1 2006-04-01 Raja R Harinath <rharinath@novell.com>
4 * report.cs (SymbolRelatedToPreviousError): Drop generic type
5 arguments before checking whether a type is reflected or not.
7 2006-04-01 Raja R Harinath <rharinath@novell.com>
10 * expression.cs (Invocation.IsApplicable): Ensure a generic method
11 definition doesn't take part in overload resolution.
12 (Invocation.IsParamsMethodApplicable): Likewise.
13 (Invocation.OverloadResolve): When replacing a reflected override
14 method with its base definition, ensure that type arguments are
17 2006-04-01 Marek Safar <marek.safar@seznam.cz>
21 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
24 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
26 2006-03-31 Marek Safar <marek.safar@seznam.cz>
28 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
31 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
32 LocalTemporary change.
34 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
36 (ClassOrStruct.DefineFieldInitializers): Implemented static field
37 initializers optimization.
38 (ClassOrStruct.TypeAttr): Moved from modifiers.
39 (Constructor.CheckBase): Don't crash when static ctor has parameters.
40 (FieldBase.ResolveInitializer): Resolves initializer.
41 (FieldBase.HasDefaultInitializer): New property.
43 * cs-parser.jay: Removed message.
45 * expression.cs (CompilerGeneratedThis): New specialization.
47 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
49 2006-03-28 Marek Safar <marek.safar@seznam.cz>
51 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
53 2006-03-27 Marek Safar <marek.safar@seznam.cz>
55 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
56 be now EnumConstants only.
58 2006-03-27 Marek Safar <marek.safar@seznam.cz>
60 * attribute.cs, driver.cs: Reset more caches.
62 2006-03-26 Marek Safar <marek.safar@seznam.cz>
64 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
66 2006-03-26 Marek Safar <marek.safar@seznam.cz>
68 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
69 for easier reuse. Updated all overrides.
70 (IntegralConstant): New base class for all integral constants.
71 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
72 of the constant range, report custom error.
73 (UIntConstant.Reduce): Fixed uint conversion.
75 * ecore.cs, literal.cs: Reduce updates.
77 2006-03-26 Marek Safar <marek.safar@seznam.cz>
81 * class.cs (Constructor.Define): Removed extra if for default ctors.
82 A patch from Atsushi Enomoto.
84 2006-03-26 Marek Safar <marek.safar@seznam.cz>
86 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
89 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
92 * convert.cs (ImplicitConversionRequired): Error message moved to
95 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
96 automatic implicit conversion of an output value.
97 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
99 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
101 (TypeOf.GetAttributableValue): Add extra handling for object type.
103 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
104 special error message.
106 2006-03-25 Marek Safar <marek.safar@seznam.cz>
108 * class.cs (Constructor.Emit): Don't crash when struct ctor is
110 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
111 compatible with MS runtime.
113 2006-03-23 Marek Safar <marek.safar@seznam.cz>
115 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
116 attribute arguments here.
118 * class.cs (Indexer.Define): The check was moved to attribute class.
120 2006-03-21 Marek Safar <marek.safar@seznam.cz>
122 * expression.cs (StringConcat.Append): Reverted back to no warning state.
124 2006-03-21 Marek Safar <marek.safar@seznam.cz>
126 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
128 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
131 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
133 * doc-bootstrap.cs : fix build.
135 2006-03-20 Marek Safar <marek.safar@seznam.cz>
137 * expression.cs (StringConcat.Append): Issue a warning when empty string
140 2006-03-20 Marek Safar <marek.safar@seznam.cz>
142 * assign.cs (CompoundAssign.ResolveSource): Removed.
144 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
147 * class.cs (TypeContainer.FindMethods): Removed.
148 (TypeContainer.CheckMemberUsage): Made static.
150 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
152 * constant.cs (CheckRange): Removed unused type argument.
153 (CheckUnsigned): Removed unused type argument.
155 * cs-parser.jay: Updated after MemberAccess clean up.
156 Uses Length for empty string test.
158 * cs-tokenizer.cs: Uses Length for empty string test.
159 (IsCastToken): Made static.
160 (is_hex): Made static.
161 (real_type_suffix): Made static.
163 * decl.cs (SetupCache): Made static.
164 (OnGenerateDocComment): Removed unused ds argument.
166 * delegate.cs (VerifyDelegate): Removed unused argument.
168 * doc.cs: Uses Length for empty string test.
170 * driver.cs: Uses Length for empty string test.
172 * enum.cs (IsValidEnumType): Made static
174 * expression.cs (EnumLiftUp): Removed unused argument.
175 (ResolveMethodGroup): Ditto.
176 (BetterConversion): Ditto.
177 (GetVarargsTypes): Ditto.
178 (UpdateIndices): Ditto.
179 (ValidateInitializers): Ditto.
180 (MemberAccess.ctor): Ditto.
181 (GetIndexersForType): Ditto.
183 * flowanalysis.cs: (MergeFinally): Removed unused argument.
185 * iterators.cs: Updated after MemberAccess clean up.
187 * location.cs: Uses Length for empty string test.
189 * namespace.cs: Uses Length for empty string test.
191 * report.cs (CheckWarningCode): Made static.
193 * statement.cs (LabeledStatement): Removed unused argument.
195 * typemanager.cs (FilterNone): Removed.
197 2006-03-18 Marek Safar <marek.safar@seznam.cz>
199 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
204 2006-03-18 Marek Safar <marek.safar@seznam.cz>
206 * cs-parser.jay.cs: __arglist is not allowed for delegates.
208 2006-03-18 Marek Safar <marek.safar@seznam.cz>
212 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
214 (AnonymousMethod.ImplicitStandardConversionExists): New method.
215 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
216 Add more error reporting; Fixed issue with params.
218 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
220 * cs-parser.jay: AnonymousMethod requires host container.
222 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
224 2006-03-18 Raja R Harinath <harinath@gmail.com>
226 * class.cs: Change 'TypeContainer ds' constructor argument to
227 'DeclSpace parent'. Some classes were missed below due to
228 different naming convention.
230 * class.cs (MemberCore.Parent): Delete. This makes the
231 ParentContainer changes below enforceable by the compiler.
233 Treat pointers to enclosing declaration space as 'DeclSpace', not
235 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
236 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
238 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
240 (Block.AddThisVariable): Likewise.
241 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
242 (AbstractPropertyEventMethod.Emit): Likewise.
243 (AbstractPropertyEventMethod.EmitMethod): Likewise.
244 (GetMethod.Define, SetMethod.Define): Likewise.
245 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
246 (DelegateMethod.EmitMethod): Likewise.
248 Fix regression test-partial-13.cs.
249 Rationalize use of PartialContainer. Ensure that the partial
250 class semantics can be tied to type-correctness, i.e., any
251 violation will cause a compile error.
252 * class.cs, const.cs: Access all fields that belong to class
253 TypeContainer via ParentContainer. Arguments of EmitContexts and
254 Resolve()-like functions still use 'Parent'.
256 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
257 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
258 (PropertyMethod.CheckModifiers): Remove unused argument.
259 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
262 2006-03-28 Raja R Harinath <rharinath@novell.com>
264 * decl.cs (DeclSpace.LookupGeneric): Update to changes.
266 2006-03-17 Raja R Harinath <harinath@gmail.com>
268 Make semantics of PartialContainer simpler.
269 * decl.cs (DeclSpace.IsPartial): Remove.
270 * class.cs (TypeContainer.IsPartial): Likewise.
271 (TypeContainer..ctor): Set PartialContainer to point to self.
272 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
273 (TypeContainer.FindNestedType): Likewise.
274 (MemberCore.ParentContainer): Simplify. Remove deprecation.
276 2006-03-17 Marek Safar <marek.safar@seznam.cz>
278 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
280 2006-03-15 Marek Safar <marek.safar@seznam.cz>
282 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
285 2006-03-15 Marek Safar <marek.safar@seznam.cz>
287 * class.cs (Operator.Define): An error for base conversion was not
290 2006-03-13 Marek Safar <marek.safar@seznam.cz>
292 A fix for #77593, #77574.
294 * class.cs (MethodCore.CheckBase): Another if for operator.
296 2006-03-18 Marek Safar <marek.safar@seznam.cz>
300 * expression.cs (VerifyArgumentsCompat): Reverted to double error
301 reporting, it's more tricky than I thought.
303 2006-03-09 Marek Safar <marek.safar@seznam.cz>
305 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
308 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
309 (DelegateCreation.ImplicitStandardConversionExists): New method for just
312 * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
315 2006-03-04 Marek Safar <marek.safar@seznam.cz>
319 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
320 (Event.Define): ditto
321 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
323 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
324 Removed redundant code and set NewSlot for Invoke method too.
326 * parameter.cs (Parameters.ctor): Add custom, type ctor.
327 (Parameters.MergeGenerated): New method. Use this method when you merge
328 compiler generated argument with user arguments.
330 2006-03-03 Marek Safar <marek.safar@seznam.cz>
332 * attribute.cs (ResolveAsTypeTerminal): Removed.
334 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
335 specialization for predefined types; 30% speed up.
336 Finally placed obsolete check to right place.
337 (Expression.ResolveType): Removed.
339 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
340 Updated after ResolveType was removed.
342 * expression.cs (Cast.ctor): Check void cast.
343 (Binary.ResolveAsTypeTerminal): Is never type.
344 (Conditional.ResolveAsTypeTerminal): Is never type.
346 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
348 2006-03-26 Marek Safar <marek.safar@seznam.cz>
350 * rootcontext.cs (ResolveCore): Removed System.INullableValue.
352 2006-03-23 Martin Baulig <martin@ximian.com>
354 * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
355 type check if either of the types is an open generic type.
357 2006-03-23 Martin Baulig <martin@ximian.com>
360 (Convert.ExplicitTypeParameterConversion): New method; implement
361 explicit type parameter conversions.
363 2006-03-23 Martin Baulig <martin@ximian.com>
365 * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
366 blindly allow all conversions if we do not have any constraints.
368 2006-02-27 Marek Safar <marek.safar@seznam.cz>
370 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
371 these two separated members to simplify the code.
372 (Attribute.Resolve): Refactored to use new fields and methods.
373 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
374 implemented obsolete attribute checking.
375 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
376 implemented obsolete checking again. It look line never ending quest ;-)
377 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
379 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
381 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
383 *class.cs (Property.Define): Add RegisterProperty call.
385 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
386 argument groups (only 2).
388 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
389 encoding expression to arguments.
390 (Expression.ExprClassToResolveFlags): Just turned to property.
392 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
393 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
394 optimized as well as implemented support for zero-length attributes.
396 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
397 Add caching of PropertyInfo's.
399 2006-02-25 Marek Safar <marek.safar@seznam.cz>
401 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
402 error multiple times.
404 2006-02-25 Marek Safar <marek.safar@seznam.cz>
406 New partial class implementation.
407 A fix for #77027, #77029, #77403
409 * attribute.cs (Attributable): Made attributes protected.
411 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
412 the replacements of ClassPart and PartialContainer.
413 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
414 (TypeContainer.AddInterface): Ditto.
415 (TypeContainer.AddPartial): The main method for partial classes. It checks
416 for errors and merges ModFlags and attributes. At the end class is added to
418 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
420 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
421 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
422 from the rest of partial classes.
423 (TypeContainer.GetClassBases): Simplified.
424 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
426 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
427 (TypeContainer.HasExplicitLayout): Uses Flags now.
428 (PartialContainer): Removed.
429 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
430 (StaticClass): Was merged with Class.
431 (Class.GetClassBases): class and static class bases are verified here.
432 (Class.TypeAttr): Added static attributes when class is static.
433 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
434 (MemberBase): In some cases we need to call parent container for partial
435 class. It should be eliminated but it's not easy now.
437 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
439 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
440 partial classed to accumulate class comments.
441 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
443 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
445 * driver.cs (MainDriver): Tree.GetDecl was removed.
447 * modifiers.cs (Modifiers): Add partial modifier.
449 * tree.cs (Tree.decl): Removed.
450 (RootTypes): Started to use this class more often for root types
453 2006-03-23 Raja R Harinath <rharinath@novell.com>
455 * generic.cs (TypeParameter.UpdateConstraints): Update
456 'constraints' if null.
458 2006-02-22 Marek Safar <marek.safar@seznam.cz>
462 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
463 external interface does not have an attribute.
465 2006-02-22 Marek Safar <marek.safar@seznam.cz>
467 Another prerequisites for new partial classs implementation.
469 * attribute.cs (Attribute.Equal): Implemented.
470 (Attribute.Emit): Changed as attributes can be applied more than twice.
471 (Attributes.Emit): Check for duplicate attributes here.
473 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
474 as a parameter, clean-up.
476 2006-02-11 Marek Safar <marek.safar@seznam.cz>
480 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
481 contains obsolete attribute check which can in some cases look for base
482 type of current class which is not initialized yet.
483 (TypeContainer.BaseType): Replacement of ptype.
485 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
487 2006-02-11 Marek Safar <marek.safar@seznam.cz>
489 First of prerequisites for new partial classs implemention.
491 * attribute.cs (Attributable): Extended by ResolveContext;
492 Attributes finally have correct context for resolving in all cases.
493 (AttachTo): Attribute owner is assigned here.
495 * codegen.cs (IResolveContext): Introduce new interface to hold
496 all information needed in resolving phase.
497 (EmitContext): Implements IResolveContext; more clean-up needed here.
499 * decl.cs (MemberCore): Implemented IResolveContext.
501 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
502 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
503 parameter.cs, statement.cs, tree.cs, typemanager.cs:
504 Refactored to use new IResolveContext instead of EmitContext; cleanup
506 2006-03-22 Raja R Harinath <rharinath@novell.com>
508 Support ParameterDefaultValueAttribute in gmcs. Also applied to
509 mcs to keep code differences small.
510 * attribute.cs (Attribute.GetParameterDefaultValue): New.
511 * typemanager.cs (parameter_default_value_attribute_type): New.
512 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
515 2006-03-22 Martin Baulig <martin@ximian.com>
518 (Nullable.NullableLiteral): Derive from `NullLiteral'.
521 (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
522 instead of the normal `NullLiteral'.
524 2006-03-21 Martin Baulig <martin@ximian.com>
527 * generic.cs (TypeManager.InferType): If `pt' is a generic
528 parameter, don't check whether `pt == at'.
530 2006-03-20 Raja R Harinath <rharinath@novell.com>
533 * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
534 (TypeParameter.Resolve): Update to change.
535 (ConstraintChecker.CheckConstraints): Resolve type-argument
536 constraints before use.
538 2006-03-16 Martin Baulig <martin@ximian.com>
541 (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
542 and don't have any instance constructors, also lookup in the base class.
543 (TypeManager.IsNullableValueType): New public method.
545 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
546 `BindingFlags.DeclaredOnly' flag and set `used_cache'.
547 (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
549 * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
550 instead of just TypeManager.IsNullableType() to determine whether
551 a lifted operator exists.
552 (UnaryMutator.DoResolve): Likewise.
553 (Conditional.DoResolve): Likewise.
554 (Binary.DoResolve): A lifted operator only exists if both operands
555 are valuetypes and at least one of them is a nullable type.
557 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
559 * iterator.cs : yield break is allowed in try statement which has
560 catch clauses. Fixed bug #77767.
562 2006-03-12 Martin Baulig <martin@ximian.com>
564 * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
565 private IsSignatureEqual() to compare types; see the comment in
566 that method; fixes #77674.
568 2006-03-10 Raja R Harinath <rharinath@novell.com>
570 * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
571 (Expression.ResolveAsTypeTerminal): Likewise.
572 * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
573 * expression.cs, generic.cs, iterators.cs: Likewise.
574 * parameter.cs, statement.cs, typemanager.cs: Likewise.
576 2006-03-09 Martin Baulig <martin@ximian.com>
578 * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
579 TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
581 2006-03-09 Martin Baulig <martin@ximian.com>
583 * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
584 `prepared' flag is set.
586 * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
587 (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
588 issues; see gtest-254.cs.
590 2006-03-07 Martin Baulig <martin@ximian.com>
592 * generic.cs (TypeManager.InferType): Allow infering
593 `IEnumerable<T>' with an array of T; see gtest-251.cs.
595 2006-03-06 Martin Baulig <martin@ximian.com>
598 (TypeManager.InferType): Fix gtest-250.cs.
601 (TypeManager.IsSubclassOf): Also check the base class.
604 (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
607 2006-03-01 Raja R Harinath <rharinath@novell.com>
610 * expression.cs (ParameterReference.DoResolveBase): Change return
612 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
616 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
619 * typemanager.cs (GetFullNameSignature): Don't nullref on
622 2006-02-16 Martin Baulig <martin@ximian.com>
625 (TypeManager.GetGenericFieldDefinition): New public method; use it
626 instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
628 2006-02-14 Martin Baulig <martin@ximian.com>
630 * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
632 2006-02-14 Martin Baulig <martin@ximian.com>
635 (TypeManager.DropGenericMethodArguments): New public method; don't
636 use GetGenericMethodDefinition() on something which is not a
639 2006-02-14 Martin Baulig <martin@ximian.com>
642 (ConstraintChecker.CheckConstraints): If a type parameter has the
643 `struct' constraint, the type must be a non-nullable valuetype.
645 2006-02-10 Martin Baulig <martin@ximian.com>
648 (TypeManager.IsOverride): Make this work for instantiated methods
649 in a generic class; fixes #77509.
650 (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
651 rather than calling it directly; fixes #77488.
653 2006-02-08 Martin Baulig <martin@ximian.com>
655 * generic.cs (ConstraintChecker.CheckConstraints): Move the error
656 reporting into CheckConstraint() so we can use the correctly
659 2006-02-08 Martin Baulig <martin@ximian.com>
661 * expression.cs (BaseAccess): Add support for generic methods.
663 * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
664 the new MethodGroupExpr.
666 2006-02-07 Martin Baulig <martin@ximian.com>
668 * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
669 also reference types; fixes #77483.
671 2006-02-07 Martin Baulig <martin@ximian.com>
674 (TypeManager.IsGenericMethod): We now return whether something is
675 an instantiated generic method (and not a generic method def).
676 (TypeManager.IsGenericMethodDefinition): New public method.
679 (TypeManager.CSharpSignature): Only include type arguments for
680 "real" generic methods, not for any instantiated method.
681 (TypeManager.GetMethodName): Likewise, but also allow generic
682 method definitions here.
684 2006-02-06 Miguel de Icaza <miguel@novell.com>
686 * codegen.cs (EmitScopeInitFromBlock): check here the
687 capture_context, there is no need to make two calls to the
690 * anonymous.cs: Add some debugging messages that might help me
691 track other instances of this problem in the future (the
692 regression of test 467).
694 * cs-parser.jay: track the variable block, as we need to initalize
695 any captured variables declared in this block for the "catch"
696 portion of the "Try" statement.
698 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
699 scope initialization for captured variables.
701 Also, move the emit for the variables after the block location has
704 2006-02-06 Marek Safar <marek.safar@seznam.cz>
706 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
708 2006-02-06 Martin Baulig <martin@ximian.com>
710 * class.cs (TypeContainer.DefineType): If we're a struct, pass
711 `TypeManager.value_type' as parent type to
712 ModuleBuilder.DefineType(). Fixes #77358.
714 2006-02-02 Miguel de Icaza <miguel@novell.com>
716 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
717 commit yesterday, the initialization for the roots is necessary.
718 What is not necessary is the scope activation.
720 2006-02-02 Raja R Harinath <rharinath@novell.com>
722 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
723 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
725 (Argument.Resolve): Remove CS0206 checks.
727 2006-02-01 Miguel de Icaza <miguel@novell.com>
729 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
730 scopes for all the roots, the scopes will now be emitted when the
731 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
733 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
734 code. This reduces a lot of existing cruft.
736 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
737 that the ScopeInfo is generated as we enter the scope, not at the
738 time of use, which is what we used to do before.
740 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
741 every time a Block is about to be emitted if we have a
744 2006-02-01 Raja R Harinath <rharinath@novell.com>
746 * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
747 attribute for mscorlib too.
749 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
751 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
753 * typemanager.cs (cons_param_array_attribute): Make private.
754 (Reset): Set it to null.
755 (InitCoreHelpers): Don't initialize it.
756 (ConsParamArrayAttribute): New. Initialize it as needed.
757 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
759 2006-01-31 Miguel de Icaza <miguel@novell.com>
761 * expression.cs: There might be errors reported during the
762 selection of applicable methods. If there are errors, do not
763 continue execution as it will lead the compiler to crash.
765 2006-01-30 Miguel de Icaza <miguel@novell.com>
767 * expression.cs: Member access is not allowed on anonymous
768 methods. Fixes #77402.
770 2006-01-30 Raja R Harinath <rharinath@novell.com>
773 * cs-parser.jay (VariableDeclaration): Don't set
774 current_array_type to null.
775 (field_declaration, event_declaration, declaration_statement):
778 2006-01-29 Raja R Harinath <harinath@gmail.com>
781 * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
783 2006-01-28 Raja R Harinath <harinath@gmail.com>
785 * typemanager.cs (GenericParameterPosition): New.
788 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
790 * doc.cs : To process "include" elements, first we should create
791 another list than XmlNodeList, because it could result in node
792 removal, which could result in that the XmlNodeList gives up
795 2006-01-25 Miguel de Icaza <miguel@novell.com>
797 * expression.cs: Introduce an error report that we were not
798 catching before. Gonzalo ran into it.
800 2006-01-23 Miguel de Icaza <miguel@novell.com>
802 A fix for bug: #76957
804 * iterators.cs (MoveNextMethod.CreateMethodHost): call
805 ComputeMethodHost before creating the method, this is a new
808 * anonymous.cs (AnonymousContainer): Now we track all the scopes
809 that this method references (RegisterScope). The actual scope
810 where the method is hosted is computed with the ComputeMethodHost
811 before we create the method.
813 Moved the Deepest routine here.
815 (AnonymousContainer.ComputeMethodHost): New routine used to
816 compute the proper ScopeInfo that will host the anonymous method.
818 (ScopeInfo): Deal with multiple roots. The problem was that we
819 did not have a unique root where all ScopeInfos could be hanged
820 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
823 Remove AdjustMethodScope which is now computed at the end. Remove
824 LinkScope which did a partial link, instead link all ScopeInfos
825 before code generation from the new "LinkScopes" routine.
827 Simplify all the Add* routines as they no longer need to maintain
828 the tree, they just need to record that they are using variables
831 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
832 routines to produce the forest of ScopeInfo trees.
834 * class.cs (TypeContainer.AppendMethod): This is just like
835 AddMethod, but ensures that an interface implementation method
836 (IEnumerable.XXX) is not inserted at the beginning of the queue of
837 methods, but at the end.
839 We use this functionality to ensure that the generated MoveNext
840 method in the iterator class is resolved/emitted before the
841 enumerator methods created.
843 This is required because the MoveNext method computes the right
844 ScopeInfo for the method. And the other methods will eventually
845 need to resolve and fetch information computed from the anonymous
849 2006-01-23 Raja R Harinath <rharinath@novell.com>
851 Improve implementation of section 14.4.2.2 (Better function member).
852 * expression.cs (Invocation.MoreSpecific): Compare all type
853 arguments before deciding if one type is more specific than
854 another. Handle array types too. Return the more specific type.
855 (Invocation.BetterFunction): Add more tie-breaking rules from
856 section 14.4.2.2. Perform "more specific" check after
857 other tie-breaking rules. Compare all parameter types before
858 choosing the "more specific" method.
860 2006-01-21 Raja R Harinath <harinath@gmail.com>
861 Carlos Alberto Cortez <calberto.cortez@gmail.com>
864 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
866 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
867 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
869 2006-01-18 Martin Baulig <martin@ximian.com>
871 * class.cs (TypeContainer.AddToMemberContainer): Use
872 `symbol.MemberName.MethodName' instead of just `symbol.Name';
875 2006-01-18 Martin Baulig <martin@ximian.com>
877 Fix #76417: a generic class may now have methods which may unify
878 for some type parameter substitutions.
880 * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
881 for methods which may unify anymore.
883 * expression.cs (Invocation.MoreSpecific): New private static
884 method; checks whether one method is more specific than another
885 according to 14.4.2.2 of the spec.
886 (Invocation.BetterFunction): Implement the tie-breaking rules from
887 14.4.2.2 of the spec: if two methods unify for some type parameter
888 substitution, we need to pick the more specific one.
890 2006-01-18 Raja R Harinath <rharinath@novell.com>
892 Fix #76656, cs0231-2.cs.
893 * cs-parser.jay (formal_parameter_list): Make error case catch
895 (parenthesized_expression_0): Add CS1026 check.
896 (invocation_expression): Remove unused { $$ = lexer.Location }.
898 2006-01-17 Raja R Harinath <rharinath@novell.com>
901 * cs-parser.jay (statement_expression): Don't list out the
902 individual statement-expressions. Convert syntax error into
905 2006-01-16 Raja R Harinath <rharinath@novell.com>
908 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
909 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
910 CheckIntermediateModification.
911 (FieldExpr.DoResolve): Add new two-argument version that
912 allows us to resolve the InstanceExpression as an lvalue.
913 The one-argument variant is now just a wrapper.
914 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
915 Resolve the lhs as an lvalue if the it has a value type.
916 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
917 from Assign.DoResolve.
918 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
919 resolved as an lvalue.
920 (PropertyExpr.DoResolve): Update.
921 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
922 has a value type. Move CS1612 check here from
923 CheckIntermediateModification.
924 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
925 * expression.cs (EmptyExpression.OutAccess): New. Used as the
926 'right_side' of a ResolveLValue on an 'out' argument.
927 (EmptyExpression.LValueMemberAccess): New. Used as the
928 'right_side' of a propagated ResolveLValue on a value type.
929 (LocalVariableReference.DoResolveBase): Recognize
930 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
932 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
933 EmptyExpression.Null.
935 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
937 * typemanager.cs : added IsGenericParameter(). In gmcs it returns
938 Type.IsGenericParameter(). Fixed bug #77183.
939 * doc.cs : it is now identical to doc.cs in mcs.
941 2006-01-16 Martin Baulig <martin@ximian.com>
943 * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
945 2006-01-16 Martin Baulig <martin@ximian.com>
947 * typemanager.cs (TypeManager.CSharpSignature): Make this work for
950 2006-01-12 Miguel de Icaza <miguel@novell.com>
952 This fixes the problem where we used ldfld instead of ldflda to
953 load the "THIS" pointer on captured parameters, when THIS is a
954 value type. See bug #77205.
956 * iterators.cs (CapturedThisReference.Emit): Pass false to
957 EmitThis (we do not need the address).
959 * codegen.cs (EmitThis): it needs to know whether we need the
960 address of `this' or not. This is used by value types.
962 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
963 every other call passes false.
965 2006-01-12 Raja R Harinath <rharinath@novell.com>
968 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
970 * expression.cs (Invocation.OverloadResolve): Update.
971 (Invocation.DoResolve): Avoid double resolution of invocation.
973 2006-01-11 Raja R Harinath <rharinath@novell.com>
976 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
977 unary negation of floating point types as 0-expr; negation cannot
978 overflow in floating point types.
981 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
982 on operands of 'void' type.
985 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
986 and ExclusiveOr for boolean constants too.
988 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
990 * expression.cs: Fix Console.WriteLine ((this = x).foo);
992 2006-01-12 Miguel de Icaza <miguel@novell.com>
994 * cs-tokenizer.cs (Position): New class used to save and restore
995 the position state in the tokenizer. Before this patch the save
996 and restore was not complete enough so the line and columns would
997 start to drift and the debugger and stack traces will get the
1000 2006-01-10 Martin Baulig <martin@ximian.com>
1003 (TypeParameter.InflateConstraints): New public method.
1005 * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
1006 constraints; fixes #77042.
1008 2006-01-10 Martin Baulig <martin@ximian.com>
1010 * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
1011 instead of the `TypeBuilder' for this "<>THIS" variable; fixes
1014 2006-01-09 Raja R Harinath <rharinath@novell.com>
1017 * expression.cs (Invocation.OverloadResolve): Replace reflected
1018 override methods with their base virtual methods, rather than
1020 * typemanager.cs (TypeManager.GetOverride): New.
1022 2005-12-21 Miguel de Icaza <miguel@novell.com>
1024 * driver.cs: Report the case of no source files and no -out:
1027 2005-12-20 Raja R Harinath <rharinath@novell.com>
1030 * expression.cs (ComposedCast.GetSignatureForError): Define.
1032 2006-01-05 Jb Evain <jbevain@gmail.com>
1034 * class.cs (Property.Define, Indexer.Define): do not tag the
1035 properties as SpecialName | RTSpecialName.
1037 2006-01-04 Miguel de Icaza <miguel@novell.com>
1039 * class.cs (MethodCore.IsDuplicateImplementation): This method was
1040 doing a low-level comparission of parameter types. It was lacking
1041 a check for __argslist.
1043 2005-12-30 Miguel de Icaza <miguel@novell.com>
1045 * expression.cs (ParameterReference.DoResolveBase): Allow
1046 reference parameters if they are local to this block.
1048 This allows the ref and out parameters of a delegate to be used in
1049 an anonymous method, for example:
1051 delegate void set (out int x);
1053 set s = delegate (out int x){
1057 This is used by functionality introduced late in the C# language.
1059 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1060 method that take ref and out parameters.
1062 Fixes #77119 which was a late change in the spec.
1064 2005-12-23 Miguel de Icaza <miguel@novell.com>
1066 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1067 parent if its the same scope. Fixes #77060.
1069 2005-12-22 Marek Safar <marek.safar@seznam.cz>
1071 * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
1073 2005-12-21 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1075 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
1076 errors 1726 for strong named assemblies with InternalsVisibleToAttribute
1077 that doesn't contain the full public key. This is a update of the
1078 friend assemblies in .Net 2.0 release.
1080 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1084 * namespace.cs (NamespaceEntry): Add extern_aliases as a
1085 ListDictionary, to contain the ExternAliasEntry entries (in
1086 addition to the NamespaceEntry.aliases hashtable). This field is
1087 shared between the original entry and its doppelganger (bodyless
1089 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1090 extern_aliases field.
1091 (NamespaceEntry.Lookup): Move the IsImplicit check after the
1092 lookup in extern_aliases.
1094 2005-12-16 Raja R Harinath <rharinath@novell.com>
1097 * class.cs (TypeContainer.Mark_HasEquals): New.
1098 (TypeContainer.Mark_HasGetHashCode): New.
1099 (ClassPart): Override them.
1100 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1102 * generic.cs (GenericMethod.DefineMembers): Update to changes.
1103 (TypeParameter.TypeParameter): Change type of 'parent' argument to
1107 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1108 'parent' argument to the base constructor.
1110 Remove all mention of TypeContainer from decl.cs.
1111 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1112 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1113 (DeclSpace.DeclSpace): Likewise.
1114 (DeclSpace.DefineMembers): Remove unused argument.
1115 * cs-parser.jay (pop_current_class): Update to changes. Simplify
1116 debugging check -- we don't care if the debug code throws an
1117 InvalidCastException instead of an InternalErrorException.
1118 * class.cs (TypeContainer.DefineMembers): Update to changes.
1119 (TypeContainer.DoDefineMembers): Likewise.
1120 (TypeContainer.GetMethods): Likewise.
1121 (PropertyMember.Define): Likewise.
1122 (MemberBase.Parent): New property that forwards to
1123 MemberCore.Parent, but ensures that we get a TypeContainer.
1124 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1125 (RootContext.PopulateTypes): Likewise. Remove special case code
1126 for !RootContext.StdLib: DefineMembers is idempotent.
1128 2005-12-13 Marek Safar <marek.safar@seznam.cz>
1130 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1132 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
1134 * doc.cs : The search for referenced namespace was insufficient to
1135 get global one as it used to do. Fixed bug #76965.
1137 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
1139 * doc.cs : check name in cref in the last phase that whether it is
1142 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1144 * cs-tokenizer.cs : reverted the latest change: it somehow broke
1147 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1149 * doc.cs : so it turned out that we cannot skip override check for
1150 interface members. Fixed bug #76954.
1152 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1154 * cs-tokenizer.cs : fixed bug #75984:
1155 - #warning and #error should not be handled when the source line
1157 - #line is not checked strictly when the source line is disabled.
1158 - #define and #undef is on the other hand checked strictly at any
1161 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
1163 * cs-tokenizer.cs : missing Location (actually, filename) in one of
1166 2005-12-15 Raja R Harinath <rharinath@novell.com>
1168 * generic.cs (TypeManager.IsGeneric): Remove unused method.
1170 * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
1173 2005-12-14 Martin Baulig <martin@ximian.com>
1175 * typemanager.cs (TypeManager.GetFullName): Make this public;
1176 `Type.Fullname' now never returns null.
1178 * class.cs (Method.Define): Use TypeManager.GetFullName() for
1179 explicit interface implementations; we're now using the same
1180 naming convention than csc does.
1182 2005-12-14 Miguel de Icaza <miguel@novell.com>
1184 * convert.cs (ExplicitConversionCore): Check the return value from
1185 ExplicitConversionCore which can return null on failure. Fixes #76914
1187 2005-12-09 Raja R Harinath <rharinath@novell.com>
1189 * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
1190 instead of IsGenericInstance.
1191 * generic.cs (TypeManager.IsEqual): Likewise. Delete redundant
1192 code that's now covered by the more general test.
1193 * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
1195 * generic.cs (DropGenericTypeArguments): New. Captures the common
1196 pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
1197 * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
1198 * generic.cs, report.cs, typemanager.cs: Likewise.
1200 2005-12-08 Martin Baulig <martin@ximian.com>
1202 * generic.cs (TypeArguments.Resolve): Added CS1547 check.
1204 * typemanager.cs (TypeManager.CSharpSignature): Include type
1205 arguments in the signature of a generic method.
1207 2005-12-07 Martin Baulig <martin@ximian.com>
1209 Add support for custom attributes on type parameters.
1211 * cs-parser.jay (type_arguments): Added `opt_attributes'.
1213 * generic.cs (TypeParameterName): New public class; we use this
1214 instead of a `string' to store the name of a type parameter, so we
1215 can also have `Attributes'.
1216 (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
1217 array instead of a `string[]' array.
1218 (TypeParameter.ctor): We now also take an `Attributes' argument.
1219 (TypeParameter.EmitAttributes): New public method; emit our
1220 `OptAttributes' here.
1221 (GenericMethod.EmitAttributes): New public method; emit the custom
1222 attributes on all our type parameters.
1224 * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
1225 our type parameters.
1226 (MethodData.Define): If we're a generic method, call
1227 EmitAttributes() on it.
1229 2005-12-07 Martin Baulig <martin@ximian.com>
1232 (ConstraintChecker): New public abstract class; move the
1233 constraint checking here from `ConstructedType' and also do
1234 constraint checking for generic methods here.
1236 * expression.cs (Invocation.OverloadResolve): Use
1237 ConstraintChecker.CheckConstraints() if we resolved to a generic
1240 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1242 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1244 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1246 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1247 (FieldBase.Initializer): Initializer is now optional.
1248 (EventField.Define): Only event field can have initializer.
1250 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1252 * const.cs (Const): Reuse initializer.
1254 * cs-parser.jay: Updated after FieldBase changes.
1255 Added current_array_type to simplify array initializers.
1257 * ecore.cs (NullCast.IsDefaultValue): Implemented.
1259 * expression.cs, iterators.cs: Updated.
1261 * namespace.cs (NamespaceEntry): Made UsingFound private.
1263 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1265 * parameterCollection.cs: Obsolete, removed.
1266 * parser.cs: Obsolete, removed.
1268 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1271 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1273 * enum.cs (Enum.Define): Set obsolete context here.
1275 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
1278 - FindDocumentedMember() now expects 1) paramList as null
1279 when "we don't have to check the number of parameters" and
1280 2) Type.EmptyTypes when "there is no arguments".
1281 - Introduced FoundMember struct to hold the exact type which was
1282 used to find the documented member (the above change broke
1283 test-xml-044; it might be better just to use DeclaringType than
1284 what MS does, like this change does, but it depends on usage.)
1286 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
1288 * doc.cs : documented member might be from DeclaringType for nested
1289 types. Fixed bug #76782.
1291 2005-12-03 Ben Maurer <bmaurer@ximian.com>
1293 * anonymous.cs: Have the param code handle leaving copies on the
1294 stack etc. Allows anonymous params to take part in the assignment
1295 code (++, +=, etc). Fixes bug #76550
1297 * expression.cs: Handle the prepare_for_load/leave_copy by passing
1298 it down to the anon code.
1300 * iterators.cs: Use dummy var here
1302 * codegen.cs: Handle new vars
1304 2005-12-01 Marek Safar <marek.safar@seznam.cz>
1307 * class.cs (MethodData.Define): Set proper Obsolete context.
1309 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1311 (FieldExpr.DoResolve): Ditto.
1313 2005-12-01 Marek Safar <marek.safar@seznam.cz>
1316 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1317 parent is not obsolete.
1319 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
1321 * doc.cs : (FindDocumentedMember) find parameterless members first
1322 and get CS0419 in the early stage. Fixed first case of bug #76727.
1324 2005-11-30 Marek Safar <marek.safar@seznam.cz>
1327 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1328 no error was reported.
1330 *expression.cs (Binary.DoResolve): left can be null.
1332 2005-12-06 Raja R Harinath <rharinath@novell.com>
1334 * class.cs (MethodCore.CheckGenericOverride): Delete unused
1335 abstract method and all overrides.
1336 * support.cs (ParameterData.GenericConstraints): Delete.
1337 (ReflectionParameters.type_params): Delete.
1338 (ReflectionParameters.ReflectionParameters): Make private.
1339 (ReflectionParameters.GetConstaints): New factory method.
1340 * generic.cs (TypeParameterDefineType): Use it.
1341 (TypeManager.GetTypeParameterConstraints): Likewise.
1343 2005-11-22 Marek Safar <marek.safar@seznam.cz>
1346 * class.cs (MethodData.Emit): Parameters should be labeled first.
1348 2005-11-21 Marek Safar <marek.safar@seznam.cz>
1351 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1353 2005-11-18 Marek Safar <marek.safar@seznam.cz>
1355 * attribute.cs (AreParametersCompliant): Moved to Parameter.
1357 * class.cs (MethodCore): Parameter clean up.
1358 (IMethodData): Added ParameterInfo.
1359 (MethodData): Parameter clean up.
1360 (Indexer.Define): Parameter clean up.
1372 * typemanager.cs: Parameter clean up.
1374 * delegate.cs (Define): Get rid of duplicated code.
1376 * expression.cs (ParameterReference): Removed useless parameters
1378 (Invocation): Ditto.
1380 * parameter.cs (ParamsParameter): New class, params specialization.
1381 (ArglistParameter): Attemp to separate arglist.
1382 (Parameter): Refactored to be reusable and faster.
1383 (Parameter.Modifier): Made understandable.
1384 (Parameters): Changed to be used as a class for `this' assembly
1385 parameters. Refactored to use new specialized classes.
1387 * support.cs (ParameterData): Added Types property.
1388 (InternalParameters): Deleted.
1390 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1392 * doc.cs : the previous patch does not actually fix the bug.
1393 PropertyInfo override check is now implemented and really fixed it.
1394 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
1396 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1398 * doc.cs : apply "override filter" also to properties.
1401 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1403 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
1404 no need to check overrides. For classes, omit those results from
1405 interfaces since they must exist in the class. Fixed bug #76726.
1407 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1409 * typemanager.cs : (GetFullNameSignature) differentiate indexers
1410 with different parameters. Fixed the second problem in #76685.
1412 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1414 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
1415 get expected 'protected' access in CheckValidFamilyAccess()).
1418 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1420 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
1421 Fixed bug #76705. CS1569 was incorrectly commented out.
1423 2005-11-23 Martin Baulig <martin@ximian.com>
1425 * generic.cs (Constraints.Define): Removed.
1426 (TypeParameter.DefineConstraints): Removed.
1427 (TypeParameter.DefineType): Call SetGenericParameterAttributes()
1428 on the GenericTypeParameterBuilder here.
1430 2005-11-23 Martin Baulig <martin@ximian.com>
1432 * typemanager.cs (TypeManager.GetProperty): Make this public.
1434 * generic.cs (Nullable.NullableInfo.ctor): Use
1435 TypeManager.GetProperty() rather than using reflection directly.
1437 2005-11-17 Martin Baulig <martin@ximian.com>
1439 * expression.cs (Indexers.GetIndexersForType): Added support for
1440 generic parameters; fixes #76587.
1442 2005-11-17 Martin Baulig <martin@ximian.com>
1445 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
1446 inherit the scope from our parent. Fixes #76653.
1448 2005-11-15 Martin Baulig <martin@ximian.com>
1450 * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
1451 instead of `ScopeTypeBuilder' to refer to the "current" type.
1452 (AnonymousMethod.CreateScopeType): Correctly create the helper
1453 class if we're inside a generic type definition.
1455 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
1457 * doc.cs : use Invocation.IsOverride() to do real override check.
1458 * expression.cs : made Invocation.IsOverride() internal.
1460 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
1462 * doc.cs : use TypeManager.FindMembers() instead of (possible)
1463 TypeBuilder.FindMembers() and filter overriden base members out.
1466 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1468 * doc.cs : ref/out parameters are represented as '@' (instead of
1469 '&' in type FullName). Fixed bug #76630 (additionally crefs).
1471 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1473 * doc.cs : when there was no '.' in cref to methods in doc comment,
1474 then parameters were missing in the output. Fixed bug #76691.
1476 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1478 * driver.cs : don't output docs when there is an error.
1481 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1484 Now it should detect indexers. Fixed primary concern in bug #76685.
1485 Fixed CS0419 message to not show the identical member signature in
1488 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1490 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
1491 instead of Type.FindMembers() since it does not handle events.
1494 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
1496 * codegen.cs: Fixed typo (speficied -> specified).
1498 2005-11-11 Marek Safar <marek.safar@seznam.cz>
1501 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
1503 2005-11-11 Marek Safar <marek.safar@seznam.cz>
1505 * attribute.cs: Changed error message.
1507 * cs-tokenizer.cs: One more check.
1509 2005-11-10 Marek Safar <marek.safar@seznam.cz>
1511 * statement.cs (Block.Resolve): Ignore empty statement.
1513 2005-11-10 Marek Safar <marek.safar@seznam.cz>
1515 * report.cs: Made error/warning methods more strict to avoid
1518 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
1519 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
1520 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
1521 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
1523 2005-11-11 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1525 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute):
1526 Use the more explicit AssemblyName.FullName instead of
1527 AssemblyName.Name to report errors.
1529 2005-11-11 Marek Safar <marek.safar@seznam.cz>
1531 * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
1534 2005-11-10 Marek Safar <marek.safar@seznam.cz>
1544 * report.cs: Fixed error reporting and typos.
1546 * generic.cs (TypeParameter.GetSignatureForError): New method.
1547 (ConstructedType.GetSignatureForError): Instead of DeclarationName.
1549 * typemanager.cs (GetFullName): Refactored.
1551 2005-11-08 Marek Safar <marek.safar@seznam.cz>
1553 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
1554 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
1556 * class.cs (TypeContainer.IsComImport): New property.
1557 (Constructor.Define): Create proper ctor for ComImport types.
1559 * expression.cs (New.CheckComImport): Fixed.
1561 2005-11-07 Miguel de Icaza <miguel@novell.com>
1563 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
1564 that a parameter has been captured does not mean that we do not
1565 have to do the rest of the processing. This fixes the second part
1566 of #76592. If there was another anonymous method capturing
1567 values in the past, the Scope would never be set for the second
1568 method that captured the same parameter.
1570 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
1571 properly manipulate the stack. Second part of fix for #76592.
1573 * expression.cs (New): Add support for invoking "new" on
1574 interfaces that have been flagged with the ComImport attribute and
1575 the CoClass. Fixes #76637
1577 * statement.cs (Try.DoEmit): When a variable is captured, do not
1578 try to emit the vi.LocalBuilder variable as it has been captured.
1579 Create a temporary variable and store the results on the
1580 FieldBuilder. Fixes #76642
1582 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1584 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
1586 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
1588 * expression.cs (Binary.DoResolve): Added && optimalization.
1590 * typemanager.cs (AddUserType): Removed useless argument.
1592 2005-11-04 Marek Safar <marek.safar@seznam.cz>
1594 * statement.cs (Block.variables): Uses ListDictionary.
1596 2005-11-03 Marek Safar <marek.safar@seznam.cz>
1599 * class.cs (PartialContainer.EmitType): Customized to emit
1600 security attributes.
1601 (ClassPart.ApplyAttributeBuilder): Transform security attribute
1602 for partial classes.
1604 2005-11-03 Marek Safar <marek.safar@seznam.cz>
1607 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
1608 access has to be fixed.
1610 * typemanager.cs (IsUnmanagedType): Wrong common field type.
1612 2005-11-01 Marek Safar <marek.safar@seznam.cz>
1615 * ecore.cs (NullCast.Reduce): Implemented.
1617 * expression.cs (ArrayCreation.CheckIndices): Correcly check
1620 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
1622 (Foreach.Resolve): Catch null properly.
1624 2005-10-29 Marek Safar <marek.safar@seznam.cz>
1626 * cs-tokenizer.cs: Warning text fix.
1628 * driver.cs: AllWarningNumbers exposed on public interface.
1630 * report.cs (): Reviewed warning numbers.
1631 (IsValidWarning): Use binary search.
1633 2005-10-29 Marek Safar <marek.safar@seznam.cz>
1635 * driver.cs: Implemeted resource visibility.
1636 (Resources): New class for code sharing between /res: and
1639 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1641 decl.cs (CurrentTypeParameters): Fixed to be public.
1643 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1645 generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
1647 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1649 gmcs.exe.sources: Use CryptoConvert.cs from corlib.
1651 2005-11-05 Kornél Pál <kornelpal@hotmail.com>
1653 * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
1655 2005-11-04 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1657 Add friend assembly access support.
1658 * typemanager.cs: assembly_internals_vis_attrs
1659 cache for friend assembly access.
1660 (TypeManager.IsFriendAssembly): New method for
1661 checking friend assembly access.
1662 (TypeManager.Error_FriendAccessNameNotMatching): New
1664 (TypeManager.CompareKeyTokens): Likewise.
1665 (TypeManager.Filter): Handle friend accessible
1668 * namespace.cs (RootNamespace.GetTypeInAssembly): Return
1669 friend accessible types.
1671 * ecore.cs (Expression.IsAccessorAccessible): Handle
1672 friend accessible properties.
1674 * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
1677 2005-10-28 Marek Safar <marek.safar@seznam.cz>
1680 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
1683 * convert (Convert.ImplicitReferenceConversion): NullCast holds
1686 * ecore.cs (NullCast): Child is contant only.
1688 * literal.cs (NullLiteral.Reduce): null can be converted to any
1691 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
1693 * driver.cs: Use Encoding.Default as default code page instead
1696 2005-10-27 Raja R Harinath <rharinath@novell.com>
1699 * expression.cs (Invocation.Error_InvalidArguments): Handle
1700 __arglist parameters.
1701 (Invocation.VerifyArgumentsCompat): Likewise.
1702 * support.cs (ReflectionParameters.GetSignatureForError): Print
1703 __arglist parameters.
1704 (InternalParamters.GetSignatureForError): Likewise.
1705 * parameter.cs (Parameters.GetSignatureForError): Likewise.
1707 2005-10-26 Marek Safar <marek.safar@seznam.cz>
1709 * attribute.cs (GetPropertyValue): Made public.
1711 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
1713 Add new property WrapNonExceptionThrows to handle 2.0 assembly
1715 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
1718 * driver.cs: Reflect method name change.
1720 * statement.cs (Try.Resolve): Warn when try has both general
1723 * typemanager.cs: runtime_compatibility_attr_type new predefined
1726 2005-10-26 Raja R Harinath <harinath@gmail.com>
1729 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
1730 treat it as an empty parameter list.
1732 2005-10-26 Raja R Harinath <rharinath@novell.com>
1735 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
1736 ResolveAsTypeStep silent.
1737 * statement.cs (Block.AddConstant): Mark block as used.
1738 (Block.ResolveMeta): Avoid piling on error messages
1739 if a constant initializer resolution fails.
1741 2005-10-25 Raja R Harinath <rharinath@novell.com>
1743 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
1745 (NamespaceEntry.VerifyAllUsing): New.
1746 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
1747 behaviour. Delegates actual resolution of alias to ...
1748 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
1749 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
1751 * driver.cs (Driver.MainDriver): Update.
1753 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
1754 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
1756 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
1758 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
1759 RootNamespace.DefineNamespacesForAll.
1761 2005-10-24 Raja R Harinath <harinath@gmail.com>
1763 * typemanager.cs (assemblies, external_aliases, modules)
1764 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
1765 (ComputeNamespaces, GetRootNamespace): Remove extra staging
1766 overhead. Move resposibility ...
1767 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
1768 * driver.cs, attribute.cs, codegen.cs: Update to changes.
1770 2005-10-23 Raja R Harinath <harinath@gmail.com>
1772 * namespace.cs (RootNamespace.all_namespaces): Renamed from
1773 cached_namespaces. Improve usage.
1774 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
1775 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
1776 Move from GlobalRootNamespace and simplify.
1777 (RootNamespace.Global): Make instance variable.
1778 (RootNamespace.RootNamespace): Add "alias name" parameter.
1779 (GlobalRootNamespace): Simplify drastically.
1780 (Namespace.Lookup): Don't use GetNamespace.
1781 * typemanager.cs (GetRootNamespace): Rename from
1782 ComputeNamespaceForAlias.
1783 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
1785 2005-10-23 Marek Safar <marek.safar@seznam.cz>
1787 * anonymous.cs (AnonymousContainer): Don't crash when container
1790 2005-10-23 Marek Safar <marek.safar@seznam.cz>
1792 * expression.cs (Binary.DoResolve): Warn when comparing same
1795 2005-10-23 Marek Safar <marek.safar@seznam.cz>
1798 * expression.cs (Binary.DoResolve): It looks like there are no
1799 convetsion rules in enum context.
1801 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1803 Add support for extern alias qualifiers.
1804 * typemanager.cs: Move some LookupTypeReflection code
1805 to namespace.cs, to have cleaner code. Added some methods
1806 to help us keep track of the extern aliased references.
1807 * driver.cs: Add suport for extern alias assemblies on command
1808 line and check for their warnings/errors. Also keep track of the
1809 extern aliased assemblies.
1810 * namespace.cs: Move the global functionality of Namespace
1811 to GlobalRootNamespace/RootNamespace. Now the global namespace
1812 is GlobalRootNamespace.Globa. Also the code moved from
1813 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
1814 Finally added LocalAliasEntry (AliasEntry before) and
1815 ExternAliasEntry, to handle alias statements.
1816 * cs-parser.jay: Add support in the grammar for extern alias
1818 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
1819 Update callings to Namespace (now in GlobalRootNamespace).
1821 2005-10-25 Martin Baulig <martin@ximian.com>
1823 * convert.cs (ImplicitTypeParameterConversion): Make base
1824 interfaces actually work; fixes #76557.
1826 2005-10-25 Martin Baulig <martin@ximian.com>
1829 (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
1830 all the type parameters; fixes #76551.
1832 2005-10-25 Martin Baulig <martin@ximian.com>
1837 (GenericMethod.ctor): Added `Expression return_type' and
1838 `Parameters parameters' arguments.
1839 (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
1840 parameter and return types to check their constraints if they're
1843 * codegen.cs (EmitContext.ResolvingGenericMethod): New public
1846 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
1847 constraints of a generic type if `ec.ResolvingGenericMethod'.
1849 * class.cs (MethodCore.DoDefineParameters): Set
1850 `ec.ResolvingGenericMethod' if we're a generic method.
1851 (MemberBase.MemberType): Likewise.
1853 2005-10-25 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1855 * typemanager.cs (TypeManager): Added
1856 TypeManager.internals_visible_attr_type to cache
1857 S.R.CompilerServices.InternalsVisibleToAttribute.
1859 * codegen.cs (AssemblyClass): Added checks for
1860 InternalsVisibleToAttribute in new method
1861 CheckInternalsVisibleAttribute () and also cache the
1862 AssemblyName in AssemblyClass.Name.
1864 2005-10-24 Martin Baulig <martin@ximian.com>
1867 (TypeManager.ExpandInterfaces): Added overloaded version which
1868 just takes a `Type[]' array.
1871 (Constraints.Resolve): Don't expand the interfaces here; ie. we
1872 just use the interfaces which were explicitly specified and not
1873 the interfaces they inherit. Fixes #76482.
1874 (TypeParameter.FindMembers): Expand the interfaces here.
1876 2005-10-21 Martin Baulig <martin@ximian.com>
1879 (Constraints.Resolve): Also resolve the actual types here.
1880 (Constraints.ResolveTypes): Just check the constraints here.
1881 Fixes #76363; see gtest-218.cs.
1883 2005-10-21 Martin Baulig <martin@ximian.com>
1886 (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
1887 instead of a `BoxedCast'; fixes gtest-217.cs.
1889 2005-10-20 Atsushi Enomoto <atsushi@ximian.com>
1891 * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
1892 1) "new()" is specified as generic parameter constraint and 2) the
1893 type is TypeBuilder and 3) the type is abstract even if it has a
1894 default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
1896 2005-10-20 Martin Baulig <martin@ximian.com>
1899 (GenericConstraints.TypeParameter): New public property.
1900 (TypeParameter.ctor): Also take a `DeclSpace' argument.
1901 (TypeParameter.DeclSpace): New public property.
1902 (TypeParameter.DefineType): Inflate the constraints if our
1903 `DeclSpace' is an `Iterator'.
1905 2005-10-19 Atsushi Enomoto <atsushi@ximian.com>
1907 * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added
1908 GenericMethod argument to compare methods' generic type arguments.
1911 2005-10-19 Martin Baulig <martin@ximian.com>
1913 * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
1914 not ResolveType() when resolving the base type, so we're not
1915 checking the constraints here.
1916 (TypeContainer.ResolveType): Call ResolveType() on our base_type
1919 2005-10-19 Martin Baulig <martin@ximian.com>
1921 * generic.cs (ConstructedType.CheckConstraints): Committing
1922 untested fix for #76441.
1924 2005-10-18 Raja R Harinath <rharinath@novell.com>
1927 * class.cs (TypeContainer.DefineType): Move updating of
1928 topological sort earlier in the code.
1929 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
1931 2005-10-18 Marek Safar <marek.safar@seznam.cz>
1934 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
1936 * constant.cs (Constant.TryReduce): Moved from Cast class.
1937 (Reduce): Made little bit more OO and fixed missing conversions.
1939 * ecore.cs (Reduce): Implemented.
1940 (Binary.EnumLiftUp): New method to upgrade values to enum values.
1942 * literal.cs (Reduce): Implemented.
1944 * class.cs: Reverted Miguel's wrong commit.
1946 2005-10-14 Miguel de Icaza <miguel@novell.com>
1948 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
1950 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
1952 * cs-parser.jay, expression.cs : CS0214 was missing error location
1953 for constants. Fixed bug #76404.
1955 2005-10-10 Raja R Harinath <rharinath@novell.com>
1957 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
1959 (PropertyExpr.EmitCall): Likewise.
1960 * expression.cs (Invocation.EmitArguments): Handle case where
1962 (Invocation.EmitCall): Avoid allocating temporary variable if
1963 there are no arguments.
1965 2005-10-11 Marek Safar <marek.safar@seznam.cz>
1968 * convert.cs (ExplicitConversionCore): Fixed object->enum
1971 2005-10-07 Raja R Harinath <rharinath@novell.com>
1974 * convert.cs (ImplicitConversionStandard): Move conversion of
1975 void* to arbitrary pointer types ...
1976 (ExplicitConversionStandard): .. here.
1977 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
1978 error to always print typenames.
1980 2005-10-07 Raja R Harinath <rharinath@novell.com>
1982 * convert.cs (GetConversionOperator): Rename from
1983 GetConversionOperators. Move operator selection code from ...
1984 (UserDefinedConversion): ... here.
1986 2005-10-06 Marek Safar <marek.safar@seznam.cz>
1988 * convert.cs (ExplicitConversionCore): Removed duplicate enum
1991 2005-10-05 Marek Safar <marek.safar@seznam.cz>
1993 * assign.cs (Assign.DoResolve): Error method changed.
1995 * cfold.cs (DoConstantNumericPromotions): Error method changed.
1997 * const.cs (ResolveValue): Reset in_transit immediately.
1999 * constant.cs: Error method changed.
2001 * convert.cs: Removed useless location parameter.
2002 (ExplicitNumericConversion): Don't do double enum check.
2003 (ExplicitConversionCore): Renamed from ExplicitConversion.
2004 (ExplicitUnsafe): Extracted from ExplicitConversion.
2005 (ExplicitConversion): Uses for error reporting.
2007 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2009 (ResolveBoolean): Uses common error method.
2010 (CastToDecimal): Get rid of ec.
2011 (CastFromDecimal): Optimized.
2012 (ConvCast): Get rid of ec.
2014 * enum.cs (ResolveValue): Reset in_transit immediately.
2015 (Emit): Return after first error.
2017 * expression.cs: Convert changes.
2019 * literal.cs: Error method changed.
2021 * statement.cs: Error method changed.
2023 2005-10-06 Raja R Harinath <rharinath@novell.com>
2025 Fix gtest-131.cs and gtest-211.cs.
2026 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
2027 Only emit code for a label if it is used. Unreachable code can
2028 violate ECMA evaluation stack invariants.
2030 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2032 * anonymous.cs: Implemented ExprClassName.
2034 * assign.cs (Assign.DoResolve): Don't chrash when type is not
2037 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2040 * class.cs (StaticClass.DefineContainerMembers): Report protected
2043 * codegen.cs: if(ed) PRODUCTION.
2045 * convert.cs (Error_CannotImplicitConversion): Better error
2048 * cs-parser.jay: More error checks.
2050 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2052 * driver.cs (CSCParseOption): Enabled wrong option check.
2054 * ecore.cs (Expression.ExprClassName): Turned to property.
2055 (MemberExpr.CheckIntermediateModification): For checking boxed
2056 value types modification.
2058 * statement.cs (Fixed.Resolve): Expression type must be
2059 convertible to fixed type.
2060 (CollectionForeach.GetEnumeratorFilter,TryType):
2061 Small refactoring for easier error checking.
2063 2005-09-26 Marek Safar <marek.safar@seznam.cz>
2065 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2068 * class.cs (GeneratedBaseInitializer): New class for customization
2069 compiler generated initializers.
2070 (MemberBase.DoDefine): Check Obsolete attribute here.
2071 (FieldMember.DoDefine): Ditto.
2073 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2076 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2077 (MemberCore.GetObsoleteAttribute): Removed argument.
2078 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2079 (MemberCore.CheckObsoleteType): New helper.
2083 * statement.cs: Updates after MemberCore changes.
2085 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2086 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2088 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2089 obsolete attribute for compiler construct.
2090 (As.DoResolve): Cache result.
2092 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2094 2005-10-01 Miguel de Icaza <miguel@novell.com>
2096 * expression.cs (Probe): instead of having a "Type probe_type"
2097 keep the extra information as a TypeExpr probe_type_expr since the
2098 "As" operator needs to perform some type checks.
2100 * (As.DoResolve): If the type is a type parameter, ensure that it
2101 is constrained by a class.
2103 2005-09-22 Miguel de Icaza <miguel@novell.com>
2105 * statement.cs (Lock): Use the TemporaryVariable class instead of
2106 manually using local variables as those do not work when variables
2109 * ecore.cs: Moved the TemporaryVariable class from being a nested
2110 class inside Foreach to be a public class that can be employed in
2113 2005-09-19 Marek Safar <marek.safar@seznam.cz>
2115 * cs-parser.jay: interface_accessors replaced by
2116 accessor_declarations.
2118 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2121 * statement.cs (GotoCase.Resolve): Convert null constant to
2123 (SwitchLabel.ResolveAndReduce): Ditto.
2124 (SwitchLabel.NullStringCase): Custom null stamp.
2125 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2127 typemanager.cs (CSharpSignature): Don't skip first argument
2130 2005-09-16 Marek Safar <marek.safar@seznam.cz>
2132 * cfold.cs, constant.cs, convert.cs, ecore.cs,
2133 expression.cs, iterators.cs, literal.cs: Store constants and
2136 * class.cs (MemberBase.ShortName): Pass location.
2138 * cs-parser.jay: Some location fixes.
2140 * ecore.cs (Expression.Location): Made virtual.
2142 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2145 * const.cs (Const.ResolveValue): Check for assigning non-null
2146 value to reference type.
2148 2005-09-26 Raja R Harinath <rharinath@novell.com>
2151 * expression.cs (This.VerifyFixed): In a value type T, the type of
2152 'this' is T&, iow, 'this' is either an out or ref parameter. In a
2153 value type R, 'this' is treated as a value parameter.
2155 2005-09-05 Miguel de Icaza <miguel@novell.com>
2157 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2158 if the underlying types are the same, otherwise we need to produce
2159 code that will do the proper cast.
2161 This was exposed by Marek's constant rewrite which produced
2162 invalid code for the call site:
2165 void Method (X v) {}
2169 This fixes test-49.cs
2171 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2173 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2174 Type/Object should be allowed as well. Fixed bug #75968.
2176 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2178 * expression.cs : (Binary.DoResolve): when one is enum constant and
2179 another is constant 0, then return enum one *as enum type*.
2182 2005-10-04 Martin Baulig <martin@ximian.com>
2184 * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
2185 `SetMemberIsUsed()' work for generics, too.
2187 2005-10-04 Martin Baulig <martin@ximian.com>
2189 * expression.cs (DelegateInvocation.EmitStatement): Make this work
2190 for corlib. Fixes #75691.
2192 2005-09-28 Marek Safar <marek.safar@seznam.cz>
2195 * driver.cs: Fix compilation files with full root path.
2197 2005-09-25 Miguel de Icaza <miguel@novell.com>
2199 * report.cs (SymbolRelatedToPreviousError): Format the output so
2200 it does not use an open parenthesis that is never closed.
2202 * driver.cs: Follow coding guidelines
2204 2005-09-18 Miguel de Icaza <miguel@novell.com>
2206 * driver.cs: Set InEmacs based on the environment variable EMACS.
2208 * location.cs (InEmacs): in this mode, do not report column
2209 location as it confuses Emacs.
2211 2005-10-03 Raja R Harinath <rharinath@novell.com>
2213 * support.cs (SeekableStreamReader.Position): Don't error out when
2214 the requested position is just beyond the end of the current
2217 2005-09-28 Raja R Harinath <rharinath@novell.com>
2219 * support.cs (SeekableStreamReader): Simplify drastically. Don't
2220 try to keep in sync with the byte count of the underlying Stream.
2221 However, this limits us to a window size of 2048 characters: i.e.,
2222 the maximum lookahead of our lexer/parser can be 2048 characters.
2224 2005-09-22 Martin Baulig <martin@ximian.com>
2226 * driver.cs: Removed a debugging FIXME.
2228 2005-09-21 Raja R Harinath <rharinath@novell.com>
2230 * cs-parser.jay (type_arguments): Add CS1644 check.
2231 * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
2233 2005-09-15 Raja R Harinath <rharinath@novell.com>
2235 * Makefile (PROGRAM): Make profile specific.
2236 (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
2237 the current directory.
2240 * expression.cs (Invocation.EmitCall): Remove optimization on
2241 this_call since it doesn't handle 'this' being a value type.
2243 2005-09-05 Geoff Norton <gnorton@customerdna.com>
2245 * driver.cs: Ensure file handles are closed after parsing
2247 2005-09-05 Miguel de Icaza <miguel@novell.com>
2249 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2250 if the underlying types are the same, otherwise we need to produce
2251 code that will do the proper cast.
2253 This was exposed by Marek's constant rewrite which produced
2254 invalid code for the call site:
2257 void Method (X v) {}
2261 This fixes test-49.cs
2263 2005-09-05 Martin Baulig <martin@ximian.com>
2265 * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
2266 instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
2268 * cs-parser.jay (delegate_declaration): Small fix for #75852.
2270 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2272 * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
2273 to be a pointer type due to the spec 25.2, so check if declaring
2274 type is generic type definition. Fixed bug #75772.
2276 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2279 * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
2280 both types are not defined by methods.
2281 * expression.cs : (Invocation.IsApplicable): it should work when
2282 the argument type is equal to the parameter type, not only when
2283 ImplicitConversionExists() returns true.
2285 2005-09-02 Raja R Harinath <rharinath@novell.com>
2287 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2291 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2292 flow-branching for LocalVariableReferences in case we were invoked
2293 from a MemberAccess.
2294 * expression.cs (LocalVariableReference.VerifyAssigned): New.
2296 (LocalVariableReference.DoResolveBase): ... this.
2297 (MemberAccess.Resolve): Do the check that was disabled during
2300 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
2303 (PartialContainer.Create): check abstract/sealed/static strictly
2304 but abstract/sealed can exist only at one side. Fixed bug #75883.
2306 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
2309 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2310 specified, don't default to UnmanagedType.I4.
2312 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
2314 * expression.cs : conditional operator should check possibly
2315 incorrect assign expression. Fixed bug #75946.
2317 2005-08-30 Raja R Harinath <rharinath@novell.com>
2320 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2321 (ScopeInfo.EmitScopeType): Use it to construct field names from
2322 names of captured locals.
2325 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2326 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2327 Pass 'target_type' to BoxedCast. Don't default to 'object'.
2328 (ExplicitConversion): Remove enum cases already handled by
2329 implicit conversion. Move implicit conversion check to the beginning.
2330 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2331 * expression.cs (ArrayCreation.EmitDynamicInitializers):
2332 Don't treat System.Enum as a struct.
2334 2005-08-30 Jb Evain <jbevain@gmail.com>
2336 * attribute.cs: handles as expression in parameters.
2338 2005-08-30 Raja R Harinath <rharinath@novell.com>
2341 * class.cs (TypeContainer.VerifyClsName): Don't use a
2342 PartialContainer when verifying CLS compliance.
2343 (AbstractPropertyEventMethod): Set Parent here, ...
2344 (PropertyMethod): ... not here.
2346 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
2348 * attribute.cs : escaped attribute name should not be allowed to be
2349 resolved (e.g. @class as classAttribute). Fixed bug #75930.
2351 2005-08-29 Raja R Harinath <rharinath@novell.com>
2354 * convert.cs (ImplicitStandardConversionExists): Allow zero also
2355 when converting a long constant to unsigned long.
2356 * expression.cs (Invocation.OverloadResolve): Add sanity check to
2357 detect where IsApplicable and VerifyArgumentsCompat disagree.
2359 2005-08-29 Raja R Harinath <rharinath@novell.com>
2360 and Carlos Alberto Cortez <carlos@unixmexico.org>
2363 * class.cs (TypeContainer.CanElideInitializer): New helper.
2364 (TypeContainer.EmitFieldInitializers): Use it to determine if we
2365 can safely emitting the initializer of a field.
2367 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2369 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2370 allowed inside a switch (without loop). Fixed bug #75433.
2372 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
2374 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2375 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2377 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2379 * driver.cs : kinda reverting the default encoding changes (not exact
2380 revert since I noticed that "codepage:reset" might not work fine).
2382 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2384 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2385 Location. Now getter and setter store location correctly.
2386 (errors/cs0111-12.cs now reports the expected location.)
2388 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2390 * driver.cs : Use default encoding on the environment.
2391 Removed (now that) extra parameter for SeekableStreamReader.
2392 * support.cs : (SeekableStreamReader) third .ctor() argument for
2393 StreamReader is not required (always true). preamble size could
2394 be acquired in simpler and safe way.
2396 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
2398 * cs-parser.jay: report CS0642 at warning level 3
2399 and report CS0642 for an if else statement also
2400 fixes bug #74745. Patch by John Luke (and a bit
2402 Removed extra CS0642 warning check for "while",
2404 * statement.cs: In Block.Resolve(), CS0642 check
2405 is reimplemented to check a sequence of an empty
2406 statement and a block.
2408 Both fix bug #66777.
2410 2005-08-24 Marek Safar <marek.safar@seznam.cz>
2412 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2413 detection until I fix it.
2415 * cs-tokenizer.cs: Changed error message.
2417 * cs-parser.jay: Fixed 2 error locations.
2419 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2420 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2423 * enum.cs (GetSignatureForError): Fixed.
2425 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2429 * typemanager.cs (RegisterProperty): Removed.
2431 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2433 2005-08-24 Raja R Harinath <rharinath@novell.com>
2436 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2437 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2439 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2441 * expression.cs : tiny fix is required for not warning positive ulong.
2444 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2446 * expression.cs : add CS0652 check for constant and integral
2447 expression. Fixed bug #53974.
2449 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2451 * expression.cs : in DoNumericPromotions(), check if there is implicit
2452 conversion overload for string (to check CS0034). Fixed bug #52492.
2454 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2456 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2458 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2460 * ecore.cs : report location when it is *not* Null.
2462 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2468 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2469 correctly. Fixed bug #75721.
2471 2005-08-23 Raja R Harinath <rharinath@novell.com>
2473 * support.cs (SeekableStreamReader.Position): Avoid an expensive
2474 loop that performs 'min (pos, char_count)'.
2477 * expression.cs (Unary.ResolveOperator): Don't discard implicit
2478 converted value in Operator.OnesComplement.
2480 2005-08-22 Ben Maurer <bmaurer@ximian.com>
2482 * anonymous.cs: If the anon method is pulled into a helper class,
2483 it needs to be `internal' not `private'. Fixes runtime behavior on
2486 2005-08-17 Marek Safar <marek.safar@seznam.cz>
2489 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2492 2005-08-16 Marek Safar <marek.safar@seznam.cz>
2494 The big constants rewrite
2495 Fix #75746, #75685 and more
2496 As a side effect saved 1MB for MWF ;-)
2498 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2499 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2500 enum based for corlib compilation.
2502 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2505 * class.cs (FixedField.Define): Use ResolveAsConstant.
2507 * const.cs (IConstant): Interface constants and enums.
2508 (Const.ResolveValue): New method for constant resolvning.
2509 (ExternalConstant): Constants from imported assemblies.
2511 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2512 conversion; like enums.
2513 (Constant.ToType): Converts this constant to different type.
2514 (Constant.Increment): Adds 1.
2516 * convert.cs (ImplicitConversionRequired): Simplified.
2518 * cs-parser.jay: Create EnumMember directly.
2520 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
2522 * doc.cs (GenerateEnumDocComment): Removed.
2524 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
2525 (ConvertIntLiteral): Removed.
2526 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
2528 * enum.cs (EnumMember): Implement IConstant.
2529 (Enum.IsValidEnumConstant): Removed.
2530 (Enum.GetNextDefaultValue): Removed.
2531 (Enum.FindMembers): Updated.
2532 (Enum.GenerateDocComment): Iterate enum members.
2534 * expression.cs (Cast.TryReduce): Handle enums correctly.
2535 (New.Constantify): Made public.
2536 (MemberAccess.DoResolve): Removed contant specific if(s).
2538 * literal.cs (NullLiteral): Implement new abstract methods.
2540 * statement.cs (GotoCase.Resolve): Use new constant methods.
2541 (SwitchLabel.ResolveAndReduce): Use new constant methods.
2543 * typemanager.cs (LookupEnum): Removed.
2544 (IsEnumType): Fixed to work with corlib.
2545 (RegisterConstant): Removed.
2546 (LookupConstant): Removed.
2547 (GetConstant): Changed to work with IConstant.
2549 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
2551 * location.cs : Fixed overflown (>255) column number.
2553 2005-08-03 Raja R Harinath <rharinath@novell.com>
2555 First cut of the qualified-alias-member feature.
2556 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
2558 * cs-parser.jay (DOUBLE_COLON): New token.
2559 (namespace_or_type_name): Add rule for recognizing
2560 qualified-alias-members.
2561 (primary_expression): Likewise.
2562 (element_access): Allow QualifiedAliasMember as a possible
2563 type-bearing expression.
2564 (local_variable_type, local_variable_pointer_type): Likewise.
2565 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
2566 aliases in the current and enclosing namespace declarations.
2567 (NamespaceEntry.UsingAlias): Add CS0440 warning.
2568 * decl.cs (MemberName.is_double_colon): New.
2569 (MemberName.MemberName): Add new constructor for alias-member.
2570 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2571 * expression.cs (QualifiedAliasMember): New expression type.
2573 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2575 * location.cs : it borked when no argument was specified.
2577 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2579 * location.cs : tiny ToString() format fix.
2581 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2583 * statement.cs : oops, it was missing.
2585 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2587 A set of fixes for precise line/column location.
2590 "token" field now holds a file/line "delta", a line number offset
2591 from the segment, and a column number. See also:
2592 http://lists.ximian.com/pipermail/mono-devel-list/2004-
2593 December/009508.html
2594 Removed static IsNull. Use instance IsNull property instead.
2596 For some tokens it stores Location. For Identifier it stores
2597 LocatedToken which is a pair of string name and location.
2598 Column numbers are adjusted only at getChar().
2600 Use Location.ToString() for reporting (it now contains column).
2602 Largely modified to use LocatedToken instead of
2603 string (IDENTIFIER), and to acquire Location from some tokens.
2604 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2605 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2607 Now MemberName holds Location. DeclSpace.ctor() receives Location
2608 as a parameter. Removed extra parameters to all derived classes.
2609 Replaced Location.IsNull() with instance property.
2610 * assign.cs, expression.cs :
2611 Added .ctor() overload that omits Location.
2613 Added "nameEscaped" flag that indicates the identifier was escaped
2614 in the source file. This fixes bug #57047.
2616 2005-09-02 Martin Baulig <martin@ximian.com>
2618 * class.cs: Make CS3005 a warning, not an error.
2620 2005-08-02 Marek Safar <marek.safar@seznam.cz>
2622 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2623 New method, looking for lo-case imported cls type.
2625 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2628 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2630 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2632 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2634 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2636 Optimized to save 3.5 MB for SWF compilation.
2638 2005-08-01 Marek Safar <marek.safar@seznam.cz>
2640 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2641 (PartialContainer.Create): Moved logic AddToContainer.
2642 (PartialContainer.MarkForDuplicationCheck): Shares name.
2644 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2647 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
2649 (Namespace.GetSignatureForError): New method.
2651 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
2652 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
2654 2005-08-01 Raja R Harinath <rharinath@novell.com>
2657 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
2658 member lookup rather than qualifier_type, since qualifier_type can
2661 2005-08-01 Marek Safar <marek.safar@seznam.cz>
2663 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
2666 2005-07-31 Miguel de Icaza <miguel@novell.com>
2668 * statement.cs: Copy the local exception into the exception
2669 captured local. Fixes 75674
2671 2005-07-31 Raja R Harinath <harinath@gmail.com>
2674 * expression.cs (Invocation.OverloadResolve): Don't report error
2675 CS1501 if error CS1502 has been reported.
2676 (New.DoResolve): Delegate CS1501 reporting to
2677 Invocation.OverloadResolve.
2680 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
2681 invariant-meaning-in-block property in an enclosing block if
2684 2005-07-29 Marek Safar <marek.safar@seznam.cz>
2686 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
2687 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
2688 (Switch.CheckSwitch): Just save 50kb for SWF.
2690 2005-07-27 Martin Baulig <martin@ximian.com>
2692 * anonymous.cs (CaptureContext.AddField): Added
2693 `AnonymousContainer am' argument; compute its toplevel scope if
2694 it's not already computed. Fixes #75649.
2696 2005-07-26 Raja R Harinath <rharinath@novell.com>
2699 * class.cs (Constructor.Emit): Reset block to null if the block
2702 2005-07-25 Marek Safar <marek.safar@seznam.cz>
2704 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
2706 2005-07-25 Marek Safar <marek.safar@seznam.cz>
2708 * class.cs (MethodData.Define): Check whether accessor implementing
2709 interface is public.
2711 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
2713 2005-07-22 Marek Safar <marek.safar@seznam.cz>
2716 * namespace.cs (LookupType): Moved same type check to...
2718 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
2721 2005-07-21 Raja R Harinath <rharinath@novell.com>
2723 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
2724 already found a typebuilder.
2725 * class.cs (MethodCore.IsDuplicateImplementation): Compare
2726 MemberNames, not strings.
2728 * const.cs (Error_ExpressionMustBeConst):
2729 Rename from Error_EpressionMustBeConst.
2730 * const.cs, class.cs, statement.cd: Update.
2732 2005-07-21 Marek Safar <marek.safar@seznam.cz>
2736 * const.cs (Const.LookupConstantValue): Report missing contant expression
2738 (Error_EpressionMustBeConstant): Only one error method.
2740 * class.cs, statement.c: Updated.
2742 2005-07-20 Raja R Harinath <rharinath@novell.com>
2744 * statement.cs (Block.Flags): Add back HasVarargs.
2745 (Block.flags): Make protected.
2746 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
2748 * typemanager.cs (types, typecontainers, user_types): Remove.
2749 (UserTypes, TypeContainers): Likewise.
2750 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
2751 (CleanUp, Reset): Update.
2752 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
2753 (GetNestedType): Use Type.GetNestedType.
2754 (CoreLookupType): Take two arguments, the namespace and the
2755 basename of the type. Update to use the Namespace.Lookup
2757 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
2758 (RealMemberLookup): Use IsNestedChildOf instead of playing with
2759 string concatenation and substring matches.
2760 * class.cs, enum.cs, delegate.cs: Update to changes.
2762 2005-07-20 Marek Safar <marek.safar@seznam.cz>
2764 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
2765 Expression and made virtual.
2767 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
2768 (ImplicitStandardConversionExists): Fixed `byte' typo ?
2770 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
2772 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
2775 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
2778 2005-07-18 Marek Safar <marek.safar@seznam.cz>
2781 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
2782 AssemblyCultureAttribute is not used on executable.
2785 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
2787 2005-07-16 Raja R Harinath <rharinath@novell.com>
2790 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
2791 New. Reports CS0252/CS0253.
2792 Mostly taken from preliminary patch by Duncak Mak.
2793 (Binary.DoResolveOperator): Store results of operator lookup.
2794 Use them to detect if we need to warn about unintended reference
2797 2005-07-15 Raja R Harinath <rharinath@novell.com>
2800 * namespace.cs (Namespace.Lookup): Add back location parameter.
2801 (Namespace.LookupType): Add CS0436 report. Add location parameter.
2802 * delegate.cs, ecore.cs, expression.cs: Update to changes.
2804 * codegen.cs (EmitContext.DeclSpace): Make readonly.
2805 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
2806 (Namespace.LookupType): ... this.
2807 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
2809 * typemanager.cs (LookupTypeReflection): Remove buggy code that
2810 purported to handle pointers.
2811 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
2814 2005-07-15 Marek Safar <marek.safar@seznam.cz>
2816 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2819 2005-07-15 Raja R Harinath <rharinath@novell.com>
2821 * namespace.cs (Namespace.Lookup): Drop location parameter.
2822 (NamespaceEntry.LookupAlias): Remove. Merge into ...
2823 (NamespaceEntry.Lookup): ... this.
2824 (NamespaceEntry.Error_AmbiguousTypeReference):
2825 Move here from DeclSpace.
2826 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
2828 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
2829 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
2830 Move to NamespaceEntry.
2831 * delegate.cs, expression.cs: Update to changes.
2833 2005-08-31 Martin Baulig <martin@ximian.com>
2835 Committing a patch from Atsushi Enomoto for #75850.
2837 * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
2838 Prefer a generic enumerator over a non-generic one.
2840 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
2842 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2843 * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2845 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2847 * driver.cs : reverting default encoding change as well as mcs.
2849 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2851 * driver.cs, support.cs : merged r48826.
2853 > could you integrate your mcs changes to gmcs otherwise
2854 > gmcs cannot compile some files.
2856 2005-08-20 Martin Baulig <martin@ximian.com>
2858 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2859 scope if we don't already have it.
2861 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2862 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2865 2005-07-31 Miguel de Icaza <miguel@novell.com>
2867 * statement.cs: Copy the local exception into the exception
2868 captured local. Fixes 75674
2870 2005-07-15 Marek Safar <marek.safar@seznam.cz>
2872 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2875 2005-08-12 Martin Baulig <martin@ximian.com>
2877 * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
2878 for nested types here to avoid hitting the cache too early.
2880 2005-08-09 Miguel de Icaza <miguel@novell.com>
2882 * enum.cs: On the new compiler CLS error 3005 is now a warning not
2885 2005-08-03 Martin Baulig <martin@ximian.com>
2887 Make iterators in generic methods work; see gtest-191.cs.
2890 (Constraints.Resolve): Protect against being called twice.
2893 (TypeContainer.GetClassBases): Make this `protected virtual'.
2895 * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
2896 (Iterator.GetClassBases): Override this and compute the base
2898 (Iterator.DefineNestedTypes): If we're a generic method, all our
2899 method type parameters become class type parameters on the proxy
2903 (ToplevelBlock.Parameters): Make this a property, not a field.
2904 (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
2906 2005-08-03 Martin Baulig <martin@ximian.com>
2908 * typemanager.cs (TypeManager.IsSubclassOf): Use
2909 `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
2910 (TypeManager.GetFullName_recursed): Improved.
2912 2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2915 * ecore.cs (Expression.IsAccessorAccessible): Change the check for
2916 Private accessor case, using TypeManager.IsPrivateAccessible instead of
2917 invocation_type == mi.DeclaringType, since the first one also checks
2918 other condition used by generic instances.
2920 2005-07-27 Martin Baulig <martin@ximian.com>
2922 * anonymous.cs (CaptureContext.AddField): Added
2923 `AnonymousContainer am' argument; compute its toplevel scope if
2924 it's not already computed. Fixes #75649.
2926 2005-07-14 Marek Safar <marek.safar@seznam.cz>
2928 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
2929 CheckAttributeType and refactored.
2930 (Attribute.ResolvePossibleAttributeType): Changed to reuse
2931 ResolveAsTypeTerminal error handling.
2932 (ResolveAsTypeTerminal): Introduced because of global attributes extra
2934 (GetSignatureForError): Print errors in same way.
2937 * codegen.cs: Reflect attribute GetSignatureForError change.
2940 * expression.cs: Add silent parameter to ResolveAsTypeStep.
2942 * namespace.cs (UsingEntry): Refactored to make fields private.
2945 statement.cs: Error_UnexpectedKind has extra parameter.
2947 2005-07-14 Raja R Harinath <rharinath@novell.com>
2949 * ecore.cs (IAlias): Remove.
2950 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
2951 that implement the interface.
2952 * namespace.cs (Namespace): Likewise.
2953 (Namespace.declspaces): Renamed from 'defined_names'.
2954 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
2955 DeclSpace instead of an IAlias.
2956 * tree.cs (Tree.AddDecl): Update.
2958 2005-07-12 Raja R Harinath <rharinath@novell.com>
2960 * statement.cs (Block.Flags); Remove HasVarargs.
2961 (Block.HasVarargs): Move to ToplevelBlock.
2962 (Block.ThisVariable, Block.AddThisVariable): Likewise.
2963 (Block.Variables): Make protected. Initialize variable hashtable
2965 (Block.AddVariable): Update.
2966 (Block.Resolve): Update to changes.
2967 (ToplevelBlock.HasVarargs): New boolean.
2968 (ToplevelBlock.ThisVariable): Move here from Block.
2969 (ToplevelBlock.AddThisVariable): Likewise.
2970 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
2971 * expression.cs (This.ResolveBase): Update to changes.
2972 (ArglistAccess.DoResolve): Likewise.
2974 2005-07-11 Marek Safar <marek.safar@seznam.cz>
2977 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
2979 * class.cs (TypeContainer.VerifyMembers): Distinguish between
2980 not used and not used & assigned.
2981 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
2983 2005-07-11 Marek Safar <marek.safar@seznam.cz>
2986 * expression.cs (Is.DoResolve): null is never provided type.
2988 2005-07-08 Marek Safar <marek.safar@seznam.cz>
2991 * cs-parser.jay: Less strict event error rule to catch more errors.
2993 2005-07-11 Martin Baulig <martin@ximian.com>
2995 * generic.cs (ConstructedType.CheckConstraints): Improve the check
2996 for the constructor constraint: we do not only have to check
2997 whether the class has a public constructor, but also ensure that
2998 it's parameterless. Fixes #75492.
3000 2005-07-11 Martin Baulig <martin@ximian.com>
3002 * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
3003 between type parameters if they either have the reference type
3004 constraint or the class constraint.
3006 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
3008 * generic.cs: Use MakeGenericType instead of BindGenericParameters.
3010 2005-07-07 Marek Safar <marek.safar@seznam.cz>
3013 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3014 (ExtractSecurityPermissionSet): Cope with self referencing security
3015 attributes properly.
3017 * driver.cs (SetOutputFile): Made public property OutputFile.
3019 2005-07-07 Raja R Harinath <rharinath@novell.com>
3022 * class.cs (TypeContainer.first_nonstatic_field): Rename from
3023 has_nonstatic_fields. Make into a FieldBase pointer.
3024 (TypeContainer.AddField): Add CS0282 check.
3025 (TypeContainer.EmitType): Update.
3027 2005-07-06 Miguel de Icaza <miguel@novell.com>
3029 * cs-tokenizer.cs (consume_identifier): Do not create strings to
3030 compare if they start with __.
3032 2005-07-06 Raja R Harinath <rharinath@novell.com>
3034 * statement.cs (Switch.SwitchGoverningType): Only look at
3035 UserCasts that don't need implicit standard conversions to one of
3036 the allowed switch types (Fixes test-322.cs).
3037 (LocalInfo.Resolve): Re-enable sanity-test.
3039 2005-07-06 Marek Safar <marek.safar@seznam.cz>
3041 * cs-tokenizer.cs (consume_identifier): Detect double undescores
3043 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3045 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3047 2005-07-06 Raja R Harinath <rharinath@novell.com>
3050 * ecore.cs (SimpleName.GetSignatureForError): Add.
3051 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3052 (MemberAccess.GetSignatureForError): Add.
3054 2005-07-05 Marek Safar <marek.safar@seznam.cz>
3056 The big error and warning messages review.
3086 * typemanager.cs: Updated.
3088 * class.cs: (MethodCore.SetYields): Moved here to share.
3089 (PropertyMethod.Define): Moved iterator setup here.
3091 * iterators.cs: Add orig_method to have full access to parent
3094 2005-07-05 Raja R Harinath <rharinath@novell.com>
3096 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3097 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3098 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3099 variable of struct type.
3100 * expression.cs (Unary.ResolveOperator): Update to change.
3101 (Indirection.VerifyFixed): Likewise.
3102 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3103 (ParameterReference.VerifyFixed): Value parameters are fixed.
3104 (This.VerifyFixed): Treat 'this' as a value parameter.
3105 * statement.cs (LocalInfo.IsFixed): Remove.
3107 2005-07-01 Martin Baulig <martin@ximian.com>
3109 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3110 `ec.EmitThis ()' to get the correct scope.
3112 2005-07-01 Martin Baulig <martin@ximian.com>
3114 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3115 instance is a ParameterReference; fixes #75299.
3117 2005-06-30 Raja R Harinath <rharinath@novell.com>
3120 * expression.cs (Indexers.map): Remove.
3121 (Indexers.Append): Filter out inaccessible setters and getters.
3122 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3125 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
3127 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3128 (FieldExpr.Emit, PropertyExpr.Emit): Update.
3129 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3130 * expression.cs (Invocation.EmitCall): Add CS0120 check.
3132 2005-06-30 Marek Safar <marek.safar@seznam.cz>
3135 * class.cs (FieldBase.GetInitializerExpression): One more field
3138 2005-06-28 Miguel de Icaza <miguel@novell.com>
3140 * pending.cs: Do not define a proxy if the base method is virtual,
3141 it will be picked up by the runtime (bug 75270).
3143 2005-07-08 Martin Baulig <martin@ximian.com>
3145 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3146 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3148 2005-07-07 Martin Baulig <martin@ximian.com>
3150 * generic.cs (ConstructedType.CheckConstraint): Use
3151 ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
3152 called recursively; fixes #75329.
3154 2005-07-06 Martin Baulig <martin@ximian.com>
3156 * generic.cs (TypeManager.InferTypeArguments): Added support for
3157 anonymous methods; fixes #75461.
3159 2005-07-01 Martin Baulig <martin@ximian.com>
3161 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3162 `ec.EmitThis ()' to get the correct scope.
3164 2005-07-01 Martin Baulig <martin@ximian.com>
3166 * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
3167 instance is `This'; fixes #75299.
3169 2005-06-30 Martin Baulig <martin@ximian.com>
3171 * class.cs (Indexer): Implement IIteratorContainer; added support
3172 for iterators in indexers.
3175 (EmitContext.CurrentIterator): Make this a property, not a field.
3177 * anonymous.cs (AnonymousContainer.Iterator): New public property.
3179 2005-06-28 Miguel de Icaza <miguel@novell.com>
3181 * pending.cs: Do not define a proxy if the base method is virtual,
3182 it will be picked up by the runtime (bug 75270).
3184 2005-06-28 Martin Baulig <martin@ximian.com>
3186 * cs-parser.jay (interface_method_declaration): Avoid a
3187 reduce/reduce conflict by moving some of the code into a separate
3188 `interface_method_declaration_body' rule; fixes #75368.
3190 2005-06-28 Martin Baulig <martin@ximian.com>
3192 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
3193 array check after the check for TypeBuilder's.
3195 2005-06-21 Raja R Harinath <rharinath@novell.com>
3197 * convert.cs (FindMostEncompassedType): Add two trivial special
3198 cases (number_of_types == 0 || number_of_types == 1).
3199 (FindMostEncompasingType): Likewise.
3201 2005-06-17 Raja R Harinath <rharinath@novell.com>
3203 Some cleanups preparing for the fix of #75283.
3204 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3206 (EventExpr.InstanceResolve): Likewise.
3207 (EventExpr.DoResolve): Remove redundant checks.
3209 2005-06-08 Miguel de Icaza <miguel@novell.com>
3211 * class.cs: Small fix.
3213 2005-06-08 Raja R Harinath <rharinath@novell.com>
3216 * class.cs (GetPartialBases): Fix return value check of
3219 2005-06-07 Raja R Harinath <rharinath@novell.com>
3221 Ensure that partial classes are registered in their enclosing
3222 namespace. Initial part of fix of #75160.
3223 * tree.cs (Tree.RecordDecl): Add new namespace argument.
3224 Register declspace with namespace here, not in
3225 DeclSpace.RecordDecl.
3226 * cs-parser.jay: Pass namespace to RecordDecl.
3227 * class.cs (PartialContainer.Create): Likewise.
3228 (ClassPart.DefineType): New sanity-check. Throws an exception if
3230 * decl.cs (Declspace.RecordDecl): Remove.
3231 * namespace.cs (NamespaceEntry.DefineName): Remove.
3233 2005-06-06 Marek Safar <marek.safar@seznam.cz>
3235 * rootcontext.cs: Reset TargetExt as well.
3237 2005-06-03 Raja R Harinath <rharinath@novell.com>
3239 * ecore.cs (Expression.Resolve): Emit CS0654 error when
3242 2005-06-02 Raja R Harinath <rharinath@novell.com>
3244 Fix #75080, cs0119.cs.
3245 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
3247 (Expression.Resolve): ... this. Use it. Remove bogus code
3248 allowing ExprClass.Type and ExprClass.Namespace for
3249 ResolveFlags.VariableOrValue.
3250 (Expression.Resolve) [1-argument variant]: Change default resolve
3251 flags based on language version.
3252 (Expression.Error_UnexpectedKind): Use a simple string array
3253 rather than an ArrayList.
3254 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3256 (TypeOfVoid.DoResolve): Likewise.
3257 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
3258 flags argument -- it always has the same value.
3260 2005-05-31 Raja R Harinath <rharinath@novell.com>
3263 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3264 Use it in the error message.
3265 * assign.cs, expression.cs, statement.cs: Update.
3267 2005-05-30 Raja R Harinath <rharinath@novell.com>
3270 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3271 the "almostMatchedMember" case too.
3272 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3273 that failed the accessibility checks to 'almost_match'.
3275 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
3277 * attribute.cs: Use internal MethodBuilder methods to set
3278 ExactSpelling and SetLastError on PInvoke methods, instead
3279 of passing them via charset. Fixes #75060.
3281 2005-05-27 Raja R Harinath <rharinath@novell.com>
3283 * parameter.cs (Parameter): Remove TODO comment.
3284 (Parameter.DefineParameter): Remove Location parameter.
3285 (Parameters.LabelParameters): Likewise.
3286 * class.cs (Constructor.Emit): Update to change.
3287 (MethodData.Emit): Likewise.
3288 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
3289 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3291 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
3294 Removed Parameters.Location and added Parameter.Location instead.
3295 Removed Location parameter from Emit() and GetSignature().
3302 Modified all related calls.
3304 2005-06-21 Martin Baulig <martin@ximian.com>
3306 * generic.cs (NullCoalescingOperator.Emit): Make this work if the
3307 left-hand side is not a nullable type; fixes #75328.
3309 2005-06-21 Martin Baulig <martin@ximian.com>
3312 (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
3313 (TypeManager.GetFullNameSignature): Likewise.
3315 * convert.cs (Convert.Error_CannotImplicitConversion): Compare
3316 `source.FullName' and `target.FullName' to check whether there are
3317 two conflicting definitions.
3319 2005-06-21 Martin Baulig <martin@ximian.com>
3321 * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
3322 a BoxedCast - also for reference types - to be compatible with csc.
3324 2005-06-21 Martin Baulig <martin@ximian.com>
3326 * expression.cs (MemberAccess.DoResolve): Add support for nested
3327 types in a generic instance; fixes #75320.
3329 2005-06-20 Martin Baulig <martin@ximian.com>
3331 * generic.cs (TypeManager.InferType): Also walk the class
3332 hierarchy for generic instances; fixes #75261.
3334 2005-06-17 Martin Baulig <martin@ximian.com>
3336 * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
3337 to make things work for corlib.
3339 2005-06-15 Martin Baulig <martin@ximian.com>
3341 * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
3342 obsolete `SecurityAction' values.
3344 2005-06-06 Marek Safar <marek.safar@seznam.cz>
3346 * rootcontext.cs: Reset TargetExt as well.
3348 2005-06-09 Martin Baulig <martin@ximian.com>
3350 * delegate.cs (Delegate.VerifyMethod): Added
3351 `MethodGroupExpr old_mg' argument; inherit its
3352 `HasTypeParameters'; fix #75085.
3354 2005-06-09 Martin Baulig <martin@ximian.com>
3356 * expression.cs (Invocation.OverloadResolve): Correctly handle
3357 generic methods for the SetMemberIsUsed(); fix #75064.
3359 2005-06-09 Martin Baulig <martin@ximian.com>
3361 * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
3364 2005-06-08 Martin Baulig <martin@ximian.com>
3366 * cs-parser.jay (nullable_type_or_conditional): If we put the
3367 nullable back and our `type' is a `ComposedCast', remove the
3368 nullable from it. Fixes #75156.
3370 * expression.cs (ComposedCast.RemoveNullable): New public method.
3372 2005-06-08 Martin Baulig <martin@ximian.com>
3374 The big Iterators rewrite :-)
3376 * iterators.cs: Rewrite this to use the anonymous methods framework.
3378 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3379 before the TypeContainers; see 2test-21.cs.
3382 (TypeContainer.DefineType): Don't create a new EmitContext if we
3383 already have one (this only happens if we're an Iterator).
3384 (TypeContainer.Define): Also call Define() on all our iterators.
3385 (Method.CreateEmitContext): Added support for iterators.
3388 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3389 (AnonymousContainer.CreateMethodHost): Moved here from
3390 AnonymousMethod and made abstract.
3391 (AnonymousContainer.CreateScopeType): New abstract method.
3392 (AnonymousContainer.IsIterator): New public property.
3393 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3394 get the ScopeTypeBuilder rather than manually defining it here.
3395 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3398 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3399 before RootContext.DefineTypes().
3401 * codegen.cs (EmitContext.RemapToProxy): Removed.
3402 (EmitContext.CurrentAnonymousMethod): Changed type from
3403 AnonymousMethod -> AnonymousContainer.
3404 (EmitContext.ResolveTopBlock): Protect from being called twice.
3405 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3406 (EmitContext.EmitThis): Removed the iterators hacks; use the
3407 anonymous methods framework for that.
3410 (ToplevelBlock.Container): Make this a property, not a field.
3411 (ToplevelBlock.ReParent): New public method; move the
3412 ToplevelBlock into a new container.
3413 (Foreach.TemporaryVariable): Simplify.
3415 2005-06-05 Martin Baulig <martin@ximian.com>
3417 * statement.cs (LocalInfo.CompilerGenerated): New flag.
3418 (Block.AddTemporaryVariable): New public method; creates a new
3419 `LocalInfo' for a temporary variable.
3420 (Block.EmitMeta): Create the LocalBuilders for all the temporary
3422 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3423 non-iterator variables.
3425 2005-06-05 Martin Baulig <martin@ximian.com>
3427 * statement.cs (Foreach.TemporaryVariable): Create the
3428 LocalBuilder in the Emit phase and not in Resolve since in some
3429 situations, we don't have an ILGenerator during Resolve; see
3430 2test-19.cs for an example.
3432 2005-06-04 Martin Baulig <martin@ximian.com>
3434 The big Foreach rewrite - Part II.
3436 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3437 with `PropertyInfo ienumerator_getcurrent'.
3439 * codegen.cs (VariableStorage): Removed.
3442 (Foreach): Derive from Statement, not ExceptionStatement.
3443 (Foreach.CollectionForeach): New nested class. Moved all the code
3444 dealing with collection foreach here.
3445 (Foreach.ForeachHelperMethods): Removed.
3446 (Foreach.TemporaryVariable): Implement IMemoryLocation.
3448 2005-05-23 Martin Baulig <martin@ximian.com>
3450 * statement.cs (Try.DoResolve): Don't create a `finally' if we
3451 don't need to. Fix #75014.
3453 2005-05-26 Raja R Harinath <rharinath@novell.com>
3455 Improve user-defined conversion handling.
3456 * convert.cs (GetConversionOperators): Rewrite. Return only the
3457 applicable operators.
3458 (AddConversionOperators): New. Helper for GetConversionOperators.
3459 (FindMostEncompassedType, FindMostEncompassingType): Verify that
3460 there is only one most encompassed/encompassing type.
3461 (FindMostSpecificSource, FindMostSpecificTarget): Remove
3462 "applicable operator" handling.
3463 (UserConversion): Move cache here from GetConversionOperators.
3464 Directly cache the chosen operator, rather than the whole
3466 (ExplicitNumericConversion): Fix buggy implementation of Decimal
3467 case. Allow conversion of decimal to sbyte and byte too.
3468 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3469 New static methods. Used to avoid allocating EmptyExpressions in
3472 2005-05-24 Duncan Mak <duncan@novell.com>
3474 * ecore.cs (CastFromDecimal): New class for casting a decimal to
3475 another class, used in Convert.ExplicitNumericConversion.
3476 (CastToDecimal): New class, similar to above, but casts to
3477 System.Decimal, used in Convert.ImplicitNumericConversion and also
3478 in explicit convesion from double/float to decimal.
3480 * convert.cs (ImplicitNumericConversion): Handle implicit
3481 conversions to System.Decimal.
3482 (ExplicitNumericConversion): handle explicit conversions to
3487 2005-05-20 Miguel de Icaza <miguel@novell.com>
3489 * typemanager.cs: Do not throw an exception in the TypeBuilder
3490 case, we take care of it on the TypeCode.
3492 2005-05-17 Marek Safar <marek.safar@seznam.cz>
3494 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3497 * cs-parser.jay: Catch more lexical errors.
3499 * report.cs: Add one more Error method.
3502 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3504 2005-05-20 Martin Baulig <martin@ximian.com>
3506 * class.cs (TypeContainer.CircularDepException): Removed.
3507 (TypeContainer.DefineType): Removed the `InTransit' stuff.
3508 (TypeContainer.CheckRecursiveDefinition): Check for circular class
3509 (CS0146) and interface (CS0529) dependencies here.
3511 2005-05-20 Martin Baulig <martin@ximian.com>
3513 * expression.cs (New.DoResolve): Move the CS0712 check above the
3514 CS0144 check; otherwise it can never be reached.
3516 2005-05-20 Martin Baulig <martin@ximian.com>
3518 * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
3520 2005-05-20 Martin Baulig <martin@ximian.com>
3522 * class.cs (TypeContainer.DefineType): Fix CS0698 check.
3524 * typemanager.cs (TypeManager.IsAttributeType): New public method.
3526 2005-05-19 Martin Baulig <martin@ximian.com>
3529 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3530 to disable error reporting.
3532 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3533 here since we don't want to report an error; see the new test-336.cs.
3535 2005-05-19 Raja R Harinath <rharinath@novell.com>
3537 * statement.cs (ToplevelBlock.GetParameterReference)
3538 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3539 Move here from class Block.
3540 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3541 * expression.cs (ParameterReference.DoResolveBase): Likewise.
3543 2005-05-18 Martin Baulig <martin@ximian.com>
3548 (FlowBranching.Reachability): Add non-static public And() and Or()
3550 (FlowBranchingSwitch): New class; do the `break_origins' thing
3551 like in FlowBranchingLoop.
3552 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3553 reachability, not just locals and parameters.
3554 (FlowBranching.MergeChild): Remove some of the hacks for loop and
3555 switch; MergeBreakOrigins() now takes care of that.
3557 2005-05-18 Martin Baulig <martin@ximian.com>
3559 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3560 a loop and may leave it, reset the barrier; fixes #74974.
3562 2005-05-16 Raja R Harinath <rharinath@novell.com>
3564 Fix test-382.cs. Emit values of decimal constants.
3565 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3567 (TypeContainer.AddField): ... this.
3568 (TypeContainer.EmitFieldInitializers): Allow the list of fields
3569 with initializers to include 'Const's.
3570 (ClassPart.RegisterFieldForInitialization): Forward to
3572 * const.cs (Const.Const): Pass initializer to base class.
3573 (Const.Define): In case of decimal constants, register them for
3574 initialization in a static constructor.
3576 2005-05-14 Martin Baulig <martin@ximian.com>
3578 * statement.cs (Block.Resolve): Correctly handle unreachable code;
3579 do not call ResolveUnreachable() on unreachable statements in
3580 here, see the comment in the source code.
3582 2005-05-13 Raja R Harinath <rharinath@novell.com>
3585 * expression.cs (BinaryResolveOperator): If one of the operands of
3586 an equality comparison is 'null' and the other is a pointer type,
3587 convert the null to a NullPointer.
3588 * convert.cs (ImplicitReferenceConversion): If the expression is a
3589 NullLiteral and the target type is a pointer type, return a
3590 NullPointer instead.
3591 (ImplicitConversionStandard): Likewise.
3593 2005-05-13 Marek Safar <marek.safar@seznam.cz>
3595 * cs-parser.jay: Set readonly context based on special constructs.
3597 * expression.cs (LocalVariableReference.DoResolveBase): Improved
3598 readonly variable error handling.
3600 * rootcontext.cs (EmitCode): Don't verify members when error
3603 * statement.cs (LocalInfo): Add reaodnly context information.
3604 (SetReadOnlyContext, GetReadOnlyContext): New methods.
3606 2005-05-17 Martin Baulig <martin@ximian.com>
3608 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3611 2005-05-13 Martin Baulig <martin@ximian.com>
3613 * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
3614 handle unreachable blocks.
3616 2005-05-13 Martin Baulig <martin@ximian.com>
3619 (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
3620 (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
3623 2005-05-13 Martin Baulig <martin@ximian.com>
3625 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3626 instance variable, not a local. Fix #74873.
3627 (Block.ResolveUnreachable): Set it to true here.
3629 2005-05-12 Martin Baulig <martin@ximian.com>
3631 * cs-parser.jay (property_declaration): Pass the `current_class',
3632 not the `current_container' to Property's .ctor. Fixes #74912.
3634 2005-05-11 Martin Baulig <martin@ximian.com>
3636 * typemanager.cs (Closure): Copy this from MCS and merge all the
3637 GMCS-specific changes into it.
3639 2005-05-12 Raja R Harinath <harinath@gmail.com>
3642 * typemanager.cs (unmanaged_enclosing_types): New.
3643 (IsUnmanagedType): Avoid infloops by using
3644 'unmanaged_enclosing_types' to talk with recursive invocations.
3646 2005-05-11 Duncan Mak <duncan@novell.com>
3648 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3649 continuing to process for 'arg'.
3650 (handle_preprocessing_directive): Check the argument of the #endif
3651 directive and report error CS1025 if there are any trailing
3654 According to the C# spec, having even whitespace after the #endif
3655 directive is illegal; however, because we call arg.TrimEnd ()
3656 beforehand, we have the same behavior as csc, allowing whitespace
3657 after the directive.
3661 2005-05-11 Marek Safar <marek.safar@seznam.cz>
3665 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3666 (Constructor.GetObsoleteAttribute): Implemented correctly.
3668 2005-05-10 Martin Baulig <martin@ximian.com>
3670 * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
3671 resolve the type; fixes #74864.
3672 (DefaultValueExpression): Create the LocalTemporary in Emit(), not
3673 in DoResolve(); fixes #74862.
3675 2005-05-10 Martin Baulig <martin@ximian.com>
3677 * support.cs (ReflectionParameters.ParameterModifier): Use
3678 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3679 and `ParameterAttributes.In'. Fixes #74884.
3681 2005-05-10 Martin Baulig <martin@ximian.com>
3683 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
3684 the cache if we're just looking for `MemberTypes.NestedType' in a
3687 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3688 constraints if we're still resolving the type tree.
3689 (Expression.MemberLookup): If we're resolving the type tree, only
3690 look for `MemberTypes.NestedType' since we're only interested in
3693 * class.cs (TypeContainer.DefineType): Don't resolve the type
3694 parameters here; do this later in ResolveType() after the type
3695 tree has been resolved.
3696 (TypeContainer.ResolveType): New public method; this is called
3697 after the type tree is resolved and before the types are being
3698 populated. We resolve the generic constraints here.
3699 (TypeContainer.DoDefineMember): Check the constraints on our base
3700 class and interfaces.
3702 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
3703 set the `ResolvingTypeTree' flag on the EmitContext.
3705 * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
3707 2005-05-10 Marek Safar <marek.safar@seznam.cz>
3709 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3711 * expression.cs (Argument.GetParameterModifier): Turned to property.
3712 (Invocation.Error_InvalidArguments): Add more descriptive errors.
3714 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3717 2005-05-09 Raja R Harinath <rharinath@novell.com>
3720 * decl.cs (MemberCache.AddMethods): Register override methods,
3721 rather than non-override methods.
3722 * typemanager.cs (RegisterOverride): New.
3723 (IsOverride): Update.
3725 2005-05-09 Marek Safar <marek.safar@seznam.cz>
3727 * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
3729 2005-05-06 Martin Baulig <martin@ximian.com>
3732 (Attributable.IsClsComplianceRequired): Fix typo in the method name.
3733 (AttributeTester.AnalyzeTypeCompliance): Add generics support.
3735 2005-05-09 Marek Safar <marek.safar@seznam.cz>
3739 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3740 recursive declaration.
3742 * statement.cs (Block.ResolveMeta): Report any error in resolving.
3744 2005-05-06 Marek Safar <marek.safar@seznam.cz>
3746 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3748 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3750 2005-05-05 Raja R Harinath <rharinath@novell.com>
3753 * decl.cs (DeclSpace.FamilyAccessible):
3754 Use TypeManager.IsNestedFamilyAccessible.
3756 Fix reopened #64812.
3757 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3760 2005-05-04 Raja R Harinath <rharinath@novell.com>
3761 Abin Thomas <projectmonokochi@rediffmail.com>
3762 Anoob V E <projectmonokochi@rediffmail.com>
3763 Harilal P R <projectmonokochi@rediffmail.com>
3766 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
3767 allow access to all static members.
3769 2005-05-04 Martin Baulig <martin@ximian.com>
3771 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
3773 2005-05-04 Martin Baulig <martin@ximian.com>
3777 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
3778 section at the end; make things work if `default' is not the last
3781 2005-05-04 Martin Baulig <martin@ximian.com>
3785 * statement.cs (Switch): Replaced the `got_default' field with a
3786 `default_section' one.
3787 (Switch.CheckSwitch): Set `default_section' here.
3788 (Switch.Resolve): If we're a constant switch and the constant is
3789 not found, use the default section.
3791 2005-05-03 Martin Baulig <martin@ximian.com>
3793 * expression.cs (ArrayAccess.EmitGetLength): New public method.
3795 * statement.cs (Foreach.ArrayForeach): New nested class.
3796 (Foreach.TemporaryVariable): New nested class.
3797 (Foreach.EmitArrayForeach): Removed; this is now in the new
3800 2005-05-03 Raja R Harinath <rharinath@novell.com>
3802 * pending.cs (BaseImplements): Move the #74773 fix here. This is
3804 (VerifyPendingMethods): Revert change below.
3806 * typemanager.cs (IsOverride, RegisterNonOverride): New.
3807 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
3808 that used to trigger warning -28. Remove warning -28.
3809 * expression.cs (Invocation.OverloadResolve): Use
3810 TypeManager.IsOverride to distinguish override methods.
3813 * pending.cs (VerifyPendingMethods): If a base type implements the
3814 requested interface, don't bother checking individual methods of
3815 the base type. As a side-effect, this prevents the creation of
3816 unnecessary proxies.
3818 2005-05-02 Martin Baulig <martin@ximian.com>
3822 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3823 Also `And' the locals if the old vector is null.
3824 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
3825 null; in this case we basically reset all the variables.
3827 2005-05-02 Martin Baulig <martin@ximian.com>
3831 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
3832 Added `FlowBranching branching' argument; always `and' the
3833 variables instead of `or'ing them unless we're an infinite loop.
3835 * statement.cs (While.Resolve): Create a new sibling unless we're
3838 2005-05-02 Martin Baulig <martin@ximian.com>
3842 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
3843 arguments; use it instead of creating a new TopLevelBlock.
3844 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
3845 our ConstructorInitializer.
3848 (TopLevelBlock.TopLevelBranching): New public property.
3849 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
3850 and create our `TopLevelBranching'.
3852 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
3853 anonymous method host, use `block.TopLevelBranching' rather than
3854 creating a new branching.
3856 2005-04-20 Miguel de Icaza <miguel@novell.com>
3858 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
3859 a ScopeInfo, if any of the current children is a child of the new
3860 entry, move those children there.
3862 2005-04-30 Martin Baulig <martin@ximian.com>
3864 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
3865 at the beginning of a SwitchSection. Fix #73335.
3867 2005-04-27 Marek Safar <marek.safar@seznam.cz>
3870 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
3872 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
3873 (FieldExpr.DoResolve): Obsolete members are ignored for field
3876 2005-04-26 Marek Safar <marek.safar@seznam.cz>
3878 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
3879 of arrays detection.
3881 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
3883 (Field.VerifyClsCompliance): Volatile fields are not compliant.
3885 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
3888 2005-04-25 Ben Maurer <bmaurer@ximian.com>
3890 * cs-parser.jay: Use the prefered version of -unsafe in error
3893 2005-04-22 Marek Safar <marek.safar@seznam.cz>
3895 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
3898 2005-04-20 John Luke <john.luke@gmail.com>
3900 * driver.cs: fix typo in error message, --outout to --output
3902 2005-04-30 Martin Baulig <martin@ximian.com>
3904 * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
3905 handle the .NET 2.x security attributes.
3907 2005-04-30 Martin Baulig <martin@ximian.com>
3910 (TypeManager.ExpandInterfaces): Don't add things twice.
3913 (TypeContainer.VerifyClsCompliance): Allow generic instances.
3915 2005-04-29 Martin Baulig <martin@ximian.com>
3917 * generic.cs (Constraints.ResolveTypes): Expand interfaces.
3919 * anonymous.cs: Added support for anonymous generic methods.
3921 2005-04-29 Martin Baulig <martin@ximian.com>
3923 * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
3926 2005-04-29 Martin Baulig <martin@ximian.com>
3928 * generic.cs (TypeManager.HasConstructorConstraint): Removed.
3930 * expression.cs (New.DoResolve): Fix the CS0304 check.
3932 2005-04-29 Martin Baulig <martin@ximian.com>
3934 * typemanager.cs (TypeManager.GetFullName): Updated to the new
3937 * class.cs (MethodCore.IsDuplicateImplementation): If we're an
3938 explicit interface implementation, compare the interface types.
3939 (MethodData.Define): Use the new naming scheme from the latest
3941 (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
3943 * decl.cs (MemberName.GetMemberName): Removed.
3944 (MemberName.MethodName, FullName): New properties.
3946 2005-04-25 Raja R Harinath <rharinath@novell.com>
3948 * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
3950 2005-04-22 Martin Baulig <martin@ximian.com>
3952 * generic.cs (GenericMethod): Create the EmitContext in the
3953 `Define()'; in `Define(MethodBuilder)', create the type parameters
3954 before calling `Define()'. Fixes #73933.
3956 2005-04-22 Martin Baulig <martin@ximian.com>
3959 (Constraints.Resolve): Make things work wrt. the new type lookup system.
3960 (ConstructedType.ResolveAsTypeTerminal): Don't override this.
3962 * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
3963 ConstructedType, check its constraints.
3965 2005-04-20 Marek Safar <marek.safar@seznam.cz>
3967 * codegen.cs (InRefOutArgumentResolving): New field.
3969 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
3970 fields outside contructor.
3972 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
3974 2005-04-19 Miguel de Icaza <miguel@novell.com>
3976 * anonymous.cs (CaptureContext.EmitParameterInstance): The
3977 parameter code was not completed ever, so it was not as up-to-date
3978 as local variables. Must finish it.
3980 The bug fix was to compare the Toplevel of the block, not the
3981 current block. Thanks for Ben for pointing this out.
3983 2005-04-19 Raja R Harinath <rharinath@novell.com>
3985 * decl.cs (AddMethods): Use the declaring type of the problem
3986 method to determine if we want to squash a warning.
3988 2005-04-19 Marek Safar <marek.safar@seznam.cz>
3990 * attribute.cs: Removed debug output.
3992 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
3994 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
3997 2005-04-18 Raja R Harinath <rharinath@novell.com>
4000 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4001 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4002 all null comparisons against reference types.
4004 2005-04-18 Marek Safar <marek.safar@seznam.cz>
4007 * class.cs (TypeContainer.CircularDepException) New nested
4009 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4010 (TypeContainer.DefineType): Removed error, reset InTransit before
4012 (Class.DefineType): Throw exception when is in Transit.
4013 Catch exception and report error.
4014 (Struct.DefineType): Throw exception when is in Transit.
4015 Catch exception and report error.
4016 (Interface.DefineType): Throw exception when is in Transit.
4017 Catch exception and report error.
4019 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4020 handle nested exception handlers.
4022 * flowanalysis.cs (InTryWithCatch): New method, search for try with
4025 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4026 InFinally and InCatch storage.
4028 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4029 (Catch.Resolve): Set and Restore ec.InCatch.
4030 (Try.Resolve): Set and Restore ec.InFinally.
4031 (Try.HasCatch): True when try has catch.
4033 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
4035 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4036 for the same event member, so exclude such cases from warning 419.
4039 2005-04-16 Miguel de Icaza <miguel@novell.com>
4041 * expression.cs (Binary.ResolveOperator): Apply patch from John
4042 Luke to fix bug 59864: operators &, | and ^ on enumerations
4043 require that the same enum type on both sides.
4045 * driver.cs: Add warnings to old flag usage, this is to assist
4046 people who produce Makefiles and hope that the Makefiles will be
4049 * class.cs (TypeContainer.EmitType): Moved the definition of the
4050 special $PRIVATE$ field from the resolve phase to the Emit phase.
4051 During resolve we do not know if we are a struct with
4052 HasExplicitLayout, we know this only after the attributes for the
4055 Set the FieldOffset to zero on the dummy field that we create for
4056 the class. Fixes 74590.
4058 2005-04-16 Raja R Harinath <rharinath@novell.com>
4061 * ecore.cs (PropertyExpr.resolved): New.
4062 (DoResolve): Use it to handle a case of double resolution here.
4063 Handle a case of identical-name-and-type-name.
4064 * expression.cs (ArrayCreation.CheckIndices): Avoid double
4065 resolution by storing the results of expression resolution back
4066 into the "probes" array.
4068 2005-04-15 Raja R Harinath <rharinath@novell.com>
4070 Fix cs0208-7.cs and cs0208-8.cs.
4071 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4072 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
4073 error reporting to point out the reason a struct is not unmanaged.
4075 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4077 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
4078 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4080 2005-04-13 Raja R Harinath <rharinath@novell.com>
4083 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4084 IdenticalNameAndTypeName here.
4085 (EventExpr.InstanceResolve): Likewise.
4087 2005-04-13 Marek Safar <marek.safar@seznam.cz>
4089 C# 2.0 DefaultCharSetAttribute implementation
4091 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4092 which allows us to set GlobalNamespace for every resolve.
4093 (Attribute.ResolveArguments): Cut from Resolve.
4094 (Attribute.GetCharSetValue): Returns CharSet named argument.
4095 (Attribute.DefinePInvokeMethod): Gets default charset from
4097 (GlobalAttribute.ResolveAsTypeStep): Override.
4098 (GlobalAttribute.ResolveArguments): Override.
4100 * class.cs (TypeAttr): Is protected.
4102 * codegen.cs (ModuleClass.DefaultCharSet): New member.
4103 (ModuleClass.DefaultCharSetType): New memeber.
4104 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4106 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4107 charset from module.
4109 * delegate.cs (TypeAttr): Override.
4110 (Delegate.DefineType): Use this TypeAttr.
4112 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4113 at very early stage (before types are defined) to resolve model
4114 module attributes. It will probably not work with corlib but it
4117 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4118 charset from module.
4120 * typemanager.cs (default_charset_type): New type.
4122 2005-04-13 Raja R Harinath <rharinath@novell.com>
4124 * decl.cs (MemberCache.AddMethods): Don't warn if
4125 System.Object.Finalize has buggy MethodAttributes.
4127 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4130 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4132 * doc.cs : detect ambiguous reference to overloaded members.
4133 Fixed bug #71603. MS 1.1 csc does not detect it.
4135 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4137 * doc.cs : delegates must not be referenced with parameters.
4140 2005-04-12 Miguel de Icaza <miguel@novell.com>
4142 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4144 2005-04-10 Miguel de Icaza <miguel@novell.com>
4146 * driver.cs (MainDriver): Stop processing if the CLS stage found
4149 (CompilerCallableEntryPoint.InvokeCompiler): Always
4150 reset after execution; Take a TextWriter argument for the
4153 * report.cs: Use the error stream instead of hardcoding stderr.
4155 2005-04-09 Miguel de Icaza <miguel@novell.com>
4157 * class.cs: Reduce code paths to test, too small of an
4158 optimization to make it worth the extra testing. Always perform
4161 2005-04-08 Raja R Harinath <rharinath@novell.com>
4164 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4165 operators that had errors reported on them.
4167 2005-04-08 Marek Safar <marek.safar@seznam.cz>
4169 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4171 (Attribute.Resolve): Add named argument type checking.
4173 * class.cs (FixedField.Define): Use IsPrimitiveType
4175 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4177 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4178 unsafe parameter types.
4180 * statement.cs (Using.ResolveExpression): Add better error description.
4182 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4184 2005-04-08 Raja R Harinath <rharinath@novell.com>
4187 * attribute.cs (Attribute.GetAttributeUsage): Resolve
4188 AttributeUsageAttribute in the emitcontext of the attribute class,
4189 not in the emitcontext of the attributable entity it was attached to.
4190 * cs-parser.jay: Use 'current_class', not 'current_container',
4191 when creating a GlobalAttribute.
4193 2005-04-08 Alp Toker <alp@atoker.com>
4195 * pending.cs: The fix to #58413 failed to compile methods implementing
4196 interfaces with/without params modifiers and vice versa, even though
4197 params modifiers aren't part of the signature. Make the modifier check
4198 less strict as in csc.
4200 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
4201 Anoob V E <projectmonokochi@rediffmail.com>
4202 Harilal P R <projectmonokochi@rediffmail.com>
4205 * pending.cs (TypeAndMethods.mods): New. Store the parameter
4206 modifiers of pending methods.
4207 (PendingImplementation.PendingImplementation): Initialize it.
4208 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4209 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4210 with ParameterData. Add check for modifiers.
4211 * class.cs (MethodData.Define): Update to changes.
4213 2005-04-07 Raja R Harinath <rharinath@novell.com>
4215 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4217 2005-04-07 Marek Safar <marek.safar@seznam.cz>
4219 * class.cs (PropertyMethod.Define): Check private accessor in abstract
4222 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4225 * typemanager.cs: Registered RequiredAttributeAttribute.
4227 2005-04-06 Marek Safar <marek.safar@seznam.cz>
4229 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4230 Warning CS0169 is back at level 3.
4231 (IMethodData.SetMemberIsUsed): New method.
4233 * decl.cs (IsUsed): New value; moved from FieldBase.Status
4234 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4236 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4238 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4240 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4243 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4246 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4247 to avoid the problems with nested types.
4249 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
4250 Anoob V.E <projectmonokochi@rediffmail.com>
4251 Harilal P.R <projectmonokochi@rediffmail.com>
4252 Raja R Harinath <rharinath@novell.com>
4255 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4257 * typemanager (GetConstructor): Make public.
4259 2005-04-05 John Luke <john.luke@gmail.com>
4260 Raja R Harinath <rharinath@novell.com>
4263 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4264 struct too. Return false quicker in a few cases.
4265 (VerifyUnManaged): Use it.
4267 2005-04-05 Raja R Harinath <rharinath@novell.com>
4270 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4271 not 'unreachable_seen'.
4273 2005-04-04 Marek Safar <marek.safar@seznam.cz>
4275 * attribute.cs (Attribute.GetValue): Removed unused.
4277 * codegen.cs (CodeGen.TrimExt): Removed unused.
4279 * cs-parser.jay (output): Removed unused.
4281 * cs-tokenizer.cs (hex_digits): Removed unused.
4283 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4285 * expression.cs (Indirection.LoadExprValue): Removed unused.
4286 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4288 * iterators.cs (Iterator.param_types): Removed unused.
4290 * statement.cs (Goto.block): Removed unused.
4291 (ToplevelBlock.did): Removed unused.
4292 (Switch.ResolveConstantSwitch): Removed unused.
4294 2005-04-01 Ben Maurer <bmaurer@ximian.com>
4296 * rootcontext.cs: Allow mcs to bootstrap with the compilation
4299 2005-04-19 Martin Baulig <martin@ximian.com>
4301 Merged r42462 from MCS and made it work for GMCS.
4303 * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
4305 * generic.cs (GenericMethod.Define): Removed `return_type' argument.
4307 2005-04-01 Raja R Harinath <rharinath@novell.com>
4309 Fix #74232 and cs0208-3.cs.
4310 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4311 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4312 unmanaged type. Don't use FieldBuilders when 't' is a
4313 TypeBuilder. Use ModFlags and MemberType fields.
4314 * class.cs (MemberBase.member_type): Rename from MemberType.
4315 (MemberBase.MemberType): New property. Determines member_type on
4317 (MemberBase.DoDefine): Don't initialize MemberType here.
4318 (FieldMember.Define): Likewise.
4320 2005-04-01 Marek Safar <marek.safar@seznam.cz>
4323 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4324 Attributes are emitted there.
4326 2005-04-01 Raja R Harinath <rharinath@novell.com>
4328 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4329 keyword in 'partial enum' too.
4330 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4332 Report from Kamil Skalski <nazgul@omega.pl>.
4335 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4336 have partial containers too.
4338 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4339 in block' checks to Block.CheckInvariantMeaningInBlock.
4340 * statement.cs (Block.GetKnownVariableInfo): Make private.
4341 (Block.IsVariableUsedInChildBlock): Remove.
4342 (Block.IsVariableUsedInBlock): Likewise.
4343 (Block.CheckInvariantMeaningInBlock): New. Show location of
4344 conflicting declaration.
4345 (Block.AddVariable): Make error messages less long-winded and more
4346 specific. Show location of conflicting declaration.
4347 * parameter.cs (Parameters.Location): New readonly property.
4349 2005-03-31 Raja R Harinath <rharinath@novell.com>
4351 Clean up semantics of invoking ResolveMemberAccess.
4352 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4353 can have an instance, ensure that we pass in a non-TypeExpression
4354 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
4355 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4356 argument. Update to changes and simplify.
4357 (FieldExpr.Emitinstance): Remove CS0120 check.
4358 (PropertyExpr.EmitInstance): Likewise.
4359 * expression.cs (Argument.Resolve): Likewise.
4360 (Invocation.DoResolve): Update to changes in semantics of
4363 2005-03-31 Marek Safar <marek.safar@seznam.cz>
4366 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4369 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4371 2005-03-31 Raja R Harinath <rharinath@novell.com>
4373 Fix difference in behaviour with commandline invocation.
4374 * driver.cs (Driver.Reset): New.
4375 (CompilerCallableEntryPoint): Call it.
4377 * statement.cs (If.Resolve): Avoid spurious "uninitialized
4378 variable" warnings if the boolean expression failed to resolve.
4380 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
4382 * attribute.cs: Fix the union of several permissions when some of them
4383 are unrestricted (so the result isn't an unrestricted permission set).
4386 2005-03-30 Raja R Harinath <rharinath@novell.com>
4388 * ecore.cs (MemberExpr): New class. Convert from interface
4390 (MemberExpr.ResolveMemberAccess): Refactor and move here from
4391 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
4393 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4394 (MethodGroupExpr.IsExplicitImpl): Remove.
4395 (Expression.GetFieldFromEvent): Remove.
4396 (SimpleName.MemberStaticCheck): Remove.
4397 (SimpleName.DoSimpleNameResolve): Update to changes.
4398 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4399 (MemberAccess.IdenticalNameAndTypeName): Remove.
4400 (MemberAccess.error176): Move to MemberExpr.
4401 (MemberAccess.DoResolve): Update to changes.
4402 (BaseAccess.DoResolve): Likewise.
4404 2005-03-30 Marek Safar <marek.safar@seznam.cz>
4406 C# 2.0 Conditional attribute class implementation
4408 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4409 Analyzes class whether it has attribute which has ConditionalAttribute
4410 and its condition is not defined.
4412 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4413 (Class.IsExcluded): New method. Search for at least one defined
4414 condition in ConditionalAttribute of attribute class.
4416 2005-03-30 Raja R Harinath <rharinath@novell.com>
4418 * ecore.cs (PropertyExpr): Derive from Expression, not
4419 ExpressionStatement.
4420 (PropertyExpr.EmitStatement): Remove.
4422 2005-03-29 Raja R Harinath <rharinath@novell.com>
4425 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4426 internal field "value__" of an enum be private. The examples for
4427 "value__" that I found on MSDN all used FieldAttributes.Private.
4429 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4430 Don't mention IL method attribute names.
4432 Fix #47991. Remove a TODO.
4433 * statement.cs (Block.Toplevel): Make into a field.
4434 (Block.Parameters): Move into ToplevelBlock.
4435 (Block.known_variables): Rename from child_variable_names.
4436 (Block.Block): Remove variants that take Parameters. Initialize
4437 'Toplevel' with the immediately surrounding toplevel block.
4438 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
4439 LocalInfo parameter.
4440 (Block.GetKnownVariableInfo): New.
4441 (Block.IsVariableNameUsedInChildBlock): Update.
4442 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
4443 the block, even though it may not be in scope.
4444 (Block.AddVariable): Remove Parameters parameter. Use
4445 Toplevel.Parameters instead.
4446 (Block.AddConstant): Remove Parameters parameter.
4447 (Block.GetParameterReference): Update to use Toplevel.Parameters.
4448 (Block.IsParamaterReference): Likewise.
4449 (Block.IsLocalParameter): Likewise. Simplify a lot.
4450 (ToplevelBlock.Parameters): New. Moved from Block.
4451 (ToplevelBlock.ToplevelBlock): Update to changes. Always
4452 initialize Parameters to a non-null value.
4453 * cs-parser.jay: Update to changes.
4454 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4455 simple names that mean different things in the same block. Use
4456 Block.IsVariableNameUsedInBlock.
4458 2005-03-28 Raja R Harinath <rharinath@novell.com>
4460 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4462 2005-03-26 Raja R Harinath <harinath@acm.org>
4465 * assign.cs (Assign.DoResolve): When the RHS of an assignment
4466 fails to resolve, ensure that the LHS is still resolved as an
4469 2005-03-25 Raja R Harinath <harinath@acm.org>
4471 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4473 (Enum.current_ec): Remove.
4474 (Enum.LookupEnumValue): Remove EmitContext argument.
4475 Just uses the one created during DefineType.
4476 (Enum.FindMembers): Update.
4477 * expression.cs (MemberAccess.DoResolve): Update.
4479 2005-03-22 Marek Safar <marek.safar@seznam.cz>
4481 * assign.cs (Assign.DoResolve): Check for CS1717 when
4482 source and target are same (uses Equals).
4484 * expression.cs (LocalVariableReference, ParameterReference,
4485 This): Implemented Equals, GetHashCode.
4487 * statement.cs (Block.GetParameterReference): Removed useless
4490 2005-03-22 Raja R Harinath <rharinath@novell.com>
4493 * statement.cs (Block.AddVariable): Ensure that we skip implicit
4494 blocks before deciding whether the error is cs0136 or cs0128.
4496 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4497 (using_alias_directive, using_namespace_directive): Pass
4498 MemberName, not an expression to Namespace.UsingAlias and
4500 (MakeName): Use the MemberName of the namespace.
4501 * namespace.cs (Namespace.MemberName): New.
4502 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4503 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4505 * decl.cs (MemberName.Name): Make readonly.
4506 (MemberName.FromDotted): New "constructor".
4507 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4508 (MemberCore.Name): Compute from MemberName on demand.
4509 (MemberCore.SetMemberName): Provide a way to change the
4511 (MemberCore.AddToContainer): Don't take a fullname parameter.
4512 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4513 fully qualified name of the container to the member name.
4514 (TypeContainer.AddToTypeContainer): Use a fully qualified name
4515 only if the type is a member of the root container.
4516 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4517 MemberName.Left rather than searching for an embedded ".".
4518 (PartialContainer.CreatePart): Update to changes in RootContext.
4519 (MemberBase.ShortName): Turn into a property. Use
4520 MemberCore.SetMemberName.
4521 (MemberBase.ExplicitInterfaceName): Remove.
4522 (MemberBase.UpdateMemberName): Remove.
4523 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4524 (PropertyBase.SetMemberName): New override.
4525 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4526 (Tree.GetDecl): New.
4527 (Tree.AllDecls): Rename from Decls.
4528 * attribute.cs, enum.cs, report.cs: Update to changes.
4529 * driver.cs (MainDriver): Use MemberName.FromDotted on
4530 RootContext.MainClass.
4532 2005-03-21 Marek Safar <marek.safar@seznam.cz>
4534 * class.cs (FixedField.Define): Check for CS1664 and more sanity
4537 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4539 2005-03-18 Marek Safar <marek.safar@seznam.cz>
4541 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4542 property accessor modifiers.
4544 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4545 fixed buffer attribute (CS1716).
4546 (PropertyMethod.HasCustomAccessModifier): When property accessor
4547 has custom modifier.
4549 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4551 (PropertyExpr.DoResolveLValue): Add CS0272.
4553 2005-03-17 Miguel de Icaza <miguel@novell.com>
4555 * convert.cs: When converting to a pointer, use the proper Conv.U
4556 or Conv.I depending on the source data type.
4558 * cs-tokenizer.cs: Make the size for large decimal constants,
4561 2005-03-17 Martin Baulig <martin@ximian.com>
4563 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4564 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
4566 2005-03-17 Martin Baulig <martin@ximian.com>
4568 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4569 to bool so we can return an error condition.
4570 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4573 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
4575 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4578 2005-03-16 Raja R Harinath <rharinath@novell.com>
4580 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4581 Refactor to avoid traversing the list of assemblies, and to avoid
4582 string concatenation.
4583 * typemanager.cs (guid_attr_type): Remove.
4584 (negative_hits, pointers, references): Remove hashes.
4586 (GetConstructedType): New. Uses type_hash to handle constructed
4587 types (arrays, references, pointers).
4588 (GetReferenceType, GetPointerType): Use it.
4589 (GetNestedType): New. Uses type_hash to handle nested types of
4591 (LookupType, LookupTypeDirect): Remove.
4592 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
4593 'types' hash and LookupTypeReflection directly.
4594 (params_string, params_object): Use GetConstructedType.
4595 * namespace.cs (Namespace.cached_types): New. Cache of reflected
4597 (Namespace.Lookup): Use cached_types.
4598 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4599 provided by old TypeManager.LookupType.
4600 * rootcontext.cs (MakeFQN): Remove.
4601 * decl.cs (DeclSpace.MakeFQN): Likewise.
4602 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4603 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4604 TypeManager.GetConstructedType.
4605 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4607 2005-04-16 Zoltan Varga <vargaz@freemail.hu>
4609 * cs-parser.jay: Fix build.
4611 2005-03-15 Marek Safar <marek.safar@seznam.cz>
4613 * class.cs (TypeContainer.CircularDepException) New nested
4614 (MethodCore.CheckBase): Report CS1715 for properties and indexers.
4616 * cs-parser.jay: Reports CS1527 for any namespace element.
4618 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4621 * expression.cs (ParameterReference.IsAssigned): Changed error to
4623 (Error_WrongNumArguments): Moved CS0245 detection here.
4625 * statement.cs (Return.Resolve): Add CS1622 report.
4627 2005-03-11 Marek Safar <marek.safar@seznam.cz>
4629 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4631 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
4633 * attribute.cs expression.cs: Get rid of some allocations.
4635 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
4637 * doc.cs : just eliminate the latest change.
4639 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4641 * doc.cs : commented out the latest change. It breaks xml-030.cs
4643 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4645 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4646 fail. So invoke CreateType() in FindDocumentedType().
4648 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4650 * cs-tokenizer.cs : added IsKeyword().
4651 * doc.cs : Detect keyword incorrectly used as identifier.
4652 Allow identifiers prefixed by @.
4654 2005-03-10 Marek Safar <marek.safar@seznam.cz>
4656 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4657 It caused exception in namespace resolving (again!).
4659 * class.cs (Class.ctor): Removed exit.
4660 (PropertyMethod.ctor): ditto.
4662 * codegen.cs (Codegen.Reset): Reset static data.
4663 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4665 * cs-tokenizer.cs (Cleanup): Removed.
4667 * driver.cs (GetSystemDir): Rewrote to one line command.
4668 It caused problem with unloaded dynamic modules.
4669 (UnixParseOption): Removed Exit.
4670 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4671 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4672 Now can be mcs used as library.
4674 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4677 * location.cs (Reset): Reset static data.
4679 * namespace.cs (Reset): Reset static data.
4681 * report.cs (Report.Reset): Reset static data.
4683 * rootcontext.cs (RootContext.Reset): Reset static data.
4685 * tree.cs (RootTypes.ctor): Use Location.Null
4687 * typemanager.cs (TypeManager.Reset): Reset static data.
4688 (CoreLookupType): Removed Exit.
4689 (TypeHandle.Reset): Reset static data.
4691 2005-03-10 Raja R Harinath <rharinath@novell.com>
4694 * typemanager.cs (ComputeNamespaces): Import namespaces from
4695 referenced modules too.
4697 2005-03-09 Raja R Harinath <rharinath@novell.com>
4699 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4702 2005-03-09 Raja R Harinath <rharinath@novell.com>
4704 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4705 enclosing DeclSpace. This ensures that a name-lookup populates
4706 more caches and there are fewer 'TypeExpression's. Carve out
4707 nested type lookup into ...
4708 (LookupNestedTypeInHierarchy): ... this.
4710 2005-04-15 Martin Baulig <martin@ximian.com>
4712 Merged r41590 from MCS and make it work in the generics land.
4714 * generic.cs (TypeParameter.UpdateConstraints): Removed the
4717 * class.cs (PartialContainer.UpdateConstraints): Removed.
4718 (PartialContainer.CheckConstraints): Removed.
4719 (PartialContainer.SetParameterInfo): Store the constraints here.
4720 (PartialContainer.DefineTypeParameters): New public method;
4721 resolve the type parameter's constraints here. Note that the
4722 PartialContainer doesn't have an EmitContext anymore, so we must
4723 do this in the ClassPart.
4725 2005-03-09 Raja R Harinath <rharinath@novell.com>
4727 Clean up a few partial-class semantics.
4728 Fixes test-357.cs and cs1618-2.cs.
4729 * cs-parser.jay (struct_declaration): Use 'current_class' as
4730 parent of newly-created struct. Remove call to Register ().
4731 Use 'pop_current_class' to complete handing the current struct.
4732 (interface_declaration): Likewise.
4733 (class_declaration): Likewise.
4734 (enum_declaration): Use 'current_class' as parent of newly created
4736 (delegate_declaration): Likewise.
4737 (pop_current_class): New function. This is used to handle closing
4738 up the 'current_class' and 'current_container', and pointing them
4739 to the enclosing class/container.
4740 (CSharpParser): Initialize 'current_class' too.
4741 * decl.cs (MemberCore): Add check for invariant: a partial
4742 container is not a parsed entity, and thus does not enclose any
4744 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4745 (DeclSpace.BaseTypeExpr): Use it.
4746 (DeclSpace.LookupType): Add check for invariant.
4747 * class.cs (TypeContainer): Add check for invariant: a nested
4748 class should have the same NamespaceEntry as its enclosing class.
4749 (TypeContainer.EmitFieldInitializers): Make virtual.
4750 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4752 (TypeContainer.Register): Remove.
4753 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4754 null. Use TypeResolveEmitContext for resolving base types and
4755 interfaces. Move initialization of Parts.TypeBuilder here from
4757 (TypeContainer.DefineNestedTypes): ... here.
4758 (PartialContainer): Take a Namespace not a NamespaceEntry.
4759 (PartialContainer.Create): Don't use Register. Call the
4760 appropriate Add... function directly.
4761 (ClassPart): Take both the PartialContainer and the enclosing
4762 class as constructor arguments.
4763 (ClassPart.EmitFieldInitializers): Override.
4764 (ClassPart.PartFindNestedTypes): Remove.
4765 (FieldBase.GetInitializerExpression): Resolve the initializer
4766 expression in the emit context of the enclosing class.
4767 * tree.cs (RootTypes): Remove Register ().
4769 2005-03-08 Marek Safar <marek.safar@seznam.cz>
4771 * cs-parser.jay: Removed CS0134.
4773 * driver.cs: Removed CS1901.
4775 * expression.cs (SizeOf.DoResolve): Don't report CS0233
4776 for predefined types.
4778 2005-03-07 Duncan Mak <duncan@novell.com>
4780 * codegen.cs (Save): Catch UnauthorizedAccessException as
4781 well. Fixes bug #73454.
4783 2005-03-07 Marek Safar <marek.safar@seznam.cz>
4785 * cs-tokenizer.cs (xtoken): Add CS1035.
4787 * class.cs (MethodData.Define): Add CS0683.
4788 (FieldMember.ctor): Add CS0681.
4790 2005-03-07 Raja R Harinath <rharinath@novell.com>
4792 * ecore.cs (SimpleName.DoResolve): Rename from
4793 SimpleName.DoResolveAllowStatic.
4794 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4795 Pass 'intermediate' flag to MemberStaticCheck.
4796 (SimpleName.MemberStaticCheck): Skip "static check" only in case
4797 of "intermediate" lookups via MemberAccess.
4798 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
4799 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4801 2005-03-07 Raja R Harinath <rharinath@novell.com>
4804 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4805 slipped in because of variable names that are identical to a
4806 builtin type's BCL equivalent ('string String;', 'int Int32;').
4807 (PropertyExpr.EmitInstance): Likewise.
4809 2005-03-04 Marek Safar <marek.safar@seznam.cz>
4811 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4813 * report.cs (warning_ignore_table): Made public.
4815 2005-03-04 Raja R Harinath <rharinath@novell.com>
4818 * class.cs (MethodData.Emit): Pass 'container' to
4819 container.GetObsoleteAttribute instead of 'container.Parent'.
4821 2005-03-03 Marek Safar <marek.safar@seznam.cz>
4823 * cs-parser.jay: Add 1534 error test.
4825 * iterators.cs (Yield.CheckContext): Add error 1629.
4826 (Iterator.ctor): Save unsafe modifier.
4827 (MoveNextMethod.DoEmit): Restore unsafe context.
4829 * namespace.cs (UsingAlias): Better error message.
4831 2005-03-03 Dan Winship <danw@novell.com>
4833 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4834 the warning message [#73219]
4836 2005-03-03 Raja R Harinath <rharinath@novell.com>
4838 Fix compile with MCS 1.0.0.0.
4839 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4840 w_restore to not depend on string constant folding.
4842 2005-03-03 Raja R Harinath <rharinath@novell.com>
4844 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
4845 CS0246 check to users who passed 'silent = false'.
4846 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
4848 (SimpleName.SimpleNameResolve): Update.
4849 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
4850 (MemberAccess.IdenticalNameAndTypeName): Update.
4851 * doc.cs (FindDocumentedTypeNonArray): Update.
4853 2005-03-03 Raja R Harinath <rharinath@novell.com>
4855 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
4856 * parameters.cs (ComputeAndDefineParameters): Remove.
4857 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
4858 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
4859 Use GetParameterInfo.
4861 2005-03-02 Marek Safar <marek.safar@seznam.cz>
4863 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
4865 2005-03-02 Raja R Harinath <rharinath@novell.com>
4867 Unify DeclSpace.LookupType and DeclSpace.FindType.
4868 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
4869 is in charge of defining nested types on demand.
4870 (DeclSpace.LookupType): Use it when the current_type is a
4871 TypeBuilder. Use LookupTypeDirect for reflected types.
4872 (DeclSpace.FindType): Remove.
4873 (DeclSpace.LookupInterfaceOrClass): Likewise.
4874 (DeclSpace.DefineTypeAndParents): Likewise.
4875 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
4876 DeclSpace.LookupType.
4877 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
4878 * typemanager.cs (LookupType): Simplify.
4879 (AddUserType): Remove type from negative_hits.
4880 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
4881 * class.cs (TypeContainer.FindMembers): Move handling of nested
4883 (TypeContainer.FindMembers_NestedTypes): ... here.
4884 (TypeContainer.FindNestedType): Implement override.
4885 (ClassPart.FindNestedType): Delegate to PartialContainer.
4886 (ClassPart.PartFindNestedType): Looks up the nested types of the
4889 2005-04-14 Martin Baulig <martin@ximian.com>
4891 * generic.cs (ConstructedType): Moved all the type lookup and
4892 nested class logic into SimpleName.
4893 (ConstructedType.ResolveConstructedType): Our underlying type is
4894 already fully resolved; all the type lookup stuff is in
4897 * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
4898 constructed types here instead of in ConstructedType.
4900 * decl.cs (MemberName.GetTypeExpression): Always create a
4901 SimpleName, not a ConstructedType.
4902 (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
4904 2005-03-02 Martin Baulig <martin@ximian.com>
4906 * class.cs (TypeContainer.DoDefineMembers): We also need a default
4907 static constructor in static classes.
4909 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
4911 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
4912 sizeParamIndex is not specified.
4914 2005-03-01 Marek Safar <marek.safar@seznam.cz>
4917 * report.cs (WarningMessage.IsEnabled): Missing null check.
4919 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4921 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
4922 in the fields and not in the properties.
4924 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
4926 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
4929 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4931 * attribute.cs: Small refactoring (improved robustness).
4932 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
4933 (ValidateGuid): Removed.
4934 (Resolve): Removed referenced to above mentioned.
4935 (GetAttributeUsage): Made private and changed to work without
4937 (GetIndexerAttributeValue): Don't crash.
4938 (GetConditionalAttributeValue): Ditto.
4939 (GetClsCompliantAttributeValue): Ditto.
4940 (ExtractSecurityPermissionSet): All attributes exceptions are
4942 (GetPropertyValue): New helper.
4943 (GetMethodImplOptions): New method.
4944 (DefinePInvokeMethod): Reuse common code. Implemented handling of
4945 some missing properties.
4947 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
4948 (Method.ApplyAttributeBuilder): Updated.
4950 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
4953 2005-02-28 Raja R Harinath <rharinath@novell.com>
4956 * report.cs (Report.SymbolRelatedToPreviousError): Handle
4957 non-simple types (array, pointer, reference).
4959 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4961 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
4963 * class.cs (MethodCore.IsDuplicateImplementation): Special error
4965 (Method.CheckBase): Catch wrong destructor here.
4966 (MethodData.Define): Add errors 550, 668.
4968 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
4970 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
4972 * pending.cs (VerifyPendingMethods): Add error 551.
4974 * typemanager.cs (CSharpName): Next error report helper.
4976 2005-02-25 Marek Safar <marek.safar@seznam.cz>
4978 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
4979 attributes. Removed useless attribute double check.
4980 It saves almost 2MBs for corlib.
4982 2005-02-25 Raja R Harinath <rharinath@novell.com>
4985 * statement.cs (ExpressionStatement.Resolve): Make robust to being
4986 called twice in case of error.
4988 2005-02-23 Chris Toshok <toshok@ximian.com>
4990 Fix compiler portions of #72827.
4991 * statement.cs (Block.Emit): call Begin/EndScope on the
4992 EmitContext instead of the ILGenerator.
4994 * codegen.cs (EmitContext.BeginScope): new method, call
4995 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
4997 (EmitContext.BeginScope): same, but EndScope and CloseScope
4999 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5000 offset and call the superclass's OpenScope(int) with it.
5001 (SymbolWriter.CloseScope): get the current il
5002 offset and call superclass's CloseScope(int) with it.
5004 2005-02-23 Marek Safar <marek.safar@seznam.cz>
5006 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5007 CS1677 for out and ref as well.
5009 * class.cs (Method.Define): Add error CS1599 detection.
5011 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5013 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5015 * delegate.cs (Delegate.Define): Add error CS1599 detection.
5017 * support.cs.cs (ModifierDesc): New helper method.
5019 2005-02-23 Raja R Harinath <rharinath@novell.com>
5020 Abin Thomas <projectmonokochi@rediffmail.com>
5021 Anoob V E <projectmonokochi@rediffmail.com>
5022 Harilal P R <projectmonokochi@rediffmail.com>
5025 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5026 MemberLookup (used for error reporting) actually returns a result.
5027 Fix error report number (122, not 112).
5029 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
5030 Anoob V E <projectmonokochi@rediffmail.com>
5031 Harilal P R <projectmonokochi@rediffmail.com>
5034 * pending.cs (PendingImplementation.GetAbstractMethods):
5035 Find NonPublic members too.
5037 2005-02-22 Marek Safar <marek.safar@seznam.cz>
5039 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5042 * class.cs (MethodCore.CheckMethodAgainstBase):
5043 Add error 239 report.
5045 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5047 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5049 * class.cs (Operator.Define): Add error 217 report.
5051 2005-02-21 Raja R Harinath <rharinath@novell.com>
5054 * expression.cs (Invocation.IsApplicable): Make public.
5055 (Invocation.IsParamsMethodApplicable): Likewise.
5056 * delegate.cs (Delegate.VerifyApplicability): Don't use
5057 Invocation.VerifyArgumentCompat for parameter applicability
5058 testing. Use Invocation.IsApplicable and
5059 Invocation.IsParamsMethodApplicable.
5061 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5063 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5065 * class.cs (Operator.Define): Add error 217 report.
5067 2005-02-21 Raja R Harinath <rharinath@novell.com>
5069 * namespace.cs (UsingEntry.Resolve): Undo change below.
5071 2005-02-21 Raja R Harinath <rharinath@novell.com>
5074 * ecore.cs (Expression.MemberLookupFailed): Add argument to
5075 disable the error message when the extended MemberLookup also
5077 (Expression.MemberLookupFinal): Update.
5078 (SimpleName.DoSimpleNameResolve): Update.
5079 * expression.cs (MemberAccess.ResolveNamespaceOrType):
5080 Don't use MemberLookupFinal.
5081 (New.DoResolve): Update.
5082 (BaseAccess.CommonResolve): Update.
5084 2005-02-21 Raja R Harinath <rharinath@novell.com>
5087 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5088 occured previously, don't resolve again.
5090 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5093 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5094 argument. Call ResolveAttributeUsage for unresolved.
5095 when types doesn't match ctor arguments.
5097 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5098 for nested attribute classes.
5099 (Class.attribute_usage): Removed.
5100 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5101 for attribute class.
5103 * ecore.cs (IsAttribute): Removed.
5105 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5107 * rootcontext.cs (RegisterAttribute): Removed, attributes are
5109 (attribute_types): Removed.
5110 (EmitCode): Global attributes are emited as the latest.
5112 2005-02-18 Marek Safar <marek.safar@seznam.cz>
5114 * class.cs (EmitFieldInitializers): Don't emit field initializer
5115 for default values when optimilization is on.
5117 * constant.cs (Constant.IsDefaultValue): New property.
5119 * driver.cs: Add /optimize handling.
5123 * literal.cs: Implement new IsDefaultValue property.
5125 * rootcontext.cs (Optimize): New field, holds /optimize option.
5127 2005-02-18 Raja R Harinath <rharinath@novell.com>
5129 Fix crasher in re-opened #72347.
5130 * namespace.cs (Namespace.Lookup): Return null if
5131 DeclSpace.DefineType returns null.
5134 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5136 2005-02-18 Raja R Harinath <rharinath@novell.com>
5138 Fix remainder of #63202. Change semantics of DoResolveLValue: it
5139 now returns null if it cannot resolve to an lvalue.
5140 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5141 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5142 returned null. Remove check for SimpleName.
5143 (EventExpr.DoResolveLValue): New.
5144 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5145 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
5147 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
5149 (Unary.ResolveOperator): Move CS0211 check ...
5150 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
5152 (Unary.DoResolveLValue): Simplify.
5153 (AddressOf.DoResolveLValue): New.
5154 (ArrayAccess.DoResolveLValue): New.
5156 2005-02-16 Marek Safar <marek.safar@seznam.cz>
5158 * attribute.cs (Attribute.Resolve): Add arguments casting for
5159 when types doesn't match ctor arguments.
5161 2005-02-16 Raja R Harinath <rharinath@novell.com>
5163 Fix parts of #63202.
5164 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5165 lookup of operator in base type. Ensure that all checks happen
5166 when the operator resolves to an "op_..." method.
5168 2005-02-15 Raja R Harinath <rharinath@novell.com>
5171 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5172 'ignore_cs0104' parameter. Pass it to ...
5173 (NamespaceEntry.Lookup): ... this.
5174 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5175 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5176 (TypeLookupExpression.DoResolveAsTypeStep): Update.
5177 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5178 Update. Request that cs0104 errors be ignored.
5179 (ComposedCast.ResolveAsTypeStep): Update.
5181 2005-02-14 Raja R Harinath <rharinath@novell.com>
5184 * expression.cs (Invocation.BetterFunction): Remove support for
5185 comparing virtual functions and their overrides.
5186 (Invocation.IsOverride): New.
5187 (Invocation.OverloadResolve): Don't consider 'override' functions
5188 during candidate selection. Store them in a lookaside list.
5189 If the selected method is a 'virtual' function, use the list to
5190 find any overrides that are closer to the LHS type.
5192 2005-02-14 Marek Safar <marek.safar@seznam.cz>
5194 * expression.cs (New.DoResolve): Add complex core type reduction.
5195 (New.Constantify): Converts complex core type syntax like 'new int ()'
5198 2005-02-14 Raja R Harinath <rharinath@novell.com>
5200 * decl.cs (EntryType.EntryType): New constructor to create an
5201 updated copy of a cache entry.
5202 (MemberCache.AddMethods): Use it.
5203 (MemberCache.ClearDeclaredOnly): Remove.
5204 (MemberCache.MemberCache): Update.
5206 2005-02-11 Miguel de Icaza <miguel@novell.com>
5208 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5209 variable. This one is represents the actual low-level declaration
5210 of the method, as opposed to the semantic level `IsStatic'.
5212 An anonymous method which is hosted into a static method might be
5213 actually an instance method. IsStatic would reflect the
5214 container, while MethodIsStatic represents the actual code
5217 * expression.cs (ParameterReference): Use the new MethodIsStatic
5218 instead of IsStatic.
5220 * anonymous.cs (AnonymousMethod.Compatible): Pass the
5221 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5222 set on the current EmitContext.
5224 * expression.cs (Cast): Overload DoResolveLValue so we can pass
5225 resolve our casted expression as an LValue. This triggers the
5226 proper LValue processing that is later required by Assign.
5230 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5232 2005-02-11 Marek Safar <marek.safar@seznam.cz>
5234 C# 2.0 Fixed buffer implementation
5236 * anonymous.cs: Update after RegisterHelperClass renaming.
5238 * attribute.cs (AttributeTester.fixed_buffer_cache):
5239 Cache of external fixed buffers.
5240 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5241 implementation if field is fixed buffer else null.
5244 (TypeContainer.AddField): Accept FieldMember instead of Field.
5245 (FieldBase.IsFieldClsCompliant): Extracted code from
5246 VerifyClsCompliance descendant customization.
5247 (FixedField): New class handles fixed buffer fields.
5248 (FixedFieldExternal): Keeps information about imported fixed
5250 (IFixedField): Make access to internal or external fixed buffer
5253 * cs-parser.jay: Add fixed buffer parsing.
5255 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5258 * expression.cs (Indirection): Extended implementation to accept
5260 (PointerArithmetic.Emit): Get element from fixed buffer as well.
5261 (ElementAccess.MakePointerAccess): Get type as parameter.
5262 (DoResolve): Add fixed buffer field expression conversion.
5263 (DoResolveLValue): Ditto.
5264 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5265 (ArrayPtr): Derives from FixedBufferPtr.
5266 (ArrayPtr.Emit): Add extra emit for array elements.
5268 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5270 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5271 for compiler generated types.
5272 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5274 * statement.cs (Fixed): Refactored to be easier add fixed buffer
5275 and consume less memory.
5276 (Fixed.Resolve): Add fixed buffer case.
5278 * typemanager.cs (compiler_generated_attr_ctor,
5279 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5280 (HasElementType): Add our own implementation to work on every
5283 2005-02-11 Miguel de Icaza <miguel@novell.com>
5285 * anonymous.cs (CaptureContext): Track whether `this' has been
5288 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
5289 only captured `this' if it was implicitly done (instance
5290 methods/variables were used).
5292 * codegen.cs (EmitContext.CaptureThis): New method to flag that
5293 `this' must be captured.
5295 2005-01-30 Miguel de Icaza <miguel@novell.com>
5297 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5298 is null it means that there has been no need to capture anything,
5299 so we just create a sibling.
5301 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5303 Just a partial fix. The other half is fairly elusive.
5305 2005-02-10 Raja R Harinath <rharinath@novell.com>
5307 Fix #52586, cs0121-4.cs.
5308 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
5309 and return a hashtable.
5310 (MemberCache.ClearDeclaredOnly): New.
5311 (MemberCache.MemberCache): Update to change. Make a deep copy of
5312 the method_hash of a base type too.
5313 (MemberCache.AddMethods): Adapt to having a deep copy of the base
5314 type methods. Overwrite entries with the same MethodHandle so
5315 that the ReflectedType is correct. The process leaves in base
5316 virtual functions and their overrides as distinct entries.
5317 (CacheEntry): Now a class instead of a struct. It shouldn't alter
5318 matters since it was boxed in a ArrayList before.
5319 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5321 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
5322 case of a virtual function and its override (choose the overload
5324 (Invocation.OverloadResolve): Avoid 'override' members during
5325 'applicable_type' calculation.
5327 2005-03-28 Raja R Harinath <rharinath@novell.com>
5329 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5330 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5331 GetTypeHandle. It is possible for a reflected type to derive from
5332 a TypeBuilder (e.g., int[] derives from the TypeBuilder
5333 System.Array during mscorlib compilation).
5334 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5335 contain a method_hash, don't create one either. Don't create a
5336 deep copy of the base cache's method_hash.
5337 (MemberCache.SetupCache): Rename back from DeepCopy.
5338 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5339 already initialized. If we see an override function, add its
5340 underlying base virtual function to the member_hash too.
5342 2005-02-09 Raja R Harinath <rharinath@novell.com>
5344 Combine two near-redundant caches.
5345 * typemanager.cs (method_params): Rename from method_internal_params.
5346 (TypeManager.GetParameterData): New. Replace
5347 Invocation.GetParameterData.
5348 (TypeManager.LookupParametersByBuilder): Remove.
5349 * expression.cs (Invocation.method_parameter_cache): Remove.
5350 (Invocation.GetParameterData): Remove.
5352 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5355 2005-02-08 Raja R Harinath <rharinath@novell.com>
5358 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5359 TypeManager.multicast_delegate_type is null, resolve it by looking
5360 up "System.MulticastDelegate".
5361 * rootcontext.cs (RootContext.ResolveCore): Simplify.
5363 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
5364 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
5365 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
5368 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5369 (LabeledStatement.AddReference): New. Set 'referenced'.
5370 (Goto.Resolve): Use it.
5372 2005-02-05 John Luke <john.luke@gmail.com>
5374 * driver.cs: remove duplicate -doc line in Usage ()
5376 2005-02-04 Raja R Harinath <rharinath@novell.com>
5378 * location.cs (Location.AddFile): Fix CS2002 error report.
5380 2005-02-02 Martin Baulig <martin@ximian.com>
5382 * delegate.cs (Delegate.DefineType): Report an internal error if
5383 TypeManager.multicast_delegate_type is null. See bug #72015 for
5386 2005-02-02 Raja R Harinath <rharinath@novell.com>
5388 Fix a crasher in a variant of #31984.
5389 * const.cs (Constant.CheckBase): New override that defers the
5390 new-or-override check in case the base type hasn't been populated
5392 (Constant.Define): Ensure the new-or-override check is performed.
5394 2005-02-01 Duncan Mak <duncan@ximian.com>
5396 * const.cs (LookupConstantValue): Check that `ce' is not null
5397 before calling GetValue ().
5399 2005-02-01 Raja R Harinath <rharinath@novell.com>
5401 Fix test-334.cs (#69519).
5402 * cs-parser.jay (using_alias_directive): Pass in an expression to
5403 NamespaceEntry.UsingAlias.
5404 (using_namespace_directive): Pass in an expression to
5405 NamespaceEntry.Using.
5406 (namespace_name): Don't flatten to a string.
5407 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5408 (NamespaceEntry.AliasEntry.Resolve): Lookup using
5410 (NamespaceEntry.UsingEntry): Likewise.
5411 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5413 (NamespaceEntry.LookupForUsing): Remove.
5414 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5416 (NamespaceEntry.Lookup): Remove support for dotted names.
5418 2005-02-01 Raja R Harinath <rharinath@novell.com>
5420 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5422 (NamespaceEntry.ImplicitParent): Compute on demand.
5423 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5424 parallels the current.
5425 (NamespaceEntry.LookupForUsing): Use it.
5426 (NamespaceEntry.Lookup): If the current namespace-entry is
5427 implicit, don't search aliases and using tables.
5429 2005-02-01 Raja R Harinath <rharinath@novell.com>
5432 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5434 (TypeContainer.BaseCache): Compute on demand.
5435 (TypeContainer.FindMembers): Define constants and types if they're
5436 not already created.
5437 (FieldMember.Define): Move resetting of ec.InUnsafe before error
5439 * const.cs (Constant.Define): Make idempotent.
5441 2005-01-29 Miguel de Icaza <miguel@novell.com>
5443 * pending.cs: Produce better code (no nops produced by using Ldarg
5446 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5447 i - 1' it should be arg + 1.
5451 2005-01-28 Raja R Harinath <rharinath@novell.com>
5453 * attribute.cs (Attribute.CheckAttributeType): Make private
5455 (Attribute.ResolveType): Make virtual.
5456 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5457 handling of RootContext.Tree.Types.
5459 2005-01-27 Raja R Harinath <rharinath@novell.com>
5461 Update attribute-handling to use the SimpleName/MemberAccess
5463 * cs-parser.jay (attribute): Pass in an expression to the
5464 constructors of Attribute and GlobalAttribute.
5465 * attribute.cs (Attribute): Take an expression for the name.
5466 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
5467 passed in attribute name expression.
5468 (Attribute.CheckAttributeType): Use it.
5469 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5470 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5471 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
5472 argument to prevent error messages if the lookup fails.
5474 2005-01-27 Marek Safar <marek.safar@seznam.cz>
5476 * expression.cs (Indirection): Implemented IVariable interface
5477 to support indirection in AddressOf operator.
5478 (PointerArithmetic.Emit): Add optimalization for case where
5479 result can be precomputed.
5481 2005-01-26 Martin Baulig <martin@ximian.com>
5483 * class.cs (TypeContainer.AttributeTargets): Return the correct
5484 AttributeTargets depending on our `Kind' instead of throwing an
5485 exception; fixes #71632.
5487 2005-01-26 Marek Safar <marek.safar@seznam.cz>
5490 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5493 2005-03-17 Martin Baulig <martin@ximian.com>
5495 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5496 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
5498 2005-03-17 Martin Baulig <martin@ximian.com>
5500 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5501 to bool so we can return an error condition.
5502 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5505 2005-03-17 Martin Baulig <martin@ximian.com>
5507 * generic.cs (TypeMananager.IsIEnumerable): New public method.
5509 * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
5510 converting from an array-type of T to `IEnumerable<T>'.
5512 2005-03-16 Martin Baulig <martin@ximian.com>
5514 * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
5515 (Nullable.LiftedUnaryMutator): New public class.
5517 * expression.cs (UnaryMutator.DoResolve): Added support for
5520 2005-03-14 Martin Baulig <martin@ximian.com>
5522 * generic.cs (Nullable.NullCoalescingOperator): Implemented.
5524 2005-03-14 Martin Baulig <martin@ximian.com>
5526 * generic.cs (Nullable.LiftedBinaryOperator): Added support for
5527 the comparision operators `<', `>', `<=' and `>='.
5529 2005-03-13 Martin Baulig <martin@ximian.com>
5532 (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
5533 avoid confusion with the `NullLiteral'.
5534 (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
5536 2005-03-13 Martin Baulig <martin@ximian.com>
5538 * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
5539 comparing arbitrary types with the null literal.
5541 2005-03-13 Martin Baulig <martin@ximian.com>
5543 * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
5544 boolean operators '&&', '||', '&' and '|'.
5545 (Nullable.OperatorTrueOrFalse): New public class.
5547 * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
5548 instead of a `StaticCallExpr'; added support for nullables.
5550 2005-03-10 Martin Baulig <martin@ximian.com>
5553 (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
5554 rather than `etype.IsSubclassOf (TypeManager.value_type)'.
5556 2005-03-07 Martin Baulig <martin@ximian.com>
5558 * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
5559 it work if `expr' is not an IMemoryLocation.
5560 (Nullable.Lifted): Implement IMemoryLocation.
5561 (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
5564 2005-03-05 Martin Baulig <martin@ximian.com>
5566 * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
5567 (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
5568 (Nullable): Added support for lifted unary and binary operators.
5570 * expression.cs (Unary.DoResolve): Added support for nullable types.
5571 (Binary.DoResolve): Likewise.
5572 (Conditional.DoResolve): Likewise.
5574 2005-03-02 Martin Baulig <martin@ximian.com>
5576 * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
5578 * class.cs (ClassPart.SetParameterInfo): Override this.
5579 (PartialContainer.SetParameterInfo): Override this.
5580 (TypeContainer.CheckConstraints): New protected method.
5581 (PartialContainer.CheckConstraints): Override this and check
5582 whether the same contraints were specified in all parts of a
5583 partial generic type definition.
5584 (PartialContainer.UpdateConstraints): New public method.
5586 * generic.cs (TypeParameter.UpdateConstraints): New public method.
5588 2005-03-02 Martin Baulig <martin@ximian.com>
5590 Committing a patch from Carlos Alberto Cortez to fix #72887.
5592 * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
5593 casts from `T []' to `int []'.
5595 2005-03-02 Martin Baulig <martin@ximian.com>
5597 * generic.cs (TypeManager.IsEqual): Make this symmetric.
5599 * expression.cs (Binary.ResolveOperator): When resolving a
5600 BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
5601 `=='. Fixes #71866. See gen-127.cs.
5603 2005-03-02 Martin Baulig <martin@ximian.com>
5605 * class.cs (TypeContainer.DoDefineMembers): We also need a default
5606 static constructor in static classes.
5608 2005-03-02 Martin Baulig <martin@ximian.com>
5611 (NullableType.Name, NullableType.FullName): Add a "?" to the name.
5612 (Nullable.LiftedConversion): Added support for user-defined
5615 * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
5617 * cs-parser.jay: Use ComposedCast everywhere instead of
5618 NullableType, so we don't need to check for NullableType
5620 (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
5621 case where we'll be resolved into a `parenthesized_expression_0'
5625 (Convert.UserDefinedConversion): Added nullable conversions.
5627 2005-02-28 Martin Baulig <martin@ximian.com>
5629 * generic.cs (TypeManager.IsNullableType): New static method.
5630 (Nullable): New abstract class.
5631 (Nullable.NullLiteral): New public class.
5632 (Nullable.LiftedConversion): New public class.
5634 * cs-parser.jay (non_expression_type): Changed `builtin_types' to
5635 `builtin_types opt_nullable'.
5638 (Convert.ImplicitConversionStandard): Added nullable conversions.
5639 (Convert.ExplicitConversionStandard): Likewise.
5640 (Convert.ExplicitConversion): Likewise.
5642 2005-02-26 Martin Baulig <martin@ximian.com>
5644 * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
5645 begin with a "?", for instance "?[]". Don't do a type lookup if
5648 2005-02-25 Martin Baulig <martin@ximian.com>
5650 The first part of Nullable Types :-)
5652 * generic.cs (NullableType): New public class.
5653 (NullCoalescingOperator): New public class.
5654 (TypeArguments.Resolve): Add a CS0306 check.
5656 * cs-parser.jay (opt_error_modifier): Removed, this was unused.
5657 (opt_nullable): New rule.
5658 (type): Added `opt_nullable' to `namespace_or_type_name',
5659 `builtin_types' and `pointer_type'.
5660 (array_type): Added `opt_nullable'.
5661 (opt_rank_specifier_or_nullable): New rule; this is the
5662 combination of `opt_rank_specifier' and `opt_nullable'.
5663 (opt_error): New rule; catch errors here.
5664 (nullable_type_or_conditional): New rule; we use this to check for
5665 nullable and still detect the conditional operator.
5666 (local_variable_type): Use `opt_rank_specifier_or_nullable'
5667 instead `opt_rank_specifier'.
5669 * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
5672 2005-02-24 Martin Baulig <martin@ximian.com>
5674 * README, README.Changes: Removed; they're old and obsolete.
5676 2005-02-22 Martin Baulig <martin@ximian.com>
5678 * generic.cs (TypeParameter.Resolve): If resolving the constraints
5679 returned an error, set `constraints' to null to avoid a crash
5681 (TypeParameter.ResolveType): Likewise.
5683 2005-02-22 Martin Baulig <martin@ximian.com>
5686 (Constraints.ResolveTypes): Protect against being called twice.
5687 (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
5688 (TypeParameter.ResolveType): New public method; calls
5689 constraints.ResolveTypes().
5690 (TypeParameter.DefineType): Moved constraints.ResolveType() out
5691 into the new ResolveType().
5692 (GenericMethod.Define): Call ResolveType() on all our
5695 2005-02-21 Martin Baulig <martin@ximian.com>
5698 (TypeManager.generic_nullable_type): New static public field.
5699 (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
5702 (RootContext.ResolveCore): Resolve "System.Nullable`1".
5704 2005-02-15 Martin Baulig <martin@ximian.com>
5706 * generic.cs (ConstructedType.Constraints): Correctly check
5707 constraints if the argument type is a type parameter; fixes
5710 2005-02-02 Martin Baulig <martin@ximian.com>
5712 * delegate.cs (Delegate.DefineType): Report an internal error if
5713 TypeManager.multicast_delegate_type is null. See bug #72015 for
5716 2005-01-29 Miguel de Icaza <miguel@novell.com>
5718 * pending.cs: Produce better code (no nops produced by using Ldarg
5721 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5722 i - 1' it should be arg + 1.
5726 2005-01-26 Martin Baulig <martin@ximian.com>
5728 * cs-parser.jay (indexer_declarator): Don't report an error if we
5729 have type parameters since we can be an explicit interface
5730 implementation; fixes #71449.
5732 2005-01-26 Martin Baulig <martin@ximian.com>
5734 * class.cs (TypeContainer.AttributeTargets): Return the correct
5735 AttributeTargets depending on our `Kind' instead of throwing an
5736 exception; fixes #71632.
5738 2005-01-26 Martin Baulig <martin@ximian.com>
5740 * delegate.cs (Delegate.DefineType): Correctly define our type
5741 parameters. Fixes #71483.
5743 2005-01-25 Raja R Harinath <rharinath@novell.com>
5746 * expression.cs (MemberAccess.DoResolve): Don't complain with
5747 cs0572 when the LHS of a member access has identical name and type
5750 2005-01-25 Marek Safar <marek.safar@seznam.cz>
5753 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5755 Create custom PermissionSet only for PermissionSetAttribute.
5757 2005-01-24 Marek Safar <marek.safar@seznam.cz>
5760 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5761 delegates in static class.
5763 2005-01-24 Martin Baulig <martin@ximian.com>
5765 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5766 merging an implicit block, just use its reachability.
5768 * statement.cs (Block.Resolve): Make the unreachable code check
5769 work wrt. implicit blocks; see test-337 from #63842.
5771 2005-01-21 Alp Toker <alp@atoker.com>
5773 * cs-parser.jay: destructor_declaration's container is PartialContainer
5774 not Class when partial types are used, so use Kind prop instead of
5777 2005-01-22 Miguel de Icaza <miguel@ximian.com>
5779 * cs-parser.jay: Improve error reporting when an interface
5782 2005-01-20 Dick Porter <dick@ximian.com>
5784 * support.cs: SeekableStreamReader fix from Sandor Dobos
5785 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5786 chars are read. Fixes bug 70369.
5788 2005-01-20 Raja R Harinath <rharinath@novell.com>
5790 * cs-parser.jay (catch_clause): Simplify current_block handling
5793 2005-01-17 Miguel de Icaza <miguel@ximian.com>
5795 * convert.cs (ImplicitStandardConversionExists): Synchronize the
5796 code with ImplicitStandardConversion to handle the implicit
5797 conversion of method groups into valid delegate invocations.
5799 The problem is that in parameter handling we were using this code
5800 path. Fixes bug #64698
5802 2005-01-19 Raja R Harinath <rharinath@novell.com>
5804 * cs-parser.jay: Fix several infelicities.
5805 - Avoid assigning to the parser value stack. Code like
5806 '$3 = null' is unclean. Synthesize a value for the code block
5808 - Avoid using oob_stack for storing location information. Use ...
5809 (_mark_): ... this. New (empty) rule. Saves the current location
5811 (foreach_statement): Avoid using oob_stack for current_block
5812 handling. Use technique used in for_statement and
5813 using_statement. Synthesize a value for the code block to store
5814 additional intermediate information.
5816 2005-01-13 Miguel de Icaza <miguel@ximian.com>
5818 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5819 of a different type is only allowed to private fields of a
5820 containing type, not on fields of a base class.
5822 See test-174.cs and error cs0122-9.cs
5824 2005-01-13 Raja R Harinath <rharinath@novell.com>
5826 Fix test-335.cs (bug #58126).
5827 * cs-parser.jay (argument): Split out non-expression parts of the
5828 rule into 'non_simple_argument'.
5829 (invocation_expression): Support parenthesized invocations with
5830 multiple arguments, and with single non-simple arguments.
5832 2005-01-13 Raja R Harinath <rharinath@novell.com>
5834 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5837 2005-01-12 Raja R Harinath <rharinath@novell.com>
5839 Fix cs0038-1.cs, cs1640-6.cs.
5840 * ecore.cs (Expression.Resolve): Remove special-case for
5841 SimpleName in error-handling.
5842 (Expression.almostMatchedMembers): Relax access permission to
5844 (Expression.MemberLookupFailed): Handle duplicates in
5845 almostMatchedMembers list.
5846 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5847 * expression.cs (New.DoResolve): Report CS1540 for more cases.
5848 * typemanager.cs (GetFullNameSignature): Use the MethodBase
5849 overload if the passed in MemberInfo is a MethodBase.
5851 2005-01-25 Martin Baulig <martin@ximian.com>
5854 (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
5856 2005-01-12 Marek Safar <marek.safar@seznam.cz>
5859 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5860 for non-CAS & merge permission sets properly.
5862 2005-01-11 Raja R Harinath <rharinath@novell.com>
5864 Improve standard-compliance of simple name and member access
5865 resolution. Fixes bugs #52697, #57200, #67520, #69519.
5866 * ecore.cs (FullNamedExpression): New abstract base class
5867 for Namespaces and TypeExpressions.
5868 (ResolveFlags.SimpleName): Remove.
5869 (SimpleName): Remove support for dotted names.
5870 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
5871 DeclSpace.FindType and DeclSpace.LookupType.
5872 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5873 (Expression.ExprClassName): Make member function.
5874 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5875 a namespace. Remove creation of dotted "SimpleName"s.
5876 (MemberAccess.DoResolve): Likewise.
5877 * decl.cs (DeclSpace.Cache): Make private.
5878 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5879 (DeclSpace.FindType): Update.
5880 (DeclSpace.LookupType): Move here from RootContext. Return a
5881 FullNamedExpression.
5882 * namespace.cs (Namespace): Derive from FullNamedExpression
5883 so that it can be part of expression resolution.
5884 (Namespace.Lookup): Return an FullNamedExpression.
5885 (NamespaceEntry.LookupAlias): Lookup aliases only in current
5887 * rootcontext.cs (NamespaceLookup): Remove.
5888 (LookupType): Move to DeclSpace.
5889 * attribute.cs (CheckAttributeType): Update.
5890 * doc.cs (FindDocumentedType): Remove allowAlias argument.
5891 (FindDocumentedTypeNonArray): Likewise.
5893 2005-01-11 Raja R Harinath <rharinath@novell.com>
5895 Fix cs0509.cs, cs1632.cs.
5896 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5897 is the same as IsInterface.
5898 (TypeContainer.GetClassBases): Likewise.
5899 * statement.cs (LabeledStatement.ig): New field.
5900 (LabeledStatement.LabelTarget): Save ILGenerator which created the
5902 (LabeledStatement.DoEmit): Check that the label was created with
5903 the same ILGenerator.
5905 2005-01-10 Marek Safar <marek.safar@seznam.cz>
5908 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5909 accessors to its properties.
5911 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5912 from accessors to property.
5914 2005-01-10 Marek Safar <marek.safar@seznam.cz>
5917 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5920 2005-01-08 Miguel de Icaza <miguel@ximian.com>
5922 * attribute.cs: Check for null and empty strings.
5924 I have lost another battle to Paolo.
5926 2005-01-07 Marek Safar <marek.safar@seznam.cz>
5929 * class.cs (PropertyMethod): Set Parent field in ctors.
5930 (SetMethod.InternalParameters): Add unsafe switch hack.
5931 Override MarkForDuplicationCheck where it is appropriate.
5933 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5934 It says whether container allows members with the same name.
5936 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5937 Removed is_method parameter.
5939 2005-01-06 Duncan Mak <duncan@ximian.com>
5941 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
5942 because the previous change led to incorrect reporting of CS1032
5943 ("Cannot define/undefine preprocessor symbols after first token in
5944 file"). Instead of using `tokens_seen' as the only flag that
5945 triggers CS1040, introduce `comments_seen'. This new flag is used
5946 to signify having seen comments on the current line, so it is
5947 unset after a newline.
5949 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
5951 * doc.cs : When searching for a type, find nested type too.
5952 This fixes bug #71040.
5954 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
5957 - Warn missing member comment on those classes which also does not
5958 have doc comments. Fixed bug #71041.
5959 - Don't warn missing doc comment on default constructor.
5962 2005-01-06 Duncan Mak <duncan@ximian.com>
5964 * cs-tokenizer.cs (xtoken): After handling traditional C-style
5965 comments, set `tokens_seen' to true. This allows us to detect
5966 misplaced preprocessor directives (i.e. not at the beginning of
5967 the a line, nor after whitespaces). In that case, report error
5968 CS1040. This fixes bug #56460.
5970 * cs-parser.jay (interface_member_declaration): Add checks for
5971 IsExplicitImpl, and report CS0541 error if an interface member is
5972 defined as an explicit interface declaration.
5974 2005-01-06 Marek Safar <marek.safar@seznam.cz>
5977 * class.cs (PropertyMethod): Set Parent field in ctors.
5978 (SetMethod.InternalParameters): Add unsafe switch hack.
5980 * decl.cs (MemberCore.Parent): Cannot be readonly.
5982 2005-01-06 Raja R Harinath <rharinath@novell.com>
5984 * decl.cs (DeclSpace.ResolveType): Remove.
5985 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5986 Merge in code from ...
5987 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
5988 * class.cs, enum.cs: Update to changes.
5990 2005-01-06 Miguel de Icaza <miguel@ximian.com>
5992 * anonymous.cs: Ensure that we init the scope of our parent if it
5993 has not been initialized yet.
5995 2004-12-30 Duncan Mak <duncan@ximian.com>
5997 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
5998 if field.FieldBuilder is null. Fixes #70758.
6000 * convert.cs: Fixed some typos and updated some of the comments.
6001 (ImplicitStandardConversionExists):
6002 (TryImplicitIntConversion): If `target_type' is an interface and
6003 the type of `ic' implements this interface, return true or a new
6004 BoxedCast instead of null. This fixes #70468.
6006 2004-12-29 Duncan Mak <duncan@ximian.com>
6008 * expression.cs (Argument.Emit): Check that Expr is
6009 IMemoryLocation before casting to it, and report CS1510 otherwise.
6013 2004-12-21 Ben Maurer <bmaurer@ximian.com>
6015 * statement.cs (Block.ThisVariable): remove the recursion here, to
6016 make the --profile more sane.
6018 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
6020 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6021 assembly, by JB Evain.
6023 2004-12-17 Raja R Harinath <rharinath@novell.com>
6025 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
6026 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6027 "parent" refers to enclosing type/class. "base" refers to superclass.
6029 2004-12-17 Raja R Harinath <rharinath@novell.com>
6031 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6032 Ensure that we only have GlobalAttributes.
6033 * attribute.cs (Attribute.Emit): Make non-virtual.
6034 (GlobalAttribute.Emit): Remove.
6035 (Attribute.Resolve): Make virtual.
6036 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
6037 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6038 the argument. Don't create one.
6039 (Attribute.GetObsoleteAttribute): Likewise.
6040 (Attribute.GetClsCompliantAttributeValue): Likewise.
6041 * class.cs, decl.cs: Update to changes.
6043 2004-12-17 Marek Safar <marek.safar@seznam.cz>
6045 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6047 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6049 * statement.cs (Foreach.Resolve): Add error 186 report.
6051 2004-12-16 Marek Safar <marek.safar@seznam.cz>
6053 * expression.cs (Conditional.DoResolve): Add warning 429.
6055 * statement.cs (If.Resolve): Add warning 665.
6057 2004-12-16 Raja R Harinath <rharinath@novell.com>
6059 New invariant: RootContext.Tree.Types.NamespaceEntry == null
6060 except when in the parser, and in GlobalAttribute.
6061 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6062 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6063 RootContext.Tree.Types.NamespaceEntry once work is done.
6064 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
6065 and resets RootContext.Tree.Types.NamespaceEntry.
6067 2004-12-15 Marek Safar <marek.safar@seznam.cz>
6069 * cs-parser.jay: Don't create a block for every variable.
6071 2004-12-14 Miguel de Icaza <miguel@ximian.com>
6073 * location.cs: Provide extra information.
6075 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6076 variables from the captured environment, it is the ldarg_0.
6078 2004-12-14 Marek Safar <marek.safar@seznam.cz>
6080 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6083 * class.cs: Changed warning level for 169 to avoid developer
6084 displeasure from warning flooding. It will be changed back when they
6085 fix most of current BCL warnings.
6087 * RootContext.cs: Pushed default WarningLevel to 3.
6089 * statement.cs: Removed unused variable.
6091 2004-12-14 Marek Safar <marek.safar@seznam.cz>
6093 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6094 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6095 Add error 502 report.
6096 (StaticClass.DefineType): Add error 441 report.
6097 (Class.AllowedModifiersProp): New virtual property as temporary
6098 extension to AllowedModifiers.
6099 (Class.DefineType): Add error 418 report. Moved ModFlags check here
6100 to share implementation with StaticClass and don't call virtual
6103 * driver.cs (MainDriver): Add error 1558 test.
6105 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6106 report. Moved error 36 test here.
6108 * statement.cs (Throw.Resolve): Add error 724 report.
6110 * typemanager.cs: Add out_attribute_type core type.
6112 2004-12-13 Marek Safar <marek.safar@seznam.cz>
6114 * class.cs (TypeContainer.VerifyClsCompliance): Add error
6116 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6118 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6121 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6123 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
6124 Add error 3023 report.
6125 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6127 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6130 2004-12-12 John Luke <john.luke@gmail.com>
6132 * driver.cs (AddArgs): take -- into account when
6133 adding arguments, fixes bug 65710
6135 2004-12-12 Martin Baulig <martin@ximian.com>
6137 * expression.cs (Unary.TryReduceNegative): Added support for
6138 SByteConstant and ByteConstant.
6139 (Unary.Reduce): Check error values from TryReduceNegative().
6141 2004-12-10 Marek Safar <marek.safar@seznam.cz>
6143 * attributes.cs (Attribute.Resolve): Avoid multiple error report
6144 and report exception as error 182.
6146 2004-12-10 Raja R Harinath <rharinath@novell.com>
6148 * driver.cs (Main): Fix message when there are warnings.
6150 2004-12-09 Miguel de Icaza <miguel@ximian.com>
6152 * delegate.cs: Fixed my fix from yesterday, sorry about that.
6154 2004-12-09 Marek Safar <marek.safar@seznam.cz>
6156 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
6157 Reduced number of warnings.
6159 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6161 2004-12-08 Miguel de Icaza <miguel@ximian.com>
6163 * driver.cs: Removed message.
6165 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6167 2004-12-08 <vargaz@freemail.hu>
6169 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6171 2004-12-08 Martin Baulig <martin@ximian.com>
6173 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6174 instead of a CS3002 for properties and indexer.
6176 2004-12-08 Martin Baulig <martin@ximian.com>
6178 * decl.cs (MemberName.ToString): Make this work again.
6180 2004-12-08 Marek Safar <marek.safar@seznam.cz>
6182 * attribute.cs (Resolve): Add error 591 detection.
6184 * class.cs (FieldMember.Define): Add error 1547 detection.
6185 (Indexer.Define): Add error 620 detection.
6186 (Operator.Define): Add error 590 detection.
6188 * ecore.cs: Missing argument for error 79.
6190 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6193 2004-12-07 Marek Safar <marek.safar@seznam.cz>
6196 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6199 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
6201 * cs-parser.jay : handle doc comments on implicit/explicit operators.
6202 Some operator comments were suppressed.
6203 * doc.cs : Implicit/explicit operator name in doc comments are like
6204 "op_Explicit(type)~returnType", so added suffix handling.
6206 2005-01-21 Alp Toker <alp@atoker.com>
6208 * cs-parser.jay: destructor_declaration's container is PartialContainer
6209 not Class when partial types are used, so use Kind prop instead of 'is'.
6211 2004-12-12 Martin Baulig <martin@ximian.com>
6213 * expression.cs (Unary.TryReduceNegative): Added support for
6214 SByteConstant and ByteConstant.
6215 (Unary.Reduce): Check error values from TryReduceNegative().
6217 2004-12-11 Martin Baulig <martin@ximian.com>
6219 * support.cs (ReflectionParameters.ParameterName): If we have a
6220 `gpd', call `ParameterName' on it.
6222 * parameter.cs (Parameter.GetParameterAttributes): New static method.
6224 * pending.cs (PendingImplementation.DefineProxy): Call
6225 DefineParameter() for all of the MethodBuilder's arguments.
6227 2004-12-09 Martin Baulig <martin@ximian.com>
6229 * doc.cs (DocUtil): Make this a static class.
6231 2004-12-09 Martin Baulig <martin@ximian.com>
6233 * expression.cs (Invocation.InferType): Moved the type inference
6234 implementation into TypeManager.
6236 * generics.cs (TypeManager): Moved the type inference
6237 implementation here.
6239 2004-12-09 Martin Baulig <martin@ximian.com>
6241 * typemanager.cs (TypeManager): Make this a partial class.
6244 (TypeManager): Move the generics part of `TypeManager' here.
6246 2004-12-08 Martin Baulig <martin@ximian.com>
6248 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6249 instead of a CS3002 for properties and indexer. Added CS3024
6250 check for generic interfaces.
6252 * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
6253 instances are not CLS-compliant.
6255 2004-12-08 Martin Baulig <martin@ximian.com>
6258 (void_pointer_expression): New rule for `void*', `void**' etc.
6259 (typeof_expression): Add `void_pointer_expression'; fixes #66846.
6261 2004-12-08 Martin Baulig <martin@ximian.com>
6263 * expression.cs (Invocation.InferType): Removed the hack for
6264 MethodCore.MayUnify().
6266 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
6269 * class.cs (MethodCore.MayUnify): Use
6270 TypeManager.MayBecomeEqualGenericTypes().
6272 2004-12-08 Martin Baulig <martin@ximian.com>
6274 * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
6275 parameter, box it. Fixes #69233.
6277 2004-12-08 Martin Baulig <martin@ximian.com>
6279 * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
6280 have the ctor constraint. Fixes #68326.
6282 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
6284 * cs-parser.jay : interface comment was not consumed because of
6285 extra opt_semicolon before doc handling.
6287 2004-12-03 Raja R Harinath <rharinath@novell.com>
6289 Fix test-327.cs, test-328.cs, and put in early infrastructure
6290 for eventually fixing #52697.
6291 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6292 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6294 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6295 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6296 (VerifyUsing, error246): Update.
6297 * rootcontext.cs (RootContext.NamespaceLookup): Just use
6298 'NamespaceEntry.LookupNamespaceOrType'.
6300 2004-12-07 Martin Baulig <martin@ximian.com>
6302 * driver.cs: Call it "BETA SOFTWARE" :-)
6304 2004-12-06 Raja R Harinath <rharinath@novell.com>
6306 Fix crash on cs0657-17.cs.
6307 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6308 Use RootContext.Tree.Types, not 'new RootTypes ()'.
6309 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6310 the case where the NamespaceEntry gets overwritten.
6312 2004-12-06 Marek Safar <marek.safar@seznam.cz>
6314 Fixed #69195, #56821
6315 * ecore.cs (ResolveBoolean): Tiny refactoring.
6317 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6318 of right expression resolving when left is false constant and
6319 operator is LogicalAnd OR true constant and operator is LogicalOr.
6321 * statement.cs (ResolveUnreachable): Always reports warning.
6323 2004-12-05 Miguel de Icaza <miguel@ximian.com>
6325 * class.cs: Distinguish between 1721 and 1722 (just a little help
6326 for the programmer).
6328 2004-12-03 Miguel de Icaza <miguel@ximian.com>
6330 * delegate.cs: Only allow this on new versions of the language.
6332 2004-12-02 Duncan Mak <duncan@ximian.com>
6334 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6336 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6337 here as a static method. Take an additional bool out parameter
6338 `must_do_cs1540_check' for signaling to InstanceResolve.
6339 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6340 member field from PropertyExpr class and made it an argument of
6342 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6343 check for MarshalByRefObject, and report CS0122 instead of CS1540.
6344 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6345 and `remove_accessor' as well as InstanceResolve: report CS0122
6350 2004-12-07 Martin Baulig <martin@ximian.com>
6352 * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
6353 and CS0692 where appropriate.
6355 2004-12-06 Martin Baulig <martin@ximian.com>
6357 * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
6358 IsDuplicateImplementation() and improved it.
6360 * expression.cs (Invocation.InferTypeArguments): Added
6361 `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
6362 and removed the "ref" modifier from `infered_types'.
6364 * decl.cs (MemberName.ToString): Removed the exception.
6366 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
6368 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6369 comments are allowed.
6371 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6373 * delegate.cs: Add checks for subtypes in paramaters and return values
6374 in VerifyMethod () to add support for Covariance/Contravariance
6377 2004-12-02 Miguel de Icaza <miguel@ximian.com>
6379 * report.cs: Remove extra closing parenthesis.
6381 * convert.cs (Error_CannotImplicitConversion): If the name of the
6382 types are the same, provide some extra information.
6384 2004-12-02 Marek Safar <marek.safar@seznam.cz>
6387 * attribute.cs (Resolve): Improved implementation of params
6388 attribute arguments.
6390 * support.cs (ParameterData): Add HasParams to be faster.
6392 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
6394 all things are for /doc support:
6396 * doc.cs: new file that supports XML documentation generation.
6397 * mcs.exe.sources: added doc.cs.
6399 Handle /doc command line option.
6400 Report error 2006 instead of 5 for missing file name for /doc.
6401 Generate XML documentation when required, after type resolution.
6403 Added support for picking up documentation (/// and /** ... */),
6404 including a new XmlCommentState enumeration.
6406 Added lines to fill Documentation element for field, constant,
6407 property, indexer, method, constructor, destructor, operator, event
6408 and class, struct, interface, delegate, enum.
6409 Added lines to warn incorrect comment.
6411 Added Documentation field (passed only when /doc was specified).
6413 Added DocComment, DocCommentHeader, GenerateDocComment() and
6414 OnGenerateDocComment() and some supporting private members for
6415 /doc feature to MemberCore.
6417 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6419 Added overriden DocCommentHeader.
6421 Added overriden DocCommentHeader and GenerateDocComment().
6423 2004-12-01 Miguel de Icaza <miguel@ximian.com>
6425 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6426 unwrapping the enumeration values, chain to
6427 DoConstantNumericPromotions again, so we can promote things to the
6428 fundamental types (takes care of enums that are bytes, sbytes).
6432 2004-12-01 Raja R Harinath <rharinath@novell.com>
6434 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6435 Fix long-standing bug in type-lookup. Use FindType instead of
6436 LookupType when ec.ResolvingTypeTree.
6437 (Attribute.ResolveType, Attribute.Resolve)
6438 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6440 (Attributes.Search): Remove internal version. Update.
6441 (Attributes.SearchMulti): Update.
6442 (Attributes.GetClsCompliantAttribute): Remove.
6443 (Attributes.GetIndexerNameAttribute): Remove.
6444 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6445 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6446 * class.cs (Indexer.Define): Likewise.
6448 2004-12-01 Marek Safar <marek.safar@seznam.cz>
6451 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6452 MarshallByReference members access.
6454 * expression.cs: Use CheckMarshallByRefAccess;
6455 Better error CS0197 message.
6457 * report.cs: Print whole related error message.
6459 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6461 * class (GetClassBases): Better error 60 report.
6462 (EventProperty): Disabled warning 67 detection.
6464 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6467 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6469 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6472 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6475 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6477 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6479 2004-11-26 Miguel de Icaza <miguel@ximian.com>
6481 * attribute.cs (Attribute.Resolve): Refine error reporting and
6482 report a cs0117 if the identifier does not exist, to distinguish
6483 from 0617 which is a miss-use of the actual identifier.
6485 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6486 between cs0070 and cs0079.
6488 * class.cs (MemberBase.DoDefine): When reporting a wrong
6489 accessibility level, we use MethodCore to compare instead of
6490 Method (this was a regression in some refactoring effort).
6492 So now we correctly report cs0056 again.
6494 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6495 testing the target_type (which was known to be object_type) and
6496 not the source type (which is anonymous_method).
6498 Fixed reporting of error cs1660.
6500 * expression.cs (UserCast.Source): Expose the underlying cast.
6502 * statement.cs (Switch.SwitchGoverningType): Sort the list of
6503 allowed types to find a match to int32 first (most common).
6505 In addition, it ignores any ImplicitUserConversions that did an
6506 internal implicit conversion (as the switch statement allows only
6507 one integral conversion to exist).
6509 * class.cs (PartialContainer.Create): rename `name' to
6510 `member_name' for clarity. Then replace the string calls with a
6511 call to MemberName.GetPartialName, as now using
6512 MemberName.ToString is an error (this is due to the side effects
6513 it had, that were fixed in the past).
6515 This will restore the error reporting on a number of partial class
6516 errors that were missusing this (and getting an exception as a
6517 results, which is now just a plain textual warning, because
6518 yyparse debug output would crash otherwise).
6520 2004-11-26 Raja R Harinath <rharinath@novell.com>
6522 * Makefile (PROGRAM_INSTALL_DIR): Remove.
6524 2004-11-25 Ben Maurer <bmaurer@ximian.com>
6526 * rootcontext.cs (LookupType): Make sure to cache lookups that
6527 don't give us a negative result. This saves about 5% of corlib
6530 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6532 * report.cs (AbstractMessage.Print): messages are sent to stderr
6534 * class.cs (TypeContainer.GetClassBases): It is an error to have a
6535 non-interface in the list of interfaces (at this point, either
6536 parent was properly set, or a base class is being listed in the
6537 interfaces section).
6539 This flags error 1722, and resolves the crash from bug 69259.
6541 2004-11-25 Ben Maurer <bmaurer@ximian.com>
6543 * statement.cs (Using.EmitExpressionFinally): make this work right
6544 for valuetypes. Fixes 69926.
6546 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6548 * const.cs (Const.ChangeType): Cope with the "0 literal can be
6549 converted to an enum" here, before we try to change the underlying
6550 type. This code exists, but it is a different code path than the
6551 one used while encoding constants.
6553 (ImplicitReferenceConversionExists): In addition, resynchronized
6554 the code here, so it matches the same code in
6555 ImplicitReferenceConversionExists for the `from any class-type S
6556 to any interface-type T'.
6558 2004-11-25 Marek Safar <marek.safar@seznam.cz>
6560 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6562 2004-11-24 Miguel de Icaza <miguel@ximian.com>
6564 * cs-parser.jay: Use verbosity accordingly.
6566 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6568 * expression.cs (Unary.ResolveOperator): Do not report warning;
6569 AddressOf reads from variable.
6571 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6573 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6577 * attribute.cs (Attributable): Removed CheckTargets.
6578 (Attributes.Emit): Explicit attribute targets are tested here.
6580 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6581 not enabled for interfaces.
6583 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6584 (GetAssemblyName): Ouch next bug there.
6586 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6588 * expression.cs: Error 275 added.
6590 2004-11-23 Marek Safar <marek.safar@seznam.cz>
6592 Fix bug #69177 (Implemented decimal constant support)
6594 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6595 (BinaryFold): Add DecimalConstant.
6597 * const.cs (Define): Decimal constant
6599 (ChangeType): Add decimal type handling.
6600 (LookupConstantValue): Don't set value for decimal type but
6601 emit DecimalConstantAttribute. Needed for constant optimization.
6603 * constant.cs (ToDecimal): New method.
6604 (ConvertToDecimal): New method.
6605 (IntConstant): Implemented ConvertToDecimal.
6606 (DecimalConstant.Emit): Emit optimized version for decimals in
6609 * expression.cs (ResolveOperator): Changed order of constant
6610 reduction to work correctly with native types which have
6611 overloaded operators.
6612 (ResolveMemberAccess): Extract constant value from attribute
6615 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6617 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6618 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6619 (ChangeType): Decimal is special.
6620 (TypeToCoreType): Add decimal type.
6622 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6624 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6627 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6629 * class.cs (EventField.ApplyAttributeBuilder): Fix error
6632 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6634 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6636 * pending.cs (PendingImplementation): Grab only interfaces.
6638 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6640 * statement.cs (ForeachHelperMethods): Add location member and
6641 error 202 detection.
6643 2004-11-18 Marek Safar <marek.safar@seznam.cz>
6645 * expression.cs (DoResolveBase): Fixed wrong warning for out
6648 2004-12-04 Martin Baulig <martin@ximian.com>
6650 * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
6651 to check whether the conversion is ok.
6653 * typemanager.cs (TypeManager.GetTypeArguments): Just return
6654 `Type.EmptyTypes' if we're not a generic TypeContainer.
6656 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6658 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6659 old bug: when converting from the null literal to a pointer,
6660 return an EmptyCast, not the NullLiteral.
6662 This fixes #69921, the recent null_type changes probably made this
6665 2004-12-03 Martin Baulig <martin@ximian.com>
6667 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6668 method as our child, call AnonymousMethod.Compatible() on it.
6670 2004-12-02 Miguel de Icaza <miguel@ximian.com>
6672 * class.cs (FieldBase): Use an unused bit field from the field to
6673 encode the `has_offset' property from the FieldMember. This saves
6674 a couple of Ks on bootstrap compilation.
6676 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6677 method as our child, return the AnonymousMethod resolved
6680 * expression.cs (New.DoResolve): Allow return values from
6681 NewDelegate to also include AnonymousMethods.
6685 2004-11-29 Raja R Harinath <rharinath@novell.com>
6687 * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
6689 * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
6690 System.Runtime.InteropServices._Exception, since it's a base
6691 interface of the core type System.Exception in the net_2_0 profile.
6693 2004-11-27 Martin Baulig <martin@ximian.com>
6695 * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
6697 2004-11-26 Raja R Harinath <rharinath@novell.com>
6699 * Makefile: Convert to use executable.make.
6700 * gmcs.exe.sources: New.
6702 2004-11-25 Martin Baulig <martin@ximian.com>
6704 * expression.cs (Invocation.InferType): Added support for byref types.
6706 2004-11-25 Martin Baulig <martin@ximian.com>
6708 * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
6709 in TypeManager.TypeToCoreType().
6711 2004-11-25 Martin Baulig <martin@ximian.com>
6713 * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
6714 "Dispose" method from the `current_type'.
6715 (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
6716 DoDefineMembers() instead of using the MethodBuilder; this is
6717 required for generic iterators.
6719 * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
6721 2004-11-24 Martin Baulig <martin@ximian.com>
6723 * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
6725 2004-11-20 Martin Baulig <martin@ximian.com>
6727 * expression.cs (Invocation.InferType): Correctly infer generic
6728 instances; see gen-103.cs.
6729 (Invocation.InferTypeArguments): If a generic method doesn't have
6730 any unbound type parameters, we don't need to infer anything.
6732 2004-11-19 Raja R Harinath <rharinath@novell.com>
6734 * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
6736 2004-11-17 Raja R Harinath <rharinath@novell.com>
6738 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6739 (TypeHandle.GetMemberCache): New.
6740 (TypeHandle.TypeHandle): Update.
6741 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6742 (TypeManager.LookupParentInterfacesCache):
6743 Rename from LookupInterfaceCache. Optimize slightly.
6744 (TypeManager.MemberLookup_FindMembers): Update.
6745 * decl.cs (MemberCache.MemberCache): Set Container to null in the
6747 (AddCacheContents): Rename from AddHashtable.
6748 * class.cs (TypeContainer.parent_container): Remove.
6749 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6750 (TypeContainer.DoDefineMembers): Don't initialize it.
6751 Update to name changes.
6753 2004-11-17 Miguel de Icaza <miguel@ximian.com>
6755 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6756 that factors the code to check access modifiers on override.
6758 (PropertyBase): Use the code here.
6760 Patch from Lluis S'anchez, fixes bug #69361.
6762 2004-11-15 Miguel de Icaza <miguel@ximian.com>
6764 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6765 routine that is used to report the use of a captured variable
6766 whose address has been taken.
6768 There are two checks: one when variables are being captured and
6769 the other check is when the address of a variable is taken.
6771 (because an anonymous methods might be resolved before *or* after
6772 the address has been taken) and
6774 * expression.cs (Conditional.DoResolve): Remove the special
6775 casing that Martin added to trueExpr and falseExpr being both
6776 NullLiteral. We get the right behavior now just by introducing
6777 the null_type into the compiler.
6779 * convert.cs (ExplicitConversion): Change the code to use
6780 null_type instead of testing `expr is NullLiteral'.
6781 (ImplicitConversionStandard): use null_type too.
6782 (ImplicitReferenceConversionExists): use null_type too.
6783 (ImplicitReferenceConversion): use null_type too.
6785 * literal.cs: The type of `NullLiteral' is now null_type instead
6787 (Resolve): Set the type here.
6789 * typemanager.cs: Introduce null_type.
6791 2004-11-18 Martin Baulig <martin@ximian.com>
6794 (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
6796 2004-11-18 Martin Baulig <martin@ximian.com>
6798 * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
6800 2004-11-18 Martin Baulig <martin@ximian.com>
6802 * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
6803 of a `DeclSpace'. If one of our constraints is a `ConstructedType',
6804 call ResolveConstructedType() on it to resolve it without checking
6806 (Constraints.ResolveTypes): Check them here.
6807 (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
6808 but don't check constraints.
6809 (ConstructedType.ResolveAsTypeTerminal): Override this and also
6810 check constraints here.
6811 (ConstructedType.ResolveConstructedType): New public method. This
6812 is called from DoResolveAsTypeStep() and Constraints.Resolve() to
6813 resolve ourselves without checking constraints.
6815 * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
6817 2004-11-18 Martin Baulig <martin@ximian.com>
6820 (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
6822 * delegate.cs (Delegate.DefineType): Always create the EmitContext.
6824 2004-11-18 Martin Baulig <martin@ximian.com>
6826 * ecore.cs (TypeExpr.ResolveType): Removed.
6827 (Expression.ResolveAsTypeTerminal): We always return a fully
6828 resolved `TypeExpr', so we can just access its `Type'.
6830 * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
6832 2004-11-17 Martin Baulig <martin@ximian.com>
6834 * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
6835 sure we don't return any unresolved TypeExpr's.
6836 (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
6838 (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
6840 * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
6841 unresolved `ConstructedType's.
6843 2004-11-17 Martin Baulig <martin@ximian.com>
6845 * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
6847 2004-11-17 Martin Baulig <martin@ximian.com>
6850 (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
6852 * decl.cs (DeclSpace.ResolveType): Removed.
6853 (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
6855 2004-11-17 Martin Baulig <martin@ximian.com>
6857 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6858 direction, like FindMembers() does. Fixes #69546, testcase is in
6861 2004-11-16 Martin Baulig <martin@ximian.com>
6863 This is based on a patch from Marek Safar, see bug #69082.
6864 Fixes bugs #63705 and #67130.
6866 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6867 method; create a MemberCache for an interface type and cache the
6870 * decl.cs (IMemberContainer.ParentContainer): Removed.
6871 (IMemberContainer.ParentCache): New property.
6872 (MemberCache.SetupCacheForInterface): Removed.
6873 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6874 to create a cache for an interface's "parent".
6876 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6879 2004-11-14 Ben Maurer <bmaurer@ximian.com>
6881 * statement.cs: Avoid adding bools to a hashtable.
6883 2004-11-15 Martin Baulig <martin@ximian.com>
6885 * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
6887 2004-11-11 Martin Baulig <martin@ximian.com>
6889 * typemanager.cs (TypeManager.GetMethodName): New method.
6891 * class.cs (MethodData.Define): Include the generic arity in the
6892 name of an explicit interface; also add it to the method name.
6894 * pending.cs (PendingImplementation.InterfaceMethod): The method
6895 name now includes the generic arity.
6897 2004-11-07 Miguel de Icaza <miguel@ximian.com>
6899 * expression.cs (Invocation.OverloadResolve): Flag error if we are
6900 calling an unsafe method from a safe location.
6902 2004-11-06 Marek Safar <marek.safar@seznam.cz>
6905 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6907 2004-11-06 Miguel de Icaza <miguel@ximian.com>
6909 * namespace.cs (VerifyUsing): use GetPartialName instead of
6912 2004-11-05 Miguel de Icaza <miguel@ximian.com>
6914 * statement.cs (Return.Resolve): Fix regression in typo: if
6915 `in_exc', we have to request a NeedReturnLabel, this was a typo
6916 introduced in the anonymous method check-in. Fixes #69131.
6918 * Indexers were using the ShortName when defining themselves,
6919 causing a regression in the compiler bootstrap when applying the
6920 patch from 2004-11-02 (first part), now they use their full name
6921 and the bug is gone.
6923 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
6925 * driver.cs: Strip the path from the names of embedded resources. Fixes
6928 2004-11-04 Raja R Harinath <rharinath@novell.com>
6930 Fix error message regression: cs0104-2.cs.
6931 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6932 (AliasEntry.Resolve): Update.
6933 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
6935 (RootContext.LookupType): Update.
6937 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
6939 * cs-parser.jay: Add support for handling accessor modifiers
6940 * class: Add support port accessor modifiers and error checking,
6941 define PropertyMethod.Define as virtual (not abstract anymore)
6942 * ecore.cs: Add checking for proeprties access with access modifiers
6943 * iterators.cs: Modify Accessor constructor call based in the modified
6945 2004-11-02 Ben Maurer <bmaurer@ximian.com>
6947 * expression.cs (StringConcat): Handle being called twice,
6948 as when we have a concat in a field init with more than two
6951 2004-11-02 Miguel de Icaza <miguel@ximian.com>
6953 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6954 special case explicit implementations, we should always produce
6955 the .property or .event declaration.
6957 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6958 since it will not return correct data if people use this
6959 unresolved in the presence of using statements (see test-313).
6961 * class.cs (MethodData.Define): If we are an explicit interface
6962 implementation, set the method name to the full name of the
6963 interface plus the name of the method.
6965 Notice that using the method.MethodName.GetFullName() does not
6966 work, as it will only contain the name as declared on the source
6967 file (it can be a shorthand in the presence of using statements)
6968 and not the fully qualifed type name, for example:
6972 class D : ICloneable {
6973 object ICloneable.Clone () {
6977 Would produce a method called `ICloneable.Clone' instead of
6978 `System.ICloneable.Clone'.
6980 * namespace.cs (Alias.Resolve): Use GetPartialName.
6982 2004-11-01 Marek Safar <marek.safar@seznam.cz>
6984 * cs-parser.jay: Add error 1055 report.
6986 2004-11-01 Miguel de Icaza <miguel@ximian.com>
6988 * assign.cs (Assign.DoResolve): Only do the transform of
6989 assignment into a New if the types are compatible, if not, fall
6990 through and let the implicit code deal with the errors and with
6991 the necessary conversions.
6993 2004-11-01 Marek Safar <marek.safar@seznam.cz>
6995 * cs-parser.jay: Add error 1031 report.
6997 * cs-tokenizer.cs: Add location for error 1038.
6999 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7001 * cs-parser.jay: Add error 1016 report.
7003 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7005 * cs-parser.jay: Add errors 1575,1611 report.
7007 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7009 * cs-parser.jay: Add error 1001 report.
7011 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7014 * attribute.cs (GetMarshal): Add method argument for
7015 caller identification.
7017 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7018 agument for GetMarshal and RuntimeMissingSupport.
7020 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7022 * attribute.cs (ExtractSecurityPermissionSet): Removed
7023 TypeManager.code_access_permission_type.
7025 * typemanager.cs: Removed TypeManager.code_access_permission_type.
7027 2004-10-27 Miguel de Icaza <miguel@ximian.com>
7029 * expression.cs (LocalVariableReference.DoResolveLValue): Check
7030 for obsolete use of a variable here. Fixes regression on errors
7031 cs0619-25 and cs0619-26.
7033 2004-10-27 Marek Safar <marek.safar@seznam.cz>
7035 Fix #62358, implemented security attribute encoding.
7037 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7038 Tests permitted SecurityAction for assembly or other types.
7039 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7040 data from SecurityPermissionAttribute to PermisionSet class.
7042 * class.cs (ApplyAttributeBuilder): Added special handling
7043 for System.Security.Permissions.SecurityAttribute based types.
7045 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7046 special handling for System.Security.Permissions.SecurityAttribute
7049 * enum.cs (ApplyAttributeBuilder): Added special handling
7050 for System.Security.Permissions.SecurityAttribute based types.
7052 * parameter.cs (ApplyAttributeBuilder): Added special handling
7053 for System.Security.Permissions.SecurityAttribute based types.
7055 * rootcontext.cs: Next 2 core types.
7057 * typemanager.cs (TypeManager.security_permission_attr_type):
7058 Built in type for the SecurityPermission Attribute.
7059 (code_access_permission_type): Build in type.
7061 2004-10-17 Miguel de Icaza <miguel@ximian.com>
7063 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7064 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7065 all of this information into
7066 EmitContext.EmitCapturedVariableInstance.
7068 * codegen.cs (EmitCapturedVariableInstance): move here the
7069 funcionality of emitting an ldarg.0 in the presence of a
7070 remapping. This centralizes the instance emit code.
7072 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7073 then emit a load of this: it means that we have reached the
7074 topmost ScopeInfo: the one that contains the pointer to the
7075 instance of the class hosting the anonymous method.
7077 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7078 captures to the topmost CaptureContext.
7080 2004-10-12 Miguel de Icaza <miguel@ximian.com>
7082 * expression.cs (LocalVariableReference): Move the knowledge about
7083 the iterators into codegen's EmitCapturedVariableInstance.
7085 2004-10-11 Miguel de Icaza <miguel@ximian.com>
7087 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7088 all code paths return a value from an anonymous method (it is the
7089 same as the 161 error, but for anonymous methods).
7091 2004-10-08 Miguel de Icaza <miguel@ximian.com>
7093 The introduction of anonymous methods in the compiler changed
7094 various ways of doing things in the compiler. The most
7095 significant one is the hard split between the resolution phase
7096 and the emission phases of the compiler.
7098 For instance, routines that referenced local variables no
7099 longer can safely create temporary variables during the
7100 resolution phase: they must do so from the emission phase,
7101 since the variable might have been "captured", hence access to
7102 it can not be done with the local-variable operations from the runtime.
7106 (Block.Flags): New flag `IsTopLevel' to indicate that this block
7107 is a toplevel block.
7109 (ToplevelBlock): A new kind of Block, these are the blocks that
7110 are created by the parser for all toplevel method bodies. These
7111 include methods, accessors and anonymous methods.
7113 These contain some extra information not found in regular blocks:
7114 A pointer to an optional CaptureContext (for tracking captured
7115 local variables and parameters). A pointer to the parent
7118 (Return.Resolve): Catch missmatches when returning a value from an
7119 anonymous method (error 1662).
7120 Invoke NeedReturnLabel from the Resolve phase instead of the emit
7123 (Break.Resolve): ditto.
7125 (SwitchLabel): instead of defining the labels during the
7126 resolution phase, we now turned the public ILLabel and ILLabelCode
7127 labels into methods called GetILLabelCode() and GetILLabel() that
7128 only define the label during the Emit phase.
7130 (GotoCase): Track the SwitchLabel instead of the computed label
7131 (its contained therein). Emit the code by using
7132 SwitchLabel.GetILLabelCode ().
7134 (LocalInfo.Flags.Captured): A new flag has been introduce to track
7135 whether the Local has been captured or not.
7137 (LocalInfo.IsCaptured): New property, used to tell whether the
7138 local has been captured.
7140 * anonymous.cs: Vastly updated to contain the anonymous method
7143 The main classes here are: CaptureContext which tracks any
7144 captured information for a toplevel block and ScopeInfo used to
7145 track the activation frames for various local variables.
7147 Each toplevel block has an optional capture context associated
7148 with it. When a method contains an anonymous method both the
7149 toplevel method and the anonymous method will create a capture
7150 context. When variables or parameters are captured, they are
7151 recorded on the CaptureContext that owns them, for example:
7155 MyDelegate d = delegate {
7160 Here `a' will be recorded as captured on the toplevel
7161 CapturedContext, the inner captured context will not have anything
7162 (it will only have data if local variables or parameters from it
7163 are captured in a nested anonymous method.
7165 The ScopeInfo is used to track the activation frames for local
7166 variables, for example:
7168 for (int i = 0; i < 10; i++)
7169 for (int j = 0; j < 10; j++){
7170 MyDelegate d = delegate {
7175 At runtime this captures a single captured variable `i', but it
7176 captures 10 different versions of the variable `j'. The variable
7177 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7178 recorded on a child.
7180 The toplevel ScopeInfo will also track information like the `this'
7181 pointer if instance variables were referenced (this is necessary
7182 as the anonymous method lives inside a nested class in the host
7183 type of the method).
7185 (AnonymousMethod): Expanded to track the Toplevel, implement
7186 `AnonymousMethod.Compatible' to tell whether an anonymous method
7187 can be converted to a target delegate type.
7189 The routine now also produces the anonymous method content
7191 (AnonymousDelegate): A helper class that derives from
7192 DelegateCreation, this is used to generate the code necessary to
7193 produce the delegate for the anonymous method that was created.
7195 * assign.cs: API adjustments for new changes in
7196 Convert.ImplicitStandardConversionExists.
7198 * class.cs: Adjustments to cope with the fact that now toplevel
7199 blocks are of type `ToplevelBlock'.
7201 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7202 insteda of standard blocks.
7204 Flag errors if params arguments are passed to anonymous methods.
7206 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7207 `CurrentAnonymousMethod' which points to the current Anonymous
7208 Method. The variable points to the AnonymousMethod class that
7209 holds the code being compiled. It is set in the new EmitContext
7210 created for the anonymous method.
7212 (EmitContext.Phase): Introduce a variable and an enumeration to
7213 assist in enforcing some rules about when and where we are allowed
7214 to invoke certain methods (EmitContext.NeedsReturnLabel is the
7215 only one that enfonces this right now).
7217 (EmitContext.HaveCaptureInfo): new helper method that returns
7218 whether we have a CapturedContext initialized.
7220 (EmitContext.CaptureVariable): New method used to register that a
7221 LocalInfo must be flagged for capturing.
7223 (EmitContext.CapturedParameter): New method used to register that a
7224 parameters must be flagged for capturing.
7226 (EmitContext.CapturedField): New method used to register that a
7227 field must be flagged for capturing.
7229 (EmitContext.HaveCapturedVariables,
7230 EmitContext.HaveCapturedFields): Return whether there are captured
7231 variables or fields.
7233 (EmitContext.EmitMethodHostInstance): This is used to emit the
7234 instance for the anonymous method. The instance might be null
7235 (static methods), this (for anonymous methods that capture nothing
7236 and happen to live side-by-side with the current method body) or a
7237 more complicated expression if the method has a CaptureContext.
7239 (EmitContext.EmitTopBlock): Routine that drives the emission of
7240 code: it will first resolve the top block, then emit any metadata
7241 and then emit the code. The split is done so that we can extract
7242 any anonymous methods and flag any captured variables/parameters.
7244 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7245 during this phase, the ILGenerator should not be used as labels
7246 and local variables declared here might not be accessible to any
7247 code that is part of an anonymous method.
7249 Exceptions to this include the temporary variables that are
7250 created by some statements internally for holding temporary
7253 (EmitContext.EmitMeta): New routine, in charge of emitting all the
7256 (EmitContext.TemporaryReturn): This method is typically called
7257 from the Emit phase, and its the only place where we allow the
7258 ReturnLabel to be defined other than the EmitMeta. The reason is
7259 that otherwise we would have to duplicate a lot of logic in the
7260 Resolve phases of various methods that today is on the Emit
7263 (EmitContext.NeedReturnLabel): This no longer creates the label,
7264 as the ILGenerator is not valid during the resolve phase.
7266 (EmitContext.EmitThis): Extended the knowledge in this class to
7267 work in anonymous methods in addition to iterators.
7269 (EmitContext.EmitCapturedVariableInstance): This emits whatever
7270 code is necessary on the stack to access the instance to a local
7271 variable (the variable will be accessed as a field).
7273 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7274 EmitContext.EmitAddressOfParameter): Routines to support
7275 parameters (not completed at this point).
7277 Removals: Removed RemapLocal and RemapLocalLValue. We probably
7278 will also remove the parameters.
7280 * convert.cs (Convert): Define a `ConstantEC' which points to a
7281 null. This is just to prefity some code that uses
7282 ImplicitStandardConversion code and do not have an EmitContext
7285 The idea is to flag explicitly that at that point in time, it is
7286 known that the conversion will not trigger the delegate checking
7287 code in implicit conversions (which requires a valid
7290 Everywhere: pass new EmitContext parameter since
7291 ImplicitStandardConversionExists now requires it to check for
7292 anonymous method conversions.
7294 (Convert.ImplicitStandardConversionExists): If the type of an
7295 expression is the anonymous_method_type, and the type is a
7296 delegate, we invoke the AnonymousMethod.Compatible method to check
7297 whether an implicit conversion is possible.
7299 (Convert.ImplicitConversionStandard): Only do implicit method
7300 group conversions if the language level is not ISO_1.
7302 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7303 MethodInfo for the Invoke method. used by Delegate and
7306 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7307 method conversions if the target type is a delegate.
7309 Removed extra debugging nops.
7311 (LocalVariableReference): Turn the `local_info' into a public
7314 Add `prepared' field, the same hack used for FieldExprs to cope
7315 with composed assignments, as Local variables do not necessarily
7316 operate purely on the stack as they used to: they can be captured
7319 Add `temp' for a temporary result, like fields.
7321 Refactor DoResolve and DoResolveLValue into DoResolveBase.
7323 It now copes with Local variables that are captured and emits the
7324 proper instance variable to load it from a field in the captured
7327 (ParameterReference.DoResolveBase): During the resolve phase,
7328 capture parameters if we are in an anonymous method.
7330 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7331 anonymous method, use the EmitContext helper routines to emit the
7332 parameter reference.
7334 * iterators.cs: Set RemapToProxy to true/false during the
7337 * parameters.cs (GetParameterByName): New helper method.
7339 * typemanager.cs (anonymous_method_type) a new type that
7340 represents an anonyous method. This is always an internal type,
7341 used as a fencepost to test against the anonymous-methodness of an
7344 2004-10-20 Marek Safar <marek.safar@seznam.cz>
7346 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7348 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7350 2004-11-10 Martin Baulig <martin@ximian.com>
7352 * expression.cs (Invocation.BetterFunction): If two methods have
7353 equal parameter types, but only one of them is generic, the
7354 non-generic one wins.
7355 (New.DoResolve): Don't set `is_struct' to false if we're a generic
7356 instance; just use `Type.IsValueType' to determine whether
7357 something is a struct or not.
7358 (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
7359 so we can be called multiple times.
7361 2004-11-10 Martin Baulig <martin@ximian.com>
7363 * generic.cs (TypeParameter.DefineConstraints): New public method.
7364 (TypeParameter.CheckAccessLevel): Override this and return true.
7365 (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
7366 override ResolveType() anymore.
7367 (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
7369 2004-11-10 Martin Baulig <martin@ximian.com>
7371 * rootcontext.cs (RootContext.LookupType): If we're a nested type,
7372 call DeclSpace.ResolveNestedType() on it.
7374 2004-11-10 Martin Baulig <martin@ximian.com>
7376 * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
7377 non-null, call ParameterModifier() on it.
7379 2004-11-10 Martin Baulig <martin@ximian.com>
7382 (Iterators): Added `current_type' and `this_type' fields.
7383 (Iterators.DefineIterator): Create a new EmitContext and store it
7384 in `ec'; compute `this_type'.
7386 2004-11-10 Martin Baulig <martin@ximian.com>
7389 (TypeManager.IsPrivateAccessible): New public method.
7390 (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
7392 2004-11-10 Martin Baulig <martin@ximian.com>
7394 * class.cs (TypeContainer.DefineType): Call
7395 TypeBuilder.DefineGenericParameters() before resolving the type
7397 (MethodData.parent_method): New protected field.
7398 (MethodData..ctor): Added `MethodInfo parent_method' argument.
7399 (MethodData.Define): Compute `parent_method'.
7402 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7403 (MemberCore.GetClsCompliantAttributeValue): Likewise.
7404 (DeclSpace.ec): New protected field; store the EmitContext here.
7405 (DeclSpace.EmitContext): New public property.
7406 (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
7407 (DeclSpace.ResolveNestedType): New public method.
7408 (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
7409 (DeclSpace.NestedAccessible): Added `Type tb' argument.
7410 (DeclSpace.FamilyAccessible): Likewise.
7411 (DeclSpace.FindType): Call ResolveNestedType() for nested types.
7412 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7415 * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
7418 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7419 (Enum.Emit): Don't create a new EmitContext.
7421 2004-10-18 Martin Baulig <martin@ximian.com>
7423 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7424 `Type' directly, but call ResolveType() on it.
7425 (Catch.Resolve): Likewise.
7426 (Foreach.Resolve): Likewise.
7428 2004-10-18 Martin Baulig <martin@ximian.com>
7430 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7431 `Type' directly, but call ResolveType() on it.
7432 (Probe.DoResolve): Likewise.
7433 (ArrayCreation.LookupType): Likewise.
7434 (TypeOf.DoResolve): Likewise.
7435 (SizeOf.DoResolve): Likewise.
7437 2004-10-18 Raja R Harinath <rharinath@novell.com>
7439 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7442 2004-10-17 John Luke <john.luke@gmail.com>
7444 * class.cs (Operator.GetSignatureForError): use CSharpName
7446 * parameter.cs (Parameter.GetSignatureForError): Returns
7447 correct name even if was not defined.
7449 2004-10-13 Raja R Harinath <rharinath@novell.com>
7452 * class.cs (TypeContainer.EmitContext): New property.
7453 (DefineNestedTypes): Create an emitcontext for each part.
7454 (MethodCore.DoDefineParameters): Use container's emitcontext.
7455 Pass type array to InternalParameters.
7456 (MemberBase.DoDefine): Use container's emitcontext.
7457 (FieldMember.Define): Likewise.
7458 (Event.Define): Likewise.
7459 (SetMethod.GetParameterInfo): Change argument to EmitContext.
7460 Pass type array to InternalParameters.
7461 (SetIndexerMethod.GetParameterInfo): Likewise.
7462 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7463 * delegate.cs (Define): Pass emitcontext to
7464 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
7465 array to InternalParameters.
7466 * expression.cs (ParameterReference.DoResolveBase): Pass
7467 emitcontext to GetParameterInfo.
7468 (ComposedCast.DoResolveAsTypeStep): Remove check on
7469 ec.ResolvingTypeTree.
7470 * parameter.cs (Parameter.Resolve): Change argument to
7471 EmitContext. Use ResolveAsTypeTerminal.
7472 (Parameter.GetSignature): Change argument to EmitContext.
7473 (Parameters.ComputeSignature): Likewise.
7474 (Parameters.ComputeParameterTypes): Likewise.
7475 (Parameters.GetParameterInfo): Likewise.
7476 (Parameters.ComputeAndDefineParameterTypes): Likewise.
7477 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
7478 * support.cs (InternalParameters..ctor): Remove variant that takes
7480 * typemanager.cs (system_intptr_expr): New.
7481 (InitExpressionTypes): Initialize it.
7483 2004-10-12 Chris Toshok <toshok@ximian.com>
7485 * cs-parser.jay: fix location for try_statement and catch_clause.
7487 2004-10-18 Martin Baulig <martin@ximian.com>
7489 * class.cs (FieldMember.Define): Don't access the TypeExpr's
7490 `Type' directly, but call ResolveType() on it.
7491 (MemberBase.DoDefine): Likewise.
7493 * expression.cs (New.DoResolve): Don't access the TypeExpr's
7494 `Type' directly, but call ResolveType() on it.
7495 (ComposedCast.DoResolveAsTypeStep): Likewise.
7497 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7498 `Type' directly, but call ResolveType() on it.
7500 2004-10-17 John Luke <john.luke@gmail.com>
7502 * class.cs (Operator.GetSignatureForError): use CSharpName
7504 * parameter.cs (Parameter.GetSignatureForError): Returns
7505 correct name even if was not defined.
7507 2004-10-13 Raja R Harinath <rharinath@novell.com>
7510 * class.cs (TypeContainer.EmitContext): New property.
7511 (DefineNestedTypes): Create an emitcontext for each part.
7512 (MethodCore.DoDefineParameters): Use container's emitcontext.
7513 Pass type array to InternalParameters.
7514 (MemberBase.DoDefine): Use container's emitcontext.
7515 (FieldMember.Define): Likewise.
7516 (Event.Define): Likewise.
7517 (SetMethod.GetParameterInfo): Change argument to EmitContext.
7518 Pass type array to InternalParameters.
7519 (SetIndexerMethod.GetParameterInfo): Likewise.
7520 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7521 * delegate.cs (Define): Pass emitcontext to
7522 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
7523 array to InternalParameters.
7524 * expression.cs (ParameterReference.DoResolveBase): Pass
7525 emitcontext to GetParameterInfo.
7526 (ComposedCast.DoResolveAsTypeStep): Remove check on
7527 ec.ResolvingTypeTree.
7528 * parameter.cs (Parameter.Resolve): Change argument to
7529 EmitContext. Use ResolveAsTypeTerminal.
7530 (Parameter.GetSignature): Change argument to EmitContext.
7531 (Parameters.ComputeSignature): Likewise.
7532 (Parameters.ComputeParameterTypes): Likewise.
7533 (Parameters.GetParameterInfo): Likewise.
7534 (Parameters.ComputeAndDefineParameterTypes): Likewise.
7535 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
7536 * support.cs (InternalParameters..ctor): Remove variant that takes
7538 * typemanager.cs (system_intptr_expr): New.
7539 (InitExpressionTypes): Initialize it.
7541 2004-10-12 Chris Toshok <toshok@ximian.com>
7543 * cs-parser.jay: fix location for try_statement and catch_clause.
7545 2004-10-07 Raja R Harinath <rharinath@novell.com>
7547 More DeclSpace.ResolveType avoidance.
7548 * decl.cs (MemberCore.InUnsafe): New property.
7549 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
7550 with newly created EmitContext.
7551 (FieldMember.Define): Likewise.
7552 * delegate.cs (Delegate.Define): Likewise.
7553 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7554 only if normal name-lookup fails.
7555 (TypeExpr.DoResolve): Enable error-checking.
7556 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7557 (SizeOf.DoResolve): Likewise.
7558 (ComposedCast.DoResolveAsTypeStep): Likewise.
7559 (StackAlloc.DoResolve): Likewise.
7560 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7561 (Block.Unsafe): New property.
7562 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7563 (Unsafe): Set 'unsafe' flag of contained block.
7564 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7565 (Fixed.Resolve): Likewise.
7566 (Catch.Resolve): Likewise.
7567 (Using.ResolveLocalVariableDecls): Likewise.
7568 (Foreach.Resolve): Likewise.
7570 2004-10-05 John Luke <john.luke@gmail.com>
7572 * cs-parser.jay: add location to error CS0175
7574 2004-10-04 Miguel de Icaza <miguel@ximian.com>
7576 * ecore.cs (Expression.Constantity): Add support for turning null
7579 * const.cs (Const.Define): Allow constants to be reference types
7580 as long as the value is Null.
7582 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
7584 * namespace.cs (NamespaceEntry.Using): No matter which warning
7585 level is set, check if this namespace name has already been added.
7587 2004-10-03 Ben Maurer <bmaurer@ximian.com>
7589 * expression.cs: reftype [!=]= null should always use br[true,false].
7592 2004-10-03 Marek Safar <marek.safar@seznam.cz>
7595 * attribute.cs: Enum conversion moved to
7596 GetAttributeArgumentExpression to be applied to the all
7599 2004-10-01 Raja R Harinath <rharinath@novell.com>
7601 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7602 * class.c (TypeContainer.DefineType): Flag error if
7603 base types aren't accessible due to access permissions.
7604 * decl.cs (DeclSpace.ResolveType): Move logic to
7605 Expression.ResolveAsTypeTerminal.
7606 (DeclSpace.ResolveTypeExpr): Thin layer over
7607 Expression.ResolveAsTypeTerminal.
7608 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7609 Refactor code into NestedAccess. Use it.
7610 (DeclSpace.NestedAccess): New.
7611 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7612 argument to silence errors. Check access permissions.
7613 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7614 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7615 (Cast.DoResolve): Likewise.
7616 (New.DoResolve): Likewise.
7617 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7618 (TypeOf.DoResolve): Likewise.
7620 * expression.cs (Invocation.BetterConversion): Return the Type of
7621 the better conversion. Implement section 14.4.2.3 more faithfully.
7622 (Invocation.BetterFunction): Make boolean. Make correspondence to
7623 section 14.4.2.2 explicit.
7624 (Invocation.OverloadResolve): Update.
7625 (Invocation): Remove is_base field.
7626 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
7627 (Invocation.Emit): Likewise.
7629 2004-09-24 Marek Safar <marek.safar@seznam.cz>
7631 * cs-parser.jay: Reverted 642 warning fix.
7633 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7636 * decl.cs (FindMemberWithSameName): Indexer can have more than
7639 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7641 * expression.cs (LocalVariableReference.DoResolveLValue):
7642 Do not report warning 219 for out values.
7643 (EmptyExpression.Null): New member to avoid extra allocations.
7645 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7647 * cs-parser.jay: Fix wrong warning 642 report.
7649 * cs-tokenizer.cs (CheckNextToken): New helper;
7650 Inspect next character if is same as expected.
7652 2004-09-23 Martin Baulig <martin@ximian.com>
7654 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7655 (Convert.ImplicitReferenceConversionExists): Likewise.
7657 2004-11-09 Raja R Harinath <rharinath@novell.com>
7659 * Makefile (DISTFILES): Comment out a few missing files.
7661 2004-10-29 Raja R Harinath <rharinath@novell.com>
7663 * Makefile (bootstrap_libs,bootstrap_libfiles): New.
7664 (bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
7665 (gmcs.exe): Invoke bootstrap-libs.
7666 (clean-local): Clean the net_2_0_bootstrap profile too.
7667 (PROGRAM_INSTALL_DIR): New.
7668 (install-local): Use it.
7670 2004-10-13 Martin Baulig <martin@ximian.com>
7672 * generic.cs (TypeManager.InflatedConstraints): New nested class.
7673 (TypeParameter.DefineType): If we're a method type parameter and
7674 that method is overriding something, "inflate" its constraints.
7676 2004-10-12 Martin Baulig <martin@ximian.com>
7678 * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
7679 and have type arguments, create and resolve a ConstructedType.
7681 2004-10-12 Martin Baulig <martin@ximian.com>
7683 * decl.cs (MemberCache.FindMemberToOverride): Use
7684 TypeManager.IsEqual() to compare the parameters and Type.Equals()
7685 to compare the invocationType.
7687 * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
7688 When comparing two type parameters, only do the signature-only
7689 comparision for method type parameters.
7691 2004-10-11 Martin Baulig <martin@ximian.com>
7693 * report.cs: Don't make --fatal abort on warnings, we have
7694 -warnaserror for that.
7696 2004-10-11 Martin Baulig <martin@ximian.com>
7699 (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
7700 (TypeManager.IsEqual): Call ourself recursively instead of using
7703 2004-10-11 Martin Baulig <martin@ximian.com>
7705 * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
7706 on our own type parameters, not on the ones we inherit from a containing
7709 * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
7712 * generic.cs (TypeParameter.Define): We may only be called once.
7714 * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
7715 instead of TypeManager.IsEqual().
7717 2004-09-28 Martin Baulig <martin@ximian.com>
7720 (GenericConstraints.EffectiveBaseClass): New public property.
7721 (TypeParameter.GenericConstraints): New public property.
7722 (ConstructedType.CheckConstraints): Improved.
7724 * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
7725 (Convert.TypeParameterConversion): New private method; use this in
7726 ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
7727 for all conversions related to type parameters.
7729 2004-09-24 Martin Baulig <martin@ximian.com>
7731 * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
7732 type parameter conversions for type parameters which are known to
7735 2004-09-24 Martin Baulig <martin@ximian.com>
7737 * generic.cs (GenericConstraints): Added `IsReferenceType' and
7738 `IsValueType' properties.
7740 * support.cs (ReflectionConstraints): Use
7741 Type.GetGenericParameterConstraints() instead of the old hack.
7743 2004-09-24 Martin Baulig <martin@ximian.com>
7745 * generic.cs (GenericConstraints): Moved here and made it an
7748 * support.cs (GenericConstraints): Moved to generic.cs.
7750 2004-09-24 Martin Baulig <martin@ximian.com>
7753 (ReflectionConstraints): Un-nested this class and made it public.
7756 (TypeManager.GetTypeParameterConstraints): New public method.
7757 (TypeManager.HasConstructorConstraint): Use the attributes.
7759 2004-09-24 Martin Baulig <martin@ximian.com>
7761 * support.cs (GenericConstraints): Replaced `HasConstructor',
7762 `IsReferenceType' and `IsValueType' with `Attributes'.
7763 (ReflectionParameters.ReflectionConstraints): Removed the Create()
7764 method and made the .ctor public.
7766 * generic.cs (Constraints.Attributes): New public property.
7767 (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
7768 `IsReferenceType' -> `HasReferenceTypeConstraint' and
7769 `IsValueType' -> `HasValueTypeConstraint'.
7771 2004-09-23 Martin Baulig <martin@ximian.com>
7773 * generic.cs (Constraints): Reflect latest runtime changes.
7775 2004-09-23 Martin Baulig <martin@ximian.com>
7777 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7778 (Convert.ImplicitReferenceConversionExists): Likewise.
7780 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7782 * class.cs (Operator.Define): Add error 448 and 559 report.
7784 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7786 * class.cs (MemberBase.IsTypePermitted): New protected
7787 method for checking error CS0610.
7789 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7791 * class.cs (TypeContainer.HasExplicitLayout): New property
7792 Returns whether container has StructLayout attribute set Explicit.
7793 (FieldMember): New abstract class for consts and fields.
7794 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7795 (Field): Reuse FieldMember.
7797 * const.cs (Const): Reuse FieldMember.
7799 * rootcontext.cs: EmitConstants call moved to class.
7801 2004-09-22 Martin Baulig <martin@ximian.com>
7803 Marek and me just fixed one of our oldest bugs: #28562 :-)
7805 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7807 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7808 we're an EnumConstant, just return that.
7809 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7810 an EnumConstant. In this case, we need to use GetValueAsEnumType()
7811 to get the value which'll actually be written into the attribute.
7812 However, we have to use GetValue() to access the attribute's value
7815 2004-09-22 Marek Safar <marek.safar@seznam.cz>
7817 * constant.cs (Constant.IsNegative): New abstract property
7820 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7821 (StackAlloc.DoResolve): Reused IsNegative.
7823 2004-09-22 Martin Baulig <martin@ximian.com>
7825 * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
7826 public method; like LookupTypeContainer, but also works for
7829 * report.cs (Report.SymbolRelatedToPreviousError): Use
7830 TypeManager.LookupGenericTypeContainer().
7832 2004-09-22 Martin Baulig <martin@ximian.com>
7834 Thanks to Peter Sestoft for this bug report.
7836 * expression.cs (Conditional): If both the `trueExpr' and the
7837 `falseExpr' is a NullLiteral, return a NullLiteral.
7839 2004-09-22 Martin Baulig <martin@ximian.com>
7841 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7842 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7843 for the "get_Current" call.
7845 2004-09-21 Martin Baulig <martin@ximian.com>
7847 * convert.cs (Convert.ImplicitReferenceConversion): When
7848 converting to an interface type, first check whether we're
7849 converting from a reference type.
7851 2004-09-14 Martin Baulig <martin@ximian.com>
7853 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7855 2004-09-14 Marek Safar <marek.safar@seznam.cz>
7858 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7859 called and is obsolete then this member suppress message
7860 when call is inside next [Obsolete] method or type.
7862 * expression.cs: Use TestObsoleteMethodUsage member.
7864 2004-09-14 Martin Baulig <martin@ximian.com>
7866 * genericparser.cs: Removed.
7868 2004-09-13 Marek Safar <marek.safar@seznam.cz>
7870 * class.cs (MethodCore.CheckBase): Fix bug #65757.
7872 2004-09-12 Marek Safar <marek.safar@seznam.cz>
7874 * attribute.cs (Attribute.Resolve): Add error 653 report.
7876 * class.cs (Class.ApplyAttributeBuilder): Add error 641
7878 (Method.ApplyAttributeBuilder): Add error 685 report.
7879 (Operator.Define): Add error 564 report.
7881 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7883 * expression.cs (Invocation.DoResolve): Add error
7886 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7889 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7891 * class.cs (ConstructorInitializer.Resolve):
7892 Wrong error number (515->516).
7894 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7896 * class.cs (Indexer.Define): Add error 631 report.
7898 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7900 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7902 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7904 * expression.cs (Probe.DoResolve): Add error CS0241 report.
7906 2004-09-10 Marek Safar <marek.safar@seznam.cz>
7908 * cs-parser.jay: Added error CS0241 report.
7910 2004-09-10 Raja R Harinath <rharinath@novell.com>
7912 * cs-parser.jay (fixed_statement): Introduce a scope for the
7913 declaration in the 'fixed' statement.
7915 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7917 * cs-parser.jay: Added CS0230 error report.
7919 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7921 * cs-parser.jay: Added errors CS0231 and CS0257 report.
7923 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7925 * expression.cs (Argument.Resolve): Added error CS0192 and
7928 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7930 C# 2.0 #pragma warning feature
7932 * cs-tokenizer.cs (PreProcessPragma): New method;
7933 Handles #pragma directive.
7935 * report.cs (WarningRegions): New class; Support
7936 class for #pragma warning directive. It tests whether
7937 warning is enabled for a given line.
7939 2004-09-08 Miguel de Icaza <miguel@ximian.com>
7941 * const.cs: Add more descriptive error report, tahnks to
7944 2004-09-08 Marek Safar <marek.safar@seznam.cz>
7946 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7948 2004-09-07 Miguel de Icaza <miguel@ximian.com>
7950 * expression.cs: Apply patch from Ben: Remove dead code from
7951 ArrayCreation, and remove the TurnintoConstant call in const.cs,
7952 as that code just threw an exception anwyays.
7954 * const.cs: Remove the call to the turnintoconstant, for details
7957 * literal.cs: The type of the null-literal is the null type; So
7958 we use a placeholder type (literal.cs:System.Null, defined here)
7961 * expression.cs (Conditional.DoResolve): Remove some old code that
7962 is no longer needed, conversions have been fixed.
7964 (ArrayCreationExpression.DoResolve): Return false if we fail to
7965 resolve the inner expression.
7967 2004-09-07 Raja R Harinath <rharinath@novell.com>
7970 * cs-parser.jay (delegate_declaration): Record a delegate
7971 declaration as a type declaration.
7972 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7974 2004-09-06 Miguel de Icaza <miguel@ximian.com>
7976 * parameter.cs: Do not crash if the type can not be resolved.
7978 * expression.cs: Report errors with unsafe pointers, fixes #64896
7980 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
7982 * expression.cs: Pointer arith always needs to do a conv.i
7983 if the operand is a long. fix 65320
7985 2004-09-04 Marek Safar <marek.safar@seznam.cz>
7987 Fixed cs0619-37.cs, cs0619-38.cs
7989 * enum.cs (GetObsoleteAttribute): Removed.
7991 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7992 on Enum member is double staged. The first is tested member
7995 2004-09-04 Marek Safar <marek.safar@seznam.cz>
7997 Fixed #56986, #63631, #65231
7999 * class.cs: (TypeContainer.AddToMemberContainer): New method,
8000 adds member to name container.
8001 (TypeContainer.AddToTypeContainer): New method, adds type to
8003 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8004 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8005 AddOperator): Simplified by reusing AddToMemberContainer.
8006 (TypeContainer.UserDefinedStaticConstructor): Changed to property
8008 (Method.CheckForDuplications): Fixed implementation to test all
8010 (MemberBase): Detection whether member is explicit interface
8011 implementation is now in constructor.
8012 (MemberBase.UpdateMemberName): Handles IndexerName.
8013 (Accessor): Changed to keep also location information.
8014 (AbstractPropertyEventMethod): Is derived from MemberCore.
8015 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8016 will be emited or not.
8017 (PropertyBase.AreAccessorsDuplicateImplementation):
8018 Tests whether accessors are not in collision with some method.
8019 (Operator): Is derived from MethodCore to simplify common
8022 * decl.cs (Flags.TestMethodDuplication): Test for duplication
8024 (DeclSpace.AddToContainer): Adds the member to defined_names
8025 table. It tests for duplications and enclosing name conflicts.
8027 * enum.cs (EnumMember): Clean up to reuse the base structures
8029 2004-09-03 Martin Baulig <martin@ximian.com>
8031 Merged latest changes into gmcs. Please keep this comment in
8032 here, it makes it easier for me to see what changed in MCS since
8033 the last time I merged.
8035 2004-09-03 Martin Baulig <martin@ximian.com>
8037 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8038 into TypeContainer, to make partial classes work again.
8040 2004-09-03 Martin Baulig <martin@ximian.com>
8042 * rootcontext.cs (RootContext.V2): Removed.
8044 2004-03-23 Martin Baulig <martin@ximian.com>
8046 * expression.cs (Invocation.OverloadResolve): Added `bool
8047 may_fail' argument and use it instead of the Location.IsNull() hack.
8049 2004-09-09 Martin Baulig <martin@ximian.com>
8051 * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
8053 2004-09-09 Martin Baulig <martin@ximian.com>
8055 * generic.cs (TypeParameter.DefineType): Added support for
8056 explicit interface methods.
8058 2004-09-09 Martin Baulig <martin@ximian.com>
8060 * README.Changes: New document. Started to list important changes
8061 between MCS and GMCS here.
8063 2004-09-08 Martin Baulig <martin@ximian.com>
8066 (TypeContainer.CheckRecursiveDefinition): New protected method.
8067 (TypeContainer.DefineType): Move the CS0146 check into
8068 CheckRecursiveDefinition().
8070 2004-09-06 Martin Baulig <martin@ximian.com>
8072 * generic.cs (ConstructedType.CheckConstraints): Allow builtin
8073 types for the constructor constraint.
8075 2004-09-03 Martin Baulig <martin@ximian.com>
8077 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8078 into TypeContainer, to make partial classes work again.
8080 2004-09-03 Martin Baulig <martin@ximian.com>
8082 * rootcontext.cs (RootContext.V2): Removed.
8084 2004-03-23 Martin Baulig <martin@ximian.com>
8086 * expression.cs (Invocation.OverloadResolve): Added `bool
8087 may_fail' argument and use it instead of the Location.IsNull() hack.
8089 2004-09-03 Martin Baulig <martin@ximian.com>
8091 Merged latest changes into gmcs. Please keep this comment in
8092 here, it makes it easier for me to see what changed in MCS since
8093 the last time I merged.
8095 2004-09-03 Raja R Harinath <rharinath@novell.com>
8098 * expression.cs (BetterConversion): Don't allow either conversion
8099 to be null. Remove redundant implicit conversion test when 'q ==
8100 null' -- when this function is invoked, we already know that the
8101 implicit conversion exists.
8102 (BetterFunction): Assume that 'best' is non-null. Remove
8103 redundant reimplementation of IsApplicable when 'best' is null.
8104 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
8105 number of arguments.
8106 (IsAncestralType): Extract from OverloadResolve.
8107 (OverloadResolve): Make robust to the MethodGroupExpr being
8108 unsorted. Implement all the logic of Section 14.5.5.1, and
8109 support overloading of methods from multiple applicable types.
8110 Clean up logic somewhat. Don't pass null methods to BetterFunction.
8112 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
8113 (RealError, Warning): Append type of report to related symbol.
8115 2004-09-03 Marek Safar <marek.safar@seznam.cz>
8117 * enum.cs: Fixed CLS-Compliance checks for enum members.
8118 Error tests cs3008-8.cs, cs3014-8.cs
8120 2004-09-02 Marek Safar <marek.safar@seznam.cz>
8122 Fixed bug #62342, #63102
8123 * class.cs: ImplementIndexer uses member.IsExplicitImpl
8124 like ImplementMethod.
8126 2004-09-02 Marek Safar <marek.safar@seznam.cz>
8128 * attribute.cs (Attribute.GetAttributeArgumentExpression):
8131 2004-09-02 Martin Baulig <martin@ximian.com>
8133 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8134 TypeManager.GetArgumentTypes() rather than calling GetParameters()
8137 2004-09-01 Marek Safar <marek.safar@seznam.cz>
8139 C# 2.0 Static classes implemented
8141 * class.cs (TypeContainer): instance_constructors,
8142 initialized_fields, initialized_static_fields,
8143 default_constructor, base_inteface_types are protected to be
8144 accessible from StaticClass.
8145 (TypeContainer.DefineDefaultConstructor): New virtual method
8146 for custom default constructor generating
8147 (StaticClass): New class to handle "Static classes" feature.
8149 * cs-parser.jay: Handle static keyword on class like instance
8152 * driver.cs: Added "/langversion" command line switch with two
8153 options (iso-1, default).
8155 2004-08-31 Marek Safar <marek.safar@seznam.cz>
8157 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8159 2004-08-31 Miguel de Icaza <miguel@ximian.com>
8161 * delegate.cs: Style.
8163 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
8165 * delegate.cs: Add seperate instance expr field for miguel.
8167 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
8169 * PointerArithmetic (Resolve): make sure we are not doing
8170 pointer arith on void*. Also, make sure we are resolved
8171 by not setting eclass until resolve.
8173 All callers: Make sure that PointerArithmetic gets resolved.
8175 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
8177 * ArrayCreation (LookupType): If the type does not resolve
8178 to an array, give an error.
8180 2004-08-27 Marek Safar <marek.safar@seznam.cz>
8182 * statement.cs (Try.Resolve): Fixed bug #64222
8184 2004-08-27 Martin Baulig <martin@ximian.com>
8187 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8190 2004-08-26 Marek Safar <marek.safar@seznam.cz>
8192 * ecore.cs (Constantify): Get underlying type via
8193 System.Enum.GetUnderlyingType to avoid StackOverflow on the
8194 Windows in special cases.
8196 2004-08-26 Marek Safar <marek.safar@seznam.cz>
8198 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8199 for obtaining also private methods.
8200 (GetRemoveMethod): Used GetRemoveMethod (true)
8201 for obtaining also private methods.
8203 2004-09-02 Martin Baulig <martin@ximian.com>
8205 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8206 TypeManager.GetArgumentTypes() rather than calling GetParameters()
8209 2004-08-27 Martin Baulig <martin@ximian.com>
8212 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8215 2004-08-25 Martin Baulig <martin@ximian.com>
8217 * support.cs (ReflectionParameters..ctor): If this is a generic
8218 method, retrieve and store its type parameters.
8219 (InternalParameters..ctor): Added `TypeParameter[]' argument.
8220 (ReflectionParameters.GenericConstraints): The argument specifies
8221 the type parameter, not the method parameter.
8222 (InternalParameters.GenericConstraints): Likewise.
8224 * generic.cs (TypeParameter.DefineType): Correctly handle
8225 constraints wrt. generic methods in interfaces and their
8228 2004-08-24 Martin Baulig <martin@ximian.com>
8230 * generic.cs (TypeParameter.IsSubclassOf): New public method.
8231 (Constraints.IsSubclassOf): New internal method.
8233 * typemanager.cs (TypeManager.FindMembers): Added special support
8234 for GenericTypeParameterBuilder's.
8235 (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
8238 2004-08-24 Martin Baulig <martin@ximian.com>
8241 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8242 this for accessibility checks.
8243 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8244 IsNestedFamilyAccessible.
8245 (TypeManager.IsSubclassOf): New method, do what the name actually
8248 2004-08-24 Martin Baulig <martin@ximian.com>
8250 * expression.cs (MemberAccess.DoResolve): When resolving ourselves
8251 as a SimpleName, include the generic arity.
8253 2004-08-24 Martin Baulig <martin@ximian.com>
8255 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8256 MethodAttributes.HideBySig for operators.
8258 2004-08-23 Martin Baulig <martin@ximian.com>
8260 Back to the old error reporting system :-)
8262 * report.cs (Message): Removed.
8263 (Report.MessageData, ErrorData, WarningData): Removed.
8264 (Report.Error, Warning): Back to the old system.
8266 2004-08-23 Martin Baulig <martin@ximian.com>
8268 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8270 * class.cs (TypeContainer.ParentContainer): New public virtual
8271 method; replaces the explicit interface implementation.
8272 (ClassPart.ParentContainer): Override.
8274 2004-08-23 Martin Baulig <martin@ximian.com>
8276 * statement.cs (Switch): Added support for constant switches; see
8277 #59428 or test-285.cs.
8279 2004-08-22 Marek Safar <marek.safar@seznam.cz>
8282 * statement.cs (GetEnumeratorFilter): Removed useless
8283 logic because C# specs is strict. GetEnumerator must be
8286 2004-08-22 Martin Baulig <martin@ximian.com>
8288 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8289 a switch and may break, reset the barrier. Fixes #59867.
8291 2004-08-22 Marek Safar <marek.safar@seznam.cz>
8293 CLS-Compliance speed up (~5% for corlib)
8295 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8296 New method. Tests container for CLS-Compliant names
8298 * class.cs (TypeContainer.VerifyClsName): New method.
8299 Checks whether container name is CLS Compliant.
8300 (Constructor): Implements IMethodData.
8302 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8303 low-case table for CLS Compliance test.
8304 (MemberCache.VerifyClsParameterConflict): New method.
8305 Checks method parameters for CS3006 error.
8307 * enum.cs (EnumMember): Is derived from MemberCore.
8308 (Enum.VerifyClsName): Optimized for better performance.
8310 2004-08-06 Marek Safar <marek.safar@seznam.cz>
8312 * report.cs: Renamed Error_T to Error and changed all
8315 2004-08-06 Marek Safar <marek.safar@seznam.cz>
8317 * class.cs (TypeContainer.IndexerArrayList): New inner class
8318 container for indexers.
8319 (TypeContainer.DefaultIndexerName): New constant for default
8320 indexer name. Replaced all "Item" with this constant.
8321 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8323 * typemanager.cs (TypeManager.default_member_ctor): Cache here
8324 DefaultMemberAttribute constructor.
8326 2004-08-05 Martin Baulig <martin@ximian.com>
8328 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8331 2004-08-05 Marek Safar <marek.safar@seznam.cz>
8333 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8334 multi platforms problem.
8336 * compiler.csproj: Included shared files.
8338 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8340 Fix bug 60333, 55971 in the more general way
8341 * attribute.cs (Attribute.GetAttributeArgumentExpression):
8342 Added arg_type argument for constant conversion.
8343 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8345 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8348 * class.cs (TypeContainer ): New inner classes MethodArrayList,
8349 OperatorArrayList, MethodCoreArrayList for typecontainer
8350 containers. Changed class member types to these new types.
8351 (MethodArrayList.DefineMembers): Added test for CS0659.
8353 2004-08-04 Miguel de Icaza <miguel@ximian.com>
8355 * cfold.cs: Synchronize the folding with the code in expression.cs
8356 Binary.DoNumericPromotions for uint operands.
8358 * attribute.cs: Revert patch from Raja, it introduced a regression
8359 while building Blam-1.2.1 (hard to isolate a test case).
8361 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8365 (TypeContainer.Define): Renamed to DefineContainerMembers because of
8367 (MethodCore.parent_method): New member. The method we're overriding
8368 if this is an override method.
8369 (MethodCore.CheckBase): Moved from Method class and made common.
8370 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8372 (MethodCore.CheckForDuplications): New abstract method. For custom
8373 member duplication search in a container
8374 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8375 method and its return type.
8376 (Event.conflict_symbol): New member. Symbol with same name in the
8380 (MemberCache.FindMemberWithSameName): New method. The method
8381 is looking for conflict with inherited symbols.
8383 2004-08-04 Martin Baulig <martin@ximian.com>
8385 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8387 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8389 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8391 * report.cs (Message): New enum for better error, warning reference in
8393 (MessageData): New inner abstract class. It generally handles printing of
8394 error and warning messages.
8395 Removed unused Error, Warning, Message methods.
8397 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8399 Fix for cs0592-8.cs test
8401 (Attributable.ValidAttributeTargets): Made public.
8402 (Attribute.ExplicitTarget): New member for explicit target value.
8403 (Attribute.CheckTargets): Now we translate explicit attribute
8404 target to Target here.
8406 2004-08-03 Ben Maurer <bmaurer@ximian.com>
8408 * ecore.cs (MethodGroupExpr): new IsBase property.
8410 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8412 * delegate.cs (DelegateCreation): store a MethodGroupExpr
8413 rather than an instance expr.
8415 (DelegateCreation.Emit): Use the method group rather than
8416 the instance expression. Also, if you have base.Foo as the
8417 method for a delegate, make sure to emit ldftn, not ldftnvirt.
8419 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
8421 (NewDelegate.DoResolve): Only check for the existance of Invoke
8422 if the method is going to be needed. Use MethodGroupExpr.
8424 (NewDelegate.Emit): Remove, DelegateCreation implements this.
8426 * expression.cs: For pointer arith., make sure to use
8427 the size of the type, not the size of the pointer to
8430 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8433 * class.cs (Class): Added error CS0502 test.
8435 2004-08-03 John Luke <jluke@cfl.rr.com>
8436 Raja R Harinath <rharinath@novell.com>
8439 * attribute.cs (Attribute.complained_before): New flag.
8440 (Attribute.ResolveType, Attribute.Resolve),
8441 (Attribute.DefinePInvokeMethod): Set it.
8442 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8444 2004-08-03 Martin Baulig <martin@ximian.com>
8446 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8447 use a user-defined operator; we still need to do numeric
8448 promotions in case one argument is a builtin type and the other
8449 one has an implicit conversion to that type. Fixes #62322.
8451 2004-08-18 Martin Baulig <martin@ximian.com>
8453 * class.cs (Method.Define): Use the correct method name when
8454 creating the MethodBuilder for a generic method.
8456 2004-08-17 Martin Baulig <martin@ximian.com>
8458 * generic.cs (Constraints): Support type parameter constraints.
8460 2004-08-16 Martin Baulig <martin@ximian.com>
8462 * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
8463 (Token.GENERIC_DIMENSION): New token; this is returned if we
8464 encounter an unbound generic type in a typeof() expression.
8466 * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
8467 this token is only generated while parsing a typeof() expression.
8468 (typeof_expression): Removed the old unbound_type hack.
8470 * generic.cs (TypeArguments.IsUnbound): New public property.
8472 * decl.cs (MemberName): Added support for unbound types.
8474 2004-08-14 Martin Baulig <martin@ximian.com>
8477 (TypeManager.IsEqualGenericInstance): New static method.
8478 (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
8479 just used to check accessibility, so follow the rules of 26.1.6.
8481 * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
8482 ConstructedType instead of a TypeExpression if we have type arguments.
8484 * cs-parser.jay (typeof_expression): Support unbound generic types.
8486 * ecore.cs (UnboundTypeExpression): New public class.
8488 2004-08-12 Martin Baulig <martin@ximian.com>
8490 * typemanager.cs (TypeManager.IsNestedChildOf): Use
8491 TypeManager.IsEqual() rather than `=='.
8493 * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
8494 generic instances as well.
8496 2004-08-12 Martin Baulig <martin@ximian.com>
8498 * expression.cs (Invocation.InferType): We can only infer method
8499 type parameters. Fixes #62647.
8501 2004-08-11 Martin Baulig <martin@ximian.com>
8503 * class.cs (TypeContainer.DefineType): Create the TypeBuilder
8504 before resolving the base classes.
8506 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8508 * Makefile: install .mdb file too.
8510 2004-08-05 Martin Baulig <martin@ximian.com>
8512 * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
8513 initializer, the current type is just the TypeBuilder, not the
8514 instantiated generic type.
8515 (FieldExpr.IsFieldInitializer): New public property.
8517 2004-08-04 Martin Baulig <martin@ximian.com>
8519 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8521 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8523 2004-08-03 Martin Baulig <martin@ximian.com>
8525 * class.cs (MethodData.Define): If we're an explicit
8526 implementation, remove the generic arity from the type name.
8528 2004-08-03 Martin Baulig <martin@ximian.com>
8530 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8531 use a user-defined operator; we still need to do numeric
8532 promotions in case one argument is a builtin type and the other
8533 one has an implicit conversion to that type. Fixes #62322.
8535 2004-08-02 Martin Baulig <martin@ximian.com>
8537 * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
8539 (TypeContainer.GetClassBases): Return the unexpanded list of
8540 interfaces; we expand them later.
8541 (TypeContainer.DefineType): After creating the TypeBuilder, call
8542 TypeManager.ExpandInterfaces() to get an expanded and resolved
8545 * ecore.cs (TypeExpr.GetInterfaces): Removed
8547 * generics.cs (Constraints.InterfaceConstraints): Remove.
8548 (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
8549 register the interface constraints.
8552 (TypeManager.AddUserType): Removed the `ifaces' argument.
8553 (TypeManager.AddTypeParameter): Likewise.
8554 (TypeManager.AddUserInterface): Removed, was unused.
8555 (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
8556 `TypeExpr[]' array for the interfaces.
8557 (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
8558 has been defined, returns a list of the resolved interfaces types.
8559 (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
8560 (TypeManager.GetExplicitInterfaces): Likewise.
8562 2004-08-02 Martin Baulig <martin@ximian.com>
8564 * expression.cs (Invocation.EmitCall): If we're invoking a method
8565 on a type parameter, use the new `Constrained' prefix opcode.
8567 2004-08-02 Martin Baulig <martin@ximian.com>
8569 * statement.cs (LocalInfo.Flags): Added `IsThis'.
8570 (LocalInfo.IsThis): New public property.
8571 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8573 2004-08-01 Martin Baulig <martin@ximian.com>
8575 * class.cs (TypeContainer.GetClassBases): Don't set the default
8576 here since we may get called from GetPartialBases().
8577 (TypeContainer.DefineType): If GetClassBases() didn't return a
8578 parent, use the default one.
8580 2004-07-30 Martin Baulig <martin@ximian.com>
8582 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8584 * class.cs (SourceMethod): New public class, derive from the
8585 symbol writer's ISourceMethod.
8586 (Method): Use the new symbol writer API.
8588 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8589 as argument and use the new symbol writer.
8592 (SourceFile): Implement the symbol writer's ISourceFile.
8593 (Location.SymbolDocument): Removed.
8594 (Location.SourceFile): New public property.
8596 * symbolwriter.cs: Use the new symbol writer API.
8598 2004-07-30 Raja R Harinath <rharinath@novell.com>
8600 * Makefile (install-local): Remove. Functionality moved to
8603 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
8605 * Makefile: Install mcs.exe.config file together with mcs.exe.
8606 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8607 correct runtime version.
8609 2004-07-25 Martin Baulig <martin@ximian.com>
8612 (TypeContainer.RegisterOrder): Removed, this was unused.
8613 (TypeContainer, interface_order): Removed.
8614 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8615 TypeContainer as argument since we can also be called with a
8616 `PartialContainer' for a partial class/struct/interface.
8617 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8618 of checking whether we're an `Interface' - we could be a
8620 (PartialContainer.Register): Override; call
8621 AddClass()/AddStruct()/AddInterface() on our parent.
8623 * cs-parser.jay (interface_member_declaration): Add things to the
8624 `current_container', not the `current_class'.
8626 * rootcontext.cs (RegisterOrder): The overloaded version which
8627 takes an `Interface' was unused, removed.
8629 * typemanager.cs (TypeManager.LookupInterface): Return a
8630 `TypeContainer', not an `Interface'.
8631 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8632 contain a `PartialContainer' for an interface, so check it's
8633 `Kind' to figure out what it is.
8635 2004-07-25 Martin Baulig <martin@ximian.com>
8637 * class.cs (Class.DefaultTypeAttributes): New public constant.
8638 (Struct.DefaultTypeAttributes): Likewise.
8639 (Interface.DefaultTypeAttributes): Likewise.
8640 (PartialContainer.TypeAttr): Override this and add the
8641 DefaultTypeAttributes.
8643 2004-07-25 Martin Baulig <martin@ximian.com>
8645 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8646 we can just use the `Parent' field instead.
8648 2004-07-25 Martin Baulig <martin@ximian.com>
8650 * class.cs (TypeContainer.Emit): Renamed to EmitType().
8652 2004-07-25 Martin Baulig <martin@ximian.com>
8654 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8655 our parts before defining any methods.
8656 (TypeContainer.VerifyImplements): Make this virtual.
8657 (ClassPart.VerifyImplements): Override and call VerifyImplements()
8658 on our PartialContainer.
8660 2004-07-25 Martin Baulig <martin@ximian.com>
8662 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8664 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8665 argument, we can just use the `Parent' field instead.
8668 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
8669 (MemberBase.DoDefine): Likewise.
8671 2004-07-24 Martin Baulig <martin@ximian.com>
8673 * decl.cs (MemberCore.Parent): New public field.
8674 (DeclSpace.Parent): Moved to MemberCore.
8676 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8677 (MemberBase.ctor): Added TypeContainer argument, pass it to our
8679 (FieldBase, Field, Operator): Likewise.
8680 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8681 (EventField, Event): Likewise.
8683 2004-07-23 Martin Baulig <martin@ximian.com>
8685 * class.cs (PartialContainer): New public class.
8686 (ClassPart): New public class.
8687 (TypeContainer): Added support for partial classes.
8688 (TypeContainer.GetClassBases): Splitted some of the functionality
8689 out into GetNormalBases() and GetPartialBases().
8691 * cs-tokenizer.cs (Token.PARTIAL): New token.
8692 (Tokenizer.consume_identifier): Added some hacks to recognize
8693 `partial', but only if it's immediately followed by `class',
8694 `struct' or `interface'.
8696 * cs-parser.jay: Added support for partial clases.
8698 2004-07-23 Martin Baulig <martin@ximian.com>
8700 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8701 a `DeclSpace' and also made it readonly.
8702 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8703 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8704 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8706 * cs-parser.jay: Pass the `current_class', not the
8707 `current_container' (at the moment, this is still the same thing)
8708 to a new Method, Property, Event, Indexer or Constructor.
8710 2004-07-23 Martin Baulig <martin@ximian.com>
8712 * cs-parser.jay (CSharpParser): Added a new `current_class' field
8713 and removed the `current_interface' one.
8714 (struct_declaration, class_declaration, interface_declaration):
8715 Set `current_class' to the newly created class/struct/interface;
8716 set their `Bases' and call Register() before parsing their body.
8718 2004-07-23 Martin Baulig <martin@ximian.com>
8720 * class.cs (Kind): New public enum.
8721 (TypeContainer): Made this class abstract.
8722 (TypeContainer.Kind): New public readonly field.
8723 (TypeContainer.CheckDef): New public method; moved here from
8725 (TypeContainer.Register): New public abstract method.
8726 (TypeContainer.GetPendingImplementations): New public abstract
8728 (TypeContainer.GetClassBases): Removed the `is_class' and
8729 `is_iface' parameters.
8730 (TypeContainer.DefineNestedTypes): Formerly known as
8732 (ClassOrStruct): Made this class abstract.
8734 * tree.cs (RootTypes): New public type.
8736 2004-07-20 Martin Baulig <martin@ximian.com>
8738 * tree.cs (Tree.RecordNamespace): Removed.
8739 (Tree.Namespaces): Removed.
8741 * rootcontext.cs (RootContext.IsNamespace): Removed.
8743 * cs-parser.jay (namespace_declaration): Just create a new
8744 NamespaceEntry here.
8746 2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
8748 * Makefile: Install gmcs.exe.config file together with gmcs.exe.
8749 * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
8750 entry to make sure it runs in the correct runtime version.
8752 2004-07-18 Martin Baulig <martin@ximian.com>
8754 * generic.cs (ConstructedType.CheckConstraints): Improved
8755 constraints checking.
8757 2004-07-18 Martin Baulig <martin@ximian.com>
8759 * expression.cs (Invocation.BetterMethod): Call
8760 TypeManager.TypeToCoreType() on all types and removed my previous
8761 hack; we're already doig the right thing here.
8763 2004-07-17 Martin Baulig <martin@ximian.com>
8765 * decl.cs (MemberName.MakeName): Create the "class`1" names here.
8767 2004-07-16 Martin Baulig <martin@ximian.com>
8769 * iterators.cs: Added generics support.
8771 2004-07-16 Martin Baulig <martin@ximian.com>
8773 * iterators.cs: Rewrote this. We're now using one single Proxy
8774 class for both the IEnumerable and the IEnumerator interface and
8775 `Iterator' derives from Class so we can use the high-level API.
8777 * class.cs (TypeContainer.AddIterator): New method.
8778 (TypeContainer.DoDefineType): New protected virtual method, which
8779 is called from DefineType().
8780 (TypeContainer.DoDefineMembers): Call DefineType() and
8781 DefineMembers() on all our iterators.
8782 (TypeContainer.Emit): Call Emit() on all our iterators.
8783 (TypeContainer.CloseType): Call CloseType() on all our iterators.
8785 * codegen.cs (EmitContext.CurrentIterator): New public field.
8787 2004-07-15 Martin Baulig <martin@ximian.com>
8790 (TypeManager.not_supported_exception_type): New type.
8792 2004-07-14 Martin Baulig <martin@ximian.com>
8795 (TypeManager.generic_ienumerable_type): New type.
8796 (TypeManager.generic_ienumerator_type): New type.
8799 (RootContext.interfaces_first_stage): Added
8800 "System.Collections.Generic.IEnumerator`1" and
8801 "System.Collections.Generic.IEnumerable`1".
8803 2004-07-14 Martin Baulig <martin@ximian.com>
8805 * iterators.cs: Use real error numbers.
8807 2004-07-14 Martin Baulig <martin@ximian.com>
8809 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8810 requires this to be a System.Collection.IEnumerable and not a
8811 class implementing that interface.
8812 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
8814 2004-07-13 Marek Safar <marek.safar@seznam.cz>
8816 * class.cs: Fixed previous fix, it broke some error tests.
8818 2004-07-12 Martin Baulig <martin@ximian.com>
8820 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8823 2004-07-14 Martin Baulig <martin@ximian.com>
8825 * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
8826 an exclamation mark (!) for the generic arity to reflect the
8827 latest spec changes; ie. use "System.Collections.Generic.IList`1".
8829 2004-07-13 Martin Baulig <martin@ximian.com>
8831 * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
8832 specifiers being part of a type argument.
8834 2004-07-13 Martin Baulig <martin@ximian.com>
8836 * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
8837 name for generic types.
8839 2004-07-13 Martin Baulig <martin@ximian.com>
8841 * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
8844 2004-07-09 Miguel de Icaza <miguel@ximian.com>
8846 * assign.cs (LocalTemporary): Add new argument: is_address,If
8847 `is_address' is true, then the value that we store is the address
8848 to the real value, and not the value itself.
8850 * ecore.cs (PropertyExpr): use the new local temporary
8851 stuff to allow us to handle X.Y += z (where X is a struct)
8853 2004-07-08 Martin Baulig <martin@ximian.com>
8855 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8856 not always return, just like we're doing in Using.Resolve().
8858 2004-07-07 Miguel de Icaza <miguel@ximian.com>
8860 * cs-parser.jay (fixed_statement): flag this as Pinned.
8862 2004-07-06 Miguel de Icaza <miguel@ximian.com>
8864 * typemanager.cs (TypeManager): Removed MakePinned method, this
8865 mechanism is replaced with the .NET 2.x compatible mechanism of
8866 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8868 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
8869 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8870 `IsFixed' property which has a different meaning.
8872 2004-07-02 Raja R Harinath <rharinath@novell.com>
8874 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8875 visible from inside a nested class, not just the names of the
8876 immediately enclosing class.
8879 2004-06-24 Raja R Harinath <rharinath@novell.com>
8881 * expression.cs (BetterConversion): Remove buggy special-case
8882 handling of "implicit constant expression conversions". At this
8883 point, we already know that the conversion is possible -- we're
8884 only checking to see which is better.
8886 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8888 * cs-parser.jay: Added error CS0210 test.
8890 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8892 * cs-parser.jay: Added error CS0134 test.
8894 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8897 * cs-parser.jay: Added error CS0145 test.
8899 2004-06-24 Marek Safar <marek.safar@seznam.cz>
8901 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8903 2004-06-23 Ben Maurer <bmaurer@ximian.com>
8905 * expression.cs (StackAlloc.Resolve): The argument may not
8906 be a constant; deal with this case.
8908 2004-06-23 Marek Safar <marek.safar@seznam.cz>
8910 * attribute.cs (IndexerName_GetIndexerName): Renamed to
8911 GetIndexerAttributeValue.
8912 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8914 * class.cs (Indexer.Define): Added error tests for CS0415,
8917 2004-06-23 Miguel de Icaza <miguel@ximian.com>
8919 * attribute.cs (Attribute.Resolve): Keep field code in sync with
8922 2004-06-23 Martin Baulig <martin@ximian.com>
8924 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8925 neither return nor throw, reset the barrier as well. Fixes #60457.
8927 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
8929 * class.cs : EventAttributes is now set to None by default.
8930 This fixes bug #60459.
8932 2004-06-18 Marek Safar <marek.safar@seznam.cz>
8935 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8936 Don't throw exception but return null (it's sufficient now).
8938 2004-06-18 Marek Safar <marek.safar@seznam.cz>
8940 * typemanager.cs (GetArgumentTypes): Faster implementation.
8942 2004-06-18 Martin Baulig <martin@ximian.com>
8944 * attribute.cs (Attribute.Resolve): Check whether we're an
8945 EmptyCast which a Constant child. Fixes #60333.
8947 2004-06-17 Ben Maurer <bmaurer@ximian.com>
8949 * statement.cs (EmitCollectionForeach): Account for the fact that
8950 not all valuetypes are in areas which we can take the address of.
8951 For these variables, we store to a temporary variable. Also, make
8952 sure that we dont emit a `callvirt' on a valuetype method.
8954 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8956 * expression.cs (StackAlloc.DoReSolve): Added test for
8957 negative parameter (CS0247).
8959 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8962 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8964 2004-06-15 Marek Safar <marek.safar@seznam.cz>
8967 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8970 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8972 Fix bug #58254 & cs1555.cs, cs1556.cs
8973 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8975 2004-06-14 Marek Safar <marek.safar@seznam.cz>
8977 * cs-parser.jay: Added error CS1669 test for indexers.
8979 2004-06-18 Martin Baulig <martin@ximian.com>
8981 * generics.cs (GenericMethod.ctor): Don't take an Attributes
8982 argument. Fixes #60441.
8984 2004-06-16 Ben Maurer <bmaurer@ximian.com>
8985 * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
8986 The name needs to have the actual name of the method in order
8987 for other tests (such as the one in OverloadResolve for Invoke
8988 on a delegate) to work. As well, it does not really help
8989 error reporting because the method group had multiple methods.
8990 * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
8991 Make profiling work.
8993 2004-06-13 Martin Baulig <martin@ximian.com>
8995 * cs-parser.jay: Don't allow generic attributes.
8997 2004-06-13 Martin Baulig <martin@ximian.com>
8999 * class.cs (MemberBase.DoDefineBase): New protected method.
9000 (MemberBase.DoDefine): Compute the `flags' in the new
9001 DoDefineBase() which must be called first.
9002 (Method.Define): Call DoDefineBase() first so we have the flags
9003 when defining the generic method.
9005 * cs-parser.jay (interface_method_declaration): Support generic methods.
9007 2004-06-13 Martin Baulig <martin@ximian.com>
9009 * decl.cs (TypeName): Removed.
9010 (MemberName): Removed TypeName and MemberNow; now we just have
9013 * cs-parser.jay: Don't distinguish between type arguments and type
9014 parameters in the grammar and simplified the rules a bit. The
9015 reduce/reduce conflicts are now gone (except the one we inherited
9018 2004-06-11 Martin Baulig <martin@ximian.com>
9020 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9021 call this twice: for params and varargs methods.
9023 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9026 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9028 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9030 * attribute.cs (Attribute.GetValidTargets): Made public.
9033 (AbstractPropertyEventMethod): New class for better code sharing.
9034 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
9036 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
9038 2004-06-09 Martin Baulig <martin@ximian.com>
9040 * cs-parser.jay: Removed a reduce/reduce conflict.
9042 2004-06-03 Martin Baulig <martin@ximian.com>
9044 * generic.cs (ConstructedType.GetMemberAccess): Renamed to
9045 GetSimpleName() and return a SimpleName.
9047 * ecore.cs (SimpleName.Arguments): New public field.
9048 (SimpleName): Added overloaded ctor which takes an additional
9049 TypeArguments argument.
9050 (SimpleName.SimpleNameResolve): Added support for generic methods.
9051 (MethodGroupExpr.ResolveGeneric): New public method. The code was
9052 formerly in MemberAccess.DoResolve(), but we also need it in
9053 SimpleNameResolve().
9055 * expression.cs (MemberAccess.DoResolve): Use the new
9056 MethodGroupExpr.ResolveGeneric().
9058 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9060 * decl.cs: If possible, use lookuptypedirect here. We can only do
9061 this if there is no `.' after the namespace. Avoids using
9062 LookupType, which does lots of slow processing.
9063 (FindNestedType) New method, does what it says :-).
9064 * namespace.cs: use LookupTypeDirect.
9065 * rootcontext.cs: use membercache, if possible.
9066 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9068 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9071 According to the spec,
9073 In a member access of the form E.I, if E is a single identifier,
9074 and if the meaning of E as a simple-name (§7.5.2) is a constant,
9075 field, property, localvariable, or parameter with the same type as
9076 the meaning of E as a type-name (§3.8), then both possible
9077 meanings of E are permitted.
9079 We did not check that E as a simple-name had the same type as E as
9082 This trivial check gives us 5-7% on bootstrap time.
9084 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9086 * expression.cs (Invocation.OverloadResolve): Avoid the
9087 use of hashtables and boxing here by allocating on demand.
9089 2004-05-30 Martin Baulig <martin@ximian.com>
9091 * rootcontext.cs (RootContext.LookupType): Don't cache things if
9092 we're doing a silent lookup. Don't try to lookup nested types in
9093 TypeManager.object_type (thanks to Ben Maurer).
9095 2004-05-30 Martin Baulig <martin@ximian.com>
9097 Committing a patch from Ben Maurer.
9099 * rootcontext.cs (RootContext.LookupType): Cache negative results.
9101 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9103 * convert.cs: add a trivial cache for overload operator resolution.
9105 2004-05-31 Marek Safar <marek.safar@seznam.cz>
9108 (AttributeTester.GetObsoleteAttribute): Returns instance of
9109 ObsoleteAttribute when type is obsolete.
9112 (TypeContainer.VerifyObsoleteAttribute): Override.
9113 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
9114 (MethodCode.VerifyObsoleteAttribute): Override.
9115 (MemberBase.VerifyObsoleteAttribute): Override.
9118 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
9119 and report proper error.
9122 (Delegate.VerifyObsoleteAttribute): Override.
9125 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
9126 and report proper error.
9127 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
9130 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
9134 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
9135 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
9136 Added test for ObsoleteAttribute.
9139 (Catch): Derived from Statement.
9141 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9143 * decl.cs: If possible, use lookuptypedirect here. We can only do
9144 this if there is no `.' after the namespace. Avoids using
9145 LookupType, which does lots of slow processing.
9146 (FindNestedType) New method, does what it says :-).
9147 * namespace.cs: use LookupTypeDirect.
9148 * rootcontext.cs: use membercache, if possible.
9149 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9151 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9154 According to the spec,
9156 In a member access of the form E.I, if E is a single identifier,
9157 and if the meaning of E as a simple-name (§7.5.2) is a constant,
9158 field, property, localvariable, or parameter with the same type as
9159 the meaning of E as a type-name (§3.8), then both possible
9160 meanings of E are permitted.
9162 We did not check that E as a simple-name had the same type as E as
9165 This trivial check gives us 5-7% on bootstrap time.
9167 2004-05-30 Marek Safar <marek.safar@seznam.cz>
9169 Fixed bug #59071 & cs0160.cs
9170 * statement.cs (Try.Resolve): Check here whether order of catch
9171 clauses matches their dependencies.
9173 2004-05-30 Marek Safar <marek.safar@seznam.cz>
9176 * ecore.cs (SimpleName.SimpleNameResolve): Added test for
9179 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9181 * expression.cs (Invocation.OverloadResolve): Avoid the
9182 use of hashtables and boxing here by allocating on demand.
9184 2004-05-30 Martin Baulig <martin@ximian.com>
9186 * rootcontext.cs (RootContext.LookupType): Don't cache things if
9187 we're doing a silent lookup. Don't try to lookup nested types in
9188 TypeManager.object_type (thanks to Ben Maurer).
9190 2004-05-30 Martin Baulig <martin@ximian.com>
9192 Committing a patch from Ben Maurer.
9194 * rootcontext.cs (RootContext.LookupType): Cache negative results.
9196 2004-05-29 Martin Baulig <martin@ximian.com>
9198 * class.cs (IMethodData.ShouldIgnore): New method.
9200 * typemanager.cs (TypeManager.MethodFlags): Don't take a
9201 `Location' argument, we don't need it anywhere. Use
9202 `IMethodData.ShouldIgnore ()' instead of
9203 `MethodData.GetMethodFlags ()'.
9204 (TypeManager.AddMethod): Removed.
9205 (TypeManager.AddMethod2): Renamed to AddMethod.
9207 2004-05-29 Martin Baulig <martin@ximian.com>
9209 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9211 * convert.cs (Convert.ImplicitReferenceConversion): If we're
9212 converting from a class type S to an interface type and we already
9213 have an object on the stack, don't box it again. Fixes #52578.
9215 2004-05-29 Martin Baulig <martin@ximian.com>
9217 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9218 Added support for `params' parameters. Fixes #59267.
9220 2004-05-29 Martin Baulig <martin@ximian.com>
9222 * literal.cs (NullPointer): Provide a private .ctor which sets
9223 `type' to TypeManager.object_type. Fixes #59048.
9225 2004-05-29 Martin Baulig <martin@ximian.com>
9227 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9228 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
9230 * ecore.cs (EventExpr.instance_expr): Make the field private.
9232 2004-05-26 Marek Safar <marek.safar@seznam.cz>
9234 Fixed bug #50080 & cs0214-2.cs
9235 * expression.cs (Cast.DoResolve): Check unsafe context here.
9237 * statement.cs (Resolve.DoResolve): Likewise.
9239 2004-05-26 Martin Baulig <martin@ximian.com>
9241 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9243 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9244 (RootContext.LookupType): Pass down the `silent' flag.
9246 2004-05-25 Martin Baulig <martin@ximian.com>
9249 (MethodGroupExpr.IdenticalTypeName): New public property.
9250 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9251 expression actually refers to a type.
9253 2004-05-25 Martin Baulig <martin@ximian.com>
9255 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9256 for #56176 and made it actually work.
9258 2004-05-25 Martin Baulig <martin@ximian.com>
9260 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9261 (FieldExpr, PropertyExpr): Override and implement
9262 CacheTemporaries. Fixes #52279.
9264 2004-05-25 Miguel de Icaza <miguel@ximian.com>
9266 * location.cs: In the new compiler listing a file twice is a
9267 warning, not an error.
9269 2004-05-24 Martin Baulig <martin@ximian.com>
9271 * enum.cs (Enum.DefineType): For the `BaseType' to be a
9272 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
9274 2004-05-24 Martin Baulig <martin@ximian.com>
9276 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9277 walking the `using' list. Fixes #53921.
9279 2004-05-24 Martin Baulig <martin@ximian.com>
9281 * const.cs (Const.LookupConstantValue): Added support for
9282 EmptyCast's; fixes #55251.
9284 2004-05-24 Martin Baulig <martin@ximian.com>
9286 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9287 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9288 which does the CS0135 check. The reason is that we first need to
9289 check whether the variable actually exists.
9291 2004-05-24 Martin Baulig <martin@ximian.com>
9293 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9294 than RootContext.LookupType() to find the explicit interface
9297 2004-05-24 Raja R Harinath <rharinath@novell.com>
9299 * Makefile: Simplify. Use executable.make.
9300 * mcs.exe.sources: New file. List of sources of mcs.exe.
9302 2004-05-24 Anders Carlsson <andersca@gnome.org>
9306 Use the invariant culture when doing String.Compare for CLS case
9309 2004-05-23 Martin Baulig <martin@ximian.com>
9311 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9312 don't have any dots. Fixes #52622, added cs0246-8.cs.
9314 * namespace.cs (NamespaceEntry.Lookup): Likewise.
9316 2004-05-23 Marek Safar <marek.safar@seznam.cz>
9318 * class.cs (MemberBase.Define): Reuse MemberType member for
9319 resolved type. Other methods can use it too.
9321 2004-05-23 Martin Baulig <martin@ximian.com>
9323 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9324 the variable also exists in the current block (otherwise, we need
9325 to report a CS0103). Fixes #58670.
9327 2004-05-23 Martin Baulig <martin@ximian.com>
9329 * flowanalysis.cs (Reachability.Reachable): Compute this
9330 on-the-fly rather than storing it as a field.
9332 2004-05-23 Martin Baulig <martin@ximian.com>
9334 * flowanalysis.cs (Reachability.And): Manually compute the
9335 resulting `barrier' from the reachability.
9337 2004-05-23 Marek Safar <marek.safar@seznam.cz>
9340 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9341 instance of ObsoleteAttribute when symbol is obsolete.
9344 (IMethodData): Extended interface for ObsoleteAttribute support.
9346 2004-05-22 Marek Safar <marek.safar@seznam.cz>
9348 * attribute.cs: Fix bug #55970
9350 2004-05-22 Marek Safar <marek.safar@seznam.cz>
9354 (GetObsoleteAttribute): New method. Creates the instance of
9356 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9357 ObsoleteAttribute when member is obsolete.
9358 (AttributeTester.Report_ObsoleteMessage): Common method for
9359 Obsolete error/warning reporting.
9362 (TypeContainer.base_classs_type): New member for storing parent type.
9365 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9366 for this MemberCore.
9368 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9370 * attribute.cs, const.cs: Fix bug #58590
9372 2004-05-21 Martin Baulig <martin@ximian.com>
9374 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9375 out parameters if the end of the method is unreachable. Fixes
9378 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9380 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9381 Hari was right, why extra method.
9383 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9385 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9387 2004-05-20 Martin Baulig <martin@ximian.com>
9389 * delegate.cs: Convert this file to Unix mode - like the original
9392 2004-05-20 Martin Baulig <martin@ximian.com>
9394 * attribute.cs: Convert this file to Unix mode - like the original
9397 2004-05-19 Marek Safar <marek.safar@seznam.cz>
9399 Fix bug #58688 (MCS does not report error when the same attribute
9402 * attribute.cs (Attribute.Emit): Distinction between null and default.
9404 2004-05-19 Raja R Harinath <rharinath@novell.com>
9406 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9407 of a top-level attribute without an attribute target.
9408 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
9410 (Attribute.Conditional_GetConditionName),
9411 (Attribute.Obsolete_GetObsoleteMessage): Update.
9412 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
9413 part of ScanForIndexerName.
9414 (Attribute.CanIgnoreInvalidAttribute): New function.
9415 (Attribute.ScanForIndexerName): Move to ...
9416 (Attributes.ScanForIndexerName): ... here.
9417 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9418 (Attributes.Search): New internal variant that can choose not to
9419 complain if types aren't resolved. The original signature now
9421 (Attributes.GetClsCompliantAttribute): Use internal variant, with
9422 complaints suppressed.
9423 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9424 only if it not useful.
9425 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9426 top-level for attributes that are shared between the assembly
9427 and a top-level class.
9428 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9429 * class.cs: Update to reflect changes.
9430 (DefineIndexers): Fuse loops.
9431 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
9432 a couple more variants of attribute names.
9434 2004-05-18 Marek Safar <marek.safar@seznam.cz>
9436 Fix bug #52585 (Implemented explicit attribute declaration)
9439 (Attributable.ValidAttributeTargets): New abstract method. It gets
9440 list of valid attribute targets for explicit target declaration.
9441 (Attribute.Target): It holds target itself.
9442 (AttributeSection): Removed.
9443 (Attribute.CheckTargets): New method. It checks whether attribute
9444 target is valid for the current element.
9447 (EventProperty): New class. For events that are declared like
9448 property (with add and remove accessors).
9449 (EventField): New class. For events that are declared like field.
9452 * cs-parser.jay: Implemented explicit attribute target declaration.
9454 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
9455 Override ValidAttributeTargets.
9458 (ReturnParameter): Class for applying custom attributes on
9460 (ParameterAtribute): New class. Class for applying custom
9461 attributes on the parameter type.
9463 2004-05-17 Miguel de Icaza <miguel@ximian.com>
9465 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9468 (Method): Allow UNSAFE here.
9470 * modifiers.cs: Support unsafe reporting.
9472 2004-05-17 Marek Safar <marek.safar@seznam.cz>
9474 * decl.cs: Fix bug #58478.
9476 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9478 * statement.cs: When checking for unreachable code on an EmptyStatement,
9479 set the location. Fixes bug #58488.
9481 2004-05-13 Miguel de Icaza <miguel@ximian.com>
9483 * driver.cs: Add -pkg handling.
9485 From Gonzalo: UseShelLExecute=false
9487 2004-05-12 Marek Safar <marek.safar@seznam.cz>
9490 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9492 (Attribute.IsClsCompliaceRequired): Moved to base for better
9494 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9495 when attribute is AttributeUsageAttribute.
9496 (Attribute.GetValidTargets): Simplified.
9497 (Attribute.GetAttributeUsage): New method returns AttributeUsage
9498 attribute for this type.
9499 (Attribute.ApplyAttributes): Method renamed to Emit and make
9501 (GlobalAttributeSection): New class for special handling of global
9502 attributes (assembly, module).
9503 (AttributeSection.Emit): New method.
9505 * class.cs: Implemented Attributable abstract methods.
9506 (MethodCore.LabelParameters): Moved to Parameter class.
9507 (Accessor): Is back simple class.
9508 (PropertyMethod): Implemented Attributable abstract class.
9509 (DelegateMethod): Implemented Attributable abstract class.
9510 (Event): New constructor for disctintion between normal Event
9511 and Event with accessors.
9513 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9515 * codegen.cs, const.cs, decl.cs, delegate.cs:
9516 (CommonAssemblyModulClass): Implemented Attributable abstract class
9519 * enum.cs: Implement IAttributeSupport interface.
9520 (EnumMember): New class for emum members. Implemented Attributable
9524 (ParameterBase): Is abstract.
9525 (ReturnParameter): New class for easier [return:] attribute handling.
9527 * typemanager.cs: Removed builder_to_attr.
9529 2004-05-11 Raja R Harinath <rharinath@novell.com>
9532 * attribute.cs (Attribute.GetPositionalValue): New function.
9533 * class.cs (TypeContainer.VerifyMembers): New function.
9534 (TypeContainer.Emit): Use it.
9535 (ClassOrStruct): New base class for Class and Struct.
9536 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
9537 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9539 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9540 then each non-static field should have a FieldOffset attribute.
9541 Otherwise, none of the fields should have a FieldOffset attribute.
9542 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
9543 and FieldOffset attributes.
9544 * typemanager.cs (TypeManager.struct_layout_attribute_type)
9545 (TypeManager.field_offset_attribute_type): New core types.
9546 (TypeManager.InitCoreTypes): Initialize them.
9548 2004-05-11 Michal Moskal <malekith@pld-linux.org>
9550 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9551 Return correct type.
9554 2004-05-09 Miguel de Icaza <miguel@ximian.com>
9556 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9557 be implicitly converted to ulong.
9559 * expression.cs: The logic for allowing operator &, | and ^ worked
9560 was wrong, it worked before because we did not report an error in
9561 an else branch. Fixes 57895.
9563 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9564 allow volatile fields to be reference types.
9566 2004-05-07 Miguel de Icaza <miguel@ximian.com>
9568 * driver.cs: Add support for /debug-
9570 2004-05-07 Raja R Harinath <rharinath@novell.com>
9572 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
9573 Add a 'complain' parameter to silence errors.
9574 (Attribute.Resolve): Update to changes. Put in sanity check to catch
9575 silently overlooked type-resolutions.
9576 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9578 (Attributes.Search): New function.
9579 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9580 (Attributes.GetAttributeFullName): Remove hack.
9581 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
9582 Update to reflect changes.
9583 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9584 Use Attributes.Search instead of nested loops.
9586 2004-05-07 Marek Safar <marek.safar@seznam.cz>
9589 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9590 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9591 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9593 * report.cs: (Report.Warning): Renamed to Warning_T because of
9594 parameter collision.
9596 2004-05-05 Raja R Harinath <rharinath@novell.com>
9598 * expression.cs (MemberAccess.ResolveMemberAccess):
9599 Exit with non-zero status after Report.Error.
9600 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9602 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9604 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9606 * support.cs: Don't hang when the file is empty.
9608 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9610 * support.cs: In SeekableStreamReader, compute the preamble size of the
9611 underlying stream. Position changes should take into account that initial
9614 2004-05-03 Todd Berman <tberman@sevenl.net>
9616 * driver.cs: remove unused GetSysVersion function.
9618 2004-05-03 Todd Berman <tberman@sevenl.net>
9620 * driver.cs: Remove the hack from saturday, as well as the hack
9621 from jackson (LoadAssemblyFromGac), also adds the CWD to the
9622 link_paths to get that bit proper.
9624 2004-05-01 Todd Berman <tberman@sevenl.net>
9626 * driver.cs: Try a LoadFrom before a Load, this checks the current
9627 path. This is currently a bug in mono that is be fixed, however, this
9628 provides a workaround for now. This will be removed when the bug
9631 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
9633 * CryptoConvert.cs: Updated to latest version. Fix issue with
9634 incomplete key pairs (#57941).
9636 2004-05-01 Todd Berman <tberman@sevenl.net>
9638 * driver.cs: Remove '.' from path_chars, now System.* loads properly
9641 2004-04-30 Jackson Harper <jackson@ximian.com>
9643 * codegen.cs: Open keys readonly.
9645 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9647 * typemanager.cs: don't report cyclic struct layout when a struct
9648 contains 2 or more fields of the same type. Failed for Pango.AttrShape
9649 which has 2 Pango.Rectangle fields.
9651 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
9653 * expression.cs: Handle IntPtr comparisons with IL code
9654 rather than a method call.
9656 2004-04-29 Martin Baulig <martin@ximian.com>
9658 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
9659 the list of PropertyInfo's in class hierarchy and find the
9660 accessor. Fixes #56013.
9662 2004-04-29 Martin Baulig <martin@ximian.com>
9664 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9666 2004-04-29 Martin Baulig <martin@ximian.com>
9668 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9670 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9672 2004-04-29 Martin Baulig <martin@ximian.com>
9674 * class.cs (ConstructorInitializer.Resolve): Check whether the
9675 parent .ctor is accessible. Fixes #52146.
9677 2004-04-29 Martin Baulig <martin@ximian.com>
9679 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9681 * statement.cs (Using.EmitLocalVariableDecls): Use
9682 TypeManager.idisposable_type, not typeof (IDisposable).
9683 (Foreach.EmitCollectionForeach): Added support for valuetypes.
9685 2004-04-29 Martin Baulig <martin@ximian.com>
9687 * class.cs (Event.Define): Don't emit the field and don't set
9688 RTSpecialName and SpecialName for events on interfaces. Fixes
9691 2004-04-29 Raja R Harinath <rharinath@novell.com>
9693 Refactor Attribute.ApplyAttributes.
9694 * attribute.cs (Attributable): New base class for objects that can
9695 have Attributes applied on them.
9696 (Attribute): Make AttributeUsage fields public.
9697 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9698 (Attribute.IsInternalCall): New property.
9699 (Attribute.UsageAttr): Convert to a public read-only property.
9700 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9701 (Attribute.ResolveType, Attribute.Resolve)
9702 (Attribute.ScanForIndexerName): Update to reflect changes.
9703 (Attribute.CheckAttributeTarget): Re-format.
9704 (Attribute.ApplyAttributes): Refactor, to various
9705 Attributable.ApplyAttributeBuilder methods.
9706 * decl.cs (MemberCore): Make Attributable.
9707 * class.cs (Accessor): Make Attributable.
9708 (MethodData.ApplyAttributes): Use proper attribute types, not
9710 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9711 (TypeContainer.ApplyAttributeBuilder)
9712 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9713 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
9714 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9715 (Operator.ApplyAttributeBuilder): New factored-out methods.
9716 * const.cs (Const.ApplyAttributeBuilder): Likewise.
9717 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9718 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9719 * parameter.cs (ParameterBase): New Attributable base class
9720 that can also represent Return types.
9721 (Parameter): Update to the changes.
9723 2004-04-29 Jackson Harper <jackson@ximian.com>
9725 * driver.cs: Prefer the corlib system version when looking for
9726 assemblies in the GAC. This is still a hack, but its a better hack
9729 2004-04-29 Marek Safar <marek.safar@seznam.cz>
9731 * decl.cs, enum.cs: Improved error 3005 reporting.
9733 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9734 (related_symbols): New private member for list of symbols
9735 related to reported error/warning.
9737 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9739 2004-04-29 Martin Baulig <martin@ximian.com>
9741 * ecore.cs (Expression.Constantify): If we're an enum and
9742 TypeManager.TypeToCoreType() doesn't give us another type, use
9743 t.UnderlyingSystemType. Fixes #56178.
9745 2004-04-29 Martin Baulig <martin@ximian.com>
9747 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9748 interfaces and for each interface, only add members directly
9749 declared in that interface. Fixes #53255.
9751 2004-04-28 Martin Baulig <martin@ximian.com>
9753 * expression.cs (ConditionalLogicalOperator): Use a temporary
9754 variable for `left' to avoid that we evaluate it more than once;
9757 2004-04-28 Martin Baulig <martin@ximian.com>
9759 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9762 2004-04-28 Martin Baulig <martin@ximian.com>
9764 * statement.cs (LocalInfo.Resolve): Check whether the type is not
9767 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9768 whether the type is not void (CS1547).
9770 2004-04-28 Martin Baulig <martin@ximian.com>
9772 * expression.cs (Unary.DoResolveLValue): Override this and report
9773 CS0131 for anything but Operator.Indirection.
9775 2004-04-28 Martin Baulig <martin@ximian.com>
9777 Committing a patch from Ben Maurer; see bug #50820.
9779 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9782 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9785 2004-04-28 Martin Baulig <martin@ximian.com>
9787 Committing a patch from Ben Maurer; see bug #50820.
9789 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9792 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9795 2004-04-28 Martin Baulig <martin@ximian.com>
9797 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9798 (Block.AddLabel): Call DoLookupLabel() to only search in the
9801 2004-04-28 Martin Baulig <martin@ximian.com>
9803 * cfold.cs (ConstantFold.BinaryFold): Added special support for
9804 comparing StringConstants and NullLiterals in Equality and Inequality.
9806 2004-04-28 Jackson Harper <jackson@ximian.com>
9808 * driver.cs: Attempt to load referenced assemblies from the
9809 GAC. This is the quick and dirty version of this method that
9810 doesnt take into account versions and just takes the first
9811 canidate found. Will be good enough for now as we will not have more
9812 then one version installed into the GAC until I update this method.
9814 2004-04-28 Martin Baulig <martin@ximian.com>
9816 * typemanager.cs (TypeManager.CheckStructCycles): New public
9817 static method to check for cycles in the struct layout.
9819 * rootcontext.cs (RootContext.PopulateTypes): Call
9820 TypeManager.CheckStructCycles() for each TypeContainer.
9821 [Note: We only need to visit each type once.]
9823 2004-04-28 Martin Baulig <martin@ximian.com>
9825 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9827 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9828 success and added `out object value'. Use a `bool resolved' field
9829 to check whether we've already been called rather than
9830 `ConstantValue != null' since this breaks for NullLiterals.
9832 2004-04-28 Raja R Harinath <rharinath@novell.com>
9834 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9835 setting of this flag, since the 'set' method may be non-public.
9837 2004-04-28 Raja R Harinath <rharinath@novell.com>
9839 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9840 check on current_vector.Block.
9842 2004-04-27 Martin Baulig <martin@ximian.com>
9844 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9845 a field initializer. Fixes #56459.
9847 2004-04-27 Martin Baulig <martin@ximian.com>
9849 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9850 we're not attempting to use an indexer. Fixes #52154.
9852 2004-04-27 Martin Baulig <martin@ximian.com>
9854 * statement.cs (Return): Don't create a return label if we don't
9855 need it; reverts my change from January 20th. Thanks to Ben
9858 2004-04-27 Martin Baulig <martin@ximian.com>
9860 According to the spec, `goto' can only leave a nested scope, but
9863 * statement.cs (Block.LookupLabel): Only lookup in the current
9864 block, don't recurse into parent or child blocks.
9865 (Block.AddLabel): Check in parent and child blocks, report
9866 CS0140/CS0158 if we find a duplicate.
9867 (Block): Removed this indexer for label lookups.
9868 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9869 this already does the error reporting for us.
9872 (FlowBranching.UsageVector.Block): New public variable; may be null.
9873 (FlowBranching.CreateSibling): Added `Block' argument.
9874 (FlowBranching.LookupLabel): New public virtual method. Lookup a
9875 label for the target of a `goto' and check whether we're not
9876 leaving a `finally'.
9878 2004-04-27 Martin Baulig <martin@ximian.com>
9880 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9881 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9884 2004-04-27 Martin Baulig <martin@ximian.com>
9886 * statement.cs (Block.AddLabel): Also check for implicit blocks
9887 and added a CS0158 check.
9889 2004-04-27 Martin Baulig <martin@ximian.com>
9891 * flowanalysis.cs (FlowBranchingLoop): New class.
9892 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9893 UsageVector's instead of an ArrayList.
9894 (FlowBranching.Label): Likewise.
9895 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9896 (FlowBranching.AddBreakVector): New method.
9898 2004-04-27 Miguel de Icaza <miguel@ximian.com>
9900 * attribute.cs: Small regression fix: only convert the type if we
9901 the type is different, fixes System.Drawing build.
9903 2004-04-27 Martin Baulig <martin@ximian.com>
9905 * attribute.cs (Attribute.Resolve): If we have a constant value
9906 for a named field or property, implicity convert it to the correct
9909 2004-04-27 Raja R Harinath <rharinath@novell.com>
9911 * statement.cs (Block.Block): Implicit blocks share
9912 'child_variable_names' fields with parent blocks.
9913 (Block.AddChildVariableNames): Remove.
9914 (Block.AddVariable): Mark variable as "used by a child block" in
9915 every surrounding block.
9916 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9917 been used in a child block, complain about violation of "Invariant
9918 meaning in blocks" rule.
9919 * cs-parser.jay (declare_local_variables): Don't use
9920 AddChildVariableNames.
9921 (foreach_statement): Don't create an implicit block: 'foreach'
9924 2004-04-23 Miguel de Icaza <miguel@ximian.com>
9926 * convert.cs (ImplicitNumericConversion): 0 is also positive when
9927 converting from 0L to ulong. Fixes 57522.
9929 2004-04-22 Marek Safar <marek.safar@seznam.cz>
9931 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9932 derived class hides via 'new' keyword field from base class (test-242.cs).
9933 TODO: Handle this in the more general way.
9935 * class.cs (CheckBase): Ditto.
9937 2004-04-22 Marek Safar <marek.safar@seznam.cz>
9939 * decl.cs (caching_flags): New member for storing cached values
9941 (MemberCore.Flags): New enum where bit flags for caching_flags
9943 (MemberCore.cls_compliance): Moved to caching_flags.
9944 (DeclSpace.Created): Moved to caching_flags.
9946 * class.cs: Use caching_flags instead of DeclSpace.Created
9948 2004-04-21 Miguel de Icaza <miguel@ximian.com>
9950 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9951 if we are only a derived class, not a nested class.
9953 * typemanager.cs: Same as above, but do this at the MemberLookup
9954 level (used by field and methods, properties are handled in
9955 PropertyExpr). Allow for the qualified access if we are a nested
9958 2004-04-21 Marek Safar <marek.safar@seznam.cz>
9960 * class.cs: Refactoring.
9961 (IMethodData): New inteface; Holds links to parent members
9962 to avoid member duplication (reduced memory allocation).
9963 (Method): Implemented IMethodData interface.
9964 (PropertyBase): New inner classes for get/set methods.
9965 (PropertyBase.PropertyMethod): Implemented IMethodData interface
9966 (Event): New inner classes for add/remove methods.
9967 (Event.DelegateMethod): Implemented IMethodData interface.
9969 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9970 EmitContext (related to class.cs refactoring).
9972 2004-04-21 Raja R Harinath <rharinath@novell.com>
9974 * delegate.cs (Delegate.VerifyApplicability): If the number of
9975 arguments are the same as the number of parameters, first try to
9976 verify applicability ignoring any 'params' modifier on the last
9980 2004-04-08 Martin Baulig <martin@ximian.com>
9982 Merged latest changes into gmcs. Please keep this comment in
9983 here, it makes it easier for me to see what changed in MCS since
9984 the last time I merged.
9986 2004-04-16 Raja R Harinath <rharinath@novell.com>
9988 * class.cs (TypeContainer.AddIndexer): Use
9989 'ExplicitInterfaceName' to determine if interface name was
9990 explicitly specified. 'InterfaceType' is not initialized at this time.
9991 (TypeContainer.DefineIndexers): Remove use of temporary list. The
9992 Indexers array is already in the required order. Initialize
9993 'IndexerName' only if there are normal indexers.
9994 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
9995 (TypeContainer.Emit): Emit DefaultMember attribute only if
9996 IndexerName is initialized.
9999 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
10001 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10004 2004-04-15 Raja R Harinath <rharinath@novell.com>
10006 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10010 * attribute.cs (Attribute.Resolve): Check for duplicate named
10014 2004-04-15 Miguel de Icaza <miguel@ximian.com>
10016 * iterators.cs (MarkYield): track whether we are in an exception,
10017 and generate code accordingly. Use a temporary value to store the
10018 result for our state.
10020 I had ignored a bit the interaction of try/catch with iterators
10021 since their behavior was not entirely obvious, but now it is
10022 possible to verify that our behavior is the same as MS .NET 2.0
10026 2004-04-14 Miguel de Icaza <miguel@ximian.com>
10028 * iterators.cs: Avoid creating temporaries if there is no work to
10031 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10032 Enumerations, use TypeManager.EnumToUnderlying and call
10035 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10038 (This.Emit): Use EmitContext.EmitThis to emit our
10041 (This.EmitAssign): Ditto.
10043 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
10044 codepaths, we will move all the functionality into
10047 (FieldExpr.EmitAssign): Ditto.
10049 This fixes several hidden bugs that I uncovered while doing a code
10050 review of this today.
10052 * codegen.cs (EmitThis): reworked so the semantics are more clear
10053 and also support value types "this" instances.
10055 * iterators.cs: Changed so that for iterators in value types, we
10056 do not pass the value type as a parameter.
10058 Initialization of the enumerator helpers is now done in the caller
10059 instead of passing the parameters to the constructors and having
10060 the constructor set the fields.
10062 The fields have now `assembly' visibility instead of private.
10064 2004-04-11 Miguel de Icaza <miguel@ximian.com>
10066 * expression.cs (Argument.Resolve): Check if fields passed as ref
10067 or out are contained in a MarshalByRefObject.
10069 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
10070 another compiler type.
10072 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
10074 * class.cs (Indexer.Define): use the new name checking method.
10075 Also, return false on an error.
10076 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
10077 (is_identifier_[start/part]_character): make static.
10079 2004-04-10 Miguel de Icaza <miguel@ximian.com>
10081 * expression.cs (Binary.ResolveOperator): Do no append strings
10082 twice: since we can be invoked more than once (array evaluation)
10083 on the same concatenation, take care of this here. Based on a fix
10084 from Ben (bug #56454)
10086 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
10088 * codegen.cs: Fix another case where CS1548 must be reported (when
10089 delay-sign isn't specified and no private is available #56564). Fix
10090 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
10091 error when MCS is used on the MS runtime and we need to delay-sign
10092 (which seems unsupported by AssemblyBuilder - see #56621).
10094 2004-04-08 Marek Safar <marek.safar@seznam.cz>
10096 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
10097 (TypeManager.ComputeNamespaces): Faster implementation for
10100 * compiler.csproj: Updated AssemblyName to mcs.
10102 2004-05-11 Jackson Harper <jackson@ximian.com>
10104 * Makefile: Preserve MONO_PATH
10106 2004-05-11 Jackson Harper <jackson@ximian.com>
10108 * Makefile: Use mono and mcs to build gmcs
10110 2004-05-03 Miguel de Icaza <miguel@ximian.com>
10112 * codegen.cs: Add patch from Robert Shade
10113 <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
10116 2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
10118 * CryptoConvert.cs: Updated to latest version. Fix issue with
10119 incomplete key pairs (#57941).
10121 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
10123 * codegen.cs: Fix another case where CS1548 must be reported (when
10124 delay-sign isn't specified and no private is available #56564). Fix
10125 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
10126 error when MCS is used on the MS runtime and we need to delay-sign
10127 (which seems unsupported by AssemblyBuilder - see #56621).
10129 2004-04-29 Jackson Harper <jackson@ximian.com>
10131 * Makefile: Set MONO_PATH to use the bootstrap corlib
10132 * driver.cs: Check the GAC for referenced assemblies.
10134 2004-04-29 Martin Baulig <martin@ximian.com>
10136 * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
10138 2004-04-07 Martin Baulig <martin@ximian.com>
10140 * expression.cs (Binary.ResolveOperator): Added special case for
10141 Equality/Inequality between a type parameter and a null literal.
10143 2004-04-07 Martin Baulig <martin@ximian.com>
10145 * convert.cs: Check null literal -> type parameter conversions.
10147 2004-04-07 Martin Baulig <martin@ximian.com>
10149 * generic.cs (ConstructedType.CheckConstraints): Enforce the
10150 `class' and `struct' constraints.
10152 2004-04-07 Martin Baulig <martin@ximian.com>
10154 * generic.cs (SpecialConstraint): New public enum.
10155 (Constraints.Resolve): Added support for the `class' and `struct'
10158 * cs-parser.jay (type_parameter_constraint): Added support for the
10159 `class' and `struct' constraints.
10161 2004-04-07 Martin Baulig <martin@ximian.com>
10163 * support.cs (GenericConstraints): Replaced `Types' by
10164 `ClassConstraint' and `InterfaceConstraints'; added
10165 `HasClassConstraint'.
10167 2004-04-07 Martin Baulig <martin@ximian.com>
10170 (Constraints.InterfaceConstraints): New public property.
10171 (Constraints.Types): Make this property public
10172 (TypeParameter): Implement IMemberContainer.
10173 (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
10174 instead of a TypeBuilder/MethodBuilder; pass the interface
10175 constraints to TypeManager.AddTypeParameter().
10176 (TypeParameter.DefineType): Just take an EmitContext and no
10177 TypeBuilder/MethodBuilder. Use the new public API.
10179 * typemanager.cs (TypeManager.AddTypeParameter): Added
10180 `TypeExpr[]' argument; add the interfaces to the
10181 `builder_to_ifaces' hash.
10182 (TypeManager.LookupMemberContainer): For
10183 GenericTypeParameterBuilders, get the TypeParameter from the
10184 `builder_to_type_param'.
10185 (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
10186 the TypeParameter and call FindMembers on it.
10188 2004-04-07 Martin Baulig <martin@ximian.com>
10191 (MethodCore.GenericMethod): Moved this field here from Method.
10192 (MethodCore.IsDuplicateImplementation): Take the number of type
10193 parameters into account if we're a generic method.
10195 * expression.cs (Invocation.InferTypeArguments): Don't return true
10196 if `arguments' is null; we still need to check whether we actually
10197 don't need to infer anything in this case.
10198 (MemberAccess): Merged the functionality from GenericMemberAccess
10201 * generic.cs (GenericMemberAccess): Removed.
10203 2004-04-05 Martin Baulig <martin@ximian.com>
10205 * decl.cs (MemberCore): For generic classes, interfaces and
10206 structs, `Name' now includes the number of type parameters
10207 ("Stack!1.Node!1").
10208 (DeclSpace.FindType): Removed the `num_type_args' argument; we now
10209 encode the number of type arguments in the type name.
10211 * expression.cs (Expression.MemberLookup): Removed the
10212 `num_type_args' argument; we now encode the number of type
10213 arguments in the type name.
10215 * ecore.cs (SimpleName): Encode the number of type arguments in
10216 the type name itself.
10218 * generic.cs (ConstructedType): Likewise.
10220 * tree.cs (Tree.RecordDecl): Take a `string' instead of a
10221 `MemberName'; we now include the number of type parameters in the
10224 * typemanager.cs (TypeManager.CheckGeneric): Removed.
10225 (TypeManager.MemberLookup): Removed the
10226 `num_type_args' argument; we now encode the number of type
10227 arguments in the type name.
10229 2004-04-03 Martin Baulig <martin@ximian.com>
10231 * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
10232 (MemberCore.MemberName): Moved here from MemberBase.
10233 (DeclSpace.SetParameterInfo): Just take the constraints as an
10234 ArrayList; we already have the type parameters in our
10235 `MemberName'; also do the CS0080 reporting here.
10237 * cs-parser.jay (struct_declaration): Use `member_name' instead of
10238 `IDENTIFIER opt_type_parameter_list'; when constructing our
10239 `MemberName', it'll already include our type parameters.
10240 (class_declaration, interface_declaration): Likewise.
10241 (delegate_declaration): Likewise.
10242 (MakeName): Take a MemberName and return a MemberName.
10243 The following two changes are required to avoid shift/reduce conflicts:
10244 (member_name): Don't include a TypeName anymore; ie. this is now
10245 just 'IDENTIFIER opt_type_parameter_list'.
10246 (property_declaration, event_declaration): Use a
10247 `namespace_or_type_name' instead of a `member_name'.
10249 2004-04-03 Martin Baulig <martin@ximian.com>
10251 * decl.cs (MemberName): Renamed to `TypeName' and created a new
10252 `MemberName' class.
10253 (TypeName): Formerly known as MemberName.
10255 * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
10256 instead of a `MemberName'.
10258 * cs-parser.jay (namespace_or_type_name): Create a TypeName.
10259 (member_name): New rule; create a MemberName.
10261 2004-04-02 Martin Baulig <martin@ximian.com>
10263 * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
10264 (CS0305 and CS0308).
10266 2004-04-02 Martin Baulig <martin@ximian.com>
10268 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
10269 support for nested types.
10271 2004-04-02 Martin Baulig <martin@ximian.com>
10273 * ecore.cs (IAlias): New public interface.
10274 (TypeExpr, TypeExpression): Implement IAlias.
10275 (TypeAliasExpression): New public class.
10277 * namespace.cs (Namespace): Implement IAlias.
10278 (Namespace.Lookup): Return an IAlias instead on an object.
10279 (Namespace.DefineName): Take an IAlias instead of an object.
10280 (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
10282 (NamespaceEntry.UsingAlias): Take a Membername instead of an
10284 (NamespaceEntry.LookupAlias): Return an IAlias instead on an
10286 (NamespaceEntry.Lookup): Likewise.
10288 * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
10291 * decl.cs (DeclSpace): Implement IAlias.
10292 (DeclSpace.LookupAlias): Return an IAlias instead of a string.
10294 * generic.cs (ConstructedType): Improved error checking.
10296 2004-04-02 Martin Baulig <martin@ximian.com>
10298 * convert.cs: Added type parameter conversions.
10301 (UnboxCast.Emit): Emit an `unbox.any' for type params.
10302 (ClassCast.Emit): If the source type is a type parameter, box it.
10303 If the target type is a type parameter, emit an `unbox.any'
10304 instead of a `classcast'.1
10306 2004-04-01 Martin Baulig <martin@ximian.com>
10308 * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
10310 2004-04-01 Martin Baulig <martin@ximian.com>
10312 * generic.cs (ConstructedType.CheckConstraints): Use
10313 Convert.ImplicitStandardConversionExists(); user-defined implicit
10314 conversions are not allowed according to the spec.
10316 2004-03-30 Martin Baulig <martin@ximian.com>
10318 * expression.cs (New): Added support for type parameters.
10321 (TypeManager.activator_type): New public static field.
10322 (TypeManager.activator_create_instance): Likewise.
10324 2004-03-30 Martin Baulig <martin@ximian.com>
10326 * typemanager.cs (TypeManager.HasConstructorConstraint): New
10329 2004-03-30 Martin Baulig <martin@ximian.com>
10331 * generic.cs (ConstructedType.CheckConstraints): Actually follow
10332 the spec here: the argument type must be convertible to the
10335 2004-03-30 Martin Baulig <martin@ximian.com>
10338 (TypeParameter.Define, TypeParameter.DefineMethod): Call
10339 TypeManager.AddTypeParameter().
10340 (ConstructedType.CheckConstraints): Re-enable this and actually
10341 check whether we have a constructor constraint.
10344 (TypeManager.builder_to_type_param): New static field.
10345 (TypeManager.AddTypeParameter): New static method.
10346 (TypeManager.LookupTypeParameter): New public method.
10348 2004-03-30 Martin Baulig <martin@ximian.com>
10350 * generic.cs (TypeParameter.DefineType): Return a boolean and use
10351 the new API to actually define the constructor constraint.
10354 (TypeManager.new_constraint_attr_type): New static field.
10355 (TypeManager.InitCoreTypes): Initialize it.
10357 2004-03-30 Martin Baulig <martin@ximian.com>
10359 * generic.cs (Constraints): Completed error checking, use correct
10362 2004-03-29 Martin Baulig <martin@ximian.com>
10364 * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
10366 * expression.cs (Invocation.InferTypeArguments): Added overloaded
10367 public version which takes a `ParameterData pd' instead of an
10370 2004-03-29 Martin Baulig <martin@ximian.com>
10372 * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
10375 2004-03-29 Martin Baulig <martin@ximian.com>
10377 * expression.cs (Argument.ResolveMethodGroup): If we're a
10378 ConstructedType, call GetMemberAccess() on it.
10380 2004-03-29 Martin Baulig <martin@ximian.com>
10382 * class.cs (MethodBase.CheckGenericOverride): New abstract method.
10383 (MethodCore.CheckGenericOverride): When overriding a generic
10384 method, check whether the constraints match.
10386 * support.cs (GenericConstraints): New public interface.
10387 (ParameterData.GenericConstraints): New public method.
10389 * parameter.cs (Parameter.Resolve): Check whether we're a generic
10390 method parameter and compute our constraints if appropriate.
10391 (Parameter.GenericConstraints): New public property.
10393 * generic.cs (Constraints): Implement GenericConstraints.
10395 2004-03-29 Martin Baulig <martin@ximian.com>
10397 * decl.cs (MemberCache.FindMemberToOverride): Use
10398 `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
10400 2004-03-29 Martin Baulig <martin@ximian.com>
10402 * generic.cs (GenericMethod.Define): Resolve our type parameters.
10404 2004-03-29 Martin Baulig <martin@ximian.com>
10406 * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
10407 not allowed on non-generic declarations").
10409 2004-03-29 Martin Baulig <martin@ximian.com>
10411 * expression.cs (Invocation.InferTypeArguments): Added overloaded
10412 public version of this method.
10414 * class.cs (MethodCore.IsDuplicateImplementation): Use
10415 Invocation.InferTypeArguments() to check this.
10417 2004-03-29 Martin Baulig <martin@ximian.com>
10419 * convert.cs: Use TypeManager.IsDelegateType() instead of
10420 comparing types correctly.
10422 2004-03-29 Martin Baulig <martin@ximian.com>
10424 * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
10425 types directly to make it work for generic instances.
10427 * typemanager.cs (TypeManager.IsSubclassOf): New static method.
10429 2004-03-29 Martin Baulig <martin@ximian.com>
10431 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
10432 support for arrays.
10434 2004-03-24 Martin Baulig <martin@ximian.com>
10436 * decl.cs (DeclSpace.FindType): Also use
10437 TypeManager.CheckGeneric() for types from the using clauses.
10439 2004-03-23 Martin Baulig <martin@ximian.com>
10441 * expression.cs (Invocation.OverloadResolve): Added `bool
10442 may_fail' argument and use it instead of the Location.IsNull() hack.
10444 2004-03-23 Martin Baulig <martin@ximian.com>
10446 * expression.cs (Invocation.InferType): Use correct type inference
10449 2004-03-23 Martin Baulig <martin@ximian.com>
10451 * ecore.cs (MethodGroupExpr.Name): Use
10452 TypeManager.CSharpSignature() instead of just the name.
10454 * expression.cs (Invocation.OverloadResolve): Provide better error
10456 (Invocation.DoResolve): OverloadResolve() never returns null
10457 without reporting an error, so removed the error -6 reporting here.
10459 2004-03-23 Martin Baulig <martin@ximian.com>
10461 * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
10464 * cs-parser.jay (delegate_declaration): Support generic delegates.
10466 * delegate.cs: Support generic delegates.
10468 2004-03-22 Martin Baulig <martin@ximian.com>
10470 * expression.cs (Invocation.InferParamsTypeArguments): New static
10471 method; does type inference for params arguments.
10473 2004-03-21 Martin Baulig <martin@ximian.com>
10475 * typemanager.cs (TypeManager.IsGenericMethod): New public static
10476 method; checks whether a method is a generic method.
10478 * expression.cs (Invocation.InferTypeArguments): New static method;
10479 infer type arguments for generic method invocation.
10481 * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
10482 property; we set this to true if we're resolving a generic method
10483 invocation and the user specified type arguments, ie. we're not
10484 doing type inference.
10486 2004-03-20 Martin Baulig <martin@ximian.com>
10488 * class.cs (MethodData.DeclaringType): New public property.
10489 (MethodData.Define): Set DeclaringType here.
10490 (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
10491 instead of OperatorMethodBuilder.DeclaringType.
10493 2004-03-20 Martin Baulig <martin@ximian.com>
10495 * cs-tokenizer.cs (xtoken): Return a special
10496 Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
10498 * cs-parser.jay (default_value_expression): Switch to the new
10501 2004-03-19 Martin Baulig <martin@ximian.com>
10503 * decl.cs (MemberName): New class. We use this to "construct"
10504 namespace_or_type_name's.
10506 * generics.cs (TypeArguments.GetDeclarations): New public method;
10507 returns the type arguments as a string[] and reports a CS0081 if
10508 one of them is not an identifier.
10510 * class.cs (MemberBase): The .ctor now takes the name as a
10511 MemberName instead of a string.
10512 (MemberBase.ExplicitInterfaceName): Changed type from string to
10514 (MemberBase.DoDefine): If we're an explicit implementation, the
10515 InterfaceType may be a generic instance.
10517 * cs-parser.jay (namespace_or_type_name): Return a MemberName.
10518 (namespace_name): Call MemberName.GetName () to transform the
10519 MemberName into a string and ensure we don't have any type
10521 (type_name): Call MemberName.GetTypeExpression() to transfrom the
10522 MemberName into an expression.
10523 (method_header): Use namespace_or_type_name instead of member_name.
10525 2004-04-07 Miguel de Icaza <miguel@ximian.com>
10527 * rootcontext.cs: Add new types to the boot resolution.
10529 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10530 MulticastDelegate is not allowed.
10532 * typemanager.cs: Add new types to lookup: System.TypedReference
10535 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10536 check for TypedReference or ArgIterator, they are not allowed.
10538 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10539 makes us properly catch 1510 in some conditions (see bug 56016 for
10542 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
10544 * CryptoConvert.cs: update from corlib version
10547 2004-04-05 Miguel de Icaza <miguel@ximian.com>
10549 * class.cs (Indexer.Define): Check indexername declaration
10551 2004-04-05 Marek Safar <marek.safar@seznam.cz>
10553 * attribute.cs (IsClsCompliant): Fixed problem with handling
10554 all three states (compliant, not-compliant, undetected).
10556 2004-03-30 Marek Safar <marek.safar@seznam.cz>
10558 * attribute.cs (Attribute): Location is now public.
10559 (Resolve): Store resolved arguments (pos_values) in attribute class.
10560 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10561 (GetClsCompliantAttributeValue): New method that gets
10562 CLSCompliantAttribute value.
10563 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10564 if exists else null.
10565 (AttributeTester): New class for CLS-Compliant verification routines.
10567 * class.cs (Emit): Add CLS-Compliant verification.
10568 (Method.GetSignatureForError): Implemented.
10569 (Constructor.GetSignatureForError): Implemented
10570 (Constructor.HasCompliantArgs): Returns if constructor has
10571 CLS-Compliant arguments.
10572 (Constructor.Emit): Override.
10573 (Construcor.IsIdentifierClsCompliant): New method; For constructors
10574 is needed to test only parameters.
10575 (FieldBase.GetSignatureForError): Implemented.
10576 (TypeContainer): New member for storing base interfaces.
10577 (TypeContainer.FindMembers): Search in base interfaces too.
10579 * codegen.cs (GetClsComplianceAttribute): New method that gets
10580 assembly or module CLSCompliantAttribute value.
10581 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10583 (ModuleClass.Emit): Add error 3012 test.
10585 * const.cs (Emit): Override and call base for CLS-Compliant tests.
10587 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10588 state for all decl types.
10589 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10590 if CLS-Compliant tests are required.
10591 (IsClsCompliaceRequired): New method. Analyze whether code
10592 must be CLS-Compliant.
10593 (IsExposedFromAssembly): New method. Returns true when MemberCore
10594 is exposed from assembly.
10595 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10596 value or gets cached value.
10597 (HasClsCompliantAttribute): New method. Returns true if MemberCore
10598 is explicitly marked with CLSCompliantAttribute.
10599 (IsIdentifierClsCompliant): New abstract method. This method is
10600 used to testing error 3005.
10601 (IsIdentifierAndParamClsCompliant): New method. Common helper method
10602 for identifier and parameters CLS-Compliant testing.
10603 (VerifyClsCompliance): New method. The main virtual method for
10604 CLS-Compliant verifications.
10605 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10606 null. I don't know why is null (too many public members !).
10607 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10608 and get value of first CLSCompliantAttribute that found.
10610 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10611 (VerifyClsCompliance): Override and add extra tests.
10613 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10614 clscheck- disable CLS-Compliant verification event if assembly is has
10615 CLSCompliantAttribute(true).
10617 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10618 ApllyAttribute is now called in emit section as in the other cases.
10619 Possible future Emit integration.
10620 (IsIdentifierClsCompliant): New override.
10621 (VerifyClsCompliance): New override.
10622 (GetEnumeratorName): Returns full enum name.
10624 * parameter.cs (GetSignatureForError): Implemented.
10626 * report.cs (WarningData): New struct for Warning message information.
10627 (LocationOfPreviousError): New method.
10628 (Warning): New method. Reports warning based on the warning table.
10629 (Error_T): New method. Reports error based on the error table.
10631 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10632 verifications are done here.
10634 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10636 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10637 CLSCompliantAttribute.
10638 (all_imported_types): New member holds all imported types from other
10640 (LoadAllImportedTypes): New method fills static table with exported types
10641 from all referenced assemblies.
10642 (Modules): New property returns all assembly modules.
10644 2004-03-30 Miguel de Icaza <miguel@ximian.com>
10646 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10647 throwing a parser error.
10649 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10650 which removes the hardcoded get_/set_ prefixes for properties, as
10651 IL allows for the properties to be named something else.
10655 * expression.cs: Do not override operand before we know if it is
10656 non-null. Fix 56207
10658 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10660 * typemanager.cs: support for pinned variables.
10662 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10664 * decl.cs, typemanager.cs: Avoid using an arraylist
10665 as a buffer if there is only one result set.
10667 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10669 * expression.cs: Make sure you cant call a static method
10670 with an instance expression, bug #56174.
10672 2004-03-29 Miguel de Icaza <miguel@ximian.com>
10674 * class.cs (IsDuplicateImplementation): Improve error reporting to
10675 flag 663 (method only differs in parameter modifier).
10677 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10678 in preprocessor directives.
10680 * location.cs (LookupFile): Allow for the empty path.
10682 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
10683 better approach for some of that patch, but its failing with the
10684 CharSet enumeration. For now try/catch will do.
10686 * typemanager.cs: Do not crash if a struct does not have fields.
10689 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10691 * expression.cs: cs0213, cant fix a fixed expression.
10694 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10696 * cs-parser.jay: detect invalid embeded statements gracefully.
10699 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10701 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10704 the invocation type may not be a subclass of the tye of the item/
10705 The type of the item must be a subclass of the invocation item.
10710 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
10712 * attribute.cs: Added methods to get a string and a bool from an
10713 attribute. Required to information from AssemblyKeyFileAttribute,
10714 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10715 * codegen.cs: Modified AssemblyName creation to include support for
10716 strongnames. Catch additional exceptions to report them as CS1548.
10717 * compiler.csproj: Updated include CryptoConvert.cs.
10718 * compiler.csproj.user: Removed file - user specific configuration.
10719 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
10720 Mono.Security assembly. The original class is maintained and tested in
10721 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10722 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10723 like CSC 8.0 (C# v2) supports.
10724 * Makefile: Added CryptoConvert.cs to mcs sources.
10725 * rootcontext.cs: Added new options for strongnames.
10727 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
10729 * driver.cs: For --expect-error, report error code `2'
10730 if the program compiled with no errors, error code `1' if
10731 it compiled with an error other than the one expected.
10733 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
10735 * compiler.csproj: Updated for Visual Studio .NET 2003.
10736 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10737 * compiler.sln: Updated for Visual Studio .NET 2003.
10739 2004-03-24 Ravi Pratap M <ravi@ximian.com>
10741 * expression.cs: Fix bug #47234. We basically need to apply the
10742 rule that we prefer the conversion of null to a reference type
10743 when faced with a conversion to 'object' (csc behaviour).
10745 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10747 * statement.cs: Shorter form for foreach, eliminates
10748 a local variable. r=Martin.
10750 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10752 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10753 checks if we can use brtrue/brfalse to test for 0.
10754 * expression.cs: use the above in the test for using brtrue/brfalse.
10755 cleanup code a bit.
10757 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10759 * expression.cs: Rewrite string concat stuff. Benefits:
10761 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10762 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10763 rather than a concat chain.
10765 * typemanager.cs: Add lookups for more concat overloads.
10767 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
10769 * expression.cs: Emit shorter il code for array init.
10786 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
10788 * statement.cs: Before, two switch blocks would be merged if the
10789 total size of the blocks (end_item - begin_item + 1) was less than
10790 two times the combined sizes of the blocks.
10792 Now, it will only merge if after the merge at least half of the
10797 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
10799 * class.cs : csc build fix for GetMethods(). See bug #52503.
10801 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
10803 * expression.cs: Make sure fp comparisons work with NaN.
10804 This fixes bug #54303. Mig approved this patch a long
10805 time ago, but we were not able to test b/c the runtime
10808 2004-03-19 Miguel de Icaza <miguel@ximian.com>
10810 * ecore.cs (TypExpr.GetHashCode): implement this overload.
10812 2004-03-19 Martin Baulig <martin@ximian.com>
10814 * class.cs (MemberCore.IsDuplicateImplementation): Check whether
10815 two overloads may unify for some type parameter substitutions and
10816 report a CS0408 if appropriate.
10818 2004-03-19 Martin Baulig <martin@ximian.com>
10820 * class.cs (MemberCore.IsDuplicateImplementation): Report the
10821 error here and not in our caller.
10823 2004-03-19 Martin Baulig <martin@ximian.com>
10825 * interface.cs: Completely killed this file.
10826 (Interface): We're now a TypeContainer and live in class.cs.
10828 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
10829 argument; we're now also called for interfaces.
10830 (TypeContainer.DefineMembers): Allow this method being called
10832 (TypeContainer.GetMethods): New public method; formerly known as
10833 Interface.GetMethod(). This is used by PendingImplementation.
10834 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
10835 it's now private and non-static.
10836 (Interface): Moved this here; it's now implemented similar to
10838 (Method, Property, Event, Indexer): Added `bool is_interface'
10839 argument to their .ctor's.
10840 (MemberBase.IsInterface): New public field.
10842 * cs-parser.jay: Create normal Method, Property, Event, Indexer
10843 instances instead of InterfaceMethod, InterfaceProperty, etc.
10844 (opt_interface_base): Removed; we now use `opt_class_base' instead.
10845 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
10847 2004-03-19 Martin Baulig <martin@ximian.com>
10849 * class.cs (MethodCore.IsDuplicateImplementation): New private
10850 method which does the CS0111 checking.
10851 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
10852 Use IsDuplicateImplementation().
10854 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
10856 * decl.cs (FindMemberToOverride): New method to find the correct
10857 method or property to override in the base class.
10859 - Make Method/Property use the above method to find the
10860 version in the base class.
10861 - Remove the InheritableMemberSignatureCompare as it is now
10864 This patch makes large code bases much faster to compile, as it is
10865 O(n) rather than O(n^2) to do this validation.
10867 Also, it fixes bug 52458 which is that nested classes are not
10868 taken into account when finding the base class member.
10870 Reviewed/Approved by Martin.
10872 2004-03-17 Martin Baulig <martin@ximian.com>
10874 * expression.cs (MemberAccess.DoResolve): Take the parent's number
10875 of type arguments into account; use the `real_num_type_args'
10876 approach like in DoResolveAsTypeStep().
10878 * generic.cs (GenericMemberAccess.DoResolve): Make this work for
10881 2004-03-17 Marek Safar <marek.safar@seznam.cz>
10883 * interface.cs: In all interface classes removed redundant
10884 member initialization.
10886 2004-03-16 Martin Baulig <martin@ximian.com>
10888 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
10890 2004-03-15 Miguel de Icaza <miguel@ximian.com>
10892 * decl.cs (DefineTypeAndParents): New helper method to define a
10893 type's containers before the type itself is defined; This is a
10894 bug exposed by the recent changes to Windows.Forms when an
10895 implemented interface was defined inside a class that had not been
10898 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
10900 (Check): Loop correctly to report errors modifiers
10901 (UNSAFE was not in the loop, since it was the same as TOP).
10903 * interface.cs: Every interface member now takes a ModFlags,
10904 instead of a "is_new" bool, which we set on the base MemberCore.
10906 Every place where we called "UnsafeOk" in the interface, now we
10907 call the proper member (InterfaceMethod.UnsafeOK) instead to get
10908 the unsafe settings from the member declaration instead of the
10909 container interface.
10911 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
10913 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
10914 `set_indexer_name' to the pending bits (one per type).
10916 We fixed a bug today that was picking the wrong method to
10917 override, since for properties the existing InterfaceMethod code
10918 basically ignored the method name. Now we make sure that the
10919 method name is one of the valid indexer names.
10921 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
10923 * support.cs (SeekableStreamReader): Keep track of stream byte
10924 positions and don't mix them with character offsets to the buffer.
10926 Patch from Gustavo Giráldez
10928 2004-03-15 Marek Safar <marek.safar@seznam.cz>
10930 * interface.cs (InterfaceSetGetBase): Removed double member
10931 initialization, base class does it as well.
10933 2004-03-13 Martin Baulig <martin@ximian.com>
10935 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
10936 when compiling corlib.
10938 2004-03-13 Miguel de Icaza <miguel@ximian.com>
10940 * convert.cs (ExplicitConversion): We were reporting an error on
10941 certain conversions (object_type source to a value type, when the
10942 expression was `null') before we had a chance to pass it through
10943 the user defined conversions.
10945 * driver.cs: Replace / and \ in resource specifications to dots.
10948 * class.cs: Add check for duplicate operators. Fixes 52477
10950 2004-03-11 Miguel de Icaza <miguel@ximian.com>
10952 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
10953 that are in the middle of the statements, not only at the end.
10956 * class.cs (TypeContainer.AddField): No longer set the
10957 `HaveStaticConstructor' flag, now we call it
10958 `UserDefineStaticConstructor' to diferentiate the slightly
10959 semantic difference.
10961 The situation is that we were not adding BeforeFieldInit (from
10962 Modifiers.TypeAttr) to classes that could have it.
10963 BeforeFieldInit should be set to classes that have no static
10968 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
10970 And most importantly Zoltan's comment:
10972 http://bugzilla.ximian.com/show_bug.cgi?id=44229
10974 "I think beforefieldinit means 'it's ok to initialize the type sometime
10975 before its static fields are used', i.e. initialization does not need
10976 to be triggered by the first access to the type. Setting this flag
10977 helps the JIT to compile better code, since it can run the static
10978 constructor at JIT time, and does not need to generate code to call it
10979 (possibly lots of times) at runtime. Unfortunately, mcs does not set
10980 this flag for lots of classes like String.
10982 csc sets this flag if the type does not have an explicit static
10983 constructor. The reasoning seems to be that if there are only static
10984 initalizers for a type, and no static constructor, then the programmer
10985 does not care when this initialization happens, so beforefieldinit
10988 This bug prevents the AOT compiler from being usable, since it
10989 generates so many calls to mono_runtime_class_init that the AOT code
10990 is much slower than the JITted code. The JITted code is faster,
10991 because it does not generate these calls if the vtable is type is
10992 already initialized, which is true in the majority of cases. But the
10993 AOT compiler can't do this."
10995 2004-03-10 Miguel de Icaza <miguel@ximian.com>
10997 * class.cs (MethodData.Emit): Refactor the code so symbolic
10998 information is generated for destructors; For some reasons we
10999 were taking a code path that did not generate symbolic information
11002 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
11004 * class.cs: Create a Constructor.CheckBase method that
11005 takes care of all validation type code. The method
11006 contains some code that was moved from Define.
11008 It also includes new code that checks for duplicate ctors.
11009 This fixes bug #55148.
11011 2004-03-09 Joshua Tauberer <tauberer@for.net>
11013 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
11014 a { ... }-style array creation invokes EmitStaticInitializers
11015 which is not good for reference-type arrays. String, decimal
11016 and now null constants (NullCast) are not counted toward
11017 static initializers.
11019 2004-03-05 Martin Baulig <martin@ximian.com>
11021 * location.cs (SourceFile.HasLineDirective): New public field;
11022 specifies whether the file contains or is referenced by a "#line"
11024 (Location.DefineSymbolDocuments): Ignore source files which
11025 either contain or are referenced by a "#line" directive.
11027 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
11029 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
11030 direct access to our parent, so check the method inline there.
11032 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
11034 * expression.cs (Invocation.EmitCall): Miguel's last commit
11035 caused a regression. If you had:
11040 In Foo the implict this would be null.
11042 2004-02-27 Miguel de Icaza <miguel@ximian.com>
11044 * expression.cs (Invocation.EmitCall): If the method is not
11045 virtual, do not emit a CallVirt to it, use Call.
11047 * typemanager.cs (GetFullNameSignature): Improve the method to
11048 cope with ".ctor" and replace it with the type name.
11050 * class.cs (ConstructorInitializer.Resolve): Now the method takes
11051 as an argument the ConstructorBuilder where it is being defined,
11052 to catch the recursive constructor invocations.
11054 2004-03-16 Martin Baulig <martin@ximian.com>
11056 * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
11057 ConstructedType, call ResolveType() on it to get the type rather
11058 than just using `expr.Type'.
11060 2004-03-16 Martin Baulig <martin@ximian.com>
11062 * generics.cs (ConstructedType.GetMemberAccess): Take the
11063 EmitContext instead on the TypeExpr and use
11064 ec.TypeContainer.CurrentType/ec.ContainerType.
11066 2004-03-16 Martin Baulig <martin@ximian.com>
11068 * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
11069 parameters before aliases.
11071 2004-03-16 Martin Baulig <martin@ximian.com>
11073 * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
11074 New oublic function; checks whether two generic instances may become
11075 equal under some instantiations (26.3.1).
11077 * class.cs (TypeContainer.Define): Call
11078 TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
11081 2004-03-16 Martin Baulig <martin@ximian.com>
11083 * class.cs (TypeContainer.GetClassBases): Moved
11084 Error_TypeParameterAsBase() here and also check whether the base
11085 class is not an attribute.
11087 2004-03-16 Martin Baulig <martin@ximian.com>
11089 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11091 2004-03-16 Martin Baulig <martin@ximian.com>
11093 * class.cs (Error_TypeParameterAsBase): Use correct error number
11096 2004-03-16 Martin Baulig <martin@ximian.com>
11098 * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
11101 * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
11104 2004-03-15 Martin Baulig <martin@ximian.com>
11106 * typemanager.cs (TypeManager.GetFullName): New public method.
11107 (TypeManager.MemberLookup): Added `int_num_type_arguments'
11108 argument; only return members with the correct number of type
11110 (TypeManager.CheckGeneric): Allow -1 to bypass the check.
11111 (TypeManager.FilterWithClosure): Call CheckGeneric() to check
11112 whether the number of type arguments matches.
11114 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
11115 not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
11117 * expression.cs (MemberAccess): Added public `NumTypeArguments'
11118 field; it's set by the protected .ctor when we're actually a
11119 GenericMemberAccess.
11120 (MemberAccess.ResolveAsTypeStep): Compute the total number of type
11121 arguments and pass it to MemberLookupFinal ().
11123 * ecore.cs (Expression.MemberLookup): Added `int
11124 num_type_arguments' argument; only return members with the correct
11125 number of type arguments.
11126 (Expression.MemberLookupFailed): Check whether the MemberLookup
11127 failed because we did not have the correct number of type
11128 arguments; report CS0305 in this case.
11130 * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
11131 `e.ResolveAsTypeTerminal()' already did so.
11133 2004-03-15 Martin Baulig <martin@ximian.com>
11135 * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
11136 we're a ConstructedType; in this case, the caller must report an
11137 error (for instance CS0131).
11139 * generic.cs (TypeArguments): Added Location argument to the .ctor.
11140 (TypeArguments.Resolve): Actually report errors here.
11142 2004-03-15 Miguel de Icaza <miguel@ximian.com>
11144 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11145 `set_indexer_name' to the pending bits (one per type).
11147 We fixed a bug today that was picking the wrong method to
11148 override, since for properties the existing InterfaceMethod code
11149 basically ignored the method name. Now we make sure that the
11150 method name is one of the valid indexer names.
11152 2004-03-15 Martin Baulig <martin@ximian.com>
11154 * typemanager.cs (TypeManager.IndexerPropertyName): Added support
11155 for generic instances.
11157 2004-03-13 Martin Baulig <martin@ximian.com>
11159 * class.cs (TypeContainer.DefineType): Call
11160 TypeManager.AddUserType() immediately after creating the
11161 TypeBuilder; pass all type parameters when creating the
11164 * decl.cs (DeclSpace.FindNestedType): New public method.
11165 (DeclSpace.FindType): Added `int num_type_args' argument; only
11166 return types with the correct number of type parameters.
11167 (DeclSpace.CountTypeParams): New public property.
11169 * ecore.cs (SimpleName.ctor): Added overloaded version which takes
11170 the number of type parameters; defaults to zero.
11172 * generic.cs (TypeArguments.Count): New public property.
11173 (ConstructedType.DoResolveAsTypeStep): First call
11174 ds.FindNestedType() to find out whether we're nested in the
11175 current generic type; in this case, we inherit all type parameters
11176 from the current class.
11178 * rootcontext.cs (RootContext.NamespaceLookup): Added `int
11179 num_type_args' argument.
11180 (RootContext.LookupType): Added overloaded version which takes the
11181 number of type arguments; only return types with the correct
11182 number of type arguments.
11184 * typemanager.cs (TypeManager.CheckGeneric): New public function;
11185 checks whether `Type t' has `int num_type_args'.
11187 2004-03-13 Martin Baulig <martin@ximian.com>
11189 * generic.cs (GenericMethod.DefineType): New method; calls
11190 DefineType() on all the type parameters.
11192 * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
11193 (MethodData.Define): If we're a generic method, call
11194 GenericMethod.DefineType() to define the type parameters.
11196 2004-03-10 Martin Baulig <martin@ximian.com>
11198 * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
11199 instead of IsAssignableFrom.
11201 2004-03-10 Martin Baulig <martin@ximian.com>
11203 * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
11205 * support.cs (ParameterData.HasArrayParameter): New property.
11206 (ReflectionParameters.ctor): Take a MethodBase instead of a
11207 ParameterInfo[]. If we have any type parameters, get the generic
11208 method definition and ask it whether we have variable arguments.
11210 2004-02-26 Miguel de Icaza <miguel@ximian.com>
11212 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11213 routines to check if a type is an enumerable/enumerator allow
11214 classes that implement the IEnumerable or IEnumerator interfaces.
11216 * class.cs (Property, Operator): Implement IIteratorContainer, and
11217 implement SetYields.
11219 (Property.Define): Do the block swapping for get_methods in the
11220 context of iterators. We need to check if Properties also
11221 include indexers or not.
11223 (Operator): Assign the Block before invoking the
11224 OperatorMethod.Define, so we can trigger the Iterator code
11227 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
11228 Property and Operator classes are not created when we parse the
11229 declarator but until we have the block completed, so we use a
11230 singleton SimpleIteratorContainer.Simple to flag whether the
11231 SetYields has been invoked.
11233 We propagate this setting then to the Property or the Operator to
11234 allow the `yield' to function.
11236 2004-02-25 Marek Safar <marek.safar@seznam.cz>
11238 * codegen.cs: Implemented attribute support for modules.
11239 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11240 Assembly/Module functionality.
11242 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11243 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11244 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11246 2004-02-16 Marek Safar <marek.safar@seznam.cz>
11248 * interface.cs (FindMembers): The operation is performed on all base
11249 interfaces and not only on the first. It is required for future CLS Compliance patch.
11251 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
11253 * statement.cs, codegen.cs:
11254 This patch deals with patterns such as:
11256 public class List : IEnumerable {
11258 public MyEnumerator GetEnumerator () {
11259 return new MyEnumerator(this);
11262 IEnumerator IEnumerable.GetEnumerator () {
11266 public struct MyEnumerator : IEnumerator {
11271 Before, there were a few things we did wrong:
11272 1) we would emit callvirt on a struct, which is illegal
11273 2) we emited ldarg when we needed to emit ldarga
11274 3) we would mistakenly call the interface methods on an enumerator
11275 type that derived from IEnumerator and was in another assembly. For example:
11277 public class MyEnumerator : IEnumerator
11279 Would have the interface methods called, even if there were public impls of the
11280 method. In a struct, this lead to invalid IL code.
11282 2004-02-11 Marek Safar <marek.safar@seznam.cz>
11284 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11287 * delegate.cs (Define): Fixed crash when delegate type is undefined.
11289 2004-02-11 Miguel de Icaza <miguel@ximian.com>
11291 * cs-parser.jay: Fix small regression: we were not testing V2
11292 compiler features correctly.
11294 * interface.cs: If the emit context is null, then create one
11296 2004-02-09 Marek Safar <marek.safar@seznam.cz>
11298 * decl.cs (GetSignatureForError): New virtual method to get full name
11299 for error messages.
11301 * attribute.cs (IAttributeSupport): New interface for attribute setting.
11302 Now it is possible to rewrite ApplyAttributes method to be less if/else.
11304 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11305 Duplicated members and code in these classes has been removed.
11306 Better encapsulation in these classes.
11308 2004-02-07 Miguel de Icaza <miguel@ximian.com>
11310 * assign.cs (Assign.DoResolve): When dealing with compound
11311 assignments, there is a new rule in ECMA C# 2.4 (might have been
11312 there before, but it is documented here) that states that in:
11316 If b is of type int, and the `op' is a shift-operator, then the
11317 above is evaluated as:
11321 * expression.cs (Binary.ResolveOperator): Instead of testing for
11322 int/uint/long/ulong, try to implicitly convert to any of those
11323 types and use that in pointer arithmetic.
11325 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11326 method to print information for from the type, not from the
11327 null-method we were given.
11329 2004-02-01 Duncan Mak <duncan@ximian.com>
11331 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11332 parsing for cmd, fixes bug #53694.
11334 2004-02-04 Marek Safar <marek.safar@seznam.cz>
11336 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11337 in the member name duplication tests. Property and operator name duplication
11338 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11340 2004-02-03 Marek Safar <marek.safar@seznam.cz>
11342 * interface.cs (PopulateMethod): Fixed crash when interface method
11343 returns not existing type (error test cs0246-3.cs).
11345 2004-02-02 Ravi Pratap M <ravi@ximian.com>
11347 * cs-parser.jay (interface_accessors): Re-write actions to also
11348 store attributes attached to get and set methods. Fix spelling
11351 (inteface_property_declaration): Modify accordingly.
11353 (InterfaceAccessorInfo): New helper class to store information to pass
11354 around between rules that use interface_accessors.
11356 * interface.cs (Emit): Apply attributes on the get and set
11357 accessors of properties and indexers too.
11359 * attribute.cs (ApplyAttributes): Modify accordingly to use the
11360 right MethodBuilder when applying attributes to the get and set accessors.
11362 2004-01-31 Miguel de Icaza <miguel@ximian.com>
11364 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11366 2004-01-26 Miguel de Icaza <miguel@ximian.com>
11368 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11370 2004-01-25 Miguel de Icaza <miguel@ximian.com>
11372 * cs-parser.jay: Remove YIELD token, instead use the new grammar
11373 changes that treat `yield' specially when present before `break'
11374 or `return' tokens.
11376 * cs-tokenizer.cs: yield is no longer a keyword.
11378 2004-01-23 Marek Safar <marek.safar@seznam.cz>
11380 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11381 setting for default constructors.
11382 For default constructors are almost every time set wrong Modifier. The
11383 generated IL code has been alright. But inside mcs this values was
11384 wrong and this was reason why several of my CLS Compliance tests
11387 2004-02-27 Martin Baulig <martin@ximian.com>
11389 * generics.cs (ConstructedType.ResolveType): Make the nested type
11390 stuff actually work.
11392 2004-02-25 Martin Baulig <martin@ximian.com>
11394 * decl.cs (DeclSpace.CurrentTypeParameters): New protected
11395 property; returns the type parameters just from the current type,
11396 ie. with the ones from outer classes.
11397 (DeclSpace.LookupGeneric): First search in the current class, then
11399 (DeclSpace.initialize_type_params): When hiding a type parameter
11400 from an outer class, put it into the `type_param_list' anyways.
11402 * expression.cs (MemberAccess.expr): Made this field protected.
11404 * class.cs (TypeContainer.Define): The `CurrentType' just contains
11405 the type parameters from the current class.
11407 * generic.cs (ConstructedType.ResolveType): Support nested generic
11408 types by taking the type parameters which we inherit from outer
11409 classes into account.
11410 (GenericMemberAccess.ResolveAsTypeStep): Override this and added
11411 support for nested generic types.
11413 2004-02-23 Martin Baulig <martin@ximian.com>
11415 * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
11416 field and check whether we're nested inside a generic type.
11417 (DeclSpace.ResolveType): If we're resolving to a generic type
11418 definition, create a ConstructedType and return its resolved type.
11419 (DeclSpace.initialize_type_params): New private method;
11420 initializes the `type_param_list' field from the type parameters
11421 from this and all enclosing classes.
11422 (DeclSpace.TypeParameters): Call initialize_type_params() unless
11423 we're already initialized.
11425 2004-02-23 Martin Baulig <martin@ximian.com>
11427 * class.cs (Method.Define): Create the generic method before
11428 calling DoDefine().
11429 (Memberbase.DoDefine): Added DeclSpace argument (in addition to
11430 the TypeContainer one); we use this for generic methods.
11432 * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
11433 parent's TypeBuilder.
11435 2004-02-18 Martin Baulig <martin@ximian.com>
11437 * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
11438 to check for equality.
11440 2004-02-05 Martin Baulig <martin@ximian.com>
11442 * ecore.cs (FieldExpr.DoResolveLValue): If we have an
11443 `ec.TypeContainer.CurrentType', use it instead of
11444 `ec.ContainerType' to check whether we're in the type's ctor.
11446 2004-01-29 Martin Baulig <martin@ximian.com>
11448 * expression.cs (Invocation.DoResolve): If we're a
11449 `ConstructedType', then we're actually a generic method, so
11450 rewrite the expr as a GenericMemberAccess.
11452 * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
11453 here; manually parse it into a string.
11455 2004-01-28 Martin Baulig <martin@ximian.com>
11457 * typemanager.cs (TypeManager.IsEqual): New static method.
11458 (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
11459 check for equality instead of using `=='.
11461 2004-01-26 Martin Baulig <martin@ximian.com>
11463 * decl.cs (DeclSpace.CurrentType): New public field.
11465 * expression.cs (This.ResolveBase): If we have an
11466 `ec.TypeContainer.CurrentType', use it instead of
11467 `ec.ContainerType'.
11469 * class.cs (TypeContainer.DefineType): If we're a generic type,
11470 create the `CurrentType' (unresolved).
11471 (TypeContainer.GenericType): New private field.
11472 (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
11473 it and store it in `GenericType' before creating the MemberCache.
11474 (TypeContainer.GetMembers): If we have a `GenericType', call
11475 TypeManager.FindMembers() on it.
11477 * interface.cs (Interface.GenericType): New private field.
11478 (Interface.DefineType): If we're a generic type, create the
11479 `CurrentType' (unresolved).
11480 (Interface.DefineMembers): If we have a `CurrentType', resolve it
11481 and store it in `GenericType' before creating the MemberCache.
11482 (Interface.GetMembers): If we have a `GenericType', call
11483 TypeManager.FindMembers() on it.
11485 2004-01-22 Martin Baulig <martin@ximian.com>
11487 * cs-parser.jay (namespace_or_type_name): Return an Expression,
11488 not a QualifiedIdentifier. This is what `type_name_expression'
11489 was previously doing.
11490 (type_name_expression): Removed; the code is now in
11491 `namespace_or_type_name'.
11492 (qualified_identifier): Removed, use `namespace_or_type_name'
11494 (QualifiedIdentifier): Removed this class.
11496 2004-01-22 Martin Baulig <martin@ximian.com>
11498 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11499 not a string as alias name.
11501 2004-01-21 Miguel de Icaza <miguel@ximian.com>
11503 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11504 #52730 bug, and instead compute correctly the need to use a
11505 temporary variable when requesting an address based on the
11506 static/instace modified of the field and the constructor.
11508 2004-01-21 Martin Baulig <martin@ximian.com>
11510 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11511 class and namespace before looking up aliases. Fixes #52517.
11513 2004-01-21 Martin Baulig <martin@ximian.com>
11515 * flowanalysis.cs (UsageVector.Merge): Allow variables being
11516 assinged in a 'try'; fixes exception4.cs.
11518 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11519 * class.cs : Implemented parameter-less constructor for TypeContainer
11521 * decl.cs: Attributes are now stored here. New property OptAttributes
11523 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11525 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11527 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11529 * typemanager.cs (CSharpSignature): Now reports also inner class name.
11530 (CSharpSignature): New method for indexer and property signature.
11532 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11534 * pending.cs (IsVirtualFilter): Faster implementation.
11536 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11538 * typemanager.cs: Avoid inclusion of same assembly more than once.
11540 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11542 * cs-parser.jay: Fixed problem where the last assembly attribute
11543 has been applied also to following declaration (class, struct, etc.)
11545 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11547 * class.cs: Added error CS0538, CS0539 reporting.
11548 Fixed crash on Microsoft runtime when field type is void.
11550 * cs-parser.jay: Added error CS0537 reporting.
11552 * pending.cs: Added error CS0535 reporting.
11553 Improved error report for errors CS0536, CS0534.
11555 2004-01-20 Miguel de Icaza <miguel@ximian.com>
11557 Merge a few bits from the Anonymous Method MCS tree.
11559 * statement.cs (ToplevelBlock): New class for toplevel methods,
11560 will hold anonymous methods, lifted variables.
11562 * cs-parser.jay: Create toplevel blocks for delegates and for
11563 regular blocks of code.
11565 2004-01-20 Martin Baulig <martin@ximian.com>
11567 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11568 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11569 and `NeedExplicitReturn'; added `IsLastStatement'.
11570 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11571 have a `ReturnLabel' or we're not unreachable.
11573 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11574 child's reachability; don't just override ours with it. Fixes
11575 #58058 (lluis's example).
11576 (FlowBranching): Added public InTryOrCatch(), InCatch(),
11577 InFinally(), InLoop(), InSwitch() and
11578 BreakCrossesTryCatchBoundary() methods.
11580 * statement.cs (Return): Do all error checking in Resolve().
11581 Unless we are the last statement in a top-level block, always
11582 create a return label and jump to it.
11583 (Break, Continue): Do all error checking in Resolve(); also make
11584 sure we aren't leaving a `finally'.
11585 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11586 statement in a top-level block.
11587 (Block.Flags): Added `IsDestructor'.
11588 (Block.IsDestructor): New public property.
11590 2004-01-20 Martin Baulig <martin@ximian.com>
11592 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11594 2004-01-20 Martin Baulig <martin@ximian.com>
11596 * statement.cs (Statement.ResolveUnreachable): New public method.
11597 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11598 (Block.Resolve): Resolve unreachable statements.
11600 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
11602 * expression.cs: We need to fix the case where we do
11603 not have a temp variable here.
11605 * assign.cs: Only expression compound assignments need
11606 temporary variables.
11608 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
11610 * flowanalysis.cs: Reduce memory allocation in a few ways:
11611 - A block with no variables should not allocate a bit
11613 - A method with no out parameters does not need any tracking
11614 for assignment of the parameters, so we need not allocate
11617 public readonly Type[] VariableTypes;
11618 public readonly string[] VariableNames;
11619 Are redundant. The data is already stored in the variable
11620 map, so we need not allocate another array for it.
11621 - We need to add alot of checks for if (params | locals) == null
11622 due to the first two changes.
11624 2004-01-18 Miguel de Icaza <miguel@ximian.com>
11626 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11627 implement IMemoryLocation, we store a copy on a local variable and
11628 take the address of it. Patch from Benjamin Jemlich
11630 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11631 to use a special "type_name_expression" rule which reduces the
11632 number of "QualifiedIdentifier" classes created, and instead
11633 directly creates MemberAccess expressions.
11635 2004-01-17 Miguel de Icaza <miguel@ximian.com>
11637 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11638 that fixes #52853. Null literal assignment to ValueType
11640 * class.cs (MethodData.Emit): Instead of checking the name of the
11641 method to determine if its a destructor, create a new derived
11642 class from Method called Destructor, and test for that.
11644 * cs-parser.jay: Create a Destructor object instead of a Method.
11646 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11650 2004-01-16 Miguel de Icaza <miguel@ximian.com>
11652 * expression.cs (Binary.ResolveOperator): Perform an implicit
11653 conversion from MethodGroups to their delegate types on the
11654 Addition operation.
11656 * delegate.cs: Introduce a new class DelegateCreation that is the
11657 base class for `NewDelegate' and `ImplicitDelegateCreation',
11658 factor some code in here.
11660 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11661 conversion from MethodGroups to compatible delegate types.
11663 * ecore.cs (Expression.Resolve): Do not flag error 654
11664 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11665 we allow conversions from MethodGroups to delegate types now.
11667 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11668 assignments in v2 either.
11670 2004-01-10 Miguel de Icaza <miguel@ximian.com>
11672 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11673 static read-only fields in ctors.
11675 Applied patch from Benjamin Jemlich
11677 * expression.cs (UnaryMutator): Avoid leaking local variables.
11679 2004-01-09 Miguel de Icaza <miguel@ximian.com>
11681 * cs-tokenizer.cs (IsCastToken): Allow the various native types
11682 here to return true, as they can be used like this:
11684 (XXX) int.MEMBER ()
11686 Fixed 49836 and all the other dups
11688 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
11690 * driver.cs: Implement /win32res and /win32icon.
11692 2004-01-08 Miguel de Icaza <miguel@ximian.com>
11694 * cs-parser.jay: Add a rule to improve error handling for the
11695 common mistake of placing modifiers after the type.
11697 2004-01-07 Miguel de Icaza <miguel@ximian.com>
11699 * cs-parser.jay (interface_event_declaration): Catch
11700 initialization of events on interfaces, and report cs0068
11702 * cs-parser.jay (interface_event_declaration): Catch
11703 initialization of events.
11705 * ecore.cs: Better report missing constructors.
11707 * expression.cs (Binary.ResolveOperator): My previous bug fix had
11708 the error reporting done in the wrong place. Fix.
11710 * expression.cs (Binary.ResolveOperator): Catch the
11711 operator + (E x, E y) error earlier, and later allow for implicit
11712 conversions in operator +/- (E e, U x) from U to the underlying
11715 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11716 52596, if the container class is abstract, the default constructor
11717 is protected otherwise its public (before, we were always public).
11719 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11722 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11723 Jemlich that fixes bug #52597, MCS was generating invalid code for
11724 idisposable structs. Thanks to Ben for following up with this
11727 2004-01-06 Miguel de Icaza <miguel@ximian.com>
11729 * driver.cs: Allow assemblies without code to be generated, fixes
11732 2004-01-07 Nick Drochak <ndrochak@gol.com>
11734 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11736 2004-01-05 Miguel de Icaza <miguel@ximian.com>
11738 * cs-parser.jay: Add rules to improve error reporting if fields or
11739 methods are declared at the namespace level (error 116)
11741 * Add rules to catch event add/remove
11743 2004-01-04 David Sheldon <dave-mono@earth.li>
11745 * expression.cs: Added matching ")" to error message for
11748 2004-01-03 Todd Berman <tberman@gentoo.org>
11750 * ecore.cs, attribute.cs:
11751 Applying fix from #52429.
11753 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11755 * ecore.cs, expression.cs, statement.cs:
11756 Total rewrite of how we handle branching. We
11757 now handle complex boolean expressions with fewer
11758 jumps. As well if (x == 0) no longer emits a ceq.
11760 if (x is Foo) is much faster now, because we generate
11763 Overall, we get a pretty big improvement on our benchmark
11764 tests. The code we generate is smaller and more readable.
11766 I did a full two-stage bootstrap. The patch was reviewed
11767 by Martin and Miguel.
11769 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11771 * cs-parser.jay: Make primary_expression not take a QI.
11772 we dont need this because the member_access rule covers
11773 us here. So we replace the rule with just IDENTIFIER.
11775 This has two good effects. First, we remove a s/r conflict.
11776 Second, we allocate many fewer QualifiedIdentifier objects.
11778 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11780 * attribute.cs: Handle MarshalAs attributes as pseudo, and
11781 set the correct information via SRE. This prevents
11782 hanging on the MS runtime. Fixes #29374.
11784 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
11786 * convert.cs: correctly handle conversions to value types
11787 from Enum and ValueType as unboxing conversions.
11789 Fixes bug #52569. Patch by Benjamin Jemlich.
11791 2004-01-02 Ravi Pratap <ravi@ximian.com>
11793 * expression.cs (BetterConversion): Prefer int -> uint
11794 over int -> ulong (csc's behaviour). This fixed bug #52046.
11796 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
11798 * decl.cs (MemberCache.FindMembers): now returns a
11801 * typemanager.cs: In general, go with with ^^.
11802 (CopyNewMethods): take an IList.
11803 (RealMemberLookup): Only allocate an arraylist
11804 if we copy from two sets of methods.
11806 This change basically does two things:
11807 1) Fewer array lists allocated due to CopyNewMethods.
11808 2) the explicit cast in MemberList costed ALOT.
11810 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
11812 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
11813 a hashtable to avoid needless string allocations when an identifier is
11814 used more than once (the common case).
11816 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
11818 * pending.cs: MS's TypeBuilder.GetInterfaces ()
11819 is broken, it will not return anything. So, we
11820 have to use the information we have in mcs to
11823 * typemanager.cs: Add a cache for GetInterfaces,
11824 since this will now be used more often (due to ^^)
11826 (GetExplicitInterfaces) New method that gets the
11827 declared, not effective, interfaces on a type
11828 builder (eg, if you have interface IFoo, interface
11829 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
11832 This patch makes MCS able to bootstrap itself on
11835 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
11837 * expression.cs: Remove the Nop's that Miguel put
11840 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11842 * report.cs, codegen.cs: Give the real stack trace to
11843 the error when an exception is thrown.
11845 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11847 * decl.cs: only allocate hashtables for ifaces if
11850 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
11852 * expression.cs: fix the error from cs0121-2.cs
11853 (a parent interface has two child interfaces that
11854 have a function with the same name and 0 params
11855 and the function is called through the parent).
11857 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
11859 * class.cs, rootcontext.cs, typmanager.cs: do not
11862 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
11864 * codegen.cs: remove stack for the ec flow branching.
11865 It is already a linked list, so no need.
11867 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
11869 * Makefile: Allow custom profiler here.
11871 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
11873 * typemanager.cs (LookupType):
11874 - Use a static char [], because split takes
11875 a param array for args, so it was allocating
11877 - Do not store true in a hashtable, it boxes.
11879 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
11881 * flowanalysis.cs: bytify common enums.
11883 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11885 * modifiers.cs: Add a new set of flags for the
11886 flags allowed on explicit interface impls.
11887 * cs-parser.jay: catch the use of modifiers in
11888 interfaces correctly.
11889 * class.cs: catch private void IFoo.Blah ().
11891 All related to bug #50572.
11893 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11895 * decl.cs: Rewrite the consistant accessability checking.
11896 Accessability is not linear, it must be implemented in
11897 a tableish way. Fixes #49704.
11899 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
11901 * expression.cs: Handle negation in a checked context.
11902 We must use subtraction from zero. Fixes #38674.
11904 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
11906 * class.cs: Ignore static void main in DLLs.
11907 * rootcontext.cs: Handle the target type here,
11908 since we are have to access it from class.cs
11909 * driver.cs: account for the above.
11911 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
11913 * report.cs: Give line numbers and files if available.
11915 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
11917 * driver.cs: Implement /addmodule.
11919 * typemanager.cs: Change 'modules' field so it now contains Modules not
11922 2003-12-20 Martin Baulig <martin@ximian.com>
11924 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
11925 (FieldBase.IsAssigned): Removed this field.
11926 (FieldBase.SetAssigned): New public method.
11927 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
11929 2003-12-20 Martin Baulig <martin@ximian.com>
11931 * expression.cs (LocalVariableReference.DoResolve): Don't set
11932 `vi.Used' if we're called from DoResolveLValue().
11934 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
11935 returns the usage vector it just merged into the current one -
11936 pass this one to UsageWarning().
11937 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
11938 of the `EmitContext', don't call this recursively on our children.
11940 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
11942 * driver.cs: Implement /target:module.
11944 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
11946 * support.cs (CharArrayHashtable): New helper class.
11948 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
11949 char arrays, not strings, so we can avoid creating a string in
11950 consume_identifier if the identifier is a keyword.
11952 2003-12-16 Martin Baulig <martin@ximian.com>
11954 * statement.cs (LocalInfo.Assigned): Removed this property.
11955 (LocalInfo.Flags): Removed `Assigned'.
11956 (LocalInfo.IsAssigned): New public method; takes the EmitContext
11957 and uses flow analysis.
11958 (Block.UsageWarning): Made this method private.
11959 (Block.Resolve): Call UsageWarning() if appropriate.
11961 * expression.cs (LocalVariableReference.DoResolve): Always set
11962 LocalInfo.Used here.
11964 2003-12-13 Martin Baulig <martin@ximian.com>
11966 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
11967 any value here; we're now using flow analysis to figure out
11968 whether a statement/block returns a value.
11970 2003-12-13 Martin Baulig <martin@ximian.com>
11972 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
11974 (FlowBranching.MergeFinally): Don't call
11975 `branching.CheckOutParameters()' here, this is called in
11977 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
11978 when adding the `finally' vector.
11980 2003-12-13 Martin Baulig <martin@ximian.com>
11983 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
11984 actually work and also fix #48962.
11986 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
11988 * decl.cs: Do not check System.Object for nested types,
11989 since we know it does not have any. Big bang for buck:
11992 Run 1: 8.35 seconds
11993 Run 2: 8.32 seconds
11994 corlib: 17.99 seconds
11996 Run 1: 8.17 seconds
11997 Run 2: 8.17 seconds
11998 corlib: 17.39 seconds
12000 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
12002 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
12003 time we are returning 0 members, so we save alot here.
12005 2003-12-11 Martin Baulig <martin@ximian.com>
12007 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
12008 `MergeChild()', also just take the `FlowBranching' as argument;
12009 call Merge() on it and return the result.
12010 (FlowBranching.Merge): We don't need to do anything if we just
12013 2003-12-11 Martin Baulig <martin@ximian.com>
12015 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
12016 them in an `ArrayList' to reduce memory usage. Thanks to Ben
12017 Maurer for this idea.
12019 2003-12-11 Martin Baulig <martin@ximian.com>
12021 * flowanalysis.cs (MergeResult): This class is now gone; we now
12022 use the `UsageVector' for this. The reason for this is that if a
12023 branching just has one sibling, we don't need to "merge" them at
12024 all - that's the next step to do.
12025 (FlowBranching.Merge): We now return a `UsageVector' instead of a
12028 2003-12-11 Martin Baulig <martin@ximian.com>
12030 Reworked flow analyis and made it more precise and bug-free. The
12031 most important change is that we're now using a special `Reachability'
12032 class instead of having "magic" meanings of `FlowReturns'. I'll
12033 do some more cleanups and optimizations and also add some more
12034 documentation this week.
12036 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
12037 largely reworked this class.
12038 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
12039 the new `Reachability' class instead of having "magic" values here.
12040 (FlowBranching): We're now using an instance of `Reachability'
12041 instead of having separate `Returns', `Breaks' etc. fields.
12043 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
12044 based on flow analysis; ignore the return value of block.Emit ().
12046 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
12048 * driver.cs typemanager.cs: Find the mono extensions to corlib even
12049 if they are private.
12051 2003-12-09 Martin Baulig <martin@ximian.com>
12053 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
12054 call them directly on the UsageVector.
12056 2003-12-09 Martin Baulig <martin@ximian.com>
12058 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
12059 Changed return type from `FlowReturns' to `Reachability'.
12061 2003-12-09 Martin Baulig <martin@ximian.com>
12063 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
12064 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
12065 `Reachable' fields with a single `Reachability' one.
12067 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12069 * class.cs (FindMembers): Remove foreach's.
12074 Run 1: 8.74 seconds
12075 Run 2: 8.71 seconds
12078 Run 1: 8.64 seconds
12079 Run 2: 8.58 seconds
12082 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12087 This patch does a few things:
12088 1. EmptyStatement is now a singleton, so it is never reallocated.
12089 2. All blah is EmptyStatement constructs have been changed to
12090 blah == EmptyStatement.Value, which is much faster and valid
12091 now that EmptyStatement is a singleton.
12092 3. When resolving a block, rather than allocating a new array for
12093 the non-empty statements, empty statements are replaced with
12094 EmptyStatement.Value
12095 4. Some recursive functions have been made non-recursive.
12096 Mainly the performance impact is from (3), however (1) and (2) are needed for
12097 this to work. (4) does not make a big difference in normal situations, however
12098 it makes the profile look saner.
12103 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12104 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12105 Total memory allocated: 56397 KB
12108 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
12109 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
12110 Total memory allocated: 55666 KB
12112 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12114 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
12115 than the hashtable in a hashtable version
12117 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
12118 we always end up concating a string. This results in a huge perf
12119 loss, because many strings have to be tracked by the GC. In this
12120 patch, we first use a hashtable that works with two keys, so that
12121 the strings do not need to be concat'ed.
12125 Run 1: 8.74 seconds
12126 Run 2: 8.71 seconds
12129 Run 1: 8.65 seconds
12130 Run 2: 8.56 seconds
12132 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12134 * Makefile: Add a new target `do-time' that does a quick and simple
12135 profile, leaving easy to parse output.
12137 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
12139 * codegen.cs (Init): Create the dynamic assembly with
12140 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
12142 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
12144 * support.cs: Make the PtrHashtable use only one
12145 instance of its comparer.
12147 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
12149 * typemanager.cs: Fix lookup of GetNamespaces.
12151 2003-11-29 Miguel de Icaza <miguel@ximian.com>
12153 * expression.cs: Removed redundant line.
12155 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
12156 ArrayLists, use for loops with bounds.
12158 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
12161 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
12162 arraylists, use for loop with bounds.
12164 The above three changes give us a 0.071 second performance
12165 improvement out of 3.294 seconds down to 3.223. On my machine
12166 the above changes reduced the memory usage by 1,387 KB during
12167 compiler bootstrap.
12169 * cs-parser.jay (QualifiedIdentifier): New class used to represent
12170 QualifiedIdentifiers. Before we created a new string through
12171 concatenation, and mostly later on, the result would be
12172 manipulated by DecomposeQI through string manipulation.
12174 This reduced the compiler memory usage for bootstrapping from
12175 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
12176 compile times in 0.05 seconds.
12178 2003-11-28 Dick Porter <dick@ximian.com>
12180 * support.cs: Do string compares with the Invariant culture.
12188 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
12189 the comparison is done with the Invariant culture.
12191 2003-11-27 Miguel de Icaza <miguel@ximian.com>
12193 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
12194 GetEnumerator method.
12196 (ProbeCollectionType): Iterate starting at the most specific type
12197 upwards looking for a GetEnumerator
12199 * expression.cs: Shift count can be up to 31 for int/uint and 63
12202 2003-11-26 Miguel de Icaza <miguel@ximian.com>
12204 * statement.cs (Block.LookupLabel): Also look for the label on the
12205 children blocks. Use a hash table to keep track of visited
12208 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12209 we actually did transform the other operand, otherwise fall back
12210 to the common codepath that casts to long.
12212 * cs-tokenizer.cs: Use the same code pattern as the int case.
12213 Maybe I should do the parsing myself, and avoid depending on the
12214 Parse routines to get this done.
12216 2003-11-25 Miguel de Icaza <miguel@ximian.com>
12218 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
12219 which fixes bug 51347. This time test it.
12221 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12222 attributes for example can not tell the difference between these.
12223 The difference was only a syntax feature of the language.
12225 * attribute.cs: Apply attributes to delegates.
12227 * delegate.cs: Call the apply attributes method.
12229 2003-11-24 Miguel de Icaza <miguel@ximian.com>
12231 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12232 comparing 0 vs Byte.MinValue, not the value
12234 (ImplicitConversionRequired): When reporting a conversion error,
12235 use error 31 to print out the constant error instead of the
12238 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
12239 which fixes bug 51347.
12241 2003-11-22 Miguel de Icaza <miguel@ximian.com>
12243 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
12244 which fixes the -warnaserror command line option.
12246 2003-11-21 Miguel de Icaza <miguel@ximian.com>
12248 * cfold.cs (DoNumericPromotions): During constant folding of
12249 additions on UIntConstant, special case intconstants with
12250 IntConstants like we do on the expression binary operator.
12252 2003-11-12 Miguel de Icaza <miguel@ximian.com>
12254 * convert.cs (ImplicitReferenceConversion): We were missing a case
12255 (System.Enum are not value types or class types, so we need to
12256 classify them separatedly).
12258 * driver.cs: We do not support error 2007.
12260 2003-11-12 Jackson Harper <jackson@ximian.com>
12262 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
12263 system directory. Also use the full file name so users can
12264 libraries names mscorlib-o-tron.dll in a non system dir.
12266 2004-01-04 David Sheldon <dave-mono@earth.li>
12268 * expression.cs: Added matching ")" to error message for CS0077.
12270 2003-12-19 Martin Baulig <martin@ximian.com>
12272 * typemanager.cs (TypeManager.IsEqualGenericType): New public
12273 static method; see documentation in the method.
12274 (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
12276 * convert.cs (Convert.ImplicitReferenceConversion,
12277 Convert.ImplicitReferenceConversionExists): Add support for
12278 generic type declarations; see gen-36.cs.
12280 2003-12-19 Martin Baulig <martin@ximian.com>
12282 * pending.cs (Pending.InterfaceMethod): Use
12283 `Type.IsAssignableFrom()' instead of `=='.
12285 2003-12-18 Martin Baulig <martin@ximian.com>
12287 * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
12290 * convert.cs (Convert.ImplicitStandardConversionExists): Use
12291 `expr_type.Equals (target_type)' instead of `=='.
12293 2003-12-08 Martin Baulig <martin@ximian.com>
12295 * generics.cs (Constraints.Types): Removed.
12296 (Constraints.Resolve): Just resolve everything to TypeExpr's, not
12298 (Constraints.ResolveTypes): New public method; resolves the
12299 TypeExpr's to Type's.
12300 (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
12301 longer takes the constraints.
12302 (TypeParameter.DefineMethod): Likewise.
12303 (TypeParameter.DefineType): New public method. Calls
12304 `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
12307 2003-12-08 Martin Baulig <martin@ximian.com>
12309 * convert.cs (Convert.ImplicitConversionStandard): Use
12310 `expr_type.Equals (target_type)' instead of `=='.
12312 2003-12-08 Martin Baulig <martin@ximian.com>
12314 * typemanager.cs (TypeManager.GetReferenceType): Call
12315 `Type.MakeByRefType ()'.
12317 2003-12-08 Martin Baulig <martin@ximian.com>
12319 * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
12320 just has some special meaning in some situations. For instance,
12321 it is allowed to use `where' as the name of a variable etc.
12323 2003-12-04 Martin Baulig <martin@ximian.com>
12325 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12326 `Type.MakeArrayType()' for array types.
12328 2003-11-18 Miguel de Icaza <miguel@ximian.com>
12330 * expression.cs (Invocation.VerifyArgumentsCompat): Remove
12333 (SizeOf.DoResolve): assign the `type_queried' field. This gets
12336 2003-11-16 Martin Baulig <martin@ximian.com>
12338 * codegen.cs (EmitContext.IsGeneric): Removed.
12340 * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
12341 ResolveGeneric() on the DeclSpace.
12343 2003-11-16 Martin Baulig <martin@ximian.com>
12345 * generic.cs (TypeArguments.Resolve):
12346 `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
12347 `ResolveType()' on it to get the Type.
12349 2003-11-15 Martin Baulig <martin@ximian.com>
12351 * generic.cs (ConstructedType.GetInterfaces): Override this.
12353 2003-11-14 Martin Baulig <martin@ximian.com>
12355 * interface.cs (Interface.DefineType): Define all type parameters
12356 before adding the interfaces we inherit.
12358 2003-11-11 Martin Baulig <martin@ximian.com>
12360 * generic.cs (ConstructedType.ResolveType): Always call
12361 `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
12363 2003-11-10 Martin Baulig <martin@ximian.com>
12365 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12366 (TypeManager.InitCoreTypes): Initialize them here, but instead of
12367 calling `ResolveType()' on them, directly assign their `Type'.
12369 2003-11-08 Martin Baulig <martin@ximian.com>
12371 * generic.cs (ConstructedType): Override `IsClass' etc.
12373 2003-11-08 Martin Baulig <martin@ximian.com>
12375 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12376 return value and the `out parent' parameter.
12377 (TypeContainer.DefineType): Moved the CS0644 check into
12378 GetClassBases(). Don't pass the interface types to the
12379 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12380 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12382 * ecore.cs (TypeExpr.IsAttribute): New property.
12383 (TypeExpr.GetInterfaces): New method.
12385 * interface.cs (Interface.GetInterfaceTypeByName): Return a
12386 TypeExpr instead of a Type.
12387 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12388 (Interface.DefineType): Don't pass the interface types to the
12389 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12390 them later and then call `TypeBulider.AddInterfaceImplementation()'.
12392 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12393 instead of a `Type[]'.
12394 (TypeManager.RegisterBuilder): Likewise.
12395 (TypeManager.AddUserInterface): Likewise.
12396 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12397 `Type[]' and also return a `TypeExpr[]'.
12398 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12400 2003-11-08 Martin Baulig <martin@ximian.com>
12402 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12405 2003-11-08 Martin Baulig <martin@ximian.com>
12407 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12408 TypeManager.ResolveExpressionTypes().
12410 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12411 instead of an Expression.
12412 (TypeExpr): This is now an abstract base class for `TypeExpression'.
12413 (TypeExpression): New public class; formerly known as `TypeExpr'.
12415 * expression.cs (ComposedCast): Derive from TypeExpr.
12417 * typemanager.cs (TypeManager.system_*_expr): These are now
12418 TypExpr's instead of Expression's.
12419 (TypeManager.ResolveExpressionTypes): New public static function;
12420 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12423 2003-11-06 Miguel de Icaza <miguel@ximian.com>
12425 * expression.cs (New.DoResolve): Do not dereference value that
12426 might be a null return.
12428 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12429 sure that the constant value has the right type. Fixes an
12430 unreported bug, similar to 50425.
12432 * const.cs (Const.LookupConstantValue): Call
12433 ImplicitStandardConversionExists before doing a conversion to
12434 avoid havng the TypeManager.ChangeType do conversions.
12436 Reduced the number of casts used
12438 (Const.ChangeType): New routine to enable reuse of the constant
12439 type changing code from statement.
12441 * typemanager.cs (ChangeType): Move common initialization to
12442 static global variables.
12446 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12447 every value type to go through, even if it was void. Fix that.
12449 * cs-tokenizer.cs: Use is_identifier_start_character on the start
12450 character of the define, and the is_identifier_part_character for
12451 the rest of the string.
12453 2003-11-05 Miguel de Icaza <miguel@ximian.com>
12455 * expression.cs (UnaryMutator.EmitCode): When I updated
12456 LocalVariableReference.DoResolve, I overdid it, and dropped an
12457 optimization done on local variable references.
12459 2003-11-04 Miguel de Icaza <miguel@ximian.com>
12461 * ecore.cs: Convert the return from Ldlen into an int.
12463 2003-10-20 Miguel de Icaza <miguel@ximian.com>
12465 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12466 the accessibility, this is a special case for toplevel non-public
12467 classes (internal for instance).
12469 2003-10-20 Nick Drochak <ndrochak@gol.com>
12471 * ecore.cs: Fix typo and build. Needed another right paren.
12473 2003-10-19 Miguel de Icaza <miguel@ximian.com>
12475 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
12476 `internal' case regular and protected, but not allowing protected
12477 to be evaluated later. Bug 49840
12479 2003-10-15 Miguel de Icaza <miguel@ximian.com>
12481 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12482 to kb.Nlast, and not the kb.nFirst to isolate the switch
12485 Extract the underlying type, so enumerations of long/ulong are
12486 treated like long/ulong.
12488 2003-10-14 Miguel de Icaza <miguel@ximian.com>
12490 * expression.cs (New): Overload the meaning of RequestedType to
12491 track the possible creation of the NewDelegate type, since
12492 DoResolve is invoked more than once for new constructors on field
12495 See bugs: #48800 and #37014
12497 * cs-parser.jay (declare_local_constants): Take an arraylist
12498 instead of a single constant.
12500 (local_constant_declaration): It should take a
12501 constant_declarators, not a constant_declarator. Fixes 49487
12503 * convert.cs: Fix error report.
12505 2003-10-13 Jackson Harper <jackson@ximian.com>
12507 * typemanager.cs (TypeToCoreType): Add float and double this fixes
12510 2003-11-03 Martin Baulig <martin@ximian.com>
12512 * expression.cs (ArrayAccess.GetStoreOpcode): Added
12513 `out bool has_type_arg'; if set, we need to pass the type to
12515 (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
12516 Stelem_Any/Ldelem_Any for generic parameters.
12518 2003-11-02 Martin Baulig <martin@ximian.com>
12520 * expression.cs (Invocation.EmitCall): Use
12521 `TypeManager.IsValueType()' to check whether it's a value type.
12522 Don't set `struct_call' when calling a method on a type parameter.
12524 2003-11-02 Martin Baulig <martin@ximian.com>
12526 * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
12527 and removed the TypeBuilder argument.
12529 * typemanager.cs (TypeManager.IsValueType): Return
12530 `t.IsGenericParameter || t.IsValueType'.
12532 2003-10-25 Martin Baulig <martin@ximian.com>
12534 * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
12535 call ConstructedType.Resolve() on it.
12537 * generic.cs (ConstructedType.Resolve): Set `type' on success.
12539 2003-10-25 Martin Baulig <martin@ximian.com>
12541 * class.cs (TypeContainer.GetClassBases): Changed
12542 `out Type parent' into `out TypeExpr parent'. Moved CS0644 and
12543 CS8214 reporting here.
12544 (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
12545 instead of a `Type' for our parent. In case of a recursive
12546 declaration (see tests/gen-23.cs for an example), our parent is a
12547 ConstructedType and it doesn't have its type set. So, first
12548 create our own TypeBuilder, then call constructed.Resolve() to get
12549 the parent's type and finally TypeBuilder.SetParent() it.
12551 * ecore.cs (TypeExpr.Name): New public virtual property.
12554 (ConstructedType): We're now a TypeExpr and not just an Expression.
12555 (ConstructedType.ResolveAsTypeStep): Don't resolve our type
12556 arguments here; this is done later.
12557 (ConstructedType.Resolve): New public method to resolve the type
12558 arguments and bind them.
12560 2003-10-21 Martin Baulig <martin@ximian.com>
12562 * convert.cs: Use `TypeManager.IsValueType' instead of
12563 'type.IsValueType' everywhere.
12565 * typemanager.cs (TypeManager.IsValueType): Return true for type
12566 parameters. The reason for this is that we need to box a type
12567 parameter when converting it to a reference type.
12569 * cs-parser.jay: Added support for default value expressions.
12571 * generics.cs (DefaultValueExpression): New public class.
12573 2003-10-17 Martin Baulig <martin@ximian.com>
12575 * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
12576 TypeContainer so we can also use this for Interfaces.
12577 (TypeParameter.Resolve): Likewise.
12579 * interface.cs (Interface.DefineType): Added support for generic
12582 * cs-parser.jay: Added support for generic structs and interfaces.
12584 2003-10-17 Martin Baulig <martin@ximian.com>
12586 * generic.cs (GenericMemberAccess.DoResolve): We can now actually
12587 call generic methods :-)
12589 2003-10-16 Martin Baulig <martin@ximian.com>
12591 * cs-parser.jay (namespace_or_type_name): Only create a
12592 GenericMemberAccess if we actually have type arguments.
12594 2003-10-13 Martin Baulig <martin@ximian.com>
12596 * class.cs (Method.Define): If we're a generic method, call
12597 TypeBuilder.DefineGenericMethod () before resolving
12599 (MethodData): Added .ctor which takes an additional MethodBuilder
12600 argument; this is used for generic methods.
12601 (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
12602 we already have a MethodBuilder.
12604 2003-10-10 Martin Baulig <martin@ximian.com>
12606 * class.cs (Method): Added .ctor which takes a `GenericMethod'
12607 instead of a `DeclSpace'. This is used for generic methods.
12609 * cs-parser.jay (method_header): Added support for generic
12610 methods; create a `GenericMethod' instance and pass it to the
12611 `Method's .ctor; it'll be used as the `DeclSpace' to lookup
12612 parameters and locals.
12614 * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
12615 since we already have the location. Check whether we're a generic
12616 type declaration or a generic method and create the correct type
12619 * generic.cs (TypeParameter.DefineMethod): New public method.
12620 (GenericMethod): New public class; derives from DeclSpace and is
12621 used for generic methods.
12623 2003-10-09 Martin Baulig <martin@ximian.com>
12625 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12627 (MethodCore.DoDefineParameters): Removed the TypeContainer
12628 argument; use the DeclSpace which was passed to the .ctor instead.
12629 (MethodCore.CheckParameter): Take a DeclSpace instead of a
12630 TypeContainer; we only need a DeclSpace here.
12632 2003-10-09 Martin Baulig <martin@ximian.com>
12634 * class.cs (MethodData): Added additional `DeclSpace ds' argument
12636 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12637 EmitContext's .ctor.
12639 2003-10-09 Martin Baulig <martin@ximian.com>
12641 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12642 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12643 AsAccessible(), moved them as well.
12645 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12647 2003-10-07 Miguel de Icaza <miguel@ximian.com>
12649 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12650 generation for >=, as spotted by Paolo, bug 48679.
12651 Patch from David Waite.
12653 * cs-tokenizer.cs: Add handling for #pragma.
12655 * cs-parser.jay: Allow for both yield and yield return in the
12656 syntax. The anti-cobolization of C# fight will go on!
12658 * class.cs (TypeBuilder.DefineType): Catch error condition here
12659 (Parent.DefineType erroring out and returning null).
12661 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12662 coping with enumerations variables, we were mistakenly processing
12663 them as a regular value type instead of built-in types. Fixes the
12666 * typemanager.cs (IsBuiltinOrEnum): New method.
12668 2003-09-30 Miguel de Icaza <miguel@ximian.com>
12670 * cs-parser.jay: Upgrade: yield now needs the return clause.
12672 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12674 * cs-parser.jay : Renamed yyName to yyNames related to jay.
12676 2003-09-29 Martin Baulig <martin@ximian.com>
12678 * typemanager.cs (TypeManager.GetMethodFlags): Added support for
12679 inflated generic methods.
12681 * generics.cs (ConstructedType): Distinguish between open and
12682 closed constructed types; correctly resolve the arguments.
12684 2003-09-22 Martin Baulig <martin@ximian.com>
12686 * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
12687 all type arguments meet their constraints.
12689 2003-09-19 Martin Baulig <martin@ximian.com>
12691 * decl.cs (MemberCache.SetupCacheForInterface): Take a
12692 `MemberCache parent' argument. Normally, an interface doesn't
12693 have a parent type except System.Object, but we use this in gmcs
12694 for generic type parameters.
12696 2003-09-18 Martin Baulig <martin@ximian.com>
12698 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12699 on `type.IsInterface'; don't check whether the type has a parent
12700 to determine whether it's an interface.
12702 2003-09-17 Martin Baulig <martin@ximian.com>
12704 * generic.cs (ConstructedType.ToString): Always use `name' as the
12707 2003-09-15 Martin Baulig <martin@ximian.com>
12709 * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
12711 * generic.cs (Constraints.Resolve): New public method; this is
12712 called to resolve the constraint types and to check whether all
12713 the constraints are correct.
12714 (Constraints.Types): New public property.
12715 (TypeParameter.Resolve): New public method; resolves all the
12716 type's constraints.
12718 * class.cs (TypeContainer.DefineType): Call
12719 TypeParameter.Resolve() before actually defining the type.
12721 2003-09-15 Martin Baulig <martin@ximian.com>
12723 * class.cs (TypeContainer.DefineType): Added an error flag to
12724 avoid reporting duplicate CS0146's ("class definition is
12727 * driver.cs (Driver.MainDriver): Abort if
12728 RootContext.ResolveTree() reported any errors.
12730 2003-09-07 Martin Baulig <martin@ximian.com>
12732 * report.cs (Error, Warning): Added overloaded versions which take
12733 a `params object[] args' and call String.Format().
12735 2003-09-07 Martin Baulig <martin@ximian.com>
12737 * decl.cs (DeclSpace..ctor): Don't call
12738 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12739 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
12740 (DeclSpace.RecordDecl): New method.
12742 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12744 2003-09-02 Ravi Pratap <ravi@ximian.com>
12746 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12747 value attributes to be applied to ParameterBuilders.
12749 * class.cs (MethodCore.LabelParameters): Make static and more
12750 generic so that it can be used from other places - like interface
12751 methods, for instance.
12753 * interface.cs (Interface.Emit): Call LabelParameters before
12754 emitting attributes on the InterfaceMethod.
12756 2003-09-07 Martin Baulig <martin@ximian.com>
12758 * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
12759 if the number of type parameters doesn't match.
12761 2003-09-04 Martin Baulig <martin@ximian.com>
12763 * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
12764 for arrays of generic type params (ie. `!0[]').
12766 2003-09-04 Martin Baulig <martin@ximian.com>
12768 * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
12771 2003-09-04 Martin Baulig <martin@ximian.com>
12773 * decl.cs (DeclSpace.LookupGeneric): New method.
12774 (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
12777 * generic.cs (TypeParameterExpr): Take a TypeParameter as
12778 argument, not just a string.
12779 (TypeParameter.Define): New public method; this is called to
12780 actually define the generic parameter; after this, you can use the
12781 new `Type' property to get the type.
12783 2003-09-04 Martin Baulig <martin@ximian.com>
12785 * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
12786 is now an ArrayList; initialize the result of the `TypeParameters'
12788 (DeclSpace.GetGenericData): Removed.
12789 (DeclSpace.LookupGeneric): Temporarily removed; we need to
12790 implement this in a different way.
12791 (DeclSpace.GetTypeParameters): Removed; there's now a
12792 `TypeParameters' property.
12793 (DeclSpace.TypeParameters): New public property.
12795 * generic.cs (Constraints): Make this class public.
12796 (TypeParameter): New public class.
12798 2003-09-04 Martin Baulig <martin@ximian.com>
12800 * decl.cs (DeclSpace.GetTypeParameters): New method to return the
12801 generic parameters.
12803 * class.cs (TypeContainer.DefineType): Call
12804 TypeBuilder.DefineGenericParameter () on all generic parameters if
12805 this is a generic type.
12807 2003-08-28 Martin Baulig <martin@ximian.com>
12809 * sample-stack.il: Compile this with ilasm: "ilasm /dll
12812 * sample-hello.cs: Compile this with gmcs: "gmcs
12813 /r:sample-stack.dll sample-hello.cs".
12815 2003-08-28 Martin Baulig <martin@ximian.com>
12817 * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
12818 the parameters to the generic type.
12820 2003-08-28 Martin Baulig <martin@ximian.com>
12822 * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
12824 2003-08-28 Martin Baulig <martin@ximian.com>
12826 * cs-parser.jay (opt_type_argument_list): Use
12827 `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
12828 (primary_expression): Replace `qualified_identifier' with `type_name'.
12829 (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
12831 * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
12832 parser to check whether it is syntactically a type parameter list;
12833 return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
12836 2003-08-26 Martin Baulig <martin@ximian.com>
12838 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
12839 resolving aliases; fixes #47927.
12841 2003-08-26 Martin Baulig <martin@ximian.com>
12843 * statement.cs (Using.DoResolve): This is internally emitting a
12844 try/finally clause, so we need to set ec.NeedExplicitReturn if we
12845 do not always return. Fixes #47681.
12847 2003-08-26 Martin Baulig <martin@ximian.com>
12849 * decl.cs (MemberCore): Moved WarningNotHiding(),
12850 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
12852 (AdditionResult): Make this nested in DeclSpace.
12853 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
12854 argument; call NamespaceEntry.Define() unless we're nested in a
12857 * namespace.cs (Namespace.DefineName): New public function. This
12858 is called from DeclSpace's .ctor to add
12859 (Namespace.Lookup): Include DeclSpaces in the lookup.
12861 * class.cs (Operator): Derive from MemberBase, not MemberCore.
12863 * const.cs (Const): Derive from MemberBase, not MemberCore.
12865 2003-08-25 Martin Baulig <martin@ximian.com>
12867 * convert.cs (Convert.ExplicitReferenceConversion): When
12868 converting from an interface type to a class, unbox if the target
12869 type is a struct type. Fixes #47822.
12871 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12873 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
12876 2003-08-22 Martin Baulig <martin@ximian.com>
12878 * class.cs (TypeManager.DefineType): When defining a nested type,
12879 call DefineType() on our parent; fixes #47801.
12881 2003-08-22 Martin Baulig <martin@ximian.com>
12883 * class.cs (MethodData.Define): While checking if a method is an
12884 interface implementation, improve the test a bit more to fix #47654.
12886 2003-08-22 Martin Baulig <martin@ximian.com>
12888 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
12889 correctly; fixes #47722.
12891 2003-08-22 Martin Baulig <martin@ximian.com>
12893 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
12894 LocalVariableReference, ensure it's not read-only. Fixes #47536.
12896 * statement.cs (Fixed.DoResolve): Make all variables read-only.
12898 2003-08-22 Martin Baulig <martin@ximian.com>
12900 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
12901 can only be assigned in static constructors. Fixes #47161.
12903 2003-08-22 Martin Baulig <martin@ximian.com>
12905 Rewrote and improved the flow analysis code.
12907 * flowbranching.cs (FlowBranching): Make this class abstract.
12908 (FlowBranching.CreateBranching): New static function to create a
12909 new flow branching.
12910 (FlowBranchingBlock, FlowBranchingException): New classes.
12911 (FlowBranching.UsageVector.Type): New public readonly field.
12912 (FlowBranching.UsageVector.Breaks): Removed the setter.
12913 (FlowBranching.UsageVector.Returns): Removed the setter.
12914 (FlowBranching.UsageVector): Added Break(), Return(),
12915 NeverReachable() and Throw() methods to modify the reachability.
12916 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
12917 done by FlowBranching.Merge().
12918 (FlowBranching.UsageVector.MergeChild): New method; merges the
12919 merge result into the current vector.
12920 (FlowBranching.Merge): New abstract method to merge a branching.
12922 2003-08-12 Martin Baulig <martin@ximian.com>
12924 * expression.cs (Indirection.CacheTemporaries): Create the
12925 LocalTemporary with the pointer type, not its element type.
12927 2003-08-10 Miguel de Icaza <miguel@ximian.com>
12929 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
12930 token was a keyword or not.
12932 Add `error' options where an IDENTIFIER was expected; Provide
12933 CheckToken and CheckIdentifierToken convenience error reporting
12936 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
12938 * decl.cs: Rename `NamespaceEntry Namespace' public field into
12939 NameSpaceEntry NameSpaceEntry.
12941 (LookupInterfaceOrClass): Avoid creating a full qualified name
12942 from namespace and name: avoid doing lookups when we know the
12943 namespace is non-existant. Use new Tree.LookupByNamespace which
12944 looks up DeclSpaces based on their namespace, name pair.
12946 * driver.cs: Provide a new `parser verbose' to display the
12947 exception thrown during parsing. This is turned off by default
12948 now, so the output of a failure from mcs is more graceful.
12950 * namespace.cs: Track all the namespaces defined in a hashtable
12953 (IsNamespace): New method
12955 2003-08-09 Miguel de Icaza <miguel@ximian.com>
12957 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
12958 we know that we need to concatenate (full typename can never be
12963 * statement.cs: Use a bitfield; Do not initialize to null things
12964 which are done by the constructor by default.
12966 * cs-parser.jay: bug fix, parameter was 4, not 3.
12968 * expression.cs: Just use the property;
12970 * statement.cs: No need for GetVariableInfo method.
12972 2003-08-08 Martin Baulig <martin@ximian.com>
12974 * flowanalysis.cs (FlowReturns): This is now nested in the
12975 `FlowBranching' class.
12976 (MyBitVector): Moved this here from statement.cs.
12977 (FlowBranching.SiblingType): New enum type.
12978 (FlowBranching.CreateSibling): Added `SiblingType' argument.
12980 2003-08-07 Martin Baulig <martin@ximian.com>
12982 * flowanalysis.cs (FlowBranchingType): This is now nested in the
12983 `FlowBranching' class and called `BranchingType'.
12985 2003-08-07 Martin Baulig <martin@ximian.com>
12987 * flowanalysis.cs: Moved all the control flow analysis code into
12990 2003-08-07 Martin Baulig <martin@ximian.com>
12992 * assign.cs (Assign.DoResolve): `target' must either be an
12993 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
12996 2003-08-07 Miguel de Icaza <miguel@ximian.com>
12998 * expression.cs (BinaryMethod): This kind of expression is created by the
12999 Binary class if it determines that the operator has to be handled
13002 (BinaryDelegate): This kind of expression is created if we are
13003 dealing with a + or - operator on delegates.
13005 (Binary): remove method, argumetns, and DelegateOperator: when
13006 dealing with methods,
13008 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
13010 * statement.cs (Block): use bitfields for the three extra booleans
13011 we had in use. Remove unused topblock parameter.
13013 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
13015 * assign.cs: Drop extra unneeded tests.
13017 2003-08-06 Miguel de Icaza <miguel@ximian.com>
13019 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
13021 * statement.cs (Foreach): Use VariableStorage instead of
13024 * codegen.cs (VariableStorage): New class used by clients that
13025 require a variable stored: locals or fields for variables that
13026 need to live across yield.
13028 Maybe provide a convenience api for EmitThis+EmitLoad?
13030 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
13033 2003-08-05 Miguel de Icaza <miguel@ximian.com>
13035 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
13036 RemapParameterLValue): New methods that are used to turn a
13037 precomputed FieldInfo into an expression like this:
13041 The idea is to use this instead of making LocalVariableReference
13042 have more than one meaning.
13044 * cs-parser.jay: Add error production to BASE.
13046 * ecore.cs: Deal with TypeManager.GetField returning null, which
13047 is now a valid return value.
13049 (FieldExprNoAddress): New expression for Fields whose address can
13052 * expression.cs (LocalVariableReference): During the resolve
13053 phases, create new expressions if we are in a remapping context.
13054 Remove code that dealt with remapping here.
13056 (ParameterReference): same.
13058 (ProxyInstance): New expression, like the `This' expression, but
13059 it is born fully resolved. We know what we are doing, so remove
13060 the errors that are targeted to user-provided uses of `this'.
13062 * statement.cs (Foreach): our variable is now stored as an
13063 Expression; During resolution, follow the protocol, dont just
13064 assume it will return this.
13066 2003-08-06 Martin Baulig <martin@ximian.com>
13068 * support.cs (SeekableStreamReader.cs): New public class.
13070 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
13071 SeekableStreamReader instead of the normal StreamReader.
13073 2003-08-04 Martin Baulig <martin@ximian.com>
13075 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
13076 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
13077 deambiguate casts and delegate invocations.
13078 (parenthesized_expression): Use the new tokens to ensure this is
13079 not a cast of method invocation.
13081 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
13082 when reading a `)' and Deambiguate_CloseParens () was previously
13085 * expression.cs (ParenthesizedExpression): New class. This is
13086 just used for the CS0075 test.
13087 (Binary.DoResolve): Check for CS0075.
13089 2003-07-29 Ravi Pratap <ravi@ximian.com>
13091 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
13092 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
13093 reference comparison.
13095 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
13096 examine the ReturnType for equality - this is necessary in the
13097 cases of implicit and explicit operators whose signature also
13098 includes the return type.
13100 2003-07-26 Miguel de Icaza <miguel@ximian.com>
13102 * namespace.cs: Cache the result of the namespace computation,
13103 instead of computing it every time.
13105 2003-07-24 Miguel de Icaza <miguel@ximian.com>
13107 * decl.cs: Use a global arraylist that we reuse over invocations
13108 to avoid excesive memory consumption. Reduces memory usage on an
13109 mcs compile by one meg (45 average).
13111 * typemanager.cs (LookupTypeReflection): In .NET pointers are
13112 private, work around that.
13114 2003-07-23 Miguel de Icaza <miguel@ximian.com>
13116 * literal.cs (IntLiteral): Define Zero and One static literals.
13118 * cs-parser.jay (integer_literal): use static literals to reduce
13119 memory usage for the most used literals (0, 1 and -1). 211kb
13120 reduced in memory usage.
13122 Replace all calls to `new ArrayList' with `new
13123 ArrayList(4)' which is a good average number for most allocations,
13124 and also requires only 16 bytes of memory for its buffer by
13127 This reduced MCS memory usage in seven megabytes for the RSS after
13130 2003-07-28 Ravi Pratap <ravi@ximian.com>
13132 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
13133 handle params methods the correct way by forming only one
13134 applicable set with params and normal methods in them. Earlier we
13135 were looking at params methods only if we found no normal methods
13136 which was not the correct thing to do.
13138 (Invocation.BetterFunction): Take separate arguments indicating
13139 when candidate and the best method are params methods in their
13142 This fixes bugs #43367 and #46199.
13144 * attribute.cs: Documentation updates.
13146 (CheckAttribute): Rename to CheckAttributeTarget.
13147 (GetValidPlaces): Rename to GetValidTargets.
13149 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
13150 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
13154 2003-07-28 Miguel de Icaza <miguel@ximian.com>
13156 * codegen.cs: Compute IsGeneric correctly.
13158 * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
13161 Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
13162 OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
13163 regressions, and I was chasing more bugs than I required.
13165 * interface.cs: Use expressions for base type names (like classes
13166 and structs have been doing for a while now), and resolve that.
13167 This patch should probably go into head as well.
13169 This makes it one less user of FindType.
13171 2003-07-24 Miguel de Icaza <miguel@ximian.com>
13173 This compiler can not self host currently. Need to fix that.
13175 * Makefile: compile to `gmcs.exe'
13177 * driver.cs: Turn on v2 by default on gmcs.
13179 * generic.cs (ConstructedType): Does no longer take a container
13180 type argument; That will be taken care of later.
13182 (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
13183 Use SimpleName to resolve for now, so we can continue the work on
13184 the parser, until we get Type.GetType that understands generics.
13186 (ConstructedType.ToString): Implement
13188 (TypeArguments.Resolve): Resolve the child expressions as types.
13190 * cs-parser.jay: Rename interface_constraints to
13191 type_parameter_constraints
13193 (namespace_or_type_name): Only use constructed types for the basic
13194 construction, we will deal with identifier<...> later.
13196 (type/type_name): No longer call DecomposeQI, as
13197 namespace_or_type_name is always decoded now.
13199 2003-07-22 Ravi Pratap <ravi@ximian.com>
13201 * expression.cs (Invocation.OverloadResolve): Follow the spec more
13202 closely: we eliminate methods in base types when we have an
13203 applicable method in a top-level type.
13205 Please see section 14.5.5.1 for an exact description of what goes
13208 This fixes bug #45127 and a host of other related to corlib compilation.
13210 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13211 array is the method corresponding to the top-level type (this is
13212 because of the changes made to icall.c) so we change this
13215 (MethodGroupExpr.Name): This too.
13217 * typemanager.cs (GetElementType): New method which does the right
13218 thing when compiling corlib.
13220 * everywhere: Make use of the above in the relevant places.
13222 2003-07-22 Martin Baulig <martin@ximian.com>
13224 * cs-parser.jay (invocation_expression): Moved
13225 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
13226 `cast_expression', but create a InvocationOrCast which later
13227 resolves to either an Invocation or a Cast.
13229 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
13230 method; call this before EmitStatement() to make sure that this
13231 expression can be used as a statement.
13233 * expression.cs (InvocationOrCast): New class; resolves to either
13234 an Invocation or a Cast.
13236 * statement.cs (StatementExpression): Call ResolveStatement() on
13237 the ExpressionStatement before emitting it.
13239 2003-07-21 Martin Baulig <martin@ximian.com>
13241 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
13242 `ref' and `out' attributes match; fixes #46220.
13243 (MemberAccess.ResolveMemberAccess): You can't reference a type
13244 through an expression; fixes #33180.
13245 (Indexers.GetIndexersForType): Don't return the indexers from
13246 interfaces the class implements; fixes #46502.
13248 2003-07-21 Martin Baulig <martin@ximian.com>
13250 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
13251 CS0661 checks; fixes bug #30442.
13253 2003-07-21 Martin Baulig <martin@ximian.com>
13255 * decl.cs (AdditionResult): Added `Error'.
13257 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
13259 * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
13260 cs0031.cs actually work.
13262 2003-07-20 Miguel de Icaza <miguel@ximian.com>
13264 * cs-parser.jay (namespace_name): do not use
13265 namespace_or_type_name, use qualified_identifier, because
13266 namespace_or_type_name will soon return a composed expression
13267 instead of a string.
13269 (namespace_or_type_name): Instead of returning a string, now this
13270 production returns an expression.
13272 * codegen.cs (EmitContext): Setup IsGeneric property based on
13273 whether our DeclSpace is generic, our the method is generic.
13275 * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
13276 the method is generic.
13278 * cs-parser.jay (type_arguments, opt_type_argument_list,
13279 type_parameters, type_parameter_list, opt_type_parameter_list,
13280 type_parameter,, opt_type_parameter_constraints_clauses,
13281 type_parameter_constraints_clauses,
13282 type_parameter_constraint_clause, type_parameter_constraint,
13283 interface_constraints): Add new production
13285 * decl.cs (DeclSpace): IsGeneric, flag to track whether this
13286 DeclSpace is generic or not.
13288 (DeclSpace.SetParameterInfo): New routine, used to set the
13289 parameter info for a type.
13291 (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
13292 returns a GenericTypeExpr
13294 * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
13295 generic, lookup the generic argument.
13297 * attribute.cs: Do not allow TypeParameterExpressions in
13300 * class.cs: Do not allow the Main method to be defined in a
13303 * expression.cs (SizeOf): Do not allow generic types to be used as
13304 arguments to sizeof.
13306 * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
13307 it: whether a type is generic or not. Only works for types we are
13308 currently building for now.
13310 2003-07-20 Martin Baulig <martin@ximian.com>
13312 * namespace.cs: Fixed that bug which caused a crash when compiling
13313 the debugger's GUI.
13315 2003-07-20 Miguel de Icaza <miguel@ximian.com>
13317 * typemanager.cs (LookupTypeReflection): Never expose types which
13318 are NotPublic, NestedPrivate, NestedAssembly, or
13319 NestedFamANDAssem. We used to return these, and later do a check
13320 that would report a meaningful error, but the problem is that we
13321 would not get the real match, if there was a name override.
13323 2003-07-18 Miguel de Icaza <miguel@ximian.com>
13325 * namespace.cs (Namespace, Name): Do not compute the namespace
13326 name dynamically, compute it in the constructor. This reduced
13327 memory usage by 1697 KB.
13329 * driver.cs: Use --pause to pause at the end.
13331 2003-07-17 Peter Williams <peter@newton.cx>
13333 * Makefile: Change the name of the test target so that it doesn't
13334 conflict with the recursive test target.
13336 2003-07-17 Miguel de Icaza <miguel@ximian.com>
13338 * expression.cs (LocalVariableReference.Emit, EmitAssign,
13339 AddressOf): Do not use EmitThis, that was wrong, use the actual
13342 2003-07-15 Miguel de Icaza <miguel@ximian.com>
13344 * class.cs (MethodData.Define): While checking if a method is an
13345 interface implementation, improve the test: If we are not public
13346 (use new test here: use the computed MethodAttributes directly,
13347 instead of the parsed modifier flags) check if the `implementing'
13348 method comes from an interface or not.
13350 * pending.cs (VerifyPendingMethods): Slightly better error
13353 * makefile: add test target that does the mcs bootstrap.
13355 2003-07-16 Ravi Pratap <ravi@ximian.com>
13357 * interface.cs (Define): Do nothing here since there are no
13358 members to populate etc. Move the attribute emission out of here
13359 since this was just totally the wrong place to put it. Attribute
13360 application happens during the 'Emit' phase, not in the 'Define'
13363 (Emit): Add this method and move the attribute emission here
13365 * rootcontext.cs (EmitCode): Call the Emit method on interface
13368 2003-07-14 Ravi Pratap M <ravi@ximian.com>
13370 * expression.cs (OverloadResolve): Report error only if Location
13371 is not 'Null' which means that there was a probe going on.
13373 2003-07-14 Martin Baulig <martin@ximian.com>
13375 * expression.cs (ConditionalLogicalOperator): New public class to
13376 implement user defined conditional logical operators.
13377 This is section 14.11.2 in the spec and bug #40505.
13379 2003-07-14 Martin Baulig <martin@ximian.com>
13381 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13383 2003-07-14 Martin Baulig <martin@ximian.com>
13385 * codegen.cs (EmitContext.InFixedInitializer): New public field.
13387 * ecore.cs (IVariable.VerifyFixed): New interface method.
13389 * expression.cs (Unary.ResolveOperator): When resolving the `&'
13390 operator, check whether the variable is actually fixed. Fixes bug
13391 #36055. Set a variable definitely assigned when taking its
13392 address as required by the spec.
13394 * statement.cs (LocalInfo.IsFixed): New field.
13395 (LocalInfo.MakePinned): Set `IsFixed' to true.
13397 2003-07-14 Ravi Pratap M <ravi@ximian.com>
13399 * attribute.cs (Attribute.Resolve): While doing a Member lookup
13400 for .ctors, ensure that we only ask for members declared in the
13401 attribute type (BindingFlags.DeclaredOnly).
13405 * expression.cs (Error_WrongNumArguments): Report error 1501
13406 correctly the way CSC does.
13408 2003-07-13 Martin Baulig <martin@ximian.com>
13410 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13411 lookup on the fully qualified name, to make things like "X.X" work
13412 where "X.X" is a fully qualified type name, but we also have a
13413 namespace "X" in the using list. Fixes #41975.
13415 2003-07-13 Martin Baulig <martin@ximian.com>
13417 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13418 function. If we're a CompoundAssign, we need to create an embedded
13419 CompoundAssign, not an embedded Assign.
13420 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13423 2003-07-13 Martin Baulig <martin@ximian.com>
13425 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13426 work to fix bug #46088.
13428 2003-07-13 Ravi Pratap <ravi@ximian.com>
13430 * class.cs (Operator.Emit): Do not emit attributes here - it is
13431 taken care of by the Method class that we delegate too. This takes
13432 care of bug #45876.
13434 2003-07-10 Martin Baulig <martin@ximian.com>
13436 * expression.cs (TypeOfVoid): New class.
13437 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
13439 2003-07-10 Martin Baulig <martin@ximian.com>
13441 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13444 2003-07-10 Martin Baulig <martin@ximian.com>
13446 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13447 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13449 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13451 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13453 2003-07-10 Martin Baulig <martin@ximian.com>
13455 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13456 of decimal. Fixes #42850.
13458 NOTE: I also fixed the created byte blob, but this doesn't work on
13459 the MS runtime and csc never produces any byte blobs for decimal
13462 2003-07-10 Martin Baulig <martin@ximian.com>
13464 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13465 structs; fixes #32068.
13466 (Block.AddChildVariableNames): Fixed #44302.
13468 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13470 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
13472 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13474 * attribute.cs: And this test is onger needed.
13476 2003-07-08 Martin Baulig <martin@ximian.com>
13478 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13479 inaccessible types. Fixes #36313.
13481 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13483 * namespace.cs (NamespaceEntry): Create implicit entries for all
13484 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13485 implicit entries for N1.N2 and N1.
13487 2003-07-08 Martin Baulig <martin@ximian.com>
13489 Rewrote the handling of namespaces to fix a lot of the issues
13490 wrt. `using' aliases etc.
13492 * namespace.cs (Namespace): Splitted this class into a
13493 per-assembly `Namespace' and a per-file `NamespaceEntry'.
13495 * typemanager.cs (TypeManager.IsNamespace): Removed.
13496 (TypeManager.ComputeNamespaces): Only compute namespaces from
13497 loaded assemblies here, not the namespaces from the assembly we're
13498 currently compiling.
13500 2003-07-08 Martin Baulig <martin@ximian.com>
13502 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13504 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13506 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13509 I thought about the memory savings here, but LookupTypeReflection
13510 is used under already very constrained scenarios. Compiling
13511 corlib or mcs only exposes one hit, so it would not really reduce
13512 any memory consumption.
13514 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13516 * typemanager.cs: fixes bug #45889 by only adding public types from
13517 other assemblies to the list of known types.
13519 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13521 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13522 on the type we resolved.
13524 2003-07-05 Martin Baulig <martin@ximian.com>
13526 * pending.cs (PendingImplementation.ParentImplements): Don't
13527 create the proxy if the parent is abstract.
13529 * class.cs (TypeContainer.DefineIndexers): Process explicit
13530 interface implementations first. Fixes #37714.
13532 2003-07-04 Miguel de Icaza <miguel@ximian.com>
13534 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13535 defined recursively; but since we modify the input parameters
13536 (left is set to `this' temporarily), we reset this value if the
13537 left_is_explicit is false, which gives the original semantics to
13540 * literal.cs (NullPointer): new class used to represent a null
13541 literal in a pointer context.
13543 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13544 type is a pointer, use a NullPointer object instead of a
13545 NullLiteral. Closes 43687
13547 (ExplicitConversion): Convert pointer values using
13548 the conv opcode to the proper type.
13550 * ecore.cs (New): change ValueTypeVariable property into a method,
13551 that returns whether the valuetype is suitable for being used.
13553 * expression.cs (Binary.DoNumericPromotions): Only return if we
13554 the int constant was a valid uint, and we can return both left and
13555 right as uints. If not, we continue processing, to trigger the
13556 type conversion. This fixes 39018.
13558 * statement.cs (Block.EmitMeta): During constant resolution, set
13559 the CurrentBlock property on the emitcontext, so that we resolve
13560 constants propertly.
13562 2003-07-02 Martin Baulig <martin@ximian.com>
13564 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13565 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13567 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13568 than emitting it here.
13570 * statement.cs: Fixed some more flow analysis bugs.
13572 2003-07-02 Martin Baulig <martin@ximian.com>
13574 * class.cs (MethodData.Define): When implementing interface
13575 methods, set Final unless we're Virtual.
13577 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
13578 check work for interface methods.
13580 2003-07-01 Martin Baulig <martin@ximian.com>
13582 * ecore.cs (EmitContext.This): Replaced this property with a
13583 GetThis() method which takes a Location argument. This ensures
13584 that we get the correct error location for a CS0188.
13586 2003-07-01 Miguel de Icaza <miguel@ximian.com>
13588 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13589 ImplicitStandardConversion.
13591 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13593 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
13595 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13598 2003-06-30 Miguel de Icaza <miguel@ximian.com>
13600 * class.cs (Constructor.Define): Turn off initlocals for unsafe
13603 (MethodData.Define): Turn off initlocals for unsafe methods.
13605 2003-06-29 Miguel de Icaza <miguel@ximian.com>
13607 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13608 complete; Fixes #37521.
13610 * delegate.cs: Use Modifiers.TypeAttr to compute the
13611 TypeAttributes, instead of rolling our own. This makes the flags
13612 correct for the delegates.
13614 2003-06-28 Miguel de Icaza <miguel@ximian.com>
13616 * class.cs (Constructor.Define): Set the private flag for static
13617 constructors as well.
13619 * cs-parser.jay (statement_expression): Set the return value to
13620 null, to avoid a crash when we catch an error.
13622 2003-06-24 Miguel de Icaza <miguel@ximian.com>
13624 * cs-parser.jay: Applied patch from Jackson that adds support for
13625 extern and unsafe modifiers to destructor declarations.
13627 * expression.cs: Report error 21 if the user is trying to index a
13630 * driver.cs: Add an error message, suggested by the bug report.
13632 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13633 if we do not have a ": this ()" constructor initializer. Fixes 45149
13635 2003-06-14 Miguel de Icaza <miguel@ximian.com>
13637 * namespace.cs: Add some information to reduce FAQs.
13639 2003-06-13 Miguel de Icaza <miguel@ximian.com>
13641 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13642 underlying enumeration types. Fixes #43915.
13644 * expression.cs: Treat ushort/short as legal values to be used in
13645 bitwise operations.
13647 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13649 * delegate.cs: transfer custom attributes for paramenters from
13650 the delegate declaration to Invoke and BeginInvoke.
13652 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13654 * attribute.cs: handle custom marshalers and emit marshal info
13657 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
13659 * makefile.gnu: Added anonymous.cs to the compiler sources.
13661 2003-05-28 Miguel de Icaza <miguel@ximian.com>
13663 * iterators.cs: Change the name of the proxy class to include two
13666 * cs-parser.jay: Update grammar to include anonymous methods.
13668 * anonymous.cs: new file.
13670 2003-05-27 Miguel de Icaza <miguel@ximian.com>
13672 * class.cs (Field.Define): Add missing test for pointers and
13675 2003-05-27 Ravi Pratap <ravi@ximian.com>
13677 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13678 we use the stobj opcode.
13680 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13681 since it wasn't the correct fix.
13683 It still is puzzling that we are required to use stobj for IntPtr
13684 which seems to be a ValueType.
13686 2003-05-26 Miguel de Icaza <miguel@ximian.com>
13688 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13689 during regular simple name resolution. Now, the trick is that
13690 instead of returning for processing the simplename, we do a
13691 TypeManager.LookupType (ie, a rooted lookup as opposed to a
13692 contextual lookup type). If a match is found, return that, if
13693 not, return for further composition.
13695 This fixes long-standing 30485.
13697 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13698 using the address to initialize an object, do an Stobj instead of
13699 using the regular Stelem.
13701 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13702 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13703 Because if we are a BaseIndexerAccess that value will be true.
13706 * statement.cs (GotoCase.Resolve): Return after reporting an
13707 error, do not attempt to continue.
13709 * expression.cs (PointerArithmetic.Emit): If our operand is a
13710 long, convert our constants to match the operand before
13711 multiplying. Convert to I type before adding. Fixes 43670.
13713 2003-05-14 Ravi Pratap <ravi@ximian.com>
13715 * enum.cs (ImplicitConversionExists) : Rename to
13716 ImplicitEnumConversionExists to remove ambiguity.
13718 * ecore.cs (NullCast): New type of cast expression class which
13719 basically is very similar to EmptyCast with the difference being
13720 it still is a constant since it is used only to cast a null to
13722 (eg. (string) null)
13724 * convert.cs (ImplicitReferenceConversion): When casting a null
13725 literal, we return a NullCast.
13727 * literal.cs (NullLiteralTyped): Remove - I don't see why this
13728 should be around anymore.
13730 The renaming (reported was slightly wrong). Corrections:
13732 ConvertImplicitStandard -> ImplicitConversionStandard
13733 ConvertExplicitStandard -> ExplicitConversionStandard
13735 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13736 before passing them in !
13738 * convert.cs (ImplicitConversionStandard): When comparing for
13739 equal expr and target types, ensure that expr is not a
13742 In general, we must not be checking (expr_type ==
13743 target_type) in the top level conversion methods
13744 (ImplicitConversion, ExplicitConversion etc). This checking is
13745 done in the methods that they delegate to.
13747 2003-05-20 Miguel de Icaza <miguel@ximian.com>
13749 * convert.cs: Move Error_CannotConvertType,
13750 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13751 ImplicitNumericConversion, ImplicitConversionExists,
13752 ImplicitUserConversionExists, StandardConversionExists,
13753 FindMostEncompassedType, FindMostSpecificSource,
13754 FindMostSpecificTarget, ImplicitUserConversion,
13755 ExplicitUserConversion, GetConversionOperators,
13756 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13757 TryImplicitIntConversion, Error_CannotConvertImplicit,
13758 ConvertImplicitRequired, ConvertNumericExplicit,
13759 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13760 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13763 Perform the following renames:
13765 StandardConversionExists -> ImplicitStandardConversionExists
13766 ConvertImplicit -> ImplicitConversion
13767 ConvertImplicitStandard -> ImplicitStandardConversion
13768 TryImplicitIntConversion -> ImplicitIntConversion
13769 ConvertImplicitRequired -> ImplicitConversionRequired
13770 ConvertNumericExplicit -> ExplicitNumericConversion
13771 ConvertReferenceExplicit -> ExplicitReferenceConversion
13772 ConvertExplicit -> ExplicitConversion
13773 ConvertExplicitStandard -> ExplicitStandardConversion
13775 2003-05-19 Martin Baulig <martin@ximian.com>
13777 * statement.cs (TypeInfo.StructInfo): Made this type protected.
13778 (TypeInfo): Added support for structs having structs as fields.
13780 * ecore.cs (FieldExpr): Implement IVariable.
13781 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13782 VariableInfo for the field.
13784 2003-05-18 Martin Baulig <martin@ximian.com>
13786 * expression.cs (This.DoResolve): Report a CS0027 if we're
13787 emitting a field initializer.
13789 2003-05-18 Martin Baulig <martin@ximian.com>
13791 * expression.cs (This.ResolveBase): New public function.
13792 (This.DoResolve): Check for CS0188.
13794 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13797 * ecore.cs (MethodGroupExpr.DoResolve): Set the
13798 `instance_expression' to null if we don't have any non-static
13801 2003-05-18 Martin Baulig <martin@ximian.com>
13803 Reworked the way how local variables and parameters are handled by
13804 the flow analysis code.
13806 * statement.cs (TypeInfo, VariableMap): New public classes.
13807 (VariableInfo): New public class. This is now responsible for
13808 checking whether a variable has been assigned. It is used for
13809 parameters and local variables.
13810 (Block.EmitMeta): Take the InternalParameters as argument; compute
13811 the layout of the flow vectors here.
13812 (Block.LocalMap, Block.ParameterMap): New public properties.
13813 (FlowBranching): The .ctor doesn't get the InternalParameters
13814 anymore since Block.EmitMeta() now computes the layout of the flow
13816 (MyStructInfo): This class is now known as `StructInfo' and nested
13817 in `TypeInfo'; we don't access this directly anymore.
13819 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
13820 property and removed IsAssigned(), IsFieldAssigned(),
13821 SetAssigned() and SetFieldAssigned(); we now call them on the
13822 VariableInfo so we don't need to duplicate this code everywhere.
13824 * expression.cs (ParameterReference): Added `Block block' argument
13826 (LocalVariableReference, ParameterReference, This): The new
13827 VariableInfo class is now responsible for all the definite
13830 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
13831 IsParameterAssigned, SetParameterAssigned): Removed.
13833 2003-05-18 Martin Baulig <martin@ximian.com>
13835 * typemanager.cs (InitCoreTypes): Try calling
13836 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
13837 the 3-args-version. Corlib now also needs our `void_type'.
13838 (GetMethod): Added overloaded version which takes an optional
13839 `bool report_errors' to allow lookups of optional methods.
13841 2003-05-12 Martin Baulig <martin@ximian.com>
13843 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
13844 only used for locals and not for parameters.
13846 2003-05-12 Miguel de Icaza <miguel@ximian.com>
13848 * support.cs (InternalParameters.ParameterType): Return the
13849 ExternalType of the parameter.
13851 * parameter.cs (Parameter.ExternalType): drop the two arguments,
13854 2003-05-11 Miguel de Icaza <miguel@ximian.com>
13856 * class.cs (MethodData.Define): Do not set the `newslot' on
13857 interface members, if they are also flagged as "override".
13859 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
13860 better code for ++i and i++. This only works for static fields
13861 and local variables.
13863 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
13864 want to pull the DeclSpace out of the builder_to_declspace instead
13865 of the TypeBuilder (like in TypeContainer.FindMembers).
13867 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
13868 instead of LookupTypeContainer. Fixes the crash on .NET for
13869 looking up interface members.
13871 * const.cs: Create our own emit context during the Definition
13872 stage, so that constants are evaluated in the proper context, when
13873 a recursive definition happens.
13875 2003-05-11 Martin Baulig <martin@ximian.com>
13877 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
13878 new block for a switch section.
13879 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
13880 the adding/lookup in the switch block. Fixes #39828.
13882 2003-05-09 Miguel de Icaza <miguel@ximian.com>
13884 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
13885 functionality: I needed to convert the data after I had performed
13886 the add/sub operation into the operands type size.
13888 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
13889 pass the type for the box operation, otherwise the resulting
13890 object would have been of type object.
13892 (BoxedCast): Add constructor to specify the type to box as.
13894 2003-05-07 Miguel de Icaza <miguel@ximian.com>
13896 * iterators.cs: I was reusing the `count' variable inadvertently,
13897 take steps to not allow this to happen.
13899 2003-05-06 Miguel de Icaza <miguel@ximian.com>
13901 * attribute.cs (Attribute.Resolve): Params attributes are encoded
13902 by creating an array at the point where the params starts and
13903 putting all those arguments there, then adjusting the size of the
13906 2003-05-05 Miguel de Icaza <miguel@ximian.com>
13908 * expression.cs (New.AddressOf): Implement interface
13909 IMemoryLocation. This is used when the `new' operator is used in
13910 the context of an invocation to a method on a value type.
13912 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
13915 * namespace.cs: Also check the using aliases here.
13917 * driver.cs: Move the test for using validity after the types have
13918 been entered, so we do a single pass that also includes the using
13921 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
13922 in the regular case. CreateSiblingForFinally is doing extra
13925 * attribute.cs (GetAttributeArgumentExpression): Store the result
13926 on an out value, and use the return value to indicate failure
13927 instead of using null (which is a valid return for Constant.GetValue).
13929 * statement.cs: Perform the analysis flow for the increment
13930 portion after the statement, because this will be the real flow of
13931 execution. Fixes #42385
13933 * codegen.cs (EmitContext.EmitArgument,
13934 EmitContext.EmitStoreArgument): New helper functions when the
13935 RemapToProxy flag is set.
13937 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
13940 Add support for remapping parameters.
13942 * iterators.cs: Propagate parameter values; Store parameter
13943 values in the proxy classes.
13945 2003-05-04 Miguel de Icaza <miguel@ximian.com>
13947 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
13948 need a proxy reference; I do not know what I was thinking
13950 * cs-parser.jay (constructor_initializer): catch another error,
13951 and display nice message.
13953 (field_declaration): catch void field declaration
13954 to flag a better error.
13956 * class.cs (MemberBase.CheckBase): Report an error instead of a
13957 warning if a new protected member is declared in a struct.
13958 (Field.Define): catch the error of readonly/volatile.
13960 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
13962 (FieldExpr.AddressOf): ditto. Catch error where the address of a
13963 volatile variable is taken
13965 2003-05-02 Miguel de Icaza <miguel@ximian.com>
13967 * statement.cs (Fixed.Resolve): Report an error if we are not in
13970 2003-05-01 Miguel de Icaza <miguel@ximian.com>
13972 * typemanager.cs: reuse the code that handles type clashes for
13973 delegates and enumerations.
13975 * class.cs (Report28): Always report.
13977 * expression.cs (EncodeAsAttribute): Allow nulls here.
13979 2003-04-28 Miguel de Icaza <miguel@ximian.com>
13981 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
13982 the functionality for testing whether an expression is valid for
13983 an attribute here. Also handle the case of arrays of elements
13986 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
13987 encoding a linear array into an array of objects that are suitable
13988 to be passed to an CustomAttributeBuilder.
13990 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
13992 * ecore.cs: (FieldExpr): Handle field remapping here.
13994 * iteratators.cs: Pass the instance variable (if the method is an
13995 instance method) to the constructors, so we can access the field
13996 variables on the class.
13998 TODO: Test this with structs. I think the THIS variable on
13999 structs might have to be a pointer, and not a refenrece
14001 2003-04-27 Miguel de Icaza <miguel@ximian.com>
14003 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
14004 local variables to fields in a proxy class.
14006 * iterators.cs (PopulateProxy): Rename our internal fields to
14008 Create a <THIS> field if we are an instance method, so we can
14009 reference our parent container variables.
14010 (MapVariable): Called back from the EmitContext code to enter a
14011 new variable to field mapping into the proxy class (we just create
14015 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
14016 for using the remapped locals to fields.
14018 I placed the code here, because that gives the same semantics to
14019 local variables, and only changes the Emit code.
14021 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
14022 statements inside iterators.
14023 (VariableInfo): Add a FieldBuilder for the cases when we are
14024 remapping local variables to fields in a proxy class
14026 * ecore.cs (SimpleNameResolve): Avoid testing two times for
14027 current_block != null.
14029 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
14030 not cope with strings, as it has been moved to the
14031 TableSwitchEmit. Fixed bug in switch generation.
14033 * expression.cs (New.DoResolve): Provide more context for the user
14034 when reporting an error.
14036 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
14039 * expression.cs (MemberAccess.DoResolve): When we get a type back,
14040 check the permissions for it. Note than in a type-resolution
14041 context the check was already present in DeclSpace.ResolveType,
14042 but was missing from the MemberAccess.
14044 (ArrayCreation.CheckIndices): warn if the user has
14045 more nested levels of expressions, but there are no more
14046 dimensions specified. Avoids crash on bug 41906.
14048 2003-04-26 Miguel de Icaza <miguel@ximian.com>
14050 * statement.cs (Block): replace Implicit bool, for a generic
14052 New flag: `Unchecked'. This is used during the EmitMeta phase
14053 (which is out-of-line with the regular Resolve/Emit process for a
14054 statement, as this is done ahead of time, but still gets a chance
14055 to call constant resolve).
14057 (Block.Flags): new enum for adding a new flag.
14059 (Block.EmitMeta): track the state of unchecked.
14061 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
14062 to enable constant resolution to work there as well.
14064 2003-04-22 Miguel de Icaza <miguel@ximian.com>
14066 * typemanager.cs (ienumerable_type): Also look up
14067 System.Collections.IEnumerable.
14069 2003-04-21 Miguel de Icaza <miguel@ximian.com>
14071 TODO: Test more than one conditional per method.
14073 * class.cs (Indexer.Define): Report the location where the user is
14074 referencing the unsupported feature.
14076 (MethodData): Overload the use of `conditionals' to
14077 minimize the creation of needless ArrayLists. This saves roughly
14078 212kb on my machine.
14080 (Method): Implement the new IIteratorContainer interface.
14081 (Method.SetYields): Implement the method by setting the ModFlags
14082 to contain METHOD_YIELDS.
14084 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
14085 which just got set to null.
14087 * iterators.cs: New file.
14089 (Yield, YieldBreak): New statements.
14091 * statement.cs (Return.Resolve): Flag an error if we are used in
14092 an iterator method.
14094 * codegen.cs (InIterator): New flag set if the code is being
14095 compiled in an iterator method.
14097 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
14098 internal modifier, and we just use it to avoid adding extra
14099 fields, as this is seldom used.
14101 * cs-parser.jay: Add yield_statement (yield and yield break).
14103 * driver.cs: New flag -v2 to turn on version 2 features.
14105 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
14106 hashtable when v2 is enabled.
14108 2003-04-20 Miguel de Icaza <miguel@ximian.com>
14110 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
14111 there is already a namespace defined with this name.
14113 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
14114 people upgraded their corlibs.
14116 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
14117 always use fully qualified types, no need to use the compiler
14120 (TypeManager.IsNamespace): Use binarysearch.
14122 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
14123 AddDelegate): I did not quite use the new IsValid API properly: I
14124 have to pass the short-name and the fullname. I was passing only
14125 the basename instead of the fullname sometimes.
14127 (TypeContainer.DefineType): call NamespaceClash.
14129 * interface.cs (Interface.DefineType): use NamespaceClash before
14132 * delegate.cs (Delegate.DefineType): use NamespaceClash before
14135 * enum.cs: (Enum.DefineType): use NamespaceClash before
14138 * typemanager.cs (: 3-line patch that gives us some tasty 11%
14139 speed increase. First, use the negative_hits cache when we get a
14140 negative. Second, add the type with its full original name
14141 instead of the new . and + encoded name (reflection uses + to
14142 separate type from a nested type). Use LookupTypeReflection
14143 directly which bypasses the type->name hashtable (that we already
14144 know does not contain the type.
14146 * decl.cs (DeclSpace.ResolveTypeExpr): track the
14147 location/container type.
14149 * driver.cs: When passing utf8, use directly the UTF8Encoding.
14151 2003-04-19 Miguel de Icaza <miguel@ximian.com>
14153 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
14155 * delegate.cs (NewDelegate.Resolve): Test whether an instance
14156 method is being referenced in the method group from a static
14157 context, and report error 120 if so.
14159 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
14162 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
14163 is created, we create the A namespace).
14165 * cs-parser.jay: A namespace also introduces a DeclarationFound.
14168 2003-04-18 Miguel de Icaza <miguel@ximian.com>
14170 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
14171 invocation to ModuleBuilder.GetType with the same values will
14172 return a new type instance, so we need to cache its return
14175 * expression.cs (Binary.ResolveOperator): Only allow the compare
14176 operators on enums if they are of the same type.
14178 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
14179 types of ValueType on their own case. Before we were giving them
14180 the same treatment as objects.
14182 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
14183 fullname. Short name is used to compare against container name.
14184 Fullname is used to check against defined namespace names.
14186 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
14187 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
14189 (Method.CheckBase): Call parent.
14190 (MemberBase.CheckBase): Check for protected members on sealed
14192 (PropertyBase.CheckBase): Call parent.
14193 (Field.Define): Call parent.
14195 * report.cs: Negative error codes are now mapped to 8000 - code,
14196 so that the display is render more nicely.
14198 * typemanager.cs: Do not use try/catch, instead report a regular
14201 (GetPointerType, GetReferenceType): These methods provide
14202 mechanisms to obtain the T* and T& from a T. We had the code
14203 previously scattered around the code base, and it also used
14204 TypeManager.LookupType that would go through plenty of caches.
14205 This one goes directly to the type source.
14207 In some places we did the Type.GetType followed by
14208 ModuleBuilder.GetType, but not in others, so this unifies the
14209 processing as well.
14211 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14212 statements now that we have namespace information.
14214 * typemanager.cs (IsNamespace): New method, returns whether the
14215 string presented is a namespace or not.
14217 (ComputeNamespaces): New public entry point, computes the list of
14218 available namespaces, using the GetNamespaces API call in Mono, or
14219 the slower version in MS.NET.
14221 Now before we start the semantic analysis phase, we have a
14222 complete list of namespaces including everything that the user has
14225 Deleted old code to cache namespaces in .nsc files.
14227 2003-04-17 Miguel de Icaza <miguel@ximian.com>
14229 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14230 class/struct location definition Location for the implicit
14231 constructor location.
14233 (Operator.Define): Use the location of the operator for the
14234 implicit Method definition.
14236 (Constructor.Emit): use the constructor location for the implicit
14237 base initializer constructor.
14239 * ecore.cs: Remove ITypeExpression. This interface is now gone,
14240 and the Expression class now contains two new methods:
14242 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
14243 isolate type lookup from the rest of the resolution process.
14245 Since we use Expressions to hold type definitions due to the way
14246 we parse the input we have historically overloaded Resolve to
14247 perform the Type lookups if a special flag is passed. Now this is
14248 eliminated and two methods take their place.
14250 The differences in the two methods between xStep and xTerminal is
14251 that xStep is involved in our current lookup system that uses
14252 SimpleNames to compose a name, while xTerminal is used just to
14253 catch the case where the simplename lookup failed.
14255 2003-04-16 Miguel de Icaza <miguel@ximian.com>
14257 * expression.cs (ResolveMemberAccess): Remove redundant code.
14258 TypeExpr expressions are always born fully resolved.
14260 * interface.cs (PopulateMethod): Do not lookup the types twice.
14261 We were doing it once during SemanticAnalysis and once during
14264 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
14265 in local variable type definitions, were being returned as a
14266 SimpleName (we decomposed everything into a string), that is
14267 because primary_expression was being used instead of a type in the
14268 grammar (reduce/reduce conflicts).
14270 The part that was wrong is that we converted the expression into a
14271 string (an oversimplification in one hand, compounded with primary
14272 expressions doing string concatenation).
14278 Would return "A.B.C[]" as a SimpleName. This stopped things like
14279 using clauses from working on this particular context. And a type
14280 was being matched directly against "A.B.C[]".
14282 We now use the correct approach, and allow for ComposedCast to be
14283 part of the unary expression. So the "A.B.C []" become a composed
14284 cast of "A.B.C" (as a nested group of MemberAccess with a
14285 SimpleName at the end) plus the rank composition "[]".
14289 2003-04-10 Miguel de Icaza <miguel@ximian.com>
14291 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
14292 for the access level checking.
14294 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
14295 `TypeContainer container', because I kept getting confused when I
14296 was debugging this code.
14298 * expression.cs (Indexers): Instead of tracking getters/setters,
14299 we now track them in parallel. We create one arraylist less, but
14300 most importantly it is possible now for the LValue code to find a
14301 matching get for a set.
14303 (IndexerAccess.DoResolveLValue): Update the code.
14304 GetIndexersForType has been modified already to extract all the
14305 indexers from a type. The code assumed it did not.
14307 Also make the code set the correct return type for the indexer.
14308 This was fixed a long time ago for properties, but was missing for
14309 indexers. It used to be void_type.
14311 (Binary.Emit): Test first for doubles instead of
14312 floats, as they are more common.
14314 (Binary.EmitBranchable): Use the .un version of the branch opcodes
14315 when dealing with floats and the <=, >= operators. This fixes bug
14318 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14319 to load the array value by emitting a load on the foreach variable
14320 type. This was incorrect.
14322 We now emit the code to load an element using the the array
14323 variable type, and then we emit the conversion operator.
14327 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
14329 * attribute.cs: Avoid allocation of ArrayLists in the common case.
14331 2003-04-09 Miguel de Icaza <miguel@ximian.com>
14333 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14334 test for protection before we test for signatures.
14336 (MethodSignature.ToString): implement.
14338 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14339 to the case where we reduced into a LongConstant.
14341 * decl.cs (CheckAccessLevel): If the type is an array, we can not
14342 depend on whether the information is acurrate, because the
14343 Microsoft runtime will always claim that the array type is public,
14344 regardless of the real state.
14346 If the type is a pointer, another problem happens: the type is
14347 reported as non-public in Microsoft.
14349 In both cases we have to call CheckAccessLevel recursively with
14350 the underlying type as the argument to be tested.
14352 2003-04-08 Miguel de Icaza <miguel@ximian.com>
14354 * assign.cs (Assign.Emit): If we are dealing with a compound
14355 assignment expression, we should use the code path that stores the
14356 intermediate result in a temporary value. This fixes #40903.
14358 *expression.cs (Indirection.ToString): Provide ToString method for
14361 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
14363 * class.cs: Null out fields holding references to Block objects so
14364 they can be garbage collected.
14366 * expression.cs (OverloadResolve): Remove unused local.
14368 2003-04-07 Martin Baulig <martin@ximian.com>
14370 * codegen.cs (EmitContext.CurrentFile): New public field.
14371 (EmitContext.Mark): Use the CurrentFile to check whether the
14372 location is in the correct file.
14373 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14375 2003-04-07 Martin Baulig <martin@ximian.com>
14377 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14379 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14380 location. [FIXME: The location argument which gets passed to this
14381 method is sometimes wrong!]
14383 2003-04-07 Nick Drochak <ndrochak@gol.com>
14385 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14387 2003-04-07 Miguel de Icaza <miguel@ximian.com>
14389 * expression.cs (Indirection.EmitAssign): We were using the
14390 temporary, but returning immediately instead of continuing the
14393 2003-04-06 Martin Baulig <martin@ximian.com>
14395 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14396 if it's a nested child, but also deriving from the outer class.
14399 * typemanager.cs (IsNestedChildOf): Make this work if it's a
14400 nested child, but also deriving from the outer class. See
14402 (FilterWithClosure): We may access private members of the outer
14403 class if we're a nested child and deriving from the outer class.
14404 (RealMemberLookup): Only set `closure_private_ok' if the
14405 `original_bf' contained BindingFlags.NonPublic.
14407 2003-04-05 Martin Baulig <martin@ximian.com>
14409 * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
14410 probe if its a type parameter, and if so, flag an error.
14412 * decl.cs: Move here the SetParameterInfo code from class.cs.
14413 Handle IsGeneric here.
14415 Handle a variety of errors in the parameter info definition.
14417 * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
14418 type parameters here.
14420 * cs-parser.jay (class_declaration): report errors for parameters
14423 2003-01-21 Miguel de Icaza <miguel@ximian.com>
14425 * generic.cs: New file, contains support code for generics.
14427 * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
14428 OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
14430 Update parser for the above removals.
14432 * cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
14433 now taken care of in the parser.
14435 2003-04-02 Miguel de Icaza <miguel@ximian.com>
14437 * class.cs (Event.Define): Do not allow abstract events to have
14440 2003-04-01 Miguel de Icaza <miguel@ximian.com>
14442 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14443 block in event declarations.
14445 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14446 value type, get its address.
14448 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14449 leaving a class on the stack instead of a boolean value (int
14450 0/1). Change the code so we compare against null, and then the
14451 result against zero.
14453 * class.cs (TypeContainer.GetClassBases): We were checking for the
14454 parent class being sealed too late.
14456 * expression.cs (Binary.Emit): For <= and >= when dealing with
14457 floating point values, use cgt.un and clt.un instead of cgt and
14460 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
14462 * statement.cs: Apply the same optimization as MS: skip the
14463 GetEnumerator returning an IEnumerator, and use the one returning a
14464 CharEnumerator instead. This allows us to avoid the try-finally block
14467 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
14469 * cs-parser.jay: Attributes cannot be applied to
14470 namespaces. Fixes #40473
14472 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14475 (Add*): check if the name is valid using the full name for constants,
14476 fields, properties and events.
14478 2003-03-28 Miguel de Icaza <miguel@ximian.com>
14480 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
14481 char constants to be part of the enumeration.
14483 * expression.cs (Conditional.DoResolve): Add support for operator
14484 true. Implements the missing functionality from 14.12
14486 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
14487 operator true/false as required by the spec.
14489 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
14490 implicit conversion to boolean.
14492 * statement.cs (Statement.ResolveBoolean): A boolean expression is
14493 also one where the type implements `operator true'.
14495 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
14496 get an expression that will invoke operator true based on an
14499 (GetConversionOperators): Removed the hack that called op_True
14502 (Expression.ResolveBoolean): Move this from Statement.
14504 2003-03-17 Miguel de Icaza <miguel@ximian.com>
14506 * ecore.cs (FieldExpr): do not allow initialization of initonly
14507 fields on derived classes
14509 2003-03-13 Martin Baulig <martin@ximian.com>
14511 * statement.cs (Block.Emit): Call ig.BeginScope() and
14512 ig.EndScope() when compiling with debugging info; call
14513 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14515 2003-03-08 Miguel de Icaza <miguel@ximian.com>
14517 * expression.cs (Indexers): Do not construct immediately, allow
14518 for new members to be appended as we go. Fixes 38143
14520 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14522 * expression.cs: save/restore context when resolving an unchecked
14525 2003-03-05 Miguel de Icaza <miguel@ximian.com>
14527 * cfold.cs: Catch division by zero in modulus operator during
14530 2003-03-03 Miguel de Icaza <miguel@ximian.com>
14532 * interface.cs (Interface.DefineMembers): Avoid defining members
14535 2003-02-27 Miguel de Icaza <miguel@ximian.com>
14537 * driver.cs: handle the +/- options for -noconfig
14539 * statement.cs (Unckeched.Resolve): Also track the state of
14540 unchecked in the Resolve phase.
14542 2003-02-27 Martin Baulig <martin@ximian.com>
14544 * ecore.cs (Expression.MemberLookup): Don't create a
14545 MethodGroupExpr for something which is not a method. Fixes #38291.
14547 2003-02-25 Miguel de Icaza <miguel@ximian.com>
14549 * class.cs (MemberBase.CheckParameters): Also check that the type
14550 is unmanaged if it is a pointer.
14552 * expression.cs (SizeOf.Resolve): Add location information.
14554 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14555 a managed type is declared.
14557 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14558 parameter modifiers as well. Fixes bug 38606
14560 * class.cs: Very sad. Am backing out the speed up changes
14561 introduced by the ArrayList -> Array in the TypeContainer, as they
14562 were not actually that much faster, and introduced a bug (no error
14563 reports on duplicated methods).
14565 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14566 source first, this will guarantee that we have a valid expression
14567 before calling in lower levels functions that will require a
14568 resolved object. Then use this original_source in the
14569 target.ResolveLValue instead of the original source that was
14572 Another change. Use target.Resolve instead of LValueResolve.
14573 Although we are resolving for LValues, we will let the Assign code
14574 take care of that (it will be called again from Resolve). This
14575 basically allows code like this:
14577 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14578 class Y { void A (X x) { x [0] += o; }
14580 The problem was that the indexer was trying to resolve for
14581 set_Item (idx, object o) and never finding one. The real set_Item
14582 was set_Item (idx, X). By delaying the process we get the right
14587 2003-02-23 Martin Baulig <martin@ximian.com>
14589 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14590 while calling DoEmit ().
14592 * codegen.cs (EmitContext.Mark): Don't mark locations in other
14593 source files; if you use the #line directive inside a method, the
14594 compiler stops emitting line numbers for the debugger until it
14595 reaches the end of the method or another #line directive which
14596 restores the original file.
14598 2003-02-23 Martin Baulig <martin@ximian.com>
14600 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14602 2003-02-23 Martin Baulig <martin@ximian.com>
14604 * statement.cs (Block.AddChildVariableNames): We need to call this
14605 recursively, not just for our immediate children.
14607 2003-02-23 Martin Baulig <martin@ximian.com>
14609 * class.cs (Event.Define): Always make the field private, like csc does.
14611 * typemanager.cs (TypeManager.RealMemberLookup): Make events
14612 actually work, fixes bug #37521.
14614 2003-02-23 Miguel de Icaza <miguel@ximian.com>
14616 * delegate.cs: When creating the various temporary "Parameters"
14617 classes, make sure that we call the ComputeAndDefineParameterTypes
14618 on those new parameters (just like we do with the formal ones), to
14619 allow them to be resolved in the context of the DeclSpace.
14621 This fixes the bug that Dick observed in Bugzilla #38530.
14623 2003-02-22 Miguel de Icaza <miguel@ximian.com>
14625 * expression.cs (ResolveMemberAccess): When resolving a constant,
14626 do not attempt to pull a constant if the value was not able to
14627 generate a valid constant.
14629 * const.cs (LookupConstantValue): Do not report more errors than required.
14631 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14633 * expression.cs: fixes bug #38328.
14635 2003-02-18 Miguel de Icaza <miguel@ximian.com>
14637 * class.cs: Changed all the various members that can be part of a
14638 class from being an ArrayList to be an Array of the right type.
14639 During the DefineType type_list, interface_list, delegate_list and
14640 enum_list are turned into types, interfaces, delegates and enums
14643 And during the member population, indexer_list, event_list,
14644 constant_list, field_list, instance_constructor_list, method_list,
14645 operator_list and property_list are turned into their real arrays.
14647 Although we could probably perform this operation earlier, for
14648 good error reporting we need to keep the lists and remove the
14649 lists for longer than required.
14651 This optimization was triggered by Paolo profiling the compiler
14652 speed on the output of `gen-sample-program.pl' perl script.
14654 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14655 not crash in methods like MemberLookupFailed that use this field.
14657 This problem arises when the compiler fails to resolve a type
14658 during interface type definition for example.
14660 2003-02-18 Miguel de Icaza <miguel@ximian.com>
14662 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14663 inherit from System.Object, so we have to stop at null, not only
14664 when reaching System.Object.
14666 2003-02-17 Miguel de Icaza <miguel@ximian.com>
14668 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14669 DeclaredOnly because the parent indexer might have had a different
14670 name, but did not loop until the top of the hierarchy was reached.
14672 The problem this one fixes is 35492: when a class implemented an
14673 indexer from an interface, we were getting the interface method
14674 (which was abstract) and we were flagging an error (can not invoke
14677 This also keeps bug 33089 functioning, and test-148 functioning.
14679 * typemanager.cs (IsSpecialMethod): The correct way of figuring
14680 out if a method is special is to see if it is declared in a
14681 property or event, or whether it is one of the predefined operator
14682 names. This should fix correctly #36804.
14684 2003-02-15 Miguel de Icaza <miguel@ximian.com>
14686 The goal here is to remove the dependency on EmptyCast.Peel ().
14687 Killing it completely.
14689 The problem is that currently in a number of places where
14690 constants are expected, we have to "probe" for an EmptyCast, and
14691 Peel, which is not the correct thing to do, as this will be
14692 repetitive and will likely lead to errors.
14694 The idea is to remove any EmptyCasts that are used in casts that
14695 can be reduced to constants, so we only have to cope with
14698 This bug hunt was triggered by Bug 37363 and the desire to remove
14699 the duplicate pattern where we were "peeling" emptycasts to check
14700 whether they were constants. Now constants will always be
14703 * ecore.cs: Use an enumconstant here instead of wrapping with
14706 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14707 throwing me off. By handling this we can get rid of a few hacks.
14709 * statement.cs (Switch): Removed Peel() code.
14711 2003-02-14 Miguel de Icaza <miguel@ximian.com>
14713 * class.cs: Location information for error 508
14715 * expression.cs (New.DoResolve): Add a guard against double
14716 resolution of an expression.
14718 The New DoResolve might be called twice when initializing field
14719 expressions (see EmitFieldInitializers, the call to
14720 GetInitializerExpression will perform a resolve on the expression,
14721 and later the assign will trigger another resolution
14723 This leads to bugs (#37014)
14725 * delegate.cs: The signature for EndInvoke should contain any ref
14726 or out parameters as well. We were not doing this in the past.
14728 * class.cs (Field.Define): Do not overwrite the type definition
14729 inside the `volatile' group. Turns out that volatile enumerations
14730 were changing the type here to perform a validity test, which
14733 2003-02-12 Miguel de Icaza <miguel@ximian.com>
14735 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14736 and structs, we do not want to load the instance variable
14738 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14739 enum_type has to be handled like an object reference (implicit
14740 conversions exists from this to object), but the regular IsClass
14741 and IsValueType tests will never return true for this one.
14743 Also we use TypeManager.IsValueType instead of type.IsValueType,
14744 just for consistency with the rest of the code (this is only
14745 needed if we ever use the construct exposed by test-180.cs inside
14746 corlib, which we dont today).
14748 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
14750 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14753 2003-02-09 Martin Baulig <martin@ximian.com>
14755 * namespace.cs (Namespace..ctor): Added SourceFile argument.
14756 (Namespace.DefineNamespaces): New static public method; this is
14757 called when we're compiling with debugging to add all namespaces
14758 to the symbol file.
14760 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14761 pass it to the Namespace's .ctor.
14763 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14764 and MethodBase arguments; pass the namespace ID to the symwriter;
14765 pass the MethodBase instead of the token to the symwriter.
14766 (SymbolWriter.DefineNamespace): New method to add a namespace to
14769 2003-02-09 Martin Baulig <martin@ximian.com>
14771 * symbolwriter.cs: New file. This is a wrapper around
14772 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
14773 methods here in near future.
14775 2003-02-09 Martin Baulig <martin@ximian.com>
14777 * codegen.cs (EmitContext.Mark): Just pass the arguments to
14778 ILGenerator.MarkSequencePoint() which are actually used by the
14781 2003-02-09 Martin Baulig <martin@ximian.com>
14783 * location.cs (SourceFile): New public sealed class. This
14784 contains the name and an index which is used in the location's token.
14785 (Location): Reserve an appropriate number of bits in the token for
14786 the source file instead of walking over that list, this gives us a
14787 really huge performance improvement when compiling with debugging.
14789 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14790 `SourceFile' argument instead of a string.
14791 (Driver.ProcessFile): Add all the files via Location.AddFile(),
14792 but don't parse/tokenize here, we need to generate the list of all
14793 source files before we do that.
14794 (Driver.ProcessFiles): New static function. Parses/tokenizes all
14797 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14798 instead of a string.
14800 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
14803 2003-02-09 Martin Baulig <martin@ximian.com>
14805 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
14806 filename on `#line default'.
14808 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
14810 * statement.cs: don't clear the pinned var when the fixed statement
14811 returns from the method (fixes bug#37752).
14813 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
14815 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
14818 2003-02-07 Martin Baulig <martin@ximian.com>
14820 * driver.cs: Removed the `--debug-args' command line argument.
14822 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
14823 automatically by the AsssemblyBuilder.
14824 (CodeGen.InitializeSymbolWriter): We don't need to call any
14825 initialization function on the symbol writer anymore. This method
14826 doesn't take any arguments.
14828 2003-02-03 Miguel de Icaza <miguel@ximian.com>
14830 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
14831 from referenced assemblies as well.
14833 2003-02-02 Martin Baulig <martin@ximian.com>
14835 * class.cs (MethodData.Emit): Generate debugging info for external methods.
14837 2003-02-02 Martin Baulig <martin@ximian.com>
14839 * class.cs (Constructor.Emit): Open the symbol writer before
14840 emitting the constructor initializer.
14841 (ConstructorInitializer.Emit): Call ec.Mark() to allow
14842 single-stepping through constructor initializers.
14844 2003-01-30 Miguel de Icaza <miguel@ximian.com>
14846 * class.cs: Handle error 549: do not allow virtual methods in
14849 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
14851 * decl.cs: Check access levels when resolving types
14853 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
14855 * statement.cs: Add parameters and locals set in catch blocks that might
14856 return to set vector
14858 2003-01-29 Miguel de Icaza <miguel@ximian.com>
14860 * class.cs (Operator): Set the SpecialName flags for operators.
14862 * expression.cs (Invocation.DoResolve): Only block calls to
14863 accessors and operators on SpecialName methods.
14865 (Cast.TryReduce): Handle conversions from char constants.
14868 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
14870 * statement.cs: small memory and time optimization in FlowBranching.
14872 2003-01-28 Pedro Mart <yoros@wanadoo.es>
14874 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
14875 problem that the last fix but in the other sid (Set).
14877 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
14878 access when there is no indexer in the hierarchy.
14880 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
14882 * class.cs: Combine some if statements.
14884 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14886 * driver.cs: fixed bug #37187.
14888 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
14890 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
14891 any indexer, it's needed to build a list with all the indexers in the
14892 hierarchy (AllGetters), else we have problems. Fixes #35653.
14894 2003-01-23 Miguel de Icaza <miguel@ximian.com>
14896 * class.cs (MethodData.Define): It is wrong for an interface
14897 implementation to be static in both cases: explicit and implicit.
14898 We were only handling this in one case.
14900 Improve the if situation there to not have negations.
14902 * class.cs (Field.Define): Turns out that we do not need to check
14903 the unsafe bit on field definition, only on usage. Remove the test.
14905 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14907 * driver.cs: use assembly.Location instead of Codebase (the latest
14908 patch made mcs fail when using MS assemblies).
14910 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
14912 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
14913 get the path to *corlib.dll.
14915 2003-01-21 Nick Drochak <ndrochak@gol.com>
14919 * typemanager.cs: Remove compiler warnings
14921 2003-01-20 Duncan Mak <duncan@ximian.com>
14923 * AssemblyInfo.cs: Bump the version number to 0.19.
14925 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14927 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
14929 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
14931 * class.cs (Constructor::Emit): Emit debugging info for constructors.
14933 2003-01-17 Miguel de Icaza <miguel@ximian.com>
14935 * cs-parser.jay: Small fix: we were not comparing the constructor
14936 name correctly. Thanks to Zoltan for the initial pointer.
14938 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
14940 * cs-tokenizer.cs: Set file name when specified with #line
14942 2003-01-15 Miguel de Icaza <miguel@ximian.com>
14944 * cs-parser.jay: Only perform the constructor checks here if we
14945 are named like the class; This will help provider a better
14946 error. The constructor path is taken when a type definition is
14947 not found, but most likely the user forgot to add the type, so
14948 report that rather than the constructor error.
14950 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
14952 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
14955 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14957 * cs-parser.jay: Add cleanup call.
14959 2003-01-13 Duncan Mak <duncan@ximian.com>
14961 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
14962 consistent with other methods.
14964 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
14966 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
14968 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
14970 * attribute.cs: only set GuidAttr to true when we have a
14973 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14977 * typemanager.cs: fixes to allow mcs compile corlib with the new
14978 Type.IsSubclassOf fix.
14980 2003-01-08 Miguel de Icaza <miguel@ximian.com>
14982 * expression.cs (LocalVariableReference.DoResolve): Classify a
14983 constant as a value, not as a variable. Also, set the type for
14986 * cs-parser.jay (fixed_statement): take a type instead of a
14987 pointer_type, so we can produce a better error message later.
14989 * statement.cs (Fixed.Resolve): Flag types that are not pointers
14992 (For.DoEmit): Make inifinite loops have a
14993 non-conditional branch back.
14995 (Fixed.DoEmit): First populate the pinned variables, then emit the
14996 statement, then clear the variables. Before I was emitting the
14997 code once for each fixed piece.
15000 2003-01-08 Martin Baulig <martin@ximian.com>
15002 * statement.cs (FlowBranching.MergeChild): A break in a
15003 SWITCH_SECTION does not leave a loop. Fixes #36155.
15005 2003-01-08 Martin Baulig <martin@ximian.com>
15007 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
15008 lives in the same number space than `param_map'. Fixes #36154.
15010 2003-01-07 Miguel de Icaza <miguel@ximian.com>
15012 * cs-parser.jay (constructor_declaration): Set the
15013 Constructor.ModFlags before probing for it. This makes the
15014 compiler report 514, 515 and 132 (the code was there, but got
15017 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
15018 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
15019 (GotoCase.Resolve): Set `Returns' to ALWAYS.
15021 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
15023 * enum.cs: create the enum static fields using the enum type.
15025 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
15027 * class.cs: don't try to create the ParamBuilder for the return
15028 type if it's not needed (and handle it breaking for the ms runtime
15031 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
15033 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
15035 2002-12-29 Miguel de Icaza <miguel@ximian.com>
15037 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
15038 the command. This showed up while compiling the JANET source
15039 code, which used \r as its only newline separator.
15041 2002-12-28 Miguel de Icaza <miguel@ximian.com>
15043 * class.cs (Method.Define): If we are an operator (because it
15044 reuses our code), then set the SpecialName and HideBySig. #36128
15046 2002-12-22 Miguel de Icaza <miguel@ximian.com>
15048 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
15049 exception, report error 120 `object reference required'.
15051 * driver.cs: Add --pause option, used during to measure the size
15052 of the process as it goes with --timestamp.
15054 * expression.cs (Invocation.DoResolve): Do not allow methods with
15055 SpecialName to be invoked.
15057 2002-12-21 Miguel de Icaza <miguel@ximian.com>
15059 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
15060 number before adding it.
15062 2002-12-21 Ravi Pratap <ravi@ximian.com>
15064 * ecore.cs (StandardImplicitConversion): When in an unsafe
15065 context, we allow conversion between void * to any other pointer
15066 type. This fixes bug #35973.
15068 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
15070 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
15071 is not thrown when extensionless outputs are used
15073 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15075 * rootcontext.cs: fixed compilation of corlib.
15077 2002-12-19 Miguel de Icaza <miguel@ximian.com>
15079 * attribute.cs (Attributes.Contains): Add new method.
15081 * class.cs (MethodCore.LabelParameters): if the parameter is an
15082 `out' parameter, check that no attribute `[In]' has been passed.
15084 * enum.cs: Handle the `value__' name in an enumeration.
15086 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
15088 * decl.cs: Added special case to allow overrides on "protected
15091 2002-12-18 Ravi Pratap <ravi@ximian.com>
15093 * attribute.cs (Attributes.AddAttributeSection): Rename to this
15094 since it makes much more sense.
15096 (Attributes.ctor): Don't require a Location parameter.
15098 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
15100 * attribute.cs (ApplyAttributes): Remove extra Location parameters
15101 since we already have that information per attribute.
15103 * everywhere : make appropriate changes.
15105 * class.cs (LabelParameters): Write the code which actually
15106 applies attributes to the return type. We can't do this on the MS
15107 .NET runtime so we flag a warning in the case an exception is
15110 2002-12-18 Miguel de Icaza <miguel@ximian.com>
15112 * const.cs: Handle implicit null conversions here too.
15114 2002-12-17 Ravi Pratap <ravi@ximian.com>
15116 * class.cs (MethodCore.LabelParameters): Remove the extra
15117 Type [] parameter since it is completely unnecessary. Instead
15118 pass in the method's attributes so that we can extract
15119 the "return" attribute.
15121 2002-12-17 Miguel de Icaza <miguel@ximian.com>
15123 * cs-parser.jay (parse): Use Report.Error to flag errors instead
15124 of ignoring it and letting the compile continue.
15126 * typemanager.cs (ChangeType): use an extra argument to return an
15127 error condition instead of throwing an exception.
15129 2002-12-15 Miguel de Icaza <miguel@ximian.com>
15131 * expression.cs (Unary.TryReduce): mimic the code for the regular
15132 code path. Perform an implicit cast in the cases where we can
15133 implicitly convert to one of the integral types, and then reduce
15134 based on that constant. This fixes bug #35483.
15136 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15138 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
15140 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15142 * namespace.cs: fixed bug #35489.
15144 2002-12-12 Miguel de Icaza <miguel@ximian.com>
15146 * class.cs: Remove some dead code.
15148 * cs-parser.jay: Estimate the number of methods needed
15149 (RootContext.MethodCount);
15151 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
15152 numbers instead of StringBuilders.
15154 * support.cs (PtrHashtable): Add constructor with initial size;
15155 We can now reduce reallocations of the method table.
15157 2002-12-10 Ravi Pratap <ravi@ximian.com>
15159 * attribute.cs (ApplyAttributes): Keep track of the emitted
15160 attributes on a per-target basis. This fixes bug #35413.
15162 2002-12-10 Miguel de Icaza <miguel@ximian.com>
15164 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
15165 default to the Windows 1252 encoding.
15167 (UnixParseOption): Support version, thanks to Alp for the missing
15170 * AssemblyInfo.cs: Add nice assembly information.
15172 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
15175 * cs-parser.jay: Allow a trailing comma before the close bracked
15176 in the attribute_section production.
15178 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
15179 address of the instance was being taken, I will take this out,
15180 because we take the address of the object immediately here.
15182 2002-12-09 Ravi Pratap <ravi@ximian.com>
15184 * typemanager.cs (AreMultipleAllowed): Take care of the most
15185 obvious case where attribute type is not in the current assembly -
15188 2002-12-08 Miguel de Icaza <miguel@ximian.com>
15190 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
15191 definitions, instead of doing that afterwards.
15193 Also we use a nice little hack, depending on the constructor, we
15194 know if we are a "composed" name or a simple name. Hence, we
15195 avoid the IndexOf test, and we avoid
15197 * codegen.cs: Add code to assist in a bug reporter to track down
15198 the source of a compiler crash.
15200 2002-12-07 Ravi Pratap <ravi@ximian.com>
15202 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
15203 types have been emitted for a given element and flag an error
15204 if something which does not have AllowMultiple set is used more
15207 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15208 attribute types and their corresponding AllowMultiple properties
15210 (AreMultipleAllowed): Check the property for a given type.
15212 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15213 property in the case we have a TypeContainer.
15215 (Attributes.AddAttribute): Detect duplicates and just skip on
15216 adding them. This trivial fix catches a pretty gross error in our
15217 attribute emission - global attributes were being emitted twice!
15219 Bugzilla bug #33187 is now fixed.
15221 2002-12-06 Miguel de Icaza <miguel@ximian.com>
15223 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15224 instead of pp_and).
15226 * expression.cs (Binary.ResolveOperator): I can only use the
15227 Concat (string, string, string) and Concat (string, string,
15228 string, string) if the child is actually a concatenation of
15231 2002-12-04 Miguel de Icaza <miguel@ximian.com>
15233 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15234 context where we need a 2-character lookahead.
15236 * pending.cs (PendingImplementation): Rework so we can keep track
15237 of interface types all the time, and flag those which were
15238 implemented by parents as optional.
15240 2002-12-03 Miguel de Icaza <miguel@ximian.com>
15242 * expression.cs (Binary.ResolveOperator): Use
15243 String.Concat(string,string,string) or
15244 String.Concat(string,string,string,string) when possible.
15246 * typemanager: More helper methods.
15249 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15251 * pending.cs: remove the bogus return from GetMissingInterfaces()
15252 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15254 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15256 * namespace.cs: avoid duplicated 'using xxx' being added to
15257 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15258 when we get more than one 'using' statement for the same namespace.
15259 Report a CS0105 warning for it.
15261 2002-11-30 Miguel de Icaza <miguel@ximian.com>
15263 * cs-tokenizer.cs (consume_identifier): use read directly, instead
15264 of calling getChar/putback, uses internal knowledge of it.
15266 (xtoken): Reorder tokenizer so most common patterns are checked
15267 first. This reduces the compilation time in another 5% (from 8.11s
15268 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15270 The parsing time is 22% of the compilation in mcs, and from that
15271 64% is spent on the tokenization process.
15273 I tried using a binary search for keywords, but this is slower
15274 than the hashtable. Another option would be to do a couple of
15277 * Not use a StringBuilder, instead use an array of chars,
15278 with a set value. Notice that this way we could catch
15279 the 645 error without having to do it *afterwards*.
15281 * We could write a hand-parser to avoid the hashtable
15282 compares altogether.
15284 The identifier consumption process takes 37% of the tokenization
15285 time. Another 15% is spent on is_number. 56% of the time spent
15286 on is_number is spent on Int64.Parse:
15288 * We could probably choose based on the string length to
15289 use Int32.Parse or Int64.Parse and avoid all the 64-bit
15292 Another 3% is spend on wrapping `xtoken' in the `token' function.
15294 Handle 0xa0 as whitespace (#34752)
15296 2002-11-26 Miguel de Icaza <miguel@ximian.com>
15298 * typemanager.cs (IsCLRType): New routine to tell whether a type
15299 is one of the builtin types.
15301 Maybe it needs to use TypeCodes to be faster. Maybe we could use
15302 typecode in more places instead of doing pointer comparissions.
15303 We could leverage some knowledge about the way the typecodes are
15306 New code to cache namespaces in assemblies, it is currently not
15307 invoked, to be used soon.
15309 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
15311 * expression.cs (Binary.ResolveOperator): specially handle
15312 strings, and do not perform user-defined operator overloading for
15315 2002-11-24 Miguel de Icaza <miguel@ximian.com>
15317 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15318 internalcall as it is a pretty simple operation; Avoid whenever
15319 possible to call Char.IsLetter.
15321 (consume_identifier): Cut by half the number of
15322 hashtable calls by merging the is_keyword and GetKeyword behavior.
15324 Do not short-circuit, because if we do, we
15325 report errors (ie, #if false && true would produce an invalid
15329 2002-11-24 Martin Baulig <martin@ximian.com>
15331 * expression.cs (Cast.TryReduce): If we're in checked syntax,
15332 check constant ranges and report a CS0221. Fixes #33186.
15334 2002-11-24 Martin Baulig <martin@ximian.com>
15336 * cs-parser.jay: Make this work for uninitialized variable
15337 declarations in the `for' initializer. Fixes #32416.
15339 2002-11-24 Martin Baulig <martin@ximian.com>
15341 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15342 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
15344 2002-11-24 Martin Baulig <martin@ximian.com>
15346 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15347 argument; if true, we also check for user-defined conversions.
15348 This is only needed if both arguments are of a user-defined type.
15349 Fixes #30443, added test-175.cs.
15350 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15352 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15354 2002-11-24 Martin Baulig <martin@ximian.com>
15356 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15357 function to get the store opcode.
15358 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15359 only emit the Ldelema if the store opcode is Stobj. You must run
15360 both test-34 and test-167 to test this. Fixes #34529.
15362 2002-11-23 Martin Baulig <martin@ximian.com>
15364 * ecore.cs (Expression.MemberLookup): Added additional
15365 `qualifier_type' argument which is used when we're being called
15366 from MemberAccess.DoResolve() and null if we're called from a
15368 (Expression.MemberLookupFailed): New method to report errors; this
15369 does the CS1540 check and reports the correct error message.
15371 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15372 argument for the CS1540 check and redone the way how we're dealing
15373 with private members. See the comment in the source code for details.
15374 (FilterWithClosure): Reverted this back to revision 1.197; renamed
15375 `closure_start_type' to `closure_qualifier_type' and check whether
15376 it's not null. It was not this filter being broken, it was just
15377 being called with the wrong arguments.
15379 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15380 and pass it the correct `qualifier_type'; this also does the error
15383 2002-11-22 Miguel de Icaza <miguel@ximian.com>
15385 * expression.cs (Invocation.EmitParams): If the we are dealing
15386 with a non-built-in value type, load its address as well.
15388 (ArrayCreation): Use a a pretty constant instead
15389 of the hardcoded value 2. Use 6 instead of 2 for the number of
15390 static initializers.
15392 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15393 because they are not really value types, just glorified integers.
15395 * driver.cs: Do not append .exe, the CSC compiler does not do it.
15397 * ecore.cs: Remove redundant code for enumerations, make them use
15398 the same code path as everything else, fixes the casting issue
15399 with enumerations in Windows.Forms.
15401 * attribute.cs: Do only cast to string if it is a string, the
15402 validation happens later.
15404 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15405 people upgrade their corlibs.
15407 * ecore.cs: Oops, enumerations were not following the entire code path
15409 2002-11-21 Miguel de Icaza <miguel@ximian.com>
15411 * typemanager.cs (FilterWithClosure): Commented out the test for
15412 1540 in typemanager.cs, as it has problems when accessing
15413 protected methods from a parent class (see test-174.cs).
15415 * attribute.cs (Attribute.ValidateGuid): new method.
15416 (Attribute.Resolve): Use above.
15418 2002-11-19 Miguel de Icaza <miguel@ximian.com>
15420 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15422 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15423 handling for enumerations, as we only needed the TypeContainer
15424 functionality to begin with (this is required for the fix below to
15425 work for enums that reference constants in a container class for
15428 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15430 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15431 a valid TypeBuilder to perform lookups on.o
15433 * class.cs (InheritableMemberSignatureCompare): Use true in the
15434 call to GetGetMethod and GetSetMethod, because we are comparing
15435 the signature, and we need to get the methods *even* if they are
15438 (PropertyBase.CheckBase): ditto.
15440 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15441 GotoCase.Resolve): Use Peel on EmpytCasts.
15443 * ecore.cs (EmptyCast): drop child, add Peel method.
15445 2002-11-17 Martin Baulig <martin@ximian.com>
15447 * ecore.cs (EmptyCast.Child): New public property.
15449 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15450 label resolved to an EmptyCast. Fixes #34162.
15451 (GotoCase.Resolve): Likewise.
15452 (Block.EmitMeta): Likewise.
15454 2002-11-17 Martin Baulig <martin@ximian.com>
15456 * expression.cs (Invocation.BetterConversion): Prefer int over
15457 uint; short over ushort; long over ulong for integer literals.
15458 Use ImplicitConversionExists instead of StandardConversionExists
15459 since we also need to check for user-defined implicit conversions.
15460 Fixes #34165. Added test-173.cs.
15462 2002-11-16 Martin Baulig <martin@ximian.com>
15464 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15465 with the `true' and `false' literals. Fixes #33151.
15467 2002-11-16 Martin Baulig <martin@ximian.com>
15469 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
15470 October 22nd; don't do the cs1540 check for static members.
15472 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
15473 now using our own filter here and doing the cs1540 check again.
15475 2002-11-16 Martin Baulig <martin@ximian.com>
15477 * support.cs (InternalParameters): Don't crash if we don't have
15478 any fixed parameters. Fixes #33532.
15480 2002-11-16 Martin Baulig <martin@ximian.com>
15482 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
15483 when looking up static methods to make this work on Windows.
15486 2002-11-16 Martin Baulig <martin@ximian.com>
15488 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
15489 a setter rather than using PropertyInfo.CanWrite.
15491 2002-11-15 Nick Drochak <ndrochak@gol.com>
15493 * class.cs: Allow acces to block member by subclasses. Fixes build
15496 2002-11-14 Martin Baulig <martin@ximian.com>
15498 * class.cs (Constructor.Emit): Added the extern/block check.
15501 2002-11-14 Martin Baulig <martin@ximian.com>
15503 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15504 iteration while looking for indexers, this is needed because the
15505 indexer may have a different name in our base classes. Fixed the
15506 error reporting (no indexers at all, not get accessor, no
15507 overloaded match). Fixes bug #33089.
15508 (IndexerAccess.DoResolveLValue): Likewise.
15510 2002-11-14 Martin Baulig <martin@ximian.com>
15512 * class.cs (PropertyBase.CheckBase): Make this work for multiple
15513 indexers. Fixes the first part of bug #33089.
15514 (MethodSignature.InheritableMemberSignatureCompare): Added support
15517 2002-11-13 Ravi Pratap <ravi@ximian.com>
15519 * attribute.cs (Attribute.Resolve): Catch the
15520 NullReferenceException and report it since it isn't supposed to
15523 2002-11-12 Miguel de Icaza <miguel@ximian.com>
15525 * expression.cs (Binary.EmitBranchable): Also handle the cases for
15526 LogicalOr and LogicalAnd that can benefit from recursively
15527 handling EmitBranchable. The code now should be nice for Paolo.
15529 2002-11-08 Miguel de Icaza <miguel@ximian.com>
15531 * typemanager.cs (LookupType): Added a negative-hit hashtable for
15532 the Type lookups, as we perform quite a number of lookups on
15533 non-Types. This can be removed once we can deterministically tell
15534 whether we have a type or a namespace in advance.
15536 But this might require special hacks from our corlib.
15540 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15541 and double which avoids a conversion from an integer to a double.
15543 * expression.cs: tiny optimization, avoid calling IsConstant,
15544 because it effectively performs the lookup twice.
15546 2002-11-06 Miguel de Icaza <miguel@ximian.com>
15548 But a bogus return here to keep the semantics of the old code
15549 until the Mono runtime is fixed.
15551 * pending.cs (GetMissingInterfaces): New method used to remove all
15552 the interfaces that are already implemented by our parent
15553 classes from the list of pending methods.
15555 * interface.cs: Add checks for calls after ResolveTypeExpr.
15557 2002-11-05 Miguel de Icaza <miguel@ximian.com>
15559 * class.cs (Class.Emit): Report warning 67: event not used if the
15560 warning level is beyond 3.
15562 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15563 being a NullLiteral.
15565 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15568 * class.cs (TypeContainer.GetClassBases): Cover a missing code
15569 path that might fail if a type can not be resolved.
15571 * expression.cs (Binary.Emit): Emit unsigned versions of the
15574 * driver.cs: use error 5.
15576 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15578 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15580 2002-11-01 Miguel de Icaza <miguel@ximian.com>
15582 * cs-parser.jay (switch_section): A beautiful patch from Martin
15583 Baulig that fixed 33094.
15585 2002-10-31 Miguel de Icaza <miguel@ximian.com>
15587 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15588 Check whether the base is abstract and report an error if so.
15590 * expression.cs (IndexerAccess.DoResolveLValue,
15591 IndexerAccess.DoResolve): ditto.
15593 (Invocation.DoResolve): ditto.
15595 (Invocation.FullMethodDesc): Improve the report string.
15597 * statement.cs (Block): Eliminate IsVariableDefined as it is
15598 basically just a wrapper for GetVariableInfo.
15600 * ecore.cs (SimpleName): Use new
15602 * support.cs (ReflectionParamter.ParameterType): We unwrap the
15603 type, as we return the actual parameter ref/unref state on a
15606 2002-10-30 Miguel de Icaza <miguel@ximian.com>
15608 * support.cs: Return proper flags REF/OUT fixing the previous
15611 * expression.cs: Reverted last patch, that was wrong. Is_ref is
15612 not used to mean `ref' but `ref or out' in ParameterReference
15614 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15615 full type signature instead of calling TypeManger.CSharpName
15618 * support.cs (InternalParameters.ParameterDesc): Do not compare
15619 directly to the modflags, because REF/OUT will actually be bitsets
15622 * delegate.cs (VerifyMethod): Check also the modifiers.
15624 * cs-tokenizer.cs: Fix bug where floating point values with an
15625 exponent where a sign was missing was ignored.
15627 * driver.cs: Allow multiple assemblies to be specified in a single
15630 2002-10-28 Miguel de Icaza <miguel@ximian.com>
15632 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
15633 because identifiers after a parenthesis would end up in this kind
15634 of production, and we needed to desamiguate it for having casts
15637 (UserDefinedType *) xxx
15639 2002-10-24 Miguel de Icaza <miguel@ximian.com>
15641 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15642 we should set on the Bindingflags.NonPublic, but not turn on
15643 private_ok. private_ok controls whether a Private member is
15644 returned (this is chekced on the filter routine), while the
15645 BindingFlags.NonPublic just controls whether private/protected
15646 will be allowed. This fixes the problem part of the problem of
15647 private properties being allowed to be used in derived classes.
15649 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15650 so we can call the children DoResolveLValue method (this will
15651 properly signal errors on lvalue assignments to base properties)
15653 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15654 getter are null, and we have a property info, we know that this
15655 happened because the lookup failed, so we report an error 122 for
15656 protection level violation.
15658 We also silently return if setter and getter are null in the
15659 resolve functions, this condition only happens if we have flagged
15660 the error before. This is the other half of the problem.
15662 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15663 not have accessibility information, that is why we were returning
15664 true in the filter function in typemanager.cs.
15666 To properly report 122 (property is inaccessible because of its
15667 protection level) correctly, we report this error in ResolveAccess
15668 by failing if both the setter and the getter are lacking (ie, the
15671 DoResolve and DoLResolve have been modified to check for both
15672 setter/getter being null and returning silently, the reason being
15673 that I did not want to put the knowledge about this error in upper
15676 int old = Report.Errors;
15677 x = new PropertyExpr (...);
15678 if (old != Report.Errors)
15683 So the property expr is returned, but it is invalid, so the error
15684 will be flagged during the resolve process.
15686 * class.cs: Remove InheritablePropertySignatureCompare from the
15687 class, as we no longer depend on the property signature to compute
15688 whether it is possible to implement a method or not.
15690 The reason is that calling PropertyInfo.GetGetMethod will return
15691 null (in .NET, in Mono it works, and we should change this), in
15692 cases where the Get Method does not exist in that particular
15697 class X { public virtual int A { get { return 1; } } }
15699 class Z : Y { public override int A { get { return 2; } } }
15701 Would fail in Z because the parent (Y) would not have the property
15702 defined. So we avoid this completely now (because the alternative
15703 fix was ugly and slow), and we now depend exclusively on the
15706 (PropertyBase.CheckBase): Use a method-base mechanism to find our
15707 reference method, instead of using the property.
15709 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15710 routines are gone now.
15712 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15713 names, they were incorrectly named.
15715 * cs-tokenizer.cs: Return are more gentle token on failure.
15717 * pending.cs (PendingImplementation.InterfaceMethod): This routine
15718 had an out-of-sync index variable, which caused it to remove from
15719 the list of pending methods the wrong method sometimes.
15721 2002-10-22 Miguel de Icaza <miguel@ximian.com>
15723 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15724 CanWrite, because those refer to this particular instance of the
15725 property, and do not take into account the fact that we can
15726 override single members of a property.
15728 Constructor requires an EmitContext. The resolution process does
15729 not happen here, but we need to compute the accessors before,
15730 because the resolution does not always happen for properties.
15732 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15733 subclass, before we did not update this flag, but we did update
15736 (GetAccessors): Drop this routine, as it did not work in the
15737 presence of partially overwritten set/get methods.
15739 Notice that this broke the cs1540 detection, but that will require
15742 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15746 * driver.cs: issue a warning instead of an error if we don't support
15747 debugging for the platform. Also ignore a couple of errors that may
15748 arise when trying to write the symbols. Undo my previous patch.
15750 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15752 * driver.cs: ignore /debug switch except for Unix platforms.
15754 2002-10-23 Nick Drochak <ndrochak@gol.com>
15756 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15758 2002-10-21 Miguel de Icaza <miguel@ximian.com>
15760 * driver.cs: Do not make mcs-debug conditional, so we do not break
15761 builds that use it.
15763 * statement.cs (UsageVector.MergeChildren): I would like Martin to
15764 review this patch. But basically after all the children variables
15765 have been merged, the value of "Breaks" was not being set to
15766 new_breaks for Switch blocks. I think that it should be set after
15767 it has executed. Currently I set this to the value of new_breaks,
15768 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15769 conservative, but I do not understand this code very well.
15771 I did not break anything in the build, so that is good ;-)
15773 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15775 2002-10-20 Mark Crichton <crichton@gimp.org>
15777 * cfold.cs: Fixed compile blocker. Really fixed it this time.
15779 2002-10-20 Nick Drochak <ndrochak@gol.com>
15781 * cfold.cs: Fixed compile blocker.
15783 2002-10-20 Miguel de Icaza <miguel@ximian.com>
15785 * driver.cs: I was chekcing the key, not the file.
15787 2002-10-19 Ravi Pratap <ravi@ximian.com>
15789 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15790 message that we were generating - we just need to silently return
15793 2002-10-19 Miguel de Icaza <miguel@ximian.com>
15795 * class.cs (Event.Define): Change my previous commit, as this
15796 breaks the debugger. This is a temporary hack, as it seems like
15797 the compiler is generating events incorrectly to begin with.
15799 * expression.cs (Binary.ResolveOperator): Added support for
15800 "U operator - (E x, E y)"
15802 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
15805 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
15806 init-only variables, but this path did not take into account that
15807 there might be also instance readonly variables. Correct this
15810 This fixes bug 32253
15812 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
15815 * driver.cs: Change the extension for modules to `netmodule'
15817 * cs-parser.jay: Improved slightly the location tracking for
15818 the debugger symbols.
15820 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
15821 modifiers that were specified instead of the hardcoded value
15822 (FamAndAssem). This was basically ignoring the static modifier,
15823 and others. Fixes 32429.
15825 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
15826 fixed a bug in the process (32476)
15828 * expression.cs (ArrayAccess.EmitAssign): Patch from
15829 hwang_rob@yahoo.ca that fixes bug 31834.3
15831 2002-10-18 Miguel de Icaza <miguel@ximian.com>
15833 * driver.cs: Make the module extension .netmodule.
15835 2002-10-16 Miguel de Icaza <miguel@ximian.com>
15837 * driver.cs: Report an error if the resource file is not found
15838 instead of crashing.
15840 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
15841 false, like Emit does.
15843 2002-10-16 Nick Drochak <ndrochak@gol.com>
15845 * typemanager.cs: Remove unused private member. Also reported mcs
15846 bug to report this as a warning like csc.
15848 2002-10-15 Martin Baulig <martin@gnome.org>
15850 * statement.cs (Statement.Emit): Made this a virtual method; emits
15851 the line number info and calls DoEmit().
15852 (Statement.DoEmit): New protected abstract method, formerly knows
15853 as Statement.Emit().
15855 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
15857 2002-10-11 Miguel de Icaza <miguel@ximian.com>
15859 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
15860 have fixed a remaining problem: not every AddXXXX was adding a
15861 fully qualified name.
15863 Now everyone registers a fully qualified name in the DeclSpace as
15864 being defined instead of the partial name.
15866 Downsides: we are slower than we need to be due to the excess
15867 copies and the names being registered this way.
15869 The reason for this is that we currently depend (on the corlib
15870 bootstrap for instance) that types are fully qualified, because
15871 we dump all the types in the namespace, and we should really have
15872 types inserted into the proper namespace, so we can only store the
15873 basenames in the defined_names array.
15875 2002-10-10 Martin Baulig <martin@gnome.org>
15877 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
15878 from bug #31834, see the bug report for a testcase which is
15881 2002-10-10 Martin Baulig <martin@gnome.org>
15883 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
15884 flow analysis code for this.
15886 * statement.cs (Do, While, For): Tell the flow analysis code about
15888 (FlowBranching.UsageVector): Added support for infinite loops.
15889 (Block.Resolve): Moved the dead code elimination here and use flow
15892 2002-10-09 Miguel de Icaza <miguel@ximian.com>
15894 * class.cs (Field.Define): Catch cycles on struct type
15897 * typemanager.cs (IsUnmanagedtype): Do not recursively check
15898 fields if the fields are static. We only need to check instance
15901 * expression.cs (As.DoResolve): Test for reference type.
15903 * statement.cs (Using.ResolveExpression): Use
15904 ConvertImplicitRequired, not ConvertImplicit which reports an
15906 (Using.ResolveLocalVariableDecls): ditto.
15908 * expression.cs (Binary.ResolveOperator): Report errors in a few
15909 places where we had to.
15911 * typemanager.cs (IsUnmanagedtype): Finish implementation.
15913 2002-10-08 Miguel de Icaza <miguel@ximian.com>
15915 * expression.cs: Use StoreFromPtr instead of extracting the type
15916 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
15918 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
15919 an enumeration value to a System.Enum, but System.Enum is not a
15920 value type, but an class type, so we need to box.
15922 (Expression.ConvertExplicit): One codepath could return
15923 errors but not flag them. Fix this. Fixes #31853
15925 * parameter.cs (Resolve): Do not allow void as a parameter type.
15927 2002-10-06 Martin Baulig <martin@gnome.org>
15929 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
15930 if it's a class type and not a struct. Fixes #31815.
15932 2002-10-06 Martin Baulig <martin@gnome.org>
15934 * statement.cs: Reworked the flow analysis code a bit to make it
15935 usable for dead code elimination.
15937 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15939 * cs-parser.jay: allow empty source files. Fixes bug #31781.
15941 2002-10-04 Miguel de Icaza <miguel@ximian.com>
15943 * expression.cs (ComposedCast.DoResolveType): A quick workaround
15944 to fix the test 165, will investigate deeper.
15946 2002-10-04 Martin Baulig <martin@gnome.org>
15948 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
15949 finally blocks actually work.
15950 (Try.Resolve): We don't need to create a sibling for `finally' if
15951 there is no finally block.
15953 2002-10-04 Martin Baulig <martin@gnome.org>
15955 * class.cs (Constructor.Define): The default accessibility for a
15956 non-default constructor is private, not public.
15958 2002-10-04 Miguel de Icaza <miguel@ximian.com>
15960 * class.cs (Constructor): Make AllowedModifiers public, add
15963 * cs-parser.jay: Perform the modifiers test here, as the
15964 constructor for the Constructor class usually receives a zero
15965 because of the way we create it (first we create, later we
15966 customize, and we were never checking the modifiers).
15968 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
15969 is a version of LookupTypeReflection that includes the type-name
15970 cache. This can be used as a fast path for functions that know
15971 the fully qualified name and are only calling into *.GetType() to
15972 obtain a composed type.
15974 This is also used by TypeManager.LookupType during its type
15977 (LookupType): We now also track the real type name, as sometimes
15978 we can get a quey for the real type name from things like
15979 ComposedCast. This fixes bug 31422.
15981 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
15982 complete type fullname, it does not have to go through the type
15983 resolution system to obtain the composed version of the type (for
15984 obtaining arrays or pointers).
15986 (Conditional.Emit): Use the EmitBoolExpression to
15987 generate nicer code, as requested by Paolo.
15989 (ArrayCreation.CheckIndices): Use the patch from
15990 hwang_rob@yahoo.ca to validate the array initializers.
15992 2002-10-03 Miguel de Icaza <miguel@ximian.com>
15994 * class.cs (ConstructorInitializer.Emit): simplify code by using
15995 Invocation.EmitCall, and at the same time, fix the bugs in calling
15996 parent constructors that took variable arguments.
15998 * ecore.cs (Expression.ConvertNumericExplicit,
15999 Expression.ImplicitNumericConversion): Remove the code that
16000 manually wrapped decimal (InternalTypeConstructor call is now gone
16003 * expression.cs (Cast.TryReduce): Also handle decimal types when
16004 trying to perform a constant fold on the type.
16006 * typemanager.cs (IsUnmanagedtype): Partially implemented.
16008 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
16009 that only turned off an error report, and did nothing else.
16011 2002-10-02 Miguel de Icaza <miguel@ximian.com>
16013 * driver.cs: Handle and ignore /fullpaths
16015 2002-10-01 Miguel de Icaza <miguel@ximian.com>
16017 * expression.cs (Binary.ResolveOperator): Catch the case where
16018 DoNumericPromotions returns true,
16020 (Binary.DoNumericPromotions): Simplify the code, and the tests.
16022 2002-09-27 Miguel de Icaza <miguel@ximian.com>
16024 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
16027 2002-09-26 Miguel de Icaza <miguel@ximian.com>
16029 * ecore.cs (ConvertNumericExplicit): It is not enough that the
16030 conversion exists, but it is also required that the conversion be
16031 performed. This manifested in "(Type64Enum) 2".
16033 * class.cs (TypeManager.AddMethod): The fix is not to change
16034 AddEnum, because that one was using a fully qualified name (every
16035 DeclSpace derivative does), but to change the AddMethod routine
16036 that was using an un-namespaced name. This now correctly reports
16037 the duplicated name.
16039 Revert patch until I can properly fix it. The issue
16040 is that we have a shared Type space across all namespaces
16041 currently, which is wrong.
16043 Options include making the Namespace a DeclSpace, and merge
16044 current_namespace/current_container in the parser.
16046 2002-09-25 Miguel de Icaza <miguel@ximian.com>
16048 * cs-parser.jay: Improve error reporting when we get a different
16049 kind of expression in local_variable_type and
16050 local_variable_pointer_type.
16052 Propagate this to avoid missleading errors being reported.
16054 * ecore.cs (ImplicitReferenceConversion): treat
16055 TypeManager.value_type as a target just like object_type. As
16060 Is valid, and needs to result in the int 1 being boxed before it
16061 is assigned to the value type v.
16063 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
16064 to validate the enumeration name.
16066 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
16067 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
16068 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
16070 * ecore.cs (TryImplicitIntConversion): When doing an
16071 implicit-enumeration-conversion, check if the type is 64-bits and
16072 perform a conversion before passing to EnumConstant.
16074 2002-09-23 Miguel de Icaza <miguel@ximian.com>
16076 * decl.cs (Error_AmbiguousTypeReference); New routine used to
16077 report ambiguous type references. Unlike the MS version, we
16078 report what the ambiguity is. Innovation at work ;-)
16080 (DeclSpace.FindType): Require a location argument to
16081 display when we display an ambiguous error.
16083 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
16085 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
16087 * expression.cs (EmitDynamicInitializers): Apply patch from
16088 hwang_rob@yahoo.ca that fixes the order in which we emit our
16091 2002-09-21 Martin Baulig <martin@gnome.org>
16093 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
16094 delegate takes no arguments.
16096 2002-09-20 Miguel de Icaza <miguel@ximian.com>
16098 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
16101 * expression.cs: Extract the underlying type.
16103 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
16105 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
16107 2002-09-19 Miguel de Icaza <miguel@ximian.com>
16109 * class.cs (TypeContainer.DefineType): We can not use the nice
16110 PackingSize with the size set to 1 DefineType method, because it
16111 will not allow us to define the interfaces that the struct
16114 This completes the fixing of bug 27287
16116 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
16117 means also structs. This fixes part of the problem.
16118 (Expresion.ImplicitReferenceConversionExists): ditto.
16120 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
16121 error if there were no errors reported during the type lookup
16122 process, to avoid duplicates or redundant errors. Without this
16123 you would get an ambiguous errors plus a type not found. We have
16124 beaten the user enough with the first error.
16126 (DeclSparce.FindType): Emit a warning if we have an ambiguous
16129 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
16130 during the resolution process, stop the lookup, this avoids
16131 repeated error reports (same error twice).
16133 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
16135 * typemanager.cs (LookupType): Redo the type lookup code to match
16136 the needs of System.Reflection.
16138 The issue is that System.Reflection requires references to nested
16139 types to begin with a "+" sign instead of a dot. So toplevel
16140 types look like: "NameSpace.TopLevelClass", and nested ones look
16141 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
16144 2002-09-19 Martin Baulig <martin@gnome.org>
16146 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
16147 says that a method always returns or always throws an exception,
16148 don't report the CS0161.
16150 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
16151 set `Returns = new_returns'.
16153 2002-09-19 Martin Baulig <martin@gnome.org>
16155 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
16156 to an enum constant, check for a CS0176.
16158 2002-09-18 Miguel de Icaza <miguel@ximian.com>
16160 * class.cs (TypeContainer.CheckPairedOperators): Now we check
16161 for operators that must be in pairs and report errors.
16163 * ecore.cs (SimpleName.DoResolveType): During the initial type
16164 resolution process, when we define types recursively, we must
16165 check first for types in our current scope before we perform
16166 lookups in the enclosing scopes.
16168 * expression.cs (MakeByteBlob): Handle Decimal blobs.
16170 (Invocation.VerifyArgumentsCompat): Call
16171 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
16172 I thought we were supposed to always call this, but there are a
16173 few places in the code where we dont do it.
16175 2002-09-17 Miguel de Icaza <miguel@ximian.com>
16177 * driver.cs: Add support in -linkres and -resource to specify the
16178 name of the identifier.
16180 2002-09-16 Miguel de Icaza <miguel@ximian.com>
16182 * ecore.cs (StandardConversionExists): Sync with the conversion
16183 code: allow anything-* to void* conversions.
16185 (FindMostSpecificSource): Use an Expression argument
16186 instead of a Type, because we might be handed over a Literal which
16187 gets a few more implicit conversions that plain types do not. So
16188 this information was being lost.
16190 Also, we drop the temporary type-holder expression when not
16193 2002-09-17 Martin Baulig <martin@gnome.org>
16195 * class.cs (PropertyBase.CheckBase): Don't check the base class if
16196 this is an explicit interface implementation.
16198 2002-09-17 Martin Baulig <martin@gnome.org>
16200 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
16201 different `IndexerName' attributes.
16203 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
16204 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
16205 virtual CommonResolve().
16207 2002-09-16 Miguel de Icaza <miguel@ximian.com>
16209 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16210 and convert that to the UnderlyingType.
16212 * statement.cs (Foreach.Resolve): Indexers are just like variables
16213 or PropertyAccesses.
16215 * cs-tokenizer.cs (consume_string): Track line numbers and columns
16216 inside quoted strings, we were not doing this before.
16218 2002-09-16 Martin Baulig <martin@gnome.org>
16220 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16221 resolve it. This is needed for the definite assignment check of the
16222 instance expression, fixes bug #29846.
16223 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16225 2002-09-16 Nick Drochak <ndrochak@gol.com>
16227 * parameter.cs: Fix compile error. Cannot reference static member
16228 from an instance object. Is this an mcs bug?
16230 2002-09-14 Martin Baulig <martin@gnome.org>
16232 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16233 multiple times. Fixes bug #30295, added test-166.cs.
16235 2002-09-14 Martin Baulig <martin@gnome.org>
16237 * statement.cs (Block.Emit): Don't emit unreachable code.
16238 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16239 `break' statements.
16240 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16242 2002-09-14 Martin Baulig <martin@gnome.org>
16244 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16247 2002-09-14 Martin Baulig <martin@gnome.org>
16249 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16250 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16251 be false on the ms runtime.
16253 2002-09-13 Martin Baulig <martin@gnome.org>
16255 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16256 the CS0038 error message.
16258 2002-09-12 Miguel de Icaza <miguel@ximian.com>
16260 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16261 constant inside, return it.
16263 2002-09-12 Martin Baulig <martin@gnome.org>
16265 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16266 implicit conversion can be done between enum types.
16268 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16269 check whether an implicit conversion to the current enum's UnderlyingType
16270 exists and report an error if not.
16272 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16273 without debugging support.
16275 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16276 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
16278 2002-09-12 Martin Baulig <martin@gnome.org>
16280 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16282 * ecore.cs (IMemberExpr.DeclaringType): New property.
16283 (SimpleName.SimpleNameResolve): Check whether we're accessing a
16284 nonstatic member of an outer type (CS0038).
16286 2002-09-11 Miguel de Icaza <miguel@ximian.com>
16288 * driver.cs: Activate the using-error detector at warning level
16289 4 (at least for MS-compatible APIs).
16291 * namespace.cs (VerifyUsing): Small buglett fix.
16293 * pending.cs (PendingImplementation): pass the container pointer.
16295 * interface.cs (GetMethods): Allow for recursive definition. Long
16296 term, I would like to move every type to support recursive
16297 definitions, not the current ordering mechanism that we have right
16300 The situation is this: Attributes are handled before interfaces,
16301 so we can apply attributes to interfaces. But some attributes
16302 implement interfaces, we will now handle the simple cases
16303 (recursive definitions will just get an error).
16305 * parameter.cs: Only invalidate types at the end if we fail to
16308 2002-09-09 Martin Baulig <martin@gnome.org>
16310 * ecore.cs (PropertyExpr.Emit): Also check for
16311 TypeManager.system_int_array_get_length so this'll also work when
16312 compiling corlib. Fixes #30003.
16314 2002-09-09 Martin Baulig <martin@gnome.org>
16316 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16317 and throw an exception if we can't get the type's size. Fixed #30040,
16320 2002-09-09 Martin Baulig <martin@gnome.org>
16322 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16324 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16325 context. Fixes bug #30027.
16327 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16328 virtual functions. Fixes bug #30043, added test-164.cs.
16330 2002-09-08 Ravi Pratap <ravi@ximian.com>
16332 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16334 2002-09-08 Nick Drochak <ndrochak@gol.com>
16336 * driver.cs: Use an object to get the windows codepage since it's not a
16339 2002-09-08 Miguel de Icaza <miguel@ximian.com>
16341 * statement.cs (For.Emit): for infinite loops (test == null)
16342 return whether there is a break inside, not always "true".
16344 * namespace.cs (UsingEntry): New struct to hold the name of the
16345 using definition, the location where it is defined, and whether it
16346 has been used in a successful type lookup.
16348 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16353 2002-09-06 Ravi Pratap <ravi@ximian.com>
16355 * attribute.cs : Fix incorrect code which relied on catching
16356 a NullReferenceException to detect a null being passed in
16357 where an object was expected.
16359 2002-09-06 Miguel de Icaza <miguel@ximian.com>
16361 * statement.cs (Try): flag the catch variable as assigned
16363 * expression.cs (Cast): Simplified by using ResolveType instead of
16364 manually resolving.
16366 * statement.cs (Catch): Fix bug by using ResolveType.
16368 2002-09-06 Ravi Pratap <ravi@ximian.com>
16370 * expression.cs (BetterConversion): Special case for when we have
16371 a NullLiteral as the argument and we have to choose between string
16372 and object types - we choose string the way csc does.
16374 * attribute.cs (Attribute.Resolve): Catch the
16375 NullReferenceException and report error #182 since the Mono
16376 runtime no more has the bug and having this exception raised means
16377 we tried to select a constructor which takes an object and is
16380 2002-09-05 Ravi Pratap <ravi@ximian.com>
16382 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16383 message (1502, 1503) when we can't locate a method after overload
16384 resolution. This is much more informative and closes the bug
16387 * interface.cs (PopulateMethod): Return if there are no argument
16388 types. Fixes a NullReferenceException bug.
16390 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16391 expressions too. Previously we were checking only in one place for
16392 positional arguments leaving out named arguments.
16394 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16395 type to the enum type is not allowed. Remove code corresponding to
16398 (ConvertNumericExplicit): Allow explicit conversions from
16399 the underlying type to enum type. This precisely follows the spec
16400 and closes a bug filed by Gonzalo.
16402 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16405 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16407 2002-09-03 Miguel de Icaza <miguel@ximian.com>
16409 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16410 it was important that we stored the right value after the
16411 reduction in `converted'.
16413 2002-09-04 Martin Baulig <martin@gnome.org>
16415 * location.cs (Location.SymbolDocument): Use full pathnames for the
16418 2002-08-30 Miguel de Icaza <miguel@ximian.com>
16420 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16421 of the expression resolve mechanism, because that will catch the
16422 SimpleName error failures.
16424 (Conditional): If we can not resolve the
16425 expression, return, do not crash.
16427 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16430 (location): display token name instead of its number.
16432 2002-08-28 Martin Baulig <martin@gnome.org>
16434 * expression.cs (Binary.ResolveOperator): Don't silently return
16435 but return an error if an operator cannot be applied between two
16438 2002-08-28 Martin Baulig <martin@gnome.org>
16440 * class.cs (Constructor.Define): Set the permission attributes
16441 correctly instead of making all constructors public.
16443 2002-08-28 Martin Baulig <martin@gnome.org>
16445 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16446 for private members before reporting a CS0103; if we find anything,
16449 2002-08-28 Martin Baulig <martin@gnome.org>
16451 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16452 to check whether `closure_start_type == closure_invocation_type',
16453 we also need to check whether `m.DeclaringType == closure_invocation_type'
16454 before bypassing the permission checks. We might be accessing
16455 protected/private members from the base class.
16456 (TypeManager.RealMemberLookup): Only set private_ok if private
16457 members were requested via BindingFlags.NonPublic.
16459 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16461 * expression.cs (MemberAccess.ResolveMemberAccess): Set
16462 MethodGroupExpr.IsExplicitImpl if appropriate.
16463 (Invocation.DoResolve): Don't report the CS0120 for explicit
16464 interface implementations.
16466 2002-08-27 Martin Baulig <martin@gnome.org>
16468 * expression.cs (Invocation.DoResolve): If this is a static
16469 method and we don't have an InstanceExpression, we must report
16472 2002-08-25 Martin Baulig <martin@gnome.org>
16474 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
16475 `==' between a valuetype and an object.
16477 2002-08-25 Miguel de Icaza <miguel@ximian.com>
16479 * ecore.cs (TypeExpr): Provide a ToString method.
16481 2002-08-24 Martin Baulig <martin@gnome.org>
16483 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
16484 now called proggie.dbg and it's a binary file.
16486 2002-08-23 Martin Baulig <martin@gnome.org>
16488 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
16490 2002-08-23 Martin Baulig <martin@gnome.org>
16492 * struct.cs (MyStructInfo.ctor): Make this work with empty
16493 structs; it's not allowed to use foreach() on null.
16495 2002-08-23 Martin Baulig <martin@gnome.org>
16497 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
16498 writer the full pathname of the generated assembly.
16500 2002-08-23 Martin Baulig <martin@gnome.org>
16502 * statements.cs (FlowBranching.UsageVector.MergeChildren):
16503 A `finally' block never returns or breaks; improved handling of
16506 2002-08-23 Martin Baulig <martin@gnome.org>
16508 * statement.cs (Throw.Resolve): Allow `throw null'.
16510 2002-08-23 Martin Baulig <martin@gnome.org>
16512 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16513 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16514 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
16515 MemberLookup would return a wrong event if this is an explicit
16516 interface implementation and the class has an event with the same
16519 2002-08-23 Martin Baulig <martin@gnome.org>
16521 * statement.cs (Block.AddChildVariableNames): New public method.
16522 (Block.AddChildVariableName): Likewise.
16523 (Block.IsVariableNameUsedInChildBlock): Likewise.
16524 (Block.AddVariable): Check whether a variable name has already
16525 been used in a child block.
16527 * cs-parser.jay (declare_local_variables): Mark all variable names
16528 from the current block as being used in a child block in the
16531 2002-08-23 Martin Baulig <martin@gnome.org>
16533 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16534 find the symbol writer.
16536 * driver.cs: csc also allows the arguments to /define being
16537 separated by commas, not only by semicolons.
16539 2002-08-23 Martin Baulig <martin@gnome.org>
16541 * interface.cs (Interface.GetMembers): Added static check for events.
16543 2002-08-15 Martin Baulig <martin@gnome.org>
16545 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16546 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16548 * ecore.cs (Expression.MemberLookup): Added documentation and explained
16549 why the MethodData.EmitDestructor() change was necessary.
16551 2002-08-20 Martin Baulig <martin@gnome.org>
16553 * class.cs (TypeContainer.FindMembers): Added static check for events.
16555 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16557 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16558 use Type.GetEvents(), not Type.FindMembers().
16560 2002-08-20 Martin Baulig <martin@gnome.org>
16562 * decl.cs (MemberCache): Added a special method cache which will
16563 be used for method-only searched. This ensures that a method
16564 search will return a MethodInfo with the correct ReflectedType for
16567 2002-08-20 Martin Baulig <martin@gnome.org>
16569 * decl.cs (DeclSpace.FindMembers): Made this public.
16571 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16573 * delegate.cs: fixed build on windows.
16574 [FIXME: Filed as bug #29150: MCS must report these errors.]
16576 2002-08-19 Ravi Pratap <ravi@ximian.com>
16578 * ecore.cs (StandardConversionExists): Return a false
16579 if we are trying to convert the void type to anything else
16580 since that is not allowed.
16582 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16583 we flag error 70 in the event an event is trying to be accessed
16584 directly from outside the declaring type.
16586 2002-08-20 Martin Baulig <martin@gnome.org>
16588 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16589 MemberCache from typemanager.cs to decl.cs.
16591 2002-08-19 Martin Baulig <martin@gnome.org>
16593 * class.cs (TypeContainer): Implement IMemberContainer.
16594 (TypeContainer.DefineMembers): Create the MemberCache.
16595 (TypeContainer.FindMembers): Do better BindingFlags checking; only
16596 return public members if BindingFlags.Public was given, check
16597 whether members are static.
16599 2002-08-16 Martin Baulig <martin@gnome.org>
16601 * decl.cs (DeclSpace.Define): Splitted this in Define and
16602 DefineMembers. DefineMembers is called first and initializes the
16605 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
16606 DefineMembers() on all our DeclSpaces.
16608 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16609 but call DefineMembers() on all nested interfaces. We call their
16610 Define() in our new Define() function.
16612 * interface.cs (Interface): Implement IMemberContainer.
16613 (Interface.Define): Moved all code except the attribute stuf to
16615 (Interface.DefineMembers): Initialize the member cache.
16617 * typemanager.cs (IMemberFinder): Removed this interface, we don't
16618 need this anymore since we can use MemberCache.FindMembers directly.
16620 2002-08-19 Martin Baulig <martin@gnome.org>
16622 * typemanager.cs (MemberCache): When creating the cache for an
16623 interface type, add all inherited members.
16624 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16625 to `out bool used_cache' and documented it.
16626 (TypeManager.MemberLookup): If we already used the cache in the first
16627 iteration, we don't need to do the interfaces check.
16629 2002-08-19 Martin Baulig <martin@gnome.org>
16631 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
16632 here from IMemberFinder and don't implement this interface anymore.
16633 (DeclSpace.MemberCache): Moved here from IMemberFinder.
16635 * typemanager.cs (IMemberFinder): This interface is now only used by
16636 classes which actually support the member cache.
16637 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16638 since we only put DeclSpaces into this Hashtable.
16639 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16640 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16642 2002-08-16 Martin Baulig <martin@gnome.org>
16644 * typemanager.cs (ICachingMemberFinder): Removed.
16645 (IMemberFinder.MemberCache): New property.
16646 (TypeManager.FindMembers): Merged this with RealFindMembers().
16647 This function will never be called from TypeManager.MemberLookup()
16648 so we can't use the cache here, just the IMemberFinder.
16649 (TypeManager.MemberLookup_FindMembers): Check whether the
16650 IMemberFinder has a MemberCache and call the cache's FindMembers
16652 (MemberCache): Rewrote larger parts of this yet another time and
16653 cleaned it up a bit.
16655 2002-08-15 Miguel de Icaza <miguel@ximian.com>
16657 * driver.cs (LoadArgs): Support quoting.
16659 (Usage): Show the CSC-like command line arguments.
16661 Improved a few error messages.
16663 2002-08-15 Martin Baulig <martin@gnome.org>
16665 * typemanager.cs (IMemberContainer.Type): New property.
16666 (IMemberContainer.IsInterface): New property.
16668 The following changes are conditional to BROKEN_RUNTIME, which is
16669 defined at the top of the file.
16671 * typemanager.cs (MemberCache.MemberCache): Don't add the base
16672 class'es members, but add all members from TypeHandle.ObjectType
16673 if we're an interface.
16674 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16675 is the current type.
16676 (MemberCache.CacheEntry.Container): Removed this field.
16677 (TypeHandle.GetMembers): Include inherited members.
16679 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16681 * typemanager.cs: fixed compilation and added a comment on a field that
16684 2002-08-15 Martin Baulig <martin@gnome.org>
16686 * class.cs (ConstructorInitializer.Resolve): In the
16687 Expression.MemberLookup call, use the queried_type as
16690 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16691 declared' attribute, it's always true.
16692 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16693 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16694 temporary wrapper for FindMembers which tells MemberLookup whether
16695 members from the base classes are included in the return value.
16696 This will go away soon.
16697 (TypeManager.MemberLookup): Use this temporary hack here; once the
16698 new MemberCache is completed, we don't need to do the DeclaredOnly
16699 looping here anymore since the MemberCache will take care of this.
16700 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16701 (MemberCache): When creating the MemberCache for a class, get
16702 members from the current class and all its base classes.
16703 (MemberCache.CacheEntry.Container): New field. This is a
16704 temporary hack until the Mono runtime is fixed to distinguish
16705 between ReflectedType and DeclaringType. It allows us to use MCS
16706 with both the MS runtime and the unfixed Mono runtime without
16707 problems and without accecting performance.
16708 (MemberCache.SearchMembers): The DeclaredOnly looping from
16709 TypeManager.MemberLookup is now done here.
16711 2002-08-14 Martin Baulig <martin@gnome.org>
16713 * statement.cs (MyStructInfo.MyStructInfo): Don't call
16714 Type.GetFields on dynamic types but get the fields from the
16715 corresponding TypeContainer.
16716 (MyStructInfo.GetStructInfo): Added check for enum types.
16718 * typemanager.cs (MemberList.IsSynchronized): Implemented.
16719 (MemberList.SyncRoot): Implemented.
16720 (TypeManager.FilterWithClosure): No need to check permissions if
16721 closure_start_type == closure_invocation_type, don't crash if
16722 closure_invocation_type is null.
16724 2002-08-13 Martin Baulig <martin@gnome.org>
16726 Rewrote TypeContainer.FindMembers to use a member cache. This
16727 gives us a speed increase of about 35% for the self-hosting MCS
16728 build and of about 15-20% for the class libs (both on GNU/Linux).
16730 * report.cs (Timer): New class to get enhanced profiling. This
16731 whole class is "TIMER" conditional since it remarkably slows down
16734 * class.cs (MemberList): New class. This is an IList wrapper
16735 which we're now using instead of passing MemberInfo[]'s around to
16736 avoid copying this array unnecessarily.
16737 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16738 (ICachingMemberFinder, IMemberContainer): New interface.
16739 (TypeManager.FilterWithClosure): If `criteria' is null, the name
16740 has already been checked, otherwise use it for the name comparision.
16741 (TypeManager.FindMembers): Renamed to RealMemberFinder and
16742 provided wrapper which tries to use ICachingMemberFinder.FindMembers
16743 if possible. Returns a MemberList, not a MemberInfo [].
16744 (TypeHandle): New class, implements IMemberContainer. We create
16745 one instance of this class per type, it contains a MemberCache
16746 which is used to do the member lookups.
16747 (MemberCache): New class. Each instance of this class contains
16748 all members of a type and a name-based hash table.
16749 (MemberCache.FindMembers): This is our new member lookup
16750 function. First, it looks up all members of the requested name in
16751 the hash table. Then, it walks this list and sorts out all
16752 applicable members and returns them.
16754 2002-08-13 Martin Baulig <martin@gnome.org>
16756 In addition to a nice code cleanup, this gives us a performance
16757 increase of about 1.4% on GNU/Linux - not much, but it's already
16758 half a second for the self-hosting MCS compilation.
16760 * typemanager.cs (IMemberFinder): New interface. It is used by
16761 TypeManager.FindMembers to call FindMembers on a TypeContainer,
16762 Enum, Delegate or Interface.
16763 (TypeManager.finder_to_member_finder): New PtrHashtable.
16764 (TypeManager.finder_to_container): Removed.
16765 (TypeManager.finder_to_delegate): Removed.
16766 (TypeManager.finder_to_interface): Removed.
16767 (TypeManager.finder_to_enum): Removed.
16769 * interface.cs (Interface): Implement IMemberFinder.
16771 * delegate.cs (Delegate): Implement IMemberFinder.
16773 * enum.cs (Enum): Implement IMemberFinder.
16775 * class.cs (TypeContainer): Implement IMemberFinder.
16777 2002-08-12 Martin Baulig <martin@gnome.org>
16779 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16781 2002-08-12 Martin Baulig <martin@gnome.org>
16783 * ecore.cs (ITypeExpression): New interface for expressions which
16785 (TypeExpression): Renamed to TypeLookupExpression.
16786 (Expression.DoResolve): If we're doing a types-only lookup, the
16787 expression must implement the ITypeExpression interface and we
16788 call DoResolveType() on it.
16789 (SimpleName): Implement the new ITypeExpression interface.
16790 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16791 hack, the situation that we're only looking up types can't happen
16792 anymore when this method is called. Moved the type lookup code to
16793 DoResolveType() and call it.
16794 (SimpleName.DoResolveType): This ITypeExpression interface method
16795 is now doing the types-only lookup.
16796 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16797 (ResolveFlags): Added MaskExprClass.
16799 * expression.cs (MemberAccess): Implement the ITypeExpression
16801 (MemberAccess.DoResolve): Added support for a types-only lookup
16802 when we're called via ITypeExpression.DoResolveType().
16803 (ComposedCast): Implement the ITypeExpression interface.
16805 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
16806 Expression.Resolve() with ResolveFlags.Type instead.
16808 2002-08-12 Martin Baulig <martin@gnome.org>
16810 * interface.cs (Interface.Define): Apply attributes.
16812 * attribute.cs (Attribute.ApplyAttributes): Added support for
16813 interface attributes.
16815 2002-08-11 Martin Baulig <martin@gnome.org>
16817 * statement.cs (Block.Emit): Only check the "this" variable if we
16818 do not always throw an exception.
16820 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
16821 whether the property has a set accessor.
16823 2002-08-11 Martin Baulig <martin@gnome.org>
16825 Added control flow analysis support for structs.
16827 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
16828 with control flow analysis turned off.
16829 (IVariable): New interface.
16830 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
16831 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
16832 (FieldExpr.DoResolve): Resolve the instance expression with flow
16833 analysis turned off and do the definite assignment check after the
16834 resolving when we know what the expression will resolve to.
16836 * expression.cs (LocalVariableReference, ParameterReference):
16837 Implement the new IVariable interface, only call the flow analysis
16838 code if ec.DoFlowAnalysis is true.
16839 (This): Added constructor which takes a Block argument. Implement
16840 the new IVariable interface.
16841 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
16842 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
16843 This does the definite assignment checks for struct members.
16845 * class.cs (Constructor.Emit): If this is a non-static `struct'
16846 constructor which doesn't have any initializer, call
16847 Block.AddThisVariable() to tell the flow analysis code that all
16848 struct elements must be initialized before control returns from
16851 * statement.cs (MyStructInfo): New public class.
16852 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
16853 argument to this indexer. If non-zero, check an individual struct
16854 member, not the whole struct.
16855 (FlowBranching.CheckOutParameters): Check struct members.
16856 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
16857 overloaded versions of these methods which take an additional
16858 `int field_idx' argument to check struct members.
16859 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
16860 overloaded versions of these methods which take an additional
16861 `string field_name' argument to check struct member.s
16862 (VariableInfo): Implement the IVariable interface.
16863 (VariableInfo.StructInfo): New public property. Returns the
16864 MyStructInfo instance of the variable if it's a struct or null.
16865 (Block.AddThisVariable): New public method. This is called from
16866 Constructor.Emit() for non-static `struct' constructor which do
16867 not have any initializer. It creates a special variable for the
16868 "this" instance variable which will be checked by the flow
16869 analysis code to ensure that all of the struct's fields are
16870 initialized before control returns from the constructor.
16871 (UsageVector): Added support for struct members. If a
16872 variable/parameter is a struct with N members, we reserve a slot
16873 in the usage vector for each member. A struct is considered fully
16874 initialized if either the struct itself (slot 0) or all its
16875 members are initialized.
16877 2002-08-08 Martin Baulig <martin@gnome.org>
16879 * driver.cs (Driver.MainDriver): Only report an error CS5001
16880 if there were no compilation errors.
16882 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
16883 `UnsafeContext' property to determine whether the parent is in
16884 unsafe context rather than checking the parent's ModFlags:
16885 classes nested in an unsafe class are unsafe as well.
16887 2002-08-08 Martin Baulig <martin@gnome.org>
16889 * statement.cs (UsageVector.MergeChildren): Distinguish between
16890 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
16891 we return. Added test17() and test18() to test-154.cs.
16893 2002-08-08 Martin Baulig <martin@gnome.org>
16895 * typemanager.cs (TypeManager.FilterWithClosure): If we have
16896 Family access, make sure the invoking type isn't a subclass of the
16897 queried type (that'd be a CS1540).
16899 * ecore.cs (Expression.MemberLookup): Added overloaded version of
16900 this method which takes an additional `Type invocation_type'.
16902 * expression.cs (BaseAccess.DoResolve): Use the base type as
16903 invocation and query type.
16904 (MemberAccess.DoResolve): If the lookup failed and we're about to
16905 report a CS0122, try a lookup with the ec.ContainerType - if this
16906 succeeds, we must report a CS1540.
16908 2002-08-08 Martin Baulig <martin@gnome.org>
16910 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
16911 (MethodGroupExpr): Implement the IMemberExpr interface.
16913 * expression (MemberAccess.ResolveMemberAccess): No need to have
16914 any special code for MethodGroupExprs anymore, they're now
16917 2002-08-08 Martin Baulig <martin@gnome.org>
16919 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
16920 Family, FamANDAssem and FamORAssem permissions.
16921 (TypeManager.IsSubclassOrNestedChildOf): New public method.
16923 2002-08-08 Martin Baulig <martin@gnome.org>
16925 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
16926 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
16929 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
16931 * driver.cs: implemented /resource option to embed managed resources.
16933 2002-08-07 Martin Baulig <martin@gnome.org>
16935 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
16936 (FieldBase.HasFieldInitializer): New public property.
16937 (FieldBase.GetInitializerExpression): New public method. Resolves and
16938 returns the field initializer and makes sure it is only resolved once.
16939 (TypeContainer.EmitFieldInitializers): Call
16940 FieldBase.GetInitializerExpression to get the initializer, this ensures
16941 that it isn't resolved multiple times.
16943 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
16944 the resolving process (SimpleName/MemberLookup) that we're currently
16945 emitting a field initializer (which must not access any instance members,
16946 this is an error CS0236).
16948 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
16949 argument, if the `IsFieldInitializer' flag is set, we must report and
16950 error CS0236 and not an error CS0120.
16952 2002-08-07 Martin Baulig <martin@gnome.org>
16954 * ecore.cs (IMemberExpr): New public interface.
16955 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
16956 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
16957 if the expression is an IMemberExpr.
16959 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
16960 to be null, implicitly default to `this' if we're non-static in
16961 this case. Simplified the code a lot by using the new IMemberExpr
16962 interface. Also fixed bug #28176 here.
16964 2002-08-06 Martin Baulig <martin@gnome.org>
16966 * cs-parser.jay (SimpleLookup): Removed. We need to create
16967 ParameterReferences during semantic analysis so that we can do a
16968 type-only search when resolving Cast, TypeOf and SizeOf.
16969 (block): Pass the `current_local_parameters' to the Block's
16972 * class.cs (ConstructorInitializer): Added `Parameters parameters'
16973 argument to the constructor.
16974 (ConstructorInitializer.Resolve): Create a temporary implicit
16975 block with the parameters.
16977 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
16978 references here if we aren't doing a type-only search.
16980 * statement.cs (Block): Added constructor which takes a
16981 `Parameters parameters' argument.
16982 (Block.Parameters): New public property.
16984 * support.cs (InternalParameters.Parameters): Renamed `parameters'
16985 to `Parameters' and made it public readonly.
16987 2002-08-06 Martin Baulig <martin@gnome.org>
16989 * ecore.cs (Expression.Warning): Made this public as well.
16991 * report.cs (Report.Debug): Print the contents of collections.
16993 2002-08-06 Martin Baulig <martin@gnome.org>
16995 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
16996 used to tell Resolve() which kinds of expressions it may return.
16997 (Expression.Resolve): Added overloaded version of this method which
16998 takes a `ResolveFlags flags' argument. This can be used to tell
16999 Resolve() which kinds of expressions it may return. Reports a
17001 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
17002 ResolveFlags.SimpleName.
17003 (Expression.Error118): Added overloaded version of this method which
17004 takes a `ResolveFlags flags' argument. It uses the flags to determine
17005 which kinds of expressions are allowed.
17007 * expression.cs (Argument.ResolveMethodGroup): New public method.
17008 Resolves an argument, but allows a MethodGroup to be returned.
17009 This is used when invoking a delegate.
17011 * TODO: Updated a bit.
17013 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17015 Fixed compilation with csc.
17017 * ecore.cs: Expression.Error made public. Is this correct? Should
17018 Warning be made public too?
17020 * expression.cs: use ea.Location instead of ea.loc.
17021 [FIXME: Filed as bug #28607: MCS must report these errors.]
17023 2002-08-06 Martin Baulig <martin@gnome.org>
17025 * ecore.cs (Expression.loc): Moved the location here instead of
17026 duplicating it in all derived classes.
17027 (Expression.Location): New public property.
17028 (Expression.Error, Expression.Warning): Made them non-static and
17029 removed the location argument.
17030 (Expression.Warning): Added overloaded version which takes an
17031 `int level' argument.
17032 (Expression.Error118): Make this non-static and removed the
17033 expression and location arguments.
17034 (TypeExpr): Added location argument to the constructor.
17036 * expression.cs (StaticCallExpr): Added location argument to
17038 (Indirection, PointerArithmetic): Likewise.
17039 (CheckedExpr, UnCheckedExpr): Likewise.
17040 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
17041 (StringPtr): Likewise.
17044 2002-08-05 Martin Baulig <martin@gnome.org>
17046 * expression.cs (BaseAccess.DoResolve): Actually report errors.
17048 * assign.cs (Assign.DoResolve): Check whether the source
17049 expression is a value or variable.
17051 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
17052 while resolving the corresponding blocks.
17054 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
17055 an error, don't silently return null.
17057 * statement.cs (Block.AddVariable): Do the error reporting here
17058 and distinguish between CS0128 and CS0136.
17059 (Block.DoResolve): Report all unused labels (warning CS0164).
17060 (LabeledStatement): Pass the location to the constructor.
17061 (LabeledStatement.HasBeenReferenced): New property.
17062 (LabeledStatement.Resolve): Set it to true here.
17064 * statement.cs (Return.Emit): Return success even after reporting
17065 a type mismatch error (CS0126 or CS0127), this is what csc does and
17066 it avoids confusing the users with any consecutive errors.
17068 2002-08-05 Martin Baulig <martin@gnome.org>
17070 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
17072 * const.cs (Const.LookupConstantValue): Catch circular definitions.
17074 * expression.cs (MemberAccess.DoResolve): Silently return if an
17075 error has already been reported.
17077 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
17078 error has already been reported.
17080 2002-08-05 Martin Baulig <martin@gnome.org>
17082 * statement.cs (UsageVector): Only initialize the `parameters'
17083 vector if we actually have any "out" parameters.
17085 2002-08-05 Martin Baulig <martin@gnome.org>
17087 * expression.cs (Binary.ResolveOperator): When combining delegates,
17088 they must have the same type.
17090 2002-08-05 Martin Baulig <martin@gnome.org>
17092 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
17093 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
17094 work with the ms runtime and we also don't need it: if we're a
17095 PropertyBuilder and not in the `indexer_arguments' hash, then we
17096 are a property and not an indexer.
17098 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
17099 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
17100 since the latter one doesn't work with the ms runtime.
17102 2002-08-03 Martin Baulig <martin@gnome.org>
17104 Fixed bugs #27998 and #22735.
17106 * class.cs (Method.IsOperator): New public field.
17107 (Method.CheckBase): Report CS0111 if there's already a method
17108 with the same parameters in the current class. Report CS0508 when
17109 attempting to change the return type of an inherited method.
17110 (MethodData.Emit): Report CS0179 if a method doesn't have a body
17111 and it's not marked abstract or extern.
17112 (PropertyBase): New abstract base class for Property and Indexer.
17113 (PropertyBase.CheckBase): Moved here from Property and made it work
17115 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
17116 the same so we can reuse it there.
17117 (Property, Indexer): Derive from PropertyBase.
17118 (MethodSignature.inheritable_property_signature_filter): New delegate
17119 to find properties and indexers.
17121 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
17122 argument and improved error reporting.
17124 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
17125 EmptyReadOnlyParameters and made it a property.
17127 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
17128 version of this method which takes a `PropertyInfo indexer'.
17129 (TypeManager.RegisterIndexer): New method.
17131 * class.cs: Added myself as author of this file :-)
17133 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17135 * class.cs: fixed compilation on windoze.
17137 2002-08-03 Martin Baulig <martin@gnome.org>
17139 * interface.cs (Interface.GetInterfaceBases): Check whether all
17140 base interfaces are at least as accessible than the current one.
17142 * class.cs (TypeContainer.GetClassBases): Check whether base types
17143 are at least as accessible than the current type.
17144 (TypeContainer.AsAccessible): Implemented and made non-static.
17145 (MemberBase.CheckParameters): Report errors if the accessibility
17148 * delegate.cs (Delegate.Delegate): The default visibility is
17149 internal for top-level types and private for nested types.
17150 (Delegate.Define): Report errors if the accessibility checks fail.
17152 * enum.cs (Enum.Enum): The default visibility is internal for
17153 top-level types and private for nested types.
17154 (Enum.DefineType): Compute the correct visibility.
17156 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
17157 function which takes a `bool is_toplevel' instead of a TypeContainer.
17159 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
17162 2002-08-02 Martin Baulig <martin@gnome.org>
17164 * expression.cs (LocalVariableReferenc): Added constructor which
17165 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
17166 (LocalVariableReference.IsReadOnly): New property.
17167 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
17168 variable is readonly, use our own readonly flag to do this; you can
17169 use the new constructor to get a writable reference to a read-only
17172 * cs-parser.jay (foreach_statement, using_statement): Get a writable
17173 reference to the local variable.
17175 2002-08-01 Miguel de Icaza <miguel@ximian.com>
17177 * rootcontext.cs (ResolveCore): Also include System.Exception
17179 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
17180 we reach an EmptyStatement.
17182 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
17185 * expression.cs (Binary.ResolveOperator): Check error result in
17188 use brtrue/brfalse directly and avoid compares to null.
17190 2002-08-02 Martin Baulig <martin@gnome.org>
17192 * class.cs (TypeContainer.Define): Define all nested interfaces here.
17193 Fixes bug #28407, added test-155.cs.
17195 2002-08-01 Martin Baulig <martin@gnome.org>
17197 * class.cs (Event.EmitDefaultMethod): Make this work with static
17198 events. Fixes #28311, added verify-3.cs.
17200 2002-08-01 Martin Baulig <martin@gnome.org>
17202 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
17203 `is_disposable' fields.
17204 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
17205 `hm.is_disposable' if we're using the collection pattern.
17206 (Foreach.EmitCollectionForeach): Use the correct type for the
17207 enumerator's local variable, only emit the try/finally block if
17208 necessary (fixes #27713).
17210 2002-08-01 Martin Baulig <martin@gnome.org>
17212 * ecore.cs (Expression.report118): Renamed to Error118 and made
17215 * statement.cs (Throw.Resolve): Check whether the expression is of
17216 the correct type (CS0118) and whether the type derives from
17217 System.Exception (CS0155).
17218 (Catch.Resolve): New method. Do the type lookup here and check
17219 whether it derives from System.Exception (CS0155).
17220 (Catch.CatchType, Catch.IsGeneral): New public properties.
17222 * typemanager.cs (TypeManager.exception_type): Added.
17224 2002-07-31 Miguel de Icaza <miguel@ximian.com>
17226 * driver.cs: Updated About function.
17228 2002-07-31 Martin Baulig <martin@gnome.org>
17230 Implemented Control Flow Analysis.
17232 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17233 (EmitContext.CurrentBranching): Added.
17234 (EmitContext.StartFlowBranching): Added.
17235 (EmitContext.EndFlowBranching): Added.
17236 (EmitContext.KillFlowBranching): Added.
17237 (EmitContext.IsVariableAssigned): Added.
17238 (EmitContext.SetVariableAssigned): Added.
17239 (EmitContext.IsParameterAssigned): Added.
17240 (EmitContext.SetParameterAssigned): Added.
17241 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17242 Added control flow analysis stuff here.
17244 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17245 resolve the expression as lvalue.
17246 (LocalVariableReference.DoResolve): Check whether the variable has
17247 already been assigned.
17248 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17249 the parameter as assigned here.
17250 (ParameterReference.DoResolve): Check whether the parameter has already
17252 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17253 expression as lvalue.
17255 * statement.cs (FlowBranching): New class for the flow analysis code.
17256 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17257 (LabeledStatement.IsDefined): New public property.
17258 (LabeledStatement.AddUsageVector): New public method to tell flow
17259 analyis that the label may be reached via a forward jump.
17260 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17262 (VariableInfo.Number): New public field. This is used by flow analysis
17263 to number all locals of a block.
17264 (Block.CountVariables): New public property. This is the number of
17265 local variables in this block (including the locals from all parent
17267 (Block.EmitMeta): Number all the variables.
17269 * statement.cs: Added flow analysis support to all classes.
17271 2002-07-31 Martin Baulig <martin@gnome.org>
17273 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
17274 To get debugging messages, compile mcs with /define:MCS_DEBUG and
17275 then use this argument.
17277 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17279 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17280 use this to specify /define options.
17282 2002-07-29 Martin Baulig <martin@gnome.org>
17284 * statement.cs (Fixed): Moved all code that does variable lookups
17285 and resolvings from Emit to Resolve.
17287 * statement.cs (For): Moved all code that does variable lookups
17288 and resolvings from Emit to Resolve.
17290 * statement.cs (Using): Moved all code that does variable lookups
17291 and resolvings from Emit to Resolve.
17293 2002-07-29 Martin Baulig <martin@gnome.org>
17295 * attribute.cs (Attribute.Resolve): Explicitly catch a
17296 System.NullReferenceException when creating the
17297 CustromAttributeBuilder and report a different warning message.
17299 2002-07-29 Martin Baulig <martin@gnome.org>
17301 * support.cs (ParameterData.ParameterName): Added method to
17302 get the name of a parameter.
17304 * typemanager.cs (TypeManager.IsValueType): New public method.
17306 2002-07-29 Martin Baulig <martin@gnome.org>
17308 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
17309 is a flag which specifies that it's either ref or out.
17310 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
17311 the out parameter to `out Parameter.Modifier mod', also set the
17312 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17314 * support.cs (InternalParameters.ParameterModifier): Distinguish
17315 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17316 Parameter.Modifier.ISBYREF flag if it's either ref or out.
17318 * expression.cs (Argument.GetParameterModifier): Distinguish
17319 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17320 Parameter.Modifier.ISBYREF flag if it's either ref or out.
17322 2002-07-29 Martin Baulig <martin@gnome.org>
17324 * expression.cs (ParameterReference.ParameterReference): Added
17325 `Location loc' argument to the constructor.
17327 * cs-parser.jay: Pass location to ParameterReference.
17329 2002-07-28 Miguel de Icaza <miguel@ximian.com>
17331 * statement.cs (Try): Initialize the location.
17333 * cs-parser.jay: pass location to Try.
17335 * expression.cs (Unary.Reduce): Change the prototype to return
17336 whether a constant fold could be performed or not. The result is
17337 returned in an out parameters. In the case of Indirection and
17338 AddressOf, we want to perform the full tests.
17340 2002-07-26 Miguel de Icaza <miguel@ximian.com>
17342 * statement.cs (Statement.Emit): Flag dead code.
17344 2002-07-27 Andrew Birkett <andy@nobugs.org>
17346 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17348 2002-07-27 Martin Baulig <martin@gnome.org>
17350 * class.cs (MethodData.Define): Put back call to
17351 TypeManager.AddMethod(), accidentally commented this out.
17353 * report.cs (Debug): New public method to print debugging information,
17354 this is `[Conditional ("DEBUG")]'.
17356 2002-07-26 Martin Baulig <martin@gnome.org>
17358 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17359 (switch_statement): Push the current_block to the switch_stack and
17360 pop it again when we're done with the switch.
17361 (switch_section): The new block is a child of the current_block.
17362 Fixes bug #24007, added test-152.cs.
17364 2002-07-27 Martin Baulig <martin@gnome.org>
17366 * expression.cs (Invocation.EmitArguments): When calling a varargs
17367 function with only its fixed arguments, we need to pass an empty
17370 2002-07-27 Martin Baulig <martin@gnome.org>
17372 Mono 0.13 has been released.
17374 2002-07-25 Miguel de Icaza <miguel@ximian.com>
17376 * driver.cs: Rename --resource to --linkres, because that is what
17377 we do currently, we dont support --resource yet.
17379 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17381 2002-07-25 Martin Baulig <martin@gnome.org>
17383 * class.cs (MethodData): New public class. This is a `method builder'
17384 class for a method or one accessor of a Property/Indexer/Event.
17385 (MethodData.GetMethodFlags): Moved here from MemberBase.
17386 (MethodData.ApplyAttributes): Likewise.
17387 (MethodData.ApplyObsoleteAttribute): Likewise.
17388 (MethodData.ApplyConditionalAttribute): Likewise.
17389 (MethodData.ApplyDllImportAttribute): Likewise.
17390 (MethodData.CheckAbstractAndExternal): Likewise.
17391 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17392 (MethodData.Emit): Formerly known as Method.Emit().
17393 (MemberBase): Moved everything which was specific to a single
17394 accessor/method to MethodData.
17395 (Method): Create a new MethodData and call Define() and Emit() on it.
17396 (Property, Indexer, Event): Create a new MethodData objects for each
17397 accessor and call Define() and Emit() on them.
17399 2002-07-25 Martin Baulig <martin@gnome.org>
17401 Made MethodCore derive from MemberBase to reuse the code from there.
17402 MemberBase now also checks for attributes.
17404 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17405 (MemberBase.GetMethodFlags): Moved here from class Method and marked
17407 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17408 `CallingConventions cc' and `Attributes opt_attrs' arguments.
17409 (MemberBase.ApplyAttributes): New virtual method; applies the
17410 attributes to a method or accessor.
17411 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17412 (MemberBase.ApplyConditionalAttribute): Likewise.
17413 (MemberBase.ApplyDllImportAttribute): Likewise.
17414 (MemberBase.CheckAbstractAndExternal): Likewise.
17415 (MethodCore.ParameterTypes): This is now a property instead of a
17416 method, it's initialized from DoDefineParameters().
17417 (MethodCore.ParameterInfo): Removed the set accessor.
17418 (MethodCore.DoDefineParameters): New protected virtual method to
17419 initialize ParameterTypes and ParameterInfo.
17420 (Method.GetReturnType): We can now simply return the MemberType.
17421 (Method.GetMethodFlags): Override the MemberBase version and add
17422 the conditional flags.
17423 (Method.CheckBase): Moved some code from Define() here, call
17424 DoDefineParameters() here.
17425 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17426 here to avoid some larger code duplication.
17427 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17428 ensure that abstract and external accessors don't declare a body.
17430 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17431 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17432 lookup in the attribute's parent classes, so we need to abort as soon
17433 as we found the first match.
17434 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17435 the attribute has no arguments.
17437 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17440 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17442 * cs-parser.jay: reverted previous patch.
17444 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17446 * cs-parser.jay: fixed bug #22119.
17448 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17450 * attribute.cs: fixed compilation. The error was:
17451 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
17452 be assigned to before control leaves the current method."
17453 [FIXME: Filed as bug #28186: MCS must report this error.]
17455 2002-07-25 Martin Baulig <martin@gnome.org>
17457 * attribute.cs (Attribute.Conditional_GetConditionName): New static
17458 method to pull the condition name ouf of a Conditional attribute.
17459 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17460 the obsolete message and error flag out of an Obsolete attribute.
17462 * class.cs (Method.GetMethodFlags): New public method to get the
17463 TypeManager.MethodFlags for this method.
17464 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17466 (Method.Define): Get and apply the Obsolete and Conditional attributes;
17467 if we're overriding a virtual function, set the new private variable
17468 `parent_method'; call the new TypeManager.AddMethod().
17470 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
17471 the MethodBuilder and the Method in a PtrHashtable.
17472 (TypeManager.builder_to_method): Added for this purpose.
17473 (TypeManager.MethodFlags): Added IsObsoleteError.
17474 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
17475 Obsolete and Conditional arguments in MethodBuilders. If we discover
17476 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
17477 the message from the attribute.
17479 2002-07-24 Martin Baulig <martin@gnome.org>
17481 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
17482 preprocessor directives, ensure that the argument to #define/#undef is
17483 exactly one identifier and that it's actually an identifier.
17485 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
17488 2002-07-24 Martin Baulig <martin@gnome.org>
17490 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
17491 initialize it to TypeManager.object_type in the constructor.
17492 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
17493 of the `hm.get_current' method if we're using the collection pattern.
17494 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
17495 for the explicit conversion to make it work when we're using the collection
17496 pattern and the `Current' property has a different return type than `object'.
17499 2002-07-24 Martin Baulig <martin@gnome.org>
17501 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17502 does not match, but don't report any errors. This method is called in
17503 order for all methods in a MethodGroupExpr until a matching method is
17504 found, so we don't want to bail out if the first method doesn't match.
17505 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17506 matches, report the 123. Fixes #28070.
17508 2002-07-24 Martin Baulig <martin@gnome.org>
17510 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17511 TypeManager.TypeToCoreType() to the top of the method so the
17512 following equality checks will work. Fixes #28107.
17514 2002-07-24 Martin Baulig <martin@gnome.org>
17516 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17517 operand is of type uint, and the other operand is of type sbyte,
17518 short or int, the operands are converted to type long." -
17519 Actually do what this comment already told us. Fixes bug #28106,
17522 2002-07-24 Martin Baulig <martin@gnome.org>
17524 * class.cs (MethodBase): New abstract class. This is now a base
17525 class for Property, Indexer and Event to avoid some code duplication
17526 in their Define() and DefineMethods() methods.
17527 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17528 generic methods for Define() and DefineMethods().
17529 (FieldBase): Derive from MemberBase, not MemberCore.
17530 (Property): Derive from MemberBase, not MemberCore.
17531 (Property.DefineMethod): Moved all the code from this method to the
17532 new MethodBase.DefineAccessor(), just call it with appropriate
17534 (Property.Define): Call the new Property.DoDefine(), this does some
17535 sanity checks and we don't need to duplicate the code everywhere.
17536 (Event): Derive from MemberBase, not MemberCore.
17537 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17538 accessors, this will also make them work with interface events.
17539 (Indexer): Derive from MemberBase, not MemberCore.
17540 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17541 (Indexer.Define): Use the new MethodBase functions.
17543 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17544 argument to the constructor.
17545 (Interface.FindMembers): Added support for interface events.
17546 (Interface.PopluateEvent): Implemented.
17548 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
17550 2002-07-22 Miguel de Icaza <miguel@ximian.com>
17552 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17553 but this is required to check for a method name being the same as
17554 the containing class.
17558 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17560 * interface.cs: initialize variable.
17562 2002-07-23 Martin Baulig <martin@gnome.org>
17564 Implemented the IndexerName attribute in interfaces.
17566 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17567 name if this is an explicit interface implementation.
17568 (Indexer.InterfaceIndexerName): New public variable. If we're
17569 implementing an interface indexer, this is the IndexerName in that
17570 interface. Otherwise, it's the IndexerName.
17571 (Indexer.DefineMethod): If we're implementing interface indexer,
17572 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
17573 and Pending.ImplementIndexer methods.
17574 (Indexer.Define): Also define the PropertyBuilder if we're
17575 implementing an interface indexer and this is neither an explicit
17576 interface implementation nor do the IndexerName match the one in
17579 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17580 If a method is defined here, then we always need to create a proxy
17581 for it. This is used when implementing interface indexers.
17582 (Pending.IsInterfaceIndexer): New public method.
17583 (Pending.ImplementIndexer): New public method.
17584 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17585 This is used when implementing interface indexers to define a proxy
17587 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17588 define a proxy if necessary.
17590 * interface.cs (Interface.IndexerName): New public variable.
17591 (Interface.PopulateIndexer): Set the IndexerName.
17592 (Interface.DefineIndexers): New private method. Populate all the
17593 indexers and make sure their IndexerNames match.
17595 * typemanager.cs (IndexerPropertyName): Added support for interface
17598 2002-07-22 Martin Baulig <martin@gnome.org>
17600 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17601 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17602 ret if HasReturnLabel.
17603 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17606 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17607 and set the ec.LoopBeginTryCatchLevel.
17608 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17609 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17610 the current ec.TryCatchLevel, the branch goes out of an exception
17611 block. In this case, we need to use Leave and not Br.
17613 2002-07-22 Martin Baulig <martin@gnome.org>
17615 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17616 block unless the block does not always return or it is contained in
17617 another try { ... } catch { ... } block. Fixes bug #26506.
17618 Added verify-1.cs to the test suite.
17620 2002-07-22 Martin Baulig <martin@gnome.org>
17622 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17623 then we do not always return. Fixes bug #24985.
17625 2002-07-22 Martin Baulig <martin@gnome.org>
17627 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17628 lookup on a per-class level; ie. walk up the class hierarchy until we
17629 found at least one applicable method, then choose the best among them.
17630 Fixes bug #24463 and test-29.cs.
17632 2002-07-22 Martin Baulig <martin@gnome.org>
17634 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17635 return types of the methods. The return type is not part of the
17636 signature and we must not check it to make the `new' modifier work.
17637 Fixes bug #27999, also added test-147.cs.
17638 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17640 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17641 on the method's return type.
17643 2002-07-21 Martin Baulig <martin@gnome.org>
17645 * assign.cs: Make this work if the rightmost source is a constant and
17646 we need to do an implicit type conversion. Also adding a few more tests
17647 to test-38.cs which should have caught this.
17649 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17650 target in the makefile for this. The makefile.gnu is primarily intended
17651 for end-users who don't want to debug the compiler.
17653 2002-07-21 Martin Baulig <martin@gnome.org>
17655 * assign.cs: Improved the Assign class so it can now handle embedded
17656 assignments (X = Y = Z = something). As a side-effect this'll now also
17657 consume less local variables. test-38.cs now passes with MCS, added
17658 a few new test cases to that test.
17660 2002-07-20 Martin Baulig <martin@gnome.org>
17662 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17663 instructions. Fixes bug #27977, also added test-146.cs.
17665 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17667 * cs-tokenizer.cs: fixed getHex ().
17669 2002-07-19 Martin Baulig <martin@gnome.org>
17671 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17672 not Type.GetType() to lookup the array type. This is needed when
17673 we're constructing an array of a user-defined type.
17674 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17675 single-dimensional arrays, but also for single-dimensial arrays of
17678 2002-07-19 Martin Baulig <martin@gnome.org>
17680 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17681 this function is called, it's not allowed to share LocalBuilders
17682 among ILGenerators.
17684 2002-07-19 Martin Baulig <martin@gnome.org>
17686 * expression.cs (Argument.Resolve): Report an error 118 when trying
17687 to pass a type as argument.
17689 2002-07-18 Martin Baulig <martin@gnome.org>
17691 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17692 Conv_R_Un for the signed `long' type.
17694 2002-07-15 Miguel de Icaza <miguel@ximian.com>
17696 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17697 `expr' for the temporary result, as that will fail if we do
17698 multiple resolves on the same expression.
17700 2002-07-05 Miguel de Icaza <miguel@ximian.com>
17702 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17703 ec.TypeContainer for looking up aliases.
17705 * class.cs (TypeContainer): Remove LookupAlias from here.
17707 * decl.cs (DeclSpace); Move here.
17709 2002-07-01 Miguel de Icaza <miguel@ximian.com>
17711 * class.cs (FindMembers): Only call filter if the constructor
17712 bulider is not null.
17714 Also handle delegates in `NestedTypes' now. Now we will perform
17715 type lookups using the standard resolution process. This also
17718 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17719 This uses Expressions (the limited kind that can be parsed by the
17720 tree) instead of strings.
17722 * expression.cs (ComposedCast.ToString): Implement, used to flag
17723 errors since now we have to render expressions.
17725 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
17728 * ecore.cs (SimpleName.ToString): ditto.
17730 * cs-parser.jay: Instead of using strings to assemble types, use
17731 Expressions to assemble the type (using SimpleName, ComposedCast,
17732 MemberAccess). This should fix the type lookups in declarations,
17733 because we were using a different code path for this.
17735 * statement.cs (Block.Resolve): Continue processing statements
17736 even when there is an error.
17738 2002-07-17 Miguel de Icaza <miguel@ximian.com>
17740 * class.cs (Event.Define): Also remove the `remove' method from
17741 the list of pending items.
17743 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17744 generate more compact code.
17746 2002-07-17 Martin Baulig <martin@gnome.org>
17748 * const.cs (Const.LookupConstantValue): Add support for constant
17749 `unchecked' and `checked' expressions.
17750 Also adding test case test-140.cs for this.
17752 2002-07-17 Martin Baulig <martin@gnome.org>
17754 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17755 check whether mi.ReturnType implements the IEnumerator interface; the
17756 `==' and the IsAssignableFrom() will fail in this situation.
17758 2002-07-16 Ravi Pratap <ravi@ximian.com>
17760 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
17763 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17765 * expression.cs: fixed bug #27811.
17767 2002-07-14 Miguel de Icaza <miguel@ximian.com>
17769 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17770 Molaro: when we are a ref, the value already contains a pointer
17771 value, do not take the address of it.
17773 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17774 * removed mb-parser.jay and mb-tokenizer.cs
17776 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17778 * expression.cs: check against the building corlib void type.
17780 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17782 * ecore.cs: fix for valuetype static readonly fields: when
17783 initializing them, we need their address, not the address of a copy.
17785 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17787 * typemanager.cs: register also enum_type in corlib.
17789 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17791 * class.cs: allow calling this (but not base) initializers in structs.
17793 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17795 * ecore.cs: make sure we compare against the building base types
17798 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
17800 * typemanager.cs: fix TypeToCoreType() to handle void and object
17801 (corlib gets no more typerefs after this change).
17803 2002-07-12 Miguel de Icaza <miguel@ximian.com>
17805 * expression.cs (ArrayCreation.EmitArrayArguments): use
17806 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
17808 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
17809 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
17810 array indexes, the runtime actually forbids them.
17812 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
17813 for array arguments here.
17815 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
17816 instead of the default for ValueTypes.
17818 (New.DoEmit): Use IsValueType instead of
17819 IsSubclassOf (value_type)
17820 (New.DoResolve): ditto.
17821 (Invocation.EmitCall): ditto.
17823 * assign.cs (Assign): ditto.
17825 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
17826 Statements *are* currently doing part of their resolution during
17829 Expressions do always resolve during resolve, but statements are
17830 only required to propagate resolution to their children.
17832 2002-07-11 Miguel de Icaza <miguel@ximian.com>
17834 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
17836 (LoadAssembly): Do not add the dll if it is already specified
17838 (MainDriver): Add the System directory to the link path at the end,
17839 after all the other -L arguments.
17841 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
17842 wrong opcode for loading bytes and bools (ldelem.i1 instead of
17843 ldelem.u1) and using the opposite for sbytes.
17845 This fixes Digger, and we can finally run it.
17847 * driver.cs (UnixParseOption): Move the option parsing here.
17848 (CSCParseOption): Implement CSC-like parsing of options.
17850 We now support both modes of operation, the old Unix way, and the
17851 new CSC-like way. This should help those who wanted to make cross
17852 platform makefiles.
17854 The only thing broken is that /r:, /reference: and /lib: are not
17855 implemented, because I want to make those have the same semantics
17856 as the CSC compiler has, and kill once and for all the confussion
17857 around this. Will be doing this tomorrow.
17859 * statement.cs (Unsafe.Resolve): The state is checked during
17860 resolve, not emit, so we have to set the flags for IsUnsfe here.
17862 2002-07-10 Miguel de Icaza <miguel@ximian.com>
17864 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
17865 not catch the Error_ObjectRefRequired in SimpleName (as it is
17866 possible to have a class/instance variable name that later gets
17867 deambiguated), we have to check this here.
17869 2002-07-10 Ravi Pratap <ravi@ximian.com>
17871 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
17872 make static and put into Expression.
17874 (Event.Define): Register the private field of the event with the
17875 TypeManager so that GetFieldFromEvent can get at it.
17877 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
17878 keep track of the private field associated with an event which
17881 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
17884 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
17886 2002-07-10 Miguel de Icaza <miguel@ximian.com>
17888 * expression.cs (Binary.EmitBranchable): this routine emits the
17889 Binary expression in a branchable context. This basically means:
17890 we need to branch somewhere, not just get the value on the stack.
17892 This works together with Statement.EmitBoolExpression.
17894 * statement.cs (Statement.EmitBoolExpression): Use
17897 2002-07-09 Miguel de Icaza <miguel@ximian.com>
17899 * statement.cs (For): Reduce the number of jumps in loops.
17901 (For): Implement loop inversion for the For statement.
17903 (Break): We can be breaking out of a Try/Catch controlled section
17904 (foreach might have an implicit try/catch clause), so we need to
17905 use Leave instead of Br.
17907 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
17908 now). If the instace expression supports IMemoryLocation, we use
17909 the AddressOf method from the IMemoryLocation to extract the
17910 address instead of emitting the instance.
17912 This showed up with `This', as we were emitting the instance
17913 always (Emit) instead of the Address of This. Particularly
17914 interesting when This is a value type, as we dont want the Emit
17915 effect (which was to load the object).
17917 2002-07-08 Miguel de Icaza <miguel@ximian.com>
17919 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
17921 * statement.cs (Checked): Set the CheckedState during the resolve
17922 process too, as the ConvCast operations track the checked state on
17923 the resolve process, and not emit.
17925 * cs-parser.jay (namespace_member_declaration): Flag that we have
17926 found a declaration when we do. This is used to flag error 1529
17928 * driver.cs: Report ok when we display the help only.
17930 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
17932 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
17934 2002-07-04 Miguel de Icaza <miguel@ximian.com>
17936 * cs-tokenizer.cs (define): We also have to track locally the
17937 defines. AllDefines is just used for the Conditional Attribute,
17938 but we also need the local defines for the current source code.
17940 2002-07-03 Miguel de Icaza <miguel@ximian.com>
17942 * statement.cs (While, For, Do): These loops can exit through a
17943 Break statement, use this information to tell whether the
17944 statement is the last piece of code.
17946 (Break): Flag that we break.
17948 * codegen.cs (EmitContexts): New `Breaks' state variable.
17950 2002-07-03 Martin Baulig <martin@gnome.org>
17952 * class.cs (TypeContainer.MethodModifiersValid): Allow override
17953 modifiers in method declarations in structs. Otherwise, you won't
17954 be able to override things like Object.Equals().
17956 2002-07-02 Miguel de Icaza <miguel@ximian.com>
17958 * class.cs (Method, Property, Indexer): Do not allow the public
17959 modifier to be used in explicit interface implementations.
17961 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
17962 override modifiers in method declarations in structs
17964 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
17966 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
17967 integer or real overflow, report an error
17969 2002-07-02 Martin Baulig <martin@gnome.org>
17971 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
17972 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
17973 to tell the runtime about our newly created System.Object and
17974 System.ValueType types.
17976 2002-07-02 Miguel de Icaza <miguel@ximian.com>
17978 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
17979 struct instead of Ldarg/Starg.
17981 2002-07-02 Martin Baulig <martin@gnome.org>
17983 * expression.cs (Indirection.Indirection): Call
17984 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
17986 2002-07-02 Martin Baulig <martin@gnome.org>
17988 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
17989 ValueType, call TypeManager.TypeToCoreType() on it.
17990 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
17991 the OpCodes.Newarr argument.
17993 2002-07-02 Martin Baulig <martin@gnome.org>
17995 * expression.cs (Invocation.EmitCall): When compiling corlib,
17996 replace all calls to the system's System.Array type to calls to
17997 the newly created one.
17999 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
18000 System.Array methods.
18001 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
18002 from the system's System.Array type which must be replaced.
18004 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
18006 * typemanager.cs: load unverifiable_code_ctor so we can build
18007 corlib using the correct type. Avoid using GetTypeCode() with
18009 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
18010 TypeManager.object_type to allow building corlib.
18012 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
18014 * ecore.cs: handle System.Enum separately in LoadFromPtr().
18016 2002-07-01 Martin Baulig <martin@gnome.org>
18018 * class.cs: Make the last change actually work, we need to check
18019 whether `ifaces != null' to avoid a crash.
18021 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18023 * class.cs: when we build structs without fields that implement
18024 interfaces, we need to add the interfaces separately, since there is
18025 no API to both set the size and add the interfaces at type creation
18028 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18030 * expression.cs: the dimension arguments to the array constructors
18031 need to be converted if they are a long.
18033 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
18035 * class.cs: don't emit ldarg.0 if there is no parent constructor
18036 (fixes showstopper for corlib).
18038 2002-06-29 Martin Baulig <martin@gnome.org>
18040 MCS now compiles corlib on GNU/Linux :-)
18042 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
18043 ie. check for MethodImplOptions.InternalCall.
18045 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
18046 and TypeManager.attribute_type are null, so we must explicitly check
18047 whether parent is not null to find out whether it's an attribute type.
18048 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
18049 and SetBuilder, not only if the property is neither abstract nor external.
18050 This is necessary to set the MethodImplOptions on the accessor methods.
18051 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
18052 SetBuilder, see Property.Emit().
18054 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
18055 populate "System.Object", "System.ValueType" and "System.Attribute" since
18056 they've already been populated from BootCorlib_PopulateCoreTypes().
18058 2002-06-29 Martin Baulig <martin@gnome.org>
18060 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
18061 is the NullLiteral, we also need to make sure that target_type is not
18064 2002-06-29 Martin Baulig <martin@gnome.org>
18066 * rootcontext.cs (RootContext.ResolveCore): We must initialize
18067 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
18068 before calling BootstrapCorlib_ResolveDelegate ().
18070 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18072 * statement.cs: fixed build-breaker. All tests passed ok.
18074 2002-06-27 Martin Baulig <martin@gnome.org>
18076 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
18077 for System.Decimal when compiling corlib.
18079 2002-06-27 Martin Baulig <martin@gnome.org>
18081 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
18082 switch blocks which contain nothing but a default clause.
18084 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
18086 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
18088 2002-06-27 Martin Baulig <martin@gnome.org>
18090 * ecore.cs (PropertyExpr.PropertyExpr): Call
18091 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
18093 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
18094 is already a TypeBuilder.
18096 2002-06-27 Martin Baulig <martin@gnome.org>
18098 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
18099 `target_type == TypeManager.array_type', not IsAssignableFrom() in
18100 the "from an array-type to System.Array" case. This makes it work
18101 when compiling corlib.
18103 2002-06-27 Martin Baulig <martin@gnome.org>
18105 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
18106 non-static PropertyExpr, set its InstanceExpression. This makes
18107 the `ICollection.Count' property work in System/Array.cs.
18109 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
18111 * driver.cs: Made error handling more consistent. Errors now
18112 tracked by Report class, so many methods which used to return int
18113 now return void. Main() now prints success/failure and
18114 errors/warnings message.
18116 Renamed '--probe' compiler argument to '--expect-error'. Removed
18117 the magic number return values (123 and 124). Now, if the
18118 expected error occurs, the compiler exits with success (exit value
18119 0). If the compilation completes without seeing that particular
18120 error, the compiler exits with failure (exit value 1). The
18121 makefile in mcs/errors has been changed to handle the new behaviour.
18123 * report.cs: Made 'expected error' number a property and renamed
18124 it from 'Probe' to 'ExpectedError'.
18126 * genericparser.cs: Removed error handling support, since it is
18127 now all done by Report class.
18129 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
18130 class, so parse() no longer returns an int.
18132 * namespace.cs: Use Report.Error instead of GenericParser.error
18134 2002-06-22 Miguel de Icaza <miguel@ximian.com>
18136 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
18137 TypeContainer.AddOperator): At the front of the list put the
18138 explicit implementations, so they get resolved/defined first.
18140 2002-06-21 Miguel de Icaza <miguel@ximian.com>
18142 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
18143 interface type is implemented by this TypeContainer. Used during
18144 explicit interface implementation.
18146 (Property.Define, Indexer.Define, Method.Define): Validate that
18147 the given interface in the explicit implementation is one of the
18148 base classes for the containing type.
18150 Also if we are explicitly implementing an interface, but there is
18151 no match in the pending implementation table, report an error.
18153 (Property.Define): Only define the property if we are
18154 not explicitly implementing a property from an interface. Use the
18155 correct name also for those properties (the same CSC uses,
18156 although that is really not needed).
18158 (Property.Emit): Do not emit attributes for explicitly implemented
18159 properties, as there is no TypeBuilder.
18161 (Indexer.Emit): ditto.
18163 Hiding then means that we do not really *implement* a pending
18164 implementation, which makes code fail.
18166 2002-06-22 Martin Baulig <martin@gnome.org>
18168 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
18169 the return value of Object.GetType(). [FIXME: we need to do this whenever
18170 we get a type back from the reflection library].
18172 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
18174 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
18176 2002-06-20 Miguel de Icaza <miguel@ximian.com>
18178 * attribute.cs: Return null if we can not look up the type.
18180 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
18181 the interface types found.
18183 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
18184 interface types found.
18186 * typemanager.cs (GetInterfaces): Make this routine returns alll
18187 the interfaces and work around the lame differences between
18188 System.Type and System.Reflection.Emit.TypeBuilder in the results
18189 result for GetInterfaces.
18191 (ExpandInterfaces): Given an array of interface types, expand and
18192 eliminate repeated ocurrences of an interface. This expands in
18193 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
18196 2002-06-21 Martin Baulig <martin@gnome.org>
18198 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
18201 2002-06-21 Martin Baulig <martin@gnome.org>
18203 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
18204 and called with one of the core types, return the corresponding typebuilder for
18207 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18210 2002-06-21 Martin Baulig <martin@gnome.org>
18212 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18213 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18214 (Expression.ConvertReferenceExplicit): Likewise.
18216 * expression.cs (ElementAccess.DoResolve): Likewise.
18217 (ElementAccess.DoResolveLValue): Likewise.
18219 2002-06-10 Martin Baulig <martin@gnome.org>
18221 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18222 add the "value" parameter to the parameter list.
18224 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18227 2002-06-19 Miguel de Icaza <miguel@ximian.com>
18229 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18230 the argument to an int, uint, long or ulong, per the spec. Also
18231 catch negative constants in array creation.
18233 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18235 * class.cs: do not allow the same interface to appear twice in
18236 the definition list.
18238 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18240 * ecore.cs: don't use ldlen with System.Array.
18242 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18244 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18246 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18248 * modifiers.cs: produce correct field attributes for protected
18249 internal. Easy fix so miguel can work on ther harder stuff:-)
18251 2002-06-18 Miguel de Icaza <miguel@ximian.com>
18253 * pending.cs: New file. Move the code from class.cs here.
18254 Support clearning the pending flag for all methods (when not doing
18255 explicit interface implementation).
18257 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18259 * rootcontext.cs: added a couple more types needed to bootstrap.
18261 2002-06-17 Miguel de Icaza <miguel@ximian.com>
18263 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18264 constructor in the type, instead of any constructor in the type
18265 hierarchy. Thanks to Paolo for finding this bug (it showed up as
18266 a bug in the Mono runtime when applying the params attribute).
18268 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18269 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18271 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
18273 * expression.cs (Unary.ResolveOperator): Use TypeManager
18274 to resolve the type.
18276 2002-06-13 Ravi Pratap <ravi@ximian.com>
18278 * cs-parser.jay (enum_member_declaration): Pass in the attributes
18281 * enum.cs (AddEnumMember): Add support to store the attributes associated
18282 with each member too.
18284 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18285 field builders too - this takes care of the enum member case.
18287 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
18289 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
18290 address-of operator on both value types and pointers.
18292 2002-06-10 Martin Baulig <martin@gnome.org>
18294 * interface.cs (Interface.PopulateIndexer): Add the indexer's
18295 PropertyBuilder to the `property_builders' list.
18297 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
18298 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
18299 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
18300 find any indexers which are inherited from an interface.
18302 2002-06-09 Martin Baulig <martin@gnome.org>
18304 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
18305 the same type as the constant if necessary. There's also a test-130.cs
18308 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
18310 * typemanager.cs (TypeManager.ChangeType): Previously known as
18311 Enum.ChangeEnumType().
18313 2002-06-09 Martin Baulig <martin@gnome.org>
18315 * expression.cs (Cast.TryReduce): Added support for consts.
18317 2002-06-08 Ravi Pratap <ravi@ximian.com>
18319 * class.cs (Accessor): Hold attributes information so we can pass
18322 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18323 Modify to pass in attributes attached to the methods.
18325 (add_accessor_declaration, remove_accessor_declaration): Ditto.
18327 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18328 to handle the Accessor kind :-)
18330 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18332 2002-06-08 Martin Baulig <martin@gnome.org>
18334 * expression.cs (Unary.TryReduceNegative): Added support for
18337 2002-06-08 Martin Baulig <martin@gnome.org>
18339 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18340 name can't be found in the `defined_names' - the caller will do a
18341 MemberLookup in this case and thus find methods in System.Enum
18342 such as Enum.IsDefined().
18344 2002-06-08 Martin Baulig <martin@gnome.org>
18346 * enum.cs (Enum.ChangeEnumType): This is a custom version of
18347 Convert.ChangeType() which works with TypeBuilder created types.
18348 (Enum.LookupEnumValue, Enum.Define): Use it here.
18350 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18351 `TypeBuilder.BaseType != null' check.
18352 (TypeContainer.FindMembers): Only lookup parent members if we
18353 actually have a parent.
18354 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18355 (ConstructorInitializer.Resolve): Likewise.
18357 * interface.cs (Interface.FindMembers): Added
18358 `TypeBuilder.BaseType != null' check.
18360 * rootcontext.cs (RootContext.ResolveCore): Added
18361 "System.Runtime.CompilerServices.IndexerNameAttribute" to
18362 classes_second_stage.
18364 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18365 debug_type and trace_type when compiling with --nostdlib.
18367 2002-06-07 Martin Baulig <martin@gnome.org>
18369 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18370 (AddField): Set it to true when adding a non-static field.
18371 (DefineType): Use `have_nonstatic_fields' to find out whether we
18372 have non-static fields, not `Fields != null'.
18374 2002-06-02 Miguel de Icaza <miguel@ximian.com>
18376 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18377 dereferencing a null on the static-field code path)
18379 2002-05-30 Martin Baulig <martin@gnome.org>
18381 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18382 to take command line arguments. Use reflection to call the new
18383 custom `Initialize' function on the symbol writer and pass it the
18384 command line arguments.
18386 * driver.cs (--debug-args): New command line argument to pass command
18387 line arguments to the symbol writer.
18389 2002-05-28 Miguel de Icaza <miguel@ximian.com>
18391 * assign.cs (DoResolve): Forgot to do the implicit conversion to
18392 the target type for indexers and properties. Thanks to Joe for
18395 2002-05-27 Miguel de Icaza <miguel@ximian.com>
18397 * typemanager.cs (MethodFlags): returns the method flags
18398 (Obsolete/ShouldIgnore) that control warning emission and whether
18399 the invocation should be made, or ignored.
18401 * expression.cs (Invocation.Emit): Remove previous hack, we should
18402 not do this on matching a base type, we should do this based on an attribute
18404 Only emit calls to System.Diagnostics.Debug and
18405 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18406 on the command line.
18408 * rootcontext.cs: Global settings for tracing and debugging.
18410 * cs-tokenizer.cs (define): New utility function to track
18411 defines. Set the global settings for TRACE and DEBUG if found.
18413 2002-05-25 Ravi Pratap <ravi@ximian.com>
18415 * interface.cs (Populate*): Pass in the TypeContainer as well as
18416 the DeclSpace as parameters so that we can create EmitContexts and
18417 then use that to apply attributes etc.
18419 (PopulateMethod, PopulateEvent, PopulateProperty)
18420 (PopulateIndexer): Apply attributes everywhere.
18422 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18425 (ApplyAttributes): Update accordingly.
18427 We now apply interface attributes for all members too.
18429 2002-05-26 Miguel de Icaza <miguel@ximian.com>
18431 * class.cs (Indexer.Define); Correctly check if we are explicit
18432 implementation (instead of checking the Name for a ".", we
18433 directly look up if the InterfaceType was specified).
18435 Delay the creation of the PropertyBuilder.
18437 Only create the PropertyBuilder if we are not an explicit
18438 interface implementation. This means that explicit interface
18439 implementation members do not participate in regular function
18440 lookups, and hence fixes another major ambiguity problem in
18441 overload resolution (that was the visible effect).
18443 (DefineMethod): Return whether we are doing an interface
18446 * typemanager.cs: Temporary hack until we get attributes in
18447 interfaces (Ravi is working on that) and we get IndexerName
18448 support in interfaces.
18450 * interface.cs: Register the indexers as properties.
18452 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18453 warning, I have verified that this is a bug in the .NET runtime
18454 (JavaScript suffers of the same problem).
18456 * typemanager.cs (MemberLookup): When looking up members for
18457 interfaces, the parent of an interface is the implicit
18458 System.Object (so we succeed in searches of Object methods in an
18459 interface method invocation. Example: IEnumerable x; x.ToString
18462 2002-05-25 Miguel de Icaza <miguel@ximian.com>
18464 * class.cs (Event): Events should also register if they do
18465 implement the methods that an interface requires.
18467 * typemanager.cs (MemberLookup); use the new GetInterfaces
18470 (GetInterfaces): The code used to lookup interfaces for a type is
18471 used in more than one place, factor it here.
18473 * driver.cs: Track the errors at the bottom of the file, we kept
18476 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
18477 instance if the method we are calling is static!
18479 2002-05-24 Miguel de Icaza <miguel@ximian.com>
18481 * attribute.cs (ApplyAttributes): Make this function filter out
18482 the IndexerName attribute (as that attribute in reality is never
18483 applied) and return the string constant for the IndexerName
18486 * class.cs (TypeContainer.Emit): Validate that all the indexers
18487 have the same IndexerName attribute, and if so, set the
18488 DefaultName attribute on the class.
18490 * typemanager.cs: The return value might contain other stuff (not
18491 only methods). For instance, consider a method with an "Item"
18492 property and an Item method.
18494 * class.cs: If there is a problem with the parameter types,
18497 2002-05-24 Ravi Pratap <ravi@ximian.com>
18499 * ecore.cs (ImplicitConversionExists): Wrapper function which also
18500 looks at user defined conversion after making a call to
18501 StandardConversionExists - we need this for overload resolution.
18503 * expression.cs : Update accordingly the various method calls.
18505 This fixes 2 bugs filed against implicit user defined conversions
18507 2002-05-22 Miguel de Icaza <miguel@ximian.com>
18509 * statement.cs: Track the result of the assignment.
18511 2002-05-21 Miguel de Icaza <miguel@ximian.com>
18513 * expression.cs (MemberAccess): Improved error reporting for
18514 inaccessible members.
18516 2002-05-22 Martin Baulig <martin@gnome.org>
18518 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
18519 itself with debugging support.
18521 2002-05-22 Martin Baulig <martin@gnome.org>
18523 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18524 Removed, this isn't needed anymore.
18526 2002-05-20 Martin Baulig <martin@gnome.org>
18528 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18529 be underlying type for an enum.
18531 2002-05-20 Miguel de Icaza <miguel@ximian.com>
18533 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18534 that splits out the loading of just the core types.
18536 * rootcontext.cs (ResolveCore): Split the struct resolution in
18537 two, so we can load the enumeration underlying types before any
18540 * expression.cs (Is): Bandaid until we fix properly Switch (see
18541 bug #24985 for details).
18543 * typemanager.cs (ImplementsInterface): The hashtable will contain
18544 a null if there are no interfaces implemented.
18546 2002-05-18 Miguel de Icaza <miguel@ximian.com>
18548 * cs-parser.jay (indexer_declarator): It is fine to have array
18551 2002-05-17 Miguel de Icaza <miguel@ximian.com>
18553 * typemanager.cs: (RegisterBuilder): New function used to register
18554 TypeBuilders that implement interfaces. Since
18555 TypeBuilder.GetInterfaces (as usual) does not work with lame
18557 (AddUserType): register interfaces.
18559 (ImplementsInterface): Use the builder_to_ifaces hash if we are
18560 dealing with TypeBuilder. Also, arrays are showing up as
18561 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18562 methods can not be invoked on them!
18564 * ecore.cs (ExplicitReferenceConversionExists): Made public.
18565 (ImplicitReferenceConversionExists): Split out from
18566 StandardConversionExists.
18568 * expression.cs (As): We were only implementing one of the three
18569 cases for the as operator. We now implement them all.
18570 (Is): Implement the various other cases for Is as well.
18572 * typemanager.cs (CACHE): New define used to control if we want or
18573 not the FindMembers cache. Seems to have a negative impact on
18574 performance currently
18576 (MemberLookup): Nested types have full acess to
18577 enclosing type members
18579 Remove code that coped with instance/static returns for events, we
18580 now catch this in RealFindMembers.
18582 (RealFindMembers): only perform static lookup if the instance
18583 lookup did not return a type or an event.
18585 2002-05-17 Miguel de Icaza <miguel@ximian.com>
18587 * assign.cs (CompoundAssign): We pass more semantic information
18588 now to Compound Assignments than we did before: now we have all
18589 the information at hand, and now we resolve the target *before* we
18590 do the expression expansion, which allows the "CacheValue" method
18591 to have the effect we intended (before, a [x] += 1 would generate
18592 two differen ArrayAccess expressions from the ElementAccess,
18593 during the resolution process).
18595 (CompoundAssign.DoResolve): Resolve target and original_source here.
18597 2002-05-16 Miguel de Icaza <miguel@ximian.com>
18599 * expression.cs (ArrayAccess): dropped debugging information.
18601 * typemanager.cs: Small bug fix: I was always returning i_members,
18602 instead of one of i_members or s_members (depending on which had
18605 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
18606 method is invoked before any code generation takes place, and it
18607 is a mechanism to inform that the expression will be invoked more
18608 than once, and that the method should use temporary values to
18609 avoid having side effects
18611 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18613 * ecore.cs (Expression.CacheTemporaries): Provide empty default
18616 * expression.cs (Indirection, ArrayAccess): Add support for
18617 CacheTemporaries in these two bad boys.
18619 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18620 ldobj or ldind_ref.
18621 (StoreFromPtr): Handle stobj as well.
18623 * expression.cs (UnaryMutator): Share more code.
18625 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18626 down: I was not tracking the Filter function as well, which
18627 was affecting the results of the cache.
18629 2002-05-15 Miguel de Icaza <miguel@ximian.com>
18631 * attribute.cs: Remove the hack to handle the CharSet property on
18634 2002-05-14 Miguel de Icaza <miguel@ximian.com>
18636 * attribute.cs (DoResolve): More uglyness, we now only try to
18637 resolve the attribute partially, to extract the CharSet
18638 information (only if we are a StructLayout attribute). Otherwise
18640 (GetExtraTypeInfo): Add some code to conditionally kill in the
18641 future this. I am more and more convinced that the .NET
18642 framework has special code to handle the attribute setting on
18645 * expression.cs (IsParamsMethodApplicable): Revert my previous
18646 foreach change here, it was wrong.
18648 2002-05-13 Miguel de Icaza <miguel@ximian.com>
18650 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18651 (pp_expr): do not abort on unknown input, just return.
18652 (eval): abort if there are pending chars.
18654 * attribute.cs (Attribute.Resolve): Positional parameters are
18655 optional. Deal with that case.
18657 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18658 the Ansi/Unicode/Auto information for the type.
18660 (TypeContainer.DefineType): instantiate the EmitContext here, as
18661 we will be using it during the type definition (to resolve
18662 attributes) and during the emit phase.
18664 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18665 to pull type information out of the attributes
18667 (Attribute.Resolve): track the constructor builder, and allow for
18668 multiple invocations (structs and classes will use this).
18670 * ecore.cs (MemberLookupFinal): new version with all the
18671 parameters customizable.
18673 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18674 constructors. Return if the result value is null (as the error
18675 would have been flagged already by MemberLookupFinal)
18677 Do not allow instances of abstract classes or interfaces to be
18680 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18681 We have to compare the assembly property here when dealing with
18682 FamANDAssem and Assembly access modifiers, because we might be
18683 creating an assembly from *modules* (that means that we are not
18684 getting TypeBuilders for types defined in other modules that are
18685 part of this assembly).
18687 (Method.Emit): If the method is marked abstract and has a body,
18690 (TypeContainer.DefineMembers): If both the defined member and the
18691 parent name match are methods, then do not emit any warnings: let
18692 the Method.Define routine take care of flagging warnings. But if
18693 there is a mismatch (method overrides something else, or method is
18694 overriwritten by something, then emit warning).
18696 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18697 set to null, this means `do not check for the return type on the
18700 (Method.Define): set the return type for the method signature to
18701 null, so that we get methods with the same name and parameters and
18702 different return types. This is used to flag warning 114 (you are
18703 hiding a method, and you probably want to use the new/override
18706 * typemanager.cs (MemberLookup): Implemented proper access
18707 control, closing a long standing set of bug reports. The problem
18708 was that the Framework only has two bits: Public and NonPublic,
18709 and NonPublic includes private and protected methods, but we need
18710 to enforce the FamANDAssem, FamOrAssem and Family.
18712 2002-05-11 Miguel de Icaza <miguel@ximian.com>
18714 * statement.cs (GotoCase): Return true: Ammounts to giving up
18715 knowledge on whether we return or not, and letting the other case
18716 be responsible for it.
18718 2002-05-10 Miguel de Icaza <miguel@ximian.com>
18720 * driver.cs: Do not load directories for each file processed, only
18721 do it if there is a pattern.
18723 * ecore.cs: Report readonly assigns here as well, as we might have
18724 been resolved only by MemberAccess.
18726 (SimpleName.SimpleNameResolve): Also be useful for LValue
18727 resolution. We need this to propagate assign to local readonly variables
18729 * typemanager.cs: Use a ptrhashtable for the criteria, because we
18730 do not want to reuse potential criteria memory.
18732 * class.cs (MyEventBuilder): Set reflected_type;
18734 * ecore.cs (Constantify): Added support for constifying bools.
18736 (RootContext.LookupType): Added a cache for values looked up in
18737 the declaration space.
18739 * typemanager.cs (FindMembers): Now is a front-end to
18740 RealFindMembers, and provides a two-level hashtable-based cache to
18743 15% performance improvement: from 22.5 to 19.2 seconds.
18745 * expression.cs (IsParamsMethodApplicable): use foreach.
18746 (Invocation.DoResolve): ditto.
18747 (New.DoResolve): ditto.
18748 (ArrayCreation.DoResolve): ditto.
18750 * ecore.cs (FindMostEncompassingType): use foreach.
18752 * delegate.cs (NewDelegate.DoResolve): Use foreach
18754 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18755 (RemoveMethods): use foreach.
18757 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18758 nested foreach statements instead of for, and also break out of
18759 the inner loop once a match is found.
18761 (Invocation.OverloadResolve): Use foreach, simplify the code.
18763 2002-05-08 Miguel de Icaza <miguel@ximian.com>
18765 * cfold.cs (BinaryFold): During an enumeration evaluation context,
18766 we actually unwrap the expression to allow for extra information
18769 * expression.cs: Use Shr_Un on unsigned operations.
18771 2002-05-08 Ravi Pratap <ravi@ximian.com>
18773 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
18774 applicable operators was not being considered correctly. This closes
18775 the bug Miguel reported.
18777 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18779 * attribute.cs: check that the type derives from System.Attribute
18780 and report the correct error in that case (moved the duplicate code to
18781 its own method, too).
18783 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18785 * attribute.cs: lookup attribute type name as the spec says: first the
18786 bare attribute name and then name + "Attribute" (nant compiles with
18787 mcs after this fix).
18789 2002-05-07 Miguel de Icaza <miguel@ximian.com>
18791 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
18792 Because of the way we parse things, we should try to see if a
18793 UIntConstant can fit in an integer.
18795 2002-05-07 Ravi Pratap <ravi@ximian.com>
18797 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18798 when we are in an explicit context.
18800 (ConvertReferenceExplicit): When converting from Iface type S to Class
18801 T make sure the rules are implemented as an OR.
18803 * parameter.cs (ParameterType): Make it a property for now although the
18804 purpose really isn't anything immediate.
18806 * expression.cs (Is*Applicable): Do better checking on the parameter type
18807 of a ref/out parameter. The ones from the system assemblies are already
18808 marked with the correct type so we don't need to do any correction.
18810 * ecore.cs (StandardConversionExists): Conversion from Interface types to
18811 the object type is standard too so include that.
18813 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18815 * ecore.cs (StandardConversionExists): Augment with missing code:
18816 deal with IntConstant, LongConstants and Enumerations.
18818 * assign.cs: Report the error, instead of failing silently
18820 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
18821 typecontainer that they are declared, because the
18822 typecontainer/namespace will have the list of using clauses that
18823 need to be applied.
18825 Assembly Attributes were escaping the normal registration
18828 (EmitCode): Apply attributes within an EmitContext that represents
18829 the container they were declared on.
18831 * cs-parser.jay: Track bases for structs. How did I get this wrong?
18833 2002-05-06 Ravi Pratap <ravi@ximian.com>
18835 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
18836 Revamp completely - make much cleaner as we now operate only
18839 (FindMostSpecificSource, FindMostSpecificTarget): New methods
18840 to implement the logic detailed in the spec more correctly.
18842 (UserDefinedConversion): Update accordingly.
18844 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18846 * statement.cs: Return flow analysis information up.
18848 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
18851 (token): Do not consume an extra character before calling
18854 2002-05-06 Piers Haken <piersh@friskit.com>
18856 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
18858 2002-05-06 Miguel de Icaza <miguel@ximian.com>
18860 * class.cs (Constructor.Emit): Set the IsStatic flag in the
18861 EmitContext during the instance constructor initializer
18862 resolution, to stop access to instance variables.
18864 This is mandated by the spec, last paragraph of the `constructor
18865 initializers' section.
18867 2002-05-05 Miguel de Icaza <miguel@ximian.com>
18869 * cs-parser.jay, class.cs (Accessor): new class used to represent
18870 an accessor (get or set). In the past we used `null' to represent
18871 a missing accessor. But this is ambiguous because there was no
18872 way to tell in abstract indexers/properties if one of them was
18875 Now there is a way of addressing that.
18877 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
18878 instead of FindMembers.
18880 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
18881 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
18883 * attribute.cs: Treat indexers and properties as the same in terms
18884 of applying attributes
18886 * ecore.cs (FindMostEncompassedType): Use statically initialized
18887 EmptyExpressions()s like we do elsewhere to avoid creating useless
18888 objects (and we take this out of the tight loop).
18890 (GetConversionOperators): Move the code to extract the actual
18891 operators to a separate routine to clean things up.
18893 2002-05-04 Miguel de Icaza <miguel@ximian.com>
18895 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
18896 events are always registered FieldBuilders.
18898 * class.cs (FieldBase): New class shared by Fields
18900 * delegate.cs: If we are a toplevel delegate, use our full name.
18901 If we are a nested delegate, then only use our tail name.
18903 2002-05-02 Ravi Pratap <ravi@ximian.com>
18905 * expression.cs (IsApplicable): Ensure that we add the "&" to
18906 ref/out types before comparing it with the type of the argument.
18908 (IsParamsMethodApplicable): Ditto.
18910 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
18913 * delegate.cs : Handle the case when we have more than one applicable
18914 method. Flag an error only when we finish checking all.
18916 2002-05-02 Miguel de Icaza <miguel@ximian.com>
18918 * expression.cs: Add support for boolean static initializers.
18920 2002-05-01 Miguel de Icaza <miguel@ximian.com>
18922 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
18924 * parameter.cs (ComputeParameterTypes,
18925 ComputeAndDefineParameterTypes): Better error handling: now we
18926 clear the `types' cache if we fail during any of the type lookups.
18927 We also return the status code correctly to our caller
18929 * delegate.cs: If we fail to define a delegate, abort the extra
18932 * expression.cs (Binary.ResolveOperator): for
18933 operator==(object,object) and operator !=(object, object) we also
18934 have to verify that there is an implicit conversion from one to
18937 (ArrayAccess.DoResolve): Array Access can operate on
18940 2002-04-30 Miguel de Icaza <miguel@ximian.com>
18942 * assign.cs (CompoundAssign): A new class used as a "flag" that
18943 the assignment actually is happening as part of a compound
18944 assignment operator.
18946 During compound assignment, a few new rules exist to enable things
18953 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
18954 to the type of x) if y is implicitly convertible to the type of x,
18955 and the operator is a builtin operator and the return type of the
18956 operator is explicitly convertible to the type of x.
18958 * rootcontext.cs: Reset warning level to 2. 4 catches various
18959 "interesting" features in mcs, we must clean this up at some
18960 point, but currently am trying to kill other bugs ;-)
18962 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
18963 in container classes as well.
18965 * expression.cs (Binary.ResolveOperator): Handle string case
18966 before anything else (as operator overloading does emit an error
18967 before doing anything else).
18969 This code could go away when we move to a table driven model, but
18970 i could not come up with a good plan last night.
18972 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
18974 * typemanager.cs (CSharpName): reimplementation using regex.
18975 * class.cs: added null check for fields in Emit
18976 * rootcontext.cs: set warninglevel to 4
18978 2002-04-29 Miguel de Icaza <miguel@ximian.com>
18980 * typemanager.cs (CSharpName): reimplemented with Lupus
18983 2002-04-28 Miguel de Icaza <miguel@ximian.com>
18985 * statement.cs (If): correclty implement Resolve, because we were
18986 not catching sem errors in there. The same process is needed
18988 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
18991 (Statement.Warning_DeadCodeFound): Factorize code.
18992 (While): Report dead code here too.
18994 (Statement): Added Resolve virtual method to allow
18995 for resolution split from the emit code.
18997 2002-04-26 Miguel de Icaza <miguel@ximian.com>
18999 * statement.cs (EmitBoolExpression): No longer try to resolve the
19001 (MakeBoolean): New utility function that resolve, implicitly
19002 converts to boolean and tags the expression.
19005 (If, Do): Implement dead code elimination.
19006 (While): Implement loop inversion
19008 (Do, While, For, If): Resolve the expression prior to calling our
19011 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
19014 - added method Report28 (warning: program has more than one entry point)
19015 - added method IsEntryPoint, implements paragraph 10.1 of the spec
19016 - modified method Method.Define, the part at the end of the method
19018 * rootcontext.cs: added static public Location EntryPointLocation;
19020 * ../errors/cs0028.cs : Add test case for the above warning.
19023 - modified method CSharpName to allow arrays of primitive type to
19024 be printed nicely (e.g. instead of System.Int32[][] it now prints
19026 - added method CSharpSignature: returns the signature of a method
19027 in string format to be used in reporting errors, warnings, etc.
19029 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
19032 2002-04-26 Ravi Pratap <ravi@ximian.com>
19034 * delegate.cs (Define): Fix extremely silly bug where I was
19035 setting the type of the 'object' parameter of the BeginInvoke
19036 method to System.IAsyncResult instead of System.Object ;-)
19038 2002-04-26 Miguel de Icaza <miguel@ximian.com>
19040 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
19043 (Constructor.Emit): return if we fail to initialize the
19044 constructor. Another door closed!
19046 * expression.cs (New.DoResolve): Improve error message (from -6 to
19047 1501). Use DeclaredOnly lookup to find the exact constructor.
19049 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
19050 loop. This is useful.
19052 * cs-parser.jay: Adjust the default parameters so that destructors
19053 have the proper signature.
19055 2002-04-26 Martin Baulig <martin@gnome.org>
19057 * driver.cs (LoadAssembly): If `assembly' contains any characters
19058 which are only valid in path names and not in assembly names
19059 (currently slash, backslash and point), use Assembly.LoadFrom ()
19060 instead of Assembly.Load () on the `assembly' (before iteration
19061 over the link_paths).
19063 2002-04-26 Martin Baulig <martin@gnome.org>
19065 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
19067 2002-04-25 Miguel de Icaza <miguel@ximian.com>
19069 * class.cs (Property): use the new typemanager.MemberLookup
19071 (TypeContainer.MemberLookup): Implement using the
19072 TypeManager.MemberLookup now.
19074 * typemanager.cs: Make MemberLookup a function of the TypeManager,
19075 and return MemberInfos, so that these can be used without an
19076 EmitContext (what we had before).
19078 2002-04-24 Miguel de Icaza <miguel@ximian.com>
19080 * expression.cs: Fix the case where the argument to params if the
19081 type of the params. I omitted handling this before. Fixed
19083 2002-04-22 Miguel de Icaza <miguel@ximian.com>
19085 * driver.cs: Call BootCorlib_PopulateCoreType
19087 * class.cs (Property.CheckBase): Check for properties only, not
19090 * interface.cs: Temporary hack: try/catch around the
19091 CustomAttributeBuilder, because I am getting an exception that I
19094 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
19095 types whose definitions are required to be there (attributes are
19096 defined before standard types).
19098 Compute definitions as we boot the various types, as they are used
19099 immediately (value_type class will need object_type, but if we do
19100 not initialize object_type, we will pass a null, which will let
19101 the runtime pick the System.Object from the existing corlib, which
19102 is not what we want).
19104 2002-04-22 Patrik Torstensson <totte@labs2.com>
19106 * cs-tokenizer.cs: fixed a number of trim() issues.
19108 2002-04-22 Ravi Pratap <ravi@ximian.com>
19110 * expression.cs (Argument.Type): Ensure that we return the correct
19111 type when we have out or ref parameters [in which case we
19114 2002-04-22 Miguel de Icaza <miguel@ximian.com>
19116 * class.cs (Property, Indexer): Allow extern modifier in there.
19118 * typemanager.cs (InitBaseTypes): Initializes object_type and
19119 value_type, since those will be used early on during the bootstrap
19120 process to compile corlib.
19122 (InitCoreTypes): Move code from here to InitBaseTypes.
19124 2002-04-21 Miguel de Icaza <miguel@ximian.com>
19126 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
19127 single-dimension arrays as using the ldlen opcode.
19129 Daniel Lewis discovered this optimization.
19131 * typemanager.cs: Add signature for System.Array::get_Length
19133 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19135 * statement.cs: report the error when the foreach does not apply to an
19136 array nor a collection.
19138 2002-04-19 Miguel de Icaza <miguel@ximian.com>
19140 * expression.cs: Add implicit conversions to the operator ~.
19142 * constant.cs (DecimalConstant.Emit): Emit decimal value.
19144 * typemanager.cs: Locate the decimal constructor.
19146 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19148 * attribute.cs: use the new property of TypeOf.
19149 * expression.cs: added 'get' property around typearg.
19151 These changes fix a build breaker reported by NickD. Is this the
19152 correct way to fix? If not, please, revert my changes and make it
19155 2002-04-17 Miguel de Icaza <miguel@ximian.com>
19157 * attribute.cs: Add support for typeof in attribute invocations.
19158 I am not sure that this is right though.
19160 2002-04-14 Duncan Mak <duncan@ximian.com>
19162 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
19163 Binary.Operator.Division case.
19165 2002-04-13 Ravi Pratap <ravi@ximian.com>
19167 * class.cs (DefineType): Ensure that we do a proper check on
19168 attribute types and also register it with the TypeManager.
19170 (TypeContainer.Targets): The default for attribute types is
19171 AttributeTargets.All.
19173 * attribute.cs (ApplyAttributes): Registering the attribute type
19174 is done elsewhere, not when we discover we have a Usage attribute.
19176 2002-04-12 Ravi Pratap <ravi@ximian.com>
19178 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
19179 and get rid of is_delegate parameter.
19181 * everywhere : update.
19183 2002-04-12 Ravi Pratap <ravi@ximian.com>
19185 * cs-parser.jay (compilation_unit): Revamp completely to use
19186 some new ideas that I got from Rhys' grammar to solve the problems
19187 with assembly level attributes.
19189 (outer_declaration): New grammar production.
19191 (attribute_sections): Add.
19193 (opt_attributes): Base on attribute_sections
19195 (namespace_declaration): Allow opt_attributes to tackle the case
19196 when we have assembly level attributes - we are clever in this
19199 * attribute.cs (ApplyAttributes): Do not worry about assembly
19200 attributes in the non-global context.
19202 * rootcontext.cs (AddGlobalAttributes): Go back to using this
19203 instead of SetGlobalAttributes.
19205 * class.cs, rootcontext.cs : Ensure we define and generate
19206 attribute types before anything else.
19208 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19209 and flag the new error -20 for the case when the attribute type
19210 does not have valid targets specified. csc does not catch this.
19212 * ../errors/errors.txt : update for error # -20
19214 2002-04-11 Ravi Pratap <ravi@ximian.com>
19216 * support.cs (InternalParameters.ParameterModifier): Do some null
19217 checking and return sane values.
19219 * class.cs (Method.Define): If we are a PInvoke method, ensure
19220 that we are static and extern. Report error # 601
19222 * ../errors/cs0601.cs : Add test case for the above error.
19224 2002-04-07 Ravi Pratap <ravi@ximian.com>
19226 * rootcontext.cs (attribute_types): We need to keep type of
19227 all attribute types separately and emit code for them first.
19229 (RegisterAttribute) : Implement.
19231 * class.cs (DefineType): Check if the current Type is a custom
19232 attribute type and register it accordingly.
19234 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19235 adding the first attribute twice and rename to
19237 (SetGlobalAttributes): this.
19239 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19242 * attribute.cs (ApplyAttributes): Take an additional argument telling us
19243 if we are processing global arguments. Hmm, I am unsure of this.
19245 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19247 * expression.cs: added static array of strings to avoid calling
19248 Enum.ToString () for Operator in Binary. Significant recover of
19251 2002-04-10 Miguel de Icaza <miguel@ximian.com>
19253 * class.cs (FindMembers): Allow the Builders of the various
19254 members to be null. If they are skip them. This only happens
19255 during the PInvoke declaration.
19257 2002-04-09 Miguel de Icaza <miguel@ximian.com>
19259 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19260 failure, so we do not keep going afterwards.
19262 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19263 wanted to pass `false' as the `is_delegate' argument. If this is
19264 the case, why not use delegate_type == null to mean `is_delegate =
19265 false' and anything else as is_delegate = true.
19267 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
19269 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19270 code for the section, not the beginning of the tests.
19272 2002-04-08 Miguel de Icaza <miguel@ximian.com>
19274 * cfold.cs: Handle operator + (Enum x, Underlying x)
19276 * expression.cs (Binary): same. Warn about errors where we have
19277 Enum/Enum in operator + as well.
19279 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
19282 - added support for switch(bool)
19283 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19284 - add TableSwitchEmit() to handle table-based switch statements
19286 2002-04-05 Ravi Pratap <ravi@ximian.com>
19288 * expression.cs (Invocation.OverloadResolve): Factor out code which
19289 does parameter compatibility checking with arguments so that we can
19290 re-use the code even from Delegate.VerifyApplicability
19292 (VerifyArgumentsCompat): Move above code here.
19294 * delegate.cs (VerifyApplicability): Get rid of duplicate code
19295 and instead make a call to the above method.
19297 2002-03-31 Ravi Pratap <ravi@ximian.com>
19299 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
19300 We use it to keep track of classes which are attribute types.
19302 2002-04-02 Miguel de Icaza <miguel@ximian.com>
19304 * delegate.cs (Delegate.Define): Correctly define the types in the
19305 presence of fixed and array parameters.
19307 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
19310 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
19311 include NonPublic after the first iteration.
19313 * class.cs (Indexer.CheckBase): Only check if both parents are
19316 * cs-parser.jay (accessor_body): If empty, set to null.
19318 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19319 same code path here to resolve constants names that we did have in
19320 MemberAccess.DoResolve. There is too much code duplicated here.
19322 2002-04-01 Miguel de Icaza <miguel@ximian.com>
19324 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19326 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19329 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19330 tokens, numbers and strings.
19332 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19335 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19336 asyncronous parameters and the regular parameters.
19338 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19339 specify the target directory.
19341 * expression.cs: (This.DoResolve): Simplify
19342 (As.Emit): Optimize, do not generate IsInst if the expression is
19343 always of the given type.
19345 (Is.DoResolve): Bug fix, we were reporting both always/never for
19348 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19349 creating too many unnecessary arrays.
19351 2002-03-31 Miguel de Icaza <miguel@ximian.com>
19353 * class.cs (EmitFieldInitializer): Use Assign expression to assign
19354 fields instead of rolling our own initializer. Takes care of all
19355 implicit conversions, and drops unnecessary static checks/argument.
19357 2002-03-31 Dick Porter <dick@ximian.com>
19359 * driver.cs: use the GetDirectories() return values properly, and
19360 use "/" as path separator.
19362 2002-03-30 Miguel de Icaza <miguel@ximian.com>
19364 * expression.cs (Unary): Optimize - - expr into expr.
19365 (Binary): Optimize a + (-b) into a -b.
19367 * codegen.cs (CodeGen): Made all methods static.
19369 2002-03-29 Miguel de Icaza <miguel@ximian.com>
19373 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19374 TypeBuilder property.
19376 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19379 * tree.cs: Removed the various RecordXXXX, and replaced with a
19380 single RecordDecl. Removed all the accessor methods, and just
19381 left a single access point Type
19383 * enum.cs: Rename DefineEnum to DefineType.
19385 * decl.cs: New abstract method `DefineType' used to unify the
19386 Defines for Enumerations, Interfaces, TypeContainers and
19389 (FindType): Moved LookupInterfaceOrClass here. Moved the
19390 LookupBaseClasses method that used to live in class.cs and
19391 interface.cs here, and renamed to FindType.
19393 * delegate.cs: Implement DefineType. Take advantage of the
19394 refactored pattern for locating the parent builder without taking
19395 the parent_builder argument (which we know does not work if we are
19396 nested, and triggering a toplevel definition).
19398 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19400 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19401 accessibility of a member has changed during override and report
19404 * class.cs (Method.Define, Property.Define): Only complain on
19405 overrides if the method is private, any other accessibility is
19406 fine (and since we just checked the permission is the same, we are
19409 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19410 and elif are processed always. The other pre-processing
19411 directives are only processed if we are "taking" the path
19413 2002-03-29 Martin Baulig <martin@gnome.org>
19415 * class.cs (Method.Emit): Only emit symbolic debugging info if the
19416 current location is not Null.
19418 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19419 a separate method so we can profile it.
19421 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19422 `span.Seconds' are just seconds, but no minutes or hours.
19423 (MainDriver): Profile the CodeGen.SaveSymbols calls.
19425 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19427 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19428 Remove the gratuitous set of Final:
19430 // If an interface implementation, then we can set Final.
19431 if (((flags & MethodAttributes.Abstract) == 0) &&
19432 implementing.DeclaringType.IsInterface)
19433 flags |= MethodAttributes.Final;
19435 I do not know what I was smoking when I used that.
19438 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19439 step into fixing the name resolution issues for delegates and
19440 unifying the toplevel name resolution.
19442 2002-03-28 Martin Baulig <martin@gnome.org>
19444 * class.cs (Method.Emit): If we have a symbol writer, call its
19445 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19446 tell it about the current method.
19448 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19449 writer that we're going to emit the first byte of IL code for a new
19450 statement (a new source line).
19451 (EmitContext.EmitTopBlock): If we have a symbol writer, call
19452 EmitContext.Mark() before emitting any code.
19454 * location.cs (SymbolDocument): Return null when we're Null.
19456 * statement.cs (Statement): Moved the `Location loc' variable here.
19457 (Statement.EmitBoolExpression): If we have a symbol writer, call
19458 ec.Mark() before emitting any code to tell it that we're at the
19459 beginning of a new statement.
19460 (StatementExpression): Added `Location' argument to the constructor.
19461 (Block): Added public readonly variable `StartLocation' and public
19462 variable `EndLocation'. The latter is to be set using SetEndLocation().
19463 (Block): Added constructor which takes a start and end location.
19464 (Block.SetEndLocation): New method. This sets the end location.
19465 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19466 local variables we create.
19467 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
19468 each statement and do also mark the begin and end of the block.
19470 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
19471 tell it the current lexer.Location, use Location.Null for the end of the
19473 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
19474 current block, set its end location using SetEndLocation().
19475 (statement_expression): StatementExpression constructor now takes the
19476 lexer.Location as additional argument.
19477 (for_statement, declare_local_variables): Likewise.
19478 (declare_local_variables): When creating a new implicit block, use the
19479 new Block constructor and pass it the lexer.Location.
19481 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19483 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
19484 members also on the parent interfaces recursively.
19486 2002-03-27 Miguel de Icaza <miguel@ximian.com>
19488 * report.cs: Use new formats, since Gonzalo finished the missing
19491 * expression.cs (Binary.ResolveOperator): added missing operator|
19492 operator& and operator^ for bool/bool.
19494 * cs-parser.jay: CheckDef now takes a Location argument that is
19495 used to report errors more precisly (instead of reporting the end
19496 of a definition, we try to track something which is a lot closer
19497 to the source of the problem).
19499 * cs-tokenizer.cs: Track global token use, so we can properly flag
19500 the use of #define/#undef after the first token has been seen.
19502 Also, rename the reportXXXX to Error_DescriptiveName
19504 * decl.cs (DeclSpace.IsTopLevel): Move property here from
19505 TypeContainer, so that Enum and Interface can use this too.
19507 * class.cs (TypeContainer.LookupInterfaceOrClass,
19508 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19509 `builder' argument. Typically this was used to pass the parent
19510 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19513 The problem is that a nested class could trigger the definition of
19514 a toplevel class, and the builder would be obviously wrong in that
19517 So we drop this argument, and we compute dynamically the
19518 TypeBuilder/ModuleBuilder (the correct information was available
19519 to us anyways from DeclSpace.Parent)
19521 * interface.cs (Interface.DefineInterface): Drop builder
19522 parameter cleanup like class.cs
19524 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
19527 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19530 (Try.Emit): Propagate the returns value from the statement.
19532 (Return.Emit): Even if we are leavning
19534 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19536 * modifiers.cs: Fix the computation of MethodAttributes flags.
19538 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19540 * driver.cs: allow compilation of files that start with '/'.
19541 Add a default case when checking the argument of --target.
19543 2002-03-25 Miguel de Icaza <miguel@ximian.com>
19545 * interface.cs: Implement the same search algorithm for types in
19546 the interface code.
19548 * delegate.cs: Do not allow multiple definition.
19550 * Recovered ChangeLog that got accidentally amputated
19552 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19554 * rootcontext.cs: Load manually enum to allow core classes to
19555 contain enumerations.
19557 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19558 Update to new static methods in TypeManager.
19560 * typemanager.cs (GetMethod, GetConstructor): Use our
19561 implementation of FindMembers to find the members, since during
19562 corlib compilation, the types are TypeBuilders and GetMethod and
19563 GetConstructor do not work.
19565 Make all methods in TypeManager static.
19567 (InitCodeHelpers): Split the functionality from
19568 the InitCodeTypes function.
19570 * driver.cs: Call InitCodeHelpers after we have populated the
19573 * cs-parser.jay (delegate_declaration): we did not used to compute
19574 the delegate name correctly for void delegates.
19576 2002-03-24 Miguel de Icaza <miguel@ximian.com>
19578 * rootcontext.cs (RootContext): Init the interface_resolve_order
19579 and type_container_resolve_order always.
19581 (ResolveCore, BootstrapCorlib_ResolveClass,
19582 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19583 compiler when compiling with --nostdlib
19585 * class.cs (TypeContainer.DefineType): Check that our parent is
19586 not null. This test is most important when we are bootstraping
19589 * codegen.cs: Split out the symbol writing code.
19591 2002-03-25 Martin Baulig <martin@gnome.org>
19593 * driver.cs (-g): Made -g an alias for --debug.
19595 2002-03-24 Martin Baulig <martin@gnome.org>
19597 * codegen.cs (SymbolWriter): New public variable. Returns the
19598 current symbol writer.
19599 (CodeGen): Added `bool want_debugging_support' argument to the
19600 constructor. If true, tell the ModuleBuild that we want debugging
19601 support and ask it for the ISymbolWriter.
19602 (Save): If we have a symbol writer, call it's Close() method after
19603 saving the assembly.
19605 * driver.c (--debug): New command line argument to create a
19606 debugger information file.
19608 * location.cs (SymbolDocument): New public property. Returns an
19609 ISymbolDocumentWriter object for the current source file or null
19610 if we don't have a symbol writer.
19612 2002-03-21 Miguel de Icaza <miguel@ximian.com>
19614 * driver.cs (LoadAssembly): Correctly return when all the paths
19615 have been tried and not before.
19617 * statement.cs (Switch.Emit): return the actual coverage for this
19618 statement (returns/not-returns)
19620 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19621 switch of the statement if we are the last switch section. That
19622 kills two problems: try/catch problems (we used to emit an empty
19623 nop at the end) and switch statements where all branches would
19626 2002-03-19 Miguel de Icaza <miguel@ximian.com>
19628 * driver.cs: Add default assemblies (the equivalent to the
19629 Microsoft CSC.RSP file)
19631 * cs-tokenizer.cs: When updating `cols and setting it to zero,
19632 also update tokens_seen and set it to false.
19634 * driver.cs: Implement --recurse for Mike.
19636 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19637 correctly splitting out the paths.
19639 2002-03-18 Miguel de Icaza <miguel@ximian.com>
19641 * interface.cs (Interface.PopulateProperty): Instead of using
19642 `parent' as the declaration space for the set parameters, use
19645 * support.cs (InternalParameters): InternalParameters constructor
19646 takes a DeclSpace instead of a TypeContainer.
19648 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19649 types are being initialized, load the address of it before calling
19652 (New): Provide a mechanism to disable the generation of local
19653 value type temporaries when the caller will be providing us with
19654 an address to store it.
19656 (ArrayCreation.EmitDynamicInitializers): Use it.
19658 2002-03-17 Miguel de Icaza <miguel@ximian.com>
19660 * expression.cs (Invocation.EmitArguments): Only probe for array
19661 property if there is more than one argument. Sorry about that.
19663 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19664 empty param arrays.
19666 * class.cs (Method.LabelParameters): Fix incorrect code path that
19667 prevented the `ParamArrayAttribute' from being applied to the
19670 2002-03-16 Miguel de Icaza <miguel@ximian.com>
19672 * support.cs (ReflectionParameters): Correctly compute whether the
19673 last argument is a params array. Fixes the problem with
19676 * typemanager.cs: Make the assemblies array always be non-null
19677 (empty, but non-null)
19679 * tree.cs (RecordDecl): New function that abstracts the recording
19680 of names. This reports error 101, and provides a pointer to the
19681 previous declaration. Fixes a crash in the compiler.
19683 * cs-parser.jay (constructor_declaration): Update to new grammar,
19684 and provide a constructor_body that can be empty.
19686 2002-03-15 Miguel de Icaza <miguel@ximian.com>
19688 * driver.cs: Add support for --resources.
19690 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19691 Make all types for the various array helper methods be integer.
19693 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19694 CheckState to ConvCast.
19696 (ConvCast): Now it takes a `checked' state argument, to avoid
19697 depending on the emit context for the conversion, and just using
19698 the resolve time setting.
19700 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19701 instead of Invocation.EmitArguments. We do not emit the original
19702 arguments, instead we emit those which have been converted to
19703 unsigned int expressions.
19705 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19707 * codegen.cs: ditto.
19709 * expression.cs (LocalVariableReference): Drop the use of the
19710 Store function that depended on the variable index.
19712 * statement.cs (VariableInfo): Drop the `Idx' property from this
19713 class, as this is not taking into account the indexes for
19714 temporaries tat we generate during the execution, getting the
19717 * class.cs: First emit class initializers, then call the parent
19720 * expression.cs (Binary): Fix opcode emision.
19721 (UnaryMutator.EmitCode): Support checked code generation
19723 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19724 matches for events for both the Static and Instance scans,
19725 pointing to the same element. Fix that.
19727 2002-03-14 Miguel de Icaza <miguel@ximian.com>
19729 * rootcontext.cs (ResolveTree): Always set the
19730 interface_resolve_order, because nested interfaces will be calling
19733 * class.cs (GetInterfaceOrClass): Track the same resolution
19734 process used by TypeManager.LookupType. This fixes the nested
19735 type lookups in class declarations (separate path from
19738 (TypeContainer.DefineType): Also define nested interfaces.
19739 (TypeContainer.RegisterOrder): New public function used to
19740 register the order in which child interfaces need to be closed.
19742 Nested interfaces need to be closed after their parents have been
19745 * interface.cs (InterfaceAttr): Put all the logic for computing
19746 the interface attribute here.
19748 (DefineInterface): Register our interface order with the
19749 RootContext or with the TypeContainer depending on the case.
19751 2002-03-12 Miguel de Icaza <miguel@ximian.com>
19753 * cs-parser.jay: rework foreach statement to work with the new
19754 changes to the policy on SimpleNames.
19756 * report.cs: support Stacktrace on warnings as well.
19758 * makefile: drop --unsafe and /unsafe from the compile.
19760 2002-03-13 Ravi Pratap <ravi@ximian.com>
19762 * ecore.cs (StandardConversionExists): Modify to take an Expression
19763 as the first parameter. Ensure we do null -> reference type conversion
19766 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19767 temporary Expression objects.
19769 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19771 * interface.cs: workaround bug in method overloading resolution
19772 (there is already a bugzilla bug for it).
19774 2002-03-12 Miguel de Icaza <miguel@ximian.com>
19776 We could also solve this problem by having a separate path for
19777 performing type lookups, instead of DoResolve, we could have a
19778 ResolveType entry point, and only participating pieces of the
19779 production (simplename, deref, array) would implement this.
19781 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19782 signal SimpleName to only resolve type names and not attempt to
19783 resolve anything else.
19785 * expression.cs (Cast): Set the flag.
19787 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19789 * class.cs: Only report 108 if there is no `new' modifier.
19791 * cs-parser.jay: rework foreach statement to work with the new
19792 changes to the policy on SimpleNames.
19794 * report.cs: support Stacktrace on warnings as well.
19796 * makefile: drop --unsafe and /unsafe from the compile.
19798 2002-03-11 Miguel de Icaza <miguel@ximian.com>
19800 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19801 lookups here, instead of doing that at parse time. This means
19802 that our grammar will not introduce `LocalVariableReferences' as
19803 expressions at this point. That solves the problem of code like
19807 static void Main ()
19811 This is only half the fix. The full fix requires parameters to
19812 also be handled in this way.
19814 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
19815 makes the use more obvious of the DeclSpace. The
19816 ec.TypeContainer.TypeBuilder is now only used to pull the
19817 TypeBuilder for it.
19819 My theory is that I can get rid of the TypeBuilder completely from
19820 the EmitContext, and have typecasts where it is used (from
19821 DeclSpace to where it matters).
19823 The only pending problem is that the code that implements Aliases
19824 is on TypeContainer, and probably should go in DeclSpace.
19826 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
19827 lookups here, instead of doing that at parse time. This means
19828 that our grammar will not introduce `LocalVariableReferences' as
19829 expressions at this point. That solves the problem of code like
19833 static void Main ()
19837 This is only half the fix. The full fix requires parameters to
19838 also be handled in this way.
19840 * class.cs (Property.DefineMethod): When implementing an interface
19841 method, set newslot, when implementing an abstract method, do not
19842 set the flag (before we tried never setting it, or always setting
19843 it, which is the difference).
19844 (Indexer.DefineMethod): same.
19845 (Method.DefineMethod): same.
19847 * ecore.cs: Only set the status used flag if we get back a Field.
19849 * attribute.cs: Temporary hack, so Paolo can keep working.
19851 2002-03-08 Ravi Pratap <ravi@ximian.com>
19853 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
19854 the unmanaged type in the case we have a MarshalAs attribute.
19856 (Resolve): Handle the case when we are parsing the special MarshalAs
19857 attribute [we need to store the unmanaged type to use later]
19859 * typemanager.cs (marshal_as_attr_type): Built in type for the
19860 MarshalAs Attribute.
19862 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
19863 on parameters and accordingly set the marshalling info.
19865 2002-03-09 Miguel de Icaza <miguel@ximian.com>
19867 * class.cs: Optimizing slightly by removing redundant code after
19868 we switched to the `NoTypes' return value.
19869 (Property.DefineMethod): use NoTypes here too.
19871 This fixes the bug I introduced in my last batch of changes.
19873 2002-03-05 Ravi Pratap <ravi@ximian.com>
19875 * tree.cs (RecordEnum): Add. We now keep track of enums too.
19877 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
19878 Enums since those are types too.
19880 * cs-parser.jay (enum_declaration): Record enums as we parse them.
19882 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
19883 thanks to a call during the lookup process.
19885 2002-03-07 Miguel de Icaza <miguel@ximian.com>
19887 * statement.cs (Foreach): Lots of work to accomodate a particular
19888 kind of foreach statement that I had not kept in mind. It is
19889 possible to have foreachs on classes that provide a GetEnumerator
19890 method that return objects that implement the "pattern" for using
19891 a foreach, there is no need to support GetEnumerator
19894 This is needed to compile nant.
19896 * decl.cs: Only report 114 if the member is not `Finalize' and if
19897 the warning level is at least 2.
19899 * class.cs: Moved the compare function from Method to
19902 (MethodSignature.InheritableMemberSignatureCompare): Add new
19903 filter function that is used to extract inheritable methods from a
19906 (Method.Define): Use the new `inheritable_method_signature_filter'
19909 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
19912 2002-03-06 Miguel de Icaza <miguel@ximian.com>
19914 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
19916 * cs-parser.jay: Add opt_semicolon to the interface declaration.
19918 * expression.cs: Pass location information to
19919 ConvertImplicitStandard.
19921 * class.cs: Added debugging code to track return values from
19924 2002-03-05 Miguel de Icaza <miguel@ximian.com>
19926 * expression.cs (Is.DoResolve): If either side of the `is' is an
19927 interface, do not flag the warning.
19929 * ecore.cs (ImplicitReferenceConversion): We need a separate test
19932 * report.cs: Allow for --fatal to be used with --probe.
19934 * typemanager.cs (NoTypes): Move the definition for the empty Type
19937 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
19939 (TypeContainer.DefineProxy): New function used to proxy to parent
19940 implementations when implementing interfaces.
19941 (TypeContainer.ParentImplements): used to lookup if our parent
19942 implements a public function that is required by an interface.
19943 (TypeContainer.VerifyPendingMethods): Hook this up.
19945 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
19946 `modules' and `assemblies' arraylists into arrays. We only grow
19947 these are the very early start up of the program, so this improves
19948 the speedof LookupType (nicely measured).
19950 * expression.cs (MakeByteBlob): Replaced unsafe code with
19951 BitConverter, as suggested by Paolo.
19953 * cfold.cs (ConstantFold.Binary): Special case: perform constant
19954 folding of string concatenation, but if either side is a string,
19955 and the other is not, then return null, and let the runtime use
19956 the concatenation on the string plus the object (using
19957 `Object.ToString').
19959 2002-03-04 Miguel de Icaza <miguel@ximian.com>
19961 Constant Folding has been implemented now.
19963 * expression.cs (Unary.Reduce): Do not throw an exception, catch
19964 the error instead on types that are not supported in one's
19967 * constant.cs (Constant and all children): New set of functions to
19968 perform implict and explicit conversions.
19970 * ecore.cs (EnumConstant): Implement the new functions to perform
19971 conversion by proxying to the child expression.
19973 * codegen.cs: (ConstantCheckState): Constant evaluation has its
19974 own separate setting that can not be turned off from the command
19975 line using --unchecked or --checked and is only controlled using
19976 the checked/unchecked statements and expressions. This setting is
19977 used by the constant folder to flag errors.
19979 * expression.cs (CheckedExpr, UncheckedExpr): Set the
19980 ConstantCheckState as well.
19982 During Resolve, they also have to flag the state, because the
19983 constant folder runs completely in the Resolve phase.
19985 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
19988 2002-03-01 Miguel de Icaza <miguel@ximian.com>
19990 * cfold.cs: New file, this file contains the constant folder.
19992 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
19993 argument to track whether we are using the resulting address to
19994 load or store a value and provide better error messages.
19996 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
19997 new AddressOf arguments.
19999 * statement.cs (Foreach.EmitCollectionForeach): Update
20001 * expression.cs (Argument.Emit): Call AddressOf with proper
20002 arguments to track usage.
20004 (New.DoEmit): Call AddressOf with new arguments.
20006 (Unary.Emit): Adjust AddressOf call.
20008 2002-03-01 Ravi Pratap <ravi@ximian.com>
20010 * cs-parser.jay (member_access): Change the case for pre-defined types
20011 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
20014 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
20017 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
20018 essentially like methods and apply attributes like MethodImplOptions to them too.
20020 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
20023 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
20024 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
20027 * Update code everywhere accordingly.
20029 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
20031 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
20033 2002-02-28 Ravi Pratap <ravi@ximian.com>
20035 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
20036 try performing lookups against those instead of jumping straight into using
20037 the 'using' clauses.
20039 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
20041 (LookupType): Perform lookups in implicit parents too.
20043 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
20044 sequence as RootContext.LookupType.
20046 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
20047 the various cases of namespace lookups into this method.
20049 2002-03-01 Miguel de Icaza <miguel@ximian.com>
20051 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
20052 in positional arguments)
20054 * class.cs (Operator): Update the AllowedModifiers to contain
20057 * cs-parser.jay: Update operator declaration to allow for the
20058 operator body to be empty.
20060 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
20063 2002-02-27 Miguel de Icaza <miguel@ximian.com>
20065 * class.cs (Method.Emit): Label parameters.
20067 * driver.cs: Return 1 or 0 as the program exit code.
20069 2002-02-26 Miguel de Icaza <miguel@ximian.com>
20071 * expression.cs: Special case the `null' object when trying to
20072 auto-compute the type, as anything can be explicitly converted to
20075 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
20076 spotting this Paolo.
20078 (Expression.ImplicitNumericConversion): Perform comparissions of
20079 the type using the underlying type in the case of an enumeration
20080 rather than using the enumeration type for the compare.
20082 Cope with the underlying == type case, which is not possible to
20085 (Expression.ConvertNumericExplicit): Perform comparissions of
20086 the type using the underlying type in the case of an enumeration
20087 rather than using the enumeration type for the compare.
20089 * driver.cs: If the user does not supply an extension, assume .exe
20091 * cs-parser.jay (if_statement): Rewrote so that we can track the
20092 location for the if statement.
20094 * expression.cs (Binary.ConstantFold): Only concat strings when
20095 the operation is "+", not everything ;-)
20097 * statement.cs (Statement.EmitBoolExpression): Take a location
20099 (If, While, Do): Track location.
20101 * expression.cs (Binary.ResolveOperator): In the object + string
20102 case, I was missing a call to ConvertImplicit
20104 2002-02-25 Ravi Pratap <ravi@ximian.com>
20106 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
20107 Location arguments. Ensure we use RootContext.LookupType to do our work
20108 and not try to do a direct Type.GetType and ModuleBuilder.GetType
20110 * interface.cs (PopulateMethod): Handle the type of the parameter being
20113 * expression.cs (Invocation.BetterFunction): Handle the case when we
20114 have a params method with no fixed arguments and a call is made with no
20117 2002-02-25 Miguel de Icaza <miguel@ximian.com>
20119 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
20120 the verbatim-string-literal
20122 * support.cs (InternalParameters.ParameterModifier): handle null
20124 (InternalParameters.ParameterType): ditto.
20126 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
20127 duplicating the name of the variable parameter.
20128 (GetParameterByName): Fix bug where we were not looking up array
20129 paramters if they were the only present (thanks Paolo!).
20130 (GetParameterInfo): We only have an empty set of types if both
20131 fixed and array are set to null.
20132 (GetParameterInfo-idx): Handle FixedParameter == null
20134 * cs-parser.jay: Handle the case where there is no catch
20135 statements (missing null test).
20137 2002-02-22 Miguel de Icaza <miguel@ximian.com>
20139 * driver.cs (MainDriver): Be conservative on our command line
20142 Catch DirectoryNotFoundException when calling GetFiles.
20144 (SplitPathAndPattern): Used to split the input specification into
20145 a path and a pattern that we can feed to Directory.GetFiles.
20147 2002-02-21 Miguel de Icaza <miguel@ximian.com>
20149 * statement.cs (Fixed): Implement the last case of the Fixed
20150 statement (string handling).
20152 * expression.cs (StringPtr): New class used to return a char * to
20153 a string; Used by the Fixed statement.
20155 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
20157 * expression.cs (Binary.ResolveOperator): Remove redundant
20158 MemberLookup pn parent type.
20159 Optimize union call, we do not need a union if the types are the same.
20160 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
20163 Specialize the use of MemberLookup everywhere, instead of using
20164 the default settings.
20166 (StackAlloc): Implement stackalloc keyword.
20168 * cs-parser.jay: Add rule to parse stackalloc.
20170 * driver.cs: Handle /h, /help, /?
20172 * expression.cs (MakeByteBlob): Removed the hacks we had in place
20173 before we supported unsafe code.
20175 * makefile: add --unsafe to the self compilation of mcs.
20177 2002-02-20 Miguel de Icaza <miguel@ximian.com>
20179 * expression.cs (PointerArithmetic): New class that is used to
20180 perform pointer arithmetic.
20181 (Binary.Resolve): Handle pointer arithmetic
20182 Handle pointer comparission.
20183 (ArrayPtr): Utility expression class that is used to take the
20184 address of an array.
20186 (ElementAccess): Implement array access for pointers
20188 * statement.cs (Fixed): Implement fixed statement for arrays, we
20189 are missing one more case before we are done.
20191 * expression.cs (Indirection): Implement EmitAssign and set the
20192 ExprClass to Variable. This allows pointer dereferences to be
20193 treated as variables, and to have values assigned to them.
20195 * ecore.cs (Expression.StoreFromPtr): New utility function to
20196 store values dereferencing.
20198 2002-02-20 Ravi Pratap <ravi@ximian.com>
20200 * expression.cs (Binary.ResolveOperator): Ensure that we are
20201 not trying to operate on a void type - this fixes the reported
20204 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
20205 the parent implementation is sealed.
20207 * ../errors/cs0239.cs : Add.
20209 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20211 * typemanager.cs (unverifiable_code_type): Corresponds to
20212 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20213 which have unsafe code in them.
20215 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
20218 2002-02-19 Miguel de Icaza <miguel@ximian.com>
20220 * cs-tokenizer.cs: Add support for @"litreal strings"
20222 Make tokenizer accept pre-processor directives
20223 on any column (remove the old C-like limitation).
20225 * rootcontext.cs (EmitCode): Emit any global attributes.
20226 (AddGlobalAttributes): Used to keep track of assembly attributes.
20228 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20230 * cs-parser.jay: Add support for global attributes.
20232 2002-02-17 Miguel de Icaza <miguel@ximian.com>
20234 * expression.cs (Indirection): New helper class. Unary will
20235 create Indirection classes to be able to implement the
20236 IMemoryLocation interface on it.
20238 2002-02-16 Miguel de Icaza <miguel@ximian.com>
20240 * cs-parser.jay (fixed_statement): reference the right statement.
20242 * statement.cs (Fixed.Emit): Finish implementing the fixed
20243 statement for the &x case.
20245 2002-02-14 Miguel de Icaza <miguel@ximian.com>
20247 * class.cs (Property.Define, Method.Define): Remove newslot when
20250 * modifiers.cs: My use of NewSlot when `Abstract' was set was
20251 wrong. NewSlot should only be used if the `new' keyword is present.
20253 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20254 locating our system dir. Sorry about this.
20256 2002-02-13 Miguel de Icaza <miguel@ximian.com>
20258 * driver.cs (GetSystemDir): Compute correctly the location of our
20259 system assemblies. I was using the compiler directory instead of
20260 the library directory.
20262 2002-02-13 Ravi Pratap <ravi@ximian.com>
20264 * expression.cs (BetterFunction): Put back in what Miguel commented out
20265 since it is the correct fix. The problem is elsewhere ;-)
20267 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20268 parameters of the parms method are themselves compatible or not !
20270 (StandardConversionExists): Fix very dangerous bug where we were forgetting
20271 to check that a class implements an interface before saying that an implicit
20272 conversion was allowed. Use ImplementsInterface to do the checking.
20274 2002-02-13 Miguel de Icaza <miguel@ximian.com>
20276 * class.cs (Method.Define): Track whether we are an explicit
20277 implementation or not. And only call DefineMethodOverride if we
20278 are an explicit implementation.
20280 (Property.DefineMethod): Ditto.
20282 2002-02-11 Ravi Pratap <ravi@ximian.com>
20284 * expression.cs (BetterFunction): Catch hideous bug which was
20285 preventing us from detecting ambiguous calls due to implicit casts i.e
20288 2002-01-29 Miguel de Icaza <miguel@ximian.com>
20290 * support.cs (Pair): Remove un-needed method. I figured why I was
20291 getting the error in cs-parser.jay, the variable in a foreach loop
20292 is readonly, and the compiler does not really treat this as a variable.
20294 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
20295 instead of EQUALS in grammar.
20297 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
20299 * expression.cs (Unary.DoResolve): Check whether the argument is
20302 2002-01-28 Miguel de Icaza <miguel@ximian.com>
20304 * support.cs: Api for Pair to set a value. Despite the fact that
20305 the variables are public the MS C# compiler refuses to compile
20306 code that accesses the field if the variable is part of a foreach
20309 * statement.cs (Fixed): Begin implementation of the fixed
20312 (Block.AddVariable): Return the VariableInfo on success and null
20313 on failure instead of true/false.
20315 * cs-parser.jay (foreach): Catch errors on variables already
20316 defined (we were ignoring this value before) and properly unwind
20317 the block hierarchy
20319 (fixed_statement): grammar for the fixed statement.
20321 2002-01-25 Miguel de Icaza <miguel@ximian.com>
20323 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20324 pointer types to be incretemented.
20326 (SizeOf): Implement.
20328 * cs-parser.jay (pointer_member_access): Implement
20329 expr->IDENTIFIER production.
20331 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20332 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20335 (Unary): Implement indirection.
20337 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20338 use in non-unsafe context).
20340 (SimpleName.DoResolve): Check for pointers in field access on safe
20343 (Expression.LoadFromPtr): Factor the load-indirect code in this
20344 function. This was duplicated in UnboxCast and ParameterReference
20346 2002-01-24 Miguel de Icaza <miguel@ximian.com>
20348 * expression.cs (ComposedCast): report an error if a pointer cast
20349 is used in a safe region.
20351 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20352 pointer type casts in unsafe context.
20354 * codegen.cs (EmitContext): Set up IsUnsafe.
20356 * cs-parser.jay (non_expression_type): Add productions for pointer
20359 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20360 code. We should not use force into static mode if the method is
20361 not virtual. Fixes bug in MIS
20363 * statement.cs (Do.Emit, While.Emit, For.Emit,
20364 Statement.EmitBoolExpression): Add support to Do and While to
20365 propagate infinite loop as `I do return' semantics.
20367 Improve the For case to also test for boolean constants.
20369 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20370 to the list of attributes we can add.
20372 Remove `EmitContext' argument.
20374 * class.cs (Method.Define): Apply parameter attributes.
20375 (Constructor.Define): Apply parameter attributes.
20376 (MethodCore.LabelParameters): Move here the core of labeling
20379 * support.cs (ReflectionParameters.ParameterModifier,
20380 InternalParameters.ParameterModifier): Use IsByRef on the type and
20381 only return the OUT bit for these parameters instead of in/out/ref
20384 This is because I miss-understood things. The ParameterInfo.IsIn
20385 and IsOut represent whether the parameter has the [In] and [Out]
20388 2002-01-22 Miguel de Icaza <miguel@ximian.com>
20390 * ecore.cs (FieldExpr.Emit): Release temporaries.
20392 * assign.cs (LocalTemporary.Release): new function.
20394 * codegen.cs (EmitContext.GetTemporaryStorage,
20395 EmitContext.FreeTemporaryStorage): Rework the way we deal with
20396 temporary storage. Now we can "put back" localbuilders when we
20399 2002-01-21 Miguel de Icaza <miguel@ximian.com>
20401 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20402 need to make a copy of the variable to generate verifiable code.
20404 2002-01-19 Miguel de Icaza <miguel@ximian.com>
20406 * driver.cs: Compute dynamically the system directory.
20408 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20409 Slower, but more generally useful. Used by the abstract
20410 registering implementation.
20412 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20413 the rules for the special rule on Type/instances. First check if
20414 we have the same name, and if so, try that special static path
20415 rather than the instance path.
20417 2002-01-18 Miguel de Icaza <miguel@ximian.com>
20419 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20422 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20423 Enum, ValueType, Delegate or Array for non-corlib compiles.
20425 * cs-tokenizer.cs: Catch long identifiers (645)
20427 * typemanager.cs (IndexerPropetyName): Ravi never tested this
20430 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20431 fix, we were returning too early, so we were not registering
20432 pending methods from abstract classes.
20434 Do not register pending methods if the class is abstract.
20436 * expression.cs (Conditional.DoResolve): Report circular implicit
20437 conversions when we neecd to compute it for conditional
20440 (Is.DoResolve): If the expression is always of the provided type,
20441 flag warning 183. If the expression can not ever be of the
20442 provided type flag warning 184.
20444 * class.cs: Catch 169 as well.
20446 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20449 2002-01-18 Nick Drochak <ndrochak@gol.com>
20451 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
20453 2002-01-17 Miguel de Icaza <miguel@ximian.com>
20455 * interface.cs: (PopulateMethod): Check for pointers being defined
20456 only if the unsafe context is active.
20457 (PopulateProperty): ditto.
20458 (PopulateIndexer): ditto.
20460 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20461 specified. If pointers are present, make sure that they are
20462 present in an unsafe context.
20463 (Constructor, Constructor.Define): ditto.
20464 (Field, Field.Define): ditto.
20465 (Property, Property.Define): ditto.
20466 (Event, Event.Define): ditto.
20468 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
20469 hashtable if there are classes or structs defined.
20471 * expression.cs (LocalVariableReference.DoResolve): Simplify this
20472 code, as the constant resolution moved.
20474 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
20475 the metadata, so we can flag error 133.
20477 * decl.cs (MemberCore.UnsafeOK): New function to test that a
20478 pointer is being declared in an unsafe context.
20480 2002-01-16 Miguel de Icaza <miguel@ximian.com>
20482 * modifiers.cs (Modifiers.Check): Require a Location argument.
20483 Report error 227 for Unsafe use.
20485 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
20487 * statement.cs (For.Emit): If the test is null, then report that
20488 we do `return', as we wont reach anything afterwards.
20490 (Switch.SwitchGoverningType): Track the expression that matched
20493 * driver.cs: Allow negative numbers as an error code to flag.
20495 * cs-parser.jay: Handle 1551.
20497 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
20499 2002-01-15 Miguel de Icaza <miguel@ximian.com>
20501 * cs-parser.jay: Report 1518 (type declaration can only contain
20502 class, struct, interface, enum or delegate)
20504 (switch_label): Report 1523 (keywords `case' or `default' must
20507 (opt_switch_sections): Report 1522 (empty switch)
20509 * driver.cs: Report 1515 (response file specified multiple times)
20510 Report 1516 (Source file specified multiple times).
20512 * expression.cs (Argument.Resolve): Signal 1510
20514 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20515 access not allowed in static code)
20517 2002-01-11 Ravi Pratap <ravi@ximian.com>
20519 * typemanager.cs (IsPointerType): Utility method which we are going
20522 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20523 the object type, so we take care of that.
20525 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20527 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20528 added to non-params parameters :-)
20530 * typemanager.cs (CSharpName): Include 'void' type too.
20532 (void_ptr_type): Include in the set of core types.
20534 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
20537 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
20540 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
20541 completely forgotten about it.
20543 2002-01-10 Ravi Pratap <ravi@ximian.com>
20545 * cs-parser.jay (pointer_type): Add. This begins our implementation
20546 of parsing rules for unsafe code.
20548 (unsafe_statement): Implement.
20550 (embedded_statement): Modify to include the above.
20552 * statement.cs (Unsafe): Implement new class for unsafe blocks.
20554 * codegen.cs (EmitContext.InUnsafe): Add. This determines
20555 if the current context is an unsafe one.
20557 * cs-parser.jay (local_variable_pointer_type): Since local variable types
20558 are handled differently, we need separate rules for them.
20560 (local_variable_declaration): Update to use local_variable_pointer_type
20561 to allow variable declarations of unmanaged pointer types.
20563 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20564 in unsafe contexts.
20566 * ../errors/cs0214.cs : Add.
20568 2002-01-16 Nick Drochak <ndrochak@gol.com>
20570 * makefile: remove 'response' file when cleaning.
20572 2002-01-15 Miguel de Icaza <miguel@ximian.com>
20574 * cs-parser.jay: Report 1524.
20576 2002-01-14 Miguel de Icaza <miguel@ximian.com>
20578 * typemanager.cs (RegisterMethod): drop checking if we have
20579 registered this from here
20581 2002-01-12 Miguel de Icaza <miguel@ximian.com>
20583 * class.cs (Method.EmitDestructor): Implement calling our base
20586 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20587 value of InFinally.
20589 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20590 this routine and will wrap the call in a try/catch block. Deal
20593 2002-01-11 Miguel de Icaza <miguel@ximian.com>
20595 * ecore.cs (Expression.MemberLookup): instead of taking a
20596 parameter `same_type' that was used to tell whether we could
20597 access private members we compute our containing type from the
20600 (FieldExpr): Added partial support for volatile fields. This does
20601 not work for volatile fields exposed from assemblies, as I can not
20602 figure out how to extract the modreq from it.
20604 Updated all the source files to use this.
20606 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20607 because it is referenced by MemberLookup very often.
20609 2002-01-09 Ravi Pratap <ravi@ximian.com>
20611 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20612 TypeBuilder.GetCustomAttributes to retrieve what we need.
20614 Get rid of redundant default_member_attr_type as this is the same as
20615 default_member_type which already exists.
20617 * interface.cs, attribute.cs : Update accordingly.
20619 2002-01-08 Miguel de Icaza <miguel@ximian.com>
20621 * typemanager.cs: Enable IndexerPropertyName again. It does not
20622 work for TYpeBuilders though. Ravi, can you please fix this?
20624 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20626 * expression.cs (Argument.Emit): Handle the case of ref objects
20627 being passed to ref functions;
20629 (ParameterReference.EmitLoad): Loads the content of the pointer
20630 without dereferencing.
20632 2002-01-07 Miguel de Icaza <miguel@ximian.com>
20634 * cs-tokenizer.cs: Implemented the pre-processing expressions.
20636 2002-01-08 Ravi Pratap <ravi@ximian.com>
20638 * class.cs (Indexer.DefineMethod): Incorporate the interface
20639 type in the name of the method if we are doing explicit interface
20642 * expression.cs (ConversionExists): Remove as it is completely obsolete.
20644 (BetterConversion): Fix extremely trivial bug where we were referring to
20645 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20648 * ../errors/bug16.cs : Add although we have fixed it.
20650 2002-01-07 Miguel de Icaza <miguel@ximian.com>
20652 * expression.cs (BaseIndexer): Begin implementation.
20654 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20656 * cs-parser.jay (indexer_declarator): Use qualified_identifier
20657 production directly to remove a shift/reduce, and implement
20658 explicit interface implementation.
20660 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20661 after a floating point suffix.
20663 * expression.cs (DoNumericPromotions): Improved the conversion for
20664 uint/uint. If we have a constant, we avoid doing a typecast to a
20667 * class.cs (Indexer): Implement explicit interface implementation
20670 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20672 * class.cs: make the default instance constructor public and hidebysig.
20674 2001-01-03 Ravi Pratap <ravi@ximian.com>
20676 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20677 so we can call it from elsewhere.
20679 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20680 we emit it internally if the class has a defined indexer; otherwise the user
20681 emits it by decorating the class definition with the DefaultMemberAttribute.
20683 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20684 attribute is not used on a type which defines an indexer.
20686 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20687 character when we skip whitespace.
20689 * ../errors/cs0646.cs : Add.
20691 2002-01-03 Miguel de Icaza <miguel@ximian.com>
20693 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20696 * makefile: Add practical target `mcs3.exe' which builds the third
20697 generation compiler.
20699 * expression.cs (New): Fix structures constructor calling.
20701 * class.cs (Property, Method, Indexer): Emit Final flag on the
20702 method if we are an interface implementation and we are not
20705 * ecore.cs (PropertyExpr): New public field `IsBase', tells
20706 whether this property is referencing a `base' method.
20708 * expression.cs (Invocation.EmitCall): take an extra argument:
20709 is_base, this is used to determine whether the `call' or
20710 `callvirt' opcode should be used.
20713 * delegate.cs: update EmitCall.
20715 * class.cs (Method.Define): Set NewSlot for the cases where we are
20716 not implementing an interface method.
20718 (Property.Define): ditto.
20720 2002-01-02 Miguel de Icaza <miguel@ximian.com>
20722 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20723 'r'. Allows mcs to parse itself fully.
20725 2002-01-02 Ravi Pratap <ravi@ximian.com>
20727 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20728 of the number of initializers that require the InitializeArray method.
20730 (CheckIndices): Store the Expression in all cases - not the plain value. Also
20731 update the above field where necessary.
20733 (MakeByteBlob): Update accordingly.
20735 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
20738 (EmitDynamicInitializers): Update in accordance with the new optimization.
20740 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20741 same OpCode applies.
20743 * cs-parser.jay : Fix some glaring errors I introduced.
20745 2002-01-01 Ravi Pratap <ravi@ximian.com>
20747 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20748 so that we can check for name clashes there too.
20750 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20751 for interface indexers.
20753 * interfaces.cs (Define): Emit the default member attribute.
20755 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20756 variable was being referred to while setting the value ;-)
20758 2002-01-01 Miguel de Icaza <miguel@ximian.com>
20760 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20761 byte-by-byte information when we know the data is zero.
20763 Make the block always a multiple of 4, because
20764 DefineInitializedData has a bug.
20766 * assign.cs: Fix, we should assign from the temporary, not from
20769 * expression.cs (MakeByteBlob): Fix my incorrect code.
20771 2001-12-31 Miguel de Icaza <miguel@ximian.com>
20773 * typemanager.cs (EnumToUnderlying): This function is used to get
20774 the underlying type from an enumeration, because it does not
20777 * constant.cs: Use the I4_S form for values between -128 and 127.
20779 * statement.cs (Block.LookupLabel): Looks up a label.
20780 (Block): Drop support for labeled blocks.
20782 (LabeledStatement): New kind of statement that represents a label
20785 (Goto): Finally implement this bad boy.
20787 * cs-parser.jay: Update to reflect new mechanism to implement
20790 2001-12-30 Miguel de Icaza <miguel@ximian.com>
20792 * codegen.cs (EmitContext.This): a codegen property that keeps the
20793 a single instance of this instead of creating many different this
20796 * delegate.cs (Delegate.DoResolve): Update to use the property;
20798 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
20800 * expression.cs (BaseAccess.DoResolve): Ditto.
20802 2001-12-29 Ravi Pratap <ravi@ximian.com>
20804 * typemanager.cs (methodimpl_attr_type): Add to hold the type
20805 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
20807 (InitCoreTypes): Update accordingly.
20809 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
20810 so we can quickly store the state.
20812 (ApplyAttributes): Set the correct implementation flags
20813 for InternalCall methods.
20815 2001-12-29 Miguel de Icaza <miguel@ximian.com>
20817 * expression.cs (EmitCall): if a method is not virtual, then do
20818 not use callvirt on it.
20820 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
20821 user defined stuff) requires the use of stobj, which takes an
20822 address on the stack instead of an array and an index. So emit
20823 the Ldelema operation for it.
20825 (EmitStoreOpcode): Use stobj for valuetypes.
20827 (UnaryMutator.EmitCode): Use the right 1 value depending on
20828 whether we are dealing with int64/uint64, float or doubles.
20830 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
20831 constructors that I implemented last night.
20833 (Constructor.IsDefault): Fix to work properly for static
20836 * cs-parser.jay (CheckDef): report method signature errors.
20837 Update error number 103 to be 132.
20839 * decl.cs: New AdditionResult enumeration value: MethodExists.
20840 Although we do this check for methods later on in the semantic
20841 analysis, catching repeated default constructors is so easy that
20842 we catch these here.
20844 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
20847 (ParameterReference.EmitAssign, Emit): handle
20850 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
20851 (ArrayAccess.EmitStoreOpcode): ditto.
20853 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
20855 * expression.cs (MakeByteBlob): Complete all the missing types
20856 (uint, short, ushort, byte, sbyte)
20858 * class.cs: Only init instance field initializers on instance
20861 Rename `constructors' to instance_constructors.
20863 (TypeContainer.AddConstructor): Only add constructors to the list
20864 if it is not static.
20866 Make sure that we handle default_static_constructor independently
20867 everywhere where we handle instance_constructors
20869 2001-12-28 Miguel de Icaza <miguel@ximian.com>
20871 * class.cs: Do not lookup or create a base initializer for a
20872 static constructor.
20874 (ConstructorInitializer.Resolve): use the proper type to lookup
20877 * cs-parser.jay: Report error 1585 (modifiers between type and name).
20879 * enum.cs, interface.cs: Remove CloseType, this is taken care by
20882 * decl.cs: CloseType is now an virtual method, the default
20883 implementation just closes this type.
20885 2001-12-28 Ravi Pratap <ravi@ximian.com>
20887 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
20888 to PreserveSig by default. Also emit HideBySig on such methods.
20890 Basically, set the defaults to standard values.
20892 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
20893 argument, if candidate is better, it can't be worse than the best !
20895 (Invocation): Re-write bits to differentiate between methods being
20896 applicable in their expanded form and their normal form - for params
20899 Get rid of use_standard everywhere as only standard conversions are allowed
20900 in overload resolution.
20902 More spec conformance.
20904 2001-12-27 Miguel de Icaza <miguel@ximian.com>
20906 * driver.cs: Add --timestamp, to see where the compiler spends
20909 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
20910 `this' in static code.
20912 (SimpleName.DoResolve): Implement in terms of a helper function
20913 that allows static-references to be passed upstream to
20916 (Expression.ResolveWithSimpleName): Resolve specially simple
20917 names when called by MemberAccess to implement the special
20920 (Expression.ImplicitReferenceConversion): Handle conversions from
20921 Null to reference types before others, as Null's type is
20924 * expression.cs (Invocation.EmitCall): Handle the special case of
20925 calling methods declared on a reference type from a ValueType
20926 (Base classes System.Object and System.Enum)
20928 (MemberAccess.Resolve): Only perform lookups on Enumerations if
20929 the left hand side is a TypeExpr, not on every enumeration.
20931 (Binary.Resolve): If types are reference types, then do a cast to
20932 object on operators != and == of both arguments.
20934 * typemanager.cs (FindMembers): Extract instance and static
20935 members if requested.
20937 * interface.cs (PopulateProperty): Use void_type instead of null
20938 as the return type for the setter method.
20940 (PopulateIndexer): ditto.
20942 2001-12-27 Ravi Pratap <ravi@ximian.com>
20944 * support.cs (ReflectionParameters): Fix minor bug where we
20945 were examining the wrong parameter for the ParamArray attribute.
20947 Cope with requests for the type of the parameter at position
20948 greater than the params parameter's. We now return the element
20949 type of the params array as that makes more sense.
20951 * expression.cs (Invocation.IsParamsMethodApplicable): Update
20952 accordingly as we no longer have to extract the element type
20955 (Invocation.OverloadResolve): Update.
20957 2001-12-27 Miguel de Icaza <miguel@ximian.com>
20959 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
20960 against IEnumerator, test whether the return value is a descendant
20961 of the IEnumerator interface.
20963 * class.cs (Indexer.Define): Use an auxiliary method to implement
20964 the other bits of the method definition. Begin support for
20965 explicit interface implementation.
20967 (Property.DefineMethod): Use TypeManager.void_type instead of null
20968 for an empty return value.
20970 2001-12-26 Miguel de Icaza <miguel@ximian.com>
20972 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
20973 dealing with a FieldExpr which is composed of a FieldBuilder, in
20974 the code path we did extract the constant, but we should have
20975 obtained the underlying value to be able to cast it (otherwise we
20976 end up in an infinite loop, this is what Ravi was running into).
20978 (ArrayCreation.UpdateIndices): Arrays might be empty.
20980 (MemberAccess.ResolveMemberAccess): Add support for section
20981 14.5.4.1 that deals with the special case of E.I when E is a type
20982 and something else, that I can be a reference to a static member.
20984 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
20985 handle a particular array type to create byte blobs, it is just
20986 something we dont generate byteblobs for.
20988 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
20991 * location.cs (Push): remove the key from the hashtable that we
20992 are about to add. This happens for empty files.
20994 * driver.cs: Dispose files after we have parsed them.
20996 (tokenize): new function that only runs the tokenizer on its
20997 input, for speed testing.
20999 2001-12-26 Ravi Pratap <ravi@ximian.com>
21001 * class.cs (Event.Define): Define the private field only if there
21002 are no accessors defined.
21004 * expression.cs (ResolveMemberAccess): If there is no associated
21005 field with the event, that means we have an event defined with its
21006 own accessors and we should flag error cs0070 since transforming
21007 ourselves into a field is not valid in that case.
21009 * ecore.cs (SimpleName.DoResolve): Same as above.
21011 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
21012 and charset to sane values.
21014 2001-12-25 Ravi Pratap <ravi@ximian.com>
21016 * assign.cs (DoResolve): Perform check on events only if they
21017 are being accessed outside the declaring type.
21019 * cs-parser.jay (event_declarations): Update rules to correctly
21020 set the type of the implicit parameter etc.
21022 (add_accessor, remove_accessor): Set current local parameters.
21024 * expression.cs (Binary): For delegate addition and subtraction,
21025 cast the return value from the method into the appropriate delegate
21028 2001-12-24 Ravi Pratap <ravi@ximian.com>
21030 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
21031 of these as the workaround is unnecessary.
21033 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
21034 delegate data - none of that is needed at all.
21036 Re-write bits to extract the instance expression and the delegate method
21039 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
21042 * attribute.cs (ApplyAttributes): New method to take care of common tasks
21043 of attaching attributes instead of duplicating code everywhere.
21045 * everywhere : Update code to do attribute emission using the above method.
21047 2001-12-23 Miguel de Icaza <miguel@ximian.com>
21049 * expression.cs (IsParamsMethodApplicable): if there are not
21050 parameters, return immediately.
21052 * ecore.cs: The 0 literal can be implicity converted to an enum
21055 (SimpleName.DoResolve): First lookup the type, then lookup the
21058 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
21059 want to get its address. If the InstanceExpression is not
21060 addressable, store the result in a temporary variable, then get
21063 * codegen.cs: Only display 219 errors on warning level or above.
21065 * expression.cs (ArrayAccess): Make it implement the
21066 IMemoryLocation interface.
21068 (Binary.DoResolve): handle the operator == (object a, object b)
21069 and operator != (object a, object b) without incurring into a
21070 BoxedCast (because 5 != o should never be performed).
21072 Handle binary enumerator operators.
21074 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
21075 value type, otherwise use Ldelem_ref.
21077 Use precomputed names;
21079 (AddressOf): Implement address of
21081 * cs-parser.jay (labeled_statement): Fix recursive block
21082 addition by reworking the production.
21084 * expression.cs (New.DoEmit): New has a special case:
21086 If we are dealing with a ValueType, we have a few
21087 situations to deal with:
21089 * The target of New is a ValueType variable, that is
21090 easy, we just pass this as the variable reference
21092 * The target of New is being passed as an argument,
21093 to a boxing operation or a function that takes a
21096 In this case, we need to create a temporary variable
21097 that is the argument of New.
21100 2001-12-23 Ravi Pratap <ravi@ximian.com>
21102 * rootcontext.cs (LookupType): Check that current_type is not null before
21103 going about looking at nested types.
21105 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
21106 not implement the IAssignMethod interface any more.
21108 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
21109 where we tranform them into FieldExprs if they are being resolved from within
21110 the declaring type.
21112 * ecore.cs (SimpleName.DoResolve): Do the same here.
21114 * assign.cs (DoResolve, Emit): Clean up code considerably.
21116 * ../errors/bug10.cs : Add.
21118 * ../errors/cs0070.cs : Add.
21120 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
21122 * assign.cs : Get rid of EventIsLocal everywhere.
21124 2001-12-23 Miguel de Icaza <miguel@ximian.com>
21126 * ecore.cs (ConvertIntLiteral): finished the implementation.
21128 * statement.cs (SwitchLabel): Convert the value we are using as a
21129 key before looking up the table.
21131 2001-12-22 Miguel de Icaza <miguel@ximian.com>
21133 * codegen.cs (EmitTopBlock): Require a Location argument now.
21135 * cs-parser.jay (constructor_declarator): We need to setup
21136 current_local_parameters before we parse the
21137 opt_constructor_initializer, to allow the variables to be bound
21138 to the constructor arguments.
21140 * rootcontext.cs (LookupType): First lookup nested classes in our
21141 class and our parents before we go looking outside our class.
21143 * expression.cs (ConstantFold): Extract/debox the values at the
21146 * rootcontext.cs (EmitCode): Resolve the constants first before we
21147 resolve the types. This is not really needed, but it helps debugging.
21149 * statement.cs: report location.
21151 * cs-parser.jay: pass location to throw statement.
21153 * driver.cs: Small bug fix.
21155 * report.cs: Updated format to be 4-zero filled digits.
21157 2001-12-22 Ravi Pratap <ravi@ximian.com>
21159 * expression.cs (CheckIndices): Fix minor bug where the wrong
21160 variable was being referred to ;-)
21162 (DoEmit): Do not call EmitStaticInitializers when the
21163 underlying type is System.Object.
21165 2001-12-21 Ravi Pratap <ravi@ximian.com>
21167 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
21168 and do the usual workaround for SRE.
21170 * class.cs (MyEventBuilder.EventType): New member to get at the type
21171 of the event, quickly.
21173 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
21175 * assign.cs (Assign.DoResolve): Handle the case when the target
21176 is an EventExpr and perform the necessary checks.
21178 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
21181 (SimpleName.MemberStaticCheck): Include check for EventExpr.
21183 (EventExpr): Set the type in the constructor itself since we
21184 are meant to be born fully resolved.
21186 (EventExpr.Define): Revert code I wrote earlier.
21188 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
21189 instance expression is null. The instance expression is a This in that case
21190 or a null, depending on whether it is a static method or not.
21192 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
21193 refers to more than one method.
21195 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
21196 and accordingly flag errors.
21198 2001-12-21 Miguel de Icaza <miguel@ximian.com>
21200 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
21202 2001-12-22 Miguel de Icaza <miguel@ximian.com>
21204 * location.cs (ToString): Provide useful rutine.
21206 2001-12-21 Miguel de Icaza <miguel@ximian.com>
21208 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21209 objects, return the actual integral boxed.
21211 * statement.cs (SwitchLabel): define an ILLabel for each
21214 (Switch.CheckSwitch): If the value is a Literal, extract
21215 the underlying literal.
21217 Also in the unused hashtable we had, add the SwitchLabel so we can
21218 quickly look this value up.
21220 * constant.cs: Implement a bunch of new constants. Rewrite
21221 Literal based on this. Made changes everywhere to adapt to this.
21223 * expression.cs (Expression.MakeByteBlob): Optimize routine by
21224 dereferencing array only once, and also copes with enumrations.
21226 bytes are two bytes wide, not one.
21228 (Cast): Perform constant conversions.
21230 * ecore.cs (TryImplicitIntConversion): Return literals instead of
21231 wrappers to the literals here.
21233 * expression.cs (DoNumericPromotions): long literals can converted
21234 to ulong implicity (this is taken care of elsewhere, but I was
21235 missing this spot).
21237 * ecore.cs (Expression.Literalize): Make the return type Literal,
21238 to improve type checking.
21240 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21242 2001-12-20 Miguel de Icaza <miguel@ximian.com>
21244 * literal.cs: Revert code from ravi that checked the bounds. The
21245 bounds are sane by the definition of the type itself.
21247 * typemanager.cs: Fix implementation of ImplementsInterface. We
21248 need to actually look up in our parent hierarchy for interfaces
21251 * const.cs: Use the underlying type for enumerations
21253 * delegate.cs: Compute the basename for the delegate creation,
21254 that should fix the delegate test case, and restore the correct
21255 Type Lookup semantics in rootcontext
21257 * rootcontext.cs: Revert Ravi's last patch. The correct way of
21258 referencing a nested type with the Reflection API is using the "+"
21261 * cs-parser.jay: Do not require EOF token at the end.
21263 2001-12-20 Ravi Pratap <ravi@ximian.com>
21265 * rootcontext.cs (LookupType): Concatenate type names with
21266 a '.' instead of a '+' The test suite passes again.
21268 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21269 field of the enumeration.
21271 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21272 the case when the member is an EventExpr.
21274 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21275 static has an associated instance expression.
21277 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21279 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21281 * class.cs (Event.Define): Register event and perform appropriate checks
21284 We define the Add and Remove methods even if the use provides none because
21285 in that case, we provide default implementations ourselves.
21287 Define a private field of the type of the event. This is done by the CSC compiler
21288 and we should be doing it too ;-)
21290 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
21291 More methods we use in code we generate.
21293 (multicast_delegate_type, delegate_type): Two separate types since the distinction
21296 (InitCoreTypes): Update accordingly for the above.
21298 * class.cs (Event.Emit): Generate code for default accessors that we provide
21300 (EmitDefaultMethod): Do the job in the above.
21302 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
21305 2001-12-20 Miguel de Icaza <miguel@ximian.com>
21307 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
21308 builders even if we were missing one.
21310 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
21311 pass the Basename as our class name instead of the Name. The
21312 basename will be correctly composed for us.
21314 * parameter.cs (Paramters): Now takes a Location argument.
21316 * decl.cs (DeclSpace.LookupType): Removed convenience function and
21317 make all the code call directly LookupType in RootContext and take
21318 this chance to pass the Location information everywhere.
21320 * Everywhere: pass Location information.
21322 2001-12-19 Miguel de Icaza <miguel@ximian.com>
21324 * class.cs (Constructor.Define): Updated way of detecting the
21325 length of the parameters.
21327 (TypeContainer.DefineType): Use basename as the type name for
21330 (TypeContainer.Define): Do not recursively define types here, as
21331 definition is taken care in order by the RootContext.
21333 * tree.cs: Keep track of namespaces in a per-file basis.
21335 * parameter.cs (Parameter.ComputeSignature): Update to use
21338 (Parameters.GetSignature): ditto.
21340 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21341 instead of a TypeContainer.
21343 (Interface.SemanticAnalysis): Use `this' instead of our parent to
21344 resolve names. Because we need to be resolve in our context, not
21347 * driver.cs: Implement response files.
21349 * class.cs (TypeContainer.DefineType): If we are defined, do not
21350 redefine ourselves.
21352 (Event.Emit): Emit the code for add/remove handlers.
21353 (Event.Define): Save the MethodBuilders for add/remove.
21355 * typemanager.cs: Use pair here too.
21357 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21358 DictionaryEntry requires the first argument to be non-null.
21360 (enum_declaration): Compute full name for registering the
21363 (delegate_declaration): Instead of using
21364 formal_parameter_list, use opt_formal_parameter_list as the list
21367 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21368 (EventParsing): New property that controls whether `add' and
21369 `remove' are returned as tokens or identifiers (for events);
21371 2001-12-19 Ravi Pratap <ravi@ximian.com>
21373 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21374 use MyEventBuilder only and let it wrap the real builder for us.
21376 (MyEventBuilder): Revamp constructor etc.
21378 Implement all operations that we perform on EventBuilder in precisely the same
21381 (FindMembers): Update to use the EventBuilder member.
21383 (Event.Emit): Update accordingly.
21385 2001-12-18 Ravi Pratap <ravi@ximian.com>
21387 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21388 by calling the appropriate methods.
21390 (GetCustomAttributes): Make stubs as they cannot possibly do anything
21393 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21395 2001-12-17 Ravi Pratap <ravi@ximian.com>
21397 * delegate.cs (Delegate.Populate): Check that the return type
21398 and various parameters types are indeed accessible.
21400 * class.cs (Constructor.Define): Same here.
21402 (Field.Define): Ditto.
21404 (Event.Define): Ditto.
21406 (Operator.Define): Check that the underlying Method defined itself
21407 correctly - so it's MethodBuilder should not be null.
21409 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21410 expression happens to be null.
21412 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21413 members but as of now we don't seem to be able to do anything really useful with it.
21415 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21416 not the EventBuilder.
21418 2001-12-18 Miguel de Icaza <miguel@ximian.com>
21420 * cs-tokenizer.cs: Add support for defines.
21421 Add support for #if, #elif, #else, #endif
21423 (eval_var): evaluates a variable.
21424 (eval): stubbed for evaluating functions.
21426 * cs-parser.jay: Pass the defines information
21428 * driver.cs: Add --define command line option.
21430 * decl.cs: Move MemberCore here.
21432 Make it the base class for DeclSpace. This allows us to catch and
21433 report 108 and 109 for everything now.
21435 * class.cs (TypeContainer.Define): Extract all the members
21436 before populating and emit the warning 108 (new keyword required
21437 to override) instead of having each member implement this.
21439 (MemberCore.Define): New abstract method, we will be using this in
21440 the warning reporting engine in Populate.
21442 (Operator.Define): Adjust to new MemberCore protocol.
21444 * const.cs (Const): This does not derive from Expression, it is a
21445 temporary object we use to create fields, it is a MemberCore.
21447 * class.cs (Method.Define): Allow the entry point to be in a
21450 * driver.cs: Rewrite the argument handler to clean it up a bit.
21452 * rootcontext.cs: Made it just an auxiliary namespace feature by
21453 making everything static.
21455 * driver.cs: Adapt code to use RootContext type name instead of
21458 * delegate.cs: Remove RootContext argument.
21460 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21463 * class.cs (Event.Define): The lookup can fail.
21465 * cs-tokenizer.cs: Begin implementation of pre-procesor.
21467 * expression.cs: Resolve the this instance before invoking the code.
21469 2001-12-17 Miguel de Icaza <miguel@ximian.com>
21471 * cs-parser.jay: Add a production in element_access that allows
21472 the thing to become a "type" reference. This way we can parse
21473 things like "(string [])" as a type.
21475 Note that this still does not handle the more complex rules of
21479 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
21481 * ecore.cs: (CopyNewMethods): new utility function used to
21482 assemble the list of methods from running FindMembers.
21484 (MemberLookup): Rework FindMembers so that
21486 2001-12-16 Miguel de Icaza <miguel@ximian.com>
21488 * class.cs (TypeContainer): Remove Delegates who fail to be
21491 * delegate.cs (Populate): Verify that we dont get null return
21492 values. TODO: Check for AsAccessible.
21494 * cs-parser.jay: Use basename to emit error 574 (destructor should
21495 have the same name as container class), not the full name.
21497 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
21498 possible representation.
21500 Also implements integer type suffixes U and L.
21502 2001-12-15 Miguel de Icaza <miguel@ximian.com>
21504 * expression.cs (ArrayCreation.DoResolve): We need to do the
21505 argument resolution *always*.
21507 * decl.cs: Make this hold the namespace. Hold the root context as
21509 (LookupType): Move here.
21511 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21513 * location.cs (Row, Name): Fixed the code, it was always returning
21514 references to the first file.
21516 * interface.cs: Register properties defined through interfaces.
21518 * driver.cs: Add support for globbing on the command line
21520 * class.cs (Field): Make it derive from MemberCore as well.
21523 2001-12-15 Ravi Pratap <ravi@ximian.com>
21525 * class.cs (Event::Define): Check that the type of the event is a delegate
21526 type else flag error #66.
21528 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21531 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21532 values of EntryPoint, CharSet etc etc.
21534 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21536 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21537 be null and we should ignore this. I am not sure if this is really clean. Apparently,
21538 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21539 which needs this to do its work.
21541 * ../errors/cs0066.cs : Add.
21543 2001-12-14 Miguel de Icaza <miguel@ximian.com>
21545 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21548 * class.cs: (MethodSignature.MethodSignature): Removed hack that
21549 clears out the parameters field.
21550 (MemberSignatureCompare): Cleanup
21552 (MemberCore): New base class used to share code between MethodCore
21555 (RegisterRequiredImplementations) BindingFlags.Public requires
21556 either BindingFlags.Instace or Static. Use instance here.
21558 (Property): Refactored code to cope better with the full spec.
21560 * parameter.cs (GetParameterInfo): Return an empty array instead
21563 * class.cs (Property): Abstract or extern properties have no bodies.
21565 * parameter.cs (GetParameterInfo): return a zero-sized array.
21567 * class.cs (TypeContainer.MethodModifiersValid): Move all the
21568 method modifier validation to the typecontainer so we can reuse
21569 this on properties.
21571 (MethodCore.ParameterTypes): return an empty sized array of types.
21573 (Property.Define): Test property modifier validity.
21575 Add tests for sealed/override too.
21577 (Method.Emit): abstract or extern methods have no bodies.
21579 2001-12-14 Ravi Pratap <ravi@ximian.com>
21581 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21584 (Method::Define, ::Emit): Modify accordingly.
21586 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21588 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21590 * makefile: Pass in /unsafe.
21592 2001-12-13 Miguel de Icaza <miguel@ximian.com>
21594 * class.cs (MakeKey): Kill routine.
21596 * class.cs (TypeContainer.Define): Correctly define explicit
21597 method implementations (they require the full interface name plus
21600 * typemanager.cs: Deply the PtrHashtable here and stop using the
21601 lame keys. Things work so much better.
21603 This of course broke everyone who depended on `RegisterMethod' to
21604 do the `test for existance' test. This has to be done elsewhere.
21606 * support.cs (PtrHashtable): A hashtable that avoid comparing with
21607 the object stupid Equals method (because, that like fails all over
21608 the place). We still do not use it.
21610 * class.cs (TypeContainer.SetRequiredInterface,
21611 TypeContainer.RequireMethods): Killed these two routines and moved
21612 all the functionality to RegisterRequiredImplementations.
21614 (TypeContainer.RegisterRequiredImplementations): This routine now
21615 registers all the implementations required in an array for the
21616 interfaces and abstract methods. We use an array of structures
21617 which can be computed ahead of time to reduce memory usage and we
21618 also assume that lookups are cheap as most classes will not
21619 implement too many interfaces.
21621 We also avoid creating too many MethodSignatures.
21623 (TypeContainer.IsInterfaceMethod): Update and optionally does not
21624 clear the "pending" bit if we find that there are problems with
21627 (TypeContainer.VerifyPendingMethods): Update to report errors of
21628 methods that look like implementations but are not.
21630 (TypeContainer.Define): Add support for explicit interface method
21633 2001-12-12 Miguel de Icaza <miguel@ximian.com>
21635 * typemanager.cs: Keep track of the parameters here instead of
21636 being a feature of the TypeContainer.
21638 * class.cs: Drop the registration of parameters here, as
21639 InterfaceMethods are also interface declarations.
21641 * delegate.cs: Register methods with the TypeManager not only with
21642 the TypeContainer. This code was buggy.
21644 * interface.cs: Full registation here.
21646 2001-12-11 Miguel de Icaza <miguel@ximian.com>
21648 * expression.cs: Remove reducer for binary expressions, it can not
21651 * const.cs: Put here the code that used to go into constant.cs
21653 * constant.cs: Put here the code for constants, this is a new base
21654 class for Literals.
21656 * literal.cs: Make Literal derive from Constant.
21658 2001-12-09 Miguel de Icaza <miguel@ximian.com>
21660 * statement.cs (Return.Emit): Report error 157 if the user
21661 attempts to return from a finally block.
21663 (Return.Emit): Instead of emitting a return, jump to the end of
21666 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21667 LocalBuilder to store the result of the function. ReturnLabel is
21668 the target where we jump.
21671 2001-12-09 Radek Doulik <rodo@ximian.com>
21673 * cs-parser.jay: remember alias in current namespace
21675 * ecore.cs (SimpleName::DoResolve): use aliases for types or
21678 * class.cs (LookupAlias): lookup alias in my_namespace
21680 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21682 (LookupAlias): lookup alias in this and if needed in parent
21685 2001-12-08 Miguel de Icaza <miguel@ximian.com>
21689 * rootcontext.cs: (ModuleBuilder) Made static, first step into
21690 making things static. I need this to avoid passing the
21691 TypeContainer when calling ParameterType.
21693 * support.cs (InternalParameters.ParameterType): Remove ugly hack
21694 that did string manipulation to compute the type and then call
21695 GetType. Use Parameter.ParameterType instead.
21697 * cs-tokenizer.cs: Consume the suffix for floating values.
21699 * expression.cs (ParameterReference): figure out whether this is a
21700 reference parameter or not. Kill an extra variable by computing
21701 the arg_idx during emission.
21703 * parameter.cs (Parameters.GetParameterInfo): New overloaded
21704 function that returns whether a parameter is an out/ref value or not.
21706 (Parameter.ParameterType): The type of the parameter (base,
21707 without ref/out applied).
21709 (Parameter.Resolve): Perform resolution here.
21710 (Parameter.ExternalType): The full type (with ref/out applied).
21712 * statement.cs (Using.Emit, Using.EmitExpression): Implement
21713 support for expressions on the using statement.
21715 2001-12-07 Miguel de Icaza <miguel@ximian.com>
21717 * statement.cs (Using.EmitLocalVariableDecls): Split the
21718 localvariable handling of the using statement.
21720 (Block.EmitMeta): Keep track of variable count across blocks. We
21721 were reusing slots on separate branches of blocks.
21723 (Try.Emit): Emit the general code block, we were not emitting it.
21725 Check the type of the declaration to be an IDisposable or
21726 something that can be implicity converted to it.
21728 Emit conversions if required.
21730 * ecore.cs (EmptyExpression): New utility class.
21731 (Expression.ImplicitConversionExists): New utility function.
21733 2001-12-06 Miguel de Icaza <miguel@ximian.com>
21735 * statement.cs (Using): Implement.
21737 * expression.cs (LocalVariableReference): Support read only variables.
21739 * statement.cs: Remove the explicit emit for the Leave opcode.
21740 (VariableInfo): Add a readonly field.
21742 2001-12-05 Miguel de Icaza <miguel@ximian.com>
21744 * ecore.cs (ConvCast): new class used to encapsulate the various
21745 explicit integer conversions that works in both checked and
21746 unchecked contexts.
21748 (Expression.ConvertNumericExplicit): Use new ConvCast class to
21749 properly generate the overflow opcodes.
21751 2001-12-04 Miguel de Icaza <miguel@ximian.com>
21753 * statement.cs: The correct type for the EmptyExpression is the
21754 element_type, not the variable type. Ravi pointed this out.
21756 2001-12-04 Ravi Pratap <ravi@ximian.com>
21758 * class.cs (Method::Define): Handle PInvoke methods specially
21759 by using DefinePInvokeMethod instead of the usual one.
21761 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21762 above to do the task of extracting information and defining the method.
21764 2001-12-04 Ravi Pratap <ravi@ximian.com>
21766 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21767 of the condition for string type.
21769 (Emit): Move that here.
21771 (ArrayCreation::CheckIndices): Keep string literals in their expression
21774 (EmitDynamicInitializers): Handle strings appropriately.
21776 2001-12-04 Miguel de Icaza <miguel@ximian.com>
21778 * codegen.cs (EmitContext): Replace multiple variables with a
21779 single pointer to the current Switch statement.
21781 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21784 2001-12-03 Miguel de Icaza <miguel@ximian.com>
21788 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21791 (Foreach.Emit): Foreach on arrays was not setting
21792 up the loop variables (for break/continue).
21794 (GotoCase): Semi-implented.
21796 2001-12-03 Ravi Pratap <ravi@ximian.com>
21798 * attribute.cs (CheckAttribute): Handle system attributes by using
21799 Attribute.GetAttributes to examine information we need.
21801 (GetValidPlaces): Same here.
21803 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
21805 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
21807 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
21809 (Method::Define): Set appropriate flags if we have a DllImport attribute.
21811 (Method::Emit): Handle the case when we are a PInvoke method.
21813 2001-12-03 Miguel de Icaza <miguel@ximian.com>
21815 * expression.cs: Use ResolveWithSimpleName on compound names.
21817 2001-12-02 Ravi Pratap <ravi@ximian.com>
21819 * constant.cs (EmitConstant): Make sure we resolve the associated expression
21820 before trying to reduce it.
21822 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
21824 * constant.cs (LookupConstantValue): Implement.
21826 (EmitConstant): Use the above in emitting the constant.
21828 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
21829 that are user-defined by doing a LookupConstantValue on them.
21831 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
21834 2001-11-29 Miguel de Icaza <miguel@ximian.com>
21836 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
21838 (BaseAccess.DoResolve): Implement.
21840 (MemberAccess.DoResolve): Split this routine into a
21841 ResolveMemberAccess routine that can be used independently
21843 2001-11-28 Miguel de Icaza <miguel@ximian.com>
21845 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
21846 As that share bits of the implementation. Is returns a boolean,
21847 while As returns the Type that is being probed.
21849 2001-12-01 Ravi Pratap <ravi@ximian.com>
21851 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
21852 instead of a Literal - much easier.
21854 (EnumInTransit): Remove - utterly useless :-)
21856 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
21858 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
21860 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
21861 chain when we have no associated expression.
21863 2001-11-30 Ravi Pratap <ravi@ximian.com>
21865 * constant.cs (Define): Use Location while reporting the errror.
21867 Also emit a warning when 'new' is used and there is no inherited
21870 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
21873 (LookupEnumValue): Implement to lookup an enum member's value and define it
21876 (Populate): Re-write accordingly to use the above routine.
21878 2001-11-27 Miguel de Icaza <miguel@ximian.com>
21880 * expression.cs (This): Fix prototype for DoResolveLValue to
21881 override the base class DoResolveLValue.
21883 * cs-parser.cs: Report errors cs574 and cs575 (destructor
21886 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
21887 (we need to load the address of the field here). This fixes
21890 (FieldExpr.DoResolveLValue): Call the DoResolve
21891 function to initialize the Instance expression.
21893 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
21894 correctly the GetEnumerator operation on a value type.
21896 * cs-parser.jay: Add more simple parsing error catches.
21898 * statement.cs (Switch): Add support for string switches.
21899 Handle null specially.
21901 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
21903 2001-11-28 Ravi Pratap <ravi@ximian.com>
21905 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
21907 (declare_local_constant): New helper function.
21909 * statement.cs (AddConstant): Keep a separate record of constants
21911 (IsConstant): Implement to determine if a variable is a constant.
21913 (GetConstantExpression): Implement.
21915 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
21917 * statement.cs (IsVariableDefined): Re-write.
21919 2001-11-27 Ravi Pratap <ravi@ximian.com>
21921 * class.cs (TypeContainer::FindMembers): Look for constants
21922 in the case when we are looking for MemberTypes.Field
21924 * expression.cs (MemberAccess::DoResolve): Check that in the
21925 case we are a FieldExpr and a Literal, we are not being accessed
21926 by an instance reference.
21928 * cs-parser.jay (local_constant_declaration): Implement.
21930 (declaration_statement): Implement for constant declarations.
21932 2001-11-26 Miguel de Icaza <miguel@ximian.com>
21934 * statement.cs (Switch): Catch double defaults.
21936 (Switch): More work on the switch() statement
21937 implementation. It works for integral values now, need to finish
21941 2001-11-24 Miguel de Icaza <miguel@ximian.com>
21943 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
21944 integer literals into other integer literals. To be used by
21947 2001-11-24 Ravi Pratap <ravi@ximian.com>
21949 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
21952 (EmitDynamicInitializers): Cope with the above since we extract data
21953 directly from ArrayData now.
21955 (ExpectInitializers): Keep track of whether initializers are mandatory
21958 (Bounds): Make it a hashtable to prevent the same dimension being
21959 recorded for every element in that dimension.
21961 (EmitDynamicInitializers): Fix bug which prevented the Set array method
21964 Also fix bug which was causing the indices to be emitted in the reverse
21967 2001-11-24 Miguel de Icaza <miguel@ximian.com>
21969 * expression.cs (ArrayCreation): Implement the bits that Ravi left
21970 unfinished. They do not work, because the underlying code is
21973 2001-11-22 Miguel de Icaza <miguel@ximian.com>
21975 * cs-parser.jay: Remove bogus fixme.
21977 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
21978 on Switch statement.
21980 2001-11-23 Ravi Pratap <ravi@ximian.com>
21982 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
21985 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
21986 parameter. Apparently, any expression is allowed.
21988 (ValidateInitializers): Update accordingly.
21990 (CheckIndices): Fix some tricky bugs thanks to recursion.
21992 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
21993 I was being completely brain-dead.
21995 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
21996 and re-write acordingly.
21998 (DelegateInvocation): Re-write accordingly.
22000 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
22002 (MakeByteBlob): Handle types more correctly.
22004 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
22005 initialization from expressions but it is incomplete because I am a complete
22008 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22010 * statement.cs (If.Emit): Fix a bug that generated incorrect code
22011 on If. Basically, we have to return `true' (ie, we do return to
22012 our caller) only if both branches of the if return.
22014 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
22015 short-circuit operators, handle them as short circuit operators.
22017 (Cast.DoResolve): Resolve type.
22018 (Cast.Cast): Take an expression as the target type.
22020 * cs-parser.jay (cast_expression): Remove old hack that only
22021 allowed a limited set of types to be handled. Now we take a
22022 unary_expression and we resolve to a type during semantic
22025 Use the grammar productions from Rhys to handle casts (this is
22026 not complete like Rhys syntax yet, we fail to handle that corner
22027 case that C# has regarding (-x), but we will get there.
22029 2001-11-22 Ravi Pratap <ravi@ximian.com>
22031 * class.cs (EmitFieldInitializer): Take care of the case when we have a
22032 field which is an array type.
22034 * cs-parser.jay (declare_local_variables): Support array initialization too.
22036 * typemanager.cs (MakeKey): Implement.
22038 (everywhere): Use the above appropriately.
22040 * cs-parser.jay (for_statement): Update for array initialization while
22041 declaring variables.
22043 * ecore.cs : The error message was correct, it's the variable's names that
22044 were misleading ;-) Make the code more readable.
22046 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
22047 the correct type etc.
22049 (ConvertExplicit): Handle Enum types by examining the underlying type.
22051 2001-11-21 Ravi Pratap <ravi@ximian.com>
22053 * parameter.cs (GetCallingConvention): Always return
22054 CallingConventions.Standard for now.
22056 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22058 * expression.cs (Binary.ResolveOperator): Update the values of `l'
22059 and `r' after calling DoNumericPromotions.
22061 * ecore.cs: Fix error message (the types were in the wrong order).
22063 * statement.cs (Foreach.ProbeCollectionType): Need to pass
22064 BindingFlags.Instance as well
22066 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
22067 implicit int literal conversion in an empty cast so that we
22068 propagate the right type upstream.
22070 (UnboxCast): new class used to unbox value types.
22071 (Expression.ConvertExplicit): Add explicit type conversions done
22074 (Expression.ImplicitNumericConversion): Oops, forgot to test for
22075 the target type before applying the implicit LongLiterals to ULong
22078 2001-11-21 Miguel de Icaza <miguel@ximian.com>
22080 * cs-parser.jay (for_statement): Reworked the way For works: now
22081 we declare manually any variables that are introduced in
22082 for_initializer to solve the problem of having out-of-band code
22083 emition (that is what got for broken).
22085 (declaration_statement): Perform the actual variable declaration
22086 that used to be done in local_variable_declaration here.
22088 (local_variable_declaration): Do not declare anything, just pass
22089 the information on a DictionaryEntry
22091 2001-11-20 Ravi Pratap <ravi@ximian.com>
22093 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
22094 re-write of the logic to now make it recursive.
22096 (UpdateIndices): Re-write accordingly.
22098 Store element data in a separate ArrayData list in the above methods.
22100 (MakeByteBlob): Implement to dump the array data into a byte array.
22102 2001-11-19 Ravi Pratap <ravi@ximian.com>
22104 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
22107 * constant.cs (Define): Implement.
22109 (EmitConstant): Re-write fully.
22111 Pass in location info.
22113 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
22116 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
22117 DictionaryEntry since we need location info too.
22119 (constant_declaration): Update accordingly.
22121 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
22122 code into another method : UpdateIndices.
22124 2001-11-18 Ravi Pratap <ravi@ximian.com>
22126 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
22127 some type checking etc.
22129 2001-11-17 Ravi Pratap <ravi@ximian.com>
22131 * expression.cs (ArrayCreation::ValidateInitializers): Implement
22132 bits to provide dimension info if the user skips doing that.
22134 Update second constructor to store the rank correctly.
22136 2001-11-16 Ravi Pratap <ravi@ximian.com>
22138 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
22139 and try to implement.
22141 * ../errors/cs0150.cs : Add.
22143 * ../errors/cs0178.cs : Add.
22145 2001-11-16 Miguel de Icaza <miguel@ximian.com>
22147 * statement.cs: Implement foreach on multi-dimensional arrays.
22149 * parameter.cs (Parameters.GetParameterByName): Also lookup the
22150 name of the params argument.
22152 * expression.cs: Use EmitStoreOpcode to get the right opcode while
22153 initializing the array.
22155 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
22156 we can use this elsewhere.
22158 * statement.cs: Finish implementation of foreach for single
22161 * cs-parser.jay: Use an out-of-band stack to pass information
22162 around, I wonder why I need this.
22164 foreach_block: Make the new foreach_block the current_block.
22166 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
22167 function used to return a static Parameters structure. Used for
22168 empty parameters, as those are created very frequently.
22170 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
22172 2001-11-15 Ravi Pratap <ravi@ximian.com>
22174 * interface.cs : Default modifier is private, not public. The
22175 make verify test passes again.
22177 2001-11-15 Ravi Pratap <ravi@ximian.com>
22179 * support.cs (ReflectionParameters): Fix logic to determine
22180 whether the last parameter is a params one. Test 9 passes again.
22182 * delegate.cs (Populate): Register the builders we define with
22183 RegisterParameterForBuilder. Test 19 passes again.
22185 * cs-parser.jay (property_declaration): Reference $6 instead
22186 of $$ to get at the location.
22188 (indexer_declaration): Similar stuff.
22190 (attribute): Ditto.
22192 * class.cs (Property): Register parameters for the Get and Set methods
22193 if they exist. Test 23 passes again.
22195 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
22196 call to EmitArguments as we are sure there aren't any params arguments.
22197 Test 32 passes again.
22199 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
22200 IndexOutOfRangeException.
22202 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
22203 Test 33 now passes again.
22205 2001-11-15 Miguel de Icaza <miguel@ximian.com>
22207 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22208 broke a bunch of things. Will have to come up with a better way
22209 of tracking locations.
22211 * statement.cs: Implemented foreach for single dimension arrays.
22213 2001-11-09 Miguel de Icaza <miguel@ximian.com>
22215 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22216 an error. This removes the lookup from the critical path.
22218 * cs-parser.jay: Removed use of temporary_loc, which is completely
22221 2001-11-14 Miguel de Icaza <miguel@ximian.com>
22223 * support.cs (ReflectionParameters.ParameterModifier): Report
22224 whether the argument is a PARAMS argument or not.
22226 * class.cs: Set the attribute `ParamArrayAttribute' on the
22227 parameter argument.
22229 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22230 and cons_param_array_attribute (ConstructorInfo for
22231 ParamArrayAttribute).,
22233 * codegen.cs: Emit the return using the `Return' statement, that
22234 way we can report the error correctly for missing return values.
22236 * class.cs (Method.Emit): Clean up.
22238 * expression.cs (Argument.Resolve): Take another argument: the
22239 location where this argument is used. Notice that this is not
22240 part of the "Argument" class as to reduce the size of the
22241 structure (we know the approximate location anyways).
22243 Test if the argument is a variable-reference, if not, then
22244 complain with a 206.
22246 (Argument.Emit): Emit addresses of variables.
22248 (Argument.FullDesc): Simplify.
22250 (Invocation.DoResolve): Update for Argument.Resolve.
22252 (ElementAccess.DoResolve): ditto.
22254 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22255 method should be virtual, as this method is always virtual.
22257 (NewDelegate.DoResolve): Update for Argument.Resolve.
22259 * class.cs (ConstructorInitializer.DoResolve): ditto.
22261 * attribute.cs (Attribute.Resolve): ditto.
22263 2001-11-13 Miguel de Icaza <miguel@ximian.com>
22265 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22267 * expression.cs (ParameterReference): Drop IStackStorage and implement
22268 IAssignMethod instead.
22270 (LocalVariableReference): ditto.
22272 * ecore.cs (FieldExpr): Drop IStackStorage and implement
22273 IAssignMethod instead.
22275 2001-11-13 Miguel de Icaza <miguel@ximian.com>
22277 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22278 enumerations that are used in heavily used structures derive from
22279 byte in a laughable and pathetic attempt to reduce memory usage.
22280 This is the kind of pre-optimzations that you should not do at
22281 home without adult supervision.
22283 * expression.cs (UnaryMutator): New class, used to handle ++ and
22284 -- separatedly from the other unary operators. Cleans up the
22285 code, and kills the ExpressionStatement dependency in Unary.
22287 (Unary): Removed `method' and `Arguments' from this class, making
22288 it smaller, and moving it all to SimpleCall, so I can reuse this
22289 code in other locations and avoid creating a lot of transient data
22290 strucutres when not required.
22292 * cs-parser.jay: Adjust for new changes.
22294 2001-11-11 Miguel de Icaza <miguel@ximian.com>
22296 * enum.cs (Enum.Populate): If there is a failure during
22299 * cs-parser.jay (opt_enum_base): we used to catch type errors
22300 here, but this is really incorrect. The type error should be
22301 catched during semantic analysis.
22303 2001-12-11 Ravi Pratap <ravi@ximian.com>
22305 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
22306 current_local_parameters as expected since I, in my stupidity, had forgotten
22309 * attribute.cs (GetValidPlaces): Fix stupid bug.
22311 * class.cs (Method::Emit): Perform check on applicability of attributes.
22313 (Constructor::Emit): Ditto.
22315 (Field::Emit): Ditto.
22317 (Field.Location): Store location information.
22319 (Property, Event, Indexer, Operator): Ditto.
22321 * cs-parser.jay (field_declaration): Pass in location for each field.
22323 * ../errors/cs0592.cs : Add.
22325 2001-11-12 Ravi Pratap <ravi@ximian.com>
22327 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22329 (InitCoreTypes): Update accordingly.
22331 (RegisterAttrType, LookupAttr): Implement.
22333 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22334 info about the same.
22336 (Resolve): Update to populate the above as necessary.
22338 (Error592): Helper.
22340 (GetValidPlaces): Helper to the above.
22342 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22344 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22346 2001-11-12 Ravi Pratap <ravi@ximian.com>
22348 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22350 * ../errors/cs0617.cs : Add.
22352 2001-11-11 Ravi Pratap <ravi@ximian.com>
22354 * enum.cs (Emit): Rename to Populate to be more consistent with what
22355 we expect it to do and when exactly it is called.
22357 * class.cs, rootcontext.cs : Update accordingly.
22359 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22360 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22362 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22364 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22365 of a fieldinfo using the above, when dealing with a FieldBuilder.
22367 2001-11-10 Ravi Pratap <ravi@ximian.com>
22369 * ../errors/cs0031.cs : Add.
22371 * ../errors/cs1008.cs : Add.
22373 * ../errrors/cs0543.cs : Add.
22375 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22378 (FindMembers): Implement.
22380 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22381 enums and delegates too.
22383 (enum_types): Rename to builder_to_enum.
22385 (delegate_types): Rename to builder_to_delegate.
22387 * delegate.cs (FindMembers): Implement.
22389 2001-11-09 Ravi Pratap <ravi@ximian.com>
22391 * typemanager.cs (IsEnumType): Implement.
22393 * enum.cs (Emit): Re-write parts to account for the underlying type
22394 better and perform checking etc.
22396 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22397 of the underlying type.
22399 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22402 * enum.cs (error31): Helper to report error #31.
22404 * cs-parser.jay (enum_declaration): Store location of each member too.
22406 * enum.cs (member_to_location): New hashtable.
22408 (AddEnumMember): Update location hashtable.
22410 (Emit): Use the location of each member while reporting errors.
22412 2001-11-09 Miguel de Icaza <miguel@ximian.com>
22414 * cs-parser.jay: A for_initializer if is a
22415 local_variable_declaration really ammount to have an implicit
22416 block with the variable declaration and no initializer for for.
22418 * statement.cs (For.Emit): Cope with null initializers.
22420 This fixes the infinite loop on for initializers.
22422 2001-11-08 Miguel de Icaza <miguel@ximian.com>
22424 * enum.cs: More cleanup.
22426 * ecore.cs: Remove dead code.
22428 * class.cs (Property.Emit): More simplification.
22429 (Event.Emit): ditto.
22431 Reworked to have less levels of indentation.
22433 2001-11-08 Ravi Pratap <ravi@ximian.com>
22435 * class.cs (Property): Emit attributes.
22445 * enum.cs (Emit): Ditto.
22447 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22450 * class.cs (Field, Event, etc.): Move attribute generation into the
22451 Emit method everywhere.
22453 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22454 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22455 as we had no way of defining nested enums !
22457 * rootcontext.cs : Adjust code accordingly.
22459 * typemanager.cs (AddEnumType): To keep track of enum types separately.
22461 2001-11-07 Ravi Pratap <ravi@ximian.com>
22463 * expression.cs (EvalConstantExpression): Move into ecore.cs
22465 * enum.cs (Enum): Rename some members and make them public and readonly
22466 according to our convention.
22468 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
22471 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
22473 (Enum::Emit): Write a simple version for now which doesn't try to compute
22474 expressions. I shall modify this to be more robust in just a while.
22476 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
22478 (TypeContainer::CloseType): Create the Enum types too.
22480 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
22482 * expression.cs (EvalConstantExpression): Get rid of completely.
22484 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
22485 user-defined values and other cases.
22487 (IsValidEnumLiteral): Helper function.
22489 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
22490 out there in the case we had a literal FieldExpr.
22492 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
22494 (Literalize): Revamp a bit to take two arguments.
22496 (EnumLiteral): New class which derives from Literal to wrap enum literals.
22498 2001-11-06 Ravi Pratap <ravi@ximian.com>
22500 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22502 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22504 (Resolve): Use the above to ensure we have proper initializers.
22506 2001-11-05 Ravi Pratap <ravi@ximian.com>
22508 * expression.cs (Expression::EvalConstantExpression): New method to
22509 evaluate constant expressions.
22511 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22513 2001-11-07 Miguel de Icaza <miguel@ximian.com>
22515 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22518 (Binary.ResolveOperator): Handle operator != (object a, object b)
22519 and operator == (object a, object b);
22521 (Binary.DoNumericPromotions): Indicate whether the numeric
22522 promotion was possible.
22524 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22527 Made the ArrayAccess implement interface IAssignMethod instead of
22528 IStackStore as the order in which arguments are passed reflects
22531 * assign.cs: Instead of using expr.ExprClass to select the way of
22532 assinging, probe for the IStackStore/IAssignMethod interfaces.
22534 * typemanager.cs: Load InitializeArray definition.
22536 * rootcontext.cs (RootContext.MakeStaticData): Used to define
22537 static data that can be used to initialize arrays.
22539 2001-11-05 Miguel de Icaza <miguel@ximian.com>
22541 * expression.cs: Handle operator== and operator!= for booleans.
22543 (Conditioal.Reduce): Implement reducer for the ?: operator.
22545 (Conditional.Resolve): Implement dead code elimination.
22547 (Binary.Resolve): Catch string literals and return a new
22548 concatenated string.
22550 (Unary.Reduce): Implement reduction of unary expressions.
22552 * ecore.cs: Split out the expression core handling here.
22554 (Expression.Reduce): New method used to perform constant folding
22555 and CSE. This is needed to support constant-expressions.
22557 * statement.cs (Statement.EmitBoolExpression): Pass true and false
22558 targets, and optimize for !x.
22560 2001-11-04 Ravi Pratap <ravi@ximian.com>
22562 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22563 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22564 set custom atttributes.
22566 * literal.cs (Literal::GetValue): New abstract method to return the actual
22567 value of the literal, cast as an object.
22569 (*Literal): Implement GetValue method.
22571 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22572 expressions to the arraylist but objects of type Argument.
22574 * class.cs (TypeContainer::Emit): Emit our attributes too.
22576 (Method::Emit, Constructor::Emit): Ditto.
22578 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22579 to be ignoring earlier.
22581 2001-11-03 Ravi Pratap <ravi@ximian.com>
22583 * attribute.cs (AttributeSection::Define): Implement to do the business
22584 of constructing a CustomAttributeBuilder.
22586 (Attribute): New trivial class. Increases readability of code.
22588 * cs-parser.jay : Update accordingly.
22590 (positional_argument_list, named_argument_list, named_argument): New rules
22592 (attribute_arguments): Use the above so that we are more correct.
22594 2001-11-02 Ravi Pratap <ravi@ximian.com>
22596 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22597 to perform all checks for a method with a params parameter.
22599 (Invocation::OverloadResolve): Update to use the above method and therefore
22600 cope correctly with params method invocations.
22602 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
22605 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22606 constructors in our parent too because we can't afford to miss out on
22609 * attribute.cs (AttributeSection): New name for the class Attribute
22611 Other trivial changes to improve readability.
22613 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22614 use the new class names.
22616 2001-11-01 Ravi Pratap <ravi@ximian.com>
22618 * class.cs (Method::Define): Complete definition for params types too
22620 (Indexer::Define): Ditto.
22622 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22623 Cope everywhere with a request for info about the array parameter.
22625 2001-11-01 Ravi Pratap <ravi@ximian.com>
22627 * tree.cs (RecordNamespace): Fix up to check for the correct key.
22629 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
22630 local_variable_type to extract the string corresponding to the type.
22632 (local_variable_type): Fixup the action to use the new helper method.
22634 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
22637 * expression.cs : Clean out code which uses the above.
22639 2001-10-31 Ravi Pratap <ravi@ximian.com>
22641 * typemanager.cs (RegisterMethod): Check if we already have an existing key
22642 and bale out if necessary by returning a false.
22644 (RegisterProperty): Ditto.
22646 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22647 and print out appropriate error messages.
22649 * interface.cs (everywhere): Ditto.
22651 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22652 location to constructor.
22654 * class.cs (Property, Event, Indexer): Update accordingly.
22656 * ../errors/cs111.cs : Added.
22658 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22659 of a method, as laid down by the spec.
22661 (Invocation::OverloadResolve): Use the above method.
22663 2001-10-31 Ravi Pratap <ravi@ximian.com>
22665 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22666 now take a TypeContainer and a Parameters object.
22668 (ParameterData): Modify return type of ParameterModifier method to be
22669 Parameter.Modifier and not a string.
22671 (ReflectionParameters, InternalParameters): Update accordingly.
22673 * expression.cs (Argument::GetParameterModifier): Same here.
22675 * support.cs (InternalParameters::ParameterType): Find a better way of determining
22676 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22677 symbol in it at all so maybe this is only for now.
22679 2001-10-30 Ravi Pratap <ravi@ximian.com>
22681 * support.cs (InternalParameters): Constructor now takes an extra argument
22682 which is the actual Parameters class.
22684 (ParameterDesc): Update to provide info on ref/out modifiers.
22686 * class.cs (everywhere): Update call to InternalParameters to pass in
22687 the second argument too.
22689 * support.cs (ParameterData): Add ParameterModifier, which is a method
22690 to return the modifier info [ref/out etc]
22692 (InternalParameters, ReflectionParameters): Implement the above.
22694 * expression.cs (Argument::ParameterModifier): Similar function to return
22695 info about the argument's modifiers.
22697 (Invocation::OverloadResolve): Update to take into account matching modifiers
22700 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22701 a new SetFormalParameters object which we pass to InternalParameters.
22703 2001-10-30 Ravi Pratap <ravi@ximian.com>
22705 * expression.cs (NewArray): Merge into the ArrayCreation class.
22707 2001-10-29 Ravi Pratap <ravi@ximian.com>
22709 * expression.cs (NewArray): Merge classes NewBuiltinArray and
22710 NewUserdefinedArray into one as there wasn't much of a use in having
22713 * expression.cs (Argument): Change field's name to ArgType from Type.
22715 (Type): New readonly property which returns the proper type, taking into
22716 account ref/out modifiers.
22718 (everywhere): Adjust code accordingly for the above.
22720 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22721 whether we are emitting for a ref or out parameter.
22723 * expression.cs (Argument::Emit): Use the above field to set the state.
22725 (LocalVariableReference::Emit): Update to honour the flag and emit the
22728 * parameter.cs (Attributes): Set the correct flags for ref parameters.
22730 * expression.cs (Argument::FullDesc): New function to provide a full desc.
22732 * support.cs (ParameterData): Add method ParameterDesc to the interface.
22734 (ReflectionParameters, InternalParameters): Implement the above method.
22736 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22739 (Invocation::FullMethodDesc): Ditto.
22741 2001-10-29 Miguel de Icaza <miguel@ximian.com>
22743 * cs-parser.jay: Add extra production for the second form of array
22746 * expression.cs (ArrayCreation): Update to reflect the above
22749 * Small changes to prepare for Array initialization.
22751 2001-10-28 Miguel de Icaza <miguel@ximian.com>
22753 * typemanager.cs (ImplementsInterface): interface might be null;
22754 Deal with this problem;
22756 Also, we do store negative hits on the cache (null values), so use
22757 this instead of calling t.GetInterfaces on the type everytime.
22759 2001-10-28 Ravi Pratap <ravi@ximian.com>
22761 * typemanager.cs (IsBuiltinType): New method to help determine the same.
22763 * expression.cs (New::DoResolve): Get rid of array creation code and instead
22764 split functionality out into different classes.
22766 (New::FormArrayType): Move into NewBuiltinArray.
22768 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22771 (NewBuiltinArray): New class to handle creation of built-in arrays.
22773 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22774 account creation of one-dimensional arrays.
22776 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22778 (NewUserdefinedArray::DoResolve): Implement.
22780 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22782 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22783 we maintain inside the TypeManager. This is necessary to perform lookups on the
22786 (LookupType): Update to perform GetType on the module builders too.
22788 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22790 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22792 2001-10-23 Ravi Pratap <ravi@ximian.com>
22794 * expression.cs (New::DoResolve): Implement guts of array creation.
22796 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22798 2001-10-27 Miguel de Icaza <miguel@ximian.com>
22800 * expression.cs: Fix bug I introduced lsat night that broke
22803 (Expression.Resolve): Report a 246 error (can not resolve name)
22804 if we find a SimpleName in the stream.
22806 (Expression.ResolveLValue): Ditto.
22808 (Expression.ResolveWithSimpleName): This function is a variant of
22809 ResolveName, this one allows SimpleNames to be returned without a
22810 warning. The only consumer of SimpleNames is MemberAccess
22812 2001-10-26 Miguel de Icaza <miguel@ximian.com>
22814 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
22815 might arrive here. I have my doubts that this is correct.
22817 * statement.cs (Lock): Implement lock statement.
22819 * cs-parser.jay: Small fixes to support `lock' and `using'
22821 * cs-tokenizer.cs: Remove extra space
22823 * driver.cs: New flag --checked, allows to turn on integer math
22826 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
22827 Threading.Monitor.Exit
22829 2001-10-23 Miguel de Icaza <miguel@ximian.com>
22831 * expression.cs (IndexerAccess::DoResolveLValue): Set the
22832 Expression Class to be IndexerAccess.
22834 Notice that Indexer::DoResolve sets the eclass to Value.
22836 2001-10-22 Miguel de Icaza <miguel@ximian.com>
22838 * class.cs (TypeContainer::Emit): Emit code for indexers.
22840 * assign.cs (IAssignMethod): New interface implemented by Indexers
22841 and Properties for handling assignment.
22843 (Assign::Emit): Simplify and reuse code.
22845 * expression.cs (IndexerAccess, PropertyExpr): Implement
22846 IAssignMethod, clean up old code.
22848 2001-10-22 Ravi Pratap <ravi@ximian.com>
22850 * typemanager.cs (ImplementsInterface): New method to determine if a type
22851 implements a given interface. Provides a nice cache too.
22853 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
22856 (ConvertReferenceExplicit): Ditto.
22858 * delegate.cs (Delegate::Populate): Update to define the parameters on the
22859 various methods, with correct names etc.
22861 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
22862 Operator.UnaryNegation.
22864 * cs-parser.jay (operator_declarator): Be a little clever in the case where
22865 we have a unary plus or minus operator.
22867 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
22870 * everywhere : update accordingly.
22872 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
22875 * class.cs (Method::Define): For the case where we are implementing a method
22876 inherited from an interface, we need to set the MethodAttributes.Final flag too.
22877 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
22879 2001-10-21 Ravi Pratap <ravi@ximian.com>
22881 * interface.cs (FindMembers): Implement to work around S.R.E
22884 * typemanager.cs (IsInterfaceType): Implement.
22886 (FindMembers): Update to handle interface types too.
22888 * expression.cs (ImplicitReferenceConversion): Re-write bits which
22889 use IsAssignableFrom as that is not correct - it doesn't work.
22891 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
22892 and accordingly override EmitStatement.
22894 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
22895 using the correct logic :-)
22897 2001-10-19 Ravi Pratap <ravi@ximian.com>
22899 * ../errors/cs-11.cs : Add to demonstrate error -11
22901 2001-10-17 Miguel de Icaza <miguel@ximian.com>
22903 * assign.cs (Assign::Resolve): Resolve right hand side first, and
22904 then pass this as a hint to ResolveLValue.
22906 * expression.cs (FieldExpr): Add Location information
22908 (FieldExpr::LValueResolve): Report assignment to readonly
22911 (Expression::ExprClassFromMemberInfo): Pass location information.
22913 (Expression::ResolveLValue): Add new method that resolves an
22916 (Expression::DoResolveLValue): Default invocation calls
22919 (Indexers): New class used to keep track of indexers in a given
22922 (IStackStore): Renamed from LValue, as it did not really describe
22923 what this did. Also ResolveLValue is gone from this interface and
22924 now is part of Expression.
22926 (ElementAccess): Depending on the element access type
22928 * typemanager.cs: Add `indexer_name_type' as a Core type
22929 (System.Runtime.CompilerServices.IndexerNameAttribute)
22931 * statement.cs (Goto): Take a location.
22933 2001-10-18 Ravi Pratap <ravi@ximian.com>
22935 * delegate.cs (Delegate::VerifyDelegate): New method to verify
22936 if two delegates are compatible.
22938 (NewDelegate::DoResolve): Update to take care of the case when
22939 we instantiate a delegate from another delegate.
22941 * typemanager.cs (FindMembers): Don't even try to look up members
22942 of Delegate types for now.
22944 2001-10-18 Ravi Pratap <ravi@ximian.com>
22946 * delegate.cs (NewDelegate): New class to take care of delegate
22949 * expression.cs (New): Split the delegate related code out into
22950 the NewDelegate class.
22952 * delegate.cs (DelegateInvocation): New class to handle delegate
22955 * expression.cs (Invocation): Split out delegate related code into
22956 the DelegateInvocation class.
22958 2001-10-17 Ravi Pratap <ravi@ximian.com>
22960 * expression.cs (New::DoResolve): Implement delegate creation fully
22961 and according to the spec.
22963 (New::DoEmit): Update to handle delegates differently.
22965 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
22966 because of which we were printing out arguments in reverse order !
22968 * delegate.cs (VerifyMethod): Implement to check if the given method
22969 matches the delegate.
22971 (FullDelegateDesc): Implement.
22973 (VerifyApplicability): Implement.
22975 * expression.cs (Invocation::DoResolve): Update to accordingly handle
22976 delegate invocations too.
22978 (Invocation::Emit): Ditto.
22980 * ../errors/cs1593.cs : Added.
22982 * ../errors/cs1594.cs : Added.
22984 * delegate.cs (InstanceExpression, TargetMethod): New properties.
22986 2001-10-16 Ravi Pratap <ravi@ximian.com>
22988 * typemanager.cs (intptr_type): Core type for System.IntPtr
22990 (InitCoreTypes): Update for the same.
22992 (iasyncresult_type, asynccallback_type): Ditto.
22994 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
22997 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
23000 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
23001 the builders for the 4 members of a delegate type :-)
23003 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
23006 * expression.cs (New::DoResolve): Implement guts for delegate creation.
23008 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
23010 2001-10-15 Miguel de Icaza <miguel@ximian.com>
23012 * statement.cs (Break::Emit): Implement.
23013 (Continue::Emit): Implement.
23015 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
23016 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
23017 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
23018 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
23021 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
23022 properties that track the label for the current loop (begin of the
23023 loop and end of the loop).
23025 2001-10-15 Ravi Pratap <ravi@ximian.com>
23027 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
23028 use of emitting anything at all.
23030 * class.cs, rootcontext.cs : Get rid of calls to the same.
23032 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
23034 (Populate): Define the constructor correctly and set the implementation
23037 * typemanager.cs (delegate_types): New hashtable to hold delegates that
23040 (AddDelegateType): Implement.
23042 (IsDelegateType): Implement helper method.
23044 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
23046 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
23047 and accordingly handle it.
23049 * delegate.cs (Populate): Take TypeContainer argument.
23050 Implement bits to define the Invoke method. However, I still haven't figured out
23051 how to take care of the native int bit :-(
23053 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
23054 Qualify the name of the delegate, not its return type !
23056 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
23059 (StandardConversionExists): Checking for array types turns out to be recursive.
23061 (ConvertReferenceExplicit): Implement array conversion.
23063 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
23065 2001-10-12 Ravi Pratap <ravi@ximian.com>
23067 * cs-parser.jay (delegate_declaration): Store the fully qualified
23068 name as it is a type declaration.
23070 * delegate.cs (ReturnType, Name): Rename members to these. Make them
23073 (DefineDelegate): Renamed from Define. Does the same thing essentially,
23074 as TypeContainer::DefineType.
23076 (Populate): Method in which all the definition of the various methods (Invoke)
23079 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
23082 (CloseDelegate): Finally creates the delegate.
23084 * class.cs (TypeContainer::DefineType): Update to define delegates.
23085 (Populate, Emit and CloseType): Do the same thing here too.
23087 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
23088 delegates in all these operations.
23090 2001-10-14 Miguel de Icaza <miguel@ximian.com>
23092 * expression.cs: LocalTemporary: a new expression used to
23093 reference a temporary that has been created.
23095 * assign.cs: Handle PropertyAccess back here, so that we can
23096 provide the proper semantic access to properties.
23098 * expression.cs (Expression::ConvertReferenceExplicit): Implement
23099 a few more explicit conversions.
23101 * modifiers.cs: `NEW' modifier maps to HideBySig.
23103 * expression.cs (PropertyExpr): Make this into an
23104 ExpressionStatement, and support the EmitStatement code path.
23106 Perform get/set error checking, clean up the interface.
23108 * assign.cs: recognize PropertyExprs as targets, and if so, turn
23109 them into toplevel access objects.
23111 2001-10-12 Miguel de Icaza <miguel@ximian.com>
23113 * expression.cs: PropertyExpr::PropertyExpr: use work around the
23116 * typemanager.cs: Keep track here of our PropertyBuilders again to
23117 work around lameness in SRE.
23119 2001-10-11 Miguel de Icaza <miguel@ximian.com>
23121 * expression.cs (LValue::LValueResolve): New method in the
23122 interface, used to perform a second resolution pass for LValues.
23124 (This::DoResolve): Catch the use of this in static methods.
23126 (This::LValueResolve): Implement.
23128 (This::Store): Remove warning, assigning to `this' in structures
23131 (Invocation::Emit): Deal with invocation of
23132 methods on value types. We need to pass the address to structure
23133 methods rather than the object itself. (The equivalent code to
23134 emit "this" for structures leaves the entire structure on the
23135 stack instead of a pointer to it).
23137 (ParameterReference::DoResolve): Compute the real index for the
23138 argument based on whether the method takes or not a `this' pointer
23139 (ie, the method is static).
23141 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
23142 value types returned from functions when we need to invoke a
23143 method on the sturcture.
23146 2001-10-11 Ravi Pratap <ravi@ximian.com>
23148 * class.cs (TypeContainer::DefineType): Method to actually do the business of
23149 defining the type in the Modulebuilder or Typebuilder. This is to take
23150 care of nested types which need to be defined on the TypeBuilder using
23151 DefineNestedMethod.
23153 (TypeContainer::GetClassBases): Implement. Essentially the code from the
23154 methods in RootContext, only ported to be part of TypeContainer.
23156 (TypeContainer::GetInterfaceOrClass): Ditto.
23158 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
23160 * interface.cs (Interface::DefineInterface): New method. Does exactly
23161 what RootContext.CreateInterface did earlier, only it takes care of nested types
23164 (Interface::GetInterfaces): Move from RootContext here and port.
23166 (Interface::GetInterfaceByName): Same here.
23168 * rootcontext.cs (ResolveTree): Re-write.
23170 (PopulateTypes): Re-write.
23172 * class.cs (TypeContainer::Populate): Populate nested types too.
23173 (TypeContainer::Emit): Emit nested members too.
23175 * typemanager.cs (AddUserType): Do not make use of the FullName property,
23176 instead just use the name argument passed in as it is already fully
23179 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
23180 to TypeContainer mapping to see if a type is user-defined.
23182 * class.cs (TypeContainer::CloseType): Implement.
23184 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
23185 the default constructor.
23187 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
23190 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
23192 * interface.cs (CloseType): Create the type here.
23194 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
23197 Remove all the methods which are now in TypeContainer.
23199 2001-10-10 Ravi Pratap <ravi@ximian.com>
23201 * delegate.cs (Define): Re-write bits to define the delegate
23204 2001-10-10 Miguel de Icaza <miguel@ximian.com>
23206 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23208 * expression.cs (ImplicitReferenceConversion): handle null as well
23209 as a source to convert to any reference type.
23211 * statement.cs (Return): Perform any implicit conversions to
23212 expected return type.
23214 Validate use of return statement.
23216 * codegen.cs (EmitContext): Pass the expected return type here.
23218 * class.cs (Method, Constructor, Property): Pass expected return
23219 type to EmitContext.
23221 2001-10-09 Miguel de Icaza <miguel@ximian.com>
23223 * expression.cs: Make DoResolve take an EmitContext instead of a
23226 Replaced `l' and `location' for `loc', for consistency.
23228 (Error, Warning): Remove unneeded Tc argument.
23230 * assign.cs, literal.cs, constant.cs: Update to new calling
23233 * codegen.cs: EmitContext now contains a flag indicating whether
23234 code is being generated in a static method or not.
23236 * cs-parser.jay: DecomposeQI, new function that replaces the old
23237 QualifiedIdentifier. Now we always decompose the assembled
23238 strings from qualified_identifier productions into a group of
23241 2001-10-08 Miguel de Icaza <miguel@ximian.com>
23243 * rootcontext.cs: Deal with field-less struct types correctly now
23244 by passing the size option to Define Type.
23246 * class.cs: Removed hack that created one static field.
23248 2001-10-07 Miguel de Icaza <miguel@ximian.com>
23250 * statement.cs: Moved most of the code generation here.
23252 2001-10-09 Ravi Pratap <ravi@ximian.com>
23254 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23257 (ElementAccess): Remove useless bits for now - keep checks as the spec
23260 2001-10-08 Ravi Pratap <ravi@ximian.com>
23262 * expression.cs (ElementAccess::DoResolve): Remove my crap code
23263 and start performing checks according to the spec.
23265 2001-10-07 Ravi Pratap <ravi@ximian.com>
23267 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23268 rank_specifiers instead.
23270 (rank_specifiers): Change the order in which the rank specifiers are stored
23272 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23274 * expression.cs (ElementAccess): Implement the LValue interface too.
23276 2001-10-06 Ravi Pratap <ravi@ximian.com>
23278 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23279 except that user defined conversions are not included.
23281 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
23282 perform the conversion of the return type, if necessary.
23284 (New::DoResolve): Check whether we are creating an array or an object
23285 and accordingly do the needful.
23287 (New::Emit): Same here.
23289 (New::DoResolve): Implement guts of array creation.
23291 (New::FormLookupType): Helper function.
23293 2001-10-07 Miguel de Icaza <miguel@ximian.com>
23295 * codegen.cs: Removed most of the code generation here, and move the
23296 corresponding code generation bits to the statement classes.
23298 Added support for try/catch/finalize and throw.
23300 * cs-parser.jay: Added support for try/catch/finalize.
23302 * class.cs: Catch static methods having the flags override,
23303 virtual or abstract.
23305 * expression.cs (UserCast): This user cast was not really doing
23306 what it was supposed to do. Which is to be born in fully resolved
23307 state. Parts of the resolution were being performed at Emit time!
23311 2001-10-05 Miguel de Icaza <miguel@ximian.com>
23313 * expression.cs: Implicity convert the result from UserCast.
23315 2001-10-05 Ravi Pratap <ravi@ximian.com>
23317 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23318 prevented it from working correctly.
23320 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23321 merely ConvertImplicit.
23323 2001-10-05 Miguel de Icaza <miguel@ximian.com>
23325 * typemanager.cs: Make the LookupTypeContainer function static,
23326 and not per-instance.
23328 * class.cs: Make static FindMembers (the one that takes a Type
23331 * codegen.cs: Add EmitForeach here.
23333 * cs-parser.jay: Make foreach a toplevel object instead of the
23334 inline expansion, as we need to perform semantic analysis on it.
23336 2001-10-05 Ravi Pratap <ravi@ximian.com>
23338 * expression.cs (Expression::ImplicitUserConversion): Rename to
23339 UserDefinedConversion.
23341 (Expression::UserDefinedConversion): Take an extra argument specifying
23342 whether we look for explicit user conversions too.
23344 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23346 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23348 (ExplicitUserConversion): Make it a call to UserDefinedConversion
23349 with the appropriate arguments.
23351 * cs-parser.jay (cast_expression): Record location too.
23353 * expression.cs (Cast): Record location info.
23355 (Expression::ConvertExplicit): Take location argument.
23357 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23358 to determine if we are doing explicit conversions.
23360 (UserCast::Emit): Update accordingly.
23362 (Expression::ConvertExplicit): Report an error if everything fails.
23364 * ../errors/cs0030.cs : Add.
23366 2001-10-04 Miguel de Icaza <miguel@ximian.com>
23368 * modifiers.cs: If the ABSTRACT keyword is present, also set the
23369 virtual and newslot bits.
23371 * class.cs (TypeContainer::RegisterRequiredImplementations):
23372 Record methods we need.
23374 (TypeContainer::MakeKey): Helper function to make keys for
23375 MethodBases, since the Methodbase key is useless.
23377 (TypeContainer::Populate): Call RegisterRequiredImplementations
23378 before defining the methods.
23380 Create a mapping for method_builders_to_methods ahead of time
23381 instead of inside a tight loop.
23383 (::RequireMethods): Accept an object as the data to set into the
23384 hashtable so we can report interface vs abstract method mismatch.
23386 2001-10-03 Miguel de Icaza <miguel@ximian.com>
23388 * report.cs: Make all of it static.
23390 * rootcontext.cs: Drop object_type and value_type computations, as
23391 we have those in the TypeManager anyways.
23393 Drop report instance variable too, now it is a global.
23395 * driver.cs: Use try/catch on command line handling.
23397 Add --probe option to debug the error reporting system with a test
23400 * report.cs: Add support for exiting program when a probe
23401 condition is reached.
23403 2001-10-03 Ravi Pratap <ravi@ximian.com>
23405 * expression.cs (Binary::DoNumericPromotions): Fix the case when
23406 we do a forcible conversion regardless of type, to check if
23407 ForceConversion returns a null.
23409 (Binary::error19): Use location to report error.
23411 (Unary::error23): Use location here too.
23413 * ../errors/cs0019.cs : Check in.
23415 * ../errors/cs0023.cs : Check in.
23417 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23418 case of a non-null MethodInfo object with a length of 0 !
23420 (Binary::ResolveOperator): Flag error if overload resolution fails to find
23421 an applicable member - according to the spec :-)
23422 Also fix logic to find members in base types.
23424 (Unary::ResolveOperator): Same here.
23426 (Unary::report23): Change name to error23 and make first argument a TypeContainer
23427 as I was getting thoroughly confused between this and error19 :-)
23429 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23430 (::FindMostEncompassedType): Implement.
23431 (::FindMostEncompassingType): Implement.
23432 (::StandardConversionExists): Implement.
23434 (UserImplicitCast): Re-vamp. We now need info about most specific
23435 source and target types so that we can do the necessary conversions.
23437 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23438 mathematical union with no duplicates.
23440 2001-10-03 Miguel de Icaza <miguel@ximian.com>
23442 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23443 in order from base classes to child classes, so that we can in
23444 child classes look up in our parent for method names and
23445 attributes (required for handling abstract, virtual, new, override
23446 constructs: we need to instrospect our base class, and if we dont
23447 populate the classes in order, the introspection might be
23448 incorrect. For example, a method could query its parent before
23449 the parent has any methods and would determine that the parent has
23450 no abstract methods (while it could have had them)).
23452 (RootContext::CreateType): Record the order in which we define the
23455 2001-10-02 Miguel de Icaza <miguel@ximian.com>
23457 * class.cs (TypeContainer::Populate): Also method definitions can
23458 fail now, keep track of this.
23460 (TypeContainer::FindMembers): Implement support for
23461 DeclaredOnly/noDeclaredOnly flag.
23463 (Constructor::Emit) Return the ConstructorBuilder.
23465 (Method::Emit) Return the MethodBuilder.
23466 Check for abstract or virtual methods to be public.
23468 * rootcontext.cs (RootContext::CreateType): Register all the
23469 abstract methods required for the class to be complete and the
23470 interface methods that must be implemented.
23472 * cs-parser.jay: Report error 501 (method requires body if it is
23473 not marked abstract or extern).
23475 * expression.cs (TypeOf::Emit): Implement.
23477 * typemanager.cs: runtime_handle_type, new global type.
23479 * class.cs (Property::Emit): Generate code for properties.
23481 2001-10-02 Ravi Pratap <ravi@ximian.com>
23483 * expression.cs (Unary::ResolveOperator): Find operators on base type
23484 too - we now conform exactly to the spec.
23486 (Binary::ResolveOperator): Same here.
23488 * class.cs (Operator::Define): Fix minor quirk in the tests.
23490 * ../errors/cs0215.cs : Added.
23492 * ../errors/cs0556.cs : Added.
23494 * ../errors/cs0555.cs : Added.
23496 2001-10-01 Miguel de Icaza <miguel@ximian.com>
23498 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
23499 single integer which is really efficient
23501 2001-10-01 Ravi Pratap <ravi@ximian.com>
23503 * expression.cs (Expression::ImplicitUserConversion): Use location
23504 even in the case when we are examining True operators.
23506 * class.cs (Operator::Define): Perform extensive checks to conform
23507 with the rules for operator overloading in the spec.
23509 * expression.cs (Expression::ImplicitReferenceConversion): Implement
23510 some of the other conversions mentioned in the spec.
23512 * typemanager.cs (array_type): New static member for the System.Array built-in
23515 (cloneable_interface): For System.ICloneable interface.
23517 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23518 we start resolving the tree and populating types.
23520 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23522 2001-10-01 Miguel de Icaza <miguel@ximian.com>
23524 * expression.cs (Expression::ExprClassFromMemberInfo,
23525 Expression::Literalize): Create literal expressions from
23526 FieldInfos which are literals.
23528 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23529 type casts, because they were wrong. The test suite in tests
23532 (ImplicitNumericConversion): ushort to ulong requires a widening
23535 Int32 constant to long requires widening cast as well.
23537 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23538 for integers because the type on the stack is not i4.
23540 2001-09-30 Miguel de Icaza <miguel@ximian.com>
23542 * expression.cs (report118): require location argument.
23544 * parameter.cs: Do not dereference potential null value.
23546 * class.cs: Catch methods that lack the `new' keyword when
23547 overriding a name. Report warnings when `new' is used without
23548 anything being there to override.
23550 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23552 * class.cs: Only add constructor to hashtable if it is non-null
23553 (as now constructors can fail on define).
23555 (TypeManager, Class, Struct): Take location arguments.
23557 Catch field instance initialization in structs as errors.
23559 accepting_filter: a new filter for FindMembers that is static so
23560 that we dont create an instance per invocation.
23562 (Constructor::Define): Catch errors where a struct constructor is
23565 * cs-parser.jay: Pass location information for various new
23568 * delegate.cs (Delegate): take a location argument.
23570 * driver.cs: Do not call EmitCode if there were problesm in the
23571 Definition of the types, as many Builders wont be there.
23573 * decl.cs (Decl::Decl): Require a location argument.
23575 * cs-tokenizer.cs: Handle properly hex constants that can not fit
23576 into integers, and find the most appropiate integer for it.
23578 * literal.cs: Implement ULongLiteral.
23580 * rootcontext.cs: Provide better information about the location of
23581 failure when CreateType fails.
23583 2001-09-29 Miguel de Icaza <miguel@ximian.com>
23585 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23588 * expression.cs (Binary::CheckShiftArguments): Add missing type
23590 (Binary::ResolveOperator): Add type to the logical and and logical
23591 or, Bitwise And/Or and Exclusive Or code paths, it was missing
23594 (Binary::DoNumericPromotions): In the case where either argument
23595 is ulong (and most signed types combined with ulong cause an
23596 error) perform implicit integer constant conversions as well.
23598 2001-09-28 Miguel de Icaza <miguel@ximian.com>
23600 * expression.cs (UserImplicitCast): Method should always be
23602 (Invocation::BetterConversion): Simplified test for IntLiteral.
23604 (Expression::ImplicitNumericConversion): Split this routine out.
23605 Put the code that performs implicit constant integer conversions
23608 (Expression::Resolve): Become a wrapper around DoResolve so we can
23609 check eclass and type being set after resolve.
23611 (Invocation::Badness): Remove this dead function
23613 (Binary::ResolveOperator): Do not compute the expensive argumnets
23614 unless we have a union for it.
23616 (Probe::Emit): Is needs to do an isinst and then
23617 compare against null.
23619 (::CanConvert): Added Location argument. If the Location argument
23620 is null (Location.Null), then we do not report errors. This is
23621 used by the `probe' mechanism of the Explicit conversion. We do
23622 not want to generate an error for something that the user
23623 explicitly requested to be casted. But the pipeline for an
23624 explicit cast first tests for potential implicit casts.
23626 So for now, if the Location is null, it means `Probe only' to
23627 avoid adding another argument. Might have to revise this
23630 (ClassCast): New class used to type cast objects into arbitrary
23631 classes (used in Explicit Reference Conversions).
23633 Implement `as' as well.
23635 Reverted all the patches from Ravi below: they were broken:
23637 * The use of `level' as a mechanism to stop recursive
23638 invocations is wrong. That was there just to catch the
23639 bug with a strack trace but not as a way of addressing
23642 To fix the problem we have to *understand* what is going
23643 on and the interactions and come up with a plan, not
23644 just get things going.
23646 * The use of the type conversion cache that I proposed
23647 last night had an open topic: How does this work across
23648 protection domains. A user defined conversion might not
23649 be public in the location where we are applying the
23650 conversion, a different conversion might be selected
23651 (ie, private A->B (better) but public B->A (worse),
23652 inside A, A->B applies, but outside it, B->A will
23655 * On top of that (ie, even if the above is solved),
23656 conversions in a cache need to be abstract. Ie, `To
23657 convert from an Int to a Short use an OpcodeCast', not
23658 `To convert from an Int to a Short use the OpcodeCast on
23659 the variable 5' (which is what this patch was doing).
23661 2001-09-28 Ravi Pratap <ravi@ximian.com>
23663 * expression.cs (Invocation::ConversionExists): Re-write to use
23664 the conversion cache
23666 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23667 cache all conversions done, not just user-defined ones.
23669 (Invocation::BetterConversion): The real culprit. Use ConversionExists
23670 to determine if a conversion exists instead of acutually trying to
23671 perform the conversion. It's faster too.
23673 (Expression::ConvertExplicit): Modify to use ConversionExists to check
23674 and only then attempt the implicit conversion.
23676 2001-09-28 Ravi Pratap <ravi@ximian.com>
23678 * expression.cs (ConvertImplicit): Use a cache for conversions
23679 already found. Check level of recursion and bail out if necessary.
23681 2001-09-28 Miguel de Icaza <miguel@ximian.com>
23683 * typemanager.cs (string_concat_string_string, string_concat_object_object):
23684 Export standard methods that we expect for string operations.
23686 * statement.cs (Block::UsageWarning): Track usage of variables and
23687 report the errors for not used variables.
23689 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23692 2001-09-27 Miguel de Icaza <miguel@ximian.com>
23694 * codegen.cs: remove unnneded code
23696 * expression.cs: Removed BuiltinTypeAccess class
23698 Fix the order in which implicit conversions are
23701 The previous fixed dropped support for boxed conversions (adding a
23702 test to the test suite now)
23704 (UserImplicitCast::CanConvert): Remove test for source being null,
23705 that code is broken. We should not feed a null to begin with, if
23706 we do, then we should track the bug where the problem originates
23707 and not try to cover it up here.
23709 Return a resolved expression of type UserImplicitCast on success
23710 rather than true/false. Ravi: this is what I was talking about,
23711 the pattern is to use a static method as a "constructor" for
23714 Also, do not create arguments until the very last minute,
23715 otherwise we always create the arguments even for lookups that
23716 will never be performed.
23718 (UserImplicitCast::Resolve): Eliminate, objects of type
23719 UserImplicitCast are born in a fully resolved state.
23721 * typemanager.cs (InitCoreTypes): Init also value_type
23722 (System.ValueType).
23724 * expression.cs (Cast::Resolve): First resolve the child expression.
23726 (LValue): Add new method AddressOf to be used by
23729 Change the argument of Store to take an EmitContext instead of an
23730 ILGenerator, because things like FieldExpr need to be able to call
23731 their children expression to generate the instance code.
23733 (Expression::Error, Expression::Warning): Sugar functions for
23736 (Expression::MemberLookup): Accept a TypeContainer instead of a
23737 Report as the first argument.
23739 (Expression::ResolvePrimary): Killed. I still want to improve
23740 this as currently the code is just not right.
23742 (Expression::ResolveMemberAccess): Simplify, but it is still
23745 (Unary::Resolve): Catch errors in AddressOf operators.
23747 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23748 index to a byte for the short-version, or the compiler will choose
23749 the wrong Emit call, which generates the wrong data.
23751 (ParameterReference::Emit, ::Store): same.
23753 (FieldExpr::AddressOf): Implement.
23755 * typemanager.cs: TypeManager: made public variable instead of
23758 * driver.cs: document --fatal.
23760 * report.cs (ErrorMessage, WarningMessage): new names for the old
23761 Error and Warning classes.
23763 * cs-parser.jay (member_access): Turn built-in access to types
23764 into a normal simplename
23766 2001-09-27 Ravi Pratap <ravi@ximian.com>
23768 * expression.cs (Invocation::BetterConversion): Fix to cope
23769 with q being null, since this was introducing a bug.
23771 * expression.cs (ConvertImplicit): Do built-in conversions first.
23773 2001-09-27 Ravi Pratap <ravi@ximian.com>
23775 * expression.cs (UserImplicitCast::Resolve): Fix bug.
23777 2001-09-27 Ravi Pratap <ravi@ximian.com>
23779 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23780 I had introduced long ago (what's new ?).
23782 * expression.cs (UserImplicitCast::CanConvert): Static method to do
23783 the work of all the checking.
23784 (ConvertImplicit): Call CanConvert and only then create object if necessary.
23785 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23787 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23788 that is the right way.
23790 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
23791 overloading resolution. Use everywhere instead of cutting and pasting code.
23793 (Binary::ResolveOperator): Use MakeUnionSet.
23795 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
23796 we have to convert to bool types. Not complete yet.
23798 2001-09-27 Miguel de Icaza <miguel@ximian.com>
23800 * typemanager.cs (TypeManager::CSharpName): support ushort.
23802 * expression.cs (Expression::TryImplicitIntConversion): Attempts
23803 to provide an expression that performsn an implicit constant int
23804 conversion (section 6.1.6).
23805 (Expression::ConvertImplicitRequired): Reworked to include
23806 implicit constant expression conversions.
23808 (Expression::ConvertNumericExplicit): Finished.
23810 (Invocation::Emit): If InstanceExpression is null, then it means
23811 that we perform a call on this.
23813 2001-09-26 Miguel de Icaza <miguel@ximian.com>
23815 * expression.cs (Unary::Emit): Remove some dead code.
23816 (Probe): Implement Resolve and Emit for `is'.
23817 (Expression::ConvertImplicitRequired): Attempt to do constant
23818 expression conversions here. Maybe should be moved to
23819 ConvertImplicit, but I am not sure.
23820 (Expression::ImplicitLongConstantConversionPossible,
23821 Expression::ImplicitIntConstantConversionPossible): New functions
23822 that tell whether is it possible to apply an implicit constant
23823 expression conversion.
23825 (ConvertNumericExplicit): Started work on explicit numeric
23828 * cs-parser.jay: Update operator constants.
23830 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
23831 (Parameters::GetSignature): Hook up VerifyArgs here.
23832 (Parameters::VerifyArgs): Verifies that no two arguments have the
23835 * class.cs (Operator): Update the operator names to reflect the
23836 ones that the spec expects (as we are just stringizing the
23839 * expression.cs (Unary::ResolveOperator): Fix bug: Use
23840 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
23841 previous usage did only work for our methods.
23842 (Expression::ConvertImplicit): Handle decimal implicit numeric
23843 conversions as well.
23844 (Expression::InternalTypeConstructor): Used to invoke constructors
23845 on internal types for default promotions.
23847 (Unary::Emit): Implement special handling for the pre/post
23848 increment/decrement for overloaded operators, as they need to have
23849 the same semantics as the other operators.
23851 (Binary::ResolveOperator): ditto.
23852 (Invocation::ConversionExists): ditto.
23853 (UserImplicitCast::Resolve): ditto.
23855 2001-09-26 Ravi Pratap <ravi@ximian.com>
23857 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
23858 operator, return after emitting body. Regression tests pass again !
23860 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
23861 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
23862 (Invocation::OverloadResolve): Ditto.
23863 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
23865 * everywhere : update calls to the above methods accordingly.
23867 2001-09-26 Miguel de Icaza <miguel@ximian.com>
23869 * assign.cs (Assign): Make it inherit from ExpressionStatement.
23871 * expression.cs (ExpressionStatement): New base class used for
23872 expressions that can appear in statements, so that we can provide
23873 an alternate path to generate expression that do not leave a value
23876 (Expression::Emit, and all the derivatives): We no longer return
23877 whether a value is left on the stack or not. Every expression
23878 after being emitted leaves a single value on the stack.
23880 * codegen.cs (EmitContext::EmitStatementExpression): Use the
23881 facilties of ExpressionStatement if possible.
23883 * cs-parser.jay: Update statement_expression.
23885 2001-09-25 Miguel de Icaza <miguel@ximian.com>
23887 * driver.cs: Change the wording of message
23889 2001-09-25 Ravi Pratap <ravi@ximian.com>
23891 * expression.cs (Binary::ResolveOperator): Had forgottten to set
23892 the type of the expression to the return type of the method if
23893 we have an overloaded operator match ! The regression tests pass again !
23894 (Unary::ResolveOperator): Ditto.
23896 * expression.cs (Invocation::ConversionExists): Correct the member lookup
23897 to find "op_Implicit", not "implicit" ;-)
23898 (UserImplicitCast): New class to take care of user-defined implicit conversions.
23899 (ConvertImplicit, ForceConversion): Take TypeContainer argument
23901 * everywhere : Correct calls to the above accordingly.
23903 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
23904 (ConvertImplicit): Do user-defined conversion if it exists.
23906 2001-09-24 Miguel de Icaza <miguel@ximian.com>
23908 * assign.cs: track location.
23909 (Resolve): Use implicit conversions on assignment.
23911 * literal.cs: Oops. Not good, Emit of short access values should
23912 pass (Bytes) or the wrong argument will be selected.
23914 * expression.cs (Unary::Emit): Emit code for -expr.
23916 (Unary::ResolveOperator): Handle `Substract' for non-constants
23917 (substract from zero from the non-constants).
23918 Deal with Doubles as well.
23920 (Expression::ConvertImplicitRequired): New routine that reports an
23921 error if no implicit conversion exists.
23923 (Invocation::OverloadResolve): Store the converted implicit
23924 expressions if we make them
23926 2001-09-24 Ravi Pratap <ravi@ximian.com>
23928 * class.cs (ConstructorInitializer): Take a Location argument.
23929 (ConstructorBaseInitializer): Same here.
23930 (ConstructorThisInitializer): Same here.
23932 * cs-parser.jay : Update all calls accordingly.
23934 * expression.cs (Unary, Binary, New): Take location argument.
23935 Update accordingly everywhere.
23937 * cs-parser.jay : Update all calls to the above to take a location
23940 * class.cs : Ditto.
23942 2001-09-24 Ravi Pratap <ravi@ximian.com>
23944 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
23945 (Invocation::BetterConversion): Same here
23946 (Invocation::ConversionExists): Ditto.
23948 (Invocation::ConversionExists): Implement.
23950 2001-09-22 Ravi Pratap <ravi@ximian.com>
23952 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
23953 Also take an additional TypeContainer argument.
23955 * All over : Pass in TypeContainer as argument to OverloadResolve.
23957 * typemanager.cs (CSharpName): Update to check for the string type and return
23960 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
23963 2001-09-21 Ravi Pratap <ravi@ximian.com>
23965 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
23966 (Invocation::BetterFunction): Implement.
23967 (Invocation::BetterConversion): Implement.
23968 (Invocation::ConversionExists): Skeleton, no implementation yet.
23970 Okay, things work fine !
23972 2001-09-21 Miguel de Icaza <miguel@ximian.com>
23974 * typemanager.cs: declare and load enum_type, delegate_type and
23977 * expression.cs (Expression::Emit): Now emit returns a value that
23978 tells whether a value is left on the stack or not. This strategy
23979 might be reveted tomorrow with a mechanism that would address
23980 multiple assignments.
23981 (Expression::report118): Utility routine to report mismatches on
23984 (Unary::Report23): Report impossible type/operator combination
23987 (Unary::IsIncrementableNumber): Whether the type can be
23988 incremented or decremented with add.
23989 (Unary::ResolveOperator): Also allow enumerations to be bitwise
23991 (Unary::ResolveOperator): Implement ++, !, ~,
23993 (Invocation::Emit): Deal with new Emit convetion.
23995 * All Expression derivatives: Updated their Emit method to return
23996 whether they leave values on the stack or not.
23998 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
23999 stack for expressions that are statements.
24001 2001-09-20 Miguel de Icaza <miguel@ximian.com>
24003 * expression.cs (LValue): New interface. Must be implemented by
24005 (LocalVariableReference, ParameterReference, FieldExpr): Implement
24008 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
24009 interface for generating code, simplifies the code.
24011 2001-09-20 Ravi Pratap <ravi@ximian.com>
24013 * expression.cs (everywhere): Comment out return statements in ::Resolve
24014 methods to avoid the warnings.
24016 2001-09-20 Miguel de Icaza <miguel@ximian.com>
24018 * driver.cs (parse): Report error 2001 if we can not open the
24021 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
24024 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
24027 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
24028 otherwise nested blocks end up with the same index.
24030 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
24032 * expression.cs: Instead of having FIXMEs in the Resolve
24033 functions, throw exceptions so it is obvious that we are facing a
24036 * cs-parser.jay (invocation_expression): Pass Location information.
24038 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
24039 Use a basename for those routines because .NET does not like paths
24042 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
24045 2001-09-19 Miguel de Icaza <miguel@ximian.com>
24047 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
24048 are loading the correct data types (throws an exception if not).
24049 (TypeManager::InitCoreTypes): Use CoreLookupType
24051 * expression.cs (Unary::ResolveOperator): return the child
24052 expression for expressions which are just +expr.
24053 (Unary::ResolveOperator): Return negative literals for -LITERAL
24054 expressions (otherwise they are Unary {Literal}).
24055 (Invocation::Badness): Take into account `Implicit constant
24056 expression conversions'.
24058 * literal.cs (LongLiteral): Implement long literal class.
24059 (IntLiteral): export the `Value' of the intliteral.
24061 2001-09-19 Ravi Pratap <ravi@ximian.com>
24063 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
24065 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
24066 instead of 'Operator'
24068 * expression.cs (Binary::ResolveOperator): Update accordingly.
24069 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
24072 * cs-parser.jay (unary_expression): Update to use the new names.
24074 * gen-treedump.cs (GetUnary): Same here.
24076 * expression.cs (Unary::Resolve): Implement.
24077 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
24078 operators are found instead of making noise ;-)
24079 (Unary::ResolveOperator): New method to do precisely the same thing which
24080 Binary::ResolveOperator does for Binary expressions.
24081 (Unary.method, .Arguments): Add.
24082 (Unary::OperName): Implement.
24083 (Unary::ForceConversion): Copy and Paste !
24085 * class.cs (Operator::Define): Fix a small bug for the case when we have
24088 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
24089 for the inbuilt operators. Only overloading works for now ;-)
24091 2001-09-18 Miguel de Icaza <miguel@ximian.com>
24093 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
24094 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
24096 * expression.cs (This::Emit): Implement.
24097 (This::Resolve): Implement.
24098 (TypeOf:Resolve): Implement.
24099 (Expression::ResolveSimpleName): Add an implicit this to instance
24101 (MemberAccess::Resolve): Deal with Parameters and Fields.
24102 Bind instance variable to Field expressions.
24103 (FieldExpr::Instance): New field used to track the expression that
24104 represents the object instance.
24105 (FieldExpr::Resolve): Track potential errors from MemberLookup not
24107 (FieldExpr::Emit): Implement.
24109 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
24110 the last instruction contains a return opcode to avoid generating
24111 the last `ret' instruction (this generates correct code, and it is
24112 nice to pass the peverify output).
24114 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
24115 initializer for static and instance variables.
24116 (Constructor::Emit): Allow initializer to be null in the case of
24117 static constructors. Only emit initializer for instance
24120 (TypeContainer::FindMembers): Return a null array if there are no
24123 Also fix the code for the MemberTypes.Method branch, as it was not
24124 scanning that for operators (or tried to access null variables before).
24126 * assign.cs (Assign::Emit): Handle instance and static fields.
24130 * driver.cs: Stop compilation if there are parse errors.
24132 * cs-parser.jay (constructor_declaration): Provide default base
24133 initializer for non-static constructors.
24134 (constructor_declarator): Do not provide a default base
24135 initializers if none was specified.
24136 Catch the fact that constructors should not have parameters.
24138 * class.cs: Do not emit parent class initializers for static
24139 constructors, that should be flagged as an error.
24141 2001-09-18 Ravi Pratap <ravi@ximian.com>
24143 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
24144 Move back code into TypeContainer::Populate.
24146 2001-09-18 Ravi Pratap <ravi@ximian.com>
24148 * class.cs (TypeContainer::AddConstructor): Fix the check to
24149 compare against Name, not Basename.
24150 (Operator::OpType): Change Plus and Minus to Add and Subtract.
24152 * cs-parser.jay : Update accordingly.
24154 * class.cs (TypeContainer::FindMembers): For the case where we are searching
24155 for methods, don't forget to look into the operators too.
24156 (RegisterMethodBuilder): Helper method to take care of this for
24157 methods, constructors and operators.
24158 (Operator::Define): Completely revamp.
24159 (Operator.OperatorMethod, MethodName): New fields.
24160 (TypeContainer::Populate): Move the registering of builders into
24161 RegisterMethodBuilder.
24162 (Operator::Emit): Re-write.
24164 * expression.cs (Binary::Emit): Comment out code path to emit method
24165 invocation stuff for the case when we have a user defined operator. I am
24166 just not able to get it right !
24168 2001-09-17 Miguel de Icaza <miguel@ximian.com>
24170 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
24173 (Expression::MemberLookup): Provide a version that allows to
24174 specify the MemberTypes and BindingFlags.
24176 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
24177 so it was not fetching variable information from outer blocks.
24179 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
24180 Beforefieldinit as it was buggy.
24182 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
24183 that Ravi put here.
24185 * class.cs (Constructor::Emit): Only emit if block is not null.
24186 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
24187 deal with this by semantically definining it as if the user had
24190 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
24191 constructors as we now "emit" them at a higher level.
24193 (TypeContainer::DefineDefaultConstructor): Used to define the
24194 default constructors if none was provided.
24196 (ConstructorInitializer): Add methods Resolve and Emit.
24198 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
24200 2001-09-17 Ravi Pratap <ravi@ximian.com>
24202 * class.cs (TypeContainer::EmitDefaultConstructor): Register
24203 the default constructor builder with our hashtable for methodbuilders
24206 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24207 and argument_count is 0 in which case we have a match.
24208 (Binary::ResolveOperator): More null checking and miscellaneous coding
24211 2001-09-17 Ravi Pratap <ravi@ximian.com>
24213 * rootcontext.cs (IsNameSpace): Compare against null.
24215 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24217 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24218 and Unary::Operator.
24220 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24223 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24224 we have overloaded operators.
24225 (Binary::ResolveOperator): Implement the part which does the operator overload
24228 * class.cs (Operator::Emit): Implement.
24229 (TypeContainer::Emit): Emit the operators we have too.
24231 * expression.cs (Binary::Emit): Update to emit the appropriate code for
24232 the case when we have a user-defined operator.
24234 2001-09-17 Miguel de Icaza <miguel@ximian.com>
24236 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24238 2001-09-16 Ravi Pratap <ravi@ximian.com>
24240 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24241 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24242 (Constructor::Emit): Implement.
24243 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24244 if we have no work to do.
24245 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
24248 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24249 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24251 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24254 2001-09-15 Ravi Pratap <ravi@ximian.com>
24256 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24258 (Tree::RecordNamespace): Method to do what the name says ;-)
24259 (Tree::Namespaces): Property to get at the namespaces hashtable.
24261 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
24264 * rootcontext.cs (IsNamespace): Fixed it :-)
24266 2001-09-14 Miguel de Icaza <miguel@ximian.com>
24268 * class.cs (TypeContainer::FindMembers): Add support for
24270 (MethodCore): New class that encapsulates both the shared aspects
24271 of a Constructor and a Method.
24272 (Method, Constructor): Factored pieces into MethodCore.
24274 * driver.cs: Added --fatal which makes errors throw exceptions.
24275 Load System assembly as well as part of the standard library.
24277 * report.cs: Allow throwing exceptions on errors for debugging.
24279 * modifiers.cs: Do not use `parent', instead use the real type
24280 container to evaluate permission settings.
24282 * class.cs: Put Ravi's patch back in. He is right, and we will
24283 have to cope with the
24285 2001-09-14 Ravi Pratap <ravi@ximian.com>
24287 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
24288 FamORAssem, not FamANDAssem.
24290 2001-09-14 Miguel de Icaza <miguel@ximian.com>
24292 * driver.cs: Added --parse option that only parses its input files
24295 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
24296 incorrect. IsTopLevel is not used to tell whether an object is
24297 root_types or not (that can be achieved by testing this ==
24298 root_types). But to see if this is a top-level *class* (not
24299 necessarly our "toplevel" container).
24301 2001-09-14 Ravi Pratap <ravi@ximian.com>
24303 * enum.cs (Enum::Define): Modify to call the Lookup method on the
24304 parent instead of a direct call to GetType.
24306 2001-09-14 Ravi Pratap <ravi@ximian.com>
24308 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
24309 Modifiers.TypeAttr. This should just be a call to that method.
24311 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
24312 object so that we can determine if we are top-level or not.
24314 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
24317 * enum.cs (Enum::Define): Ditto.
24319 * modifiers.cs (FieldAttr): Re-write.
24321 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24322 (TypeContainer::HaveStaticConstructor): New property to provide access
24323 to precisely that info.
24325 * modifiers.cs (MethodAttr): Re-write.
24326 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24328 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24329 of top-level types as claimed.
24331 2001-09-13 Miguel de Icaza <miguel@ximian.com>
24333 * expression.cs (MemberLookup): Fruitless attempt to lookup
24334 constructors. Maybe I need to emit default constructors? That
24335 might be it (currently .NET emits this for me automatically).
24336 (Invocation::OverloadResolve): Cope with Arguments == null.
24337 (Invocation::EmitArguments): new function, shared by the new
24338 constructor and us.
24339 (Invocation::Emit): Handle static and instance methods. Emit
24340 proper call instruction for virtual or non-virtual invocations.
24341 (New::Emit): Implement.
24342 (New::Resolve): Implement.
24343 (MemberAccess:Resolve): Implement.
24344 (MethodGroupExpr::InstanceExpression): used conforming to the spec
24345 to track instances.
24346 (FieldExpr::Resolve): Set type.
24348 * support.cs: Handle empty arguments.
24350 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24351 SimpleLookup): Auxiliary routines to help parse a qualifier
24354 Update qualifier_identifier rule.
24356 * codegen.cs: Removed debugging messages.
24358 * class.cs: Make this a global thing, this acts just as a "key" to
24359 objects that we might have around.
24361 (Populate): Only initialize method_builders_to_methods once.
24363 * expression.cs (PropertyExpr): Initialize type from the
24366 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24367 Resolve pattern. Attempt to implicitly convert value to boolean.
24370 * expression.cs: Set the type for the int32/int32 argument case.
24371 (Binary::ResolveOperator): Set the return type to boolean for
24372 comparission operators
24374 * typemanager.cs: Remove debugging print code.
24376 (Invocation::Resolve): resolve type.
24378 * class.cs: Allocate a MemberInfo of the correct size, as the code
24379 elsewhere depends on the test to reflect the correct contents.
24381 (Method::) Keep track of parameters, due to System.Reflection holes
24383 (TypeContainer::Populate): Keep track of MethodBuilders to Method
24386 (TypeContainer::FindMembers): Use ArrayList and then copy an array
24387 of the exact size and return that.
24389 (Class::LookupMethodByBuilder): New function that maps
24390 MethodBuilders to its methods. Required to locate the information
24391 on methods because System.Reflection bit us again.
24393 * support.cs: New file, contains an interface ParameterData and
24394 two implementations: ReflectionParameters and InternalParameters
24395 used to access Parameter information. We will need to grow this
24398 * expression.cs (Invocation::GetParameterData): implement a cache
24399 and a wrapper around the ParameterData creation for methods.
24400 (Invocation::OverloadResolve): Use new code.
24402 2001-09-13 Ravi Pratap <ravi@ximian.com>
24404 * class.cs (TypeContainer::EmitField): Remove and move into
24405 (Field::Define): here and modify accordingly.
24406 (Field.FieldBuilder): New member.
24407 (TypeContainer::Populate): Update accordingly.
24408 (TypeContainer::FindMembers): Implement.
24410 2001-09-13 Miguel de Icaza <miguel@ximian.com>
24412 * statement.cs: (VariableInfo::VariableType): New field to be
24413 initialized with the full type once it is resolved.
24415 2001-09-12 Miguel de Icaza <miguel@ximian.com>
24417 * parameter.cs (GetParameterInfo): Use a type cache to compute
24418 things only once, and to reuse this information
24420 * expression.cs (LocalVariableReference::Emit): Implement.
24421 (OpcodeCast::Emit): fix.
24423 (ParameterReference::Resolve): Implement.
24424 (ParameterReference::Emit): Implement.
24426 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24427 that are expressions need to stay as Expressions.
24429 * typemanager.cs (CSharpName): Returns the C# name of a type if
24432 * expression.cs (Expression::ConvertImplicit): New function that
24433 implements implicit type conversions.
24435 (Expression::ImplicitReferenceConversion): Implements implicit
24436 reference conversions.
24438 (EmptyCast): New type for transparent casts.
24440 (OpcodeCast): New type for casts of types that are performed with
24441 a sequence of bytecodes.
24443 (BoxedCast): New type used for casting value types into reference
24444 types. Emits a box opcode.
24446 (Binary::DoNumericPromotions): Implements numeric promotions of
24447 and computation of the Binary::Type.
24449 (Binary::EmitBranchable): Optimization.
24451 (Binary::Emit): Implement code emission for expressions.
24453 * typemanager.cs (TypeManager): Added two new core types: sbyte
24456 2001-09-12 Ravi Pratap <ravi@ximian.com>
24458 * class.cs (TypeContainer::FindMembers): Method which does exactly
24459 what Type.FindMembers does, only we don't have to use reflection. No
24460 implementation yet.
24462 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24463 typecontainer objects as we need to get at them.
24464 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24466 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24467 typecontainer object.
24469 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
24470 of just a Report object.
24472 2001-09-11 Ravi Pratap <ravi@ximian.com>
24474 * class.cs (Event::Define): Go back to using the prefixes "add_" and
24476 (TypeContainer::Populate): Now define the delegates of the type too.
24477 (TypeContainer.Delegates): Property to access the list of delegates defined
24480 * delegates.cs (Delegate::Define): Implement partially.
24482 * modifiers.cs (TypeAttr): Handle more flags.
24484 2001-09-11 Ravi Pratap <ravi@ximian.com>
24486 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
24488 (Operator::Define): Re-write logic to get types by using the LookupType method
24489 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
24490 (Indexer::Define): Ditto.
24491 (Event::Define): Ditto.
24492 (Property::Define): Ditto.
24494 2001-09-10 Ravi Pratap <ravi@ximian.com>
24496 * class.cs (TypeContainer::Populate): Now define operators too.
24497 (TypeContainer.Operators): New property to access the list of operators
24499 (Operator.OperatorMethodBuilder): New member to hold the method builder
24500 for the operator we are defining.
24501 (Operator::Define): Implement.
24503 2001-09-10 Ravi Pratap <ravi@ximian.com>
24505 * class.cs (Event::Define): Make the prefixes of the accessor methods
24506 addOn_ and removeOn_
24508 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24509 of the location being passed in too. Ideally, this should go later since all
24510 error reporting should be done through the Report object.
24512 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24513 (Populate): Iterate thru the indexers we have and define them too.
24514 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24515 for the get and set accessors.
24516 (Indexer::Define): Implement.
24518 2001-09-09 Miguel de Icaza <miguel@ximian.com>
24520 * expression.cs (Binary::Resolve): Beginning of it. I scratched
24521 my previous implementation, did not work.
24523 * typemanager.cs: Add a couple of missing types (the longs).
24525 * literal.cs: Use TypeManager.bool_type instead of getting it.
24527 * expression.cs (EventExpr): New kind of expressions.
24528 (Expressio::ExprClassFromMemberInfo): finish
24530 2001-09-08 Miguel de Icaza <miguel@ximian.com>
24532 * assign.cs: Emit stores to static fields differently.
24534 2001-09-08 Ravi Pratap <ravi@ximian.com>
24536 * Merge in changes and adjust code to tackle conflicts. Backed out my
24537 code in Assign::Resolve ;-)
24539 2001-09-08 Ravi Pratap <ravi@ximian.com>
24541 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24542 instead Report.Error and also pass in the location.
24543 (CSharpParser::Lexer): New readonly property to return the reference
24544 to the Tokenizer object.
24545 (declare_local_variables): Use Report.Error with location instead of plain
24549 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24550 (Operator.CheckBinaryOperator): Ditto.
24552 * cs-parser.jay (operator_declarator): Update accordingly.
24554 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24555 (CheckBinaryOperator): Same here.
24557 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24558 on the name without any prefixes of namespace names etc. This is because we
24559 already might have something already fully qualified like
24560 'System.Console.WriteLine'
24562 * assign.cs (Resolve): Begin implementation. Stuck ;-)
24564 2001-09-07 Ravi Pratap <ravi@ximian.com>
24566 * cs-tokenizer.cs (location): Return a string which also contains
24569 * expression.cs (ElementAccess): New class for expressions of the
24570 type 'element access.'
24571 (BaseAccess): New class for expressions of the type 'base access.'
24572 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24575 * cs-parser.jay (element_access): Implement action.
24576 (base_access): Implement actions.
24577 (checked_expression, unchecked_expression): Implement.
24579 * cs-parser.jay (local_variable_type): Correct and implement.
24580 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24582 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24584 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24585 name and the specifiers.
24587 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24589 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
24590 making them all public ;-)
24592 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24595 2001-09-07 Miguel de Icaza <miguel@ximian.com>
24597 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24599 (FieldExpr, PropertyExprs): New resolved expressions.
24600 (SimpleName::MemberStaticCheck): Perform static checks for access
24601 to non-static fields on static methods. Maybe this should be
24602 generalized for MemberAccesses.
24603 (SimpleName::ResolveSimpleName): More work on simple name
24606 * cs-parser.jay (primary_expression/qualified_identifier): track
24607 the parameter index.
24609 * codegen.cs (CodeGen::Save): Catch save exception, report error.
24610 (EmitContext::EmitBoolExpression): Chain to expression generation
24611 instead of temporary hack.
24612 (::EmitStatementExpression): Put generic expression code generation.
24614 * assign.cs (Assign::Emit): Implement variable assignments to
24615 local variables, parameters and fields.
24617 2001-09-06 Miguel de Icaza <miguel@ximian.com>
24619 * statement.cs (Block::GetVariableInfo): New method, returns the
24620 VariableInfo for a variable name in a block.
24621 (Block::GetVariableType): Implement in terms of GetVariableInfo
24623 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24624 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24626 2001-09-06 Ravi Pratap <ravi@ximian.com>
24628 * cs-parser.jay (operator_declaration): Continue on my quest : update
24629 to take attributes argument.
24630 (event_declaration): Ditto.
24631 (enum_declaration): Ditto.
24632 (indexer_declaration): Ditto.
24634 * class.cs (Operator::Operator): Update constructor accordingly.
24635 (Event::Event): Ditto.
24637 * delegate.cs (Delegate::Delegate): Same here.
24639 * enum.cs (Enum::Enum): Same here.
24641 2001-09-05 Ravi Pratap <ravi@ximian.com>
24643 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24645 * ../tests/cs0658.cs : New file to demonstrate error 0658.
24647 * attribute.cs (Attributes): New class to encapsulate all attributes which were
24648 being passed around as an arraylist.
24649 (Attributes::AddAttribute): Method to add attribute sections.
24651 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24652 (struct_declaration): Update accordingly.
24653 (constant_declaration): Update.
24654 (field_declaration): Update.
24655 (method_header): Update.
24656 (fixed_parameter): Update.
24657 (parameter_array): Ditto.
24658 (property_declaration): Ditto.
24659 (destructor_declaration): Ditto.
24661 * class.cs (Struct::Struct): Update constructors accordingly.
24662 (Class::Class): Ditto.
24663 (Field::Field): Ditto.
24664 (Method::Method): Ditto.
24665 (Property::Property): Ditto.
24666 (TypeContainer::OptAttribute): update property's return type.
24668 * interface.cs (Interface.opt_attributes): New member.
24669 (Interface::Interface): Update to take the extra Attributes argument.
24671 * parameter.cs (Parameter::Parameter): Ditto.
24673 * constant.cs (Constant::Constant): Ditto.
24675 * interface.cs (InterfaceMemberBase): New OptAttributes field.
24676 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
24677 the attributes as a parameter.
24678 (InterfaceProperty): Update constructor call.
24679 (InterfaceEvent): Ditto.
24680 (InterfaceMethod): Ditto.
24681 (InterfaceIndexer): Ditto.
24683 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
24684 pass the attributes too.
24685 (interface_event_declaration): Ditto.
24686 (interface_property_declaration): Ditto.
24687 (interface_method_declaration): Ditto.
24688 (interface_declaration): Ditto.
24690 2001-09-05 Miguel de Icaza <miguel@ximian.com>
24692 * class.cs (Method::Define): Track the "static Main" definition to
24693 create an entry point.
24695 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24696 EntryPoint if we find it.
24698 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24699 (EmitContext::ig): Make this variable public.
24701 * driver.cs: Make the default output file be the first file name
24702 with the .exe extension.
24704 Detect empty compilations
24706 Handle various kinds of output targets. Handle --target and
24707 rename -t to --dumper.
24709 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24710 methods inherited from Expression return now an Expression. This
24711 will is used during the tree rewriting as we resolve them during
24714 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24715 the spec. Missing entirely is the information about
24716 accessability of elements of it.
24718 (Expression::ExprClassFromMemberInfo): New constructor for
24719 Expressions that creates a fully initialized Expression based on
24720 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24723 (Invocation::Resolve): Begin implementing resolution of invocations.
24725 * literal.cs (StringLiteral): Implement Emit.
24727 2001-09-05 Ravi Pratap <ravi@ximian.com>
24729 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24732 2001-09-04 Ravi Pratap <ravi@ximian.com>
24734 * cs-parser.jay (attribute_arguments): Implement actions.
24735 (attribute): Fix bug in production. Implement action.
24736 (attribute_list): Implement.
24737 (attribute_target): Implement.
24738 (attribute_target_specifier, opt_target_specifier): Implement
24739 (CheckAttributeTarget): New method to check if the attribute target
24741 (attribute_section): Implement.
24742 (opt_attributes): Implement.
24744 * attribute.cs : New file to handle attributes.
24745 (Attribute): Class to hold attribute info.
24747 * cs-parser.jay (opt_attribute_target_specifier): Remove production
24748 (attribute_section): Modify production to use 2 different rules to
24749 achieve the same thing. 1 s/r conflict down !
24750 Clean out commented, useless, non-reducing dimension_separator rules.
24752 * class.cs (TypeContainer.attributes): New member to hold list
24753 of attributes for a type.
24754 (Struct::Struct): Modify to take one more argument, the attribute list.
24755 (Class::Class): Ditto.
24756 (Field::Field): Ditto.
24757 (Method::Method): Ditto.
24758 (Property::Property): Ditto.
24760 * cs-parser.jay (struct_declaration): Update constructor call to
24761 pass in the attributes too.
24762 (class_declaration): Ditto.
24763 (constant_declaration): Ditto.
24764 (field_declaration): Ditto.
24765 (method_header): Ditto.
24766 (fixed_parameter): Ditto.
24767 (parameter_array): Ditto.
24768 (property_declaration): Ditto.
24770 * constant.cs (Constant::Constant): Update constructor similarly.
24771 Use System.Collections.
24773 * parameter.cs (Parameter::Parameter): Update as above.
24775 2001-09-02 Ravi Pratap <ravi@ximian.com>
24777 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24778 (TypeContainer.delegates): New member to hold list of delegates.
24780 * cs-parser.jay (delegate_declaration): Implement the action correctly
24781 this time as I seem to be on crack ;-)
24783 2001-09-02 Miguel de Icaza <miguel@ximian.com>
24785 * rootcontext.cs (RootContext::IsNamespace): new function, used to
24786 tell whether an identifier represents a namespace.
24788 * expression.cs (NamespaceExpr): A namespace expression, used only
24789 temporarly during expression resolution.
24790 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24791 utility functions to resolve names on expressions.
24793 2001-09-01 Miguel de Icaza <miguel@ximian.com>
24795 * codegen.cs: Add hook for StatementExpressions.
24797 * class.cs: Fix inverted test for static flag in methods.
24799 2001-09-02 Ravi Pratap <ravi@ximian.com>
24801 * class.cs (Operator::CheckUnaryOperator): Correct error number used
24802 to make it coincide with MS' number.
24803 (Operator::CheckBinaryOperator): Ditto.
24805 * ../errors/errors.txt : Remove error numbers added earlier.
24807 * ../errors/cs1019.cs : Test case for error # 1019
24809 * ../errros/cs1020.cs : Test case for error # 1020
24811 * cs-parser.jay : Clean out commented cruft.
24812 (dimension_separators, dimension_separator): Comment out. Ostensibly not
24813 used anywhere - non-reducing rule.
24814 (namespace_declarations): Non-reducing rule - comment out.
24816 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
24817 with TypeContainer::AddEnum.
24819 * delegate.cs : New file for delegate handling classes.
24820 (Delegate): Class for declaring delegates.
24822 * makefile : Update.
24824 * cs-parser.jay (delegate_declaration): Implement.
24826 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
24828 * class.cs (Event::Define): Implement.
24829 (Event.EventBuilder): New member.
24831 * class.cs (TypeContainer::Populate): Update to define all enums and events
24833 (Events): New property for the events arraylist we hold. Shouldn't we move to using
24834 readonly fields for all these cases ?
24836 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
24838 * class.cs (Property): Revamp to use the convention of making fields readonly.
24839 Accordingly modify code elsewhere.
24841 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
24842 the Define method of the Property class.
24844 * class.cs : Clean up applied patch and update references to variables etc. Fix
24846 (TypeContainer::Populate): Update to define all the properties we have. Also
24847 define all enumerations.
24849 * enum.cs (Define): Implement.
24851 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
24853 * cs-parser.jay (overloadable_operator): The semantic value is an
24854 enum of the Operator class.
24855 (operator_declarator): Implement actions.
24856 (operator_declaration): Implement.
24858 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
24859 validity of definitions.
24860 (Operator::CheckBinaryOperator): Static method to check for binary operators
24861 (TypeContainer::AddOperator): New method to add an operator to a type.
24863 * cs-parser.jay (indexer_declaration): Added line to actually call the
24864 AddIndexer method so it gets added ;-)
24866 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
24867 already taken care of by the MS compiler ?
24869 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
24871 * class.cs (Operator): New class for operator declarations.
24872 (Operator::OpType): Enum for the various operators.
24874 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
24876 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
24877 ostensibly handle this in semantic analysis.
24879 * cs-parser.jay (general_catch_clause): Comment out
24880 (specific_catch_clauses, specific_catch_clause): Ditto.
24881 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
24882 (catch_args, opt_catch_args): New productions.
24883 (catch_clause): Rewrite to use the new productions above
24884 (catch_clauses): Modify accordingly.
24885 (opt_catch_clauses): New production to use in try_statement
24886 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
24887 and re-write the code in the actions to extract the specific and
24888 general catch clauses by being a little smart ;-)
24890 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
24891 Hooray, try and catch statements parse fine !
24893 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24895 * statement.cs (Block::GetVariableType): Fix logic to extract the type
24896 string from the hashtable of variables.
24898 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
24899 I end up making that mistake ;-)
24900 (catch_clauses): Fixed gross error which made Key and Value of the
24901 DictionaryEntry the same : $1 !!
24903 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24905 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
24907 * cs-parser.jay (event_declaration): Correct to remove the semicolon
24908 when the add and remove accessors are specified.
24910 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
24912 * cs-parser.jay (IndexerDeclaration): New helper class to hold
24913 information about indexer_declarator.
24914 (indexer_declarator): Implement actions.
24915 (parsing_indexer): New local boolean used to keep track of whether
24916 we are parsing indexers or properties. This is necessary because
24917 implicit_parameters come into picture even for the get accessor in the
24918 case of an indexer.
24919 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
24921 * class.cs (Indexer): New class for indexer declarations.
24922 (TypeContainer::AddIndexer): New method to add an indexer to a type.
24923 (TypeContainer::indexers): New member to hold list of indexers for the
24926 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
24928 * cs-parser.jay (add_accessor_declaration): Implement action.
24929 (remove_accessor_declaration): Implement action.
24930 (event_accessors_declaration): Implement
24931 (variable_declarators): swap statements for first rule - trivial.
24933 * class.cs (Event): New class to hold information about event
24935 (TypeContainer::AddEvent): New method to add an event to a type
24936 (TypeContainer::events): New member to hold list of events.
24938 * cs-parser.jay (event_declaration): Implement actions.
24940 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
24942 * cs-parser.jay (dim_separators): Implement. Make it a string
24943 concatenating all the commas together, just as they appear.
24944 (opt_dim_separators): Modify accordingly
24945 (rank_specifiers): Update accordingly. Basically do the same
24946 thing - instead, collect the brackets here.
24947 (opt_rank_sepcifiers): Modify accordingly.
24948 (array_type): Modify to actually return the complete type string
24949 instead of ignoring the rank_specifiers.
24950 (expression_list): Implement to collect the expressions
24951 (variable_initializer): Implement. We make it a list of expressions
24952 essentially so that we can handle the array_initializer case neatly too.
24953 (variable_initializer_list): Implement.
24954 (array_initializer): Make it a list of variable_initializers
24955 (opt_array_initializer): Modify accordingly.
24957 * expression.cs (New::NType): Add enumeration to help us
24958 keep track of whether we have an object/delegate creation
24959 or an array creation.
24960 (New:NewType, New::Rank, New::Indices, New::Initializers): New
24961 members to hold data about array creation.
24962 (New:New): Modify to update NewType
24963 (New:New): New Overloaded contructor for the array creation
24966 * cs-parser.jay (array_creation_expression): Implement to call
24967 the overloaded New constructor.
24969 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
24971 * class.cs (TypeContainer::Constructors): Return member
24972 constructors instead of returning null.
24974 2001-08-26 Miguel de Icaza <miguel@ximian.com>
24976 * typemanager.cs (InitCoreTypes): Initialize the various core
24977 types after we have populated the type manager with the user
24978 defined types (this distinction will be important later while
24979 compiling corlib.dll)
24981 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
24982 on Expression Classification. Now all expressions have a method
24983 `Resolve' and a method `Emit'.
24985 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
24986 generation from working. Also add some temporary debugging
24989 2001-08-24 Miguel de Icaza <miguel@ximian.com>
24991 * codegen.cs: Lots of code generation pieces. This is only the
24992 beginning, will continue tomorrow with more touches of polish. We
24993 handle the fundamentals of if, while, do, for, return. Others are
24994 trickier and I need to start working on invocations soon.
24996 * gen-treedump.cs: Bug fix, use s.Increment here instead of
24999 * codegen.cs (EmitContext): New struct, used during code
25000 emission to keep a context. Most of the code generation will be
25003 * cs-parser.jay: Add embedded blocks to the list of statements of
25004 this block. So code generation proceeds in a top down fashion.
25006 2001-08-23 Miguel de Icaza <miguel@ximian.com>
25008 * statement.cs: Add support for multiple child blocks.
25010 2001-08-22 Miguel de Icaza <miguel@ximian.com>
25012 * codegen.cs (EmitCode): New function, will emit the code for a
25013 Block of code given a TypeContainer and its ILGenerator.
25015 * statement.cs (Block): Standard public readonly optimization.
25016 (Block::Block constructors): Link children.
25017 (Block::Child): Child Linker.
25018 (Block::EmitVariables): Emits IL variable declarations.
25020 * class.cs: Drop support for MethodGroups here, delay until
25022 (Method::): Applied the same simplification that I did before, and
25023 move from Properties to public readonly fields.
25024 (Method::ParameterTypes): Returns the parameter types for the
25025 function, and implements a cache that will be useful later when I
25026 do error checking and the semantic analysis on the methods is
25028 (Constructor::GetCallingConvention): Renamed from CallingConvetion
25029 and made a method, optional argument tells whether this is a class
25030 or a structure to apply the `has-this' bit.
25031 (Method::GetCallingConvention): Implement, returns the calling
25033 (Method::Define): Defines the type, a second pass is performed
25034 later to populate the methods.
25036 (Constructor::ParameterTypes): implement a cache similar to the
25037 one on Method::ParameterTypes, useful later when we do semantic
25040 (TypeContainer::EmitMethod): New method. Emits methods.
25042 * expression.cs: Removed MethodGroup class from here.
25044 * parameter.cs (Parameters::GetCallingConvention): new method.
25046 2001-08-21 Miguel de Icaza <miguel@ximian.com>
25048 * class.cs (TypeContainer::Populate): Drop RootContext from the
25051 (Constructor::CallingConvention): Returns the calling convention.
25052 (Constructor::ParameterTypes): Returns the constructor parameter
25055 (TypeContainer::AddConstructor): Keep track of default constructor
25056 and the default static constructor.
25058 (Constructor::) Another class that starts using `public readonly'
25059 instead of properties.
25061 (Constructor::IsDefault): Whether this is a default constructor.
25063 (Field::) use readonly public fields instead of properties also.
25065 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
25066 track of static constructors; If none is used, turn on
25067 BeforeFieldInit in the TypeAttributes.
25069 * cs-parser.jay (opt_argument_list): now the return can be null
25070 for the cases where there are no arguments.
25072 (constructor_declarator): If there is no implicit `base' or
25073 `this', then invoke the default parent constructor.
25075 * modifiers.cs (MethodAttr): New static function maps a set of
25076 modifiers flags into a MethodAttributes enum
25077 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
25078 MethodAttr, TypeAttr to represent the various mappings where the
25079 modifiers are used.
25080 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
25082 2001-08-19 Miguel de Icaza <miguel@ximian.com>
25084 * parameter.cs (GetParameterInfo): Fix bug where there would be no
25087 * interface.cs (PopulateIndexer): Implemented the code generator
25088 for interface indexers.
25090 2001-08-17 Miguel de Icaza <miguel@ximian.com>
25092 * interface.cs (InterfaceMemberBase): Now we track the new status
25095 (PopulateProperty): Implement property population. Woohoo! Got
25096 Methods and Properties going today.
25098 Removed all the properties for interfaces, and replaced them with
25099 `public readonly' fields.
25101 2001-08-16 Miguel de Icaza <miguel@ximian.com>
25103 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
25104 initialize their hashtables/arraylists only when they are needed
25105 instead of doing this always.
25107 * parameter.cs: Handle refs and out parameters.
25109 * cs-parser.jay: Use an ArrayList to construct the arguments
25110 instead of the ParameterCollection, and then cast that to a
25113 * parameter.cs: Drop the use of ParameterCollection and use
25114 instead arrays of Parameters.
25116 (GetParameterInfo): Use the Type, not the Name when resolving
25119 2001-08-13 Miguel de Icaza <miguel@ximian.com>
25121 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
25122 and instead use public readonly fields.
25124 * class.cs: Put back walking code for type containers.
25126 2001-08-11 Miguel de Icaza <miguel@ximian.com>
25128 * class.cs (MakeConstant): Code to define constants.
25130 * rootcontext.cs (LookupType): New function. Used to locate types
25133 2001-08-08 Miguel de Icaza <miguel@ximian.com>
25135 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
25136 this System.Reflection code is. Kudos to Microsoft
25138 * typemanager.cs: Implement a type cache and avoid loading all
25139 types at boot time. Wrap in LookupType the internals. This made
25140 the compiler so much faster. Wow. I rule!
25142 * driver.cs: Make sure we always load mscorlib first (for
25143 debugging purposes, nothing really important).
25145 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
25146 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
25148 * rootcontext.cs: Lookup types on their namespace; Lookup types
25149 on namespaces that have been imported using the `using' keyword.
25151 * class.cs (TypeContainer::TypeAttr): Virtualize.
25152 (Class::TypeAttr): Return attributes suitable for this bad boy.
25153 (Struct::TypeAttr): ditto.
25154 Handle nested classes.
25155 (TypeContainer::) Remove all the type visiting code, it is now
25156 replaced with the rootcontext.cs code
25158 * rootcontext.cs (GetClassBases): Added support for structs.
25160 2001-08-06 Miguel de Icaza <miguel@ximian.com>
25162 * interface.cs, statement.cs, class.cs, parameter.cs,
25163 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
25164 Drop use of TypeRefs, and use strings instead.
25166 2001-08-04 Miguel de Icaza <miguel@ximian.com>
25170 * class.cs (Struct::Struct): set the SEALED flags after
25171 checking the modifiers.
25172 (TypeContainer::TypeAttr): new property, returns the
25173 TypeAttributes for a class.
25175 * cs-parser.jay (type_list): Oops, list production was creating a
25176 new list of base types.
25178 * rootcontext.cs (StdLib): New property.
25179 (GetInterfaceTypeByName): returns an interface by type name, and
25180 encapsulates error handling here.
25181 (GetInterfaces): simplified.
25182 (ResolveTree): Encapsulated all the tree resolution here.
25183 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
25186 * driver.cs: Add support for --nostdlib, to avoid loading the
25187 default assemblies.
25188 (Main): Do not put tree resolution here.
25190 * rootcontext.cs: Beginning of the class resolution.
25192 2001-08-03 Miguel de Icaza <miguel@ximian.com>
25194 * rootcontext.cs: Provide better error reporting.
25196 * cs-parser.jay (interface_base): set our $$ to be interfaces.
25198 * rootcontext.cs (CreateInterface): Handle the case where there
25199 are no parent interfaces.
25201 (CloseTypes): Routine to flush types at the end.
25202 (CreateInterface): Track types.
25203 (GetInterfaces): Returns an array of Types from the list of
25204 defined interfaces.
25206 * typemanager.c (AddUserType): Mechanism to track user types (puts
25207 the type on the global type hash, and allows us to close it at the
25210 2001-08-02 Miguel de Icaza <miguel@ximian.com>
25212 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25213 RecordInterface instead.
25215 * cs-parser.jay: Updated to reflect changes above.
25217 * decl.cs (Definition): Keep track of the TypeBuilder type that
25218 represents this type here. Not sure we will use it in the long
25219 run, but wont hurt for now.
25221 * driver.cs: Smaller changes to accomodate the new code.
25223 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25226 * rootcontext.cs (CreateInterface): New method, used to create
25227 the System.TypeBuilder type for interfaces.
25228 (ResolveInterfaces): new entry point to resolve the interface
25230 (CodeGen): Property, used to keep track of the code generator.
25232 2001-07-26 Miguel de Icaza <miguel@ximian.com>
25234 * cs-parser.jay: Add a second production for delegate_declaration
25237 (enum_body): Put an opt_comma here instead of putting it on
25238 enum_body or enum_member_declarations so we can handle trailing
25239 commas on enumeration members. Gets rid of a shift/reduce.
25241 (type_list): Need a COMMA in the middle.
25243 (indexer_declaration): Tell tokenizer to recognize get/set
25245 * Remove old targets.
25247 * Re-add the parser target.
25249 2001-07-13 Simon Cozens <simon@simon-cozens.org>
25251 * cs-parser.jay: Add precendence rules for a number of operators
25252 ot reduce the number of shift/reduce conflicts in the grammar.
25254 2001-07-17 Miguel de Icaza <miguel@ximian.com>
25256 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25259 Get rid of old crufty code.
25261 * rootcontext.cs: Use this to keep track of the parsed
25262 representation and the defined types available to the program.
25264 * gen-treedump.cs: adjust for new convention.
25266 * type.cs: Split out the type manager, and the assembly builder
25269 * typemanager.cs: the type manager will live here now.
25271 * cil-codegen.cs: And the code generator here.
25273 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
25275 * makefile: Fixed up for easy making.
25277 2001-07-13 Simon Cozens <simon@simon-cozens.org>
25279 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25282 (unary_expression): Expand pre_increment_expression and
25283 post_decrement_expression to reduce a shift/reduce.
25285 2001-07-11 Simon Cozens
25287 * cs-tokenizer.cs: Hex numbers should begin with a 0.
25289 Improve allow_keyword_as_indent name.
25291 2001-06-19 Miguel de Icaza <miguel@ximian.com>
25293 * Adjustments for Beta2.
25295 2001-06-13 Miguel de Icaza <miguel@ximian.com>
25297 * decl.cs: Added `Define' abstract method.
25298 (InTransit): new property, used to catch recursive definitions.
25300 * interface.cs: Implement `Define'.
25302 * modifiers.cs: Map Modifiers.constants to
25303 System.Reflection.TypeAttribute flags.
25305 * class.cs: Keep track of types and user-defined types.
25306 (BuilderInit): New method for creating an assembly
25307 (ResolveType): New function to launch the resolution process, only
25308 used by interfaces for now.
25310 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
25311 that are inserted into the name space.
25313 2001-06-08 Miguel de Icaza <miguel@ximian.com>
25315 * ARGH. I have screwed up my tree so many times due to the use of
25316 rsync rather than using CVS. Going to fix this at once.
25318 * driver.cs: Objetify driver. Load assemblies, use assemblies to
25321 2001-06-07 Miguel de Icaza <miguel@ximian.com>
25323 * Experiment successful: Use System.Type rather that our own
25326 2001-05-25 Miguel de Icaza <miguel@ximian.com>
25328 * cs-parser.jay: Removed nsAliases from here.
25330 Use new namespaces, handle `using XXX;'
25332 * namespace.cs: Reimplemented namespace handling, use a recursive
25333 definition of the class. Now we can keep track of using clauses
25334 and catch invalid using clauses.
25336 2001-05-24 Miguel de Icaza <miguel@ximian.com>
25338 * gen-treedump.cs: Adapted for all the renaming.
25340 * expression.cs (Expression): this class now has a Type property
25341 which returns an expression Type.
25343 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25344 `Type', as this has a different meaning now in the base
25346 2001-05-22 Miguel de Icaza <miguel@ximian.com>
25348 * interface.cs, class.cs: Removed from all the sources the
25349 references to signature computation, as we can not do method
25350 signature computation during the parsing time, as we are not
25351 trying to solve at that point distinguishing:
25355 void a (NS.Blah x) {}
25358 Which depending on the context might be valid or not, as we do not
25359 know if Blah is the same thing as NS.Blah at that point.
25361 * Redid everything so the code uses TypeRefs now instead of
25362 Types. TypeRefs are just temporary type placeholders, that need
25363 to be resolved. They initially have a pointer to a string and the
25364 current scope in which they are used. This is used later by the
25365 compiler to resolve the reference to an actual Type.
25367 * DeclSpace is no longer a CIR.Type, and neither are
25368 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
25369 are all DeclSpaces, but no Types.
25371 * type.cs (TypeRefManager): This implements the TypeRef manager,
25372 which keeps track of all the types that need to be resolved after
25373 the parsing has finished.
25375 2001-05-13 Miguel de Icaza <miguel@ximian.com>
25377 * ARGH. We are going to have to store `foreach' as a class rather
25378 than resolving it, as we need to verify error 1579 after name
25379 resolution. *OR* we could keep a flag that says `This request to
25380 IEnumerator comes from a foreach statement' which we can then use
25381 to generate the error.
25383 2001-05-10 Miguel de Icaza <miguel@ximian.com>
25385 * class.cs (TypeContainer.AddMethod): we now add methods to the
25386 MethodGroup instead of the method hashtable.
25388 * expression.cs: Add MethodGroup abstraction, which gets us one
25389 step closer to the specification in the way we handle method
25392 * cs-parser.jay (primary_expression): qualified_identifier now
25393 tried to match up an identifier to a local variable reference or
25394 to a parameter reference.
25396 current_local_parameters is now a parser global variable that
25397 points to the current parameters for the block, used during name
25400 (property_declaration): Now creates an implicit `value' argument to
25403 2001-05-09 Miguel de Icaza <miguel@ximian.com>
25405 * parameter.cs: Do not use `param' arguments as part of the
25406 signature, per the spec.
25408 2001-05-08 Miguel de Icaza <miguel@ximian.com>
25410 * decl.cs: Base class for classes, structs and interfaces. This
25411 is the "Declaration Space"
25413 * cs-parser.jay: Use CheckDef for checking declaration errors
25414 instead of having one on each function.
25416 * class.cs: Factor out some code for handling error handling in
25417 accordance to the "Declarations" section in the "Basic Concepts"
25418 chapter in the ECMA C# spec.
25420 * interface.cs: Make all interface member classes derive from
25421 InterfaceMemberBase.
25423 2001-05-07 Miguel de Icaza <miguel@ximian.com>
25425 * Many things: all interfaces are parsed and generated in
25426 gen-treedump. Support for member variables, constructors,
25427 destructors, properties, constants is there.
25429 Beginning of the IL backend, but very little done, just there for
25432 2001-04-29 Miguel de Icaza <miguel@ximian.com>
25434 * cs-parser.jay: Fix labeled statement.
25436 * cs-tokenizer.cs (escape): Escape " and ' always.
25437 ref_line, ref_name: keep track of the line/filename as instructed
25438 by #line by the compiler.
25441 2001-04-27 Miguel de Icaza <miguel@ximian.com>
25443 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25444 to match the values in System.CodeDOM.
25446 Divid renamed to Divide.
25448 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25450 (Statements.set): remove.
25452 * System.CodeDOM/CodeCatchClause.cs: always have a valid
25455 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25456 falseStatements always have valid values.
25458 * cs-parser.jay: Use System.CodeDOM now.