1 2006-04-28 Raja R Harinath <harinath@gmail.com>
3 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
6 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
7 argument to two arguments: an usage-vector and a bool. Move call
8 to FlowBranching.Merge () ...
9 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
11 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
12 handling of loop and switch reachability to ...
13 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
15 2006-04-27 Raja R Harinath <harinath@gmail.com>
17 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
18 handling to FlowBranchingLoop.InLoop.
19 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
21 2006-04-26 Marek Safar <marek.safar@seznam.cz>
24 anonymous.cs.cs (AnonymousMethod.DoResolve): Moved the check whether
25 anonymous method is allowed from AnonymousContainer here.
27 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
29 2006-04-24 Raja R Harinath <rharinath@novell.com>
32 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
34 2006-04-23 Marek Safar <marek.safar@seznam.cz>
37 constant.cs (FloatConstant.Reduce): Add range checking for checked context.
38 (DoubleConstant.Reduce): Ditto.
40 2006-04-23 Raja R Harinath <rharinath@novell.com>
42 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
43 Remove 'lvalue_right_side' argument. Move parts to ...
44 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
45 (LocalVariable.DoResolveLValue): ... these.
47 2006-04-21 Raja R Harinath <rharinath@novell.com>
50 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
51 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
52 (LocalVariableReference.DoResolveBase): Use it to implement new
54 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
55 (Argument.Resolve): Simplify. Move CS1510 check ...
56 * ecore.cs (Expression.ResolveLValue): ... here.
57 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
58 (PropertyExpr.DoResolveLValue): Likewise.
59 (FieldExpr.Report_AssignToReadonly): Likewise.
60 (FieldExpr.DoResolve): Add 'out_access' argument. Use
61 LValueMemberAccess or LValueMemberOutAccess on instance depending
63 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
64 DoResolve as appropriate.
66 2006-04-20 Raja R Harinath <rharinath@novell.com>
69 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
70 implicit conversions on 'out' and 'ref' arguments.
72 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
73 improve clarity. Remove dead code.
76 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
77 (Catch.Resolve): Resolve VarBlock if it exists.
79 2006-04-19 Miguel de Icaza <miguel@novell.com>
81 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
82 twice, this was some residual code, the enumerator was emitted
83 properly in the two branche of if later.
85 2006-04-19 Raja R Harinath <rharinath@novell.com>
87 * expression.cs (Cast.ResolveLValue): Remove. The result of a
88 cast is never an lvalue.
89 (Cast.DoResolve, Cast.ResolveRest): Combine.
90 (Argument.Emit): Simplify slightly. Move 'Expr is
91 IMemoryLocation' check ...
92 (Argument.Resolve): ... here.
93 (Argument.Error_LValueRequired): Remove. Inline into only user.
95 Simplifications. Fix cs0191-2.cs
96 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
97 CS1649 and CS1651 to ...
98 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
99 the actual selection of the error code and message to a lookup
100 table. Add a dummy return value to simplify callsites.
101 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
102 readonly fields of other instances of the same type. Move CS0197
104 * expression.cs (Argument.Resolve): ... here. Simplify code.
105 Ensure that ec.InRefOutArgumentResolving is only set during LValue
106 resolution of an out or ref argument. The code simplification
107 above uses this invariant.
109 2006-04-18 Raja R Harinath <rharinath@novell.com>
111 Possibly fix #77752. Fix cs1690-[4-7].cs.
112 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
113 CheckMarshallByRefAccess. Drop parameter.
114 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
116 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
118 * report.cs (AllWarnings): Add CS1690.
119 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
121 (LocalVariableReference.DoResolveBase): Update.
123 2006-04-09 Marek Safar <marek.safar@seznam.cz>
125 class.cs (MethodOrOperator): Moved common parts from method class.
126 detect obsolete attributes.
127 (Method.Define): Simplified as it reuses code from base.
128 (Constructor.ValidAttributeTargets): Fixed issue found during
130 (Destructor.ValidAttributeTargets): Fixed issue found during
132 (Operator): Finished refactoring set off by #78020. Operator class is now
133 ordinary method class.
135 * anonymous.cs: Updated.
137 * decl.cs (DeclSpace): Add IsGeneric
139 2006-04-09 Marek Safar <marek.safar@seznam.cz>
141 (Constructor.Emit): Don't emit the attributes twice.
143 2006-04-09 Marek Safar <marek.safar@seznam.cz>
145 class.cs (Operator.Emit): Extracted code from MethodData to correctly
146 detect obsolete attributes.
147 (Method.CreateEmitContext): Moved to MethodOrOperator.
149 2006-04-09 Marek Safar <marek.safar@seznam.cz>
152 class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
153 customized exception to make crash detection easier.
154 (MethodOrOperator): Started to work on new base class for methods and
156 (Method): Derives from MethodOrOperator.
157 (Constructor.Emit): Emits its own attributes.
158 (AbstractPropertyEventMethod.Emit): Ditto.
159 (Operator): Derives from MethodOrOperator, will refactor fully in extra
161 (Operator.Emit): It's temporary more tricky than should be.
163 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
165 * report.cs (InternalErrorException): Add ctor with inner exception.
167 2006-04-08 Marek Safar <marek.safar@seznam.cz>
170 ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
173 2006-04-07 Marek Safar <marek.safar@seznam.cz>
176 expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
179 2006-04-06 Marek Safar <marek.safar@seznam.cz>
181 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
182 attribute is present and Guid not.
183 (Interface.ApplyAttributeBuilder): Ditto.
185 * attribute.cs: Add error message.
187 2006-04-06 Marek Safar <marek.safar@seznam.cz>
191 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
192 sources (it's composite) so hold them in extra array as they are used in
193 Emit phase only. It worked in the previous versions by mistake.
194 (Attribute.Emit): Emit attribute for more owners when exist.
196 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
197 it has now different behaviour.
199 2006-04-04 Marek Safar <marek.safar@seznam.cz>
201 * constant.cs (Constant.IsDefaultInitializer): New method.
205 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
206 re-initialize default values. It saves KBs almost for every assembly.
207 Thanks Zoltan for the idea.
208 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
209 (ArrayCreation.DoResolve): Resolve only once.
210 (ArrayCreation.Emit): Emit static initializer only when it is faster.
211 (ArrayCreation.GetAttributableValue): Cope with optimized values.
213 2006-04-03 Zoltan Varga <vargaz@gmail.com>
215 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
218 2006-04-01 Marek Safar <marek.safar@seznam.cz>
220 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
221 in an embedded statement too.
223 2006-04-01 Raja R Harinath <rharinath@novell.com>
226 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
228 2006-04-01 Marek Safar <marek.safar@seznam.cz>
232 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
235 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
237 2006-03-31 Marek Safar <marek.safar@seznam.cz>
239 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
242 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
243 LocalTemporary change.
245 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
247 (ClassOrStruct.DefineFieldInitializers): Implemented static field
248 initializers optimization.
249 (ClassOrStruct.TypeAttr): Moved from modifiers.
250 (Constructor.CheckBase): Don't crash when static ctor has parameters.
251 (FieldBase.ResolveInitializer): Resolves initializer.
252 (FieldBase.HasDefaultInitializer): New property.
254 * cs-parser.jay: Removed message.
256 * expression.cs (CompilerGeneratedThis): New specialization.
258 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
260 2006-03-28 Marek Safar <marek.safar@seznam.cz>
262 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
264 2006-03-27 Marek Safar <marek.safar@seznam.cz>
266 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
267 be now EnumConstants only.
269 2006-03-27 Marek Safar <marek.safar@seznam.cz>
271 * attribute.cs, driver.cs: Reset more caches.
273 2006-03-26 Marek Safar <marek.safar@seznam.cz>
275 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
277 2006-03-26 Marek Safar <marek.safar@seznam.cz>
279 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
280 for easier reuse. Updated all overrides.
281 (IntegralConstant): New base class for all integral constants.
282 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
283 of the constant range, report custom error.
284 (UIntConstant.Reduce): Fixed uint conversion.
286 * ecore.cs, literal.cs: Reduce updates.
288 2006-03-26 Marek Safar <marek.safar@seznam.cz>
292 * class.cs (Constructor.Define): Removed extra if for default ctors.
293 A patch from Atsushi Enomoto.
295 2006-03-26 Marek Safar <marek.safar@seznam.cz>
297 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
298 GetAttributableValue.
300 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
303 * convert.cs (ImplicitConversionRequired): Error message moved to
306 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
307 automatic implicit conversion of an output value.
308 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
310 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
312 (TypeOf.GetAttributableValue): Add extra handling for object type.
314 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
315 special error message.
317 2006-03-25 Marek Safar <marek.safar@seznam.cz>
319 * class.cs (Constructor.Emit): Don't crash when struct ctor is
321 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
322 compatible with MS runtime.
324 2006-03-23 Marek Safar <marek.safar@seznam.cz>
326 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
327 attribute arguments here.
329 * class.cs (Indexer.Define): The check was moved to attribute class.
331 2006-03-22 Marek Safar <marek.safar@seznam.cz>
333 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
334 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
337 2006-03-22 Raja R Harinath <rharinath@novell.com>
339 Support ParameterDefaultValueAttribute in gmcs. Also applied to
340 mcs to keep code differences small.
341 * attribute.cs (Attribute.GetParameterDefaultValue): New.
342 * typemanager.cs (parameter_default_value_attribute_type): New.
343 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
346 2006-03-21 Marek Safar <marek.safar@seznam.cz>
348 * expression.cs (StringConcat.Append): Reverted back to no warning state.
350 2006-03-21 Marek Safar <marek.safar@seznam.cz>
352 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
354 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
357 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
359 * doc-bootstrap.cs : fix build.
361 2006-03-20 Marek Safar <marek.safar@seznam.cz>
363 * expression.cs (StringConcat.Append): Issue a warning when empty string
366 2006-03-20 Marek Safar <marek.safar@seznam.cz>
368 * assign.cs (CompoundAssign.ResolveSource): Removed.
370 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
373 * class.cs (TypeContainer.FindMethods): Removed.
374 (TypeContainer.CheckMemberUsage): Made static.
376 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
378 * constant.cs (CheckRange): Removed unused type argument.
379 (CheckUnsigned): Removed unused type argument.
381 * cs-parser.jay: Updated after MemberAccess clean up.
382 Uses Length for empty string test.
384 * cs-tokenizer.cs: Uses Length for empty string test.
385 (IsCastToken): Made static.
386 (is_hex): Made static.
387 (real_type_suffix): Made static.
389 * decl.cs (SetupCache): Made static.
390 (OnGenerateDocComment): Removed unused ds argument.
392 * delegate.cs (VerifyDelegate): Removed unused argument.
394 * doc.cs: Uses Length for empty string test.
396 * driver.cs: Uses Length for empty string test.
398 * enum.cs (IsValidEnumType): Made static
400 * expression.cs (EnumLiftUp): Removed unused argument.
401 (ResolveMethodGroup): Ditto.
402 (BetterConversion): Ditto.
403 (GetVarargsTypes): Ditto.
404 (UpdateIndices): Ditto.
405 (ValidateInitializers): Ditto.
406 (MemberAccess.ctor): Ditto.
407 (GetIndexersForType): Ditto.
409 * flowanalysis.cs: (MergeFinally): Removed unused argument.
411 * iterators.cs: Updated after MemberAccess clean up.
413 * location.cs: Uses Length for empty string test.
415 * namespace.cs: Uses Length for empty string test.
417 * report.cs (CheckWarningCode): Made static.
419 * statement.cs (LabeledStatement): Removed unused argument.
421 * typemanager.cs (FilterNone): Removed.
423 2006-03-18 Marek Safar <marek.safar@seznam.cz>
425 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
430 2006-03-18 Marek Safar <marek.safar@seznam.cz>
432 * cs-parser.jay.cs: __arglist is not allowed for delegates.
434 2006-03-18 Marek Safar <marek.safar@seznam.cz>
438 * expression.cs (VerifyArgumentsCompat): Reverted to double error
439 reporting, it's more tricky than I thought.
441 2006-03-18 Marek Safar <marek.safar@seznam.cz>
445 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
447 (AnonymousMethod.ImplicitStandardConversionExists): New method.
448 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
449 Add more error reporting; Fixed issue with params.
451 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
453 * cs-parser.jay: AnonymousMethod requires host container.
455 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
457 2006-03-18 Raja R Harinath <harinath@gmail.com>
459 * class.cs: Change 'TypeContainer ds' constructor argument to
460 'DeclSpace parent'. Some classes were missed below due to
461 different naming convention.
463 * class.cs (MemberCore.Parent): Delete. This makes the
464 ParentContainer changes below enforceable by the compiler.
466 Treat pointers to enclosing declaration space as 'DeclSpace', not
468 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
469 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
471 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
473 (Block.AddThisVariable): Likewise.
474 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
475 (AbstractPropertyEventMethod.Emit): Likewise.
476 (AbstractPropertyEventMethod.EmitMethod): Likewise.
477 (GetMethod.Define, SetMethod.Define): Likewise.
478 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
479 (DelegateMethod.EmitMethod): Likewise.
481 Fix regression test-partial-13.cs.
482 Rationalize use of PartialContainer. Ensure that the partial
483 class semantics can be tied to type-correctness, i.e., any
484 violation will cause a compile error.
485 * class.cs, const.cs: Access all fields that belong to class
486 TypeContainer via ParentContainer. Arguments of EmitContexts and
487 Resolve()-like functions still use 'Parent'.
489 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
490 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
491 (PropertyMethod.CheckModifiers): Remove unused argument.
492 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
495 2006-03-17 Raja R Harinath <harinath@gmail.com>
497 Make semantics of PartialContainer simpler.
498 * decl.cs (DeclSpace.IsPartial): Remove.
499 * class.cs (TypeContainer.IsPartial): Likewise.
500 (TypeContainer..ctor): Set PartialContainer to point to self.
501 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
502 (TypeContainer.FindNestedType): Likewise.
503 (MemberCore.ParentContainer): Simplify. Remove deprecation.
505 2006-03-17 Marek Safar <marek.safar@seznam.cz>
507 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
509 2006-03-15 Marek Safar <marek.safar@seznam.cz>
511 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
514 2006-03-15 Marek Safar <marek.safar@seznam.cz>
516 * class.cs (Operator.Define): An error for base conversion was not
519 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
521 * iterator.cs : yield break is allowed in try statement which has
522 catch clauses. Fixed bug #77767.
524 2006-03-13 Marek Safar <marek.safar@seznam.cz>
526 A fix for #77593, #77574.
528 * class.cs (MethodCore.CheckBase): Another if for operator.
530 2006-03-09 Marek Safar <marek.safar@seznam.cz>
532 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
535 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
536 (DelegateCreation.ImplicitStandardConversionExists): New method for just
539 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
542 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
543 Updated after another emitcontext usage was clean up. It should help us to
544 synchronize with gmcs easier.
546 2006-03-04 Marek Safar <marek.safar@seznam.cz>
550 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
551 (Event.Define): ditto
552 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
554 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
555 Removed redundant code and set NewSlot for Invoke method too.
557 * parameter.cs (Parameters.ctor): Add custom, type ctor.
558 (Parameters.MergeGenerated): New method. Use this method when you merge
559 compiler generated argument with user arguments.
561 2006-03-03 Marek Safar <marek.safar@seznam.cz>
563 * attribute.cs (ResolveAsTypeTerminal): Removed.
565 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
566 specialization for predefined types; 30% speed up.
567 Finally placed obsolete check to right place.
568 (Expression.ResolveType): Removed.
570 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
571 Updated after ResolveType was removed.
573 * expression.cs (Cast.ctor): Check void cast.
574 (Binary.ResolveAsTypeTerminal): Is never type.
575 (Conditional.ResolveAsTypeTerminal): Is never type.
577 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
579 2006-03-01 Raja R Harinath <rharinath@novell.com>
582 * expression.cs (ParameterReference.DoResolveBase): Change return
584 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
588 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
591 * typemanager.cs (GetFullNameSignature): Don't nullref on
594 2006-02-27 Marek Safar <marek.safar@seznam.cz>
596 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
597 these two separated members to simplify the code.
598 (Attribute.Resolve): Refactored to use new fields and methods.
599 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
600 implemented obsolete attribute checking.
601 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
602 implemented obsolete checking again. It look line never ending quest ;-)
603 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
605 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
607 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
609 *class.cs (Property.Define): Add RegisterProperty call.
611 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
612 argument groups (only 2).
614 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
615 encoding expression to arguments.
616 (Expression.ExprClassToResolveFlags): Just turned to property.
618 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
619 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
620 optimized as well as implemented support for zero-length attributes.
622 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
623 Add caching of PropertyInfo's.
625 2006-02-25 Marek Safar <marek.safar@seznam.cz>
627 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
628 error multiple times.
630 2006-02-25 Marek Safar <marek.safar@seznam.cz>
632 New partial class implementation.
633 A fix for #77027, #77029, #77403
635 * attribute.cs (Attributable): Made attributes protected.
637 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
638 the replacements of ClassPart and PartialContainer.
639 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
640 (TypeContainer.AddInterface): Ditto.
641 (TypeContainer.AddPartial): The main method for partial classes. It checks
642 for errors and merges ModFlags and attributes. At the end class is added to
644 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
646 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
647 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
648 from the rest of partial classes.
649 (TypeContainer.GetClassBases): Simplified.
650 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
652 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
653 (TypeContainer.HasExplicitLayout): Uses Flags now.
654 (PartialContainer): Removed.
655 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
656 (StaticClass): Was merged with Class.
657 (Class.GetClassBases): class and static class bases are verified here.
658 (Class.TypeAttr): Added static attributes when class is static.
659 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
660 (MemberBase): In some cases we need to call parent container for partial
661 class. It should be eliminated but it's not easy now.
663 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
665 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
666 partial classed to accumulate class comments.
667 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
669 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
671 * driver.cs (MainDriver): Tree.GetDecl was removed.
673 * modifiers.cs (Modifiers): Add partial modifier.
675 * tree.cs (Tree.decl): Removed.
676 (RootTypes): Started to use this class more often for root types
679 2006-02-22 Marek Safar <marek.safar@seznam.cz>
683 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
684 external interface does not have an attribute.
686 2006-02-22 Marek Safar <marek.safar@seznam.cz>
688 Another prerequisites for new partial classs implementation.
690 * attribute.cs (Attribute.Equal): Implemented.
691 (Attribute.Emit): Changed as attributes can be applied more than twice.
692 (Attributes.Emit): Check for duplicate attributes here.
694 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
695 as a parameter, clean-up.
697 2006-02-11 Marek Safar <marek.safar@seznam.cz>
701 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
702 contains obsolete attribute check which can in some cases look for base
703 type of current class which is not initialized yet.
704 (TypeContainer.BaseType): Replacement of ptype.
706 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
708 2006-02-11 Marek Safar <marek.safar@seznam.cz>
710 First of prerequisites for new partial classs implemention.
712 * attribute.cs (Attributable): Extended by ResolveContext;
713 Attributes finally have correct context for resolving in all cases.
714 (AttachTo): Attribute owner is assigned here.
716 * codegen.cs (IResolveContext): Introduce new interface to hold
717 all information needed in resolving phase.
718 (EmitContext): Implements IResolveContext; more clean-up needed here.
720 * decl.cs (MemberCore): Implemented IResolveContext.
722 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
723 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
724 parameter.cs, statement.cs, tree.cs, typemanager.cs:
725 Refactored to use new IResolveContext instead of EmitContext; cleanup
727 2006-02-06 Miguel de Icaza <miguel@novell.com>
729 * codegen.cs (EmitScopeInitFromBlock): check here the
730 capture_context, there is no need to make two calls to the
733 * anonymous.cs: Add some debugging messages that might help me
734 track other instances of this problem in the future (the
735 regression of test 467).
737 * cs-parser.jay: track the variable block, as we need to initalize
738 any captured variables declared in this block for the "catch"
739 portion of the "Try" statement.
741 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
742 scope initialization for captured variables.
744 Also, move the emit for the variables after the block location has
747 2006-02-06 Marek Safar <marek.safar@seznam.cz>
749 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
751 2006-02-02 Miguel de Icaza <miguel@novell.com>
753 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
754 commit yesterday, the initialization for the roots is necessary.
755 What is not necessary is the scope activation.
757 2006-02-02 Raja R Harinath <rharinath@novell.com>
759 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
760 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
762 (Argument.Resolve): Remove CS0206 checks.
764 2006-02-01 Miguel de Icaza <miguel@novell.com>
766 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
767 scopes for all the roots, the scopes will now be emitted when the
768 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
770 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
771 code. This reduces a lot of existing cruft.
773 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
774 that the ScopeInfo is generated as we enter the scope, not at the
775 time of use, which is what we used to do before.
777 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
778 every time a Block is about to be emitted if we have a
781 2006-02-01 Raja R Harinath <rharinath@novell.com>
783 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
785 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
787 * typemanager.cs (cons_param_array_attribute): Make private.
788 (Reset): Set it to null.
789 (InitCoreHelpers): Don't initialize it.
790 (ConsParamArrayAttribute): New. Initialize it as needed.
791 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
793 2006-01-31 Miguel de Icaza <miguel@novell.com>
795 * expression.cs: There might be errors reported during the
796 selection of applicable methods. If there are errors, do not
797 continue execution as it will lead the compiler to crash.
799 2006-01-30 Miguel de Icaza <miguel@novell.com>
801 * expression.cs: Member access is not allowed on anonymous
802 methods. Fixes #77402.
804 2006-01-30 Raja R Harinath <rharinath@novell.com>
807 * cs-parser.jay (VariableDeclaration): Don't set
808 current_array_type to null.
809 (field_declaration, event_declaration, declaration_statement):
812 2006-01-28 Raja R Harinath <harinath@gmail.com>
814 * typemanager.cs (GenericParameterPosition): New.
817 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
819 * doc.cs : To process "include" elements, first we should create
820 another list than XmlNodeList, because it could result in node
821 removal, which could result in that the XmlNodeList gives up
824 (Also made code identical to gmcs again.)
826 2006-01-25 Miguel de Icaza <miguel@novell.com>
828 * ecore.cs: Introduce an error report that we were not catching
829 before, if not silent, we must report the error. Gonzalo ran into
832 2006-01-23 Miguel de Icaza <miguel@novell.com>
834 A fix for bug: #76957
836 * iterators.cs (MoveNextMethod.CreateMethodHost): call
837 ComputeMethodHost before creating the method, this is a new
840 * anonymous.cs (AnonymousContainer): Now we track all the scopes
841 that this method references (RegisterScope). The actual scope
842 where the method is hosted is computed with the ComputeMethodHost
843 before we create the method.
845 Moved the Deepest routine here.
847 (AnonymousContainer.ComputeMethodHost): New routine used to
848 compute the proper ScopeInfo that will host the anonymous method.
850 (ScopeInfo): Deal with multiple roots. The problem was that we
851 did not have a unique root where all ScopeInfos could be hanged
852 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
855 Remove AdjustMethodScope which is now computed at the end. Remove
856 LinkScope which did a partial link, instead link all ScopeInfos
857 before code generation from the new "LinkScopes" routine.
859 Simplify all the Add* routines as they no longer need to maintain
860 the tree, they just need to record that they are using variables
863 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
864 routines to produce the forest of ScopeInfo trees.
866 * class.cs (TypeContainer.AppendMethod): This is just like
867 AddMethod, but ensures that an interface implementation method
868 (IEnumerable.XXX) is not inserted at the beginning of the queue of
869 methods, but at the end.
871 We use this functionality to ensure that the generated MoveNext
872 method in the iterator class is resolved/emitted before the
873 enumerator methods created.
875 This is required because the MoveNext method computes the right
876 ScopeInfo for the method. And the other methods will eventually
877 need to resolve and fetch information computed from the anonymous
880 2006-01-21 Raja R Harinath <harinath@gmail.com>
881 Carlos Alberto Cortez <calberto.cortez@gmail.com>
884 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
886 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
887 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
889 2006-01-18 Raja R Harinath <rharinath@novell.com>
891 Fix #76656, cs0231-2.cs.
892 * cs-parser.jay (formal_parameter_list): Make error case catch
894 (parenthesized_expression_0): Add CS1026 check.
895 (invocation_expression): Remove unused { $$ = lexer.Location }.
897 2006-01-17 Raja R Harinath <rharinath@novell.com>
900 * cs-parser.jay (statement_expression): Don't list out the
901 individual statement-expressions. Convert syntax error into
904 2006-01-16 Raja R Harinath <rharinath@novell.com>
907 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
908 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
909 CheckIntermediateModification.
910 (FieldExpr.DoResolve): Add new two-argument version that
911 allows us to resolve the InstanceExpression as an lvalue.
912 The one-argument variant is now just a wrapper.
913 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
914 Resolve the lhs as an lvalue if the it has a value type.
915 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
916 from Assign.DoResolve.
917 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
918 resolved as an lvalue.
919 (PropertyExpr.DoResolve): Update.
920 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
921 has a value type. Move CS1612 check here from
922 CheckIntermediateModification.
923 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
924 * expression.cs (EmptyExpression.OutAccess): New. Used as the
925 'right_side' of a ResolveLValue on an 'out' argument.
926 (EmptyExpression.LValueMemberAccess): New. Used as the
927 'right_side' of a propagated ResolveLValue on a value type.
928 (LocalVariableReference.DoResolveBase): Recognize
929 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
931 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
932 EmptyExpression.Null.
934 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
936 * typemanager.cs : added IsGenericParameter(). In mcs it always
938 * doc.cs : for generic parameters, use GenericParameterPosition,
941 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
943 * expression.cs: Fix Console.WriteLine ((this = x).foo);
945 2006-01-12 Miguel de Icaza <miguel@novell.com>
947 This fixes the problem where we used ldfld instead of ldflda to
948 load the "THIS" pointer on captured parameters, when THIS is a
949 value type. See bug #77205.
951 * iterators.cs (CapturedThisReference.Emit): Pass false to
952 EmitThis (we do not need the address).
954 * codegen.cs (EmitThis): it needs to know whether we need the
955 address of `this' or not. This is used by value types.
957 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
958 every other call passes false.
960 2006-01-12 Raja R Harinath <rharinath@novell.com>
963 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
965 * expression.cs (Invocation.OverloadResolve): Update.
966 (Invocation.DoResolve): Avoid double resolution of invocation.
968 2006-01-11 Raja R Harinath <rharinath@novell.com>
971 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
972 unary negation of floating point types as 0-expr; negation cannot
973 overflow in floating point types.
976 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
977 on operands of 'void' type.
980 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
981 and ExclusiveOr for boolean constants too.
983 2006-01-09 Raja R Harinath <rharinath@novell.com>
986 * expression.cs (Invocation.OverloadResolve): Replace reflected
987 override methods with their base virtual methods, rather than
989 * typemanager.cs (TypeManager.GetOverride): New.
991 2006-01-05 Jb Evain <jbevain@gmail.com>
993 * class.cs (Property.Define, Indexer.Define): do not tag the
994 properties as SpecialName | RTSpecialName.
996 2006-01-04 Miguel de Icaza <miguel@novell.com>
998 * class.cs (MethodCore.IsDuplicateImplementation): This method was
999 doing a low-level comparission of parameter types. It was lacking
1000 a check for __argslist.
1002 2005-12-30 Miguel de Icaza <miguel@novell.com>
1004 * expression.cs (ParameterReference.DoResolveBase): Allow
1005 reference parameters if they are local to this block.
1007 This allows the ref and out parameters of a delegate to be used in
1008 an anonymous method, for example:
1010 delegate void set (out int x);
1012 set s = delegate (out int x){
1016 This is used by functionality introduced late in the C# language.
1018 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1019 method that take ref and out parameters.
1021 Fixes #77119 which was a late change in the spec.
1023 2005-12-23 Miguel de Icaza <miguel@novell.com>
1025 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1026 parent if its the same scope. Fixes #77060.
1028 2005-12-21 Miguel de Icaza <miguel@novell.com>
1030 * driver.cs: Report the case of no source files and no -out:
1033 2005-12-20 Raja R Harinath <rharinath@novell.com>
1036 * expression.cs (ComposedCast.GetSignatureForError): Define.
1038 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1042 * namespace.cs (NamespaceEntry): Add extern_aliases as a
1043 ListDictionary, to contain the ExternAliasEntry entries (in
1044 addition to the NamespaceEntry.aliases hashtable). This field is
1045 shared between the original entry and its doppelganger (bodyless
1047 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1048 extern_aliases field.
1049 (NamespaceEntry.Lookup): Move the IsImplicit check after the
1050 lookup in extern_aliases.
1052 2005-12-16 Raja R Harinath <rharinath@novell.com>
1055 * class.cs (TypeContainer.Mark_HasEquals): New.
1056 (TypeContainer.Mark_HasGetHashCode): New.
1057 (ClassPart): Override them.
1058 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1061 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1062 'parent' argument to the base constructor.
1064 Remove all mention of TypeContainer from decl.cs.
1065 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1066 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1067 (DeclSpace.DeclSpace): Likewise.
1068 (DeclSpace.DefineMembers): Remove unused argument.
1069 * cs-parser.jay (pop_current_class): Update to changes. Simplify
1070 debugging check -- we don't care if the debug code throws an
1071 InvalidCastException instead of an InternalErrorException.
1072 * class.cs (TypeContainer.DefineMembers): Update to changes.
1073 (TypeContainer.DoDefineMembers): Likewise.
1074 (TypeContainer.GetMethods): Likewise.
1075 (PropertyMember.Define): Likewise.
1076 (MemberBase.Parent): New property that forwards to
1077 MemberCore.Parent, but ensures that we get a TypeContainer.
1078 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1079 (RootContext.PopulateTypes): Likewise. Remove special case code
1080 for !RootContext.StdLib: DefineMembers is idempotent.
1082 2005-12-14 Miguel de Icaza <miguel@novell.com>
1084 * convert.cs (ExplicitConversionCore): Check the return value from
1085 ExplicitConversionCore which can return null on failure. Fixes #76914
1087 2005-12-13 Marek Safar <marek.safar@seznam.cz>
1089 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1091 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
1093 * doc.cs : The search for referenced namespace was insufficient to
1094 get global one as it used to do. Fixed bug #76965.
1096 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
1098 * doc.cs : check name in cref in the last phase that whether it is
1101 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1103 * cs-tokenizer.cs : reverted the latest change: it somehow broke
1106 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1108 * doc.cs : so it turned out that we cannot skip override check for
1109 interface members. Fixed bug #76954.
1111 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1113 * cs-tokenizer.cs : fixed bug #75984:
1114 - #warning and #error should not be handled when the source line
1116 - #line is not checked strictly when the source line is disabled.
1117 - #define and #undef is on the other hand checked strictly at any
1120 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
1122 * cs-tokenizer.cs : missing Location (actually, filename) in one of
1125 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1127 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1129 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1131 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1132 (FieldBase.Initializer): Initializer is now optional.
1133 (EventField.Define): Only event field can have initializer.
1135 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1137 * const.cs (Const): Reuse initializer.
1139 * cs-parser.jay: Updated after FieldBase changes.
1140 Added current_array_type to simplify array initializers.
1142 * ecore.cs (NullCast.IsDefaultValue): Implemented.
1144 * expression.cs, iterators.cs: Updated.
1146 * namespace.cs (NamespaceEntry): Made UsingFound private.
1148 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1150 * parameterCollection.cs: Obsolete, removed.
1151 * parser.cs: Obsolete, removed.
1153 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1156 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1158 * enum.cs (Enum.Define): Set obsolete context here.
1160 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
1163 - FindDocumentedMember() now expects 1) paramList as null
1164 when "we don't have to check the number of parameters" and
1165 2) Type.EmptyTypes when "there is no arguments".
1166 - Introduced FoundMember struct to hold the exact type which was
1167 used to find the documented member (the above change broke
1168 test-xml-044; it might be better just to use DeclaringType than
1169 what MS does, like this change does, but it depends on usage.)
1171 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
1173 * doc.cs : documented member might be from DeclaringType for nested
1174 types. Fixed bug #76782.
1176 2005-12-03 Ben Maurer <bmaurer@ximian.com>
1178 * anonymous.cs: Have the param code handle leaving copies on the
1179 stack etc. Allows anonymous params to take part in the assignment
1180 code (++, +=, etc). Fixes bug #76550
1182 * expression.cs: Handle the prepare_for_load/leave_copy by passing
1183 it down to the anon code.
1185 * iterators.cs: Use dummy var here
1187 * codegen.cs: Handle new vars
1189 2005-12-01 Marek Safar <marek.safar@seznam.cz>
1192 * class.cs (MethodData.Define): Set proper Obsolete context.
1194 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1196 (FieldExpr.DoResolve): Ditto.
1198 2005-12-01 Marek Safar <marek.safar@seznam.cz>
1201 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1202 parent is not obsolete.
1204 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
1206 * doc.cs : (FindDocumentedMember) find parameterless members first
1207 and get CS0419 in the early stage. Fixed first case of bug #76727.
1209 2005-11-30 Marek Safar <marek.safar@seznam.cz>
1212 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1213 no error was reported.
1215 *expression.cs (Binary.DoResolve): left can be null.
1217 2005-11-22 Marek Safar <marek.safar@seznam.cz>
1220 * class.cs (MethodData.Emit): Parameters should be labeled first.
1222 2005-11-21 Marek Safar <marek.safar@seznam.cz>
1225 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1227 2005-11-18 Marek Safar <marek.safar@seznam.cz>
1229 * attribute.cs (AreParametersCompliant): Moved to Parameter.
1231 * class.cs (MethodCore): Parameter clean up.
1232 (IMethodData): Added ParameterInfo.
1233 (MethodData): Parameter clean up.
1234 (Indexer.Define): Parameter clean up.
1246 * typemanager.cs: Parameter clean up.
1248 * delegate.cs (Define): Get rid of duplicated code.
1250 * expression.cs (ParameterReference): Removed useless parameters
1252 (Invocation): Ditto.
1254 * parameter.cs (ParamsParameter): New class, params specialization.
1255 (ArglistParameter): Attemp to separate arglist.
1256 (Parameter): Refactored to be reusable and faster.
1257 (Parameter.Modifier): Made understandable.
1258 (Parameters): Changed to be used as a class for `this' assembly
1259 parameters. Refactored to use new specialized classes.
1261 * support.cs (ParameterData): Added Types property.
1262 (InternalParameters): Deleted.
1264 2005-08-20 Martin Baulig <martin@ximian.com>
1266 Merging this patch from GMCS to fix #75867.
1268 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
1269 scope if we don't already have it.
1271 2005-11-17 Martin Baulig <martin@ximian.com>
1274 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
1275 inherit the scope from our parent. Fixes #76653.
1277 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1279 * doc.cs : the previous patch does not actually fix the bug.
1280 PropertyInfo override check is now implemented and really fixed it.
1281 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
1283 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1285 * doc.cs : apply "override filter" also to properties.
1288 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1290 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
1291 no need to check overrides. For classes, omit those results from
1292 interfaces since they must exist in the class. Fixed bug #76726.
1294 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1296 * typemanager.cs : (GetFullNameSignature) differentiate indexers
1297 with different parameters. Fixed the second problem in #76685.
1299 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1301 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
1302 get expected 'protected' access in CheckValidFamilyAccess()).
1305 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1307 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
1308 Fixed bug #76705. CS1569 was incorrectly commented out.
1310 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
1312 * doc.cs : use Invocation.IsOverride() to do real override check.
1313 * expression.cs : made Invocation.IsOverride() internal.
1315 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
1317 * doc.cs : use TypeManager.FindMembers() instead of (possible)
1318 TypeBuilder.FindMembers() and filter overriden base members out.
1321 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1323 * doc.cs : ref/out parameters are represented as '@' (instead of
1324 '&' in type FullName). Fixed bug #76630 (additionally crefs).
1326 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1328 * doc.cs : when there was no '.' in cref to methods in doc comment,
1329 then parameters were missing in the output. Fixed bug #76691.
1331 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1333 * driver.cs : don't output docs when there is an error.
1336 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1339 Now it should detect indexers. Fixed primary concern in bug #76685.
1340 Fixed CS0419 message to not show the identical member signature in
1343 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1345 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
1346 instead of Type.FindMembers() since it does not handle events.
1349 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
1351 * codegen.cs: Fixed typo (speficied -> specified).
1353 2005-11-11 Marek Safar <marek.safar@seznam.cz>
1356 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
1358 2005-11-11 Marek Safar <marek.safar@seznam.cz>
1360 * attribute.cs: Changed error message.
1362 * cs-tokenizer.cs: One more check.
1364 2005-11-10 Marek Safar <marek.safar@seznam.cz>
1366 * statement.cs (Block.Resolve): Ignore empty statement.
1368 2005-11-10 Marek Safar <marek.safar@seznam.cz>
1370 * report.cs: Made error/warning methods more strict to avoid
1373 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
1374 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
1375 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
1376 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
1378 2005-11-08 Marek Safar <marek.safar@seznam.cz>
1380 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
1381 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
1383 * class.cs (TypeContainer.IsComImport): New property.
1384 (Constructor.Define): Create proper ctor for ComImport types.
1386 * expression.cs (New.CheckComImport): Fixed.
1388 2005-11-07 Miguel de Icaza <miguel@novell.com>
1390 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
1391 that a parameter has been captured does not mean that we do not
1392 have to do the rest of the processing. This fixes the second part
1393 of #76592. If there was another anonymous method capturing
1394 values in the past, the Scope would never be set for the second
1395 method that captured the same parameter.
1397 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
1398 properly manipulate the stack. Second part of fix for #76592.
1400 * expression.cs (New): Add support for invoking "new" on
1401 interfaces that have been flagged with the ComImport attribute and
1402 the CoClass. Fixes #76637
1404 * statement.cs (Try.DoEmit): When a variable is captured, do not
1405 try to emit the vi.LocalBuilder variable as it has been captured.
1406 Create a temporary variable and store the results on the
1407 FieldBuilder. Fixes #76642
1409 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1411 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
1413 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
1415 * expression.cs (Binary.DoResolve): Added && optimalization.
1417 * typemanager.cs (AddUserType): Removed useless argument.
1419 2005-11-04 Marek Safar <marek.safar@seznam.cz>
1421 * statement.cs (Block.variables): Uses ListDictionary.
1423 2005-11-03 Marek Safar <marek.safar@seznam.cz>
1426 * class.cs (PartialContainer.EmitType): Customized to emit
1427 security attributes.
1428 (ClassPart.ApplyAttributeBuilder): Transform security attribute
1429 for partial classes.
1431 2005-11-03 Marek Safar <marek.safar@seznam.cz>
1434 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
1435 access has to be fixed.
1437 * typemanager.cs (IsUnmanagedType): Wrong common field type.
1439 2005-11-01 Marek Safar <marek.safar@seznam.cz>
1442 * ecore.cs (NullCast.Reduce): Implemented.
1444 * expression.cs (ArrayCreation.CheckIndices): Correcly check
1447 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
1449 (Foreach.Resolve): Catch null properly.
1451 2005-10-29 Marek Safar <marek.safar@seznam.cz>
1453 * cs-tokenizer.cs: Warning text fix.
1455 * driver.cs: AllWarningNumbers exposed on public interface.
1457 * report.cs (): Reviewed warning numbers.
1458 (IsValidWarning): Use binary search.
1460 2005-10-29 Marek Safar <marek.safar@seznam.cz>
1462 * driver.cs: Implemeted resource visibility.
1463 (Resources): New class for code sharing between /res: and
1466 2005-10-28 Marek Safar <marek.safar@seznam.cz>
1469 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
1472 * convert (Convert.ImplicitReferenceConversion): NullCast holds
1475 * ecore.cs (NullCast): Child is contant only.
1477 * literal.cs (NullLiteral.Reduce): null can be converted to any
1480 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
1482 * driver.cs: Use Encoding.Default as default code page instead
1485 2005-10-27 Raja R Harinath <rharinath@novell.com>
1488 * expression.cs (Invocation.Error_InvalidArguments): Handle
1489 __arglist parameters.
1490 (Invocation.VerifyArgumentsCompat): Likewise.
1491 * support.cs (ReflectionParameters.GetSignatureForError): Print
1492 __arglist parameters.
1493 (InternalParamters.GetSignatureForError): Likewise.
1494 * parameter.cs (Parameters.GetSignatureForError): Likewise.
1496 2005-10-26 Marek Safar <marek.safar@seznam.cz>
1498 * attribute.cs (GetPropertyValue): Made public.
1500 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
1502 Add new property WrapNonExceptionThrows to handle 2.0 assembly
1504 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
1507 * driver.cs: Reflect method name change.
1509 * statement.cs (Try.Resolve): Warn when try has both general
1512 * typemanager.cs: runtime_compatibility_attr_type new predefined
1515 2005-10-26 Raja R Harinath <harinath@gmail.com>
1518 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
1519 treat it as an empty parameter list.
1521 2005-10-26 Raja R Harinath <rharinath@novell.com>
1524 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
1525 ResolveAsTypeStep silent.
1526 * statement.cs (Block.AddConstant): Mark block as used.
1527 (Block.ResolveMeta): Avoid piling on error messages
1528 if a constant initializer resolution fails.
1530 2005-10-25 Raja R Harinath <rharinath@novell.com>
1532 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
1534 (NamespaceEntry.VerifyAllUsing): New.
1535 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
1536 behaviour. Delegates actual resolution of alias to ...
1537 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
1538 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
1540 * driver.cs (Driver.MainDriver): Update.
1542 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
1543 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
1545 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
1547 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
1548 RootNamespace.DefineNamespacesForAll.
1550 2005-10-24 Raja R Harinath <harinath@gmail.com>
1552 * typemanager.cs (assemblies, external_aliases, modules)
1553 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
1554 (ComputeNamespaces, GetRootNamespace): Remove extra staging
1555 overhead. Move resposibility ...
1556 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
1557 * driver.cs, attribute.cs, codegen.cs: Update to changes.
1559 2005-10-23 Raja R Harinath <harinath@gmail.com>
1561 * namespace.cs (RootNamespace.all_namespaces): Renamed from
1562 cached_namespaces. Improve usage.
1563 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
1564 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
1565 Move from GlobalRootNamespace and simplify.
1566 (RootNamespace.Global): Make instance variable.
1567 (RootNamespace.RootNamespace): Add "alias name" parameter.
1568 (GlobalRootNamespace): Simplify drastically.
1569 (Namespace.Lookup): Don't use GetNamespace.
1570 * typemanager.cs (GetRootNamespace): Rename from
1571 ComputeNamespaceForAlias.
1572 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
1574 2005-10-23 Marek Safar <marek.safar@seznam.cz>
1576 * anonymous.cs (AnonymousContainer): Don't crash when container
1579 2005-10-23 Marek Safar <marek.safar@seznam.cz>
1581 * expression.cs (Binary.DoResolve): Warn when comparing same
1584 2005-10-23 Marek Safar <marek.safar@seznam.cz>
1587 * expression.cs (Binary.DoResolve): It looks like there are no
1588 convetsion rules in enum context.
1590 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1592 Add support for extern alias qualifiers.
1593 * typemanager.cs: Move some LookupTypeReflection code
1594 to namespace.cs, to have cleaner code. Added some methods
1595 to help us keep track of the extern aliased references.
1596 * driver.cs: Add suport for extern alias assemblies on command
1597 line and check for their warnings/errors. Also keep track of the
1598 extern aliased assemblies.
1599 * namespace.cs: Move the global functionality of Namespace
1600 to GlobalRootNamespace/RootNamespace. Now the global namespace
1601 is GlobalRootNamespace.Globa. Also the code moved from
1602 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
1603 Finally added LocalAliasEntry (AliasEntry before) and
1604 ExternAliasEntry, to handle alias statements.
1605 * cs-parser.jay: Add support in the grammar for extern alias
1607 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
1608 Update callings to Namespace (now in GlobalRootNamespace).
1610 2005-10-18 Raja R Harinath <rharinath@novell.com>
1613 * class.cs (TypeContainer.DefineType): Move updating of
1614 topological sort earlier in the code.
1615 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
1617 2005-10-18 Marek Safar <marek.safar@seznam.cz>
1620 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
1622 * constant.cs (Constant.TryReduce): Moved from Cast class.
1623 (Reduce): Made little bit more OO and fixed missing conversions.
1625 * ecore.cs (Reduce): Implemented.
1626 (Binary.EnumLiftUp): New method to upgrade values to enum values.
1628 * literal.cs (Reduce): Implemented.
1630 * class.cs: Reverted Miguel's wrong commit.
1632 2005-10-14 Miguel de Icaza <miguel@novell.com>
1634 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
1636 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
1638 * cs-parser.jay, expression.cs : CS0214 was missing error location
1639 for constants. Fixed bug #76404.
1641 2005-10-11 Marek Safar <marek.safar@seznam.cz>
1644 * convert.cs (ExplicitConversionCore): Fixed object->enum
1647 2005-10-10 Raja R Harinath <rharinath@novell.com>
1649 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
1651 (PropertyExpr.EmitCall): Likewise.
1652 * expression.cs (Invocation.EmitArguments): Handle case where
1654 (Invocation.EmitCall): Avoid allocating temporary variable if
1655 there are no arguments.
1657 2005-10-07 Raja R Harinath <rharinath@novell.com>
1660 * convert.cs (ImplicitConversionStandard): Move conversion of
1661 void* to arbitrary pointer types ...
1662 (ExplicitConversionStandard): .. here.
1663 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
1664 error to always print typenames.
1666 2005-10-07 Raja R Harinath <rharinath@novell.com>
1668 * convert.cs (GetConversionOperator): Rename from
1669 GetConversionOperators. Move operator selection code from ...
1670 (UserDefinedConversion): ... here.
1672 2005-10-06 Marek Safar <marek.safar@seznam.cz>
1674 * convert.cs (ExplicitConversionCore): Removed duplicate enum
1677 2005-10-05 Marek Safar <marek.safar@seznam.cz>
1679 * assign.cs (Assign.DoResolve): Error method changed.
1681 * cfold.cs (DoConstantNumericPromotions): Error method changed.
1683 * const.cs (ResolveValue): Reset in_transit immediately.
1685 * constant.cs: Error method changed.
1687 * convert.cs: Removed useless location parameter.
1688 (ExplicitNumericConversion): Don't do double enum check.
1689 (ExplicitConversionCore): Renamed from ExplicitConversion.
1690 (ExplicitUnsafe): Extracted from ExplicitConversion.
1691 (ExplicitConversion): Uses for error reporting.
1693 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
1695 (ResolveBoolean): Uses common error method.
1696 (CastToDecimal): Get rid of ec.
1697 (CastFromDecimal): Optimized.
1698 (ConvCast): Get rid of ec.
1700 * enum.cs (ResolveValue): Reset in_transit immediately.
1701 (Emit): Return after first error.
1703 * expression.cs: Convert changes.
1705 * literal.cs: Error method changed.
1707 * statement.cs: Error method changed.
1709 2005-10-03 Raja R Harinath <rharinath@novell.com>
1711 * support.cs (SeekableStreamReader.Position): Don't error out when
1712 the requested position is just beyond the end of the current
1715 2005-09-28 Raja R Harinath <rharinath@novell.com>
1717 * support.cs (SeekableStreamReader): Simplify drastically. Don't
1718 try to keep in sync with the byte count of the underlying Stream.
1719 However, this limits us to a window size of 2048 characters: i.e.,
1720 the maximum lookahead of our lexer/parser can be 2048 characters.
1722 2005-09-28 Marek Safar <marek.safar@seznam.cz>
1725 * driver.cs: Fix compilation files with full root path.
1727 2005-09-25 Miguel de Icaza <miguel@novell.com>
1729 * report.cs (SymbolRelatedToPreviousError): Format the output so
1730 it does not use an open parenthesis that is never closed.
1732 * driver.cs: Follow coding guidelines
1734 2005-09-27 Marek Safar <marek.safar@seznam.cz>
1737 * const.cs (Const.ResolveValue): Check for assigning non-null
1738 value to reference type.
1740 2005-09-27 Marek Safar <marek.safar@seznam.cz>
1742 * anonymous.cs: Implemented ExprClassName.
1744 * assign.cs (Assign.DoResolve): Don't chrash when type is not
1747 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
1750 * class.cs (StaticClass.DefineContainerMembers): Report protected
1753 * codegen.cs: if(ed) PRODUCTION.
1755 * convert.cs (Error_CannotImplicitConversion): Better error
1758 * cs-parser.jay: More error checks.
1760 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
1762 * driver.cs (CSCParseOption): Enabled wrong option check.
1764 * ecore.cs (Expression.ExprClassName): Turned to property.
1765 (MemberExpr.CheckIntermediateModification): For checking boxed
1766 value types modification.
1768 * statement.cs (Fixed.Resolve): Expression type must be
1769 convertible to fixed type.
1770 (CollectionForeach.GetEnumeratorFilter,TryType):
1771 Small refactoring for easier error checking.
1773 2005-09-26 Marek Safar <marek.safar@seznam.cz>
1775 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
1778 * class.cs (GeneratedBaseInitializer): New class for customization
1779 compiler generated initializers.
1780 (MemberBase.DoDefine): Check Obsolete attribute here.
1781 (FieldMember.DoDefine): Ditto.
1783 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
1786 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
1787 (MemberCore.GetObsoleteAttribute): Removed argument.
1788 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
1789 (MemberCore.CheckObsoleteType): New helper.
1793 * statement.cs: Updates after MemberCore changes.
1795 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
1796 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
1798 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
1799 obsolete attribute for compiler construct.
1800 (As.DoResolve): Cache result.
1802 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
1804 2005-09-26 Raja R Harinath <rharinath@novell.com>
1807 * expression.cs (This.VerifyFixed): In a value type T, the type of
1808 'this' is T&, iow, 'this' is either an out or ref parameter. In a
1809 value type R, 'this' is treated as a value parameter.
1811 2005-09-22 Miguel de Icaza <miguel@novell.com>
1813 * statement.cs (Lock): Use the TemporaryVariable class instead of
1814 manually using local variables as those do not work when variables
1817 * ecore.cs: Moved the TemporaryVariable class from being a nested
1818 class inside Foreach to be a public class that can be employed in
1821 2005-09-19 Marek Safar <marek.safar@seznam.cz>
1823 * cs-parser.jay: interface_accessors replaced by
1824 accessor_declarations.
1826 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
1829 * statement.cs (GotoCase.Resolve): Convert null constant to
1831 (SwitchLabel.ResolveAndReduce): Ditto.
1832 (SwitchLabel.NullStringCase): Custom null stamp.
1833 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
1835 typemanager.cs (CSharpSignature): Don't skip first argument
1838 2005-09-18 Miguel de Icaza <miguel@novell.com>
1840 * driver.cs: Set InEmacs based on the environment variable EMACS.
1842 * location.cs (InEmacs): in this mode, do not report column
1843 location as it confuses Emacs.
1845 2005-09-16 Marek Safar <marek.safar@seznam.cz>
1847 * cfold.cs, constant.cs, convert.cs, ecore.cs,
1848 expression.cs, iterators.cs, literal.cs: Store constants and
1851 * class.cs (MemberBase.ShortName): Pass location.
1853 * cs-parser.jay: Some location fixes.
1855 * ecore.cs (Expression.Location): Made virtual.
1857 2005-09-05 Miguel de Icaza <miguel@novell.com>
1859 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
1860 if the underlying types are the same, otherwise we need to produce
1861 code that will do the proper cast.
1863 This was exposed by Marek's constant rewrite which produced
1864 invalid code for the call site:
1867 void Method (X v) {}
1871 This fixes test-49.cs
1873 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
1875 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
1876 Type/Object should be allowed as well. Fixed bug #75968.
1878 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
1880 * expression.cs : (Binary.DoResolve): when one is enum constant and
1881 another is constant 0, then return enum one *as enum type*.
1884 2005-09-02 Raja R Harinath <rharinath@novell.com>
1886 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
1890 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
1891 flow-branching for LocalVariableReferences in case we were invoked
1892 from a MemberAccess.
1893 * expression.cs (LocalVariableReference.VerifyAssigned): New.
1895 (LocalVariableReference.DoResolveBase): ... this.
1896 (MemberAccess.Resolve): Do the check that was disabled during
1899 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
1902 (PartialContainer.Create): check abstract/sealed/static strictly
1903 but abstract/sealed can exist only at one side. Fixed bug #75883.
1905 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
1908 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
1909 specified, don't default to UnmanagedType.I4.
1911 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
1913 * expression.cs : conditional operator should check possibly
1914 incorrect assign expression. Fixed bug #75946.
1916 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
1918 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
1919 Reverting the change. gmcs is much complex than mcs on this matter.
1921 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
1923 * cs-tokenizer.cs : To read another token ahead of the actual
1924 consumption, use new SavedToken and cache token instead of moving
1925 back the stream with SeekableStreamReader (it seemed problematic).
1927 driver.cs : Thus use StreamReader directly.
1928 * support.cs : Thus removed SeekableStreamReader.
1930 2005-08-30 Raja R Harinath <rharinath@novell.com>
1933 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
1934 (ScopeInfo.EmitScopeType): Use it to construct field names from
1935 names of captured locals.
1938 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
1939 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
1940 Pass 'target_type' to BoxedCast. Don't default to 'object'.
1941 (ExplicitConversion): Remove enum cases already handled by
1942 implicit conversion. Move implicit conversion check to the beginning.
1943 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
1944 * expression.cs (ArrayCreation.EmitDynamicInitializers):
1945 Don't treat System.Enum as a struct.
1947 2005-08-30 Jb Evain <jbevain@gmail.com>
1949 * attribute.cs: handles as expression in parameters.
1951 2005-08-30 Raja R Harinath <rharinath@novell.com>
1954 * class.cs (TypeContainer.VerifyClsName): Don't use a
1955 PartialContainer when verifying CLS compliance.
1956 (AbstractPropertyEventMethod): Set Parent here, ...
1957 (PropertyMethod): ... not here.
1959 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
1961 * attribute.cs : escaped attribute name should not be allowed to be
1962 resolved (e.g. @class as classAttribute). Fixed bug #75930.
1964 2005-08-29 Raja R Harinath <rharinath@novell.com>
1967 * convert.cs (ImplicitStandardConversionExists): Allow zero also
1968 when converting a long constant to unsigned long.
1969 * expression.cs (Invocation.OverloadResolve): Add sanity check to
1970 detect where IsApplicable and VerifyArgumentsCompat disagree.
1972 2005-08-29 Raja R Harinath <rharinath@novell.com>
1973 and Carlos Alberto Cortez <carlos@unixmexico.org>
1976 * class.cs (TypeContainer.CanElideInitializer): New helper.
1977 (TypeContainer.EmitFieldInitializers): Use it to determine if we
1978 can safely emitting the initializer of a field.
1980 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
1982 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
1983 allowed inside a switch (without loop). Fixed bug #75433.
1985 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
1987 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
1988 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
1990 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
1992 * driver.cs : kinda reverting the default encoding changes (not exact
1993 revert since I noticed that "codepage:reset" might not work fine).
1995 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
1997 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
1998 Location. Now getter and setter store location correctly.
1999 (errors/cs0111-12.cs now reports the expected location.)
2001 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2003 * driver.cs : Use default encoding on the environment.
2004 Removed (now that) extra parameter for SeekableStreamReader.
2005 * support.cs : (SeekableStreamReader) third .ctor() argument for
2006 StreamReader is not required (always true). preamble size could
2007 be acquired in simpler and safe way.
2009 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
2011 * cs-parser.jay: report CS0642 at warning level 3
2012 and report CS0642 for an if else statement also
2013 fixes bug #74745. Patch by John Luke (and a bit
2015 Removed extra CS0642 warning check for "while",
2017 * statement.cs: In Block.Resolve(), CS0642 check
2018 is reimplemented to check a sequence of an empty
2019 statement and a block.
2021 Both fix bug #66777.
2023 2005-08-24 Marek Safar <marek.safar@seznam.cz>
2025 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2026 detection until I fix it.
2028 * cs-tokenizer.cs: Changed error message.
2030 * cs-parser.jay: Fixed 2 error locations.
2032 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2033 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2036 * enum.cs (GetSignatureForError): Fixed.
2038 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2042 * typemanager.cs (RegisterProperty): Removed.
2044 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2046 2005-08-24 Raja R Harinath <rharinath@novell.com>
2049 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2050 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2052 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2054 * expression.cs : tiny fix is required for not warning positive ulong.
2057 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2059 * expression.cs : add CS0652 check for constant and integral
2060 expression. Fixed bug #53974.
2062 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2064 * expression.cs : in DoNumericPromotions(), check if there is implicit
2065 conversion overload for string (to check CS0034). Fixed bug #52492.
2067 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2069 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2071 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2073 * ecore.cs : report location when it is *not* Null.
2075 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2081 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2082 correctly. Fixed bug #75721.
2084 2005-08-23 Raja R Harinath <rharinath@novell.com>
2086 * support.cs (SeekableStreamReader.Position): Avoid an expensive
2087 loop that performs 'min (pos, char_count)'.
2090 * expression.cs (Unary.ResolveOperator): Don't discard implicit
2091 converted value in Operator.OnesComplement.
2093 2005-08-22 Ben Maurer <bmaurer@ximian.com>
2095 * anonymous.cs: If the anon method is pulled into a helper class,
2096 it needs to be `internal' not `private'. Fixes runtime behavior on
2099 2005-08-20 Martin Baulig <martin@ximian.com>
2101 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2102 scope if we don't already have it.
2104 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2105 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2108 2005-08-17 Marek Safar <marek.safar@seznam.cz>
2111 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2114 2005-08-16 Marek Safar <marek.safar@seznam.cz>
2116 The big constants rewrite
2117 Fix #75746, #75685 and more
2118 As a side effect saved 1MB for MWF ;-)
2120 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2121 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2122 enum based for corlib compilation.
2124 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2127 * class.cs (FixedField.Define): Use ResolveAsConstant.
2129 * const.cs (IConstant): Interface constants and enums.
2130 (Const.ResolveValue): New method for constant resolvning.
2131 (ExternalConstant): Constants from imported assemblies.
2133 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2134 conversion; like enums.
2135 (Constant.ToType): Converts this constant to different type.
2136 (Constant.Increment): Adds 1.
2138 * convert.cs (ImplicitConversionRequired): Simplified.
2140 * cs-parser.jay: Create EnumMember directly.
2142 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
2144 * doc.cs (GenerateEnumDocComment): Removed.
2146 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
2147 (ConvertIntLiteral): Removed.
2148 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
2150 * enum.cs (EnumMember): Implement IConstant.
2151 (Enum.IsValidEnumConstant): Removed.
2152 (Enum.GetNextDefaultValue): Removed.
2153 (Enum.FindMembers): Updated.
2154 (Enum.GenerateDocComment): Iterate enum members.
2156 * expression.cs (Cast.TryReduce): Handle enums correctly.
2157 (New.Constantify): Made public.
2158 (MemberAccess.DoResolve): Removed contant specific if(s).
2160 * literal.cs (NullLiteral): Implement new abstract methods.
2162 * statement.cs (GotoCase.Resolve): Use new constant methods.
2163 (SwitchLabel.ResolveAndReduce): Use new constant methods.
2165 * typemanager.cs (LookupEnum): Removed.
2166 (IsEnumType): Fixed to work with corlib.
2167 (RegisterConstant): Removed.
2168 (LookupConstant): Removed.
2169 (GetConstant): Changed to work with IConstant.
2171 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
2173 * location.cs : Fixed overflown (>255) column number.
2175 2005-08-03 Raja R Harinath <rharinath@novell.com>
2177 First cut of the qualified-alias-member feature.
2178 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
2180 * cs-parser.jay (DOUBLE_COLON): New token.
2181 (namespace_or_type_name): Add rule for recognizing
2182 qualified-alias-members.
2183 (primary_expression): Likewise.
2184 (element_access): Allow QualifiedAliasMember as a possible
2185 type-bearing expression.
2186 (local_variable_type, local_variable_pointer_type): Likewise.
2187 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
2188 aliases in the current and enclosing namespace declarations.
2189 (NamespaceEntry.UsingAlias): Add CS0440 warning.
2190 * decl.cs (MemberName.is_double_colon): New.
2191 (MemberName.MemberName): Add new constructor for alias-member.
2192 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2193 * expression.cs (QualifiedAliasMember): New expression type.
2195 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2197 * location.cs : it borked when no argument was specified.
2199 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2201 * location.cs : tiny ToString() format fix.
2203 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2205 * statement.cs : oops, it was missing.
2207 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2209 A set of fixes for precise line/column location.
2212 "token" field now holds a file/line "delta", a line number offset
2213 from the segment, and a column number. See also:
2214 http://lists.ximian.com/pipermail/mono-devel-list/2004-
2215 December/009508.html
2216 Removed static IsNull. Use instance IsNull property instead.
2218 For some tokens it stores Location. For Identifier it stores
2219 LocatedToken which is a pair of string name and location.
2220 Column numbers are adjusted only at getChar().
2222 Use Location.ToString() for reporting (it now contains column).
2224 Largely modified to use LocatedToken instead of
2225 string (IDENTIFIER), and to acquire Location from some tokens.
2226 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2227 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2229 Now MemberName holds Location. DeclSpace.ctor() receives Location
2230 as a parameter. Removed extra parameters to all derived classes.
2231 Replaced Location.IsNull() with instance property.
2232 * assign.cs, expression.cs :
2233 Added .ctor() overload that omits Location.
2235 Added "nameEscaped" flag that indicates the identifier was escaped
2236 in the source file. This fixes bug #57047.
2238 2005-08-02 Marek Safar <marek.safar@seznam.cz>
2240 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2241 New method, looking for lo-case imported cls type.
2243 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2246 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2248 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2250 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2252 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2254 Optimized to save 3.5 MB for SWF compilation.
2256 2005-08-01 Marek Safar <marek.safar@seznam.cz>
2258 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2259 (PartialContainer.Create): Moved logic AddToContainer.
2260 (PartialContainer.MarkForDuplicationCheck): Shares name.
2262 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2265 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
2267 (Namespace.GetSignatureForError): New method.
2269 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
2270 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
2272 2005-08-01 Raja R Harinath <rharinath@novell.com>
2275 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
2276 member lookup rather than qualifier_type, since qualifier_type can
2279 2005-08-01 Marek Safar <marek.safar@seznam.cz>
2281 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
2284 2005-07-31 Miguel de Icaza <miguel@novell.com>
2286 * statement.cs: Copy the local exception into the exception
2287 captured local. Fixes 75674
2289 2005-07-31 Raja R Harinath <harinath@gmail.com>
2292 * expression.cs (Invocation.OverloadResolve): Don't report error
2293 CS1501 if error CS1502 has been reported.
2294 (New.DoResolve): Delegate CS1501 reporting to
2295 Invocation.OverloadResolve.
2298 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
2299 invariant-meaning-in-block property in an enclosing block if
2302 2005-07-29 Marek Safar <marek.safar@seznam.cz>
2304 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
2305 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
2306 (Switch.CheckSwitch): Just save 50kb for SWF.
2308 2005-07-27 Martin Baulig <martin@ximian.com>
2310 * anonymous.cs (CaptureContext.AddField): Added
2311 `AnonymousContainer am' argument; compute its toplevel scope if
2312 it's not already computed. Fixes #75649.
2314 2005-07-26 Raja R Harinath <rharinath@novell.com>
2317 * class.cs (Constructor.Emit): Reset block to null if the block
2320 2005-07-25 Marek Safar <marek.safar@seznam.cz>
2322 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
2324 2005-07-25 Marek Safar <marek.safar@seznam.cz>
2326 * class.cs (MethodData.Define): Check whether accessor implementing
2327 interface is public.
2329 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
2331 2005-07-22 Marek Safar <marek.safar@seznam.cz>
2334 * namespace.cs (LookupType): Moved same type check to...
2336 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
2339 2005-07-21 Raja R Harinath <rharinath@novell.com>
2341 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
2342 already found a typebuilder.
2343 * class.cs (MethodCore.IsDuplicateImplementation): Compare
2344 MemberNames, not strings.
2346 * const.cs (Error_ExpressionMustBeConst):
2347 Rename from Error_EpressionMustBeConst.
2348 * const.cs, class.cs, statement.cd: Update.
2350 2005-07-21 Marek Safar <marek.safar@seznam.cz>
2354 * const.cs (Const.LookupConstantValue): Report missing contant expression
2356 (Error_EpressionMustBeConstant): Only one error method.
2358 * class.cs, statement.c: Updated.
2360 2005-07-20 Raja R Harinath <rharinath@novell.com>
2362 * statement.cs (Block.Flags): Add back HasVarargs.
2363 (Block.flags): Make protected.
2364 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
2366 * typemanager.cs (types, typecontainers, user_types): Remove.
2367 (UserTypes, TypeContainers): Likewise.
2368 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
2369 (CleanUp, Reset): Update.
2370 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
2371 (GetNestedType): Use Type.GetNestedType.
2372 (CoreLookupType): Take two arguments, the namespace and the
2373 basename of the type. Update to use the Namespace.Lookup
2375 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
2376 (RealMemberLookup): Use IsNestedChildOf instead of playing with
2377 string concatenation and substring matches.
2378 * class.cs, enum.cs, delegate.cs: Update to changes.
2380 2005-07-20 Marek Safar <marek.safar@seznam.cz>
2382 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
2383 Expression and made virtual.
2385 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
2386 (ImplicitStandardConversionExists): Fixed `byte' typo ?
2388 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
2390 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
2393 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
2396 2005-07-18 Marek Safar <marek.safar@seznam.cz>
2399 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
2400 AssemblyCultureAttribute is not used on executable.
2403 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
2405 2005-07-16 Raja R Harinath <rharinath@novell.com>
2408 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
2409 New. Reports CS0252/CS0253.
2410 Mostly taken from preliminary patch by Duncak Mak.
2411 (Binary.DoResolveOperator): Store results of operator lookup.
2412 Use them to detect if we need to warn about unintended reference
2415 2005-07-15 Raja R Harinath <rharinath@novell.com>
2418 * namespace.cs (Namespace.Lookup): Add back location parameter.
2419 (Namespace.LookupType): Add CS0436 report. Add location parameter.
2420 * delegate.cs, ecore.cs, expression.cs: Update to changes.
2422 * codegen.cs (EmitContext.DeclSpace): Make readonly.
2423 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
2424 (Namespace.LookupType): ... this.
2425 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
2427 * typemanager.cs (LookupTypeReflection): Remove buggy code that
2428 purported to handle pointers.
2429 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
2432 2005-07-15 Marek Safar <marek.safar@seznam.cz>
2434 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2437 2005-07-15 Raja R Harinath <rharinath@novell.com>
2439 * namespace.cs (Namespace.Lookup): Drop location parameter.
2440 (NamespaceEntry.LookupAlias): Remove. Merge into ...
2441 (NamespaceEntry.Lookup): ... this.
2442 (NamespaceEntry.Error_AmbiguousTypeReference):
2443 Move here from DeclSpace.
2444 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
2446 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
2447 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
2448 Move to NamespaceEntry.
2449 * delegate.cs, expression.cs: Update to changes.
2451 2005-07-14 Marek Safar <marek.safar@seznam.cz>
2453 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
2454 CheckAttributeType and refactored.
2455 (Attribute.ResolvePossibleAttributeType): Changed to reuse
2456 ResolveAsTypeTerminal error handling.
2457 (ResolveAsTypeTerminal): Introduced because of global attributes extra
2459 (GetSignatureForError): Print errors in same way.
2462 * codegen.cs: Reflect attribute GetSignatureForError change.
2465 * expression.cs: Add silent parameter to ResolveAsTypeStep.
2467 * namespace.cs (UsingEntry): Refactored to make fields private.
2470 statement.cs: Error_UnexpectedKind has extra parameter.
2472 2005-07-14 Raja R Harinath <rharinath@novell.com>
2474 * ecore.cs (IAlias): Remove.
2475 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
2476 that implement the interface.
2477 * namespace.cs (Namespace): Likewise.
2478 (Namespace.declspaces): Renamed from 'defined_names'.
2479 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
2480 DeclSpace instead of an IAlias.
2481 * tree.cs (Tree.AddDecl): Update.
2483 2005-07-12 Raja R Harinath <rharinath@novell.com>
2485 * statement.cs (Block.Flags); Remove HasVarargs.
2486 (Block.HasVarargs): Move to ToplevelBlock.
2487 (Block.ThisVariable, Block.AddThisVariable): Likewise.
2488 (Block.Variables): Make protected. Initialize variable hashtable
2490 (Block.AddVariable): Update.
2491 (Block.Resolve): Update to changes.
2492 (ToplevelBlock.HasVarargs): New boolean.
2493 (ToplevelBlock.ThisVariable): Move here from Block.
2494 (ToplevelBlock.AddThisVariable): Likewise.
2495 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
2496 * expression.cs (This.ResolveBase): Update to changes.
2497 (ArglistAccess.DoResolve): Likewise.
2499 2005-07-11 Marek Safar <marek.safar@seznam.cz>
2502 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
2504 * class.cs (TypeContainer.VerifyMembers): Distinguish between
2505 not used and not used & assigned.
2506 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
2508 2005-07-11 Marek Safar <marek.safar@seznam.cz>
2511 * expression.cs (Is.DoResolve): null is never provided type.
2513 2005-07-08 Marek Safar <marek.safar@seznam.cz>
2516 * cs-parser.jay: Less strict event error rule to catch more errors.
2518 2005-07-08 Martin Baulig <martin@ximian.com>
2520 Fix test-iter-10.cs - distinguish whether we `yield' in a property
2521 gettter (allowed) or setter (not allowed).
2523 * class.cs (Accessor): Implement IIteratorContainer.
2524 (Accessor.Yields): New public field.
2525 (PropertyBase.PropertyMethod.Define): Handle iterators on a
2529 (get_accessor_declaration, set_accessor_declaration): Set the
2530 `yields' flag on the accessor, not the property.
2531 (property_declaration): Do the iterators check on a per-accessor
2532 basis and not for the whole property.
2534 2005-07-08 Martin Baulig <martin@ximian.com>
2536 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
2537 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
2539 2005-07-07 Marek Safar <marek.safar@seznam.cz>
2542 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
2543 (ExtractSecurityPermissionSet): Cope with self referencing security
2544 attributes properly.
2546 * driver.cs (SetOutputFile): Made public property OutputFile.
2548 2005-07-07 Raja R Harinath <rharinath@novell.com>
2551 * class.cs (TypeContainer.first_nonstatic_field): Rename from
2552 has_nonstatic_fields. Make into a FieldBase pointer.
2553 (TypeContainer.AddField): Add CS0282 check.
2554 (TypeContainer.EmitType): Update.
2556 2005-07-06 Miguel de Icaza <miguel@novell.com>
2558 * cs-tokenizer.cs (consume_identifier): Do not create strings to
2559 compare if they start with __.
2561 2005-07-06 Raja R Harinath <rharinath@novell.com>
2563 * statement.cs (Switch.SwitchGoverningType): Only look at
2564 UserCasts that don't need implicit standard conversions to one of
2565 the allowed switch types (Fixes test-322.cs).
2566 (LocalInfo.Resolve): Re-enable sanity-test.
2568 2005-07-06 Marek Safar <marek.safar@seznam.cz>
2570 * cs-tokenizer.cs (consume_identifier): Detect double undescores
2572 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
2574 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
2576 2005-07-06 Raja R Harinath <rharinath@novell.com>
2579 * ecore.cs (SimpleName.GetSignatureForError): Add.
2580 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
2581 (MemberAccess.GetSignatureForError): Add.
2583 2005-07-05 Marek Safar <marek.safar@seznam.cz>
2585 The big error and warning messages review.
2615 * typemanager.cs: Updated.
2617 * class.cs: (MethodCore.SetYields): Moved here to share.
2618 (PropertyMethod.Define): Moved iterator setup here.
2620 * iterators.cs: Add orig_method to have full access to parent
2623 2005-07-05 Raja R Harinath <rharinath@novell.com>
2625 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
2626 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
2627 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
2628 variable of struct type.
2629 * expression.cs (Unary.ResolveOperator): Update to change.
2630 (Indirection.VerifyFixed): Likewise.
2631 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
2632 (ParameterReference.VerifyFixed): Value parameters are fixed.
2633 (This.VerifyFixed): Treat 'this' as a value parameter.
2634 * statement.cs (LocalInfo.IsFixed): Remove.
2636 2005-07-01 Martin Baulig <martin@ximian.com>
2638 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
2639 `ec.EmitThis ()' to get the correct scope.
2641 2005-07-01 Martin Baulig <martin@ximian.com>
2643 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
2644 instance is a ParameterReference; fixes #75299.
2646 2005-07-01 Martin Baulig <martin@ximian.com>
2648 Reverted Marek's latest patch (r46725):
2649 - it contains structural changes which are neither mentioned in
2650 the ChangeLog nor explained anywhere; for example the additional
2651 argument of EmitContext's and Iterator's .ctor's and the
2652 TypeContainer.DefineMembers() change.
2653 - structural changes like this should go in in seperate patches
2654 and not be hidden in a huge patch which just seems to affect
2655 warnings and errors.
2656 a big and hard to understand patch.
2657 - it breaks iterators and causes regressions, for instance in
2660 2005-06-30 Raja R Harinath <rharinath@novell.com>
2663 * expression.cs (Indexers.map): Remove.
2664 (Indexers.Append): Filter out inaccessible setters and getters.
2665 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
2668 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
2670 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
2671 (FieldExpr.Emit, PropertyExpr.Emit): Update.
2672 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
2673 * expression.cs (Invocation.EmitCall): Add CS0120 check.
2675 2005-06-30 Marek Safar <marek.safar@seznam.cz>
2678 * class.cs (FieldBase.GetInitializerExpression): One more field
2681 2005-06-28 Miguel de Icaza <miguel@novell.com>
2683 * pending.cs: Do not define a proxy if the base method is virtual,
2684 it will be picked up by the runtime (bug 75270).
2686 2005-06-08 Martin Baulig <martin@ximian.com>
2688 The big Iterators rewrite :-)
2690 * iterators.cs: Rewrite this to use the anonymous methods framework.
2692 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
2693 before the TypeContainers; see 2test-21.cs.
2696 (TypeContainer.DefineType): Don't create a new EmitContext if we
2697 already have one (this only happens if we're an Iterator).
2698 (TypeContainer.Define): Also call Define() on all our iterators.
2699 (Method.CreateEmitContext): Added support for iterators.
2702 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
2703 (AnonymousContainer.CreateMethodHost): Moved here from
2704 AnonymousMethod and made abstract.
2705 (AnonymousContainer.CreateScopeType): New abstract method.
2706 (AnonymousContainer.IsIterator): New public property.
2707 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
2708 get the ScopeTypeBuilder rather than manually defining it here.
2709 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
2712 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
2713 before RootContext.DefineTypes().
2715 * codegen.cs (EmitContext.RemapToProxy): Removed.
2716 (EmitContext.CurrentAnonymousMethod): Changed type from
2717 AnonymousMethod -> AnonymousContainer.
2718 (EmitContext.ResolveTopBlock): Protect from being called twice.
2719 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
2720 (EmitContext.EmitThis): Removed the iterators hacks; use the
2721 anonymous methods framework for that.
2724 (ToplevelBlock.Container): Make this a property, not a field.
2725 (ToplevelBlock.ReParent): New public method; move the
2726 ToplevelBlock into a new container.
2727 (Foreach.TemporaryVariable): Simplify.
2729 2005-06-05 Martin Baulig <martin@ximian.com>
2731 * statement.cs (LocalInfo.CompilerGenerated): New flag.
2732 (Block.AddTemporaryVariable): New public method; creates a new
2733 `LocalInfo' for a temporary variable.
2734 (Block.EmitMeta): Create the LocalBuilders for all the temporary
2736 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
2737 non-iterator variables.
2739 2005-06-05 Martin Baulig <martin@ximian.com>
2741 * statement.cs (Foreach.TemporaryVariable): Create the
2742 LocalBuilder in the Emit phase and not in Resolve since in some
2743 situations, we don't have an ILGenerator during Resolve; see
2744 2test-19.cs for an example.
2746 2005-06-04 Martin Baulig <martin@ximian.com>
2748 **** Merged r45395 from GCS ****
2750 The big Foreach rewrite - Part II.
2752 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
2753 with `PropertyInfo ienumerator_getcurrent'.
2755 * codegen.cs (VariableStorage): Removed.
2758 (Foreach): Derive from Statement, not ExceptionStatement.
2759 (Foreach.CollectionForeach): New nested class. Moved all the code
2760 dealing with collection foreach here.
2761 (Foreach.ForeachHelperMethods): Removed.
2762 (Foreach.TemporaryVariable): Implement IMemoryLocation.
2764 2005-05-23 Martin Baulig <martin@ximian.com>
2766 * statement.cs (Try.DoResolve): Don't create a `finally' if we
2767 don't need to. Fix #75014.
2769 2005-05-20 Martin Baulig <martin@ximian.com>
2771 Merged r44808 from GMCS.
2773 * class.cs (TypeContainer.CircularDepException): Removed.
2774 (TypeContainer.DefineType): Removed the `InTransit' stuff.
2775 (TypeContainer.CheckRecursiveDefinition): Check for circular class
2776 (CS0146) and interface (CS0529) dependencies here.
2778 2005-06-21 Raja R Harinath <rharinath@novell.com>
2780 * expression.cs (Invocation.EmitCall): Fix initialization
2781 'this_call' to reflect current behaviour. Fix indentation.
2783 * convert.cs (FindMostEncompassedType): Add two trivial special
2784 cases (number_of_types == 0 || number_of_types == 1).
2785 (FindMostEncompasingType): Likewise.
2787 2005-06-17 Raja R Harinath <rharinath@novell.com>
2789 Some cleanups preparing for the fix of #75283.
2790 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
2792 (EventExpr.InstanceResolve): Likewise.
2793 (EventExpr.DoResolve): Remove redundant checks.
2795 2005-06-10 Duncan Mak <duncan@novell.com>
2797 * cs-tokenizer.cs (process_directives): New flag for controlling
2798 the processing of preprocessor directives.
2799 (x_token): After seeing a '#', return Token.NONE instead of going
2800 to handle_preprocessing_directive() when not processing
2801 directives. This avoids unnecessary processing during the token peek in
2806 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
2807 the existing error reporting methods instead of Report.Error.
2809 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
2810 after Raja's rewrite.
2812 2005-06-08 Miguel de Icaza <miguel@novell.com>
2814 * class.cs: Small fix.
2816 2005-06-08 Raja R Harinath <rharinath@novell.com>
2819 * class.cs (GetPartialBases): Fix return value check of
2822 2005-06-07 Raja R Harinath <rharinath@novell.com>
2824 Ensure that partial classes are registered in their enclosing
2825 namespace. Initial part of fix of #75160.
2826 * tree.cs (Tree.RecordDecl): Add new namespace argument.
2827 Register declspace with namespace here, not in
2828 DeclSpace.RecordDecl.
2829 * cs-parser.jay: Pass namespace to RecordDecl.
2830 * class.cs (PartialContainer.Create): Likewise.
2831 (ClassPart.DefineType): New sanity-check. Throws an exception if
2833 * decl.cs (Declspace.RecordDecl): Remove.
2834 * namespace.cs (NamespaceEntry.DefineName): Remove.
2836 2005-06-06 Marek Safar <marek.safar@seznam.cz>
2838 * rootcontext.cs: Reset TargetExt as well.
2840 2005-06-03 Raja R Harinath <rharinath@novell.com>
2842 * ecore.cs (Expression.Resolve): Emit CS0654 error when
2845 2005-06-02 Raja R Harinath <rharinath@novell.com>
2847 Fix #75080, cs0119.cs.
2848 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
2850 (Expression.Resolve): ... this. Use it. Remove bogus code
2851 allowing ExprClass.Type and ExprClass.Namespace for
2852 ResolveFlags.VariableOrValue.
2853 (Expression.Resolve) [1-argument variant]: Change default resolve
2854 flags based on language version.
2855 (Expression.Error_UnexpectedKind): Use a simple string array
2856 rather than an ArrayList.
2857 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
2859 (TypeOfVoid.DoResolve): Likewise.
2860 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
2861 flags argument -- it always has the same value.
2863 2005-05-31 Raja R Harinath <rharinath@novell.com>
2866 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
2867 Use it in the error message.
2868 * assign.cs, expression.cs, statement.cs: Update.
2870 2005-05-30 Raja R Harinath <rharinath@novell.com>
2873 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
2874 the "almostMatchedMember" case too.
2875 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
2876 that failed the accessibility checks to 'almost_match'.
2878 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
2880 * attribute.cs: Use internal MethodBuilder methods to set
2881 ExactSpelling and SetLastError on PInvoke methods, instead
2882 of passing them via charset. Fixes #75060.
2884 2005-05-27 Raja R Harinath <rharinath@novell.com>
2886 * parameter.cs (Parameter): Remove TODO comment.
2887 (Parameter.DefineParameter): Remove Location parameter.
2888 (Parameters.LabelParameters): Likewise.
2889 * class.cs (Constructor.Emit): Update to change.
2890 (MethodData.Emit): Likewise.
2891 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
2892 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
2894 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
2897 Removed Parameters.Location and added Parameter.Location instead.
2898 Removed Location parameter from Emit() and GetSignature().
2905 Modified all related calls.
2907 2005-05-26 Raja R Harinath <rharinath@novell.com>
2909 Improve user-defined conversion handling.
2910 * convert.cs (GetConversionOperators): Rewrite. Return only the
2911 applicable operators.
2912 (AddConversionOperators): New. Helper for GetConversionOperators.
2913 (FindMostEncompassedType, FindMostEncompassingType): Verify that
2914 there is only one most encompassed/encompassing type.
2915 (FindMostSpecificSource, FindMostSpecificTarget): Remove
2916 "applicable operator" handling.
2917 (UserConversion): Move cache here from GetConversionOperators.
2918 Directly cache the chosen operator, rather than the whole
2920 (ExplicitNumericConversion): Fix buggy implementation of Decimal
2921 case. Allow conversion of decimal to sbyte and byte too.
2922 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
2923 New static methods. Used to avoid allocating EmptyExpressions in
2926 2005-05-24 Duncan Mak <duncan@novell.com>
2928 * ecore.cs (CastFromDecimal): New class for casting a decimal to
2929 another class, used in Convert.ExplicitNumericConversion.
2930 (CastToDecimal): New class, similar to above, but casts to
2931 System.Decimal, used in Convert.ImplicitNumericConversion and also
2932 in explicit convesion from double/float to decimal.
2934 * convert.cs (ImplicitNumericConversion): Handle implicit
2935 conversions to System.Decimal.
2936 (ExplicitNumericConversion): handle explicit conversions to
2941 2005-05-20 Miguel de Icaza <miguel@novell.com>
2943 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
2944 know the type at this stage, just break through. Fixes #75008
2946 2005-05-19 Martin Baulig <martin@ximian.com>
2949 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
2950 to disable error reporting.
2952 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
2953 here since we don't want to report an error; see the new test-336.cs.
2955 2005-05-19 Raja R Harinath <rharinath@novell.com>
2957 * statement.cs (ToplevelBlock.GetParameterReference)
2958 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
2959 Move here from class Block.
2960 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
2961 * expression.cs (ParameterReference.DoResolveBase): Likewise.
2963 2005-05-18 Martin Baulig <martin@ximian.com>
2968 (FlowBranching.Reachability): Add non-static public And() and Or()
2970 (FlowBranchingSwitch): New class; do the `break_origins' thing
2971 like in FlowBranchingLoop.
2972 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
2973 reachability, not just locals and parameters.
2974 (FlowBranching.MergeChild): Remove some of the hacks for loop and
2975 switch; MergeBreakOrigins() now takes care of that.
2977 2005-05-18 Martin Baulig <martin@ximian.com>
2979 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2980 a loop and may leave it, reset the barrier; fixes #74974.
2982 2005-05-17 Marek Safar <marek.safar@seznam.cz>
2984 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
2987 * cs-parser.jay: Catch more lexical errors.
2989 * report.cs: Add one more Error method.
2992 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
2994 2005-05-17 Martin Baulig <martin@ximian.com>
2996 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
2999 2005-05-16 Raja R Harinath <rharinath@novell.com>
3001 Fix test-382.cs. Emit values of decimal constants.
3002 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3004 (TypeContainer.AddField): ... this.
3005 (TypeContainer.EmitFieldInitializers): Allow the list of fields
3006 with initializers to include 'Const's.
3007 (ClassPart.RegisterFieldForInitialization): Forward to
3009 * const.cs (Const.Const): Pass initializer to base class.
3010 (Const.Define): In case of decimal constants, register them for
3011 initialization in a static constructor.
3013 2005-05-14 Martin Baulig <martin@ximian.com>
3015 * statement.cs (Block.Resolve): Correctly handle unreachable code;
3016 do not call ResolveUnreachable() on unreachable statements in
3017 here, see the comment in the source code.
3019 2005-05-13 Raja R Harinath <rharinath@novell.com>
3022 * expression.cs (BinaryResolveOperator): If one of the operands of
3023 an equality comparison is 'null' and the other is a pointer type,
3024 convert the null to a NullPointer.
3025 * convert.cs (ImplicitReferenceConversion): If the expression is a
3026 NullLiteral and the target type is a pointer type, return a
3027 NullPointer instead.
3028 (ImplicitConversionStandard): Likewise.
3030 2005-05-13 Marek Safar <marek.safar@seznam.cz>
3032 * cs-parser.jay: Set readonly context based on special constructs.
3034 * expression.cs (LocalVariableReference.DoResolveBase): Improved
3035 readonly variable error handling.
3037 * rootcontext.cs (EmitCode): Don't verify members when error
3040 * statement.cs (LocalInfo): Add reaodnly context information.
3041 (SetReadOnlyContext, GetReadOnlyContext): New methods.
3043 2005-05-13 Raja R Harinath <rharinath@novell.com>
3045 * statement.cs (Block.Resolve): Revert change below. Modify fix
3046 for #74041 to initialize 'resolved' to false only for explicit
3047 blocks. Fixes #74873.
3049 2005-05-12 Raja R Harinath <harinath@gmail.com>
3052 * typemanager.cs (unmanaged_enclosing_types): New.
3053 (IsUnmanagedType): Avoid infloops by using
3054 'unmanaged_enclosing_types' to talk with recursive invocations.
3056 2005-05-13 Martin Baulig <martin@ximian.com>
3058 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3059 instance variable, not a local. Fix #74873.
3060 (Block.ResolveUnreachable): Set it to true here.
3062 2005-05-11 Duncan Mak <duncan@novell.com>
3064 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3065 continuing to process for 'arg'.
3066 (handle_preprocessing_directive): Check the argument of the #endif
3067 directive and report error CS1025 if there are any trailing
3070 According to the C# spec, having even whitespace after the #endif
3071 directive is illegal; however, because we call arg.TrimEnd ()
3072 beforehand, we have the same behavior as csc, allowing whitespace
3073 after the directive.
3077 2005-05-11 Marek Safar <marek.safar@seznam.cz>
3081 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3082 (Constructor.GetObsoleteAttribute): Implemented correctly.
3084 2005-05-10 Martin Baulig <martin@ximian.com>
3086 * support.cs (ReflectionParameters.ParameterModifier): Use
3087 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3088 and `ParameterAttributes.In'. Fixes #74884.
3090 2005-05-10 Marek Safar <marek.safar@seznam.cz>
3092 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3094 * expression.cs (Argument.GetParameterModifier): Turned to property.
3095 (Invocation.Error_InvalidArguments): Add more descriptive errors.
3097 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3100 2005-05-09 Raja R Harinath <rharinath@novell.com>
3103 * decl.cs (MemberCache.AddMethods): Register override methods,
3104 rather than non-override methods.
3105 * typemanager.cs (RegisterOverride): New.
3106 (IsOverride): Update.
3108 2005-05-09 Marek Safar <marek.safar@seznam.cz>
3112 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3113 recursive declaration.
3115 * statement.cs (Block.ResolveMeta): Report any error in resolving.
3117 2005-05-06 Marek Safar <marek.safar@seznam.cz>
3119 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3121 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3123 2005-05-05 Raja R Harinath <rharinath@novell.com>
3126 * decl.cs (DeclSpace.FamilyAccessible):
3127 Use TypeManager.IsNestedFamilyAccessible.
3129 Fix reopened #64812.
3130 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3133 2005-05-04 Raja R Harinath <rharinath@novell.com>
3134 Abin Thomas <projectmonokochi@rediffmail.com>
3135 Anoob V E <projectmonokochi@rediffmail.com>
3136 Harilal P R <projectmonokochi@rediffmail.com>
3139 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
3140 allow access to all static members.
3142 2005-05-04 Martin Baulig <martin@ximian.com>
3144 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
3146 2005-05-04 Martin Baulig <martin@ximian.com>
3150 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
3151 section at the end; make things work if `default' is not the last
3154 2005-05-04 Martin Baulig <martin@ximian.com>
3158 * statement.cs (Switch): Replaced the `got_default' field with a
3159 `default_section' one.
3160 (Switch.CheckSwitch): Set `default_section' here.
3161 (Switch.Resolve): If we're a constant switch and the constant is
3162 not found, use the default section.
3164 2005-05-03 Martin Baulig <martin@ximian.com>
3166 * expression.cs (ArrayAccess.EmitGetLength): New public method.
3168 * statement.cs (Foreach.ArrayForeach): New nested class.
3169 (Foreach.TemporaryVariable): New nested class.
3170 (Foreach.EmitArrayForeach): Removed; this is now in the new
3173 2005-05-03 Raja R Harinath <rharinath@novell.com>
3175 * pending.cs (BaseImplements): Move the #74773 fix here. This is
3177 (VerifyPendingMethods): Revert change below.
3179 * typemanager.cs (IsOverride, RegisterNonOverride): New.
3180 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
3181 that used to trigger warning -28. Remove warning -28.
3182 * expression.cs (Invocation.OverloadResolve): Use
3183 TypeManager.IsOverride to distinguish override methods.
3186 * pending.cs (VerifyPendingMethods): If a base type implements the
3187 requested interface, don't bother checking individual methods of
3188 the base type. As a side-effect, this prevents the creation of
3189 unnecessary proxies.
3191 2005-05-02 Martin Baulig <martin@ximian.com>
3195 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3196 Also `And' the locals if the old vector is null.
3197 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
3198 null; in this case we basically reset all the variables.
3200 2005-05-02 Martin Baulig <martin@ximian.com>
3204 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
3205 Added `FlowBranching branching' argument; always `and' the
3206 variables instead of `or'ing them unless we're an infinite loop.
3208 * statement.cs (While.Resolve): Create a new sibling unless we're
3211 2005-05-02 Martin Baulig <martin@ximian.com>
3215 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
3216 arguments; use it instead of creating a new TopLevelBlock.
3217 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
3218 our ConstructorInitializer.
3221 (TopLevelBlock.TopLevelBranching): New public property.
3222 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
3223 and create our `TopLevelBranching'.
3225 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
3226 anonymous method host, use `block.TopLevelBranching' rather than
3227 creating a new branching.
3229 2005-04-20 Miguel de Icaza <miguel@novell.com>
3231 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
3232 a ScopeInfo, if any of the current children is a child of the new
3233 entry, move those children there.
3235 2005-04-30 Martin Baulig <martin@ximian.com>
3237 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
3238 at the beginning of a SwitchSection. Fix #73335.
3240 2005-04-27 Marek Safar <marek.safar@seznam.cz>
3243 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
3245 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
3246 (FieldExpr.DoResolve): Obsolete members are ignored for field
3249 2005-04-26 Marek Safar <marek.safar@seznam.cz>
3251 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
3252 of arrays detection.
3254 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
3256 (Field.VerifyClsCompliance): Volatile fields are not compliant.
3258 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
3261 2005-04-25 Ben Maurer <bmaurer@ximian.com>
3263 * cs-parser.jay: Use the prefered version of -unsafe in error
3266 2005-04-22 Marek Safar <marek.safar@seznam.cz>
3268 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
3271 2005-04-20 John Luke <john.luke@gmail.com>
3273 * driver.cs: fix typo in error message, --outout to --output
3275 2005-04-20 Marek Safar <marek.safar@seznam.cz>
3277 * codegen.cs (InRefOutArgumentResolving): New field.
3279 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
3280 fields outside contructor.
3282 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
3284 2005-04-19 Miguel de Icaza <miguel@novell.com>
3286 * anonymous.cs (CaptureContext.EmitParameterInstance): The
3287 parameter code was not completed ever, so it was not as up-to-date
3288 as local variables. Must finish it.
3290 The bug fix was to compare the Toplevel of the block, not the
3291 current block. Thanks for Ben for pointing this out.
3293 2005-04-19 Raja R Harinath <rharinath@novell.com>
3295 * decl.cs (AddMethods): Use the declaring type of the problem
3296 method to determine if we want to squash a warning.
3298 2005-04-19 Marek Safar <marek.safar@seznam.cz>
3300 * attribute.cs: Removed debug output.
3302 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
3304 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
3307 2005-04-18 Raja R Harinath <rharinath@novell.com>
3310 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
3311 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
3312 all null comparisons against reference types.
3314 2005-04-18 Marek Safar <marek.safar@seznam.cz>
3317 * class.cs (TypeContainer.CircularDepException) New nested
3319 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
3320 (TypeContainer.DefineType): Removed error, reset InTransit before
3322 (Class.DefineType): Throw exception when is in Transit.
3323 Catch exception and report error.
3324 (Struct.DefineType): Throw exception when is in Transit.
3325 Catch exception and report error.
3326 (Interface.DefineType): Throw exception when is in Transit.
3327 Catch exception and report error.
3329 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
3330 handle nested exception handlers.
3332 * flowanalysis.cs (InTryWithCatch): New method, search for try with
3335 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
3336 InFinally and InCatch storage.
3338 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
3339 (Catch.Resolve): Set and Restore ec.InCatch.
3340 (Try.Resolve): Set and Restore ec.InFinally.
3341 (Try.HasCatch): True when try has catch.
3343 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
3345 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
3346 for the same event member, so exclude such cases from warning 419.
3349 2005-04-16 Miguel de Icaza <miguel@novell.com>
3351 * expression.cs (Binary.ResolveOperator): Apply patch from John
3352 Luke to fix bug 59864: operators &, | and ^ on enumerations
3353 require that the same enum type on both sides.
3355 * driver.cs: Add warnings to old flag usage, this is to assist
3356 people who produce Makefiles and hope that the Makefiles will be
3359 * class.cs (TypeContainer.EmitType): Moved the definition of the
3360 special $PRIVATE$ field from the resolve phase to the Emit phase.
3361 During resolve we do not know if we are a struct with
3362 HasExplicitLayout, we know this only after the attributes for the
3365 Set the FieldOffset to zero on the dummy field that we create for
3366 the class. Fixes 74590.
3368 2005-04-16 Raja R Harinath <rharinath@novell.com>
3371 * ecore.cs (PropertyExpr.resolved): New.
3372 (DoResolve): Use it to handle a case of double resolution here.
3373 Handle a case of identical-name-and-type-name.
3374 * expression.cs (ArrayCreation.CheckIndices): Avoid double
3375 resolution by storing the results of expression resolution back
3376 into the "probes" array.
3378 2005-04-15 Raja R Harinath <rharinath@novell.com>
3380 Fix cs0208-7.cs and cs0208-8.cs.
3381 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
3382 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
3383 error reporting to point out the reason a struct is not unmanaged.
3385 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
3387 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
3388 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
3390 2005-04-13 Raja R Harinath <rharinath@novell.com>
3393 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
3394 IdenticalNameAndTypeName here.
3395 (EventExpr.InstanceResolve): Likewise.
3397 2005-04-13 Marek Safar <marek.safar@seznam.cz>
3399 C# 2.0 DefaultCharSetAttribute implementation
3401 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
3402 which allows us to set GlobalNamespace for every resolve.
3403 (Attribute.ResolveArguments): Cut from Resolve.
3404 (Attribute.GetCharSetValue): Returns CharSet named argument.
3405 (Attribute.DefinePInvokeMethod): Gets default charset from
3407 (GlobalAttribute.ResolveAsTypeStep): Override.
3408 (GlobalAttribute.ResolveArguments): Override.
3410 * class.cs (TypeAttr): Is protected.
3412 * codegen.cs (ModuleClass.DefaultCharSet): New member.
3413 (ModuleClass.DefaultCharSetType): New memeber.
3414 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
3416 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
3417 charset from module.
3419 * delegate.cs (TypeAttr): Override.
3420 (Delegate.DefineType): Use this TypeAttr.
3422 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
3423 at very early stage (before types are defined) to resolve model
3424 module attributes. It will probably not work with corlib but it
3427 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
3428 charset from module.
3430 * typemanager.cs (default_charset_type): New type.
3432 2005-04-13 Raja R Harinath <rharinath@novell.com>
3434 * decl.cs (MemberCache.AddMethods): Don't warn if
3435 System.Object.Finalize has buggy MethodAttributes.
3437 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
3440 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
3442 * doc.cs : detect ambiguous reference to overloaded members.
3443 Fixed bug #71603. MS 1.1 csc does not detect it.
3445 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
3447 * doc.cs : delegates must not be referenced with parameters.
3450 2005-04-12 Miguel de Icaza <miguel@novell.com>
3452 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
3454 2005-04-10 Miguel de Icaza <miguel@novell.com>
3456 * driver.cs (MainDriver): Stop processing if the CLS stage found
3459 (CompilerCallableEntryPoint.InvokeCompiler): Always
3460 reset after execution; Take a TextWriter argument for the
3463 * report.cs: Use the error stream instead of hardcoding stderr.
3465 2005-04-09 Miguel de Icaza <miguel@novell.com>
3467 * class.cs: Reduce code paths to test, too small of an
3468 optimization to make it worth the extra testing. Always perform
3471 2005-04-08 Raja R Harinath <rharinath@novell.com>
3474 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
3475 operators that had errors reported on them.
3477 2005-04-08 Marek Safar <marek.safar@seznam.cz>
3479 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
3481 (Attribute.Resolve): Add named argument type checking.
3483 * class.cs (FixedField.Define): Use IsPrimitiveType
3485 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
3487 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
3488 unsafe parameter types.
3490 * statement.cs (Using.ResolveExpression): Add better error description.
3492 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
3494 2005-04-08 Raja R Harinath <rharinath@novell.com>
3497 * attribute.cs (Attribute.GetAttributeUsage): Resolve
3498 AttributeUsageAttribute in the emitcontext of the attribute class,
3499 not in the emitcontext of the attributable entity it was attached to.
3500 * cs-parser.jay: Use 'current_class', not 'current_container',
3501 when creating a GlobalAttribute.
3503 2005-04-08 Alp Toker <alp@atoker.com>
3505 * pending.cs: The fix to #58413 failed to compile methods implementing
3506 interfaces with/without params modifiers and vice versa, even though
3507 params modifiers aren't part of the signature. Make the modifier check
3508 less strict as in csc.
3510 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
3511 Anoob V E <projectmonokochi@rediffmail.com>
3512 Harilal P R <projectmonokochi@rediffmail.com>
3515 * pending.cs (TypeAndMethods.mods): New. Store the parameter
3516 modifiers of pending methods.
3517 (PendingImplementation.PendingImplementation): Initialize it.
3518 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
3519 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
3520 with ParameterData. Add check for modifiers.
3521 * class.cs (MethodData.Define): Update to changes.
3523 2005-04-07 Raja R Harinath <rharinath@novell.com>
3525 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
3527 2005-04-07 Marek Safar <marek.safar@seznam.cz>
3529 * class.cs (PropertyMethod.Define): Check private accessor in abstract
3532 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
3535 * typemanager.cs: Registered RequiredAttributeAttribute.
3537 2005-04-06 Marek Safar <marek.safar@seznam.cz>
3539 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
3540 Warning CS0169 is back at level 3.
3541 (IMethodData.SetMemberIsUsed): New method.
3543 * decl.cs (IsUsed): New value; moved from FieldBase.Status
3544 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
3546 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
3548 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
3550 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
3553 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
3556 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
3557 to avoid the problems with nested types.
3559 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
3560 Anoob V.E <projectmonokochi@rediffmail.com>
3561 Harilal P.R <projectmonokochi@rediffmail.com>
3562 Raja R Harinath <rharinath@novell.com>
3565 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
3567 * typemanager (GetConstructor): Make public.
3569 2005-04-05 John Luke <john.luke@gmail.com>
3570 Raja R Harinath <rharinath@novell.com>
3573 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
3574 struct too. Return false quicker in a few cases.
3575 (VerifyUnManaged): Use it.
3577 2005-04-05 Raja R Harinath <rharinath@novell.com>
3580 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
3581 not 'unreachable_seen'.
3583 2005-04-04 Marek Safar <marek.safar@seznam.cz>
3585 * attribute.cs (Attribute.GetValue): Removed unused.
3587 * codegen.cs (CodeGen.TrimExt): Removed unused.
3589 * cs-parser.jay (output): Removed unused.
3591 * cs-tokenizer.cs (hex_digits): Removed unused.
3593 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
3595 * expression.cs (Indirection.LoadExprValue): Removed unused.
3596 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
3598 * iterators.cs (Iterator.param_types): Removed unused.
3600 * statement.cs (Goto.block): Removed unused.
3601 (ToplevelBlock.did): Removed unused.
3602 (Switch.ResolveConstantSwitch): Removed unused.
3604 2005-04-01 Ben Maurer <bmaurer@ximian.com>
3606 * rootcontext.cs: Allow mcs to bootstrap with the compilation
3609 2005-04-01 Raja R Harinath <rharinath@novell.com>
3611 Fix #74232 and cs0208-3.cs.
3612 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
3613 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
3614 unmanaged type. Don't use FieldBuilders when 't' is a
3615 TypeBuilder. Use ModFlags and MemberType fields.
3616 * class.cs (MemberBase.member_type): Rename from MemberType.
3617 (MemberBase.MemberType): New property. Determines member_type on
3619 (MemberBase.DoDefine): Don't initialize MemberType here.
3620 (FieldMember.Define): Likewise.
3622 2005-04-01 Marek Safar <marek.safar@seznam.cz>
3625 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
3626 Attributes are emitted there.
3628 2005-04-01 Raja R Harinath <rharinath@novell.com>
3630 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
3631 keyword in 'partial enum' too.
3632 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
3634 Report from Kamil Skalski <nazgul@omega.pl>.
3637 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
3638 have partial containers too.
3640 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
3641 in block' checks to Block.CheckInvariantMeaningInBlock.
3642 * statement.cs (Block.GetKnownVariableInfo): Make private.
3643 (Block.IsVariableUsedInChildBlock): Remove.
3644 (Block.IsVariableUsedInBlock): Likewise.
3645 (Block.CheckInvariantMeaningInBlock): New. Show location of
3646 conflicting declaration.
3647 (Block.AddVariable): Make error messages less long-winded and more
3648 specific. Show location of conflicting declaration.
3649 * parameter.cs (Parameters.Location): New readonly property.
3651 2005-03-31 Raja R Harinath <rharinath@novell.com>
3653 Clean up semantics of invoking ResolveMemberAccess.
3654 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
3655 can have an instance, ensure that we pass in a non-TypeExpression
3656 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
3657 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
3658 argument. Update to changes and simplify.
3659 (FieldExpr.Emitinstance): Remove CS0120 check.
3660 (PropertyExpr.EmitInstance): Likewise.
3661 * expression.cs (Argument.Resolve): Likewise.
3662 (Invocation.DoResolve): Update to changes in semantics of
3665 2005-03-31 Marek Safar <marek.safar@seznam.cz>
3668 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
3671 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
3673 2005-03-31 Raja R Harinath <rharinath@novell.com>
3675 Fix difference in behaviour with commandline invocation.
3676 * driver.cs (Driver.Reset): New.
3677 (CompilerCallableEntryPoint): Call it.
3679 * statement.cs (If.Resolve): Avoid spurious "uninitialized
3680 variable" warnings if the boolean expression failed to resolve.
3682 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
3684 * attribute.cs: Fix the union of several permissions when some of them
3685 are unrestricted (so the result isn't an unrestricted permission set).
3688 2005-03-30 Raja R Harinath <rharinath@novell.com>
3690 * ecore.cs (MemberExpr): New class. Convert from interface
3692 (MemberExpr.ResolveMemberAccess): Refactor and move here from
3693 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
3695 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
3696 (MethodGroupExpr.IsExplicitImpl): Remove.
3697 (Expression.GetFieldFromEvent): Remove.
3698 (SimpleName.MemberStaticCheck): Remove.
3699 (SimpleName.DoSimpleNameResolve): Update to changes.
3700 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
3701 (MemberAccess.IdenticalNameAndTypeName): Remove.
3702 (MemberAccess.error176): Move to MemberExpr.
3703 (MemberAccess.DoResolve): Update to changes.
3704 (BaseAccess.DoResolve): Likewise.
3706 2005-03-30 Marek Safar <marek.safar@seznam.cz>
3708 C# 2.0 Conditional attribute class implementation
3710 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
3711 Analyzes class whether it has attribute which has ConditionalAttribute
3712 and its condition is not defined.
3714 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
3715 (Class.IsExcluded): New method. Search for at least one defined
3716 condition in ConditionalAttribute of attribute class.
3718 2005-03-30 Raja R Harinath <rharinath@novell.com>
3720 * ecore.cs (PropertyExpr): Derive from Expression, not
3721 ExpressionStatement.
3722 (PropertyExpr.EmitStatement): Remove.
3724 2005-03-29 Raja R Harinath <rharinath@novell.com>
3727 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
3728 internal field "value__" of an enum be private. The examples for
3729 "value__" that I found on MSDN all used FieldAttributes.Private.
3731 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
3732 Don't mention IL method attribute names.
3734 Fix #47991. Remove a TODO.
3735 * statement.cs (Block.Toplevel): Make into a field.
3736 (Block.Parameters): Move into ToplevelBlock.
3737 (Block.known_variables): Rename from child_variable_names.
3738 (Block.Block): Remove variants that take Parameters. Initialize
3739 'Toplevel' with the immediately surrounding toplevel block.
3740 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
3741 LocalInfo parameter.
3742 (Block.GetKnownVariableInfo): New.
3743 (Block.IsVariableNameUsedInChildBlock): Update.
3744 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
3745 the block, even though it may not be in scope.
3746 (Block.AddVariable): Remove Parameters parameter. Use
3747 Toplevel.Parameters instead.
3748 (Block.AddConstant): Remove Parameters parameter.
3749 (Block.GetParameterReference): Update to use Toplevel.Parameters.
3750 (Block.IsParamaterReference): Likewise.
3751 (Block.IsLocalParameter): Likewise. Simplify a lot.
3752 (ToplevelBlock.Parameters): New. Moved from Block.
3753 (ToplevelBlock.ToplevelBlock): Update to changes. Always
3754 initialize Parameters to a non-null value.
3755 * cs-parser.jay: Update to changes.
3756 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
3757 simple names that mean different things in the same block. Use
3758 Block.IsVariableNameUsedInBlock.
3760 2005-03-28 Raja R Harinath <rharinath@novell.com>
3762 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
3763 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
3764 GetTypeHandle. It is possible for a reflected type to derive from
3765 a TypeBuilder (e.g., int[] derives from the TypeBuilder
3766 System.Array during mscorlib compilation).
3767 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
3768 contain a method_hash, don't create one either. Don't create a
3769 deep copy of the base cache's method_hash.
3770 (MemberCache.SetupCache): Rename back from DeepCopy.
3771 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
3772 already initialized. If we see an override function, add its
3773 underlying base virtual function to the member_hash too.
3775 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
3777 2005-03-26 Raja R Harinath <harinath@acm.org>
3780 * assign.cs (Assign.DoResolve): When the RHS of an assignment
3781 fails to resolve, ensure that the LHS is still resolved as an
3784 2005-03-25 Raja R Harinath <harinath@acm.org>
3786 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
3788 (Enum.current_ec): Remove.
3789 (Enum.LookupEnumValue): Remove EmitContext argument.
3790 Just uses the one created during DefineType.
3791 (Enum.FindMembers): Update.
3792 * expression.cs (MemberAccess.DoResolve): Update.
3794 2005-03-22 Marek Safar <marek.safar@seznam.cz>
3796 * assign.cs (Assign.DoResolve): Check for CS1717 when
3797 source and target are same (uses Equals).
3799 * expression.cs (LocalVariableReference, ParameterReference,
3800 This): Implemented Equals, GetHashCode.
3802 * statement.cs (Block.GetParameterReference): Removed useless
3805 2005-03-22 Raja R Harinath <rharinath@novell.com>
3808 * statement.cs (Block.AddVariable): Ensure that we skip implicit
3809 blocks before deciding whether the error is cs0136 or cs0128.
3811 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
3812 (using_alias_directive, using_namespace_directive): Pass
3813 MemberName, not an expression to Namespace.UsingAlias and
3815 (MakeName): Use the MemberName of the namespace.
3816 * namespace.cs (Namespace.MemberName): New.
3817 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
3818 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
3820 * decl.cs (MemberName.Name): Make readonly.
3821 (MemberName.FromDotted): New "constructor".
3822 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
3823 (MemberCore.Name): Compute from MemberName on demand.
3824 (MemberCore.SetMemberName): Provide a way to change the
3826 (MemberCore.AddToContainer): Don't take a fullname parameter.
3827 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
3828 fully qualified name of the container to the member name.
3829 (TypeContainer.AddToTypeContainer): Use a fully qualified name
3830 only if the type is a member of the root container.
3831 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
3832 MemberName.Left rather than searching for an embedded ".".
3833 (PartialContainer.CreatePart): Update to changes in RootContext.
3834 (MemberBase.ShortName): Turn into a property. Use
3835 MemberCore.SetMemberName.
3836 (MemberBase.ExplicitInterfaceName): Remove.
3837 (MemberBase.UpdateMemberName): Remove.
3838 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
3839 (PropertyBase.SetMemberName): New override.
3840 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
3841 (Tree.GetDecl): New.
3842 (Tree.AllDecls): Rename from Decls.
3843 * attribute.cs, enum.cs, report.cs: Update to changes.
3844 * driver.cs (MainDriver): Use MemberName.FromDotted on
3845 RootContext.MainClass.
3847 2005-03-21 Marek Safar <marek.safar@seznam.cz>
3849 * class.cs (FixedField.Define): Check for CS1664 and more sanity
3852 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
3854 2005-03-18 Marek Safar <marek.safar@seznam.cz>
3856 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
3857 property accessor modifiers.
3859 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
3860 fixed buffer attribute (CS1716).
3861 (PropertyMethod.HasCustomAccessModifier): When property accessor
3862 has custom modifier.
3864 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
3866 (PropertyExpr.DoResolveLValue): Add CS0272.
3868 2005-03-17 Miguel de Icaza <miguel@novell.com>
3870 * convert.cs: When converting to a pointer, use the proper Conv.U
3871 or Conv.I depending on the source data type.
3873 * cs-tokenizer.cs: Make the size for large decimal constants,
3876 2005-03-17 Martin Baulig <martin@ximian.com>
3878 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
3879 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
3881 2005-03-17 Martin Baulig <martin@ximian.com>
3883 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
3884 to bool so we can return an error condition.
3885 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
3888 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
3890 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
3893 2005-03-16 Raja R Harinath <rharinath@novell.com>
3895 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
3896 Refactor to avoid traversing the list of assemblies, and to avoid
3897 string concatenation.
3898 * typemanager.cs (guid_attr_type): Remove.
3899 (negative_hits, pointers, references): Remove hashes.
3901 (GetConstructedType): New. Uses type_hash to handle constructed
3902 types (arrays, references, pointers).
3903 (GetReferenceType, GetPointerType): Use it.
3904 (GetNestedType): New. Uses type_hash to handle nested types of
3906 (LookupType, LookupTypeDirect): Remove.
3907 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
3908 'types' hash and LookupTypeReflection directly.
3909 (params_string, params_object): Use GetConstructedType.
3910 * namespace.cs (Namespace.cached_types): New. Cache of reflected
3912 (Namespace.Lookup): Use cached_types.
3913 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
3914 provided by old TypeManager.LookupType.
3915 * rootcontext.cs (MakeFQN): Remove.
3916 * decl.cs (DeclSpace.MakeFQN): Likewise.
3917 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
3918 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
3919 TypeManager.GetConstructedType.
3920 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
3922 2005-03-15 Marek Safar <marek.safar@seznam.cz>
3924 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
3927 * cs-parser.jay: Reports CS1527 for any namespace element.
3929 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
3932 * expression.cs (ParameterReference.IsAssigned): Changed error to
3934 (Error_WrongNumArguments): Moved CS0245 detection here.
3936 * statement.cs (Return.Resolve): Add CS1622 report.
3938 2005-03-11 Marek Safar <marek.safar@seznam.cz>
3940 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
3942 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
3944 * attribute.cs expression.cs: Get rid of some allocations.
3946 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
3948 * doc.cs : just eliminate the latest change.
3950 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
3952 * doc.cs : commented out the latest change. It breaks xml-030.cs
3954 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
3956 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
3957 fail. So invoke CreateType() in FindDocumentedType().
3959 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
3961 * cs-tokenizer.cs : added IsKeyword().
3962 * doc.cs : Detect keyword incorrectly used as identifier.
3963 Allow identifiers prefixed by @.
3965 2005-03-10 Marek Safar <marek.safar@seznam.cz>
3967 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
3968 It caused exception in namespace resolving (again!).
3970 * class.cs (Class.ctor): Removed exit.
3971 (PropertyMethod.ctor): ditto.
3973 * codegen.cs (Codegen.Reset): Reset static data.
3974 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
3976 * cs-tokenizer.cs (Cleanup): Removed.
3978 * driver.cs (GetSystemDir): Rewrote to one line command.
3979 It caused problem with unloaded dynamic modules.
3980 (UnixParseOption): Removed Exit.
3981 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
3982 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
3983 Now can be mcs used as library.
3985 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
3988 * location.cs (Reset): Reset static data.
3990 * namespace.cs (Reset): Reset static data.
3992 * report.cs (Report.Reset): Reset static data.
3994 * rootcontext.cs (RootContext.Reset): Reset static data.
3996 * tree.cs (RootTypes.ctor): Use Location.Null
3998 * typemanager.cs (TypeManager.Reset): Reset static data.
3999 (CoreLookupType): Removed Exit.
4000 (TypeHandle.Reset): Reset static data.
4002 2005-03-10 Raja R Harinath <rharinath@novell.com>
4005 * typemanager.cs (ComputeNamespaces): Import namespaces from
4006 referenced modules too.
4008 2005-03-09 Raja R Harinath <rharinath@novell.com>
4010 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4013 2005-03-09 Raja R Harinath <rharinath@novell.com>
4015 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4016 enclosing DeclSpace. This ensures that a name-lookup populates
4017 more caches and there are fewer 'TypeExpression's. Carve out
4018 nested type lookup into ...
4019 (LookupNestedTypeInHierarchy): ... this.
4021 2005-03-09 Raja R Harinath <rharinath@novell.com>
4023 Clean up a few partial-class semantics.
4024 Fixes test-357.cs and cs1618-2.cs.
4025 * cs-parser.jay (struct_declaration): Use 'current_class' as
4026 parent of newly-created struct. Remove call to Register ().
4027 Use 'pop_current_class' to complete handing the current struct.
4028 (interface_declaration): Likewise.
4029 (class_declaration): Likewise.
4030 (enum_declaration): Use 'current_class' as parent of newly created
4032 (delegate_declaration): Likewise.
4033 (pop_current_class): New function. This is used to handle closing
4034 up the 'current_class' and 'current_container', and pointing them
4035 to the enclosing class/container.
4036 (CSharpParser): Initialize 'current_class' too.
4037 * decl.cs (MemberCore): Add check for invariant: a partial
4038 container is not a parsed entity, and thus does not enclose any
4040 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4041 (DeclSpace.BaseTypeExpr): Use it.
4042 (DeclSpace.LookupType): Add check for invariant.
4043 * class.cs (TypeContainer): Add check for invariant: a nested
4044 class should have the same NamespaceEntry as its enclosing class.
4045 (TypeContainer.EmitFieldInitializers): Make virtual.
4046 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4048 (TypeContainer.Register): Remove.
4049 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4050 null. Use TypeResolveEmitContext for resolving base types and
4051 interfaces. Move initialization of Parts.TypeBuilder here from
4053 (TypeContainer.DefineNestedTypes): ... here.
4054 (PartialContainer): Take a Namespace not a NamespaceEntry.
4055 (PartialContainer.Create): Don't use Register. Call the
4056 appropriate Add... function directly.
4057 (ClassPart): Take both the PartialContainer and the enclosing
4058 class as constructor arguments.
4059 (ClassPart.EmitFieldInitializers): Override.
4060 (ClassPart.PartFindNestedTypes): Remove.
4061 (FieldBase.GetInitializerExpression): Resolve the initializer
4062 expression in the emit context of the enclosing class.
4063 * tree.cs (RootTypes): Remove Register ().
4065 2005-03-08 Marek Safar <marek.safar@seznam.cz>
4067 * cs-parser.jay: Removed CS0134.
4069 * driver.cs: Removed CS1901.
4071 * expression.cs (SizeOf.DoResolve): Don't report CS0233
4072 for predefined types.
4074 2005-03-07 Duncan Mak <duncan@novell.com>
4076 * codegen.cs (Save): Catch UnauthorizedAccessException as
4077 well. Fixes bug #73454.
4079 2005-03-07 Marek Safar <marek.safar@seznam.cz>
4081 * cs-tokenizer.cs (xtoken): Add CS1035.
4083 * class.cs (MethodData.Define): Add CS0683.
4084 (FieldMember.ctor): Add CS0681.
4086 2005-03-07 Raja R Harinath <rharinath@novell.com>
4088 * ecore.cs (SimpleName.DoResolve): Rename from
4089 SimpleName.DoResolveAllowStatic.
4090 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4091 Pass 'intermediate' flag to MemberStaticCheck.
4092 (SimpleName.MemberStaticCheck): Skip "static check" only in case
4093 of "intermediate" lookups via MemberAccess.
4094 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
4095 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4097 2005-03-07 Raja R Harinath <rharinath@novell.com>
4100 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4101 slipped in because of variable names that are identical to a
4102 builtin type's BCL equivalent ('string String;', 'int Int32;').
4103 (PropertyExpr.EmitInstance): Likewise.
4105 2005-03-04 Marek Safar <marek.safar@seznam.cz>
4107 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4109 * report.cs (warning_ignore_table): Made public.
4111 2005-03-04 Raja R Harinath <rharinath@novell.com>
4114 * class.cs (MethodData.Emit): Pass 'container' to
4115 container.GetObsoleteAttribute instead of 'container.Parent'.
4117 2005-03-03 Marek Safar <marek.safar@seznam.cz>
4119 * cs-parser.jay: Add 1534 error test.
4121 * iterators.cs (Yield.CheckContext): Add error 1629.
4122 (Iterator.ctor): Save unsafe modifier.
4123 (MoveNextMethod.DoEmit): Restore unsafe context.
4125 * namespace.cs (UsingAlias): Better error message.
4127 2005-03-03 Dan Winship <danw@novell.com>
4129 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4130 the warning message [#73219]
4132 2005-03-03 Raja R Harinath <rharinath@novell.com>
4134 Fix compile with MCS 1.0.0.0.
4135 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4136 w_restore to not depend on string constant folding.
4138 2005-03-03 Raja R Harinath <rharinath@novell.com>
4140 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
4141 CS0246 check to users who passed 'silent = false'.
4142 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
4144 (SimpleName.SimpleNameResolve): Update.
4145 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
4146 (MemberAccess.IdenticalNameAndTypeName): Update.
4147 * doc.cs (FindDocumentedTypeNonArray): Update.
4149 2005-03-03 Raja R Harinath <rharinath@novell.com>
4151 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
4152 * parameters.cs (ComputeAndDefineParameters): Remove.
4153 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
4154 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
4155 Use GetParameterInfo.
4157 2005-03-02 Marek Safar <marek.safar@seznam.cz>
4159 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
4161 2005-03-02 Raja R Harinath <rharinath@novell.com>
4163 Unify DeclSpace.LookupType and DeclSpace.FindType.
4164 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
4165 is in charge of defining nested types on demand.
4166 (DeclSpace.LookupType): Use it when the current_type is a
4167 TypeBuilder. Use LookupTypeDirect for reflected types.
4168 (DeclSpace.FindType): Remove.
4169 (DeclSpace.LookupInterfaceOrClass): Likewise.
4170 (DeclSpace.DefineTypeAndParents): Likewise.
4171 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
4172 DeclSpace.LookupType.
4173 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
4174 * typemanager.cs (LookupType): Simplify.
4175 (AddUserType): Remove type from negative_hits.
4176 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
4177 * class.cs (TypeContainer.FindMembers): Move handling of nested
4179 (TypeContainer.FindMembers_NestedTypes): ... here.
4180 (TypeContainer.FindNestedType): Implement override.
4181 (ClassPart.FindNestedType): Delegate to PartialContainer.
4182 (ClassPart.PartFindNestedType): Looks up the nested types of the
4185 2005-03-02 Martin Baulig <martin@ximian.com>
4187 * class.cs (TypeContainer.DoDefineMembers): We also need a default
4188 static constructor in static classes.
4190 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
4192 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
4193 sizeParamIndex is not specified.
4195 2005-03-01 Marek Safar <marek.safar@seznam.cz>
4198 * report.cs (WarningMessage.IsEnabled): Missing null check.
4200 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4202 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
4203 in the fields and not in the properties.
4205 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
4207 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
4210 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4212 * attribute.cs: Small refactoring (improved robustness).
4213 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
4214 (ValidateGuid): Removed.
4215 (Resolve): Removed referenced to above mentioned.
4216 (GetAttributeUsage): Made private and changed to work without
4218 (GetIndexerAttributeValue): Don't crash.
4219 (GetConditionalAttributeValue): Ditto.
4220 (GetClsCompliantAttributeValue): Ditto.
4221 (ExtractSecurityPermissionSet): All attributes exceptions are
4223 (GetPropertyValue): New helper.
4224 (GetMethodImplOptions): New method.
4225 (DefinePInvokeMethod): Reuse common code. Implemented handling of
4226 some missing properties.
4228 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
4229 (Method.ApplyAttributeBuilder): Updated.
4231 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
4234 2005-02-28 Raja R Harinath <rharinath@novell.com>
4237 * report.cs (Report.SymbolRelatedToPreviousError): Handle
4238 non-simple types (array, pointer, reference).
4240 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4242 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
4244 * class.cs (MethodCore.IsDuplicateImplementation): Special error
4246 (Method.CheckBase): Catch wrong destructor here.
4247 (MethodData.Define): Add errors 550, 668.
4249 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
4251 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
4253 * pending.cs (VerifyPendingMethods): Add error 551.
4255 * typemanager.cs (CSharpName): Next error report helper.
4257 2005-02-25 Marek Safar <marek.safar@seznam.cz>
4259 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
4260 attributes. Removed useless attribute double check.
4261 It saves almost 2MBs for corlib.
4263 2005-02-25 Raja R Harinath <rharinath@novell.com>
4266 * statement.cs (ExpressionStatement.Resolve): Make robust to being
4267 called twice in case of error.
4269 2005-02-23 Chris Toshok <toshok@ximian.com>
4271 Fix compiler portions of #72827.
4272 * statement.cs (Block.Emit): call Begin/EndScope on the
4273 EmitContext instead of the ILGenerator.
4275 * codegen.cs (EmitContext.BeginScope): new method, call
4276 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
4278 (EmitContext.BeginScope): same, but EndScope and CloseScope
4280 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
4281 offset and call the superclass's OpenScope(int) with it.
4282 (SymbolWriter.CloseScope): get the current il
4283 offset and call superclass's CloseScope(int) with it.
4285 2005-02-23 Marek Safar <marek.safar@seznam.cz>
4287 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
4288 CS1677 for out and ref as well.
4290 * class.cs (Method.Define): Add error CS1599 detection.
4292 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
4294 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
4296 * delegate.cs (Delegate.Define): Add error CS1599 detection.
4298 * support.cs.cs (ModifierDesc): New helper method.
4300 2005-02-23 Raja R Harinath <rharinath@novell.com>
4301 Abin Thomas <projectmonokochi@rediffmail.com>
4302 Anoob V E <projectmonokochi@rediffmail.com>
4303 Harilal P R <projectmonokochi@rediffmail.com>
4306 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
4307 MemberLookup (used for error reporting) actually returns a result.
4308 Fix error report number (122, not 112).
4310 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
4311 Anoob V E <projectmonokochi@rediffmail.com>
4312 Harilal P R <projectmonokochi@rediffmail.com>
4315 * pending.cs (PendingImplementation.GetAbstractMethods):
4316 Find NonPublic members too.
4318 2005-02-22 Marek Safar <marek.safar@seznam.cz>
4320 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
4323 * class.cs (MethodCore.CheckMethodAgainstBase):
4324 Add error 239 report.
4326 2005-02-21 Raja R Harinath <rharinath@novell.com>
4329 * expression.cs (Invocation.IsApplicable): Make public.
4330 (Invocation.IsParamsMethodApplicable): Likewise.
4331 * delegate.cs (Delegate.VerifyApplicability): Don't use
4332 Invocation.VerifyArgumentCompat for parameter applicability
4333 testing. Use Invocation.IsApplicable and
4334 Invocation.IsParamsMethodApplicable.
4336 2005-02-21 Marek Safar <marek.safar@seznam.cz>
4338 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
4340 * class.cs (Operator.Define): Add error 217 report.
4342 2005-02-21 Raja R Harinath <rharinath@novell.com>
4344 * namespace.cs (UsingEntry.Resolve): Undo change below.
4346 2005-02-21 Raja R Harinath <rharinath@novell.com>
4349 * ecore.cs (Expression.MemberLookupFailed): Add argument to
4350 disable the error message when the extended MemberLookup also
4352 (Expression.MemberLookupFinal): Update.
4353 (SimpleName.DoSimpleNameResolve): Update.
4354 * expression.cs (MemberAccess.ResolveNamespaceOrType):
4355 Don't use MemberLookupFinal.
4356 (New.DoResolve): Update.
4357 (BaseAccess.CommonResolve): Update.
4359 2005-02-21 Raja R Harinath <rharinath@novell.com>
4362 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
4363 occured previously, don't resolve again.
4365 2005-02-21 Marek Safar <marek.safar@seznam.cz>
4368 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
4369 argument. Call ResolveAttributeUsage for unresolved.
4370 when types doesn't match ctor arguments.
4372 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
4373 for nested attribute classes.
4374 (Class.attribute_usage): Removed.
4375 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
4376 for attribute class.
4378 * ecore.cs (IsAttribute): Removed.
4380 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
4382 * rootcontext.cs (RegisterAttribute): Removed, attributes are
4384 (attribute_types): Removed.
4385 (EmitCode): Global attributes are emited as the latest.
4387 2005-02-18 Marek Safar <marek.safar@seznam.cz>
4389 * class.cs (EmitFieldInitializers): Don't emit field initializer
4390 for default values when optimilization is on.
4392 * constant.cs (Constant.IsDefaultValue): New property.
4394 * driver.cs: Add /optimize handling.
4398 * literal.cs: Implement new IsDefaultValue property.
4400 * rootcontext.cs (Optimize): New field, holds /optimize option.
4402 2005-02-18 Raja R Harinath <rharinath@novell.com>
4404 Fix crasher in re-opened #72347.
4405 * namespace.cs (Namespace.Lookup): Return null if
4406 DeclSpace.DefineType returns null.
4409 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
4411 2005-02-18 Raja R Harinath <rharinath@novell.com>
4413 Fix remainder of #63202. Change semantics of DoResolveLValue: it
4414 now returns null if it cannot resolve to an lvalue.
4415 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
4416 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
4417 returned null. Remove check for SimpleName.
4418 (EventExpr.DoResolveLValue): New.
4419 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
4420 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
4422 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
4424 (Unary.ResolveOperator): Move CS0211 check ...
4425 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
4427 (Unary.DoResolveLValue): Simplify.
4428 (AddressOf.DoResolveLValue): New.
4429 (ArrayAccess.DoResolveLValue): New.
4431 2005-02-16 Marek Safar <marek.safar@seznam.cz>
4433 * attribute.cs (Attribute.Resolve): Add arguments casting for
4434 when types doesn't match ctor arguments.
4436 2005-02-16 Raja R Harinath <rharinath@novell.com>
4438 Fix parts of #63202.
4439 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
4440 lookup of operator in base type. Ensure that all checks happen
4441 when the operator resolves to an "op_..." method.
4443 2005-02-15 Raja R Harinath <rharinath@novell.com>
4446 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
4447 'ignore_cs0104' parameter. Pass it to ...
4448 (NamespaceEntry.Lookup): ... this.
4449 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
4450 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
4451 (TypeLookupExpression.DoResolveAsTypeStep): Update.
4452 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
4453 Update. Request that cs0104 errors be ignored.
4454 (ComposedCast.ResolveAsTypeStep): Update.
4456 2005-02-14 Raja R Harinath <rharinath@novell.com>
4459 * expression.cs (Invocation.BetterFunction): Remove support for
4460 comparing virtual functions and their overrides.
4461 (Invocation.IsOverride): New.
4462 (Invocation.OverloadResolve): Don't consider 'override' functions
4463 during candidate selection. Store them in a lookaside list.
4464 If the selected method is a 'virtual' function, use the list to
4465 find any overrides that are closer to the LHS type.
4467 2005-02-14 Marek Safar <marek.safar@seznam.cz>
4469 * expression.cs (New.DoResolve): Add complex core type reduction.
4470 (New.Constantify): Converts complex core type syntax like 'new int ()'
4473 2005-02-14 Raja R Harinath <rharinath@novell.com>
4475 * decl.cs (EntryType.EntryType): New constructor to create an
4476 updated copy of a cache entry.
4477 (MemberCache.AddMethods): Use it.
4478 (MemberCache.ClearDeclaredOnly): Remove.
4479 (MemberCache.MemberCache): Update.
4481 2005-02-11 Miguel de Icaza <miguel@novell.com>
4483 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
4484 variable. This one is represents the actual low-level declaration
4485 of the method, as opposed to the semantic level `IsStatic'.
4487 An anonymous method which is hosted into a static method might be
4488 actually an instance method. IsStatic would reflect the
4489 container, while MethodIsStatic represents the actual code
4492 * expression.cs (ParameterReference): Use the new MethodIsStatic
4493 instead of IsStatic.
4495 * anonymous.cs (AnonymousMethod.Compatible): Pass the
4496 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
4497 set on the current EmitContext.
4499 * expression.cs (Cast): Overload DoResolveLValue so we can pass
4500 resolve our casted expression as an LValue. This triggers the
4501 proper LValue processing that is later required by Assign.
4505 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
4507 2005-02-11 Marek Safar <marek.safar@seznam.cz>
4509 C# 2.0 Fixed buffer implementation
4511 * anonymous.cs: Update after RegisterHelperClass renaming.
4513 * attribute.cs (AttributeTester.fixed_buffer_cache):
4514 Cache of external fixed buffers.
4515 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
4516 implementation if field is fixed buffer else null.
4519 (TypeContainer.AddField): Accept FieldMember instead of Field.
4520 (FieldBase.IsFieldClsCompliant): Extracted code from
4521 VerifyClsCompliance descendant customization.
4522 (FixedField): New class handles fixed buffer fields.
4523 (FixedFieldExternal): Keeps information about imported fixed
4525 (IFixedField): Make access to internal or external fixed buffer
4528 * cs-parser.jay: Add fixed buffer parsing.
4530 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
4533 * expression.cs (Indirection): Extended implementation to accept
4535 (PointerArithmetic.Emit): Get element from fixed buffer as well.
4536 (ElementAccess.MakePointerAccess): Get type as parameter.
4537 (DoResolve): Add fixed buffer field expression conversion.
4538 (DoResolveLValue): Ditto.
4539 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
4540 (ArrayPtr): Derives from FixedBufferPtr.
4541 (ArrayPtr.Emit): Add extra emit for array elements.
4543 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
4545 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
4546 for compiler generated types.
4547 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
4549 * statement.cs (Fixed): Refactored to be easier add fixed buffer
4550 and consume less memory.
4551 (Fixed.Resolve): Add fixed buffer case.
4553 * typemanager.cs (compiler_generated_attr_ctor,
4554 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
4555 (HasElementType): Add our own implementation to work on every
4558 2005-02-11 Miguel de Icaza <miguel@novell.com>
4560 * anonymous.cs (CaptureContext): Track whether `this' has been
4563 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
4564 only captured `this' if it was implicitly done (instance
4565 methods/variables were used).
4567 * codegen.cs (EmitContext.CaptureThis): New method to flag that
4568 `this' must be captured.
4570 2005-01-30 Miguel de Icaza <miguel@novell.com>
4572 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
4573 is null it means that there has been no need to capture anything,
4574 so we just create a sibling.
4576 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
4578 Just a partial fix. The other half is fairly elusive.
4580 2005-02-10 Raja R Harinath <rharinath@novell.com>
4582 Fix #52586, cs0121-4.cs.
4583 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
4584 and return a hashtable.
4585 (MemberCache.ClearDeclaredOnly): New.
4586 (MemberCache.MemberCache): Update to change. Make a deep copy of
4587 the method_hash of a base type too.
4588 (MemberCache.AddMethods): Adapt to having a deep copy of the base
4589 type methods. Overwrite entries with the same MethodHandle so
4590 that the ReflectedType is correct. The process leaves in base
4591 virtual functions and their overrides as distinct entries.
4592 (CacheEntry): Now a class instead of a struct. It shouldn't alter
4593 matters since it was boxed in a ArrayList before.
4594 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
4596 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
4597 case of a virtual function and its override (choose the overload
4599 (Invocation.OverloadResolve): Avoid 'override' members during
4600 'applicable_type' calculation.
4602 2005-02-09 Raja R Harinath <rharinath@novell.com>
4604 Combine two near-redundant caches.
4605 * typemanager.cs (method_params): Rename from method_internal_params.
4606 (TypeManager.GetParameterData): New. Replace
4607 Invocation.GetParameterData.
4608 (TypeManager.LookupParametersByBuilder): Remove.
4609 * expression.cs (Invocation.method_parameter_cache): Remove.
4610 (Invocation.GetParameterData): Remove.
4612 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
4615 2005-02-08 Raja R Harinath <rharinath@novell.com>
4618 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
4619 TypeManager.multicast_delegate_type is null, resolve it by looking
4620 up "System.MulticastDelegate".
4621 * rootcontext.cs (RootContext.ResolveCore): Simplify.
4623 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
4624 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
4625 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
4628 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
4629 (LabeledStatement.AddReference): New. Set 'referenced'.
4630 (Goto.Resolve): Use it.
4632 2005-02-05 John Luke <john.luke@gmail.com>
4634 * driver.cs: remove duplicate -doc line in Usage ()
4636 2005-02-04 Raja R Harinath <rharinath@novell.com>
4638 * location.cs (Location.AddFile): Fix CS2002 error report.
4640 2005-02-02 Martin Baulig <martin@ximian.com>
4642 * delegate.cs (Delegate.DefineType): Report an internal error if
4643 TypeManager.multicast_delegate_type is null. See bug #72015 for
4646 2005-02-02 Raja R Harinath <rharinath@novell.com>
4648 Fix a crasher in a variant of #31984.
4649 * const.cs (Constant.CheckBase): New override that defers the
4650 new-or-override check in case the base type hasn't been populated
4652 (Constant.Define): Ensure the new-or-override check is performed.
4654 2005-02-01 Duncan Mak <duncan@ximian.com>
4656 * const.cs (LookupConstantValue): Check that `ce' is not null
4657 before calling GetValue ().
4659 2005-02-01 Raja R Harinath <rharinath@novell.com>
4661 Fix test-334.cs (#69519).
4662 * cs-parser.jay (using_alias_directive): Pass in an expression to
4663 NamespaceEntry.UsingAlias.
4664 (using_namespace_directive): Pass in an expression to
4665 NamespaceEntry.Using.
4666 (namespace_name): Don't flatten to a string.
4667 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
4668 (NamespaceEntry.AliasEntry.Resolve): Lookup using
4670 (NamespaceEntry.UsingEntry): Likewise.
4671 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
4673 (NamespaceEntry.LookupForUsing): Remove.
4674 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
4676 (NamespaceEntry.Lookup): Remove support for dotted names.
4678 2005-02-01 Raja R Harinath <rharinath@novell.com>
4680 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
4682 (NamespaceEntry.ImplicitParent): Compute on demand.
4683 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
4684 parallels the current.
4685 (NamespaceEntry.LookupForUsing): Use it.
4686 (NamespaceEntry.Lookup): If the current namespace-entry is
4687 implicit, don't search aliases and using tables.
4689 2005-02-01 Raja R Harinath <rharinath@novell.com>
4692 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
4694 (TypeContainer.BaseCache): Compute on demand.
4695 (TypeContainer.FindMembers): Define constants and types if they're
4696 not already created.
4697 (FieldMember.Define): Move resetting of ec.InUnsafe before error
4699 * const.cs (Constant.Define): Make idempotent.
4701 2005-01-29 Miguel de Icaza <miguel@novell.com>
4703 * pending.cs: Produce better code (no nops produced by using Ldarg
4706 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
4707 i - 1' it should be arg + 1.
4711 2005-01-28 Raja R Harinath <rharinath@novell.com>
4713 * attribute.cs (Attribute.CheckAttributeType): Make private
4715 (Attribute.ResolveType): Make virtual.
4716 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
4717 handling of RootContext.Tree.Types.
4719 2005-01-27 Raja R Harinath <rharinath@novell.com>
4721 Update attribute-handling to use the SimpleName/MemberAccess
4723 * cs-parser.jay (attribute): Pass in an expression to the
4724 constructors of Attribute and GlobalAttribute.
4725 * attribute.cs (Attribute): Take an expression for the name.
4726 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
4727 passed in attribute name expression.
4728 (Attribute.CheckAttributeType): Use it.
4729 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
4730 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
4731 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
4732 argument to prevent error messages if the lookup fails.
4734 2005-01-27 Marek Safar <marek.safar@seznam.cz>
4736 * expression.cs (Indirection): Implemented IVariable interface
4737 to support indirection in AddressOf operator.
4738 (PointerArithmetic.Emit): Add optimalization for case where
4739 result can be precomputed.
4741 2005-01-26 Martin Baulig <martin@ximian.com>
4743 * class.cs (TypeContainer.AttributeTargets): Return the correct
4744 AttributeTargets depending on our `Kind' instead of throwing an
4745 exception; fixes #71632.
4747 2005-01-26 Marek Safar <marek.safar@seznam.cz>
4750 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
4753 2005-01-25 Raja R Harinath <rharinath@novell.com>
4756 * expression.cs (MemberAccess.DoResolve): Don't complain with
4757 cs0572 when the LHS of a member access has identical name and type
4760 2005-01-25 Marek Safar <marek.safar@seznam.cz>
4763 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
4765 Create custom PermissionSet only for PermissionSetAttribute.
4767 2005-01-24 Marek Safar <marek.safar@seznam.cz>
4770 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
4771 delegates in static class.
4773 2005-01-24 Martin Baulig <martin@ximian.com>
4775 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4776 merging an implicit block, just use its reachability.
4778 * statement.cs (Block.Resolve): Make the unreachable code check
4779 work wrt. implicit blocks; see test-337 from #63842.
4781 2005-01-21 Alp Toker <alp@atoker.com>
4783 * cs-parser.jay: destructor_declaration's container is PartialContainer
4784 not Class when partial types are used, so use Kind prop instead of
4787 2005-01-22 Miguel de Icaza <miguel@ximian.com>
4789 * cs-parser.jay: Improve error reporting when an interface
4792 2005-01-20 Dick Porter <dick@ximian.com>
4794 * support.cs: SeekableStreamReader fix from Sandor Dobos
4795 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
4796 chars are read. Fixes bug 70369.
4798 2005-01-20 Raja R Harinath <rharinath@novell.com>
4800 * cs-parser.jay (catch_clause): Simplify current_block handling
4803 2005-01-17 Miguel de Icaza <miguel@ximian.com>
4805 * convert.cs (ImplicitStandardConversionExists): Synchronize the
4806 code with ImplicitStandardConversion to handle the implicit
4807 conversion of method groups into valid delegate invocations.
4809 The problem is that in parameter handling we were using this code
4810 path. Fixes bug #64698
4812 2005-01-19 Raja R Harinath <rharinath@novell.com>
4814 * cs-parser.jay: Fix several infelicities.
4815 - Avoid assigning to the parser value stack. Code like
4816 '$3 = null' is unclean. Synthesize a value for the code block
4818 - Avoid using oob_stack for storing location information. Use ...
4819 (_mark_): ... this. New (empty) rule. Saves the current location
4821 (foreach_statement): Avoid using oob_stack for current_block
4822 handling. Use technique used in for_statement and
4823 using_statement. Synthesize a value for the code block to store
4824 additional intermediate information.
4826 2005-01-13 Miguel de Icaza <miguel@ximian.com>
4828 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
4829 of a different type is only allowed to private fields of a
4830 containing type, not on fields of a base class.
4832 See test-174.cs and error cs0122-9.cs
4834 2005-01-13 Raja R Harinath <rharinath@novell.com>
4836 Fix test-335.cs (bug #58126).
4837 * cs-parser.jay (argument): Split out non-expression parts of the
4838 rule into 'non_simple_argument'.
4839 (invocation_expression): Support parenthesized invocations with
4840 multiple arguments, and with single non-simple arguments.
4842 2005-01-13 Raja R Harinath <rharinath@novell.com>
4844 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
4847 2005-01-12 Raja R Harinath <rharinath@novell.com>
4849 Fix cs0038-1.cs, cs1640-6.cs.
4850 * ecore.cs (Expression.Resolve): Remove special-case for
4851 SimpleName in error-handling.
4852 (Expression.almostMatchedMembers): Relax access permission to
4854 (Expression.MemberLookupFailed): Handle duplicates in
4855 almostMatchedMembers list.
4856 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
4857 * expression.cs (New.DoResolve): Report CS1540 for more cases.
4858 * typemanager.cs (GetFullNameSignature): Use the MethodBase
4859 overload if the passed in MemberInfo is a MethodBase.
4861 2005-01-12 Marek Safar <marek.safar@seznam.cz>
4864 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
4865 for non-CAS & merge permission sets properly.
4867 2005-01-11 Raja R Harinath <rharinath@novell.com>
4869 Improve standard-compliance of simple name and member access
4870 resolution. Fixes bugs #52697, #57200, #67520, #69519.
4871 * ecore.cs (FullNamedExpression): New abstract base class
4872 for Namespaces and TypeExpressions.
4873 (ResolveFlags.SimpleName): Remove.
4874 (SimpleName): Remove support for dotted names.
4875 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
4876 DeclSpace.FindType and DeclSpace.LookupType.
4877 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
4878 (Expression.ExprClassName): Make member function.
4879 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
4880 a namespace. Remove creation of dotted "SimpleName"s.
4881 (MemberAccess.DoResolve): Likewise.
4882 * decl.cs (DeclSpace.Cache): Make private.
4883 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
4884 (DeclSpace.FindType): Update.
4885 (DeclSpace.LookupType): Move here from RootContext. Return a
4886 FullNamedExpression.
4887 * namespace.cs (Namespace): Derive from FullNamedExpression
4888 so that it can be part of expression resolution.
4889 (Namespace.Lookup): Return an FullNamedExpression.
4890 (NamespaceEntry.LookupAlias): Lookup aliases only in current
4892 * rootcontext.cs (NamespaceLookup): Remove.
4893 (LookupType): Move to DeclSpace.
4894 * attribute.cs (CheckAttributeType): Update.
4895 * doc.cs (FindDocumentedType): Remove allowAlias argument.
4896 (FindDocumentedTypeNonArray): Likewise.
4898 2005-01-11 Raja R Harinath <rharinath@novell.com>
4900 Fix cs0509.cs, cs1632.cs.
4901 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
4902 is the same as IsInterface.
4903 (TypeContainer.GetClassBases): Likewise.
4904 * statement.cs (LabeledStatement.ig): New field.
4905 (LabeledStatement.LabelTarget): Save ILGenerator which created the
4907 (LabeledStatement.DoEmit): Check that the label was created with
4908 the same ILGenerator.
4910 2005-01-10 Marek Safar <marek.safar@seznam.cz>
4913 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
4914 accessors to its properties.
4916 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
4917 from accessors to property.
4919 2005-01-10 Marek Safar <marek.safar@seznam.cz>
4922 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
4925 2005-01-08 Miguel de Icaza <miguel@ximian.com>
4927 * attribute.cs: Check for null and empty strings.
4929 I have lost another battle to Paolo.
4931 2005-01-07 Marek Safar <marek.safar@seznam.cz>
4934 * class.cs (PropertyMethod): Set Parent field in ctors.
4935 (SetMethod.InternalParameters): Add unsafe switch hack.
4936 Override MarkForDuplicationCheck where it is appropriate.
4938 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
4939 It says whether container allows members with the same name.
4941 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
4942 Removed is_method parameter.
4944 2005-01-06 Duncan Mak <duncan@ximian.com>
4946 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
4947 because the previous change led to incorrect reporting of CS1032
4948 ("Cannot define/undefine preprocessor symbols after first token in
4949 file"). Instead of using `tokens_seen' as the only flag that
4950 triggers CS1040, introduce `comments_seen'. This new flag is used
4951 to signify having seen comments on the current line, so it is
4952 unset after a newline.
4954 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
4956 * doc.cs : When searching for a type, find nested type too.
4957 This fixes bug #71040.
4959 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
4962 - Warn missing member comment on those classes which also does not
4963 have doc comments. Fixed bug #71041.
4964 - Don't warn missing doc comment on default constructor.
4967 2005-01-06 Duncan Mak <duncan@ximian.com>
4969 * cs-tokenizer.cs (xtoken): After handling traditional C-style
4970 comments, set `tokens_seen' to true. This allows us to detect
4971 misplaced preprocessor directives (i.e. not at the beginning of
4972 the a line, nor after whitespaces). In that case, report error
4973 CS1040. This fixes bug #56460.
4975 * cs-parser.jay (interface_member_declaration): Add checks for
4976 IsExplicitImpl, and report CS0541 error if an interface member is
4977 defined as an explicit interface declaration.
4979 2005-01-06 Marek Safar <marek.safar@seznam.cz>
4982 * class.cs (PropertyMethod): Set Parent field in ctors.
4983 (SetMethod.InternalParameters): Add unsafe switch hack.
4985 * decl.cs (MemberCore.Parent): Cannot be readonly.
4987 2005-01-06 Raja R Harinath <rharinath@novell.com>
4989 * decl.cs (DeclSpace.ResolveType): Remove.
4990 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
4991 Merge in code from ...
4992 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
4993 * class.cs, enum.cs: Update to changes.
4995 2005-01-06 Miguel de Icaza <miguel@ximian.com>
4997 * anonymous.cs: Ensure that we init the scope of our parent if it
4998 has not been initialized yet.
5000 2004-12-30 Duncan Mak <duncan@ximian.com>
5002 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
5003 if field.FieldBuilder is null. Fixes #70758.
5005 * convert.cs: Fixed some typos and updated some of the comments.
5006 (ImplicitStandardConversionExists):
5007 (TryImplicitIntConversion): If `target_type' is an interface and
5008 the type of `ic' implements this interface, return true or a new
5009 BoxedCast instead of null. This fixes #70468.
5011 2004-12-29 Duncan Mak <duncan@ximian.com>
5013 * expression.cs (Argument.Emit): Check that Expr is
5014 IMemoryLocation before casting to it, and report CS1510 otherwise.
5018 2004-12-21 Ben Maurer <bmaurer@ximian.com>
5020 * statement.cs (Block.ThisVariable): remove the recursion here, to
5021 make the --profile more sane.
5023 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
5025 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
5026 assembly, by JB Evain.
5028 2004-12-17 Raja R Harinath <rharinath@novell.com>
5030 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
5031 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
5032 "parent" refers to enclosing type/class. "base" refers to superclass.
5034 2004-12-17 Raja R Harinath <rharinath@novell.com>
5036 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5037 Ensure that we only have GlobalAttributes.
5038 * attribute.cs (Attribute.Emit): Make non-virtual.
5039 (GlobalAttribute.Emit): Remove.
5040 (Attribute.Resolve): Make virtual.
5041 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
5042 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
5043 the argument. Don't create one.
5044 (Attribute.GetObsoleteAttribute): Likewise.
5045 (Attribute.GetClsCompliantAttributeValue): Likewise.
5046 * class.cs, decl.cs: Update to changes.
5048 2004-12-17 Marek Safar <marek.safar@seznam.cz>
5050 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
5052 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
5054 * statement.cs (Foreach.Resolve): Add error 186 report.
5056 2004-12-16 Marek Safar <marek.safar@seznam.cz>
5058 * expression.cs (Conditional.DoResolve): Add warning 429.
5060 * statement.cs (If.Resolve): Add warning 665.
5062 2004-12-16 Raja R Harinath <rharinath@novell.com>
5064 New invariant: RootContext.Tree.Types.NamespaceEntry == null
5065 except when in the parser, and in GlobalAttribute.
5066 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
5067 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
5068 RootContext.Tree.Types.NamespaceEntry once work is done.
5069 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
5070 and resets RootContext.Tree.Types.NamespaceEntry.
5072 2004-12-15 Marek Safar <marek.safar@seznam.cz>
5074 * cs-parser.jay: Don't create a block for every variable.
5076 2004-12-14 Miguel de Icaza <miguel@ximian.com>
5078 * location.cs: Provide extra information.
5080 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
5081 variables from the captured environment, it is the ldarg_0.
5083 2004-12-14 Marek Safar <marek.safar@seznam.cz>
5085 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
5088 * class.cs: Changed warning level for 169 to avoid developer
5089 displeasure from warning flooding. It will be changed back when they
5090 fix most of current BCL warnings.
5092 * RootContext.cs: Pushed default WarningLevel to 3.
5094 * statement.cs: Removed unused variable.
5096 2004-12-14 Marek Safar <marek.safar@seznam.cz>
5098 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
5099 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
5100 Add error 502 report.
5101 (StaticClass.DefineType): Add error 441 report.
5102 (Class.AllowedModifiersProp): New virtual property as temporary
5103 extension to AllowedModifiers.
5104 (Class.DefineType): Add error 418 report. Moved ModFlags check here
5105 to share implementation with StaticClass and don't call virtual
5108 * driver.cs (MainDriver): Add error 1558 test.
5110 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
5111 report. Moved error 36 test here.
5113 * statement.cs (Throw.Resolve): Add error 724 report.
5115 * typemanager.cs: Add out_attribute_type core type.
5117 2004-12-13 Marek Safar <marek.safar@seznam.cz>
5119 * class.cs (TypeContainer.VerifyClsCompliance): Add error
5121 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
5123 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
5126 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
5128 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
5129 Add error 3023 report.
5130 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
5132 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
5135 2004-12-12 John Luke <john.luke@gmail.com>
5137 * driver.cs (AddArgs): take -- into account when
5138 adding arguments, fixes bug 65710
5140 2004-12-12 Martin Baulig <martin@ximian.com>
5142 * expression.cs (Unary.TryReduceNegative): Added support for
5143 SByteConstant and ByteConstant.
5144 (Unary.Reduce): Check error values from TryReduceNegative().
5146 2004-12-10 Marek Safar <marek.safar@seznam.cz>
5148 * attributes.cs (Attribute.Resolve): Avoid multiple error report
5149 and report exception as error 182.
5151 2004-12-10 Raja R Harinath <rharinath@novell.com>
5153 * driver.cs (Main): Fix message when there are warnings.
5155 2004-12-09 Miguel de Icaza <miguel@ximian.com>
5157 * delegate.cs: Fixed my fix from yesterday, sorry about that.
5159 2004-12-09 Marek Safar <marek.safar@seznam.cz>
5161 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
5162 Reduced number of warnings.
5164 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
5166 2004-12-08 Miguel de Icaza <miguel@ximian.com>
5168 * driver.cs: Removed message.
5170 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
5172 2004-12-08 <vargaz@freemail.hu>
5174 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
5176 2004-12-08 Martin Baulig <martin@ximian.com>
5178 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5179 instead of a CS3002 for properties and indexer.
5181 2004-12-08 Martin Baulig <martin@ximian.com>
5183 * decl.cs (MemberName.ToString): Make this work again.
5185 2004-12-08 Marek Safar <marek.safar@seznam.cz>
5187 * attribute.cs (Resolve): Add error 591 detection.
5189 * class.cs (FieldMember.Define): Add error 1547 detection.
5190 (Indexer.Define): Add error 620 detection.
5191 (Operator.Define): Add error 590 detection.
5193 * ecore.cs: Missing argument for error 79.
5195 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
5198 2004-12-07 Marek Safar <marek.safar@seznam.cz>
5201 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
5204 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
5206 * cs-parser.jay : handle doc comments on implicit/explicit operators.
5207 Some operator comments were suppressed.
5208 * doc.cs : Implicit/explicit operator name in doc comments are like
5209 "op_Explicit(type)~returnType", so added suffix handling.
5211 2004-12-07 Martin Baulig <martin@ximian.com>
5214 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
5215 (MemberCore.GetClsCompliantAttributeValue): Likewise.
5216 (DeclSpace.ec): New protected field; store the EmitContext here.
5217 (DeclSpace.EmitContext): New public property; moved here from
5219 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
5222 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
5223 (Enum.Emit): Don't create a new EmitContext.
5225 * delegate.cs (Delegate.DefineType): Always create the
5228 * iterators.cs (Iterators.DefineIterator): Create a new
5229 EmitContext and store it in `ec'.
5231 2004-08-24 Martin Baulig <martin@ximian.com>
5234 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
5235 this for accessibility checks.
5236 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
5237 IsNestedFamilyAccessible.
5238 (TypeManager.IsSubclassOf): New method, do what the name actually
5241 2004-12-06 Raja R Harinath <rharinath@novell.com>
5243 Fix crash on cs0657-17.cs.
5244 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5245 Use RootContext.Tree.Types, not 'new RootTypes ()'.
5246 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
5247 the case where the NamespaceEntry gets overwritten.
5249 2004-12-06 Marek Safar <marek.safar@seznam.cz>
5251 Fixed #69195, #56821
5252 * ecore.cs (ResolveBoolean): Tiny refactoring.
5254 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
5255 of right expression resolving when left is false constant and
5256 operator is LogicalAnd OR true constant and operator is LogicalOr.
5258 * statement.cs (ResolveUnreachable): Always reports warning.
5260 2004-12-05 Miguel de Icaza <miguel@ximian.com>
5262 * class.cs: Distinguish between 1721 and 1722 (just a little help
5263 for the programmer).
5265 2004-12-03 Miguel de Icaza <miguel@ximian.com>
5267 * delegate.cs: Only allow this on new versions of the language.
5269 2004-12-02 Duncan Mak <duncan@ximian.com>
5271 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
5273 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
5274 here as a static method. Take an additional bool out parameter
5275 `must_do_cs1540_check' for signaling to InstanceResolve.
5276 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
5277 member field from PropertyExpr class and made it an argument of
5279 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
5280 check for MarshalByRefObject, and report CS0122 instead of CS1540.
5281 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
5282 and `remove_accessor' as well as InstanceResolve: report CS0122
5287 2004-12-03 Raja R Harinath <rharinath@novell.com>
5289 Fix test-327.cs, test-328.cs, and put in early infrastructure
5290 for eventually fixing #52697.
5291 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
5292 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
5294 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
5295 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
5296 (VerifyUsing, error246): Update.
5297 * rootcontext.cs (RootContext.NamespaceLookup): Just use
5298 'NamespaceEntry.LookupNamespaceOrType'.
5300 2004-12-03 Martin Baulig <martin@ximian.com>
5302 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
5303 method as our child, call AnonymousMethod.Compatible() on it.
5305 2004-12-03 Raja R Harinath <rharinath@novell.com>
5307 Disable XML documentation support in 'basic' profile.
5308 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
5309 Redirect XmlElement to System.Object.
5310 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
5311 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
5312 * mcs.exe.sources: Add doc-bootstrap.cs.
5313 * doc-bootstrap.cs: New file. Contains empty stub implementation
5316 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
5318 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
5319 comments are allowed.
5321 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
5323 * delegate.cs: Add checks for subtypes in paramaters and return values
5324 in VerifyMethod () to add support for Covariance/Contravariance
5327 2004-12-02 Miguel de Icaza <miguel@ximian.com>
5329 * report.cs: Remove extra closing parenthesis.
5331 * convert.cs (Error_CannotImplicitConversion): If the name of the
5332 types are the same, provide some extra information.
5334 * class.cs (FieldBase): Use an unused bit field from the field to
5335 encode the `has_offset' property from the FieldMember. This saves
5336 a couple of Ks on bootstrap compilation.
5338 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
5339 method as our child, return the AnonymousMethod resolved
5342 * expression.cs (New.DoResolve): Allow return values from
5343 NewDelegate to also include AnonymousMethods.
5347 2004-12-02 Marek Safar <marek.safar@seznam.cz>
5350 * attribute.cs (Resolve): Improved implementation of params
5351 attribute arguments.
5353 * support.cs (ParameterData): Add HasParams to be faster.
5355 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
5357 all things are for /doc support:
5359 * doc.cs: new file that supports XML documentation generation.
5360 * mcs.exe.sources: added doc.cs.
5362 Handle /doc command line option.
5363 Report error 2006 instead of 5 for missing file name for /doc.
5364 Generate XML documentation when required, after type resolution.
5366 Added support for picking up documentation (/// and /** ... */),
5367 including a new XmlCommentState enumeration.
5369 Added lines to fill Documentation element for field, constant,
5370 property, indexer, method, constructor, destructor, operator, event
5371 and class, struct, interface, delegate, enum.
5372 Added lines to warn incorrect comment.
5374 Added Documentation field (passed only when /doc was specified).
5376 Added DocComment, DocCommentHeader, GenerateDocComment() and
5377 OnGenerateDocComment() and some supporting private members for
5378 /doc feature to MemberCore.
5380 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
5382 Added overriden DocCommentHeader.
5384 Added overriden DocCommentHeader and GenerateDocComment().
5386 2004-12-01 Miguel de Icaza <miguel@ximian.com>
5388 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
5389 unwrapping the enumeration values, chain to
5390 DoConstantNumericPromotions again, so we can promote things to the
5391 fundamental types (takes care of enums that are bytes, sbytes).
5395 2004-12-01 Raja R Harinath <rharinath@novell.com>
5397 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
5398 Fix long-standing bug in type-lookup. Use FindType instead of
5399 LookupType when ec.ResolvingTypeTree.
5400 (Attribute.ResolveType, Attribute.Resolve)
5401 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
5403 (Attributes.Search): Remove internal version. Update.
5404 (Attributes.SearchMulti): Update.
5405 (Attributes.GetClsCompliantAttribute): Remove.
5406 (Attributes.GetIndexerNameAttribute): Remove.
5407 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
5408 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
5409 * class.cs (Indexer.Define): Likewise.
5411 2004-12-01 Marek Safar <marek.safar@seznam.cz>
5414 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
5415 MarshallByReference members access.
5417 * expression.cs: Use CheckMarshallByRefAccess;
5418 Better error CS0197 message.
5420 * report.cs: Print whole related error message.
5422 2004-11-30 Raja R Harinath <rharinath@novell.com>
5424 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
5425 the current directory to help debugging.
5427 2004-11-29 Marek Safar <marek.safar@seznam.cz>
5429 * class (GetClassBases): Better error 60 report.
5430 (EventProperty): Disabled warning 67 detection.
5432 2004-11-29 Marek Safar <marek.safar@seznam.cz>
5435 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
5437 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
5440 2004-11-29 Marek Safar <marek.safar@seznam.cz>
5443 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
5445 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
5447 2004-11-26 Miguel de Icaza <miguel@ximian.com>
5449 * attribute.cs (Attribute.Resolve): Refine error reporting and
5450 report a cs0117 if the identifier does not exist, to distinguish
5451 from 0617 which is a miss-use of the actual identifier.
5453 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
5454 between cs0070 and cs0079.
5456 * class.cs (MemberBase.DoDefine): When reporting a wrong
5457 accessibility level, we use MethodCore to compare instead of
5458 Method (this was a regression in some refactoring effort).
5460 So now we correctly report cs0056 again.
5462 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
5463 testing the target_type (which was known to be object_type) and
5464 not the source type (which is anonymous_method).
5466 Fixed reporting of error cs1660.
5468 * expression.cs (UserCast.Source): Expose the underlying cast.
5470 * statement.cs (Switch.SwitchGoverningType): Sort the list of
5471 allowed types to find a match to int32 first (most common).
5473 In addition, it ignores any ImplicitUserConversions that did an
5474 internal implicit conversion (as the switch statement allows only
5475 one integral conversion to exist).
5477 * class.cs (PartialContainer.Create): rename `name' to
5478 `member_name' for clarity. Then replace the string calls with a
5479 call to MemberName.GetPartialName, as now using
5480 MemberName.ToString is an error (this is due to the side effects
5481 it had, that were fixed in the past).
5483 This will restore the error reporting on a number of partial class
5484 errors that were missusing this (and getting an exception as a
5485 results, which is now just a plain textual warning, because
5486 yyparse debug output would crash otherwise).
5488 2004-11-26 Raja R Harinath <rharinath@novell.com>
5490 * Makefile (PROGRAM_INSTALL_DIR): Remove.
5492 2004-11-25 Ben Maurer <bmaurer@ximian.com>
5494 * rootcontext.cs (LookupType): Make sure to cache lookups that
5495 don't give us a negative result. This saves about 5% of corlib
5498 2004-11-25 Miguel de Icaza <miguel@ximian.com>
5500 * report.cs (AbstractMessage.Print): messages are sent to stderr
5502 * class.cs (TypeContainer.GetClassBases): It is an error to have a
5503 non-interface in the list of interfaces (at this point, either
5504 parent was properly set, or a base class is being listed in the
5505 interfaces section).
5507 This flags error 1722, and resolves the crash from bug 69259.
5509 2004-11-25 Ben Maurer <bmaurer@ximian.com>
5511 * statement.cs (Using.EmitExpressionFinally): make this work right
5512 for valuetypes. Fixes 69926.
5514 2004-11-25 Miguel de Icaza <miguel@ximian.com>
5516 * const.cs (Const.ChangeType): Cope with the "0 literal can be
5517 converted to an enum" here, before we try to change the underlying
5518 type. This code exists, but it is a different code path than the
5519 one used while encoding constants.
5521 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
5522 old bug: when converting from the null literal to a pointer,
5523 return an EmptyCast, not the NullLiteral.
5525 This fixes #69921, the recent null_type changes probably made this
5528 (ImplicitReferenceConversionExists): In addition, resynchronized
5529 the code here, so it matches the same code in
5530 ImplicitReferenceConversionExists for the `from any class-type S
5531 to any interface-type T'.
5534 2004-11-25 Marek Safar <marek.safar@seznam.cz>
5536 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
5538 2004-11-24 Miguel de Icaza <miguel@ximian.com>
5540 * cs-parser.jay: Use verbosity accordingly.
5542 2004-11-24 Marek Safar <marek.safar@seznam.cz>
5544 * expression.cs (Unary.ResolveOperator): Do not report warning;
5545 AddressOf reads from variable.
5547 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
5549 2004-11-24 Marek Safar <marek.safar@seznam.cz>
5553 * attribute.cs (Attributable): Removed CheckTargets.
5554 (Attributes.Emit): Explicit attribute targets are tested here.
5556 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
5557 not enabled for interfaces.
5559 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
5560 (GetAssemblyName): Ouch next bug there.
5562 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
5564 * expression.cs: Error 275 added.
5566 2004-11-23 Marek Safar <marek.safar@seznam.cz>
5568 Fix bug #69177 (Implemented decimal constant support)
5570 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
5571 (BinaryFold): Add DecimalConstant.
5573 * const.cs (Define): Decimal constant
5575 (ChangeType): Add decimal type handling.
5576 (LookupConstantValue): Don't set value for decimal type but
5577 emit DecimalConstantAttribute. Needed for constant optimization.
5579 * constant.cs (ToDecimal): New method.
5580 (ConvertToDecimal): New method.
5581 (IntConstant): Implemented ConvertToDecimal.
5582 (DecimalConstant.Emit): Emit optimized version for decimals in
5585 * expression.cs (ResolveOperator): Changed order of constant
5586 reduction to work correctly with native types which have
5587 overloaded operators.
5588 (ResolveMemberAccess): Extract constant value from attribute
5591 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
5593 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
5594 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
5595 (ChangeType): Decimal is special.
5596 (TypeToCoreType): Add decimal type.
5598 2004-11-22 Marek Safar <marek.safar@seznam.cz>
5600 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
5603 2004-11-22 Marek Safar <marek.safar@seznam.cz>
5605 * class.cs (EventField.ApplyAttributeBuilder): Fix error
5608 2004-11-19 Marek Safar <marek.safar@seznam.cz>
5610 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
5612 * pending.cs (PendingImplementation): Grab only interfaces.
5614 2004-11-19 Marek Safar <marek.safar@seznam.cz>
5616 * statement.cs (ForeachHelperMethods): Add location member and
5617 error 202 detection.
5619 2004-11-19 Raja R Harinath <rharinath@novell.com>
5621 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
5622 automatically handled by executable.make.
5623 (PROGRAM): Make profile-specific.
5625 2004-11-18 Marek Safar <marek.safar@seznam.cz>
5627 * expression.cs (DoResolveBase): Fixed wrong warning for out
5630 2004-11-18 Martin Baulig <martin@ximian.com>
5632 Merged latest changes into gmcs. Please keep this comment in
5633 here, it makes it easier for me to see what changed in MCS since
5634 the last time I merged.
5636 2004-11-17 Raja R Harinath <rharinath@novell.com>
5638 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
5639 (TypeHandle.GetMemberCache): New.
5640 (TypeHandle.TypeHandle): Update.
5641 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
5642 (TypeManager.LookupParentInterfacesCache):
5643 Rename from LookupInterfaceCache. Optimize slightly.
5644 (TypeManager.MemberLookup_FindMembers): Update.
5645 * decl.cs (MemberCache.MemberCache): Set Container to null in the
5647 (AddCacheContents): Rename from AddHashtable.
5648 * class.cs (TypeContainer.parent_container): Remove.
5649 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
5650 (TypeContainer.DoDefineMembers): Don't initialize it.
5651 Update to name changes.
5653 2004-11-17 Miguel de Icaza <miguel@ximian.com>
5655 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
5656 that factors the code to check access modifiers on override.
5658 (PropertyBase): Use the code here.
5660 Patch from Lluis S'anchez, fixes bug #69361.
5662 2004-11-15 Miguel de Icaza <miguel@ximian.com>
5664 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
5665 routine that is used to report the use of a captured variable
5666 whose address has been taken.
5668 There are two checks: one when variables are being captured and
5669 the other check is when the address of a variable is taken.
5671 (because an anonymous methods might be resolved before *or* after
5672 the address has been taken) and
5674 * expression.cs (Conditional.DoResolve): Remove the special
5675 casing that Martin added to trueExpr and falseExpr being both
5676 NullLiteral. We get the right behavior now just by introducing
5677 the null_type into the compiler.
5679 * convert.cs (ExplicitConversion): Change the code to use
5680 null_type instead of testing `expr is NullLiteral'.
5681 (ImplicitConversionStandard): use null_type too.
5682 (ImplicitReferenceConversionExists): use null_type too.
5683 (ImplicitReferenceConversion): use null_type too.
5685 * literal.cs: The type of `NullLiteral' is now null_type instead
5687 (Resolve): Set the type here.
5689 * typemanager.cs: Introduce null_type.
5691 2004-11-17 Martin Baulig <martin@ximian.com>
5693 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
5694 direction, like FindMembers() does. Fixes #69546, testcase is in
5697 2004-11-16 Martin Baulig <martin@ximian.com>
5699 This is based on a patch from Marek Safar, see bug #69082.
5700 Fixes bugs #63705 and #67130.
5702 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
5703 method; create a MemberCache for an interface type and cache the
5706 * decl.cs (IMemberContainer.ParentContainer): Removed.
5707 (IMemberContainer.ParentCache): New property.
5708 (MemberCache.SetupCacheForInterface): Removed.
5709 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
5710 to create a cache for an interface's "parent".
5712 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
5715 2004-11-16 Martin Baulig <martin@ximian.com>
5717 Merged back from gmcs; these changes already went into gmcs a
5718 couple of weeks ago.
5721 (TypeManager.AddUserType): Removed the `ifaces' argument.
5722 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
5724 (TypeManager.AddUserInterface): Removed.
5725 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
5727 (TypeManager.GetInterfaces): Likewise.
5728 (TypeManager.GetExplicitInterfaces): Likewise.
5730 * ecore.cs (TypeExpr.GetInterfaces): Removed.
5732 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
5733 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
5735 2004-11-14 Ben Maurer <bmaurer@ximian.com>
5737 * statement.cs: Avoid adding bools to a hashtable.
5739 2004-11-07 Miguel de Icaza <miguel@ximian.com>
5741 * expression.cs (Invocation.OverloadResolve): Flag error if we are
5742 calling an unsafe method from a safe location.
5744 2004-11-06 Marek Safar <marek.safar@seznam.cz>
5747 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
5749 2004-11-06 Miguel de Icaza <miguel@ximian.com>
5751 * namespace.cs (VerifyUsing): use GetPartialName instead of
5754 2004-11-05 Miguel de Icaza <miguel@ximian.com>
5756 * statement.cs (Return.Resolve): Fix regression in typo: if
5757 `in_exc', we have to request a NeedReturnLabel, this was a typo
5758 introduced in the anonymous method check-in. Fixes #69131.
5760 * Indexers were using the ShortName when defining themselves,
5761 causing a regression in the compiler bootstrap when applying the
5762 patch from 2004-11-02 (first part), now they use their full name
5763 and the bug is gone.
5765 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
5767 * driver.cs: Strip the path from the names of embedded resources. Fixes
5770 2004-11-04 Raja R Harinath <rharinath@novell.com>
5772 Fix error message regression: cs0104-2.cs.
5773 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
5774 (AliasEntry.Resolve): Update.
5775 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
5777 (RootContext.LookupType): Update.
5779 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
5781 * cs-parser.jay: Add support for handling accessor modifiers
5782 * class: Add support port accessor modifiers and error checking,
5783 define PropertyMethod.Define as virtual (not abstract anymore)
5784 * ecore.cs: Add checking for proeprties access with access modifiers
5785 * iterators.cs: Modify Accessor constructor call based in the modified
5787 2004-11-02 Ben Maurer <bmaurer@ximian.com>
5789 * expression.cs (StringConcat): Handle being called twice,
5790 as when we have a concat in a field init with more than two
5793 2004-11-02 Miguel de Icaza <miguel@ximian.com>
5795 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
5796 special case explicit implementations, we should always produce
5797 the .property or .event declaration.
5799 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
5800 since it will not return correct data if people use this
5801 unresolved in the presence of using statements (see test-313).
5803 * class.cs (MethodData.Define): If we are an explicit interface
5804 implementation, set the method name to the full name of the
5805 interface plus the name of the method.
5807 Notice that using the method.MethodName.GetFullName() does not
5808 work, as it will only contain the name as declared on the source
5809 file (it can be a shorthand in the presence of using statements)
5810 and not the fully qualifed type name, for example:
5814 class D : ICloneable {
5815 object ICloneable.Clone () {
5819 Would produce a method called `ICloneable.Clone' instead of
5820 `System.ICloneable.Clone'.
5822 * namespace.cs (Alias.Resolve): Use GetPartialName.
5824 2004-11-01 Marek Safar <marek.safar@seznam.cz>
5826 * cs-parser.jay: Add error 1055 report.
5828 2004-11-01 Miguel de Icaza <miguel@ximian.com>
5830 * assign.cs (Assign.DoResolve): Only do the transform of
5831 assignment into a New if the types are compatible, if not, fall
5832 through and let the implicit code deal with the errors and with
5833 the necessary conversions.
5835 2004-11-01 Marek Safar <marek.safar@seznam.cz>
5837 * cs-parser.jay: Add error 1031 report.
5839 * cs-tokenizer.cs: Add location for error 1038.
5841 2004-10-31 Marek Safar <marek.safar@seznam.cz>
5843 * cs-parser.jay: Add error 1016 report.
5845 2004-10-31 Marek Safar <marek.safar@seznam.cz>
5847 * cs-parser.jay: Add errors 1575,1611 report.
5849 2004-10-31 Marek Safar <marek.safar@seznam.cz>
5851 * cs-parser.jay: Add error 1001 report.
5853 2004-10-31 Marek Safar <marek.safar@seznam.cz>
5856 * attribute.cs (GetMarshal): Add method argument for
5857 caller identification.
5859 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
5860 agument for GetMarshal and RuntimeMissingSupport.
5862 2004-10-31 Marek Safar <marek.safar@seznam.cz>
5864 * attribute.cs (ExtractSecurityPermissionSet): Removed
5865 TypeManager.code_access_permission_type.
5867 * typemanager.cs: Removed TypeManager.code_access_permission_type.
5869 2004-10-27 Miguel de Icaza <miguel@ximian.com>
5871 * expression.cs (LocalVariableReference.DoResolveLValue): Check
5872 for obsolete use of a variable here. Fixes regression on errors
5873 cs0619-25 and cs0619-26.
5875 2004-10-27 Marek Safar <marek.safar@seznam.cz>
5877 Fix #62358, implemented security attribute encoding.
5879 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
5880 Tests permitted SecurityAction for assembly or other types.
5881 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
5882 data from SecurityPermissionAttribute to PermisionSet class.
5884 * class.cs (ApplyAttributeBuilder): Added special handling
5885 for System.Security.Permissions.SecurityAttribute based types.
5887 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
5888 special handling for System.Security.Permissions.SecurityAttribute
5891 * enum.cs (ApplyAttributeBuilder): Added special handling
5892 for System.Security.Permissions.SecurityAttribute based types.
5894 * parameter.cs (ApplyAttributeBuilder): Added special handling
5895 for System.Security.Permissions.SecurityAttribute based types.
5897 * rootcontext.cs: Next 2 core types.
5899 * typemanager.cs (TypeManager.security_permission_attr_type):
5900 Built in type for the SecurityPermission Attribute.
5901 (code_access_permission_type): Build in type.
5903 2004-10-17 Miguel de Icaza <miguel@ximian.com>
5905 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
5906 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
5907 all of this information into
5908 EmitContext.EmitCapturedVariableInstance.
5910 * codegen.cs (EmitCapturedVariableInstance): move here the
5911 funcionality of emitting an ldarg.0 in the presence of a
5912 remapping. This centralizes the instance emit code.
5914 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
5915 then emit a load of this: it means that we have reached the
5916 topmost ScopeInfo: the one that contains the pointer to the
5917 instance of the class hosting the anonymous method.
5919 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
5920 captures to the topmost CaptureContext.
5922 2004-10-12 Miguel de Icaza <miguel@ximian.com>
5924 * expression.cs (LocalVariableReference): Move the knowledge about
5925 the iterators into codegen's EmitCapturedVariableInstance.
5927 2004-10-11 Miguel de Icaza <miguel@ximian.com>
5929 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
5930 all code paths return a value from an anonymous method (it is the
5931 same as the 161 error, but for anonymous methods).
5933 2004-10-08 Miguel de Icaza <miguel@ximian.com>
5935 The introduction of anonymous methods in the compiler changed
5936 various ways of doing things in the compiler. The most
5937 significant one is the hard split between the resolution phase
5938 and the emission phases of the compiler.
5940 For instance, routines that referenced local variables no
5941 longer can safely create temporary variables during the
5942 resolution phase: they must do so from the emission phase,
5943 since the variable might have been "captured", hence access to
5944 it can not be done with the local-variable operations from the runtime.
5948 (Block.Flags): New flag `IsTopLevel' to indicate that this block
5949 is a toplevel block.
5951 (ToplevelBlock): A new kind of Block, these are the blocks that
5952 are created by the parser for all toplevel method bodies. These
5953 include methods, accessors and anonymous methods.
5955 These contain some extra information not found in regular blocks:
5956 A pointer to an optional CaptureContext (for tracking captured
5957 local variables and parameters). A pointer to the parent
5960 (Return.Resolve): Catch missmatches when returning a value from an
5961 anonymous method (error 1662).
5962 Invoke NeedReturnLabel from the Resolve phase instead of the emit
5965 (Break.Resolve): ditto.
5967 (SwitchLabel): instead of defining the labels during the
5968 resolution phase, we now turned the public ILLabel and ILLabelCode
5969 labels into methods called GetILLabelCode() and GetILLabel() that
5970 only define the label during the Emit phase.
5972 (GotoCase): Track the SwitchLabel instead of the computed label
5973 (its contained therein). Emit the code by using
5974 SwitchLabel.GetILLabelCode ().
5976 (LocalInfo.Flags.Captured): A new flag has been introduce to track
5977 whether the Local has been captured or not.
5979 (LocalInfo.IsCaptured): New property, used to tell whether the
5980 local has been captured.
5982 * anonymous.cs: Vastly updated to contain the anonymous method
5985 The main classes here are: CaptureContext which tracks any
5986 captured information for a toplevel block and ScopeInfo used to
5987 track the activation frames for various local variables.
5989 Each toplevel block has an optional capture context associated
5990 with it. When a method contains an anonymous method both the
5991 toplevel method and the anonymous method will create a capture
5992 context. When variables or parameters are captured, they are
5993 recorded on the CaptureContext that owns them, for example:
5997 MyDelegate d = delegate {
6002 Here `a' will be recorded as captured on the toplevel
6003 CapturedContext, the inner captured context will not have anything
6004 (it will only have data if local variables or parameters from it
6005 are captured in a nested anonymous method.
6007 The ScopeInfo is used to track the activation frames for local
6008 variables, for example:
6010 for (int i = 0; i < 10; i++)
6011 for (int j = 0; j < 10; j++){
6012 MyDelegate d = delegate {
6017 At runtime this captures a single captured variable `i', but it
6018 captures 10 different versions of the variable `j'. The variable
6019 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
6020 recorded on a child.
6022 The toplevel ScopeInfo will also track information like the `this'
6023 pointer if instance variables were referenced (this is necessary
6024 as the anonymous method lives inside a nested class in the host
6025 type of the method).
6027 (AnonymousMethod): Expanded to track the Toplevel, implement
6028 `AnonymousMethod.Compatible' to tell whether an anonymous method
6029 can be converted to a target delegate type.
6031 The routine now also produces the anonymous method content
6033 (AnonymousDelegate): A helper class that derives from
6034 DelegateCreation, this is used to generate the code necessary to
6035 produce the delegate for the anonymous method that was created.
6037 * assign.cs: API adjustments for new changes in
6038 Convert.ImplicitStandardConversionExists.
6040 * class.cs: Adjustments to cope with the fact that now toplevel
6041 blocks are of type `ToplevelBlock'.
6043 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
6044 insteda of standard blocks.
6046 Flag errors if params arguments are passed to anonymous methods.
6048 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
6049 `CurrentAnonymousMethod' which points to the current Anonymous
6050 Method. The variable points to the AnonymousMethod class that
6051 holds the code being compiled. It is set in the new EmitContext
6052 created for the anonymous method.
6054 (EmitContext.Phase): Introduce a variable and an enumeration to
6055 assist in enforcing some rules about when and where we are allowed
6056 to invoke certain methods (EmitContext.NeedsReturnLabel is the
6057 only one that enfonces this right now).
6059 (EmitContext.HaveCaptureInfo): new helper method that returns
6060 whether we have a CapturedContext initialized.
6062 (EmitContext.CaptureVariable): New method used to register that a
6063 LocalInfo must be flagged for capturing.
6065 (EmitContext.CapturedParameter): New method used to register that a
6066 parameters must be flagged for capturing.
6068 (EmitContext.CapturedField): New method used to register that a
6069 field must be flagged for capturing.
6071 (EmitContext.HaveCapturedVariables,
6072 EmitContext.HaveCapturedFields): Return whether there are captured
6073 variables or fields.
6075 (EmitContext.EmitMethodHostInstance): This is used to emit the
6076 instance for the anonymous method. The instance might be null
6077 (static methods), this (for anonymous methods that capture nothing
6078 and happen to live side-by-side with the current method body) or a
6079 more complicated expression if the method has a CaptureContext.
6081 (EmitContext.EmitTopBlock): Routine that drives the emission of
6082 code: it will first resolve the top block, then emit any metadata
6083 and then emit the code. The split is done so that we can extract
6084 any anonymous methods and flag any captured variables/parameters.
6086 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
6087 during this phase, the ILGenerator should not be used as labels
6088 and local variables declared here might not be accessible to any
6089 code that is part of an anonymous method.
6091 Exceptions to this include the temporary variables that are
6092 created by some statements internally for holding temporary
6095 (EmitContext.EmitMeta): New routine, in charge of emitting all the
6098 (EmitContext.TemporaryReturn): This method is typically called
6099 from the Emit phase, and its the only place where we allow the
6100 ReturnLabel to be defined other than the EmitMeta. The reason is
6101 that otherwise we would have to duplicate a lot of logic in the
6102 Resolve phases of various methods that today is on the Emit
6105 (EmitContext.NeedReturnLabel): This no longer creates the label,
6106 as the ILGenerator is not valid during the resolve phase.
6108 (EmitContext.EmitThis): Extended the knowledge in this class to
6109 work in anonymous methods in addition to iterators.
6111 (EmitContext.EmitCapturedVariableInstance): This emits whatever
6112 code is necessary on the stack to access the instance to a local
6113 variable (the variable will be accessed as a field).
6115 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
6116 EmitContext.EmitAddressOfParameter): Routines to support
6117 parameters (not completed at this point).
6119 Removals: Removed RemapLocal and RemapLocalLValue. We probably
6120 will also remove the parameters.
6122 * convert.cs (Convert): Define a `ConstantEC' which points to a
6123 null. This is just to prefity some code that uses
6124 ImplicitStandardConversion code and do not have an EmitContext
6127 The idea is to flag explicitly that at that point in time, it is
6128 known that the conversion will not trigger the delegate checking
6129 code in implicit conversions (which requires a valid
6132 Everywhere: pass new EmitContext parameter since
6133 ImplicitStandardConversionExists now requires it to check for
6134 anonymous method conversions.
6136 (Convert.ImplicitStandardConversionExists): If the type of an
6137 expression is the anonymous_method_type, and the type is a
6138 delegate, we invoke the AnonymousMethod.Compatible method to check
6139 whether an implicit conversion is possible.
6141 (Convert.ImplicitConversionStandard): Only do implicit method
6142 group conversions if the language level is not ISO_1.
6144 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
6145 MethodInfo for the Invoke method. used by Delegate and
6148 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
6149 method conversions if the target type is a delegate.
6151 Removed extra debugging nops.
6153 (LocalVariableReference): Turn the `local_info' into a public
6156 Add `prepared' field, the same hack used for FieldExprs to cope
6157 with composed assignments, as Local variables do not necessarily
6158 operate purely on the stack as they used to: they can be captured
6161 Add `temp' for a temporary result, like fields.
6163 Refactor DoResolve and DoResolveLValue into DoResolveBase.
6165 It now copes with Local variables that are captured and emits the
6166 proper instance variable to load it from a field in the captured
6169 (ParameterReference.DoResolveBase): During the resolve phase,
6170 capture parameters if we are in an anonymous method.
6172 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
6173 anonymous method, use the EmitContext helper routines to emit the
6174 parameter reference.
6176 * iterators.cs: Set RemapToProxy to true/false during the
6179 * parameters.cs (GetParameterByName): New helper method.
6181 * typemanager.cs (anonymous_method_type) a new type that
6182 represents an anonyous method. This is always an internal type,
6183 used as a fencepost to test against the anonymous-methodness of an
6186 2004-10-20 Marek Safar <marek.safar@seznam.cz>
6188 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
6190 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
6192 2004-10-18 Martin Baulig <martin@ximian.com>
6194 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
6195 `Type' directly, but call ResolveType() on it.
6196 (Catch.Resolve): Likewise.
6197 (Foreach.Resolve): Likewise.
6199 2004-10-18 Martin Baulig <martin@ximian.com>
6201 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
6202 `Type' directly, but call ResolveType() on it.
6203 (Probe.DoResolve): Likewise.
6204 (ArrayCreation.LookupType): Likewise.
6205 (TypeOf.DoResolve): Likewise.
6206 (SizeOf.DoResolve): Likewise.
6208 2004-10-18 Martin Baulig <martin@ximian.com>
6210 * expression.cs (Invocation.BetterFunction): Put back
6211 TypeManager.TypeToCoreType().
6213 2004-10-18 Raja R Harinath <rharinath@novell.com>
6215 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
6218 2004-10-18 Martin Baulig <martin@ximian.com>
6220 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
6221 `Type' directly, but call ResolveType() on it.
6223 2004-10-18 Martin Baulig <martin@ximian.com>
6225 * class.cs (FieldMember.Define): Don't access the TypeExpr's
6226 `Type' directly, but call ResolveType() on it.
6227 (MemberBase.DoDefine): Likewise.
6229 * expression.cs (New.DoResolve): Don't access the TypeExpr's
6230 `Type' directly, but call ResolveType() on it.
6231 (ComposedCast.DoResolveAsTypeStep): Likewise.
6233 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
6234 `Type' directly, but call ResolveType() on it.
6236 2004-10-17 John Luke <john.luke@gmail.com>
6238 * class.cs (Operator.GetSignatureForError): use CSharpName
6240 * parameter.cs (Parameter.GetSignatureForError): Returns
6241 correct name even if was not defined.
6243 2004-10-13 Raja R Harinath <rharinath@novell.com>
6246 * class.cs (TypeContainer.EmitContext): New property.
6247 (DefineNestedTypes): Create an emitcontext for each part.
6248 (MethodCore.DoDefineParameters): Use container's emitcontext.
6249 Pass type array to InternalParameters.
6250 (MemberBase.DoDefine): Use container's emitcontext.
6251 (FieldMember.Define): Likewise.
6252 (Event.Define): Likewise.
6253 (SetMethod.GetParameterInfo): Change argument to EmitContext.
6254 Pass type array to InternalParameters.
6255 (SetIndexerMethod.GetParameterInfo): Likewise.
6256 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
6257 * delegate.cs (Define): Pass emitcontext to
6258 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
6259 array to InternalParameters.
6260 * expression.cs (ParameterReference.DoResolveBase): Pass
6261 emitcontext to GetParameterInfo.
6262 (ComposedCast.DoResolveAsTypeStep): Remove check on
6263 ec.ResolvingTypeTree.
6264 * parameter.cs (Parameter.Resolve): Change argument to
6265 EmitContext. Use ResolveAsTypeTerminal.
6266 (Parameter.GetSignature): Change argument to EmitContext.
6267 (Parameters.ComputeSignature): Likewise.
6268 (Parameters.ComputeParameterTypes): Likewise.
6269 (Parameters.GetParameterInfo): Likewise.
6270 (Parameters.ComputeAndDefineParameterTypes): Likewise.
6271 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
6272 * support.cs (InternalParameters..ctor): Remove variant that takes
6274 * typemanager.cs (system_intptr_expr): New.
6275 (InitExpressionTypes): Initialize it.
6277 2004-10-12 Chris Toshok <toshok@ximian.com>
6279 * cs-parser.jay: fix location for try_statement and catch_clause.
6281 2004-10-11 Martin Baulig <martin@ximian.com>
6283 * report.cs: Don't make --fatal abort on warnings, we have
6284 -warnaserror for that.
6286 2004-10-07 Raja R Harinath <rharinath@novell.com>
6288 More DeclSpace.ResolveType avoidance.
6289 * decl.cs (MemberCore.InUnsafe): New property.
6290 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
6291 with newly created EmitContext.
6292 (FieldMember.Define): Likewise.
6293 * delegate.cs (Delegate.Define): Likewise.
6294 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
6295 only if normal name-lookup fails.
6296 (TypeExpr.DoResolve): Enable error-checking.
6297 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
6298 (SizeOf.DoResolve): Likewise.
6299 (ComposedCast.DoResolveAsTypeStep): Likewise.
6300 (StackAlloc.DoResolve): Likewise.
6301 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
6302 (Block.Unsafe): New property.
6303 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
6304 (Unsafe): Set 'unsafe' flag of contained block.
6305 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
6306 (Fixed.Resolve): Likewise.
6307 (Catch.Resolve): Likewise.
6308 (Using.ResolveLocalVariableDecls): Likewise.
6309 (Foreach.Resolve): Likewise.
6311 2004-10-05 John Luke <john.luke@gmail.com>
6313 * cs-parser.jay: add location to error CS0175
6315 2004-10-04 Miguel de Icaza <miguel@ximian.com>
6317 * ecore.cs (Expression.Constantity): Add support for turning null
6320 * const.cs (Const.Define): Allow constants to be reference types
6321 as long as the value is Null.
6323 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
6325 * namespace.cs (NamespaceEntry.Using): No matter which warning
6326 level is set, check if this namespace name has already been added.
6328 2004-10-03 Ben Maurer <bmaurer@ximian.com>
6330 * expression.cs: reftype [!=]= null should always use br[true,false].
6333 2004-10-03 Marek Safar <marek.safar@seznam.cz>
6336 * attribute.cs: Enum conversion moved to
6337 GetAttributeArgumentExpression to be applied to the all
6340 2004-10-01 Raja R Harinath <rharinath@novell.com>
6342 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
6343 * class.c (TypeContainer.DefineType): Flag error if
6344 base types aren't accessible due to access permissions.
6345 * decl.cs (DeclSpace.ResolveType): Move logic to
6346 Expression.ResolveAsTypeTerminal.
6347 (DeclSpace.ResolveTypeExpr): Thin layer over
6348 Expression.ResolveAsTypeTerminal.
6349 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
6350 Refactor code into NestedAccess. Use it.
6351 (DeclSpace.NestedAccess): New.
6352 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
6353 argument to silence errors. Check access permissions.
6354 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
6355 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
6356 (Cast.DoResolve): Likewise.
6357 (New.DoResolve): Likewise.
6358 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
6359 (TypeOf.DoResolve): Likewise.
6361 * expression.cs (Invocation.BetterConversion): Return the Type of
6362 the better conversion. Implement section 14.4.2.3 more faithfully.
6363 (Invocation.BetterFunction): Make boolean. Make correspondence to
6364 section 14.4.2.2 explicit.
6365 (Invocation.OverloadResolve): Update.
6366 (Invocation): Remove is_base field.
6367 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
6368 (Invocation.Emit): Likewise.
6370 2004-09-27 Raja R Harinath <rharinath@novell.com>
6372 * README: Update to changes.
6374 2004-09-24 Marek Safar <marek.safar@seznam.cz>
6376 * cs-parser.jay: Reverted 642 warning fix.
6378 2004-09-23 Marek Safar <marek.safar@seznam.cz>
6381 * decl.cs (FindMemberWithSameName): Indexer can have more than
6384 2004-09-23 Marek Safar <marek.safar@seznam.cz>
6386 * expression.cs (LocalVariableReference.DoResolveLValue):
6387 Do not report warning 219 for out values.
6388 (EmptyExpression.Null): New member to avoid extra allocations.
6390 2004-09-23 Marek Safar <marek.safar@seznam.cz>
6392 * cs-parser.jay: Fix wrong warning 642 report.
6394 * cs-tokenizer.cs (CheckNextToken): New helper;
6395 Inspect next character if is same as expected.
6397 2004-09-23 Martin Baulig <martin@ximian.com>
6399 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
6400 (Convert.ImplicitReferenceConversionExists): Likewise.
6402 2004-09-23 Marek Safar <marek.safar@seznam.cz>
6404 * class.cs (Operator.Define): Add error 448 and 559 report.
6406 2004-09-22 Marek Safar <marek.safar@seznam.cz>
6408 * class.cs (MemberBase.IsTypePermitted): New protected
6409 method for checking error CS0610.
6411 2004-09-22 Marek Safar <marek.safar@seznam.cz>
6413 * class.cs (TypeContainer.HasExplicitLayout): New property
6414 Returns whether container has StructLayout attribute set Explicit.
6415 (FieldMember): New abstract class for consts and fields.
6416 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
6417 (Field): Reuse FieldMember.
6419 * const.cs (Const): Reuse FieldMember.
6421 * rootcontext.cs: EmitConstants call moved to class.
6423 2004-09-22 Martin Baulig <martin@ximian.com>
6425 Thanks to Peter Sestoft for this bug report.
6427 * expression.cs (Conditional): If both the `trueExpr' and the
6428 `falseExpr' is a NullLiteral, return a NullLiteral.
6430 2004-09-22 Martin Baulig <martin@ximian.com>
6432 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
6433 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
6434 for the "get_Current" call.
6436 2004-09-22 Martin Baulig <martin@ximian.com>
6438 Marek and me just fixed one of our oldest bugs: #28562 :-)
6440 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
6442 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
6443 we're an EnumConstant, just return that.
6444 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
6445 an EnumConstant. In this case, we need to use GetValueAsEnumType()
6446 to get the value which'll actually be written into the attribute.
6447 However, we have to use GetValue() to access the attribute's value
6450 2004-09-22 Marek Safar <marek.safar@seznam.cz>
6452 * constant.cs (Constant.IsNegative): New abstract property
6455 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
6456 (StackAlloc.DoResolve): Reused IsNegative.
6458 2004-09-21 Martin Baulig <martin@ximian.com>
6460 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
6461 if we're used in an iterator, we may be called from different
6464 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
6465 we actually have an exception block.
6467 2004-09-20 John Luke <jluke@cfl.rr.com>
6469 * class.cs, cs-parser.jay: Improve the error report for 1520:
6470 report the actual line where the error happens, not where the
6473 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
6474 Pass location information that was available elsewhere.
6476 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
6478 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
6479 runtime to delay sign assemblies.
6481 2004-09-19 Miguel de Icaza <miguel@ximian.com>
6483 * cs-parser.jay: Do not report the stack trace, this is barely
6486 2004-08-22 John Luke <john.luke@gmail.com>
6488 * driver.cs : check that a resource id is not already used
6489 before adding it, report CS1508 if it is, bug #63637
6491 2004-09-19 Miguel de Icaza <miguel@ximian.com>
6493 * ecore.cs: Removed dead code.
6495 2004-09-18 Marek Safar <marek.safar@seznam.cz>
6497 * class.cs: Do not report warning CS0067 on the interfaces.
6499 2004-09-16 Marek Safar <marek.safar@seznam.cz>
6501 * cs-parser.jay: Add error 504 report.
6503 2004-09-16 Marek Safar <marek.safar@seznam.cz>
6505 * rootcontext.cs: WarningLevel is 4 by default now.
6507 * statement.cs (Fixed.Resolve): Do not null
6510 2004-09-16 Marek Safar <marek.safar@seznam.cz>
6513 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
6514 deep search when property is not virtual.
6515 (PropertyExpr.ResolveAccessors): Make one call for both
6518 2004-09-15 Marek Safar <marek.safar@seznam.cz>
6521 * statement.cs: Error 152 report constains also location.
6523 2004-09-15 Marek Safar <marek.safar@seznam.cz>
6526 * const.cs: Explicitly set constant as static.
6528 2004-09-15 Marek Safar <marek.safar@seznam.cz>
6531 * cs-parser.jay: Add error 1017 report.
6533 2004-09-15 Marek Safar <marek.safar@seznam.cz>
6535 Fixed bug #59980, #64224
6536 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
6538 * typemanager.cs (IsSpecialMethod): Simplified
6540 2004-09-14 Marek Safar <marek.safar@seznam.cz>
6542 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
6543 condition with better params.
6545 2004-09-14 Marek Safar <marek.safar@seznam.cz>
6548 * attribute.cs (Resolve): Property has to have both
6551 2004-09-14 Martin Baulig <martin@ximian.com>
6553 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
6555 2004-09-14 Marek Safar <marek.safar@seznam.cz>
6558 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
6559 called and is obsolete then this member suppress message
6560 when call is inside next [Obsolete] method or type.
6562 * expression.cs: Use TestObsoleteMethodUsage member.
6564 2004-09-14 Martin Baulig <martin@ximian.com>
6566 * cs-parser.jay: Sync a bit with the GMCS version.
6568 2004-09-14 Martin Baulig <martin@ximian.com>
6570 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
6571 (CSharpParser.yacc_verbose_flag): New public field.
6573 * genericparser.cs: Removed.
6575 2004-09-14 Raja R Harinath <rharinath@novell.com>
6577 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
6579 2004-09-13 Marek Safar <marek.safar@seznam.cz>
6581 * class.cs (MethodCore.CheckBase): Fix bug #65757.
6583 2004-09-10 Martin Baulig <martin@ximian.com>
6585 Backported my MemberName changes from GMCS into MCS.
6587 - we are now using a special `MemberName' class instead of using
6588 strings; in GMCS, the `MemberName' also contains the type
6591 - changed the grammar rules a bit:
6592 * the old `member_name' is now a `namespace_or_type_name':
6593 The rule is that we use `namespace_or_type_name' everywhere
6594 where we expect either a "member name" (GetEnumerator) or a
6595 "member name" with an explicit interface name
6596 (IEnumerable.GetEnumerator).
6597 In GMCS, the explicit interface name may include type arguments
6598 (IEnumerable<T>.GetEnumerator).
6599 * we use `member_name' instead of just `IDENTIFIER' for
6601 The rule is that we use `member_name' wherever a member may
6602 have type parameters in GMCS.
6604 * decl.cs (MemberName): New public class.
6605 (MemberCore.MemberName): New public readonly field.
6606 (MemberCore.ctor): Take a `MemberName' argument, not a string.
6607 (DeclSpace): Likewise.
6609 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
6610 * enum.cs (Enum.ctor): Likewise.
6612 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
6614 (AliasEntry.ctor): Take a MemberName, not an Expression.
6615 (AliasEntry.UsingAlias): Likewise.
6617 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
6618 (IMethodData.MemberName): Changed type from string to MemberName.
6619 (MemberBase.ExplicitInterfaceName): Likewise.
6620 (AbstractPropertyEventMethod.SetupName): Make this private.
6621 (AbstractPropertyEventMethod.ctor): Added `string prefix'
6622 argument; compute the member name here.
6623 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
6624 on the `member.MemberName' and the `prefix'.
6626 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
6628 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
6629 thus, we get a `MemberName' instead of a `string'. These
6630 declarations may have type parameters in GMCS.
6631 (interface_method_declaration, delegate_declaration): Likewise.
6632 (class_declaration, interface_declaration): Likewise.
6633 (method_header): Use `namespace_or_type_name' instead of
6634 `member_name'. We may be an explicit interface implementation.
6635 (property_declaration, event_declaration): Likewise.
6636 (member_name): This is now just an `IDENTIFIER', not a
6637 `namespace_or_type_name'.
6638 (type_name, interface_type): Removed.
6639 (namespace_or_type_name): Return a MemberName, not an Expression.
6640 (primary_expression): Use `member_name' instead of `IDENTIFIER';
6641 call GetTypeExpression() on the MemberName to get an expression.
6642 (IndexerDeclaration.interface_type): Changed type from string to
6644 (MakeName): Operate on MemberName's instead of string's.
6646 2004-09-13 Raja R Harinath <rharinath@novell.com>
6649 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
6650 (NamespaceEntry.Lookup): Add new argument to flag if we want the
6651 lookup to avoid symbols introduced by 'using'.
6652 * rootcontext.cs (NamespaceLookup): Update.
6654 2004-09-12 Marek Safar <marek.safar@seznam.cz>
6656 * class.cs (TypeContainer.DoDefineMembers): Do not call
6657 DefineDefaultConstructor for static classes.
6659 2004-09-12 Marek Safar <marek.safar@seznam.cz>
6661 * attribute.cs (Attribute.Resolve): Add error 653 report.
6663 * class.cs (Class.ApplyAttributeBuilder): Add error 641
6665 (Method.ApplyAttributeBuilder): Add error 685 report.
6666 (Operator.Define): Add error 564 report.
6668 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
6670 * expression.cs (Invocation.DoResolve): Add error
6673 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
6676 2004-09-11 Marek Safar <marek.safar@seznam.cz>
6678 * class.cs (ConstructorInitializer.Resolve):
6679 Wrong error number (515->516).
6681 2004-09-11 Marek Safar <marek.safar@seznam.cz>
6683 * class.cs (Indexer.Define): Add error 631 report.
6685 2004-09-11 Marek Safar <marek.safar@seznam.cz>
6687 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
6689 2004-09-11 Marek Safar <marek.safar@seznam.cz>
6691 * expression.cs (Probe.DoResolve): Add error CS0241 report.
6693 2004-09-10 Marek Safar <marek.safar@seznam.cz>
6695 * cs-parser.jay: Added error CS0241 report.
6697 2004-09-10 Raja R Harinath <rharinath@novell.com>
6699 * cs-parser.jay (fixed_statement): Introduce a scope for the
6700 declaration in the 'fixed' statement.
6702 2004-09-09 Marek Safar <marek.safar@seznam.cz>
6704 * cs-parser.jay: Added CS0230 error report.
6706 2004-09-09 Marek Safar <marek.safar@seznam.cz>
6708 * cs-parser.jay: Added errors CS0231 and CS0257 report.
6710 2004-09-09 Marek Safar <marek.safar@seznam.cz>
6712 * expression.cs (Argument.Resolve): Added error CS0192 and
6715 2004-09-09 Marek Safar <marek.safar@seznam.cz>
6717 C# 2.0 #pragma warning feature
6719 * cs-tokenizer.cs (PreProcessPragma): New method;
6720 Handles #pragma directive.
6722 * report.cs (WarningRegions): New class; Support
6723 class for #pragma warning directive. It tests whether
6724 warning is enabled for a given line.
6726 2004-09-08 Miguel de Icaza <miguel@ximian.com>
6728 * const.cs: Add more descriptive error report, tahnks to
6731 2004-09-08 Marek Safar <marek.safar@seznam.cz>
6733 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
6735 2004-09-07 Miguel de Icaza <miguel@ximian.com>
6737 * expression.cs: Apply patch from Ben: Remove dead code from
6738 ArrayCreation, and remove the TurnintoConstant call in const.cs,
6739 as that code just threw an exception anwyays.
6741 * const.cs: Remove the call to the turnintoconstant, for details
6744 * literal.cs: The type of the null-literal is the null type; So
6745 we use a placeholder type (literal.cs:System.Null, defined here)
6748 * expression.cs (Conditional.DoResolve): Remove some old code that
6749 is no longer needed, conversions have been fixed.
6751 (ArrayCreationExpression.DoResolve): Return false if we fail to
6752 resolve the inner expression.
6754 2004-09-07 Raja R Harinath <rharinath@novell.com>
6757 * cs-parser.jay (delegate_declaration): Record a delegate
6758 declaration as a type declaration.
6759 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
6761 2004-09-06 Miguel de Icaza <miguel@ximian.com>
6763 * parameter.cs: Do not crash if the type can not be resolved.
6765 * expression.cs: Report errors with unsafe pointers, fixes #64896
6767 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
6769 * expression.cs: Pointer arith always needs to do a conv.i
6770 if the operand is a long. fix 65320
6772 2004-09-04 Marek Safar <marek.safar@seznam.cz>
6774 Fixed cs0619-37.cs, cs0619-38.cs
6776 * enum.cs (GetObsoleteAttribute): Removed.
6778 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
6779 on Enum member is double staged. The first is tested member
6782 2004-09-04 Marek Safar <marek.safar@seznam.cz>
6784 Fixed #56986, #63631, #65231
6786 * class.cs: (TypeContainer.AddToMemberContainer): New method,
6787 adds member to name container.
6788 (TypeContainer.AddToTypeContainer): New method, adds type to
6790 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
6791 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
6792 AddOperator): Simplified by reusing AddToMemberContainer.
6793 (TypeContainer.UserDefinedStaticConstructor): Changed to property
6795 (Method.CheckForDuplications): Fixed implementation to test all
6797 (MemberBase): Detection whether member is explicit interface
6798 implementation is now in constructor.
6799 (MemberBase.UpdateMemberName): Handles IndexerName.
6800 (Accessor): Changed to keep also location information.
6801 (AbstractPropertyEventMethod): Is derived from MemberCore.
6802 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
6803 will be emited or not.
6804 (PropertyBase.AreAccessorsDuplicateImplementation):
6805 Tests whether accessors are not in collision with some method.
6806 (Operator): Is derived from MethodCore to simplify common
6809 * decl.cs (Flags.TestMethodDuplication): Test for duplication
6811 (DeclSpace.AddToContainer): Adds the member to defined_names
6812 table. It tests for duplications and enclosing name conflicts.
6814 * enum.cs (EnumMember): Clean up to reuse the base structures
6816 2004-09-03 Martin Baulig <martin@ximian.com>
6818 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
6819 into TypeContainer, to make partial classes work again.
6821 2004-09-03 Martin Baulig <martin@ximian.com>
6823 * rootcontext.cs (RootContext.V2): Removed.
6825 2004-03-23 Martin Baulig <martin@ximian.com>
6827 * expression.cs (Invocation.OverloadResolve): Added `bool
6828 may_fail' argument and use it instead of the Location.IsNull() hack.
6830 2004-09-03 Martin Baulig <martin@ximian.com>
6832 Merged latest changes into gmcs. Please keep this comment in
6833 here, it makes it easier for me to see what changed in MCS since
6834 the last time I merged.
6836 2004-09-03 Raja R Harinath <rharinath@novell.com>
6839 * expression.cs (BetterConversion): Don't allow either conversion
6840 to be null. Remove redundant implicit conversion test when 'q ==
6841 null' -- when this function is invoked, we already know that the
6842 implicit conversion exists.
6843 (BetterFunction): Assume that 'best' is non-null. Remove
6844 redundant reimplementation of IsApplicable when 'best' is null.
6845 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
6846 number of arguments.
6847 (IsAncestralType): Extract from OverloadResolve.
6848 (OverloadResolve): Make robust to the MethodGroupExpr being
6849 unsorted. Implement all the logic of Section 14.5.5.1, and
6850 support overloading of methods from multiple applicable types.
6851 Clean up logic somewhat. Don't pass null methods to BetterFunction.
6853 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
6854 (RealError, Warning): Append type of report to related symbol.
6856 2004-09-03 Marek Safar <marek.safar@seznam.cz>
6858 * enum.cs: Fixed CLS-Compliance checks for enum members.
6859 Error tests cs3008-8.cs, cs3014-8.cs
6861 2004-09-02 Marek Safar <marek.safar@seznam.cz>
6863 Fixed bug #62342, #63102
6864 * class.cs: ImplementIndexer uses member.IsExplicitImpl
6865 like ImplementMethod.
6867 2004-09-02 Marek Safar <marek.safar@seznam.cz>
6869 * attribute.cs (Attribute.GetAttributeArgumentExpression):
6872 2004-09-02 Martin Baulig <martin@ximian.com>
6874 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
6875 TypeManager.GetArgumentTypes() rather than calling GetParameters()
6878 2004-09-01 Marek Safar <marek.safar@seznam.cz>
6880 C# 2.0 Static classes implemented
6882 * class.cs (TypeContainer): instance_constructors,
6883 initialized_fields, initialized_static_fields,
6884 default_constructor, base_inteface_types are protected to be
6885 accessible from StaticClass.
6886 (TypeContainer.DefineDefaultConstructor): New virtual method
6887 for custom default constructor generating
6888 (StaticClass): New class to handle "Static classes" feature.
6890 * cs-parser.jay: Handle static keyword on class like instance
6893 * driver.cs: Added "/langversion" command line switch with two
6894 options (iso-1, default).
6896 2004-08-31 Marek Safar <marek.safar@seznam.cz>
6898 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
6900 2004-08-31 Miguel de Icaza <miguel@ximian.com>
6902 * delegate.cs: Style.
6904 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
6906 * delegate.cs: Add seperate instance expr field for miguel.
6908 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
6910 * PointerArithmetic (Resolve): make sure we are not doing
6911 pointer arith on void*. Also, make sure we are resolved
6912 by not setting eclass until resolve.
6914 All callers: Make sure that PointerArithmetic gets resolved.
6916 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
6918 * ArrayCreation (LookupType): If the type does not resolve
6919 to an array, give an error.
6921 2004-08-27 Marek Safar <marek.safar@seznam.cz>
6923 * statement.cs (Try.Resolve): Fixed bug #64222
6925 2004-08-27 Martin Baulig <martin@ximian.com>
6928 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
6931 2004-08-26 Marek Safar <marek.safar@seznam.cz>
6933 * ecore.cs (Constantify): Get underlying type via
6934 System.Enum.GetUnderlyingType to avoid StackOverflow on the
6935 Windows in special cases.
6937 2004-08-26 Marek Safar <marek.safar@seznam.cz>
6939 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
6940 for obtaining also private methods.
6941 (GetRemoveMethod): Used GetRemoveMethod (true)
6942 for obtaining also private methods.
6944 2004-08-24 Martin Baulig <martin@ximian.com>
6946 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
6947 MethodAttributes.HideBySig for operators.
6949 2004-08-23 Martin Baulig <martin@ximian.com>
6951 Back to the old error reporting system :-)
6953 * report.cs (Message): Removed.
6954 (Report.MessageData, ErrorData, WarningData): Removed.
6955 (Report.Error, Warning): Back to the old system.
6957 2004-08-23 Martin Baulig <martin@ximian.com>
6959 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
6961 * class.cs (TypeContainer.ParentContainer): New public virtual
6962 method; replaces the explicit interface implementation.
6963 (ClassPart.ParentContainer): Override.
6965 2004-08-23 Martin Baulig <martin@ximian.com>
6967 * statement.cs (Switch): Added support for constant switches; see
6968 #59428 or test-285.cs.
6970 2004-08-22 Marek Safar <marek.safar@seznam.cz>
6973 * statement.cs (GetEnumeratorFilter): Removed useless
6974 logic because C# specs is strict. GetEnumerator must be
6977 2004-08-22 Martin Baulig <martin@ximian.com>
6979 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6980 a switch and may break, reset the barrier. Fixes #59867.
6982 2004-08-22 Marek Safar <marek.safar@seznam.cz>
6984 CLS-Compliance speed up (~5% for corlib)
6986 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
6987 New method. Tests container for CLS-Compliant names
6989 * class.cs (TypeContainer.VerifyClsName): New method.
6990 Checks whether container name is CLS Compliant.
6991 (Constructor): Implements IMethodData.
6993 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
6994 low-case table for CLS Compliance test.
6995 (MemberCache.VerifyClsParameterConflict): New method.
6996 Checks method parameters for CS3006 error.
6998 * enum.cs (EnumMember): Is derived from MemberCore.
6999 (Enum.VerifyClsName): Optimized for better performance.
7001 2004-08-06 Marek Safar <marek.safar@seznam.cz>
7003 * report.cs: Renamed Error_T to Error and changed all
7006 2004-08-06 Marek Safar <marek.safar@seznam.cz>
7008 * class.cs (TypeContainer.IndexerArrayList): New inner class
7009 container for indexers.
7010 (TypeContainer.DefaultIndexerName): New constant for default
7011 indexer name. Replaced all "Item" with this constant.
7012 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
7014 * typemanager.cs (TypeManager.default_member_ctor): Cache here
7015 DefaultMemberAttribute constructor.
7017 2004-08-05 Martin Baulig <martin@ximian.com>
7019 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
7022 2004-08-05 Marek Safar <marek.safar@seznam.cz>
7024 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
7025 multi platforms problem.
7027 * compiler.csproj: Included shared files.
7029 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7031 Fix bug 60333, 55971 in the more general way
7032 * attribute.cs (Attribute.GetAttributeArgumentExpression):
7033 Added arg_type argument for constant conversion.
7034 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
7036 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7039 * class.cs (TypeContainer ): New inner classes MethodArrayList,
7040 OperatorArrayList, MethodCoreArrayList for typecontainer
7041 containers. Changed class member types to these new types.
7042 (MethodArrayList.DefineMembers): Added test for CS0659.
7044 2004-08-04 Miguel de Icaza <miguel@ximian.com>
7046 * cfold.cs: Synchronize the folding with the code in expression.cs
7047 Binary.DoNumericPromotions for uint operands.
7049 * attribute.cs: Revert patch from Raja, it introduced a regression
7050 while building Blam-1.2.1 (hard to isolate a test case).
7052 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7056 (TypeContainer.Define): Renamed to DefineContainerMembers because of
7058 (MethodCore.parent_method): New member. The method we're overriding
7059 if this is an override method.
7060 (MethodCore.CheckBase): Moved from Method class and made common.
7061 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
7063 (MethodCore.CheckForDuplications): New abstract method. For custom
7064 member duplication search in a container
7065 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
7066 method and its return type.
7067 (Event.conflict_symbol): New member. Symbol with same name in the
7071 (MemberCache.FindMemberWithSameName): New method. The method
7072 is looking for conflict with inherited symbols.
7074 2004-08-04 Martin Baulig <martin@ximian.com>
7076 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7078 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7080 2004-08-03 Marek Safar <marek.safar@seznam.cz>
7082 * report.cs (Message): New enum for better error, warning reference in
7084 (MessageData): New inner abstract class. It generally handles printing of
7085 error and warning messages.
7086 Removed unused Error, Warning, Message methods.
7088 2004-08-03 Marek Safar <marek.safar@seznam.cz>
7090 Fix for cs0592-8.cs test
7092 (Attributable.ValidAttributeTargets): Made public.
7093 (Attribute.ExplicitTarget): New member for explicit target value.
7094 (Attribute.CheckTargets): Now we translate explicit attribute
7095 target to Target here.
7097 2004-08-03 Ben Maurer <bmaurer@ximian.com>
7099 * ecore.cs (MethodGroupExpr): new IsBase property.
7101 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
7103 * delegate.cs (DelegateCreation): store a MethodGroupExpr
7104 rather than an instance expr.
7106 (DelegateCreation.Emit): Use the method group rather than
7107 the instance expression. Also, if you have base.Foo as the
7108 method for a delegate, make sure to emit ldftn, not ldftnvirt.
7110 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
7112 (NewDelegate.DoResolve): Only check for the existance of Invoke
7113 if the method is going to be needed. Use MethodGroupExpr.
7115 (NewDelegate.Emit): Remove, DelegateCreation implements this.
7117 * expression.cs: For pointer arith., make sure to use
7118 the size of the type, not the size of the pointer to
7121 2004-08-03 Marek Safar <marek.safar@seznam.cz>
7124 * class.cs (Class): Added error CS0502 test.
7126 2004-08-03 John Luke <jluke@cfl.rr.com>
7127 Raja R Harinath <rharinath@novell.com>
7130 * attribute.cs (Attribute.complained_before): New flag.
7131 (Attribute.ResolveType, Attribute.Resolve),
7132 (Attribute.DefinePInvokeMethod): Set it.
7133 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
7135 2004-08-03 Martin Baulig <martin@ximian.com>
7137 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
7138 use a user-defined operator; we still need to do numeric
7139 promotions in case one argument is a builtin type and the other
7140 one has an implicit conversion to that type. Fixes #62322.
7142 2004-08-02 Martin Baulig <martin@ximian.com>
7144 * statement.cs (LocalInfo.Flags): Added `IsThis'.
7145 (LocalInfo.IsThis): New public property.
7146 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
7148 2004-08-01 Martin Baulig <martin@ximian.com>
7150 * class.cs (TypeContainer.GetClassBases): Don't set the default
7151 here since we may get called from GetPartialBases().
7152 (TypeContainer.DefineType): If GetClassBases() didn't return a
7153 parent, use the default one.
7155 2004-07-30 Duncan Mak <duncan@ximian.com>
7157 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
7159 2004-07-30 Martin Baulig <martin@ximian.com>
7161 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
7163 * class.cs (SourceMethod): New public class, derive from the
7164 symbol writer's ISourceMethod.
7165 (Method): Use the new symbol writer API.
7167 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
7168 as argument and use the new symbol writer.
7171 (SourceFile): Implement the symbol writer's ISourceFile.
7172 (Location.SymbolDocument): Removed.
7173 (Location.SourceFile): New public property.
7175 * symbolwriter.cs: Use the new symbol writer API.
7177 2004-07-30 Raja R Harinath <rharinath@novell.com>
7179 * Makefile (install-local): Remove. Functionality moved to
7182 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
7184 * Makefile: Install mcs.exe.config file together with mcs.exe.
7185 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
7186 correct runtime version.
7188 2004-07-25 Martin Baulig <martin@ximian.com>
7191 (TypeContainer.RegisterOrder): Removed, this was unused.
7192 (TypeContainer, interface_order): Removed.
7193 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
7194 TypeContainer as argument since we can also be called with a
7195 `PartialContainer' for a partial class/struct/interface.
7196 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
7197 of checking whether we're an `Interface' - we could be a
7199 (PartialContainer.Register): Override; call
7200 AddClass()/AddStruct()/AddInterface() on our parent.
7202 * cs-parser.jay (interface_member_declaration): Add things to the
7203 `current_container', not the `current_class'.
7205 * rootcontext.cs (RegisterOrder): The overloaded version which
7206 takes an `Interface' was unused, removed.
7208 * typemanager.cs (TypeManager.LookupInterface): Return a
7209 `TypeContainer', not an `Interface'.
7210 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
7211 contain a `PartialContainer' for an interface, so check it's
7212 `Kind' to figure out what it is.
7214 2004-07-25 Martin Baulig <martin@ximian.com>
7216 * class.cs (Class.DefaultTypeAttributes): New public constant.
7217 (Struct.DefaultTypeAttributes): Likewise.
7218 (Interface.DefaultTypeAttributes): Likewise.
7219 (PartialContainer.TypeAttr): Override this and add the
7220 DefaultTypeAttributes.
7222 2004-07-25 Martin Baulig <martin@ximian.com>
7224 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
7225 we can just use the `Parent' field instead.
7227 2004-07-25 Martin Baulig <martin@ximian.com>
7229 * class.cs (TypeContainer.Emit): Renamed to EmitType().
7231 2004-07-25 Martin Baulig <martin@ximian.com>
7233 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
7234 our parts before defining any methods.
7235 (TypeContainer.VerifyImplements): Make this virtual.
7236 (ClassPart.VerifyImplements): Override and call VerifyImplements()
7237 on our PartialContainer.
7239 2004-07-25 Martin Baulig <martin@ximian.com>
7241 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
7243 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
7244 argument, we can just use the `Parent' field instead.
7247 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
7248 (MemberBase.DoDefine): Likewise.
7250 2004-07-24 Martin Baulig <martin@ximian.com>
7252 * decl.cs (MemberCore.Parent): New public field.
7253 (DeclSpace.Parent): Moved to MemberCore.
7255 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
7256 (MemberBase.ctor): Added TypeContainer argument, pass it to our
7258 (FieldBase, Field, Operator): Likewise.
7259 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
7260 (EventField, Event): Likewise.
7262 2004-07-23 Martin Baulig <martin@ximian.com>
7264 * class.cs (PartialContainer): New public class.
7265 (ClassPart): New public class.
7266 (TypeContainer): Added support for partial classes.
7267 (TypeContainer.GetClassBases): Splitted some of the functionality
7268 out into GetNormalBases() and GetPartialBases().
7270 * cs-tokenizer.cs (Token.PARTIAL): New token.
7271 (Tokenizer.consume_identifier): Added some hacks to recognize
7272 `partial', but only if it's immediately followed by `class',
7273 `struct' or `interface'.
7275 * cs-parser.jay: Added support for partial clases.
7277 2004-07-23 Martin Baulig <martin@ximian.com>
7279 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
7280 a `DeclSpace' and also made it readonly.
7281 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
7282 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
7283 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
7285 * cs-parser.jay: Pass the `current_class', not the
7286 `current_container' (at the moment, this is still the same thing)
7287 to a new Method, Property, Event, Indexer or Constructor.
7289 2004-07-23 Martin Baulig <martin@ximian.com>
7291 * cs-parser.jay (CSharpParser): Added a new `current_class' field
7292 and removed the `current_interface' one.
7293 (struct_declaration, class_declaration, interface_declaration):
7294 Set `current_class' to the newly created class/struct/interface;
7295 set their `Bases' and call Register() before parsing their body.
7297 2004-07-23 Martin Baulig <martin@ximian.com>
7299 * class.cs (Kind): New public enum.
7300 (TypeContainer): Made this class abstract.
7301 (TypeContainer.Kind): New public readonly field.
7302 (TypeContainer.CheckDef): New public method; moved here from
7304 (TypeContainer.Register): New public abstract method.
7305 (TypeContainer.GetPendingImplementations): New public abstract
7307 (TypeContainer.GetClassBases): Removed the `is_class' and
7308 `is_iface' parameters.
7309 (TypeContainer.DefineNestedTypes): Formerly known as
7311 (ClassOrStruct): Made this class abstract.
7313 * tree.cs (RootTypes): New public type.
7315 2004-07-20 Martin Baulig <martin@ximian.com>
7317 * tree.cs (Tree.RecordNamespace): Removed.
7318 (Tree.Namespaces): Removed.
7320 * rootcontext.cs (RootContext.IsNamespace): Removed.
7322 * cs-parser.jay (namespace_declaration): Just create a new
7323 NamespaceEntry here.
7325 2004-07-20 Martin Baulig <martin@ximian.com>
7327 * statement.cs (ExceptionStatement): New abstract class. This is
7328 now used as a base class for everyone who's using `finally'.
7329 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
7330 our local variables before using them.
7332 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
7333 virtual method. This is used by Yield.Resolve() to "steal" an
7334 outer block's `finally' clauses.
7335 (FlowBranchingException): The .ctor now takes an ExceptionStatement
7338 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
7339 version which takes an ExceptionStatement. This version must be
7340 used to create exception branchings.
7343 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
7344 (Iterator.EmitMoveNext): Added exception support; protect the
7345 block with a `fault' clause, properly handle 'finally' clauses.
7346 (Iterator.EmitDispose): Run all the `finally' clauses here.
7348 2004-07-20 Martin Baulig <martin@ximian.com>
7350 * iterator.cs: This is the first of a set of changes in the
7351 iterator code. Match the spec more closely: if we're an
7352 IEnumerable, then GetEnumerator() must be called. The first time
7353 GetEnumerator() is called, it returns the current instance; all
7354 subsequent invocations (if any) must create a copy.
7356 2004-07-19 Miguel de Icaza <miguel@ximian.com>
7358 * expression.cs: Resolve the constant expression before returning
7361 2004-07-19 Martin Baulig <martin@ximian.com>
7363 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
7364 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
7365 the return type of the new EmitContext.
7367 2004-07-18 Martin Baulig <martin@ximian.com>
7369 * class.cs (Property.Define): Fix iterators.
7371 * iterators.cs (Iterator.Define): Moved the
7372 `container.AddInterator (this)' call here from the .ctor; only do
7373 it if we resolved successfully.
7375 2004-07-17 Miguel de Icaza <miguel@ximian.com>
7377 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
7378 `true' for preprocessing directives that we parse. The return
7379 value indicates whether we should return to regular tokenizing or
7380 not, not whether it was parsed successfully.
7382 In the past if we were in: #if false ... #line #endif, we would
7383 resume parsing after `#line'. See bug 61604.
7385 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
7386 building: IsEnumType should return true only for enums, not for
7387 enums or System.Enum itself. This fixes #61593.
7389 Likely what happened is that corlib was wrong: mcs depended on
7390 this bug in some places. The bug got fixed, we had to add the
7391 hack, which caused bug 61593.
7393 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
7394 that was a workaround for the older conditions.
7396 2004-07-16 Ben Maurer <bmaurer@ximian.com>
7398 * assign.cs: IAssignMethod has a new interface, as documented
7399 inline. All assignment code now uses this new api.
7401 * ecore.cs, expression.cs: All classes which implement
7402 IAssignMethod now use the new interface.
7404 * expression.cs (Invocation): add a hack to EmitCall so that
7405 IndexerAccess can be the target of a compound assignment without
7406 evaluating its arguments twice.
7408 * statement.cs: Handle changes in Invocation api.
7410 2004-07-16 Martin Baulig <martin@ximian.com>
7412 * iterators.cs: Rewrote this. We're now using one single Proxy
7413 class for both the IEnumerable and the IEnumerator interface and
7414 `Iterator' derives from Class so we can use the high-level API.
7416 * class.cs (TypeContainer.AddIterator): New method.
7417 (TypeContainer.DoDefineType): New protected virtual method, which
7418 is called from DefineType().
7419 (TypeContainer.DoDefineMembers): Call DefineType() and
7420 DefineMembers() on all our iterators.
7421 (TypeContainer.Emit): Call Emit() on all our iterators.
7422 (TypeContainer.CloseType): Call CloseType() on all our iterators.
7424 * codegen.cs (EmitContext.CurrentIterator): New public field.
7426 2004-07-15 Martin Baulig <martin@ximian.com>
7429 (TypeManager.not_supported_exception_type): New type.
7431 2004-07-14 Martin Baulig <martin@ximian.com>
7433 * iterators.cs: Use real error numbers.
7435 2004-07-14 Martin Baulig <martin@ximian.com>
7437 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
7438 requires this to be a System.Collection.IEnumerable and not a
7439 class implementing that interface.
7440 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
7442 2004-07-13 Marek Safar <marek.safar@seznam.cz>
7444 * class.cs: Fixed previous fix, it broke some error tests.
7446 2004-07-12 Martin Baulig <martin@ximian.com>
7448 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
7451 2004-07-09 Miguel de Icaza <miguel@ximian.com>
7453 * assign.cs (LocalTemporary): Add new argument: is_address,If
7454 `is_address' is true, then the value that we store is the address
7455 to the real value, and not the value itself.
7457 * ecore.cs (PropertyExpr): use the new local temporary
7458 stuff to allow us to handle X.Y += z (where X is a struct)
7460 2004-07-08 Martin Baulig <martin@ximian.com>
7462 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
7463 not always return, just like we're doing in Using.Resolve().
7465 2004-07-07 Miguel de Icaza <miguel@ximian.com>
7467 * cs-parser.jay (fixed_statement): flag this as Pinned.
7469 2004-07-06 Miguel de Icaza <miguel@ximian.com>
7471 * typemanager.cs (TypeManager): Removed MakePinned method, this
7472 mechanism is replaced with the .NET 2.x compatible mechanism of
7473 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
7475 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
7476 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
7477 `IsFixed' property which has a different meaning.
7479 2004-07-02 Raja R Harinath <rharinath@novell.com>
7481 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
7482 visible from inside a nested class, not just the names of the
7483 immediately enclosing class.
7486 2004-06-24 Raja R Harinath <rharinath@novell.com>
7488 * expression.cs (BetterConversion): Remove buggy special-case
7489 handling of "implicit constant expression conversions". At this
7490 point, we already know that the conversion is possible -- we're
7491 only checking to see which is better.
7493 2004-06-24 Marek Safar <marek.safar@seznam.cz>
7495 * cs-parser.jay: Added error CS0210 test.
7497 2004-06-24 Marek Safar <marek.safar@seznam.cz>
7499 * cs-parser.jay: Added error CS0134 test.
7501 2004-06-24 Marek Safar <marek.safar@seznam.cz>
7504 * cs-parser.jay: Added error CS0145 test.
7506 2004-06-24 Marek Safar <marek.safar@seznam.cz>
7508 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
7510 2004-06-23 Ben Maurer <bmaurer@ximian.com>
7512 * expression.cs (StackAlloc.Resolve): The argument may not
7513 be a constant; deal with this case.
7515 2004-06-23 Marek Safar <marek.safar@seznam.cz>
7517 * attribute.cs (IndexerName_GetIndexerName): Renamed to
7518 GetIndexerAttributeValue.
7519 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
7521 * class.cs (Indexer.Define): Added error tests for CS0415,
7524 2004-06-23 Miguel de Icaza <miguel@ximian.com>
7526 * attribute.cs (Attribute.Resolve): Keep field code in sync with
7529 2004-06-23 Martin Baulig <martin@ximian.com>
7531 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
7532 neither return nor throw, reset the barrier as well. Fixes #60457.
7534 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
7536 * class.cs : EventAttributes is now set to None by default.
7537 This fixes bug #60459.
7539 2004-06-18 Marek Safar <marek.safar@seznam.cz>
7542 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
7543 Don't throw exception but return null (it's sufficient now).
7545 2004-06-18 Marek Safar <marek.safar@seznam.cz>
7547 * typemanager.cs (GetArgumentTypes): Faster implementation.
7549 2004-06-18 Martin Baulig <martin@ximian.com>
7551 * attribute.cs (Attribute.Resolve): Check whether we're an
7552 EmptyCast which a Constant child. Fixes #60333.
7554 2004-06-17 Ben Maurer <bmaurer@ximian.com>
7556 * statement.cs (EmitCollectionForeach): Account for the fact that
7557 not all valuetypes are in areas which we can take the address of.
7558 For these variables, we store to a temporary variable. Also, make
7559 sure that we dont emit a `callvirt' on a valuetype method.
7561 2004-06-15 Marek Safar <marek.safar@seznam.cz>
7563 * expression.cs (StackAlloc.DoReSolve): Added test for
7564 negative parameter (CS0247).
7566 2004-06-15 Marek Safar <marek.safar@seznam.cz>
7569 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
7571 2004-06-15 Marek Safar <marek.safar@seznam.cz>
7574 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
7577 2004-06-14 Marek Safar <marek.safar@seznam.cz>
7579 Fix bug #58254 & cs1555.cs, cs1556.cs
7580 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
7582 2004-06-14 Marek Safar <marek.safar@seznam.cz>
7584 * cs-parser.jay: Added error CS1669 test for indexers.
7586 2004-06-11 Martin Baulig <martin@ximian.com>
7588 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
7589 call this twice: for params and varargs methods.
7591 2004-06-11 Marek Safar <marek.safar@seznam.cz>
7594 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
7596 2004-06-11 Marek Safar <marek.safar@seznam.cz>
7598 * attribute.cs (Attribute.GetValidTargets): Made public.
7601 (AbstractPropertyEventMethod): New class for better code sharing.
7602 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
7604 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
7606 2004-06-11 Raja R Harinath <rharinath@novell.com>
7609 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
7610 that the call to Resolve is part of a MemberAccess.
7611 (Expression.Resolve): Use it for SimpleName resolution.
7612 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
7613 Add 'intermediate' boolean argument.
7614 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
7615 error message when the SimpleName can be resolved ambiguously
7616 between an expression and a type.
7617 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
7619 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
7620 call on the left-side.
7622 2004-06-11 Marek Safar <marek.safar@seznam.cz>
7625 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
7627 2004-06-11 Marek Safar <marek.safar@seznam.cz>
7629 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
7631 2004-06-11 Martin Baulig <martin@ximian.com>
7633 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
7634 varargs methods if applicable.
7636 2004-06-11 Martin Baulig <martin@ximian.com>
7638 * expression.cs (Invocation.EmitCall): Don't use
7639 `method.CallingConvention == CallingConventions.VarArgs' since the
7640 method could also have `CallingConventions.HasThis'.
7642 2004-06-11 Marek Safar <marek.safar@seznam.cz>
7644 * class.cs (Event.GetSignatureForError): Implemented.
7645 Fixed crash in error test cs3010.cs
7647 2004-06-10 Miguel de Icaza <miguel@ximian.com>
7649 * cs-tokenizer.cs: Change the way we track __arglist to be
7650 consistent with the other keywords.
7652 2004-06-09 Miguel de Icaza <miguel@ximian.com>
7654 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
7657 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
7659 * codegen.cs: Check that all referenced assemblies have a strongname
7660 before strongnaming the compiled assembly. If not report error CS1577.
7661 Fix bug #56563. Patch by Jackson Harper.
7662 * typemanager.cs: Added a method to return all referenced assemblies.
7663 Fix bug #56563. Patch by Jackson Harper.
7665 2004-06-08 Marek Safar <marek.safar@seznam.cz>
7668 (Method.ApplyAttributeBuilder): Moved and added conditional
7669 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
7672 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
7674 2004-06-08 Marek Safar <marek.safar@seznam.cz>
7677 * class.cs: (EventField.attribute_targets): Changed default target.
7679 2004-06-08 Martin Baulig <martin@ximian.com>
7681 * expression.cs (Invocation.EmitCall): Enable varargs methods.
7683 2004-06-08 Martin Baulig <martin@ximian.com>
7685 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
7687 2004-06-07 Martin Baulig <martin@ximian.com>
7689 Added support for varargs methods.
7691 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
7694 * cs-parser.jay: Added support for `__arglist'.
7696 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
7698 * expression.cs (Argument.AType): Added `ArgList'.
7699 (Invocation): Added support for varargs methods.
7700 (ArglistAccess): New public class.
7701 (Arglist): New public class.
7703 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
7705 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
7706 a method's top-level block if the method has varargs.
7708 * support.cs (ReflectionParameters, InternalParameters): Added
7709 support for varargs methods.
7711 2004-06-07 Miguel de Icaza <miguel@ximian.com>
7713 * class.cs: Provide location in indexer error report.
7715 * driver.cs: Use standard names.
7717 * namespace.cs: Catch the use of using after a namespace has been
7718 declared also on using aliases.
7720 2004-06-03 Raja R Harinath <rharinath@novell.com>
7723 * typemanager.cs (closure_private_ok, closure_invocation_type)
7724 (closure_qualifier_type, closure_invocation_assembly)
7725 (FilterWithClosure): Move to ...
7726 (Closure): New internal nested class.
7727 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
7728 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
7729 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
7730 (MemberLookup, MemberLookupFailed): Use it.
7731 * expression.cs (New.DoResolve): Treat the lookup for the
7732 constructor as being qualified by the 'new'ed type.
7733 (Indexers.GetIndexersForTypeOrInterface): Update.
7735 2004-06-03 Marek Safar <marek.safar@seznam.cz>
7738 (GetConditionalAttributeValue): New method. Returns
7739 condition of ConditionalAttribute.
7740 (SearchMulti): New method. Returns all attributes of type 't'.
7741 Use it when attribute is AllowMultiple = true.
7742 (IsConditionalMethodExcluded): New method.
7745 (Method.IsExcluded): Implemented. Returns true if method has conditional
7746 attribute and the conditions is not defined (method is excluded).
7747 (IMethodData): Extended interface for ConditionalAttribute support.
7748 (PropertyMethod.IsExcluded): Implemented.
7751 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
7754 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
7757 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
7759 * expression.cs (ArrayCreationExpression): Make this just an
7760 `expression'. It can't be a statement, so the code here was
7763 2004-06-02 Marek Safar <marek.safar@seznam.cz>
7766 * typemanager.cs (GetFullNameSignature): New method for
7769 2004-06-02 Marek Safar <marek.safar@seznam.cz>
7772 * class.cs (MemberBase.GetSignatureForError): New virtual method.
7773 Use this method when MethodBuilder is null.
7774 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
7775 Added test for error CS0626 (MONO reports error for this situation).
7776 (IMethodData.GetSignatureForError): Extended interface.
7778 2004-06-01 Marek Safar <marek.safar@seznam.cz>
7781 (AttributeTester.GetObsoleteAttribute): Returns instance of
7782 ObsoleteAttribute when type is obsolete.
7785 (TypeContainer.VerifyObsoleteAttribute): Override.
7786 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
7787 (MethodCode.VerifyObsoleteAttribute): Override.
7788 (MemberBase.VerifyObsoleteAttribute): Override.
7791 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
7792 and report proper error.
7795 Delegate.VerifyObsoleteAttribute): Override.
7798 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
7799 and report proper error.
7800 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
7803 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
7807 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
7808 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
7809 Added test for ObsoleteAttribute.
7812 (Catch): Derived from Statement.
7814 2004-06-01 Marek Safar <marek.safar@seznam.cz>
7816 Fixed bug #59071 & cs0160.cs
7818 * statement.cs (Try.Resolve): Check here whether order of catch
7819 clauses matches their dependencies.
7821 2004-05-31 Miguel de Icaza <miguel@ximian.com>
7823 * Reverted patch to namespace.cs (Use lookuptypedirect). This
7824 caused a regression: #59343. Referencing nested classes from an
7825 assembly stopped working.
7827 2004-05-31 Martin Baulig <martin@ximian.com>
7829 MCS is now frozen for beta 2.
7831 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7833 * convert.cs: add a trivial cache for overload operator resolution.
7835 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7837 * decl.cs: If possible, use lookuptypedirect here. We can only do
7838 this if there is no `.' after the namespace. Avoids using
7839 LookupType, which does lots of slow processing.
7840 (FindNestedType) New method, does what it says :-).
7841 * namespace.cs: use LookupTypeDirect.
7842 * rootcontext.cs: use membercache, if possible.
7843 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
7845 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7848 According to the spec,
7850 In a member access of the form E.I, if E is a single identifier,
7851 and if the meaning of E as a simple-name (§7.5.2) is a constant,
7852 field, property, localvariable, or parameter with the same type as
7853 the meaning of E as a type-name (§3.8), then both possible
7854 meanings of E are permitted.
7856 We did not check that E as a simple-name had the same type as E as
7859 This trivial check gives us 5-7% on bootstrap time.
7861 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
7863 * expression.cs (Invocation.OverloadResolve): Avoid the
7864 use of hashtables and boxing here by allocating on demand.
7866 2004-05-30 Martin Baulig <martin@ximian.com>
7868 * rootcontext.cs (RootContext.LookupType): Don't cache things if
7869 we're doing a silent lookup. Don't try to lookup nested types in
7870 TypeManager.object_type (thanks to Ben Maurer).
7872 2004-05-30 Martin Baulig <martin@ximian.com>
7874 Committing a patch from Ben Maurer.
7876 * rootcontext.cs (RootContext.LookupType): Cache negative results.
7878 2004-05-29 Martin Baulig <martin@ximian.com>
7880 * class.cs (IMethodData.ShouldIgnore): New method.
7882 * typemanager.cs (TypeManager.MethodFlags): Don't take a
7883 `Location' argument, we don't need it anywhere. Use
7884 `IMethodData.ShouldIgnore ()' instead of
7885 `MethodData.GetMethodFlags ()'.
7886 (TypeManager.AddMethod): Removed.
7887 (TypeManager.AddMethod2): Renamed to AddMethod.
7889 2004-05-29 Martin Baulig <martin@ximian.com>
7891 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
7893 * convert.cs (Convert.ImplicitReferenceConversion): If we're
7894 converting from a class type S to an interface type and we already
7895 have an object on the stack, don't box it again. Fixes #52578.
7897 2004-05-29 Martin Baulig <martin@ximian.com>
7899 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
7900 Added support for `params' parameters. Fixes #59267.
7902 2004-05-29 Martin Baulig <martin@ximian.com>
7904 * literal.cs (NullPointer): Provide a private .ctor which sets
7905 `type' to TypeManager.object_type. Fixes #59048.
7907 2004-05-29 Martin Baulig <martin@ximian.com>
7909 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
7910 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
7912 * ecore.cs (EventExpr.instance_expr): Make the field private.
7914 2004-05-26 Marek Safar <marek.safar@seznam.cz>
7916 Fixed bug #50080 & cs0214-2.cs
7917 * expression.cs (Cast.DoResolve): Check unsafe context here.
7919 * statement.cs (Resolve.DoResolve): Likewise.
7921 2004-05-26 Martin Baulig <martin@ximian.com>
7923 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
7925 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
7926 (RootContext.LookupType): Pass down the `silent' flag.
7928 2004-05-25 Martin Baulig <martin@ximian.com>
7931 (MethodGroupExpr.IdenticalTypeName): New public property.
7932 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
7933 expression actually refers to a type.
7935 2004-05-25 Martin Baulig <martin@ximian.com>
7937 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
7938 for #56176 and made it actually work.
7940 2004-05-25 Martin Baulig <martin@ximian.com>
7942 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
7943 (FieldExpr, PropertyExpr): Override and implement
7944 CacheTemporaries. Fixes #52279.
7946 2004-05-25 Miguel de Icaza <miguel@ximian.com>
7948 * location.cs: In the new compiler listing a file twice is a
7949 warning, not an error.
7951 2004-05-24 Martin Baulig <martin@ximian.com>
7953 * enum.cs (Enum.DefineType): For the `BaseType' to be a
7954 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
7956 2004-05-24 Martin Baulig <martin@ximian.com>
7958 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
7959 walking the `using' list. Fixes #53921.
7961 2004-05-24 Martin Baulig <martin@ximian.com>
7963 * const.cs (Const.LookupConstantValue): Added support for
7964 EmptyCast's; fixes #55251.
7966 2004-05-24 Martin Baulig <martin@ximian.com>
7968 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
7969 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
7970 which does the CS0135 check. The reason is that we first need to
7971 check whether the variable actually exists.
7973 2004-05-24 Martin Baulig <martin@ximian.com>
7975 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
7976 than RootContext.LookupType() to find the explicit interface
7979 2004-05-24 Raja R Harinath <rharinath@novell.com>
7981 * Makefile: Simplify. Use executable.make.
7982 * mcs.exe.sources: New file. List of sources of mcs.exe.
7984 2004-05-24 Anders Carlsson <andersca@gnome.org>
7988 Use the invariant culture when doing String.Compare for CLS case
7991 2004-05-23 Martin Baulig <martin@ximian.com>
7993 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
7994 don't have any dots. Fixes #52622, added cs0246-8.cs.
7996 * namespace.cs (NamespaceEntry.Lookup): Likewise.
7998 2004-05-23 Marek Safar <marek.safar@seznam.cz>
8000 * class.cs (MemberBase.Define): Reuse MemberType member for
8001 resolved type. Other methods can use it too.
8003 2004-05-23 Martin Baulig <martin@ximian.com>
8005 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
8006 the variable also exists in the current block (otherwise, we need
8007 to report a CS0103). Fixes #58670.
8009 2004-05-23 Martin Baulig <martin@ximian.com>
8011 * flowanalysis.cs (Reachability.Reachable): Compute this
8012 on-the-fly rather than storing it as a field.
8014 2004-05-23 Martin Baulig <martin@ximian.com>
8016 * flowanalysis.cs (Reachability.And): Manually compute the
8017 resulting `barrier' from the reachability.
8019 2004-05-23 Marek Safar <marek.safar@seznam.cz>
8022 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
8023 instance of ObsoleteAttribute when symbol is obsolete.
8026 (IMethodData): Extended interface for ObsoleteAttribute support.
8028 2004-05-22 Marek Safar <marek.safar@seznam.cz>
8030 * attribute.cs: Fix bug #55970
8032 2004-05-22 Marek Safar <marek.safar@seznam.cz>
8036 (GetObsoleteAttribute): New method. Creates the instance of
8038 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
8039 ObsoleteAttribute when member is obsolete.
8040 (AttributeTester.Report_ObsoleteMessage): Common method for
8041 Obsolete error/warning reporting.
8044 (TypeContainer.base_classs_type): New member for storing parent type.
8047 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
8048 for this MemberCore.
8050 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8052 * attribute.cs, const.cs: Fix bug #58590
8054 2004-05-21 Martin Baulig <martin@ximian.com>
8056 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
8057 out parameters if the end of the method is unreachable. Fixes
8060 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8062 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
8063 Hari was right, why extra method.
8065 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8067 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
8069 2004-05-20 Martin Baulig <martin@ximian.com>
8071 Merged this back from gmcs to keep the differences to a minumum.
8073 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
8074 instead of a Declspace.
8075 (Attribute.ResolveType): Likewise.
8076 (Attributes.Search): Likewise.
8077 (Attributes.Contains): Likewise.
8078 (Attributes.GetClsCompliantAttribute): Likewise.
8080 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
8082 (MethodData.ApplyAttributes): Take an EmitContext instead of a
8085 2004-05-19 Marek Safar <marek.safar@seznam.cz>
8087 Fix bug #58688 (MCS does not report error when the same attribute
8090 * attribute.cs (Attribute.Emit): Distinction between null and default.
8092 2004-05-19 Raja R Harinath <rharinath@novell.com>
8094 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
8095 of a top-level attribute without an attribute target.
8096 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
8098 (Attribute.Conditional_GetConditionName),
8099 (Attribute.Obsolete_GetObsoleteMessage): Update.
8100 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
8101 part of ScanForIndexerName.
8102 (Attribute.CanIgnoreInvalidAttribute): New function.
8103 (Attribute.ScanForIndexerName): Move to ...
8104 (Attributes.ScanForIndexerName): ... here.
8105 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
8106 (Attributes.Search): New internal variant that can choose not to
8107 complain if types aren't resolved. The original signature now
8109 (Attributes.GetClsCompliantAttribute): Use internal variant, with
8110 complaints suppressed.
8111 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
8112 only if it not useful.
8113 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
8114 top-level for attributes that are shared between the assembly
8115 and a top-level class.
8116 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
8117 * class.cs: Update to reflect changes.
8118 (DefineIndexers): Fuse loops.
8119 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
8120 a couple more variants of attribute names.
8122 2004-05-18 Marek Safar <marek.safar@seznam.cz>
8124 Fix bug #52585 (Implemented explicit attribute declaration)
8127 (Attributable.ValidAttributeTargets): New abstract method. It gets
8128 list of valid attribute targets for explicit target declaration.
8129 (Attribute.Target): It holds target itself.
8130 (AttributeSection): Removed.
8131 (Attribute.CheckTargets): New method. It checks whether attribute
8132 target is valid for the current element.
8135 (EventProperty): New class. For events that are declared like
8136 property (with add and remove accessors).
8137 (EventField): New class. For events that are declared like field.
8140 * cs-parser.jay: Implemented explicit attribute target declaration.
8142 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
8143 Override ValidAttributeTargets.
8146 (ReturnParameter): Class for applying custom attributes on
8148 (ParameterAtribute): New class. Class for applying custom
8149 attributes on the parameter type.
8151 2004-05-17 Miguel de Icaza <miguel@ximian.com>
8153 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
8156 (Method): Allow UNSAFE here.
8158 * modifiers.cs: Support unsafe reporting.
8160 2004-05-17 Marek Safar <marek.safar@seznam.cz>
8162 * decl.cs: Fix bug #58478.
8164 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8166 * statement.cs: When checking for unreachable code on an EmptyStatement,
8167 set the location. Fixes bug #58488.
8169 2004-05-13 Miguel de Icaza <miguel@ximian.com>
8171 * driver.cs: Add -pkg handling.
8173 From Gonzalo: UseShelLExecute=false
8175 2004-05-12 Marek Safar <marek.safar@seznam.cz>
8178 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
8180 (Attribute.IsClsCompliaceRequired): Moved to base for better
8182 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
8183 when attribute is AttributeUsageAttribute.
8184 (Attribute.GetValidTargets): Simplified.
8185 (Attribute.GetAttributeUsage): New method returns AttributeUsage
8186 attribute for this type.
8187 (Attribute.ApplyAttributes): Method renamed to Emit and make
8189 (GlobalAttributeSection): New class for special handling of global
8190 attributes (assembly, module).
8191 (AttributeSection.Emit): New method.
8193 * class.cs: Implemented Attributable abstract methods.
8194 (MethodCore.LabelParameters): Moved to Parameter class.
8195 (Accessor): Is back simple class.
8196 (PropertyMethod): Implemented Attributable abstract class.
8197 (DelegateMethod): Implemented Attributable abstract class.
8198 (Event): New constructor for disctintion between normal Event
8199 and Event with accessors.
8201 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
8203 * codegen.cs, const.cs, decl.cs, delegate.cs:
8204 (CommonAssemblyModulClass): Implemented Attributable abstract class
8207 * enum.cs: Implement IAttributeSupport interface.
8208 (EnumMember): New class for emum members. Implemented Attributable
8212 (ParameterBase): Is abstract.
8213 (ReturnParameter): New class for easier [return:] attribute handling.
8215 * typemanager.cs: Removed builder_to_attr.
8217 2004-05-11 Raja R Harinath <rharinath@novell.com>
8220 * attribute.cs (Attribute.GetPositionalValue): New function.
8221 * class.cs (TypeContainer.VerifyMembers): New function.
8222 (TypeContainer.Emit): Use it.
8223 (ClassOrStruct): New base class for Class and Struct.
8224 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
8225 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
8227 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
8228 then each non-static field should have a FieldOffset attribute.
8229 Otherwise, none of the fields should have a FieldOffset attribute.
8230 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
8231 and FieldOffset attributes.
8232 * typemanager.cs (TypeManager.struct_layout_attribute_type)
8233 (TypeManager.field_offset_attribute_type): New core types.
8234 (TypeManager.InitCoreTypes): Initialize them.
8236 2004-05-11 Michal Moskal <malekith@pld-linux.org>
8238 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
8239 Return correct type.
8242 2004-05-09 Miguel de Icaza <miguel@ximian.com>
8244 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
8245 be implicitly converted to ulong.
8247 * expression.cs: The logic for allowing operator &, | and ^ worked
8248 was wrong, it worked before because we did not report an error in
8249 an else branch. Fixes 57895.
8251 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
8252 allow volatile fields to be reference types.
8254 2004-05-07 Miguel de Icaza <miguel@ximian.com>
8256 * driver.cs: Add support for /debug-
8258 2004-05-07 Raja R Harinath <rharinath@novell.com>
8260 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
8261 Add a 'complain' parameter to silence errors.
8262 (Attribute.Resolve): Update to changes. Put in sanity check to catch
8263 silently overlooked type-resolutions.
8264 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
8266 (Attributes.Search): New function.
8267 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
8268 (Attributes.GetAttributeFullName): Remove hack.
8269 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
8270 Update to reflect changes.
8271 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8272 Use Attributes.Search instead of nested loops.
8274 2004-05-07 Marek Safar <marek.safar@seznam.cz>
8277 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
8278 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
8279 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
8281 * report.cs: (Report.Warning): Renamed to Warning_T because of
8282 parameter collision.
8284 2004-05-05 Raja R Harinath <rharinath@novell.com>
8286 * expression.cs (MemberAccess.ResolveMemberAccess):
8287 Exit with non-zero status after Report.Error.
8288 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
8290 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
8292 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
8294 * support.cs: Don't hang when the file is empty.
8296 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
8298 * support.cs: In SeekableStreamReader, compute the preamble size of the
8299 underlying stream. Position changes should take into account that initial
8302 2004-05-03 Todd Berman <tberman@sevenl.net>
8304 * driver.cs: remove unused GetSysVersion function.
8306 2004-05-03 Todd Berman <tberman@sevenl.net>
8308 * driver.cs: Remove the hack from saturday, as well as the hack
8309 from jackson (LoadAssemblyFromGac), also adds the CWD to the
8310 link_paths to get that bit proper.
8312 2004-05-01 Todd Berman <tberman@sevenl.net>
8314 * driver.cs: Try a LoadFrom before a Load, this checks the current
8315 path. This is currently a bug in mono that is be fixed, however, this
8316 provides a workaround for now. This will be removed when the bug
8319 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
8321 * CryptoConvert.cs: Updated to latest version. Fix issue with
8322 incomplete key pairs (#57941).
8324 2004-05-01 Todd Berman <tberman@sevenl.net>
8326 * driver.cs: Remove '.' from path_chars, now System.* loads properly
8329 2004-04-30 Jackson Harper <jackson@ximian.com>
8331 * codegen.cs: Open keys readonly.
8333 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8335 * typemanager.cs: don't report cyclic struct layout when a struct
8336 contains 2 or more fields of the same type. Failed for Pango.AttrShape
8337 which has 2 Pango.Rectangle fields.
8339 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
8341 * expression.cs: Handle IntPtr comparisons with IL code
8342 rather than a method call.
8344 2004-04-29 Martin Baulig <martin@ximian.com>
8346 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
8347 the list of PropertyInfo's in class hierarchy and find the
8348 accessor. Fixes #56013.
8350 2004-04-29 Martin Baulig <martin@ximian.com>
8352 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
8354 2004-04-29 Martin Baulig <martin@ximian.com>
8356 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
8358 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
8360 2004-04-29 Martin Baulig <martin@ximian.com>
8362 * class.cs (ConstructorInitializer.Resolve): Check whether the
8363 parent .ctor is accessible. Fixes #52146.
8365 2004-04-29 Martin Baulig <martin@ximian.com>
8367 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
8369 * statement.cs (Using.EmitLocalVariableDecls): Use
8370 TypeManager.idisposable_type, not typeof (IDisposable).
8371 (Foreach.EmitCollectionForeach): Added support for valuetypes.
8373 2004-04-29 Martin Baulig <martin@ximian.com>
8375 * class.cs (Event.Define): Don't emit the field and don't set
8376 RTSpecialName and SpecialName for events on interfaces. Fixes
8379 2004-04-29 Raja R Harinath <rharinath@novell.com>
8381 Refactor Attribute.ApplyAttributes.
8382 * attribute.cs (Attributable): New base class for objects that can
8383 have Attributes applied on them.
8384 (Attribute): Make AttributeUsage fields public.
8385 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
8386 (Attribute.IsInternalCall): New property.
8387 (Attribute.UsageAttr): Convert to a public read-only property.
8388 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
8389 (Attribute.ResolveType, Attribute.Resolve)
8390 (Attribute.ScanForIndexerName): Update to reflect changes.
8391 (Attribute.CheckAttributeTarget): Re-format.
8392 (Attribute.ApplyAttributes): Refactor, to various
8393 Attributable.ApplyAttributeBuilder methods.
8394 * decl.cs (MemberCore): Make Attributable.
8395 * class.cs (Accessor): Make Attributable.
8396 (MethodData.ApplyAttributes): Use proper attribute types, not
8398 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
8399 (TypeContainer.ApplyAttributeBuilder)
8400 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
8401 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
8402 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
8403 (Operator.ApplyAttributeBuilder): New factored-out methods.
8404 * const.cs (Const.ApplyAttributeBuilder): Likewise.
8405 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
8406 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
8407 * parameter.cs (ParameterBase): New Attributable base class
8408 that can also represent Return types.
8409 (Parameter): Update to the changes.
8411 2004-04-29 Jackson Harper <jackson@ximian.com>
8413 * driver.cs: Prefer the corlib system version when looking for
8414 assemblies in the GAC. This is still a hack, but its a better hack
8417 2004-04-29 Marek Safar <marek.safar@seznam.cz>
8419 * decl.cs, enum.cs: Improved error 3005 reporting.
8421 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
8422 (related_symbols): New private member for list of symbols
8423 related to reported error/warning.
8425 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
8427 2004-04-29 Martin Baulig <martin@ximian.com>
8429 * ecore.cs (Expression.Constantify): If we're an enum and
8430 TypeManager.TypeToCoreType() doesn't give us another type, use
8431 t.UnderlyingSystemType. Fixes #56178.
8433 2004-04-29 Martin Baulig <martin@ximian.com>
8435 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
8436 interfaces and for each interface, only add members directly
8437 declared in that interface. Fixes #53255.
8439 2004-04-28 Martin Baulig <martin@ximian.com>
8441 * expression.cs (ConditionalLogicalOperator): Use a temporary
8442 variable for `left' to avoid that we evaluate it more than once;
8445 2004-04-28 Martin Baulig <martin@ximian.com>
8447 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
8450 2004-04-28 Martin Baulig <martin@ximian.com>
8452 * statement.cs (LocalInfo.Resolve): Check whether the type is not
8455 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
8456 whether the type is not void (CS1547).
8458 2004-04-28 Martin Baulig <martin@ximian.com>
8460 * expression.cs (Unary.DoResolveLValue): Override this and report
8461 CS0131 for anything but Operator.Indirection.
8463 2004-04-28 Martin Baulig <martin@ximian.com>
8465 Committing a patch from Ben Maurer; see bug #50820.
8467 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
8470 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
8473 2004-04-28 Martin Baulig <martin@ximian.com>
8475 Committing a patch from Ben Maurer; see bug #50820.
8477 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
8480 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
8483 2004-04-28 Martin Baulig <martin@ximian.com>
8485 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
8486 (Block.AddLabel): Call DoLookupLabel() to only search in the
8489 2004-04-28 Martin Baulig <martin@ximian.com>
8491 * cfold.cs (ConstantFold.BinaryFold): Added special support for
8492 comparing StringConstants and NullLiterals in Equality and Inequality.
8494 2004-04-28 Jackson Harper <jackson@ximian.com>
8496 * driver.cs: Attempt to load referenced assemblies from the
8497 GAC. This is the quick and dirty version of this method that
8498 doesnt take into account versions and just takes the first
8499 canidate found. Will be good enough for now as we will not have more
8500 then one version installed into the GAC until I update this method.
8502 2004-04-28 Martin Baulig <martin@ximian.com>
8504 * typemanager.cs (TypeManager.CheckStructCycles): New public
8505 static method to check for cycles in the struct layout.
8507 * rootcontext.cs (RootContext.PopulateTypes): Call
8508 TypeManager.CheckStructCycles() for each TypeContainer.
8509 [Note: We only need to visit each type once.]
8511 2004-04-28 Martin Baulig <martin@ximian.com>
8513 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
8515 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
8516 success and added `out object value'. Use a `bool resolved' field
8517 to check whether we've already been called rather than
8518 `ConstantValue != null' since this breaks for NullLiterals.
8520 2004-04-28 Raja R Harinath <rharinath@novell.com>
8522 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
8523 setting of this flag, since the 'set' method may be non-public.
8525 2004-04-28 Raja R Harinath <rharinath@novell.com>
8527 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
8528 check on current_vector.Block.
8530 2004-04-27 Martin Baulig <martin@ximian.com>
8532 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
8533 a field initializer. Fixes #56459.
8535 2004-04-27 Martin Baulig <martin@ximian.com>
8537 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
8538 we're not attempting to use an indexer. Fixes #52154.
8540 2004-04-27 Martin Baulig <martin@ximian.com>
8542 * statement.cs (Return): Don't create a return label if we don't
8543 need it; reverts my change from January 20th. Thanks to Ben
8546 2004-04-27 Martin Baulig <martin@ximian.com>
8548 According to the spec, `goto' can only leave a nested scope, but
8551 * statement.cs (Block.LookupLabel): Only lookup in the current
8552 block, don't recurse into parent or child blocks.
8553 (Block.AddLabel): Check in parent and child blocks, report
8554 CS0140/CS0158 if we find a duplicate.
8555 (Block): Removed this indexer for label lookups.
8556 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
8557 this already does the error reporting for us.
8560 (FlowBranching.UsageVector.Block): New public variable; may be null.
8561 (FlowBranching.CreateSibling): Added `Block' argument.
8562 (FlowBranching.LookupLabel): New public virtual method. Lookup a
8563 label for the target of a `goto' and check whether we're not
8564 leaving a `finally'.
8566 2004-04-27 Martin Baulig <martin@ximian.com>
8568 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8569 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
8572 2004-04-27 Martin Baulig <martin@ximian.com>
8574 * statement.cs (Block.AddLabel): Also check for implicit blocks
8575 and added a CS0158 check.
8577 2004-04-27 Martin Baulig <martin@ximian.com>
8579 * flowanalysis.cs (FlowBranchingLoop): New class.
8580 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
8581 UsageVector's instead of an ArrayList.
8582 (FlowBranching.Label): Likewise.
8583 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
8584 (FlowBranching.AddBreakVector): New method.
8586 2004-04-27 Miguel de Icaza <miguel@ximian.com>
8588 * attribute.cs: Small regression fix: only convert the type if we
8589 the type is different, fixes System.Drawing build.
8591 2004-04-27 Martin Baulig <martin@ximian.com>
8593 * attribute.cs (Attribute.Resolve): If we have a constant value
8594 for a named field or property, implicity convert it to the correct
8597 2004-04-27 Raja R Harinath <rharinath@novell.com>
8599 * statement.cs (Block.Block): Implicit blocks share
8600 'child_variable_names' fields with parent blocks.
8601 (Block.AddChildVariableNames): Remove.
8602 (Block.AddVariable): Mark variable as "used by a child block" in
8603 every surrounding block.
8604 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
8605 been used in a child block, complain about violation of "Invariant
8606 meaning in blocks" rule.
8607 * cs-parser.jay (declare_local_variables): Don't use
8608 AddChildVariableNames.
8609 (foreach_statement): Don't create an implicit block: 'foreach'
8612 2004-04-23 Miguel de Icaza <miguel@ximian.com>
8614 * convert.cs (ImplicitNumericConversion): 0 is also positive when
8615 converting from 0L to ulong. Fixes 57522.
8617 2004-04-22 Marek Safar <marek.safar@seznam.cz>
8619 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
8620 derived class hides via 'new' keyword field from base class (test-242.cs).
8621 TODO: Handle this in the more general way.
8623 * class.cs (CheckBase): Ditto.
8625 2004-04-22 Marek Safar <marek.safar@seznam.cz>
8627 * decl.cs (caching_flags): New member for storing cached values
8629 (MemberCore.Flags): New enum where bit flags for caching_flags
8631 (MemberCore.cls_compliance): Moved to caching_flags.
8632 (DeclSpace.Created): Moved to caching_flags.
8634 * class.cs: Use caching_flags instead of DeclSpace.Created
8636 2004-04-21 Miguel de Icaza <miguel@ximian.com>
8638 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
8639 if we are only a derived class, not a nested class.
8641 * typemanager.cs: Same as above, but do this at the MemberLookup
8642 level (used by field and methods, properties are handled in
8643 PropertyExpr). Allow for the qualified access if we are a nested
8646 2004-04-21 Marek Safar <marek.safar@seznam.cz>
8648 * class.cs: Refactoring.
8649 (IMethodData): New inteface; Holds links to parent members
8650 to avoid member duplication (reduced memory allocation).
8651 (Method): Implemented IMethodData interface.
8652 (PropertyBase): New inner classes for get/set methods.
8653 (PropertyBase.PropertyMethod): Implemented IMethodData interface
8654 (Event): New inner classes for add/remove methods.
8655 (Event.DelegateMethod): Implemented IMethodData interface.
8657 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
8658 EmitContext (related to class.cs refactoring).
8660 2004-04-21 Raja R Harinath <rharinath@novell.com>
8662 * delegate.cs (Delegate.VerifyApplicability): If the number of
8663 arguments are the same as the number of parameters, first try to
8664 verify applicability ignoring any 'params' modifier on the last
8668 2004-04-16 Raja R Harinath <rharinath@novell.com>
8670 * class.cs (TypeContainer.AddIndexer): Use
8671 'ExplicitInterfaceName' to determine if interface name was
8672 explicitly specified. 'InterfaceType' is not initialized at this time.
8673 (TypeContainer.DefineIndexers): Remove use of temporary list. The
8674 Indexers array is already in the required order. Initialize
8675 'IndexerName' only if there are normal indexers.
8676 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
8677 (TypeContainer.Emit): Emit DefaultMember attribute only if
8678 IndexerName is initialized.
8681 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
8683 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
8686 2004-04-15 Raja R Harinath <rharinath@novell.com>
8688 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
8692 * attribute.cs (Attribute.Resolve): Check for duplicate named
8696 2004-04-15 Miguel de Icaza <miguel@ximian.com>
8698 * iterators.cs (MarkYield): track whether we are in an exception,
8699 and generate code accordingly. Use a temporary value to store the
8700 result for our state.
8702 I had ignored a bit the interaction of try/catch with iterators
8703 since their behavior was not entirely obvious, but now it is
8704 possible to verify that our behavior is the same as MS .NET 2.0
8708 2004-04-14 Miguel de Icaza <miguel@ximian.com>
8710 * iterators.cs: Avoid creating temporaries if there is no work to
8713 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
8714 Enumerations, use TypeManager.EnumToUnderlying and call
8717 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
8720 (This.Emit): Use EmitContext.EmitThis to emit our
8723 (This.EmitAssign): Ditto.
8725 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
8726 codepaths, we will move all the functionality into
8729 (FieldExpr.EmitAssign): Ditto.
8731 This fixes several hidden bugs that I uncovered while doing a code
8732 review of this today.
8734 * codegen.cs (EmitThis): reworked so the semantics are more clear
8735 and also support value types "this" instances.
8737 * iterators.cs: Changed so that for iterators in value types, we
8738 do not pass the value type as a parameter.
8740 Initialization of the enumerator helpers is now done in the caller
8741 instead of passing the parameters to the constructors and having
8742 the constructor set the fields.
8744 The fields have now `assembly' visibility instead of private.
8746 2004-04-11 Miguel de Icaza <miguel@ximian.com>
8748 * expression.cs (Argument.Resolve): Check if fields passed as ref
8749 or out are contained in a MarshalByRefObject.
8751 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
8752 another compiler type.
8754 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
8756 * class.cs (Indexer.Define): use the new name checking method.
8757 Also, return false on an error.
8758 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
8759 (is_identifier_[start/part]_character): make static.
8761 2004-04-10 Miguel de Icaza <miguel@ximian.com>
8763 * expression.cs (Binary.ResolveOperator): Do no append strings
8764 twice: since we can be invoked more than once (array evaluation)
8765 on the same concatenation, take care of this here. Based on a fix
8766 from Ben (bug #56454)
8768 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
8770 * codegen.cs: Fix another case where CS1548 must be reported (when
8771 delay-sign isn't specified and no private is available #56564). Fix
8772 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
8773 error when MCS is used on the MS runtime and we need to delay-sign
8774 (which seems unsupported by AssemblyBuilder - see #56621).
8776 2004-04-08 Marek Safar <marek.safar@seznam.cz>
8778 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
8779 (TypeManager.ComputeNamespaces): Faster implementation for
8782 * compiler.csproj: Updated AssemblyName to mcs.
8784 2004-04-07 Miguel de Icaza <miguel@ximian.com>
8786 * rootcontext.cs: Add new types to the boot resolution.
8788 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
8789 MulticastDelegate is not allowed.
8791 * typemanager.cs: Add new types to lookup: System.TypedReference
8794 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
8795 check for TypedReference or ArgIterator, they are not allowed.
8797 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
8798 makes us properly catch 1510 in some conditions (see bug 56016 for
8801 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
8803 * CryptoConvert.cs: update from corlib version
8806 2004-04-05 Miguel de Icaza <miguel@ximian.com>
8808 * class.cs (Indexer.Define): Check indexername declaration
8810 2004-04-05 Marek Safar <marek.safar@seznam.cz>
8812 * attribute.cs (IsClsCompliant): Fixed problem with handling
8813 all three states (compliant, not-compliant, undetected).
8815 2004-03-30 Marek Safar <marek.safar@seznam.cz>
8817 * attribute.cs (Attribute): Location is now public.
8818 (Resolve): Store resolved arguments (pos_values) in attribute class.
8819 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
8820 (GetClsCompliantAttributeValue): New method that gets
8821 CLSCompliantAttribute value.
8822 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
8823 if exists else null.
8824 (AttributeTester): New class for CLS-Compliant verification routines.
8826 * class.cs (Emit): Add CLS-Compliant verification.
8827 (Method.GetSignatureForError): Implemented.
8828 (Constructor.GetSignatureForError): Implemented
8829 (Constructor.HasCompliantArgs): Returns if constructor has
8830 CLS-Compliant arguments.
8831 (Constructor.Emit): Override.
8832 (Construcor.IsIdentifierClsCompliant): New method; For constructors
8833 is needed to test only parameters.
8834 (FieldBase.GetSignatureForError): Implemented.
8835 (TypeContainer): New member for storing base interfaces.
8836 (TypeContainer.FindMembers): Search in base interfaces too.
8838 * codegen.cs (GetClsComplianceAttribute): New method that gets
8839 assembly or module CLSCompliantAttribute value.
8840 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
8842 (ModuleClass.Emit): Add error 3012 test.
8844 * const.cs (Emit): Override and call base for CLS-Compliant tests.
8846 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
8847 state for all decl types.
8848 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
8849 if CLS-Compliant tests are required.
8850 (IsClsCompliaceRequired): New method. Analyze whether code
8851 must be CLS-Compliant.
8852 (IsExposedFromAssembly): New method. Returns true when MemberCore
8853 is exposed from assembly.
8854 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
8855 value or gets cached value.
8856 (HasClsCompliantAttribute): New method. Returns true if MemberCore
8857 is explicitly marked with CLSCompliantAttribute.
8858 (IsIdentifierClsCompliant): New abstract method. This method is
8859 used to testing error 3005.
8860 (IsIdentifierAndParamClsCompliant): New method. Common helper method
8861 for identifier and parameters CLS-Compliant testing.
8862 (VerifyClsCompliance): New method. The main virtual method for
8863 CLS-Compliant verifications.
8864 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
8865 null. I don't know why is null (too many public members !).
8866 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
8867 and get value of first CLSCompliantAttribute that found.
8869 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
8870 (VerifyClsCompliance): Override and add extra tests.
8872 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
8873 clscheck- disable CLS-Compliant verification event if assembly is has
8874 CLSCompliantAttribute(true).
8876 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
8877 ApllyAttribute is now called in emit section as in the other cases.
8878 Possible future Emit integration.
8879 (IsIdentifierClsCompliant): New override.
8880 (VerifyClsCompliance): New override.
8881 (GetEnumeratorName): Returns full enum name.
8883 * parameter.cs (GetSignatureForError): Implemented.
8885 * report.cs (WarningData): New struct for Warning message information.
8886 (LocationOfPreviousError): New method.
8887 (Warning): New method. Reports warning based on the warning table.
8888 (Error_T): New method. Reports error based on the error table.
8890 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
8891 verifications are done here.
8893 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
8895 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
8896 CLSCompliantAttribute.
8897 (all_imported_types): New member holds all imported types from other
8899 (LoadAllImportedTypes): New method fills static table with exported types
8900 from all referenced assemblies.
8901 (Modules): New property returns all assembly modules.
8903 2004-03-30 Miguel de Icaza <miguel@ximian.com>
8905 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
8906 throwing a parser error.
8908 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
8909 which removes the hardcoded get_/set_ prefixes for properties, as
8910 IL allows for the properties to be named something else.
8914 * expression.cs: Do not override operand before we know if it is
8917 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
8919 * typemanager.cs: support for pinned variables.
8921 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
8923 * decl.cs, typemanager.cs: Avoid using an arraylist
8924 as a buffer if there is only one result set.
8926 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
8928 * expression.cs: Make sure you cant call a static method
8929 with an instance expression, bug #56174.
8931 2004-03-29 Miguel de Icaza <miguel@ximian.com>
8933 * class.cs (IsDuplicateImplementation): Improve error reporting to
8934 flag 663 (method only differs in parameter modifier).
8936 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
8937 in preprocessor directives.
8939 * location.cs (LookupFile): Allow for the empty path.
8941 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
8942 better approach for some of that patch, but its failing with the
8943 CharSet enumeration. For now try/catch will do.
8945 * typemanager.cs: Do not crash if a struct does not have fields.
8948 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
8950 * expression.cs: cs0213, cant fix a fixed expression.
8953 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
8955 * cs-parser.jay: detect invalid embeded statements gracefully.
8958 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
8960 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
8963 the invocation type may not be a subclass of the tye of the item/
8964 The type of the item must be a subclass of the invocation item.
8969 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
8971 * attribute.cs: Added methods to get a string and a bool from an
8972 attribute. Required to information from AssemblyKeyFileAttribute,
8973 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
8974 * codegen.cs: Modified AssemblyName creation to include support for
8975 strongnames. Catch additional exceptions to report them as CS1548.
8976 * compiler.csproj: Updated include CryptoConvert.cs.
8977 * compiler.csproj.user: Removed file - user specific configuration.
8978 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
8979 Mono.Security assembly. The original class is maintained and tested in
8980 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
8981 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
8982 like CSC 8.0 (C# v2) supports.
8983 * Makefile: Added CryptoConvert.cs to mcs sources.
8984 * rootcontext.cs: Added new options for strongnames.
8986 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
8988 * driver.cs: For --expect-error, report error code `2'
8989 if the program compiled with no errors, error code `1' if
8990 it compiled with an error other than the one expected.
8992 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
8994 * compiler.csproj: Updated for Visual Studio .NET 2003.
8995 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
8996 * compiler.sln: Updated for Visual Studio .NET 2003.
8998 2004-03-24 Ravi Pratap M <ravi@ximian.com>
9000 * expression.cs: Fix bug #47234. We basically need to apply the
9001 rule that we prefer the conversion of null to a reference type
9002 when faced with a conversion to 'object' (csc behaviour).
9004 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9006 * statement.cs: Shorter form for foreach, eliminates
9007 a local variable. r=Martin.
9009 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9011 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
9012 checks if we can use brtrue/brfalse to test for 0.
9013 * expression.cs: use the above in the test for using brtrue/brfalse.
9016 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9018 * expression.cs: Rewrite string concat stuff. Benefits:
9020 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
9021 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
9022 rather than a concat chain.
9024 * typemanager.cs: Add lookups for more concat overloads.
9026 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9028 * expression.cs: Emit shorter il code for array init.
9045 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
9047 * statement.cs: Before, two switch blocks would be merged if the
9048 total size of the blocks (end_item - begin_item + 1) was less than
9049 two times the combined sizes of the blocks.
9051 Now, it will only merge if after the merge at least half of the
9056 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
9058 * class.cs : csc build fix for GetMethods(). See bug #52503.
9060 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
9062 * expression.cs: Make sure fp comparisons work with NaN.
9063 This fixes bug #54303. Mig approved this patch a long
9064 time ago, but we were not able to test b/c the runtime
9067 2004-03-19 Miguel de Icaza <miguel@ximian.com>
9069 * ecore.cs (TypExpr.GetHashCode): implement this overload.
9071 2004-03-19 Martin Baulig <martin@ximian.com>
9073 * class.cs (MemberCore.IsDuplicateImplementation): Report the
9074 error here and not in our caller.
9076 2004-03-19 Martin Baulig <martin@ximian.com>
9078 * interface.cs: Completely killed this file.
9079 (Interface): We're now a TypeContainer and live in class.cs.
9081 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
9082 argument; we're now also called for interfaces.
9083 (TypeContainer.DefineMembers): Allow this method being called
9085 (TypeContainer.GetMethods): New public method; formerly known as
9086 Interface.GetMethod(). This is used by PendingImplementation.
9087 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
9088 it's now private and non-static.
9089 (Interface): Moved this here; it's now implemented similar to
9091 (Method, Property, Event, Indexer): Added `bool is_interface'
9092 argument to their .ctor's.
9093 (MemberBase.IsInterface): New public field.
9095 * cs-parser.jay: Create normal Method, Property, Event, Indexer
9096 instances instead of InterfaceMethod, InterfaceProperty, etc.
9097 (opt_interface_base): Removed; we now use `opt_class_base' instead.
9098 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
9100 2004-03-19 Martin Baulig <martin@ximian.com>
9102 * class.cs (MethodCore.IsDuplicateImplementation): New private
9103 method which does the CS0111 checking.
9104 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
9105 Use IsDuplicateImplementation().
9107 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
9109 * decl.cs (FindMemberToOverride): New method to find the correct
9110 method or property to override in the base class.
9112 - Make Method/Property use the above method to find the
9113 version in the base class.
9114 - Remove the InheritableMemberSignatureCompare as it is now
9117 This patch makes large code bases much faster to compile, as it is
9118 O(n) rather than O(n^2) to do this validation.
9120 Also, it fixes bug 52458 which is that nested classes are not
9121 taken into account when finding the base class member.
9123 Reviewed/Approved by Martin.
9125 2004-03-17 Marek Safar <marek.safar@seznam.cz>
9127 * interface.cs: In all interface classes removed redundant
9128 member initialization.
9130 2004-03-16 Martin Baulig <martin@ximian.com>
9132 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9134 2004-03-15 Miguel de Icaza <miguel@ximian.com>
9136 * decl.cs (DefineTypeAndParents): New helper method to define a
9137 type's containers before the type itself is defined; This is a
9138 bug exposed by the recent changes to Windows.Forms when an
9139 implemented interface was defined inside a class that had not been
9142 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
9144 (Check): Loop correctly to report errors modifiers
9145 (UNSAFE was not in the loop, since it was the same as TOP).
9147 * interface.cs: Every interface member now takes a ModFlags,
9148 instead of a "is_new" bool, which we set on the base MemberCore.
9150 Every place where we called "UnsafeOk" in the interface, now we
9151 call the proper member (InterfaceMethod.UnsafeOK) instead to get
9152 the unsafe settings from the member declaration instead of the
9153 container interface.
9155 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
9157 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
9158 `set_indexer_name' to the pending bits (one per type).
9160 We fixed a bug today that was picking the wrong method to
9161 override, since for properties the existing InterfaceMethod code
9162 basically ignored the method name. Now we make sure that the
9163 method name is one of the valid indexer names.
9165 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
9167 * support.cs (SeekableStreamReader): Keep track of stream byte
9168 positions and don't mix them with character offsets to the buffer.
9170 Patch from Gustavo Giráldez
9172 2004-03-15 Marek Safar <marek.safar@seznam.cz>
9174 * interface.cs (InterfaceSetGetBase): Removed double member
9175 initialization, base class does it as well.
9177 2004-03-13 Martin Baulig <martin@ximian.com>
9179 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
9180 when compiling corlib.
9182 2004-03-13 Miguel de Icaza <miguel@ximian.com>
9184 * convert.cs (ExplicitConversion): We were reporting an error on
9185 certain conversions (object_type source to a value type, when the
9186 expression was `null') before we had a chance to pass it through
9187 the user defined conversions.
9189 * driver.cs: Replace / and \ in resource specifications to dots.
9192 * class.cs: Add check for duplicate operators. Fixes 52477
9194 2004-03-11 Miguel de Icaza <miguel@ximian.com>
9196 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
9197 that are in the middle of the statements, not only at the end.
9200 * class.cs (TypeContainer.AddField): No longer set the
9201 `HaveStaticConstructor' flag, now we call it
9202 `UserDefineStaticConstructor' to diferentiate the slightly
9203 semantic difference.
9205 The situation is that we were not adding BeforeFieldInit (from
9206 Modifiers.TypeAttr) to classes that could have it.
9207 BeforeFieldInit should be set to classes that have no static
9212 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
9214 And most importantly Zoltan's comment:
9216 http://bugzilla.ximian.com/show_bug.cgi?id=44229
9218 "I think beforefieldinit means 'it's ok to initialize the type sometime
9219 before its static fields are used', i.e. initialization does not need
9220 to be triggered by the first access to the type. Setting this flag
9221 helps the JIT to compile better code, since it can run the static
9222 constructor at JIT time, and does not need to generate code to call it
9223 (possibly lots of times) at runtime. Unfortunately, mcs does not set
9224 this flag for lots of classes like String.
9226 csc sets this flag if the type does not have an explicit static
9227 constructor. The reasoning seems to be that if there are only static
9228 initalizers for a type, and no static constructor, then the programmer
9229 does not care when this initialization happens, so beforefieldinit
9232 This bug prevents the AOT compiler from being usable, since it
9233 generates so many calls to mono_runtime_class_init that the AOT code
9234 is much slower than the JITted code. The JITted code is faster,
9235 because it does not generate these calls if the vtable is type is
9236 already initialized, which is true in the majority of cases. But the
9237 AOT compiler can't do this."
9239 2004-03-10 Miguel de Icaza <miguel@ximian.com>
9241 * class.cs (MethodData.Emit): Refactor the code so symbolic
9242 information is generated for destructors; For some reasons we
9243 were taking a code path that did not generate symbolic information
9246 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
9248 * class.cs: Create a Constructor.CheckBase method that
9249 takes care of all validation type code. The method
9250 contains some code that was moved from Define.
9252 It also includes new code that checks for duplicate ctors.
9253 This fixes bug #55148.
9255 2004-03-09 Joshua Tauberer <tauberer@for.net>
9257 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
9258 a { ... }-style array creation invokes EmitStaticInitializers
9259 which is not good for reference-type arrays. String, decimal
9260 and now null constants (NullCast) are not counted toward
9261 static initializers.
9263 2004-03-05 Martin Baulig <martin@ximian.com>
9265 * location.cs (SourceFile.HasLineDirective): New public field;
9266 specifies whether the file contains or is referenced by a "#line"
9268 (Location.DefineSymbolDocuments): Ignore source files which
9269 either contain or are referenced by a "#line" directive.
9271 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
9273 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
9274 direct access to our parent, so check the method inline there.
9276 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
9278 * expression.cs (Invocation.EmitCall): Miguel's last commit
9279 caused a regression. If you had:
9284 In Foo the implict this would be null.
9286 2004-02-27 Miguel de Icaza <miguel@ximian.com>
9288 * expression.cs (Invocation.EmitCall): If the method is not
9289 virtual, do not emit a CallVirt to it, use Call.
9291 * typemanager.cs (GetFullNameSignature): Improve the method to
9292 cope with ".ctor" and replace it with the type name.
9294 * class.cs (ConstructorInitializer.Resolve): Now the method takes
9295 as an argument the ConstructorBuilder where it is being defined,
9296 to catch the recursive constructor invocations.
9298 2004-02-26 Miguel de Icaza <miguel@ximian.com>
9300 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
9301 routines to check if a type is an enumerable/enumerator allow
9302 classes that implement the IEnumerable or IEnumerator interfaces.
9304 * class.cs (Property, Operator): Implement IIteratorContainer, and
9305 implement SetYields.
9307 (Property.Define): Do the block swapping for get_methods in the
9308 context of iterators. We need to check if Properties also
9309 include indexers or not.
9311 (Operator): Assign the Block before invoking the
9312 OperatorMethod.Define, so we can trigger the Iterator code
9315 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
9316 Property and Operator classes are not created when we parse the
9317 declarator but until we have the block completed, so we use a
9318 singleton SimpleIteratorContainer.Simple to flag whether the
9319 SetYields has been invoked.
9321 We propagate this setting then to the Property or the Operator to
9322 allow the `yield' to function.
9324 2004-02-25 Marek Safar <marek.safar@seznam.cz>
9326 * codegen.cs: Implemented attribute support for modules.
9327 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
9328 Assembly/Module functionality.
9330 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
9331 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
9332 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
9334 2004-02-16 Marek Safar <marek.safar@seznam.cz>
9336 * interface.cs (FindMembers): The operation is performed on all base
9337 interfaces and not only on the first. It is required for future CLS Compliance patch.
9339 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
9341 * statement.cs, codegen.cs:
9342 This patch deals with patterns such as:
9344 public class List : IEnumerable {
9346 public MyEnumerator GetEnumerator () {
9347 return new MyEnumerator(this);
9350 IEnumerator IEnumerable.GetEnumerator () {
9354 public struct MyEnumerator : IEnumerator {
9359 Before, there were a few things we did wrong:
9360 1) we would emit callvirt on a struct, which is illegal
9361 2) we emited ldarg when we needed to emit ldarga
9362 3) we would mistakenly call the interface methods on an enumerator
9363 type that derived from IEnumerator and was in another assembly. For example:
9365 public class MyEnumerator : IEnumerator
9367 Would have the interface methods called, even if there were public impls of the
9368 method. In a struct, this lead to invalid IL code.
9370 2004-02-11 Marek Safar <marek.safar@seznam.cz>
9372 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
9375 * delegate.cs (Define): Fixed crash when delegate type is undefined.
9377 2004-02-11 Miguel de Icaza <miguel@ximian.com>
9379 * cs-parser.jay: Fix small regression: we were not testing V2
9380 compiler features correctly.
9382 * interface.cs: If the emit context is null, then create one
9384 2004-02-09 Marek Safar <marek.safar@seznam.cz>
9386 * decl.cs (GetSignatureForError): New virtual method to get full name
9389 * attribute.cs (IAttributeSupport): New interface for attribute setting.
9390 Now it is possible to rewrite ApplyAttributes method to be less if/else.
9392 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
9393 Duplicated members and code in these classes has been removed.
9394 Better encapsulation in these classes.
9396 2004-02-07 Miguel de Icaza <miguel@ximian.com>
9398 * assign.cs (Assign.DoResolve): When dealing with compound
9399 assignments, there is a new rule in ECMA C# 2.4 (might have been
9400 there before, but it is documented here) that states that in:
9404 If b is of type int, and the `op' is a shift-operator, then the
9405 above is evaluated as:
9409 * expression.cs (Binary.ResolveOperator): Instead of testing for
9410 int/uint/long/ulong, try to implicitly convert to any of those
9411 types and use that in pointer arithmetic.
9413 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
9414 method to print information for from the type, not from the
9415 null-method we were given.
9417 2004-02-01 Duncan Mak <duncan@ximian.com>
9419 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
9420 parsing for cmd, fixes bug #53694.
9422 2004-02-04 Marek Safar <marek.safar@seznam.cz>
9424 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
9425 in the member name duplication tests. Property and operator name duplication
9426 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
9428 2004-02-03 Marek Safar <marek.safar@seznam.cz>
9430 * interface.cs (PopulateMethod): Fixed crash when interface method
9431 returns not existing type (error test cs0246-3.cs).
9433 2004-02-02 Ravi Pratap M <ravi@ximian.com>
9435 * cs-parser.jay (interface_accessors): Re-write actions to also
9436 store attributes attached to get and set methods. Fix spelling
9439 (inteface_property_declaration): Modify accordingly.
9441 (InterfaceAccessorInfo): New helper class to store information to pass
9442 around between rules that use interface_accessors.
9444 * interface.cs (Emit): Apply attributes on the get and set
9445 accessors of properties and indexers too.
9447 * attribute.cs (ApplyAttributes): Modify accordingly to use the
9448 right MethodBuilder when applying attributes to the get and set accessors.
9450 2004-01-31 Miguel de Icaza <miguel@ximian.com>
9452 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
9454 2004-01-26 Miguel de Icaza <miguel@ximian.com>
9456 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
9458 2004-01-25 Miguel de Icaza <miguel@ximian.com>
9460 * cs-parser.jay: Remove YIELD token, instead use the new grammar
9461 changes that treat `yield' specially when present before `break'
9464 * cs-tokenizer.cs: yield is no longer a keyword.
9466 2004-01-23 Marek Safar <marek.safar@seznam.cz>
9468 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
9469 setting for default constructors.
9470 For default constructors are almost every time set wrong Modifier. The
9471 generated IL code has been alright. But inside mcs this values was
9472 wrong and this was reason why several of my CLS Compliance tests
9475 2004-01-22 Martin Baulig <martin@ximian.com>
9477 * cs-parser.jay (namespace_or_type_name): Return an Expression,
9478 not a QualifiedIdentifier. This is what `type_name_expression'
9479 was previously doing.
9480 (type_name_expression): Removed; the code is now in
9481 `namespace_or_type_name'.
9482 (qualified_identifier): Removed, use `namespace_or_type_name'
9484 (QualifiedIdentifier): Removed this class.
9486 2004-01-22 Martin Baulig <martin@ximian.com>
9488 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
9489 not a string as alias name.
9491 2004-01-21 Miguel de Icaza <miguel@ximian.com>
9493 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
9494 #52730 bug, and instead compute correctly the need to use a
9495 temporary variable when requesting an address based on the
9496 static/instace modified of the field and the constructor.
9498 2004-01-21 Martin Baulig <martin@ximian.com>
9500 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
9501 class and namespace before looking up aliases. Fixes #52517.
9503 2004-01-21 Martin Baulig <martin@ximian.com>
9505 * flowanalysis.cs (UsageVector.Merge): Allow variables being
9506 assinged in a 'try'; fixes exception4.cs.
9508 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9509 * class.cs : Implemented parameter-less constructor for TypeContainer
9511 * decl.cs: Attributes are now stored here. New property OptAttributes
9513 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
9515 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
9517 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9519 * typemanager.cs (CSharpSignature): Now reports also inner class name.
9520 (CSharpSignature): New method for indexer and property signature.
9522 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9524 * pending.cs (IsVirtualFilter): Faster implementation.
9526 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9528 * typemanager.cs: Avoid inclusion of same assembly more than once.
9530 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9532 * cs-parser.jay: Fixed problem where the last assembly attribute
9533 has been applied also to following declaration (class, struct, etc.)
9535 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9537 * class.cs: Added error CS0538, CS0539 reporting.
9538 Fixed crash on Microsoft runtime when field type is void.
9540 * cs-parser.jay: Added error CS0537 reporting.
9542 * pending.cs: Added error CS0535 reporting.
9543 Improved error report for errors CS0536, CS0534.
9545 2004-01-20 Miguel de Icaza <miguel@ximian.com>
9547 Merge a few bits from the Anonymous Method MCS tree.
9549 * statement.cs (ToplevelBlock): New class for toplevel methods,
9550 will hold anonymous methods, lifted variables.
9552 * cs-parser.jay: Create toplevel blocks for delegates and for
9553 regular blocks of code.
9555 2004-01-20 Martin Baulig <martin@ximian.com>
9557 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
9558 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
9559 and `NeedExplicitReturn'; added `IsLastStatement'.
9560 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
9561 have a `ReturnLabel' or we're not unreachable.
9563 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
9564 child's reachability; don't just override ours with it. Fixes
9565 #58058 (lluis's example).
9566 (FlowBranching): Added public InTryOrCatch(), InCatch(),
9567 InFinally(), InLoop(), InSwitch() and
9568 BreakCrossesTryCatchBoundary() methods.
9570 * statement.cs (Return): Do all error checking in Resolve().
9571 Unless we are the last statement in a top-level block, always
9572 create a return label and jump to it.
9573 (Break, Continue): Do all error checking in Resolve(); also make
9574 sure we aren't leaving a `finally'.
9575 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
9576 statement in a top-level block.
9577 (Block.Flags): Added `IsDestructor'.
9578 (Block.IsDestructor): New public property.
9580 2004-01-20 Martin Baulig <martin@ximian.com>
9582 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
9584 2004-01-20 Martin Baulig <martin@ximian.com>
9586 * statement.cs (Statement.ResolveUnreachable): New public method.
9587 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
9588 (Block.Resolve): Resolve unreachable statements.
9590 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
9592 * expression.cs: We need to fix the case where we do
9593 not have a temp variable here.
9595 * assign.cs: Only expression compound assignments need
9596 temporary variables.
9598 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
9600 * flowanalysis.cs: Reduce memory allocation in a few ways:
9601 - A block with no variables should not allocate a bit
9603 - A method with no out parameters does not need any tracking
9604 for assignment of the parameters, so we need not allocate
9607 public readonly Type[] VariableTypes;
9608 public readonly string[] VariableNames;
9609 Are redundant. The data is already stored in the variable
9610 map, so we need not allocate another array for it.
9611 - We need to add alot of checks for if (params | locals) == null
9612 due to the first two changes.
9614 2004-01-18 Miguel de Icaza <miguel@ximian.com>
9616 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
9617 implement IMemoryLocation, we store a copy on a local variable and
9618 take the address of it. Patch from Benjamin Jemlich
9620 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
9621 to use a special "type_name_expression" rule which reduces the
9622 number of "QualifiedIdentifier" classes created, and instead
9623 directly creates MemberAccess expressions.
9625 2004-01-17 Miguel de Icaza <miguel@ximian.com>
9627 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
9628 that fixes #52853. Null literal assignment to ValueType
9630 * class.cs (MethodData.Emit): Instead of checking the name of the
9631 method to determine if its a destructor, create a new derived
9632 class from Method called Destructor, and test for that.
9634 * cs-parser.jay: Create a Destructor object instead of a Method.
9636 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
9640 2004-01-16 Miguel de Icaza <miguel@ximian.com>
9642 * expression.cs (Binary.ResolveOperator): Perform an implicit
9643 conversion from MethodGroups to their delegate types on the
9646 * delegate.cs: Introduce a new class DelegateCreation that is the
9647 base class for `NewDelegate' and `ImplicitDelegateCreation',
9648 factor some code in here.
9650 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
9651 conversion from MethodGroups to compatible delegate types.
9653 * ecore.cs (Expression.Resolve): Do not flag error 654
9654 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
9655 we allow conversions from MethodGroups to delegate types now.
9657 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
9658 assignments in v2 either.
9660 2004-01-10 Miguel de Icaza <miguel@ximian.com>
9662 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
9663 static read-only fields in ctors.
9665 Applied patch from Benjamin Jemlich
9667 * expression.cs (UnaryMutator): Avoid leaking local variables.
9669 2004-01-09 Miguel de Icaza <miguel@ximian.com>
9671 * cs-tokenizer.cs (IsCastToken): Allow the various native types
9672 here to return true, as they can be used like this:
9676 Fixed 49836 and all the other dups
9678 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
9680 * driver.cs: Implement /win32res and /win32icon.
9682 2004-01-08 Miguel de Icaza <miguel@ximian.com>
9684 * cs-parser.jay: Add a rule to improve error handling for the
9685 common mistake of placing modifiers after the type.
9687 2004-01-07 Miguel de Icaza <miguel@ximian.com>
9689 * cs-parser.jay (interface_event_declaration): Catch
9690 initialization of events on interfaces, and report cs0068
9692 * cs-parser.jay (interface_event_declaration): Catch
9693 initialization of events.
9695 * ecore.cs: Better report missing constructors.
9697 * expression.cs (Binary.ResolveOperator): My previous bug fix had
9698 the error reporting done in the wrong place. Fix.
9700 * expression.cs (Binary.ResolveOperator): Catch the
9701 operator + (E x, E y) error earlier, and later allow for implicit
9702 conversions in operator +/- (E e, U x) from U to the underlying
9705 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
9706 52596, if the container class is abstract, the default constructor
9707 is protected otherwise its public (before, we were always public).
9709 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
9712 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
9713 Jemlich that fixes bug #52597, MCS was generating invalid code for
9714 idisposable structs. Thanks to Ben for following up with this
9717 2004-01-06 Miguel de Icaza <miguel@ximian.com>
9719 * driver.cs: Allow assemblies without code to be generated, fixes
9722 2004-01-07 Nick Drochak <ndrochak@gol.com>
9724 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
9726 2004-01-05 Miguel de Icaza <miguel@ximian.com>
9728 * cs-parser.jay: Add rules to improve error reporting if fields or
9729 methods are declared at the namespace level (error 116)
9731 * Add rules to catch event add/remove
9733 2004-01-04 David Sheldon <dave-mono@earth.li>
9735 * expression.cs: Added matching ")" to error message for
9738 2004-01-03 Todd Berman <tberman@gentoo.org>
9740 * ecore.cs, attribute.cs:
9741 Applying fix from #52429.
9743 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
9745 * ecore.cs, expression.cs, statement.cs:
9746 Total rewrite of how we handle branching. We
9747 now handle complex boolean expressions with fewer
9748 jumps. As well if (x == 0) no longer emits a ceq.
9750 if (x is Foo) is much faster now, because we generate
9753 Overall, we get a pretty big improvement on our benchmark
9754 tests. The code we generate is smaller and more readable.
9756 I did a full two-stage bootstrap. The patch was reviewed
9757 by Martin and Miguel.
9759 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
9761 * cs-parser.jay: Make primary_expression not take a QI.
9762 we dont need this because the member_access rule covers
9763 us here. So we replace the rule with just IDENTIFIER.
9765 This has two good effects. First, we remove a s/r conflict.
9766 Second, we allocate many fewer QualifiedIdentifier objects.
9768 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
9770 * attribute.cs: Handle MarshalAs attributes as pseudo, and
9771 set the correct information via SRE. This prevents
9772 hanging on the MS runtime. Fixes #29374.
9774 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
9776 * convert.cs: correctly handle conversions to value types
9777 from Enum and ValueType as unboxing conversions.
9779 Fixes bug #52569. Patch by Benjamin Jemlich.
9781 2004-01-02 Ravi Pratap <ravi@ximian.com>
9783 * expression.cs (BetterConversion): Prefer int -> uint
9784 over int -> ulong (csc's behaviour). This fixed bug #52046.
9786 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
9788 * decl.cs (MemberCache.FindMembers): now returns a
9791 * typemanager.cs: In general, go with with ^^.
9792 (CopyNewMethods): take an IList.
9793 (RealMemberLookup): Only allocate an arraylist
9794 if we copy from two sets of methods.
9796 This change basically does two things:
9797 1) Fewer array lists allocated due to CopyNewMethods.
9798 2) the explicit cast in MemberList costed ALOT.
9800 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
9802 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
9803 a hashtable to avoid needless string allocations when an identifier is
9804 used more than once (the common case).
9806 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
9808 * pending.cs: MS's TypeBuilder.GetInterfaces ()
9809 is broken, it will not return anything. So, we
9810 have to use the information we have in mcs to
9813 * typemanager.cs: Add a cache for GetInterfaces,
9814 since this will now be used more often (due to ^^)
9816 (GetExplicitInterfaces) New method that gets the
9817 declared, not effective, interfaces on a type
9818 builder (eg, if you have interface IFoo, interface
9819 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
9822 This patch makes MCS able to bootstrap itself on
9825 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
9827 * expression.cs: Remove the Nop's that Miguel put
9830 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
9832 * report.cs, codegen.cs: Give the real stack trace to
9833 the error when an exception is thrown.
9835 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
9837 * decl.cs: only allocate hashtables for ifaces if
9840 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
9842 * expression.cs: fix the error from cs0121-2.cs
9843 (a parent interface has two child interfaces that
9844 have a function with the same name and 0 params
9845 and the function is called through the parent).
9847 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
9849 * class.cs, rootcontext.cs, typmanager.cs: do not
9852 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
9854 * codegen.cs: remove stack for the ec flow branching.
9855 It is already a linked list, so no need.
9857 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
9859 * Makefile: Allow custom profiler here.
9861 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
9863 * typemanager.cs (LookupType):
9864 - Use a static char [], because split takes
9865 a param array for args, so it was allocating
9867 - Do not store true in a hashtable, it boxes.
9869 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
9871 * flowanalysis.cs: bytify common enums.
9873 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
9875 * modifiers.cs: Add a new set of flags for the
9876 flags allowed on explicit interface impls.
9877 * cs-parser.jay: catch the use of modifiers in
9878 interfaces correctly.
9879 * class.cs: catch private void IFoo.Blah ().
9881 All related to bug #50572.
9883 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
9885 * decl.cs: Rewrite the consistant accessability checking.
9886 Accessability is not linear, it must be implemented in
9887 a tableish way. Fixes #49704.
9889 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
9891 * expression.cs: Handle negation in a checked context.
9892 We must use subtraction from zero. Fixes #38674.
9894 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
9896 * class.cs: Ignore static void main in DLLs.
9897 * rootcontext.cs: Handle the target type here,
9898 since we are have to access it from class.cs
9899 * driver.cs: account for the above.
9901 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
9903 * report.cs: Give line numbers and files if available.
9905 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
9907 * driver.cs: Implement /addmodule.
9909 * typemanager.cs: Change 'modules' field so it now contains Modules not
9912 2003-12-20 Martin Baulig <martin@ximian.com>
9914 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
9915 (FieldBase.IsAssigned): Removed this field.
9916 (FieldBase.SetAssigned): New public method.
9917 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
9919 2003-12-20 Martin Baulig <martin@ximian.com>
9921 * expression.cs (LocalVariableReference.DoResolve): Don't set
9922 `vi.Used' if we're called from DoResolveLValue().
9924 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
9925 returns the usage vector it just merged into the current one -
9926 pass this one to UsageWarning().
9927 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
9928 of the `EmitContext', don't call this recursively on our children.
9930 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
9932 * driver.cs: Implement /target:module.
9934 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
9936 * support.cs (CharArrayHashtable): New helper class.
9938 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
9939 char arrays, not strings, so we can avoid creating a string in
9940 consume_identifier if the identifier is a keyword.
9942 2003-12-16 Martin Baulig <martin@ximian.com>
9944 * statement.cs (LocalInfo.Assigned): Removed this property.
9945 (LocalInfo.Flags): Removed `Assigned'.
9946 (LocalInfo.IsAssigned): New public method; takes the EmitContext
9947 and uses flow analysis.
9948 (Block.UsageWarning): Made this method private.
9949 (Block.Resolve): Call UsageWarning() if appropriate.
9951 * expression.cs (LocalVariableReference.DoResolve): Always set
9952 LocalInfo.Used here.
9954 2003-12-13 Martin Baulig <martin@ximian.com>
9956 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
9957 any value here; we're now using flow analysis to figure out
9958 whether a statement/block returns a value.
9960 2003-12-13 Martin Baulig <martin@ximian.com>
9962 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
9964 (FlowBranching.MergeFinally): Don't call
9965 `branching.CheckOutParameters()' here, this is called in
9967 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
9968 when adding the `finally' vector.
9970 2003-12-13 Martin Baulig <martin@ximian.com>
9973 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
9974 actually work and also fix #48962.
9976 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
9978 * decl.cs: Do not check System.Object for nested types,
9979 since we know it does not have any. Big bang for buck:
9984 corlib: 17.99 seconds
9988 corlib: 17.39 seconds
9990 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
9992 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
9993 time we are returning 0 members, so we save alot here.
9995 2003-12-11 Martin Baulig <martin@ximian.com>
9997 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
9998 `MergeChild()', also just take the `FlowBranching' as argument;
9999 call Merge() on it and return the result.
10000 (FlowBranching.Merge): We don't need to do anything if we just
10003 2003-12-11 Martin Baulig <martin@ximian.com>
10005 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
10006 them in an `ArrayList' to reduce memory usage. Thanks to Ben
10007 Maurer for this idea.
10009 2003-12-11 Martin Baulig <martin@ximian.com>
10011 * flowanalysis.cs (MergeResult): This class is now gone; we now
10012 use the `UsageVector' for this. The reason for this is that if a
10013 branching just has one sibling, we don't need to "merge" them at
10014 all - that's the next step to do.
10015 (FlowBranching.Merge): We now return a `UsageVector' instead of a
10018 2003-12-11 Martin Baulig <martin@ximian.com>
10020 Reworked flow analyis and made it more precise and bug-free. The
10021 most important change is that we're now using a special `Reachability'
10022 class instead of having "magic" meanings of `FlowReturns'. I'll
10023 do some more cleanups and optimizations and also add some more
10024 documentation this week.
10026 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
10027 largely reworked this class.
10028 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
10029 the new `Reachability' class instead of having "magic" values here.
10030 (FlowBranching): We're now using an instance of `Reachability'
10031 instead of having separate `Returns', `Breaks' etc. fields.
10033 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
10034 based on flow analysis; ignore the return value of block.Emit ().
10036 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
10038 * driver.cs typemanager.cs: Find the mono extensions to corlib even
10039 if they are private.
10041 2003-12-09 Martin Baulig <martin@ximian.com>
10043 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
10044 call them directly on the UsageVector.
10046 2003-12-09 Martin Baulig <martin@ximian.com>
10048 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
10049 Changed return type from `FlowReturns' to `Reachability'.
10051 2003-12-09 Martin Baulig <martin@ximian.com>
10053 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
10054 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
10055 `Reachable' fields with a single `Reachability' one.
10057 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10059 * class.cs (FindMembers): Remove foreach's.
10064 Run 1: 8.74 seconds
10065 Run 2: 8.71 seconds
10068 Run 1: 8.64 seconds
10069 Run 2: 8.58 seconds
10072 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10077 This patch does a few things:
10078 1. EmptyStatement is now a singleton, so it is never reallocated.
10079 2. All blah is EmptyStatement constructs have been changed to
10080 blah == EmptyStatement.Value, which is much faster and valid
10081 now that EmptyStatement is a singleton.
10082 3. When resolving a block, rather than allocating a new array for
10083 the non-empty statements, empty statements are replaced with
10084 EmptyStatement.Value
10085 4. Some recursive functions have been made non-recursive.
10086 Mainly the performance impact is from (3), however (1) and (2) are needed for
10087 this to work. (4) does not make a big difference in normal situations, however
10088 it makes the profile look saner.
10093 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10094 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10095 Total memory allocated: 56397 KB
10098 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
10099 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
10100 Total memory allocated: 55666 KB
10102 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10104 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
10105 than the hashtable in a hashtable version
10107 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
10108 we always end up concating a string. This results in a huge perf
10109 loss, because many strings have to be tracked by the GC. In this
10110 patch, we first use a hashtable that works with two keys, so that
10111 the strings do not need to be concat'ed.
10115 Run 1: 8.74 seconds
10116 Run 2: 8.71 seconds
10119 Run 1: 8.65 seconds
10120 Run 2: 8.56 seconds
10122 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10124 * Makefile: Add a new target `do-time' that does a quick and simple
10125 profile, leaving easy to parse output.
10127 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
10129 * codegen.cs (Init): Create the dynamic assembly with
10130 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
10132 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
10134 * support.cs: Make the PtrHashtable use only one
10135 instance of its comparer.
10137 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
10139 * typemanager.cs: Fix lookup of GetNamespaces.
10141 2003-11-29 Miguel de Icaza <miguel@ximian.com>
10143 * expression.cs: Removed redundant line.
10145 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
10146 ArrayLists, use for loops with bounds.
10148 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
10151 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
10152 arraylists, use for loop with bounds.
10154 The above three changes give us a 0.071 second performance
10155 improvement out of 3.294 seconds down to 3.223. On my machine
10156 the above changes reduced the memory usage by 1,387 KB during
10157 compiler bootstrap.
10159 * cs-parser.jay (QualifiedIdentifier): New class used to represent
10160 QualifiedIdentifiers. Before we created a new string through
10161 concatenation, and mostly later on, the result would be
10162 manipulated by DecomposeQI through string manipulation.
10164 This reduced the compiler memory usage for bootstrapping from
10165 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
10166 compile times in 0.05 seconds.
10168 2003-11-28 Dick Porter <dick@ximian.com>
10170 * support.cs: Do string compares with the Invariant culture.
10178 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
10179 the comparison is done with the Invariant culture.
10181 2003-11-27 Miguel de Icaza <miguel@ximian.com>
10183 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
10184 GetEnumerator method.
10186 (ProbeCollectionType): Iterate starting at the most specific type
10187 upwards looking for a GetEnumerator
10189 * expression.cs: Shift count can be up to 31 for int/uint and 63
10192 2003-11-26 Miguel de Icaza <miguel@ximian.com>
10194 * statement.cs (Block.LookupLabel): Also look for the label on the
10195 children blocks. Use a hash table to keep track of visited
10198 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
10199 we actually did transform the other operand, otherwise fall back
10200 to the common codepath that casts to long.
10202 * cs-tokenizer.cs: Use the same code pattern as the int case.
10203 Maybe I should do the parsing myself, and avoid depending on the
10204 Parse routines to get this done.
10206 2003-11-25 Miguel de Icaza <miguel@ximian.com>
10208 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
10209 which fixes bug 51347. This time test it.
10211 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
10212 attributes for example can not tell the difference between these.
10213 The difference was only a syntax feature of the language.
10215 * attribute.cs: Apply attributes to delegates.
10217 * delegate.cs: Call the apply attributes method.
10219 2003-11-24 Miguel de Icaza <miguel@ximian.com>
10221 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
10222 comparing 0 vs Byte.MinValue, not the value
10224 (ImplicitConversionRequired): When reporting a conversion error,
10225 use error 31 to print out the constant error instead of the
10228 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
10229 which fixes bug 51347.
10231 2003-11-22 Miguel de Icaza <miguel@ximian.com>
10233 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
10234 which fixes the -warnaserror command line option.
10236 2003-11-21 Miguel de Icaza <miguel@ximian.com>
10238 * cfold.cs (DoNumericPromotions): During constant folding of
10239 additions on UIntConstant, special case intconstants with
10240 IntConstants like we do on the expression binary operator.
10242 2003-11-12 Miguel de Icaza <miguel@ximian.com>
10244 * convert.cs (ImplicitReferenceConversion): We were missing a case
10245 (System.Enum are not value types or class types, so we need to
10246 classify them separatedly).
10248 * driver.cs: We do not support error 2007.
10250 2003-11-12 Jackson Harper <jackson@ximian.com>
10252 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
10253 system directory. Also use the full file name so users can
10254 libraries names mscorlib-o-tron.dll in a non system dir.
10256 2003-11-10 Martin Baulig <martin@ximian.com>
10258 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
10259 (TypeManager.InitCoreTypes): Initialize them here, but instead of
10260 calling `ResolveType()' on them, directly assign their `Type'.
10262 2003-11-08 Martin Baulig <martin@ximian.com>
10264 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
10265 return value and the `out parent' parameter.
10266 (TypeContainer.DefineType): Moved the CS0644 check into
10267 GetClassBases(). Don't pass the interface types to the
10268 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
10269 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
10271 * ecore.cs (TypeExpr.IsAttribute): New property.
10272 (TypeExpr.GetInterfaces): New method.
10274 * interface.cs (Interface.GetInterfaceTypeByName): Return a
10275 TypeExpr instead of a Type.
10276 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
10277 (Interface.DefineType): Don't pass the interface types to the
10278 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
10279 them later and then call `TypeBulider.AddInterfaceImplementation()'.
10281 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
10282 instead of a `Type[]'.
10283 (TypeManager.RegisterBuilder): Likewise.
10284 (TypeManager.AddUserInterface): Likewise.
10285 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
10286 `Type[]' and also return a `TypeExpr[]'.
10287 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
10289 2003-11-08 Martin Baulig <martin@ximian.com>
10291 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
10294 2003-11-08 Martin Baulig <martin@ximian.com>
10296 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
10297 TypeManager.ResolveExpressionTypes().
10299 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
10300 instead of an Expression.
10301 (TypeExpr): This is now an abstract base class for `TypeExpression'.
10302 (TypeExpression): New public class; formerly known as `TypeExpr'.
10304 * expression.cs (ComposedCast): Derive from TypeExpr.
10306 * typemanager.cs (TypeManager.system_*_expr): These are now
10307 TypExpr's instead of Expression's.
10308 (TypeManager.ResolveExpressionTypes): New public static function;
10309 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
10312 2003-11-06 Miguel de Icaza <miguel@ximian.com>
10314 * expression.cs (New.DoResolve): Do not dereference value that
10315 might be a null return.
10317 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
10318 sure that the constant value has the right type. Fixes an
10319 unreported bug, similar to 50425.
10321 * const.cs (Const.LookupConstantValue): Call
10322 ImplicitStandardConversionExists before doing a conversion to
10323 avoid havng the TypeManager.ChangeType do conversions.
10325 Reduced the number of casts used
10327 (Const.ChangeType): New routine to enable reuse of the constant
10328 type changing code from statement.
10330 * typemanager.cs (ChangeType): Move common initialization to
10331 static global variables.
10335 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
10336 every value type to go through, even if it was void. Fix that.
10338 * cs-tokenizer.cs: Use is_identifier_start_character on the start
10339 character of the define, and the is_identifier_part_character for
10340 the rest of the string.
10342 2003-11-05 Miguel de Icaza <miguel@ximian.com>
10344 * expression.cs (UnaryMutator.EmitCode): When I updated
10345 LocalVariableReference.DoResolve, I overdid it, and dropped an
10346 optimization done on local variable references.
10348 2003-11-04 Miguel de Icaza <miguel@ximian.com>
10350 * ecore.cs: Convert the return from Ldlen into an int.
10352 2003-10-20 Miguel de Icaza <miguel@ximian.com>
10354 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
10355 the accessibility, this is a special case for toplevel non-public
10356 classes (internal for instance).
10358 2003-10-20 Nick Drochak <ndrochak@gol.com>
10360 * ecore.cs: Fix typo and build. Needed another right paren.
10362 2003-10-19 Miguel de Icaza <miguel@ximian.com>
10364 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
10365 `internal' case regular and protected, but not allowing protected
10366 to be evaluated later. Bug 49840
10368 2003-10-15 Miguel de Icaza <miguel@ximian.com>
10370 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
10371 to kb.Nlast, and not the kb.nFirst to isolate the switch
10374 Extract the underlying type, so enumerations of long/ulong are
10375 treated like long/ulong.
10377 2003-10-14 Miguel de Icaza <miguel@ximian.com>
10379 * expression.cs (New): Overload the meaning of RequestedType to
10380 track the possible creation of the NewDelegate type, since
10381 DoResolve is invoked more than once for new constructors on field
10384 See bugs: #48800 and #37014
10386 * cs-parser.jay (declare_local_constants): Take an arraylist
10387 instead of a single constant.
10389 (local_constant_declaration): It should take a
10390 constant_declarators, not a constant_declarator. Fixes 49487
10392 * convert.cs: Fix error report.
10394 2003-10-13 Jackson Harper <jackson@ximian.com>
10396 * typemanager.cs (TypeToCoreType): Add float and double this fixes
10399 2003-10-09 Martin Baulig <martin@ximian.com>
10401 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
10403 (MethodCore.DoDefineParameters): Removed the TypeContainer
10404 argument; use the DeclSpace which was passed to the .ctor instead.
10405 (MethodCore.CheckParameter): Take a DeclSpace instead of a
10406 TypeContainer; we only need a DeclSpace here.
10408 2003-10-09 Martin Baulig <martin@ximian.com>
10410 * class.cs (MethodData): Added additional `DeclSpace ds' argument
10412 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
10413 EmitContext's .ctor.
10415 2003-10-09 Martin Baulig <martin@ximian.com>
10417 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
10418 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
10419 AsAccessible(), moved them as well.
10421 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
10423 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
10425 * cs-parser.jay : Renamed yyName to yyNames related to jay.
10427 2003-10-07 Miguel de Icaza <miguel@ximian.com>
10429 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
10430 generation for >=, as spotted by Paolo, bug 48679.
10431 Patch from David Waite.
10433 * cs-tokenizer.cs: Add handling for #pragma.
10435 * cs-parser.jay: Allow for both yield and yield return in the
10436 syntax. The anti-cobolization of C# fight will go on!
10438 * class.cs (TypeBuilder.DefineType): Catch error condition here
10439 (Parent.DefineType erroring out and returning null).
10441 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10442 coping with enumerations variables, we were mistakenly processing
10443 them as a regular value type instead of built-in types. Fixes the
10446 * typemanager.cs (IsBuiltinOrEnum): New method.
10448 2003-09-30 Miguel de Icaza <miguel@ximian.com>
10450 * cs-parser.jay: Upgrade: yield now needs the return clause.
10452 2003-09-19 Martin Baulig <martin@ximian.com>
10454 * decl.cs (MemberCache.SetupCacheForInterface): Take a
10455 `MemberCache parent' argument. Normally, an interface doesn't
10456 have a parent type except System.Object, but we use this in gmcs
10457 for generic type parameters.
10459 2003-09-18 Martin Baulig <martin@ximian.com>
10461 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
10462 on `type.IsInterface'; don't check whether the type has a parent
10463 to determine whether it's an interface.
10465 2003-09-15 Martin Baulig <martin@ximian.com>
10467 * class.cs (TypeContainer.DefineType): Added an error flag to
10468 avoid reporting duplicate CS0146's ("class definition is
10471 * driver.cs (Driver.MainDriver): Abort if
10472 RootContext.ResolveTree() reported any errors.
10474 2003-09-07 Martin Baulig <martin@ximian.com>
10476 * report.cs (Error, Warning): Added overloaded versions which take
10477 a `params object[] args' and call String.Format().
10479 2003-09-07 Martin Baulig <martin@ximian.com>
10481 * decl.cs (DeclSpace..ctor): Don't call
10482 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
10483 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
10484 (DeclSpace.RecordDecl): New method.
10486 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
10488 2003-09-02 Ravi Pratap <ravi@ximian.com>
10490 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
10491 value attributes to be applied to ParameterBuilders.
10493 * class.cs (MethodCore.LabelParameters): Make static and more
10494 generic so that it can be used from other places - like interface
10495 methods, for instance.
10497 * interface.cs (Interface.Emit): Call LabelParameters before
10498 emitting attributes on the InterfaceMethod.
10500 2003-08-26 Martin Baulig <martin@ximian.com>
10502 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
10503 resolving aliases; fixes #47927.
10505 2003-08-26 Martin Baulig <martin@ximian.com>
10507 * statement.cs (Using.DoResolve): This is internally emitting a
10508 try/finally clause, so we need to set ec.NeedExplicitReturn if we
10509 do not always return. Fixes #47681.
10511 2003-08-26 Martin Baulig <martin@ximian.com>
10513 * decl.cs (MemberCore): Moved WarningNotHiding(),
10514 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
10516 (AdditionResult): Make this nested in DeclSpace.
10517 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
10518 argument; call NamespaceEntry.Define() unless we're nested in a
10521 * namespace.cs (Namespace.DefineName): New public function. This
10522 is called from DeclSpace's .ctor to add
10523 (Namespace.Lookup): Include DeclSpaces in the lookup.
10525 * class.cs (Operator): Derive from MemberBase, not MemberCore.
10527 * const.cs (Const): Derive from MemberBase, not MemberCore.
10529 2003-08-25 Martin Baulig <martin@ximian.com>
10531 * convert.cs (Convert.ExplicitReferenceConversion): When
10532 converting from an interface type to a class, unbox if the target
10533 type is a struct type. Fixes #47822.
10535 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10537 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
10540 2003-08-22 Martin Baulig <martin@ximian.com>
10542 * class.cs (TypeManager.DefineType): When defining a nested type,
10543 call DefineType() on our parent; fixes #47801.
10545 2003-08-22 Martin Baulig <martin@ximian.com>
10547 * class.cs (MethodData.Define): While checking if a method is an
10548 interface implementation, improve the test a bit more to fix #47654.
10550 2003-08-22 Martin Baulig <martin@ximian.com>
10552 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
10553 correctly; fixes #47722.
10555 2003-08-22 Martin Baulig <martin@ximian.com>
10557 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
10558 LocalVariableReference, ensure it's not read-only. Fixes #47536.
10560 * statement.cs (Fixed.DoResolve): Make all variables read-only.
10562 2003-08-22 Martin Baulig <martin@ximian.com>
10564 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
10565 can only be assigned in static constructors. Fixes #47161.
10567 2003-08-22 Martin Baulig <martin@ximian.com>
10569 Rewrote and improved the flow analysis code.
10571 * flowbranching.cs (FlowBranching): Make this class abstract.
10572 (FlowBranching.CreateBranching): New static function to create a
10573 new flow branching.
10574 (FlowBranchingBlock, FlowBranchingException): New classes.
10575 (FlowBranching.UsageVector.Type): New public readonly field.
10576 (FlowBranching.UsageVector.Breaks): Removed the setter.
10577 (FlowBranching.UsageVector.Returns): Removed the setter.
10578 (FlowBranching.UsageVector): Added Break(), Return(),
10579 NeverReachable() and Throw() methods to modify the reachability.
10580 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
10581 done by FlowBranching.Merge().
10582 (FlowBranching.UsageVector.MergeChild): New method; merges the
10583 merge result into the current vector.
10584 (FlowBranching.Merge): New abstract method to merge a branching.
10586 2003-08-12 Martin Baulig <martin@ximian.com>
10588 * expression.cs (Indirection.CacheTemporaries): Create the
10589 LocalTemporary with the pointer type, not its element type.
10591 2003-08-10 Miguel de Icaza <miguel@ximian.com>
10593 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
10594 token was a keyword or not.
10596 Add `error' options where an IDENTIFIER was expected; Provide
10597 CheckToken and CheckIdentifierToken convenience error reporting
10600 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
10602 * decl.cs: Rename `NamespaceEntry Namespace' public field into
10603 NameSpaceEntry NameSpaceEntry.
10605 (LookupInterfaceOrClass): Avoid creating a full qualified name
10606 from namespace and name: avoid doing lookups when we know the
10607 namespace is non-existant. Use new Tree.LookupByNamespace which
10608 looks up DeclSpaces based on their namespace, name pair.
10610 * driver.cs: Provide a new `parser verbose' to display the
10611 exception thrown during parsing. This is turned off by default
10612 now, so the output of a failure from mcs is more graceful.
10614 * namespace.cs: Track all the namespaces defined in a hashtable
10617 (IsNamespace): New method
10619 2003-08-09 Miguel de Icaza <miguel@ximian.com>
10621 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
10622 we know that we need to concatenate (full typename can never be
10627 * statement.cs: Use a bitfield; Do not initialize to null things
10628 which are done by the constructor by default.
10630 * cs-parser.jay: bug fix, parameter was 4, not 3.
10632 * expression.cs: Just use the property;
10634 * statement.cs: No need for GetVariableInfo method.
10636 2003-08-08 Martin Baulig <martin@ximian.com>
10638 * flowanalysis.cs (FlowReturns): This is now nested in the
10639 `FlowBranching' class.
10640 (MyBitVector): Moved this here from statement.cs.
10641 (FlowBranching.SiblingType): New enum type.
10642 (FlowBranching.CreateSibling): Added `SiblingType' argument.
10644 2003-08-07 Martin Baulig <martin@ximian.com>
10646 * flowanalysis.cs (FlowBranchingType): This is now nested in the
10647 `FlowBranching' class and called `BranchingType'.
10649 2003-08-07 Martin Baulig <martin@ximian.com>
10651 * flowanalysis.cs: Moved all the control flow analysis code into
10654 2003-08-07 Martin Baulig <martin@ximian.com>
10656 * assign.cs (Assign.DoResolve): `target' must either be an
10657 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
10660 2003-08-07 Miguel de Icaza <miguel@ximian.com>
10662 * expression.cs (BinaryMethod): This kind of expression is created by the
10663 Binary class if it determines that the operator has to be handled
10666 (BinaryDelegate): This kind of expression is created if we are
10667 dealing with a + or - operator on delegates.
10669 (Binary): remove method, argumetns, and DelegateOperator: when
10670 dealing with methods,
10672 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
10674 * statement.cs (Block): use bitfields for the three extra booleans
10675 we had in use. Remove unused topblock parameter.
10677 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
10679 * assign.cs: Drop extra unneeded tests.
10681 2003-08-06 Miguel de Icaza <miguel@ximian.com>
10683 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
10685 * statement.cs (Foreach): Use VariableStorage instead of
10688 * codegen.cs (VariableStorage): New class used by clients that
10689 require a variable stored: locals or fields for variables that
10690 need to live across yield.
10692 Maybe provide a convenience api for EmitThis+EmitLoad?
10694 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
10697 2003-08-05 Miguel de Icaza <miguel@ximian.com>
10699 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
10700 RemapParameterLValue): New methods that are used to turn a
10701 precomputed FieldInfo into an expression like this:
10705 The idea is to use this instead of making LocalVariableReference
10706 have more than one meaning.
10708 * cs-parser.jay: Add error production to BASE.
10710 * ecore.cs: Deal with TypeManager.GetField returning null, which
10711 is now a valid return value.
10713 (FieldExprNoAddress): New expression for Fields whose address can
10716 * expression.cs (LocalVariableReference): During the resolve
10717 phases, create new expressions if we are in a remapping context.
10718 Remove code that dealt with remapping here.
10720 (ParameterReference): same.
10722 (ProxyInstance): New expression, like the `This' expression, but
10723 it is born fully resolved. We know what we are doing, so remove
10724 the errors that are targeted to user-provided uses of `this'.
10726 * statement.cs (Foreach): our variable is now stored as an
10727 Expression; During resolution, follow the protocol, dont just
10728 assume it will return this.
10730 2003-08-06 Martin Baulig <martin@ximian.com>
10732 * support.cs (SeekableStreamReader.cs): New public class.
10734 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
10735 SeekableStreamReader instead of the normal StreamReader.
10737 2003-08-04 Martin Baulig <martin@ximian.com>
10739 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
10740 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
10741 deambiguate casts and delegate invocations.
10742 (parenthesized_expression): Use the new tokens to ensure this is
10743 not a cast of method invocation.
10745 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
10746 when reading a `)' and Deambiguate_CloseParens () was previously
10749 * expression.cs (ParenthesizedExpression): New class. This is
10750 just used for the CS0075 test.
10751 (Binary.DoResolve): Check for CS0075.
10753 2003-07-29 Ravi Pratap <ravi@ximian.com>
10755 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
10756 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
10757 reference comparison.
10759 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
10760 examine the ReturnType for equality - this is necessary in the
10761 cases of implicit and explicit operators whose signature also
10762 includes the return type.
10764 2003-07-26 Miguel de Icaza <miguel@ximian.com>
10766 * namespace.cs: Cache the result of the namespace computation,
10767 instead of computing it every time.
10769 2003-07-24 Miguel de Icaza <miguel@ximian.com>
10771 * decl.cs: Use a global arraylist that we reuse over invocations
10772 to avoid excesive memory consumption. Reduces memory usage on an
10773 mcs compile by one meg (45 average).
10775 * typemanager.cs (LookupTypeReflection): In .NET pointers are
10776 private, work around that.
10778 2003-07-23 Miguel de Icaza <miguel@ximian.com>
10780 * literal.cs (IntLiteral): Define Zero and One static literals.
10782 * cs-parser.jay (integer_literal): use static literals to reduce
10783 memory usage for the most used literals (0, 1 and -1). 211kb
10784 reduced in memory usage.
10786 Replace all calls to `new ArrayList' with `new
10787 ArrayList(4)' which is a good average number for most allocations,
10788 and also requires only 16 bytes of memory for its buffer by
10791 This reduced MCS memory usage in seven megabytes for the RSS after
10794 2003-07-28 Ravi Pratap <ravi@ximian.com>
10796 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
10797 handle params methods the correct way by forming only one
10798 applicable set with params and normal methods in them. Earlier we
10799 were looking at params methods only if we found no normal methods
10800 which was not the correct thing to do.
10802 (Invocation.BetterFunction): Take separate arguments indicating
10803 when candidate and the best method are params methods in their
10806 This fixes bugs #43367 and #46199.
10808 * attribute.cs: Documentation updates.
10810 (CheckAttribute): Rename to CheckAttributeTarget.
10811 (GetValidPlaces): Rename to GetValidTargets.
10813 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
10814 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
10818 2003-07-28 Martin Baulig <martin@ximian.com>
10820 * class.cs (TypeContainer.DefineMembers): Use the base type's full
10821 name when looking up the base class of a nested class. Fixes #46977.
10823 2003-07-26 Martin Baulig <martin@ximian.com>
10825 * expression.cs (Indexers.Indexer): New nested struct; contains
10826 getter, setter and the indexer's type.
10827 (Indexers.Properties): This is now an ArrayList of
10828 Indexers.Indexer's.
10829 (IndexerAccess.DoResolveLValue): Correctly set the type if the
10830 indexer doesn't have any getters.
10832 * assign.cs (Assign.DoResolve): Also do the implicit conversions
10833 for embedded property and indexer assignments.
10835 2003-07-26 Martin Baulig <martin@ximian.com>
10837 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
10838 preprocessor directive is not the first non-whitespace character
10841 2003-07-26 Martin Baulig <martin@ximian.com>
10843 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
10844 namespace parsing, follow the spec more closely.
10846 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
10847 NamespaceEntry.Lookup().
10849 2003-07-25 Martin Baulig <martin@ximian.com>
10851 * MethodCore.cs (OverridesSomething): New public field; it's set
10852 from TypeContainer.DefineMembers if this method overrides
10853 something (which doesn't need to be a method). Fix #39462.
10855 2003-07-25 Ravi Pratap <ravi@ximian.com>
10857 * typemanager.cs (GetMembers): Ensure that the list of members is
10858 reversed. This keeps things in sync.
10860 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
10861 find an AttributeUsage attribute.
10863 * expression.cs (Invocation.OverloadResolve): Perform the check
10864 which disallows Invoke to be directly called on a Delegate.
10866 (Error_InvokeOnDelegate): Report error cs1533.
10868 2003-07-25 Martin Baulig <martin@ximian.com>
10870 * expression.cs (Indexers.GetIndexersForType): Only look in the
10871 interface hierarchy if the requested type is already an
10872 interface. Fixes #46788 while keeping #46502 fixed.
10874 2003-07-25 Martin Baulig <martin@ximian.com>
10876 * class.cs (TypeContainer.DefineMembers): Check whether all
10877 readonly fields have been assigned and report warning CS0649 if
10880 * statement.cs (LocalInfo.IsFixed): Always return true if this is
10883 2003-07-24 Ravi Pratap <ravi@ximian.com>
10885 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
10886 returned from GetMethods to make things consistent with the
10887 assumptions MCS makes about ordering of methods.
10889 This should comprehensively fix bug #45127 and it does :-)
10891 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
10892 ordering is actually reverse.
10894 * Clean up some debug messages I left lying around.
10896 * interface.cs (Populate*): Get rid of code which emits attributes
10897 since the stage in which we emit attributes is the 'Emit' stage,
10898 not the define stage.
10900 (Emit): Move attribute emission for interface members here.
10902 2003-07-22 Ravi Pratap <ravi@ximian.com>
10904 * expression.cs (Invocation.OverloadResolve): Follow the spec more
10905 closely: we eliminate methods in base types when we have an
10906 applicable method in a top-level type.
10908 Please see section 14.5.5.1 for an exact description of what goes
10911 This fixes bug #45127 and a host of other related to corlib compilation.
10913 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
10914 array is the method corresponding to the top-level type (this is
10915 because of the changes made to icall.c) so we change this
10918 (MethodGroupExpr.Name): This too.
10920 * typemanager.cs (GetElementType): New method which does the right
10921 thing when compiling corlib.
10923 * everywhere: Make use of the above in the relevant places.
10925 2003-07-22 Martin Baulig <martin@ximian.com>
10927 * cs-parser.jay (invocation_expression): Moved
10928 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
10929 `cast_expression', but create a InvocationOrCast which later
10930 resolves to either an Invocation or a Cast.
10932 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
10933 method; call this before EmitStatement() to make sure that this
10934 expression can be used as a statement.
10936 * expression.cs (InvocationOrCast): New class; resolves to either
10937 an Invocation or a Cast.
10939 * statement.cs (StatementExpression): Call ResolveStatement() on
10940 the ExpressionStatement before emitting it.
10942 2003-07-21 Martin Baulig <martin@ximian.com>
10944 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
10945 `ref' and `out' attributes match; fixes #46220.
10946 (MemberAccess.ResolveMemberAccess): You can't reference a type
10947 through an expression; fixes #33180.
10948 (Indexers.GetIndexersForType): Don't return the indexers from
10949 interfaces the class implements; fixes #46502.
10951 2003-07-21 Martin Baulig <martin@ximian.com>
10953 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
10954 CS0661 checks; fixes bug #30442.
10956 2003-07-21 Martin Baulig <martin@ximian.com>
10958 * decl.cs (AdditionResult): Added `Error'.
10960 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
10962 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
10963 makes cs0031.cs actually work.
10965 2003-07-20 Martin Baulig <martin@ximian.com>
10967 * namespace.cs: Fixed that bug which caused a crash when compiling
10968 the debugger's GUI.
10970 2003-07-20 Miguel de Icaza <miguel@ximian.com>
10972 * typemanager.cs (LookupTypeReflection): Never expose types which
10973 are NotPublic, NestedPrivate, NestedAssembly, or
10974 NestedFamANDAssem. We used to return these, and later do a check
10975 that would report a meaningful error, but the problem is that we
10976 would not get the real match, if there was a name override.
10978 2003-07-18 Miguel de Icaza <miguel@ximian.com>
10980 * namespace.cs (Namespace, Name): Do not compute the namespace
10981 name dynamically, compute it in the constructor. This reduced
10982 memory usage by 1697 KB.
10984 * driver.cs: Use --pause to pause at the end.
10986 2003-07-17 Peter Williams <peter@newton.cx>
10988 * Makefile: Change the name of the test target so that it doesn't
10989 conflict with the recursive test target.
10991 2003-07-17 Miguel de Icaza <miguel@ximian.com>
10993 * expression.cs (LocalVariableReference.Emit, EmitAssign,
10994 AddressOf): Do not use EmitThis, that was wrong, use the actual
10997 2003-07-15 Miguel de Icaza <miguel@ximian.com>
10999 * class.cs (MethodData.Define): While checking if a method is an
11000 interface implementation, improve the test: If we are not public
11001 (use new test here: use the computed MethodAttributes directly,
11002 instead of the parsed modifier flags) check if the `implementing'
11003 method comes from an interface or not.
11005 * pending.cs (VerifyPendingMethods): Slightly better error
11008 * makefile: add test target that does the mcs bootstrap.
11010 2003-07-16 Ravi Pratap <ravi@ximian.com>
11012 * interface.cs (Define): Do nothing here since there are no
11013 members to populate etc. Move the attribute emission out of here
11014 since this was just totally the wrong place to put it. Attribute
11015 application happens during the 'Emit' phase, not in the 'Define'
11018 (Emit): Add this method and move the attribute emission here
11020 * rootcontext.cs (EmitCode): Call the Emit method on interface
11023 2003-07-14 Ravi Pratap M <ravi@ximian.com>
11025 * expression.cs (OverloadResolve): Report error only if Location
11026 is not 'Null' which means that there was a probe going on.
11028 2003-07-14 Martin Baulig <martin@ximian.com>
11030 * expression.cs (ConditionalLogicalOperator): New public class to
11031 implement user defined conditional logical operators.
11032 This is section 14.11.2 in the spec and bug #40505.
11034 2003-07-14 Martin Baulig <martin@ximian.com>
11036 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
11038 2003-07-14 Martin Baulig <martin@ximian.com>
11040 * codegen.cs (EmitContext.InFixedInitializer): New public field.
11042 * ecore.cs (IVariable.VerifyFixed): New interface method.
11044 * expression.cs (Unary.ResolveOperator): When resolving the `&'
11045 operator, check whether the variable is actually fixed. Fixes bug
11046 #36055. Set a variable definitely assigned when taking its
11047 address as required by the spec.
11049 * statement.cs (LocalInfo.IsFixed): New field.
11050 (LocalInfo.MakePinned): Set `IsFixed' to true.
11052 2003-07-14 Ravi Pratap M <ravi@ximian.com>
11054 * attribute.cs (Attribute.Resolve): While doing a Member lookup
11055 for .ctors, ensure that we only ask for members declared in the
11056 attribute type (BindingFlags.DeclaredOnly).
11060 * expression.cs (Error_WrongNumArguments): Report error 1501
11061 correctly the way CSC does.
11063 2003-07-13 Martin Baulig <martin@ximian.com>
11065 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
11066 lookup on the fully qualified name, to make things like "X.X" work
11067 where "X.X" is a fully qualified type name, but we also have a
11068 namespace "X" in the using list. Fixes #41975.
11070 2003-07-13 Martin Baulig <martin@ximian.com>
11072 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
11073 function. If we're a CompoundAssign, we need to create an embedded
11074 CompoundAssign, not an embedded Assign.
11075 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
11078 2003-07-13 Martin Baulig <martin@ximian.com>
11080 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
11081 work to fix bug #46088.
11083 2003-07-13 Ravi Pratap <ravi@ximian.com>
11085 * class.cs (Operator.Emit): Do not emit attributes here - it is
11086 taken care of by the Method class that we delegate too. This takes
11087 care of bug #45876.
11089 2003-07-10 Martin Baulig <martin@ximian.com>
11091 * expression.cs (TypeOfVoid): New class.
11092 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
11094 2003-07-10 Martin Baulig <martin@ximian.com>
11096 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
11099 2003-07-10 Martin Baulig <martin@ximian.com>
11101 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
11102 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
11104 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
11106 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
11108 2003-07-10 Martin Baulig <martin@ximian.com>
11110 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
11111 of decimal. Fixes #42850.
11113 NOTE: I also fixed the created byte blob, but this doesn't work on
11114 the MS runtime and csc never produces any byte blobs for decimal
11117 2003-07-10 Martin Baulig <martin@ximian.com>
11119 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
11120 structs; fixes #32068.
11121 (Block.AddChildVariableNames): Fixed #44302.
11123 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11125 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
11127 2003-07-07 Miguel de Icaza <miguel@ximian.com>
11129 * attribute.cs: And this test is onger needed.
11131 2003-07-08 Martin Baulig <martin@ximian.com>
11133 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
11134 inaccessible types. Fixes #36313.
11136 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
11138 * namespace.cs (NamespaceEntry): Create implicit entries for all
11139 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
11140 implicit entries for N1.N2 and N1.
11142 2003-07-08 Martin Baulig <martin@ximian.com>
11144 Rewrote the handling of namespaces to fix a lot of the issues
11145 wrt. `using' aliases etc.
11147 * namespace.cs (Namespace): Splitted this class into a
11148 per-assembly `Namespace' and a per-file `NamespaceEntry'.
11150 * typemanager.cs (TypeManager.IsNamespace): Removed.
11151 (TypeManager.ComputeNamespaces): Only compute namespaces from
11152 loaded assemblies here, not the namespaces from the assembly we're
11153 currently compiling.
11155 2003-07-08 Martin Baulig <martin@ximian.com>
11157 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
11159 2003-07-07 Miguel de Icaza <miguel@ximian.com>
11161 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
11164 I thought about the memory savings here, but LookupTypeReflection
11165 is used under already very constrained scenarios. Compiling
11166 corlib or mcs only exposes one hit, so it would not really reduce
11167 any memory consumption.
11169 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11171 * typemanager.cs: fixes bug #45889 by only adding public types from
11172 other assemblies to the list of known types.
11174 2003-07-07 Miguel de Icaza <miguel@ximian.com>
11176 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
11177 on the type we resolved.
11179 2003-07-05 Martin Baulig <martin@ximian.com>
11181 * pending.cs (PendingImplementation.ParentImplements): Don't
11182 create the proxy if the parent is abstract.
11184 * class.cs (TypeContainer.DefineIndexers): Process explicit
11185 interface implementations first. Fixes #37714.
11187 2003-07-04 Miguel de Icaza <miguel@ximian.com>
11189 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
11190 defined recursively; but since we modify the input parameters
11191 (left is set to `this' temporarily), we reset this value if the
11192 left_is_explicit is false, which gives the original semantics to
11195 * literal.cs (NullPointer): new class used to represent a null
11196 literal in a pointer context.
11198 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
11199 type is a pointer, use a NullPointer object instead of a
11200 NullLiteral. Closes 43687
11202 (ExplicitConversion): Convert pointer values using
11203 the conv opcode to the proper type.
11205 * ecore.cs (New): change ValueTypeVariable property into a method,
11206 that returns whether the valuetype is suitable for being used.
11208 * expression.cs (Binary.DoNumericPromotions): Only return if we
11209 the int constant was a valid uint, and we can return both left and
11210 right as uints. If not, we continue processing, to trigger the
11211 type conversion. This fixes 39018.
11213 * statement.cs (Block.EmitMeta): During constant resolution, set
11214 the CurrentBlock property on the emitcontext, so that we resolve
11215 constants propertly.
11217 2003-07-02 Martin Baulig <martin@ximian.com>
11219 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
11220 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
11222 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
11223 than emitting it here.
11225 * statement.cs: Fixed some more flow analysis bugs.
11227 2003-07-02 Martin Baulig <martin@ximian.com>
11229 * class.cs (MethodData.Define): When implementing interface
11230 methods, set Final unless we're Virtual.
11232 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
11233 check work for interface methods.
11235 2003-07-01 Martin Baulig <martin@ximian.com>
11237 * ecore.cs (EmitContext.This): Replaced this property with a
11238 GetThis() method which takes a Location argument. This ensures
11239 that we get the correct error location for a CS0188.
11241 2003-07-01 Miguel de Icaza <miguel@ximian.com>
11243 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
11244 ImplicitStandardConversion.
11246 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
11248 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
11250 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
11253 2003-06-30 Miguel de Icaza <miguel@ximian.com>
11255 * class.cs (Constructor.Define): Turn off initlocals for unsafe
11258 (MethodData.Define): Turn off initlocals for unsafe methods.
11260 2003-06-29 Miguel de Icaza <miguel@ximian.com>
11262 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
11263 complete; Fixes #37521.
11265 * delegate.cs: Use Modifiers.TypeAttr to compute the
11266 TypeAttributes, instead of rolling our own. This makes the flags
11267 correct for the delegates.
11269 2003-06-28 Miguel de Icaza <miguel@ximian.com>
11271 * class.cs (Constructor.Define): Set the private flag for static
11272 constructors as well.
11274 * cs-parser.jay (statement_expression): Set the return value to
11275 null, to avoid a crash when we catch an error.
11277 2003-06-24 Miguel de Icaza <miguel@ximian.com>
11279 * cs-parser.jay: Applied patch from Jackson that adds support for
11280 extern and unsafe modifiers to destructor declarations.
11282 * expression.cs: Report error 21 if the user is trying to index a
11285 * driver.cs: Add an error message, suggested by the bug report.
11287 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
11288 if we do not have a ": this ()" constructor initializer. Fixes 45149
11290 2003-06-14 Miguel de Icaza <miguel@ximian.com>
11292 * namespace.cs: Add some information to reduce FAQs.
11294 2003-06-13 Miguel de Icaza <miguel@ximian.com>
11296 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
11297 underlying enumeration types. Fixes #43915.
11299 * expression.cs: Treat ushort/short as legal values to be used in
11300 bitwise operations.
11302 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
11304 * delegate.cs: transfer custom attributes for paramenters from
11305 the delegate declaration to Invoke and BeginInvoke.
11307 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
11309 * attribute.cs: handle custom marshalers and emit marshal info
11312 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
11314 * makefile.gnu: Added anonymous.cs to the compiler sources.
11316 2003-05-28 Miguel de Icaza <miguel@ximian.com>
11318 * iterators.cs: Change the name of the proxy class to include two
11321 * cs-parser.jay: Update grammar to include anonymous methods.
11323 * anonymous.cs: new file.
11325 2003-05-27 Miguel de Icaza <miguel@ximian.com>
11327 * class.cs (Field.Define): Add missing test for pointers and
11330 2003-05-27 Ravi Pratap <ravi@ximian.com>
11332 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
11333 we use the stobj opcode.
11335 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
11336 since it wasn't the correct fix.
11338 It still is puzzling that we are required to use stobj for IntPtr
11339 which seems to be a ValueType.
11341 2003-05-26 Miguel de Icaza <miguel@ximian.com>
11343 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
11344 during regular simple name resolution. Now, the trick is that
11345 instead of returning for processing the simplename, we do a
11346 TypeManager.LookupType (ie, a rooted lookup as opposed to a
11347 contextual lookup type). If a match is found, return that, if
11348 not, return for further composition.
11350 This fixes long-standing 30485.
11352 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11353 using the address to initialize an object, do an Stobj instead of
11354 using the regular Stelem.
11356 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
11357 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
11358 Because if we are a BaseIndexerAccess that value will be true.
11361 * statement.cs (GotoCase.Resolve): Return after reporting an
11362 error, do not attempt to continue.
11364 * expression.cs (PointerArithmetic.Emit): If our operand is a
11365 long, convert our constants to match the operand before
11366 multiplying. Convert to I type before adding. Fixes 43670.
11368 2003-05-14 Ravi Pratap <ravi@ximian.com>
11370 * enum.cs (ImplicitConversionExists) : Rename to
11371 ImplicitEnumConversionExists to remove ambiguity.
11373 * ecore.cs (NullCast): New type of cast expression class which
11374 basically is very similar to EmptyCast with the difference being
11375 it still is a constant since it is used only to cast a null to
11377 (eg. (string) null)
11379 * convert.cs (ImplicitReferenceConversion): When casting a null
11380 literal, we return a NullCast.
11382 * literal.cs (NullLiteralTyped): Remove - I don't see why this
11383 should be around anymore.
11385 The renaming (reported was slightly wrong). Corrections:
11387 ConvertImplicitStandard -> ImplicitConversionStandard
11388 ConvertExplicitStandard -> ExplicitConversionStandard
11390 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
11391 before passing them in !
11393 * convert.cs (ImplicitConversionStandard): When comparing for
11394 equal expr and target types, ensure that expr is not a
11397 In general, we must not be checking (expr_type ==
11398 target_type) in the top level conversion methods
11399 (ImplicitConversion, ExplicitConversion etc). This checking is
11400 done in the methods that they delegate to.
11402 2003-05-20 Miguel de Icaza <miguel@ximian.com>
11404 * convert.cs: Move Error_CannotConvertType,
11405 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
11406 ImplicitNumericConversion, ImplicitConversionExists,
11407 ImplicitUserConversionExists, StandardConversionExists,
11408 FindMostEncompassedType, FindMostSpecificSource,
11409 FindMostSpecificTarget, ImplicitUserConversion,
11410 ExplicitUserConversion, GetConversionOperators,
11411 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
11412 TryImplicitIntConversion, Error_CannotConvertImplicit,
11413 ConvertImplicitRequired, ConvertNumericExplicit,
11414 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
11415 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
11418 Perform the following renames:
11420 StandardConversionExists -> ImplicitStandardConversionExists
11421 ConvertImplicit -> ImplicitConversion
11422 ConvertImplicitStandard -> ImplicitStandardConversion
11423 TryImplicitIntConversion -> ImplicitIntConversion
11424 ConvertImplicitRequired -> ImplicitConversionRequired
11425 ConvertNumericExplicit -> ExplicitNumericConversion
11426 ConvertReferenceExplicit -> ExplicitReferenceConversion
11427 ConvertExplicit -> ExplicitConversion
11428 ConvertExplicitStandard -> ExplicitStandardConversion
11430 2003-05-19 Martin Baulig <martin@ximian.com>
11432 * statement.cs (TypeInfo.StructInfo): Made this type protected.
11433 (TypeInfo): Added support for structs having structs as fields.
11435 * ecore.cs (FieldExpr): Implement IVariable.
11436 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
11437 VariableInfo for the field.
11439 2003-05-18 Martin Baulig <martin@ximian.com>
11441 * expression.cs (This.DoResolve): Report a CS0027 if we're
11442 emitting a field initializer.
11444 2003-05-18 Martin Baulig <martin@ximian.com>
11446 * expression.cs (This.ResolveBase): New public function.
11447 (This.DoResolve): Check for CS0188.
11449 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
11452 * ecore.cs (MethodGroupExpr.DoResolve): Set the
11453 `instance_expression' to null if we don't have any non-static
11456 2003-05-18 Martin Baulig <martin@ximian.com>
11458 Reworked the way how local variables and parameters are handled by
11459 the flow analysis code.
11461 * statement.cs (TypeInfo, VariableMap): New public classes.
11462 (VariableInfo): New public class. This is now responsible for
11463 checking whether a variable has been assigned. It is used for
11464 parameters and local variables.
11465 (Block.EmitMeta): Take the InternalParameters as argument; compute
11466 the layout of the flow vectors here.
11467 (Block.LocalMap, Block.ParameterMap): New public properties.
11468 (FlowBranching): The .ctor doesn't get the InternalParameters
11469 anymore since Block.EmitMeta() now computes the layout of the flow
11471 (MyStructInfo): This class is now known as `StructInfo' and nested
11472 in `TypeInfo'; we don't access this directly anymore.
11474 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
11475 property and removed IsAssigned(), IsFieldAssigned(),
11476 SetAssigned() and SetFieldAssigned(); we now call them on the
11477 VariableInfo so we don't need to duplicate this code everywhere.
11479 * expression.cs (ParameterReference): Added `Block block' argument
11481 (LocalVariableReference, ParameterReference, This): The new
11482 VariableInfo class is now responsible for all the definite
11485 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
11486 IsParameterAssigned, SetParameterAssigned): Removed.
11488 2003-05-18 Martin Baulig <martin@ximian.com>
11490 * typemanager.cs (InitCoreTypes): Try calling
11491 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
11492 the 3-args-version. Corlib now also needs our `void_type'.
11493 (GetMethod): Added overloaded version which takes an optional
11494 `bool report_errors' to allow lookups of optional methods.
11496 2003-05-12 Martin Baulig <martin@ximian.com>
11498 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
11499 only used for locals and not for parameters.
11501 2003-05-12 Miguel de Icaza <miguel@ximian.com>
11503 * support.cs (InternalParameters.ParameterType): Return the
11504 ExternalType of the parameter.
11506 * parameter.cs (Parameter.ExternalType): drop the two arguments,
11509 2003-05-11 Miguel de Icaza <miguel@ximian.com>
11511 * class.cs (MethodData.Define): Do not set the `newslot' on
11512 interface members, if they are also flagged as "override".
11514 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
11515 better code for ++i and i++. This only works for static fields
11516 and local variables.
11518 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
11519 want to pull the DeclSpace out of the builder_to_declspace instead
11520 of the TypeBuilder (like in TypeContainer.FindMembers).
11522 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
11523 instead of LookupTypeContainer. Fixes the crash on .NET for
11524 looking up interface members.
11526 * const.cs: Create our own emit context during the Definition
11527 stage, so that constants are evaluated in the proper context, when
11528 a recursive definition happens.
11530 2003-05-11 Martin Baulig <martin@ximian.com>
11532 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
11533 new block for a switch section.
11534 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
11535 the adding/lookup in the switch block. Fixes #39828.
11537 2003-05-09 Miguel de Icaza <miguel@ximian.com>
11539 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
11540 functionality: I needed to convert the data after I had performed
11541 the add/sub operation into the operands type size.
11543 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
11544 pass the type for the box operation, otherwise the resulting
11545 object would have been of type object.
11547 (BoxedCast): Add constructor to specify the type to box as.
11549 2003-05-07 Miguel de Icaza <miguel@ximian.com>
11551 * iterators.cs: I was reusing the `count' variable inadvertently,
11552 take steps to not allow this to happen.
11554 2003-05-06 Miguel de Icaza <miguel@ximian.com>
11556 * attribute.cs (Attribute.Resolve): Params attributes are encoded
11557 by creating an array at the point where the params starts and
11558 putting all those arguments there, then adjusting the size of the
11561 2003-05-05 Miguel de Icaza <miguel@ximian.com>
11563 * expression.cs (New.AddressOf): Implement interface
11564 IMemoryLocation. This is used when the `new' operator is used in
11565 the context of an invocation to a method on a value type.
11567 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
11570 * namespace.cs: Also check the using aliases here.
11572 * driver.cs: Move the test for using validity after the types have
11573 been entered, so we do a single pass that also includes the using
11576 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
11577 in the regular case. CreateSiblingForFinally is doing extra
11580 * attribute.cs (GetAttributeArgumentExpression): Store the result
11581 on an out value, and use the return value to indicate failure
11582 instead of using null (which is a valid return for Constant.GetValue).
11584 * statement.cs: Perform the analysis flow for the increment
11585 portion after the statement, because this will be the real flow of
11586 execution. Fixes #42385
11588 * codegen.cs (EmitContext.EmitArgument,
11589 EmitContext.EmitStoreArgument): New helper functions when the
11590 RemapToProxy flag is set.
11592 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
11595 Add support for remapping parameters.
11597 * iterators.cs: Propagate parameter values; Store parameter
11598 values in the proxy classes.
11600 2003-05-04 Miguel de Icaza <miguel@ximian.com>
11602 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
11603 need a proxy reference; I do not know what I was thinking
11605 * cs-parser.jay (constructor_initializer): catch another error,
11606 and display nice message.
11608 (field_declaration): catch void field declaration
11609 to flag a better error.
11611 * class.cs (MemberBase.CheckBase): Report an error instead of a
11612 warning if a new protected member is declared in a struct.
11613 (Field.Define): catch the error of readonly/volatile.
11615 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
11617 (FieldExpr.AddressOf): ditto. Catch error where the address of a
11618 volatile variable is taken
11620 2003-05-02 Miguel de Icaza <miguel@ximian.com>
11622 * statement.cs (Fixed.Resolve): Report an error if we are not in
11625 2003-05-01 Miguel de Icaza <miguel@ximian.com>
11627 * typemanager.cs: reuse the code that handles type clashes for
11628 delegates and enumerations.
11630 * class.cs (Report28): Always report.
11632 * expression.cs (EncodeAsAttribute): Allow nulls here.
11634 2003-04-28 Miguel de Icaza <miguel@ximian.com>
11636 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
11637 the functionality for testing whether an expression is valid for
11638 an attribute here. Also handle the case of arrays of elements
11641 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
11642 encoding a linear array into an array of objects that are suitable
11643 to be passed to an CustomAttributeBuilder.
11645 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
11647 * ecore.cs: (FieldExpr): Handle field remapping here.
11649 * iteratators.cs: Pass the instance variable (if the method is an
11650 instance method) to the constructors, so we can access the field
11651 variables on the class.
11653 TODO: Test this with structs. I think the THIS variable on
11654 structs might have to be a pointer, and not a refenrece
11656 2003-04-27 Miguel de Icaza <miguel@ximian.com>
11658 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
11659 local variables to fields in a proxy class.
11661 * iterators.cs (PopulateProxy): Rename our internal fields to
11663 Create a <THIS> field if we are an instance method, so we can
11664 reference our parent container variables.
11665 (MapVariable): Called back from the EmitContext code to enter a
11666 new variable to field mapping into the proxy class (we just create
11670 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
11671 for using the remapped locals to fields.
11673 I placed the code here, because that gives the same semantics to
11674 local variables, and only changes the Emit code.
11676 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
11677 statements inside iterators.
11678 (VariableInfo): Add a FieldBuilder for the cases when we are
11679 remapping local variables to fields in a proxy class
11681 * ecore.cs (SimpleNameResolve): Avoid testing two times for
11682 current_block != null.
11684 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
11685 not cope with strings, as it has been moved to the
11686 TableSwitchEmit. Fixed bug in switch generation.
11688 * expression.cs (New.DoResolve): Provide more context for the user
11689 when reporting an error.
11691 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
11694 * expression.cs (MemberAccess.DoResolve): When we get a type back,
11695 check the permissions for it. Note than in a type-resolution
11696 context the check was already present in DeclSpace.ResolveType,
11697 but was missing from the MemberAccess.
11699 (ArrayCreation.CheckIndices): warn if the user has
11700 more nested levels of expressions, but there are no more
11701 dimensions specified. Avoids crash on bug 41906.
11703 2003-04-26 Miguel de Icaza <miguel@ximian.com>
11705 * statement.cs (Block): replace Implicit bool, for a generic
11707 New flag: `Unchecked'. This is used during the EmitMeta phase
11708 (which is out-of-line with the regular Resolve/Emit process for a
11709 statement, as this is done ahead of time, but still gets a chance
11710 to call constant resolve).
11712 (Block.Flags): new enum for adding a new flag.
11714 (Block.EmitMeta): track the state of unchecked.
11716 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
11717 to enable constant resolution to work there as well.
11719 2003-04-22 Miguel de Icaza <miguel@ximian.com>
11721 * typemanager.cs (ienumerable_type): Also look up
11722 System.Collections.IEnumerable.
11724 2003-04-21 Miguel de Icaza <miguel@ximian.com>
11726 TODO: Test more than one conditional per method.
11728 * class.cs (Indexer.Define): Report the location where the user is
11729 referencing the unsupported feature.
11731 (MethodData): Overload the use of `conditionals' to
11732 minimize the creation of needless ArrayLists. This saves roughly
11733 212kb on my machine.
11735 (Method): Implement the new IIteratorContainer interface.
11736 (Method.SetYields): Implement the method by setting the ModFlags
11737 to contain METHOD_YIELDS.
11739 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
11740 which just got set to null.
11742 * iterators.cs: New file.
11744 (Yield, YieldBreak): New statements.
11746 * statement.cs (Return.Resolve): Flag an error if we are used in
11747 an iterator method.
11749 * codegen.cs (InIterator): New flag set if the code is being
11750 compiled in an iterator method.
11752 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
11753 internal modifier, and we just use it to avoid adding extra
11754 fields, as this is seldom used.
11756 * cs-parser.jay: Add yield_statement (yield and yield break).
11758 * driver.cs: New flag -v2 to turn on version 2 features.
11760 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
11761 hashtable when v2 is enabled.
11763 2003-04-20 Miguel de Icaza <miguel@ximian.com>
11765 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
11766 there is already a namespace defined with this name.
11768 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
11769 people upgraded their corlibs.
11771 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
11772 always use fully qualified types, no need to use the compiler
11775 (TypeManager.IsNamespace): Use binarysearch.
11777 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
11778 AddDelegate): I did not quite use the new IsValid API properly: I
11779 have to pass the short-name and the fullname. I was passing only
11780 the basename instead of the fullname sometimes.
11782 (TypeContainer.DefineType): call NamespaceClash.
11784 * interface.cs (Interface.DefineType): use NamespaceClash before
11787 * delegate.cs (Delegate.DefineType): use NamespaceClash before
11790 * enum.cs: (Enum.DefineType): use NamespaceClash before
11793 * typemanager.cs (: 3-line patch that gives us some tasty 11%
11794 speed increase. First, use the negative_hits cache when we get a
11795 negative. Second, add the type with its full original name
11796 instead of the new . and + encoded name (reflection uses + to
11797 separate type from a nested type). Use LookupTypeReflection
11798 directly which bypasses the type->name hashtable (that we already
11799 know does not contain the type.
11801 * decl.cs (DeclSpace.ResolveTypeExpr): track the
11802 location/container type.
11804 * driver.cs: When passing utf8, use directly the UTF8Encoding.
11806 2003-04-19 Miguel de Icaza <miguel@ximian.com>
11808 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
11810 * delegate.cs (NewDelegate.Resolve): Test whether an instance
11811 method is being referenced in the method group from a static
11812 context, and report error 120 if so.
11814 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
11817 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
11818 is created, we create the A namespace).
11820 * cs-parser.jay: A namespace also introduces a DeclarationFound.
11823 2003-04-18 Miguel de Icaza <miguel@ximian.com>
11825 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
11826 invocation to ModuleBuilder.GetType with the same values will
11827 return a new type instance, so we need to cache its return
11830 * expression.cs (Binary.ResolveOperator): Only allow the compare
11831 operators on enums if they are of the same type.
11833 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
11834 types of ValueType on their own case. Before we were giving them
11835 the same treatment as objects.
11837 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
11838 fullname. Short name is used to compare against container name.
11839 Fullname is used to check against defined namespace names.
11841 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
11842 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
11844 (Method.CheckBase): Call parent.
11845 (MemberBase.CheckBase): Check for protected members on sealed
11847 (PropertyBase.CheckBase): Call parent.
11848 (Field.Define): Call parent.
11850 * report.cs: Negative error codes are now mapped to 8000 - code,
11851 so that the display is render more nicely.
11853 * typemanager.cs: Do not use try/catch, instead report a regular
11856 (GetPointerType, GetReferenceType): These methods provide
11857 mechanisms to obtain the T* and T& from a T. We had the code
11858 previously scattered around the code base, and it also used
11859 TypeManager.LookupType that would go through plenty of caches.
11860 This one goes directly to the type source.
11862 In some places we did the Type.GetType followed by
11863 ModuleBuilder.GetType, but not in others, so this unifies the
11864 processing as well.
11866 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
11867 statements now that we have namespace information.
11869 * typemanager.cs (IsNamespace): New method, returns whether the
11870 string presented is a namespace or not.
11872 (ComputeNamespaces): New public entry point, computes the list of
11873 available namespaces, using the GetNamespaces API call in Mono, or
11874 the slower version in MS.NET.
11876 Now before we start the semantic analysis phase, we have a
11877 complete list of namespaces including everything that the user has
11880 Deleted old code to cache namespaces in .nsc files.
11882 2003-04-17 Miguel de Icaza <miguel@ximian.com>
11884 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
11885 class/struct location definition Location for the implicit
11886 constructor location.
11888 (Operator.Define): Use the location of the operator for the
11889 implicit Method definition.
11891 (Constructor.Emit): use the constructor location for the implicit
11892 base initializer constructor.
11894 * ecore.cs: Remove ITypeExpression. This interface is now gone,
11895 and the Expression class now contains two new methods:
11897 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
11898 isolate type lookup from the rest of the resolution process.
11900 Since we use Expressions to hold type definitions due to the way
11901 we parse the input we have historically overloaded Resolve to
11902 perform the Type lookups if a special flag is passed. Now this is
11903 eliminated and two methods take their place.
11905 The differences in the two methods between xStep and xTerminal is
11906 that xStep is involved in our current lookup system that uses
11907 SimpleNames to compose a name, while xTerminal is used just to
11908 catch the case where the simplename lookup failed.
11910 2003-04-16 Miguel de Icaza <miguel@ximian.com>
11912 * expression.cs (ResolveMemberAccess): Remove redundant code.
11913 TypeExpr expressions are always born fully resolved.
11915 * interface.cs (PopulateMethod): Do not lookup the types twice.
11916 We were doing it once during SemanticAnalysis and once during
11919 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
11920 in local variable type definitions, were being returned as a
11921 SimpleName (we decomposed everything into a string), that is
11922 because primary_expression was being used instead of a type in the
11923 grammar (reduce/reduce conflicts).
11925 The part that was wrong is that we converted the expression into a
11926 string (an oversimplification in one hand, compounded with primary
11927 expressions doing string concatenation).
11933 Would return "A.B.C[]" as a SimpleName. This stopped things like
11934 using clauses from working on this particular context. And a type
11935 was being matched directly against "A.B.C[]".
11937 We now use the correct approach, and allow for ComposedCast to be
11938 part of the unary expression. So the "A.B.C []" become a composed
11939 cast of "A.B.C" (as a nested group of MemberAccess with a
11940 SimpleName at the end) plus the rank composition "[]".
11944 2003-04-10 Miguel de Icaza <miguel@ximian.com>
11946 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
11947 for the access level checking.
11949 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
11950 `TypeContainer container', because I kept getting confused when I
11951 was debugging this code.
11953 * expression.cs (Indexers): Instead of tracking getters/setters,
11954 we now track them in parallel. We create one arraylist less, but
11955 most importantly it is possible now for the LValue code to find a
11956 matching get for a set.
11958 (IndexerAccess.DoResolveLValue): Update the code.
11959 GetIndexersForType has been modified already to extract all the
11960 indexers from a type. The code assumed it did not.
11962 Also make the code set the correct return type for the indexer.
11963 This was fixed a long time ago for properties, but was missing for
11964 indexers. It used to be void_type.
11966 (Binary.Emit): Test first for doubles instead of
11967 floats, as they are more common.
11969 (Binary.EmitBranchable): Use the .un version of the branch opcodes
11970 when dealing with floats and the <=, >= operators. This fixes bug
11973 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
11974 to load the array value by emitting a load on the foreach variable
11975 type. This was incorrect.
11977 We now emit the code to load an element using the the array
11978 variable type, and then we emit the conversion operator.
11982 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
11984 * attribute.cs: Avoid allocation of ArrayLists in the common case.
11986 2003-04-09 Miguel de Icaza <miguel@ximian.com>
11988 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
11989 test for protection before we test for signatures.
11991 (MethodSignature.ToString): implement.
11993 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
11994 to the case where we reduced into a LongConstant.
11996 * decl.cs (CheckAccessLevel): If the type is an array, we can not
11997 depend on whether the information is acurrate, because the
11998 Microsoft runtime will always claim that the array type is public,
11999 regardless of the real state.
12001 If the type is a pointer, another problem happens: the type is
12002 reported as non-public in Microsoft.
12004 In both cases we have to call CheckAccessLevel recursively with
12005 the underlying type as the argument to be tested.
12007 2003-04-08 Miguel de Icaza <miguel@ximian.com>
12009 * assign.cs (Assign.Emit): If we are dealing with a compound
12010 assignment expression, we should use the code path that stores the
12011 intermediate result in a temporary value. This fixes #40903.
12013 *expression.cs (Indirection.ToString): Provide ToString method for
12016 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
12018 * class.cs: Null out fields holding references to Block objects so
12019 they can be garbage collected.
12021 * expression.cs (OverloadResolve): Remove unused local.
12023 2003-04-07 Martin Baulig <martin@ximian.com>
12025 * codegen.cs (EmitContext.CurrentFile): New public field.
12026 (EmitContext.Mark): Use the CurrentFile to check whether the
12027 location is in the correct file.
12028 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
12030 2003-04-07 Martin Baulig <martin@ximian.com>
12032 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
12034 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
12035 location. [FIXME: The location argument which gets passed to this
12036 method is sometimes wrong!]
12038 2003-04-07 Nick Drochak <ndrochak@gol.com>
12040 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
12042 2003-04-07 Miguel de Icaza <miguel@ximian.com>
12044 * expression.cs (Indirection.EmitAssign): We were using the
12045 temporary, but returning immediately instead of continuing the
12048 2003-04-06 Martin Baulig <martin@ximian.com>
12050 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
12051 if it's a nested child, but also deriving from the outer class.
12054 * typemanager.cs (IsNestedChildOf): Make this work if it's a
12055 nested child, but also deriving from the outer class. See
12057 (FilterWithClosure): We may access private members of the outer
12058 class if we're a nested child and deriving from the outer class.
12059 (RealMemberLookup): Only set `closure_private_ok' if the
12060 `original_bf' contained BindingFlags.NonPublic.
12062 2003-04-05 Martin Baulig <martin@ximian.com>
12064 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
12066 2003-04-02 Miguel de Icaza <miguel@ximian.com>
12068 * class.cs (Event.Define): Do not allow abstract events to have
12071 2003-04-01 Miguel de Icaza <miguel@ximian.com>
12073 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
12074 block in event declarations.
12076 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
12077 value type, get its address.
12079 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
12080 leaving a class on the stack instead of a boolean value (int
12081 0/1). Change the code so we compare against null, and then the
12082 result against zero.
12084 * class.cs (TypeContainer.GetClassBases): We were checking for the
12085 parent class being sealed too late.
12087 * expression.cs (Binary.Emit): For <= and >= when dealing with
12088 floating point values, use cgt.un and clt.un instead of cgt and
12091 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
12093 * statement.cs: Apply the same optimization as MS: skip the
12094 GetEnumerator returning an IEnumerator, and use the one returning a
12095 CharEnumerator instead. This allows us to avoid the try-finally block
12098 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
12100 * cs-parser.jay: Attributes cannot be applied to
12101 namespaces. Fixes #40473
12103 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12106 (Add*): check if the name is valid using the full name for constants,
12107 fields, properties and events.
12109 2003-03-28 Miguel de Icaza <miguel@ximian.com>
12111 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
12112 char constants to be part of the enumeration.
12114 * expression.cs (Conditional.DoResolve): Add support for operator
12115 true. Implements the missing functionality from 14.12
12117 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
12118 operator true/false as required by the spec.
12120 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
12121 implicit conversion to boolean.
12123 * statement.cs (Statement.ResolveBoolean): A boolean expression is
12124 also one where the type implements `operator true'.
12126 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
12127 get an expression that will invoke operator true based on an
12130 (GetConversionOperators): Removed the hack that called op_True
12133 (Expression.ResolveBoolean): Move this from Statement.
12135 2003-03-17 Miguel de Icaza <miguel@ximian.com>
12137 * ecore.cs (FieldExpr): do not allow initialization of initonly
12138 fields on derived classes
12140 2003-03-13 Martin Baulig <martin@ximian.com>
12142 * statement.cs (Block.Emit): Call ig.BeginScope() and
12143 ig.EndScope() when compiling with debugging info; call
12144 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
12146 2003-03-08 Miguel de Icaza <miguel@ximian.com>
12148 * expression.cs (Indexers): Do not construct immediately, allow
12149 for new members to be appended as we go. Fixes 38143
12151 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12153 * expression.cs: save/restore context when resolving an unchecked
12156 2003-03-05 Miguel de Icaza <miguel@ximian.com>
12158 * cfold.cs: Catch division by zero in modulus operator during
12161 2003-03-03 Miguel de Icaza <miguel@ximian.com>
12163 * interface.cs (Interface.DefineMembers): Avoid defining members
12166 2003-02-27 Miguel de Icaza <miguel@ximian.com>
12168 * driver.cs: handle the +/- options for -noconfig
12170 * statement.cs (Unckeched.Resolve): Also track the state of
12171 unchecked in the Resolve phase.
12173 2003-02-27 Martin Baulig <martin@ximian.com>
12175 * ecore.cs (Expression.MemberLookup): Don't create a
12176 MethodGroupExpr for something which is not a method. Fixes #38291.
12178 2003-02-25 Miguel de Icaza <miguel@ximian.com>
12180 * class.cs (MemberBase.CheckParameters): Also check that the type
12181 is unmanaged if it is a pointer.
12183 * expression.cs (SizeOf.Resolve): Add location information.
12185 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
12186 a managed type is declared.
12188 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
12189 parameter modifiers as well. Fixes bug 38606
12191 * class.cs: Very sad. Am backing out the speed up changes
12192 introduced by the ArrayList -> Array in the TypeContainer, as they
12193 were not actually that much faster, and introduced a bug (no error
12194 reports on duplicated methods).
12196 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
12197 source first, this will guarantee that we have a valid expression
12198 before calling in lower levels functions that will require a
12199 resolved object. Then use this original_source in the
12200 target.ResolveLValue instead of the original source that was
12203 Another change. Use target.Resolve instead of LValueResolve.
12204 Although we are resolving for LValues, we will let the Assign code
12205 take care of that (it will be called again from Resolve). This
12206 basically allows code like this:
12208 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
12209 class Y { void A (X x) { x [0] += o; }
12211 The problem was that the indexer was trying to resolve for
12212 set_Item (idx, object o) and never finding one. The real set_Item
12213 was set_Item (idx, X). By delaying the process we get the right
12218 2003-02-23 Martin Baulig <martin@ximian.com>
12220 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
12221 while calling DoEmit ().
12223 * codegen.cs (EmitContext.Mark): Don't mark locations in other
12224 source files; if you use the #line directive inside a method, the
12225 compiler stops emitting line numbers for the debugger until it
12226 reaches the end of the method or another #line directive which
12227 restores the original file.
12229 2003-02-23 Martin Baulig <martin@ximian.com>
12231 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
12233 2003-02-23 Martin Baulig <martin@ximian.com>
12235 * statement.cs (Block.AddChildVariableNames): We need to call this
12236 recursively, not just for our immediate children.
12238 2003-02-23 Martin Baulig <martin@ximian.com>
12240 * class.cs (Event.Define): Always make the field private, like csc does.
12242 * typemanager.cs (TypeManager.RealMemberLookup): Make events
12243 actually work, fixes bug #37521.
12245 2003-02-23 Miguel de Icaza <miguel@ximian.com>
12247 * delegate.cs: When creating the various temporary "Parameters"
12248 classes, make sure that we call the ComputeAndDefineParameterTypes
12249 on those new parameters (just like we do with the formal ones), to
12250 allow them to be resolved in the context of the DeclSpace.
12252 This fixes the bug that Dick observed in Bugzilla #38530.
12254 2003-02-22 Miguel de Icaza <miguel@ximian.com>
12256 * expression.cs (ResolveMemberAccess): When resolving a constant,
12257 do not attempt to pull a constant if the value was not able to
12258 generate a valid constant.
12260 * const.cs (LookupConstantValue): Do not report more errors than required.
12262 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12264 * expression.cs: fixes bug #38328.
12266 2003-02-18 Miguel de Icaza <miguel@ximian.com>
12268 * class.cs: Changed all the various members that can be part of a
12269 class from being an ArrayList to be an Array of the right type.
12270 During the DefineType type_list, interface_list, delegate_list and
12271 enum_list are turned into types, interfaces, delegates and enums
12274 And during the member population, indexer_list, event_list,
12275 constant_list, field_list, instance_constructor_list, method_list,
12276 operator_list and property_list are turned into their real arrays.
12278 Although we could probably perform this operation earlier, for
12279 good error reporting we need to keep the lists and remove the
12280 lists for longer than required.
12282 This optimization was triggered by Paolo profiling the compiler
12283 speed on the output of `gen-sample-program.pl' perl script.
12285 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
12286 not crash in methods like MemberLookupFailed that use this field.
12288 This problem arises when the compiler fails to resolve a type
12289 during interface type definition for example.
12291 2003-02-18 Miguel de Icaza <miguel@ximian.com>
12293 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
12294 inherit from System.Object, so we have to stop at null, not only
12295 when reaching System.Object.
12297 2003-02-17 Miguel de Icaza <miguel@ximian.com>
12299 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
12300 DeclaredOnly because the parent indexer might have had a different
12301 name, but did not loop until the top of the hierarchy was reached.
12303 The problem this one fixes is 35492: when a class implemented an
12304 indexer from an interface, we were getting the interface method
12305 (which was abstract) and we were flagging an error (can not invoke
12308 This also keeps bug 33089 functioning, and test-148 functioning.
12310 * typemanager.cs (IsSpecialMethod): The correct way of figuring
12311 out if a method is special is to see if it is declared in a
12312 property or event, or whether it is one of the predefined operator
12313 names. This should fix correctly #36804.
12315 2003-02-15 Miguel de Icaza <miguel@ximian.com>
12317 The goal here is to remove the dependency on EmptyCast.Peel ().
12318 Killing it completely.
12320 The problem is that currently in a number of places where
12321 constants are expected, we have to "probe" for an EmptyCast, and
12322 Peel, which is not the correct thing to do, as this will be
12323 repetitive and will likely lead to errors.
12325 The idea is to remove any EmptyCasts that are used in casts that
12326 can be reduced to constants, so we only have to cope with
12329 This bug hunt was triggered by Bug 37363 and the desire to remove
12330 the duplicate pattern where we were "peeling" emptycasts to check
12331 whether they were constants. Now constants will always be
12334 * ecore.cs: Use an enumconstant here instead of wrapping with
12337 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
12338 throwing me off. By handling this we can get rid of a few hacks.
12340 * statement.cs (Switch): Removed Peel() code.
12342 2003-02-14 Miguel de Icaza <miguel@ximian.com>
12344 * class.cs: Location information for error 508
12346 * expression.cs (New.DoResolve): Add a guard against double
12347 resolution of an expression.
12349 The New DoResolve might be called twice when initializing field
12350 expressions (see EmitFieldInitializers, the call to
12351 GetInitializerExpression will perform a resolve on the expression,
12352 and later the assign will trigger another resolution
12354 This leads to bugs (#37014)
12356 * delegate.cs: The signature for EndInvoke should contain any ref
12357 or out parameters as well. We were not doing this in the past.
12359 * class.cs (Field.Define): Do not overwrite the type definition
12360 inside the `volatile' group. Turns out that volatile enumerations
12361 were changing the type here to perform a validity test, which
12364 2003-02-12 Miguel de Icaza <miguel@ximian.com>
12366 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
12367 and structs, we do not want to load the instance variable
12369 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
12370 enum_type has to be handled like an object reference (implicit
12371 conversions exists from this to object), but the regular IsClass
12372 and IsValueType tests will never return true for this one.
12374 Also we use TypeManager.IsValueType instead of type.IsValueType,
12375 just for consistency with the rest of the code (this is only
12376 needed if we ever use the construct exposed by test-180.cs inside
12377 corlib, which we dont today).
12379 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
12381 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
12384 2003-02-09 Martin Baulig <martin@ximian.com>
12386 * namespace.cs (Namespace..ctor): Added SourceFile argument.
12387 (Namespace.DefineNamespaces): New static public method; this is
12388 called when we're compiling with debugging to add all namespaces
12389 to the symbol file.
12391 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
12392 pass it to the Namespace's .ctor.
12394 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
12395 and MethodBase arguments; pass the namespace ID to the symwriter;
12396 pass the MethodBase instead of the token to the symwriter.
12397 (SymbolWriter.DefineNamespace): New method to add a namespace to
12400 2003-02-09 Martin Baulig <martin@ximian.com>
12402 * symbolwriter.cs: New file. This is a wrapper around
12403 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
12404 methods here in near future.
12406 2003-02-09 Martin Baulig <martin@ximian.com>
12408 * codegen.cs (EmitContext.Mark): Just pass the arguments to
12409 ILGenerator.MarkSequencePoint() which are actually used by the
12412 2003-02-09 Martin Baulig <martin@ximian.com>
12414 * location.cs (SourceFile): New public sealed class. This
12415 contains the name and an index which is used in the location's token.
12416 (Location): Reserve an appropriate number of bits in the token for
12417 the source file instead of walking over that list, this gives us a
12418 really huge performance improvement when compiling with debugging.
12420 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
12421 `SourceFile' argument instead of a string.
12422 (Driver.ProcessFile): Add all the files via Location.AddFile(),
12423 but don't parse/tokenize here, we need to generate the list of all
12424 source files before we do that.
12425 (Driver.ProcessFiles): New static function. Parses/tokenizes all
12428 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
12429 instead of a string.
12431 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
12434 2003-02-09 Martin Baulig <martin@ximian.com>
12436 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
12437 filename on `#line default'.
12439 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
12441 * statement.cs: don't clear the pinned var when the fixed statement
12442 returns from the method (fixes bug#37752).
12444 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
12446 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
12449 2003-02-07 Martin Baulig <martin@ximian.com>
12451 * driver.cs: Removed the `--debug-args' command line argument.
12453 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
12454 automatically by the AsssemblyBuilder.
12455 (CodeGen.InitializeSymbolWriter): We don't need to call any
12456 initialization function on the symbol writer anymore. This method
12457 doesn't take any arguments.
12459 2003-02-03 Miguel de Icaza <miguel@ximian.com>
12461 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
12462 from referenced assemblies as well.
12464 2003-02-02 Martin Baulig <martin@ximian.com>
12466 * class.cs (MethodData.Emit): Generate debugging info for external methods.
12468 2003-02-02 Martin Baulig <martin@ximian.com>
12470 * class.cs (Constructor.Emit): Open the symbol writer before
12471 emitting the constructor initializer.
12472 (ConstructorInitializer.Emit): Call ec.Mark() to allow
12473 single-stepping through constructor initializers.
12475 2003-01-30 Miguel de Icaza <miguel@ximian.com>
12477 * class.cs: Handle error 549: do not allow virtual methods in
12480 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
12482 * decl.cs: Check access levels when resolving types
12484 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
12486 * statement.cs: Add parameters and locals set in catch blocks that might
12487 return to set vector
12489 2003-01-29 Miguel de Icaza <miguel@ximian.com>
12491 * class.cs (Operator): Set the SpecialName flags for operators.
12493 * expression.cs (Invocation.DoResolve): Only block calls to
12494 accessors and operators on SpecialName methods.
12496 (Cast.TryReduce): Handle conversions from char constants.
12499 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
12501 * statement.cs: small memory and time optimization in FlowBranching.
12503 2003-01-28 Pedro Mart <yoros@wanadoo.es>
12505 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
12506 problem that the last fix but in the other sid (Set).
12508 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
12509 access when there is no indexer in the hierarchy.
12511 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
12513 * class.cs: Combine some if statements.
12515 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12517 * driver.cs: fixed bug #37187.
12519 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
12521 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
12522 any indexer, it's needed to build a list with all the indexers in the
12523 hierarchy (AllGetters), else we have problems. Fixes #35653.
12525 2003-01-23 Miguel de Icaza <miguel@ximian.com>
12527 * class.cs (MethodData.Define): It is wrong for an interface
12528 implementation to be static in both cases: explicit and implicit.
12529 We were only handling this in one case.
12531 Improve the if situation there to not have negations.
12533 * class.cs (Field.Define): Turns out that we do not need to check
12534 the unsafe bit on field definition, only on usage. Remove the test.
12536 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12538 * driver.cs: use assembly.Location instead of Codebase (the latest
12539 patch made mcs fail when using MS assemblies).
12541 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
12543 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
12544 get the path to *corlib.dll.
12546 2003-01-21 Nick Drochak <ndrochak@gol.com>
12550 * typemanager.cs: Remove compiler warnings
12552 2003-01-20 Duncan Mak <duncan@ximian.com>
12554 * AssemblyInfo.cs: Bump the version number to 0.19.
12556 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12558 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
12560 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
12562 * class.cs (Constructor::Emit): Emit debugging info for constructors.
12564 2003-01-17 Miguel de Icaza <miguel@ximian.com>
12566 * cs-parser.jay: Small fix: we were not comparing the constructor
12567 name correctly. Thanks to Zoltan for the initial pointer.
12569 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
12571 * cs-tokenizer.cs: Set file name when specified with #line
12573 2003-01-15 Miguel de Icaza <miguel@ximian.com>
12575 * cs-parser.jay: Only perform the constructor checks here if we
12576 are named like the class; This will help provider a better
12577 error. The constructor path is taken when a type definition is
12578 not found, but most likely the user forgot to add the type, so
12579 report that rather than the constructor error.
12581 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
12583 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
12586 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
12588 * cs-parser.jay: Add cleanup call.
12590 2003-01-13 Duncan Mak <duncan@ximian.com>
12592 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
12593 consistent with other methods.
12595 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
12597 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
12599 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
12601 * attribute.cs: only set GuidAttr to true when we have a
12604 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12608 * typemanager.cs: fixes to allow mcs compile corlib with the new
12609 Type.IsSubclassOf fix.
12611 2003-01-08 Miguel de Icaza <miguel@ximian.com>
12613 * expression.cs (LocalVariableReference.DoResolve): Classify a
12614 constant as a value, not as a variable. Also, set the type for
12617 * cs-parser.jay (fixed_statement): take a type instead of a
12618 pointer_type, so we can produce a better error message later.
12620 * statement.cs (Fixed.Resolve): Flag types that are not pointers
12623 (For.DoEmit): Make inifinite loops have a
12624 non-conditional branch back.
12626 (Fixed.DoEmit): First populate the pinned variables, then emit the
12627 statement, then clear the variables. Before I was emitting the
12628 code once for each fixed piece.
12631 2003-01-08 Martin Baulig <martin@ximian.com>
12633 * statement.cs (FlowBranching.MergeChild): A break in a
12634 SWITCH_SECTION does not leave a loop. Fixes #36155.
12636 2003-01-08 Martin Baulig <martin@ximian.com>
12638 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
12639 lives in the same number space than `param_map'. Fixes #36154.
12641 2003-01-07 Miguel de Icaza <miguel@ximian.com>
12643 * cs-parser.jay (constructor_declaration): Set the
12644 Constructor.ModFlags before probing for it. This makes the
12645 compiler report 514, 515 and 132 (the code was there, but got
12648 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
12649 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
12650 (GotoCase.Resolve): Set `Returns' to ALWAYS.
12652 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
12654 * enum.cs: create the enum static fields using the enum type.
12656 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
12658 * class.cs: don't try to create the ParamBuilder for the return
12659 type if it's not needed (and handle it breaking for the ms runtime
12662 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
12664 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
12666 2002-12-29 Miguel de Icaza <miguel@ximian.com>
12668 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
12669 the command. This showed up while compiling the JANET source
12670 code, which used \r as its only newline separator.
12672 2002-12-28 Miguel de Icaza <miguel@ximian.com>
12674 * class.cs (Method.Define): If we are an operator (because it
12675 reuses our code), then set the SpecialName and HideBySig. #36128
12677 2002-12-22 Miguel de Icaza <miguel@ximian.com>
12679 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
12680 exception, report error 120 `object reference required'.
12682 * driver.cs: Add --pause option, used during to measure the size
12683 of the process as it goes with --timestamp.
12685 * expression.cs (Invocation.DoResolve): Do not allow methods with
12686 SpecialName to be invoked.
12688 2002-12-21 Miguel de Icaza <miguel@ximian.com>
12690 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
12691 number before adding it.
12693 2002-12-21 Ravi Pratap <ravi@ximian.com>
12695 * ecore.cs (StandardImplicitConversion): When in an unsafe
12696 context, we allow conversion between void * to any other pointer
12697 type. This fixes bug #35973.
12699 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
12701 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
12702 is not thrown when extensionless outputs are used
12704 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12706 * rootcontext.cs: fixed compilation of corlib.
12708 2002-12-19 Miguel de Icaza <miguel@ximian.com>
12710 * attribute.cs (Attributes.Contains): Add new method.
12712 * class.cs (MethodCore.LabelParameters): if the parameter is an
12713 `out' parameter, check that no attribute `[In]' has been passed.
12715 * enum.cs: Handle the `value__' name in an enumeration.
12717 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
12719 * decl.cs: Added special case to allow overrides on "protected
12722 2002-12-18 Ravi Pratap <ravi@ximian.com>
12724 * attribute.cs (Attributes.AddAttributeSection): Rename to this
12725 since it makes much more sense.
12727 (Attributes.ctor): Don't require a Location parameter.
12729 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
12731 * attribute.cs (ApplyAttributes): Remove extra Location parameters
12732 since we already have that information per attribute.
12734 * everywhere : make appropriate changes.
12736 * class.cs (LabelParameters): Write the code which actually
12737 applies attributes to the return type. We can't do this on the MS
12738 .NET runtime so we flag a warning in the case an exception is
12741 2002-12-18 Miguel de Icaza <miguel@ximian.com>
12743 * const.cs: Handle implicit null conversions here too.
12745 2002-12-17 Ravi Pratap <ravi@ximian.com>
12747 * class.cs (MethodCore.LabelParameters): Remove the extra
12748 Type [] parameter since it is completely unnecessary. Instead
12749 pass in the method's attributes so that we can extract
12750 the "return" attribute.
12752 2002-12-17 Miguel de Icaza <miguel@ximian.com>
12754 * cs-parser.jay (parse): Use Report.Error to flag errors instead
12755 of ignoring it and letting the compile continue.
12757 * typemanager.cs (ChangeType): use an extra argument to return an
12758 error condition instead of throwing an exception.
12760 2002-12-15 Miguel de Icaza <miguel@ximian.com>
12762 * expression.cs (Unary.TryReduce): mimic the code for the regular
12763 code path. Perform an implicit cast in the cases where we can
12764 implicitly convert to one of the integral types, and then reduce
12765 based on that constant. This fixes bug #35483.
12767 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12769 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
12771 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12773 * namespace.cs: fixed bug #35489.
12775 2002-12-12 Miguel de Icaza <miguel@ximian.com>
12777 * class.cs: Remove some dead code.
12779 * cs-parser.jay: Estimate the number of methods needed
12780 (RootContext.MethodCount);
12782 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
12783 numbers instead of StringBuilders.
12785 * support.cs (PtrHashtable): Add constructor with initial size;
12786 We can now reduce reallocations of the method table.
12788 2002-12-10 Ravi Pratap <ravi@ximian.com>
12790 * attribute.cs (ApplyAttributes): Keep track of the emitted
12791 attributes on a per-target basis. This fixes bug #35413.
12793 2002-12-10 Miguel de Icaza <miguel@ximian.com>
12795 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
12796 default to the Windows 1252 encoding.
12798 (UnixParseOption): Support version, thanks to Alp for the missing
12801 * AssemblyInfo.cs: Add nice assembly information.
12803 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
12806 * cs-parser.jay: Allow a trailing comma before the close bracked
12807 in the attribute_section production.
12809 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
12810 address of the instance was being taken, I will take this out,
12811 because we take the address of the object immediately here.
12813 2002-12-09 Ravi Pratap <ravi@ximian.com>
12815 * typemanager.cs (AreMultipleAllowed): Take care of the most
12816 obvious case where attribute type is not in the current assembly -
12819 2002-12-08 Miguel de Icaza <miguel@ximian.com>
12821 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
12822 definitions, instead of doing that afterwards.
12824 Also we use a nice little hack, depending on the constructor, we
12825 know if we are a "composed" name or a simple name. Hence, we
12826 avoid the IndexOf test, and we avoid
12828 * codegen.cs: Add code to assist in a bug reporter to track down
12829 the source of a compiler crash.
12831 2002-12-07 Ravi Pratap <ravi@ximian.com>
12833 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
12834 types have been emitted for a given element and flag an error
12835 if something which does not have AllowMultiple set is used more
12838 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
12839 attribute types and their corresponding AllowMultiple properties
12841 (AreMultipleAllowed): Check the property for a given type.
12843 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
12844 property in the case we have a TypeContainer.
12846 (Attributes.AddAttribute): Detect duplicates and just skip on
12847 adding them. This trivial fix catches a pretty gross error in our
12848 attribute emission - global attributes were being emitted twice!
12850 Bugzilla bug #33187 is now fixed.
12852 2002-12-06 Miguel de Icaza <miguel@ximian.com>
12854 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
12855 instead of pp_and).
12857 * expression.cs (Binary.ResolveOperator): I can only use the
12858 Concat (string, string, string) and Concat (string, string,
12859 string, string) if the child is actually a concatenation of
12862 2002-12-04 Miguel de Icaza <miguel@ximian.com>
12864 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
12865 context where we need a 2-character lookahead.
12867 * pending.cs (PendingImplementation): Rework so we can keep track
12868 of interface types all the time, and flag those which were
12869 implemented by parents as optional.
12871 2002-12-03 Miguel de Icaza <miguel@ximian.com>
12873 * expression.cs (Binary.ResolveOperator): Use
12874 String.Concat(string,string,string) or
12875 String.Concat(string,string,string,string) when possible.
12877 * typemanager: More helper methods.
12880 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
12882 * pending.cs: remove the bogus return from GetMissingInterfaces()
12883 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
12885 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12887 * namespace.cs: avoid duplicated 'using xxx' being added to
12888 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
12889 when we get more than one 'using' statement for the same namespace.
12890 Report a CS0105 warning for it.
12892 2002-11-30 Miguel de Icaza <miguel@ximian.com>
12894 * cs-tokenizer.cs (consume_identifier): use read directly, instead
12895 of calling getChar/putback, uses internal knowledge of it.
12897 (xtoken): Reorder tokenizer so most common patterns are checked
12898 first. This reduces the compilation time in another 5% (from 8.11s
12899 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
12901 The parsing time is 22% of the compilation in mcs, and from that
12902 64% is spent on the tokenization process.
12904 I tried using a binary search for keywords, but this is slower
12905 than the hashtable. Another option would be to do a couple of
12908 * Not use a StringBuilder, instead use an array of chars,
12909 with a set value. Notice that this way we could catch
12910 the 645 error without having to do it *afterwards*.
12912 * We could write a hand-parser to avoid the hashtable
12913 compares altogether.
12915 The identifier consumption process takes 37% of the tokenization
12916 time. Another 15% is spent on is_number. 56% of the time spent
12917 on is_number is spent on Int64.Parse:
12919 * We could probably choose based on the string length to
12920 use Int32.Parse or Int64.Parse and avoid all the 64-bit
12923 Another 3% is spend on wrapping `xtoken' in the `token' function.
12925 Handle 0xa0 as whitespace (#34752)
12927 2002-11-26 Miguel de Icaza <miguel@ximian.com>
12929 * typemanager.cs (IsCLRType): New routine to tell whether a type
12930 is one of the builtin types.
12932 Maybe it needs to use TypeCodes to be faster. Maybe we could use
12933 typecode in more places instead of doing pointer comparissions.
12934 We could leverage some knowledge about the way the typecodes are
12937 New code to cache namespaces in assemblies, it is currently not
12938 invoked, to be used soon.
12940 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
12942 * expression.cs (Binary.ResolveOperator): specially handle
12943 strings, and do not perform user-defined operator overloading for
12946 2002-11-24 Miguel de Icaza <miguel@ximian.com>
12948 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
12949 internalcall as it is a pretty simple operation; Avoid whenever
12950 possible to call Char.IsLetter.
12952 (consume_identifier): Cut by half the number of
12953 hashtable calls by merging the is_keyword and GetKeyword behavior.
12955 Do not short-circuit, because if we do, we
12956 report errors (ie, #if false && true would produce an invalid
12960 2002-11-24 Martin Baulig <martin@ximian.com>
12962 * expression.cs (Cast.TryReduce): If we're in checked syntax,
12963 check constant ranges and report a CS0221. Fixes #33186.
12965 2002-11-24 Martin Baulig <martin@ximian.com>
12967 * cs-parser.jay: Make this work for uninitialized variable
12968 declarations in the `for' initializer. Fixes #32416.
12970 2002-11-24 Martin Baulig <martin@ximian.com>
12972 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
12973 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
12975 2002-11-24 Martin Baulig <martin@ximian.com>
12977 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
12978 argument; if true, we also check for user-defined conversions.
12979 This is only needed if both arguments are of a user-defined type.
12980 Fixes #30443, added test-175.cs.
12981 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
12983 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
12985 2002-11-24 Martin Baulig <martin@ximian.com>
12987 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
12988 function to get the store opcode.
12989 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
12990 only emit the Ldelema if the store opcode is Stobj. You must run
12991 both test-34 and test-167 to test this. Fixes #34529.
12993 2002-11-23 Martin Baulig <martin@ximian.com>
12995 * ecore.cs (Expression.MemberLookup): Added additional
12996 `qualifier_type' argument which is used when we're being called
12997 from MemberAccess.DoResolve() and null if we're called from a
12999 (Expression.MemberLookupFailed): New method to report errors; this
13000 does the CS1540 check and reports the correct error message.
13002 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
13003 argument for the CS1540 check and redone the way how we're dealing
13004 with private members. See the comment in the source code for details.
13005 (FilterWithClosure): Reverted this back to revision 1.197; renamed
13006 `closure_start_type' to `closure_qualifier_type' and check whether
13007 it's not null. It was not this filter being broken, it was just
13008 being called with the wrong arguments.
13010 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
13011 and pass it the correct `qualifier_type'; this also does the error
13014 2002-11-22 Miguel de Icaza <miguel@ximian.com>
13016 * expression.cs (Invocation.EmitParams): If the we are dealing
13017 with a non-built-in value type, load its address as well.
13019 (ArrayCreation): Use a a pretty constant instead
13020 of the hardcoded value 2. Use 6 instead of 2 for the number of
13021 static initializers.
13023 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
13024 because they are not really value types, just glorified integers.
13026 * driver.cs: Do not append .exe, the CSC compiler does not do it.
13028 * ecore.cs: Remove redundant code for enumerations, make them use
13029 the same code path as everything else, fixes the casting issue
13030 with enumerations in Windows.Forms.
13032 * attribute.cs: Do only cast to string if it is a string, the
13033 validation happens later.
13035 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
13036 people upgrade their corlibs.
13038 * ecore.cs: Oops, enumerations were not following the entire code path
13040 2002-11-21 Miguel de Icaza <miguel@ximian.com>
13042 * typemanager.cs (FilterWithClosure): Commented out the test for
13043 1540 in typemanager.cs, as it has problems when accessing
13044 protected methods from a parent class (see test-174.cs).
13046 * attribute.cs (Attribute.ValidateGuid): new method.
13047 (Attribute.Resolve): Use above.
13049 2002-11-19 Miguel de Icaza <miguel@ximian.com>
13051 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
13053 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
13054 handling for enumerations, as we only needed the TypeContainer
13055 functionality to begin with (this is required for the fix below to
13056 work for enums that reference constants in a container class for
13059 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
13061 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
13062 a valid TypeBuilder to perform lookups on.o
13064 * class.cs (InheritableMemberSignatureCompare): Use true in the
13065 call to GetGetMethod and GetSetMethod, because we are comparing
13066 the signature, and we need to get the methods *even* if they are
13069 (PropertyBase.CheckBase): ditto.
13071 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
13072 GotoCase.Resolve): Use Peel on EmpytCasts.
13074 * ecore.cs (EmptyCast): drop child, add Peel method.
13076 2002-11-17 Martin Baulig <martin@ximian.com>
13078 * ecore.cs (EmptyCast.Child): New public property.
13080 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
13081 label resolved to an EmptyCast. Fixes #34162.
13082 (GotoCase.Resolve): Likewise.
13083 (Block.EmitMeta): Likewise.
13085 2002-11-17 Martin Baulig <martin@ximian.com>
13087 * expression.cs (Invocation.BetterConversion): Prefer int over
13088 uint; short over ushort; long over ulong for integer literals.
13089 Use ImplicitConversionExists instead of StandardConversionExists
13090 since we also need to check for user-defined implicit conversions.
13091 Fixes #34165. Added test-173.cs.
13093 2002-11-16 Martin Baulig <martin@ximian.com>
13095 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
13096 with the `true' and `false' literals. Fixes #33151.
13098 2002-11-16 Martin Baulig <martin@ximian.com>
13100 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
13101 October 22nd; don't do the cs1540 check for static members.
13103 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
13104 now using our own filter here and doing the cs1540 check again.
13106 2002-11-16 Martin Baulig <martin@ximian.com>
13108 * support.cs (InternalParameters): Don't crash if we don't have
13109 any fixed parameters. Fixes #33532.
13111 2002-11-16 Martin Baulig <martin@ximian.com>
13113 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
13114 when looking up static methods to make this work on Windows.
13117 2002-11-16 Martin Baulig <martin@ximian.com>
13119 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
13120 a setter rather than using PropertyInfo.CanWrite.
13122 2002-11-15 Nick Drochak <ndrochak@gol.com>
13124 * class.cs: Allow acces to block member by subclasses. Fixes build
13127 2002-11-14 Martin Baulig <martin@ximian.com>
13129 * class.cs (Constructor.Emit): Added the extern/block check.
13132 2002-11-14 Martin Baulig <martin@ximian.com>
13134 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
13135 iteration while looking for indexers, this is needed because the
13136 indexer may have a different name in our base classes. Fixed the
13137 error reporting (no indexers at all, not get accessor, no
13138 overloaded match). Fixes bug #33089.
13139 (IndexerAccess.DoResolveLValue): Likewise.
13141 2002-11-14 Martin Baulig <martin@ximian.com>
13143 * class.cs (PropertyBase.CheckBase): Make this work for multiple
13144 indexers. Fixes the first part of bug #33089.
13145 (MethodSignature.InheritableMemberSignatureCompare): Added support
13148 2002-11-13 Ravi Pratap <ravi@ximian.com>
13150 * attribute.cs (Attribute.Resolve): Catch the
13151 NullReferenceException and report it since it isn't supposed to
13154 2002-11-12 Miguel de Icaza <miguel@ximian.com>
13156 * expression.cs (Binary.EmitBranchable): Also handle the cases for
13157 LogicalOr and LogicalAnd that can benefit from recursively
13158 handling EmitBranchable. The code now should be nice for Paolo.
13160 2002-11-08 Miguel de Icaza <miguel@ximian.com>
13162 * typemanager.cs (LookupType): Added a negative-hit hashtable for
13163 the Type lookups, as we perform quite a number of lookups on
13164 non-Types. This can be removed once we can deterministically tell
13165 whether we have a type or a namespace in advance.
13167 But this might require special hacks from our corlib.
13171 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
13172 and double which avoids a conversion from an integer to a double.
13174 * expression.cs: tiny optimization, avoid calling IsConstant,
13175 because it effectively performs the lookup twice.
13177 2002-11-06 Miguel de Icaza <miguel@ximian.com>
13179 But a bogus return here to keep the semantics of the old code
13180 until the Mono runtime is fixed.
13182 * pending.cs (GetMissingInterfaces): New method used to remove all
13183 the interfaces that are already implemented by our parent
13184 classes from the list of pending methods.
13186 * interface.cs: Add checks for calls after ResolveTypeExpr.
13188 2002-11-05 Miguel de Icaza <miguel@ximian.com>
13190 * class.cs (Class.Emit): Report warning 67: event not used if the
13191 warning level is beyond 3.
13193 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
13194 being a NullLiteral.
13196 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
13199 * class.cs (TypeContainer.GetClassBases): Cover a missing code
13200 path that might fail if a type can not be resolved.
13202 * expression.cs (Binary.Emit): Emit unsigned versions of the
13205 * driver.cs: use error 5.
13207 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
13209 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
13211 2002-11-01 Miguel de Icaza <miguel@ximian.com>
13213 * cs-parser.jay (switch_section): A beautiful patch from Martin
13214 Baulig that fixed 33094.
13216 2002-10-31 Miguel de Icaza <miguel@ximian.com>
13218 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
13219 Check whether the base is abstract and report an error if so.
13221 * expression.cs (IndexerAccess.DoResolveLValue,
13222 IndexerAccess.DoResolve): ditto.
13224 (Invocation.DoResolve): ditto.
13226 (Invocation.FullMethodDesc): Improve the report string.
13228 * statement.cs (Block): Eliminate IsVariableDefined as it is
13229 basically just a wrapper for GetVariableInfo.
13231 * ecore.cs (SimpleName): Use new
13233 * support.cs (ReflectionParamter.ParameterType): We unwrap the
13234 type, as we return the actual parameter ref/unref state on a
13237 2002-10-30 Miguel de Icaza <miguel@ximian.com>
13239 * support.cs: Return proper flags REF/OUT fixing the previous
13242 * expression.cs: Reverted last patch, that was wrong. Is_ref is
13243 not used to mean `ref' but `ref or out' in ParameterReference
13245 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
13246 full type signature instead of calling TypeManger.CSharpName
13249 * support.cs (InternalParameters.ParameterDesc): Do not compare
13250 directly to the modflags, because REF/OUT will actually be bitsets
13253 * delegate.cs (VerifyMethod): Check also the modifiers.
13255 * cs-tokenizer.cs: Fix bug where floating point values with an
13256 exponent where a sign was missing was ignored.
13258 * driver.cs: Allow multiple assemblies to be specified in a single
13261 2002-10-28 Miguel de Icaza <miguel@ximian.com>
13263 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
13264 because identifiers after a parenthesis would end up in this kind
13265 of production, and we needed to desamiguate it for having casts
13268 (UserDefinedType *) xxx
13270 2002-10-24 Miguel de Icaza <miguel@ximian.com>
13272 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
13273 we should set on the Bindingflags.NonPublic, but not turn on
13274 private_ok. private_ok controls whether a Private member is
13275 returned (this is chekced on the filter routine), while the
13276 BindingFlags.NonPublic just controls whether private/protected
13277 will be allowed. This fixes the problem part of the problem of
13278 private properties being allowed to be used in derived classes.
13280 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
13281 so we can call the children DoResolveLValue method (this will
13282 properly signal errors on lvalue assignments to base properties)
13284 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
13285 getter are null, and we have a property info, we know that this
13286 happened because the lookup failed, so we report an error 122 for
13287 protection level violation.
13289 We also silently return if setter and getter are null in the
13290 resolve functions, this condition only happens if we have flagged
13291 the error before. This is the other half of the problem.
13293 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
13294 not have accessibility information, that is why we were returning
13295 true in the filter function in typemanager.cs.
13297 To properly report 122 (property is inaccessible because of its
13298 protection level) correctly, we report this error in ResolveAccess
13299 by failing if both the setter and the getter are lacking (ie, the
13302 DoResolve and DoLResolve have been modified to check for both
13303 setter/getter being null and returning silently, the reason being
13304 that I did not want to put the knowledge about this error in upper
13307 int old = Report.Errors;
13308 x = new PropertyExpr (...);
13309 if (old != Report.Errors)
13314 So the property expr is returned, but it is invalid, so the error
13315 will be flagged during the resolve process.
13317 * class.cs: Remove InheritablePropertySignatureCompare from the
13318 class, as we no longer depend on the property signature to compute
13319 whether it is possible to implement a method or not.
13321 The reason is that calling PropertyInfo.GetGetMethod will return
13322 null (in .NET, in Mono it works, and we should change this), in
13323 cases where the Get Method does not exist in that particular
13328 class X { public virtual int A { get { return 1; } } }
13330 class Z : Y { public override int A { get { return 2; } } }
13332 Would fail in Z because the parent (Y) would not have the property
13333 defined. So we avoid this completely now (because the alternative
13334 fix was ugly and slow), and we now depend exclusively on the
13337 (PropertyBase.CheckBase): Use a method-base mechanism to find our
13338 reference method, instead of using the property.
13340 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
13341 routines are gone now.
13343 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
13344 names, they were incorrectly named.
13346 * cs-tokenizer.cs: Return are more gentle token on failure.
13348 * pending.cs (PendingImplementation.InterfaceMethod): This routine
13349 had an out-of-sync index variable, which caused it to remove from
13350 the list of pending methods the wrong method sometimes.
13352 2002-10-22 Miguel de Icaza <miguel@ximian.com>
13354 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
13355 CanWrite, because those refer to this particular instance of the
13356 property, and do not take into account the fact that we can
13357 override single members of a property.
13359 Constructor requires an EmitContext. The resolution process does
13360 not happen here, but we need to compute the accessors before,
13361 because the resolution does not always happen for properties.
13363 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
13364 subclass, before we did not update this flag, but we did update
13367 (GetAccessors): Drop this routine, as it did not work in the
13368 presence of partially overwritten set/get methods.
13370 Notice that this broke the cs1540 detection, but that will require
13373 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13377 * driver.cs: issue a warning instead of an error if we don't support
13378 debugging for the platform. Also ignore a couple of errors that may
13379 arise when trying to write the symbols. Undo my previous patch.
13381 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13383 * driver.cs: ignore /debug switch except for Unix platforms.
13385 2002-10-23 Nick Drochak <ndrochak@gol.com>
13387 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
13389 2002-10-21 Miguel de Icaza <miguel@ximian.com>
13391 * driver.cs: Do not make mcs-debug conditional, so we do not break
13392 builds that use it.
13394 * statement.cs (UsageVector.MergeChildren): I would like Martin to
13395 review this patch. But basically after all the children variables
13396 have been merged, the value of "Breaks" was not being set to
13397 new_breaks for Switch blocks. I think that it should be set after
13398 it has executed. Currently I set this to the value of new_breaks,
13399 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
13400 conservative, but I do not understand this code very well.
13402 I did not break anything in the build, so that is good ;-)
13404 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
13406 2002-10-20 Mark Crichton <crichton@gimp.org>
13408 * cfold.cs: Fixed compile blocker. Really fixed it this time.
13410 2002-10-20 Nick Drochak <ndrochak@gol.com>
13412 * cfold.cs: Fixed compile blocker.
13414 2002-10-20 Miguel de Icaza <miguel@ximian.com>
13416 * driver.cs: I was chekcing the key, not the file.
13418 2002-10-19 Ravi Pratap <ravi@ximian.com>
13420 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
13421 message that we were generating - we just need to silently return
13424 2002-10-19 Miguel de Icaza <miguel@ximian.com>
13426 * class.cs (Event.Define): Change my previous commit, as this
13427 breaks the debugger. This is a temporary hack, as it seems like
13428 the compiler is generating events incorrectly to begin with.
13430 * expression.cs (Binary.ResolveOperator): Added support for
13431 "U operator - (E x, E y)"
13433 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
13436 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
13437 init-only variables, but this path did not take into account that
13438 there might be also instance readonly variables. Correct this
13441 This fixes bug 32253
13443 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
13446 * driver.cs: Change the extension for modules to `netmodule'
13448 * cs-parser.jay: Improved slightly the location tracking for
13449 the debugger symbols.
13451 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
13452 modifiers that were specified instead of the hardcoded value
13453 (FamAndAssem). This was basically ignoring the static modifier,
13454 and others. Fixes 32429.
13456 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
13457 fixed a bug in the process (32476)
13459 * expression.cs (ArrayAccess.EmitAssign): Patch from
13460 hwang_rob@yahoo.ca that fixes bug 31834.3
13462 2002-10-18 Miguel de Icaza <miguel@ximian.com>
13464 * driver.cs: Make the module extension .netmodule.
13466 2002-10-16 Miguel de Icaza <miguel@ximian.com>
13468 * driver.cs: Report an error if the resource file is not found
13469 instead of crashing.
13471 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
13472 false, like Emit does.
13474 2002-10-16 Nick Drochak <ndrochak@gol.com>
13476 * typemanager.cs: Remove unused private member. Also reported mcs
13477 bug to report this as a warning like csc.
13479 2002-10-15 Martin Baulig <martin@gnome.org>
13481 * statement.cs (Statement.Emit): Made this a virtual method; emits
13482 the line number info and calls DoEmit().
13483 (Statement.DoEmit): New protected abstract method, formerly knows
13484 as Statement.Emit().
13486 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
13488 2002-10-11 Miguel de Icaza <miguel@ximian.com>
13490 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
13491 have fixed a remaining problem: not every AddXXXX was adding a
13492 fully qualified name.
13494 Now everyone registers a fully qualified name in the DeclSpace as
13495 being defined instead of the partial name.
13497 Downsides: we are slower than we need to be due to the excess
13498 copies and the names being registered this way.
13500 The reason for this is that we currently depend (on the corlib
13501 bootstrap for instance) that types are fully qualified, because
13502 we dump all the types in the namespace, and we should really have
13503 types inserted into the proper namespace, so we can only store the
13504 basenames in the defined_names array.
13506 2002-10-10 Martin Baulig <martin@gnome.org>
13508 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
13509 from bug #31834, see the bug report for a testcase which is
13512 2002-10-10 Martin Baulig <martin@gnome.org>
13514 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
13515 flow analysis code for this.
13517 * statement.cs (Do, While, For): Tell the flow analysis code about
13519 (FlowBranching.UsageVector): Added support for infinite loops.
13520 (Block.Resolve): Moved the dead code elimination here and use flow
13523 2002-10-09 Miguel de Icaza <miguel@ximian.com>
13525 * class.cs (Field.Define): Catch cycles on struct type
13528 * typemanager.cs (IsUnmanagedtype): Do not recursively check
13529 fields if the fields are static. We only need to check instance
13532 * expression.cs (As.DoResolve): Test for reference type.
13534 * statement.cs (Using.ResolveExpression): Use
13535 ConvertImplicitRequired, not ConvertImplicit which reports an
13537 (Using.ResolveLocalVariableDecls): ditto.
13539 * expression.cs (Binary.ResolveOperator): Report errors in a few
13540 places where we had to.
13542 * typemanager.cs (IsUnmanagedtype): Finish implementation.
13544 2002-10-08 Miguel de Icaza <miguel@ximian.com>
13546 * expression.cs: Use StoreFromPtr instead of extracting the type
13547 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
13549 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
13550 an enumeration value to a System.Enum, but System.Enum is not a
13551 value type, but an class type, so we need to box.
13553 (Expression.ConvertExplicit): One codepath could return
13554 errors but not flag them. Fix this. Fixes #31853
13556 * parameter.cs (Resolve): Do not allow void as a parameter type.
13558 2002-10-06 Martin Baulig <martin@gnome.org>
13560 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
13561 if it's a class type and not a struct. Fixes #31815.
13563 2002-10-06 Martin Baulig <martin@gnome.org>
13565 * statement.cs: Reworked the flow analysis code a bit to make it
13566 usable for dead code elimination.
13568 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13570 * cs-parser.jay: allow empty source files. Fixes bug #31781.
13572 2002-10-04 Miguel de Icaza <miguel@ximian.com>
13574 * expression.cs (ComposedCast.DoResolveType): A quick workaround
13575 to fix the test 165, will investigate deeper.
13577 2002-10-04 Martin Baulig <martin@gnome.org>
13579 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
13580 finally blocks actually work.
13581 (Try.Resolve): We don't need to create a sibling for `finally' if
13582 there is no finally block.
13584 2002-10-04 Martin Baulig <martin@gnome.org>
13586 * class.cs (Constructor.Define): The default accessibility for a
13587 non-default constructor is private, not public.
13589 2002-10-04 Miguel de Icaza <miguel@ximian.com>
13591 * class.cs (Constructor): Make AllowedModifiers public, add
13594 * cs-parser.jay: Perform the modifiers test here, as the
13595 constructor for the Constructor class usually receives a zero
13596 because of the way we create it (first we create, later we
13597 customize, and we were never checking the modifiers).
13599 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
13600 is a version of LookupTypeReflection that includes the type-name
13601 cache. This can be used as a fast path for functions that know
13602 the fully qualified name and are only calling into *.GetType() to
13603 obtain a composed type.
13605 This is also used by TypeManager.LookupType during its type
13608 (LookupType): We now also track the real type name, as sometimes
13609 we can get a quey for the real type name from things like
13610 ComposedCast. This fixes bug 31422.
13612 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
13613 complete type fullname, it does not have to go through the type
13614 resolution system to obtain the composed version of the type (for
13615 obtaining arrays or pointers).
13617 (Conditional.Emit): Use the EmitBoolExpression to
13618 generate nicer code, as requested by Paolo.
13620 (ArrayCreation.CheckIndices): Use the patch from
13621 hwang_rob@yahoo.ca to validate the array initializers.
13623 2002-10-03 Miguel de Icaza <miguel@ximian.com>
13625 * class.cs (ConstructorInitializer.Emit): simplify code by using
13626 Invocation.EmitCall, and at the same time, fix the bugs in calling
13627 parent constructors that took variable arguments.
13629 * ecore.cs (Expression.ConvertNumericExplicit,
13630 Expression.ImplicitNumericConversion): Remove the code that
13631 manually wrapped decimal (InternalTypeConstructor call is now gone
13634 * expression.cs (Cast.TryReduce): Also handle decimal types when
13635 trying to perform a constant fold on the type.
13637 * typemanager.cs (IsUnmanagedtype): Partially implemented.
13639 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
13640 that only turned off an error report, and did nothing else.
13642 2002-10-02 Miguel de Icaza <miguel@ximian.com>
13644 * driver.cs: Handle and ignore /fullpaths
13646 2002-10-01 Miguel de Icaza <miguel@ximian.com>
13648 * expression.cs (Binary.ResolveOperator): Catch the case where
13649 DoNumericPromotions returns true,
13651 (Binary.DoNumericPromotions): Simplify the code, and the tests.
13653 2002-09-27 Miguel de Icaza <miguel@ximian.com>
13655 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
13658 2002-09-26 Miguel de Icaza <miguel@ximian.com>
13660 * ecore.cs (ConvertNumericExplicit): It is not enough that the
13661 conversion exists, but it is also required that the conversion be
13662 performed. This manifested in "(Type64Enum) 2".
13664 * class.cs (TypeManager.AddMethod): The fix is not to change
13665 AddEnum, because that one was using a fully qualified name (every
13666 DeclSpace derivative does), but to change the AddMethod routine
13667 that was using an un-namespaced name. This now correctly reports
13668 the duplicated name.
13670 Revert patch until I can properly fix it. The issue
13671 is that we have a shared Type space across all namespaces
13672 currently, which is wrong.
13674 Options include making the Namespace a DeclSpace, and merge
13675 current_namespace/current_container in the parser.
13677 2002-09-25 Miguel de Icaza <miguel@ximian.com>
13679 * cs-parser.jay: Improve error reporting when we get a different
13680 kind of expression in local_variable_type and
13681 local_variable_pointer_type.
13683 Propagate this to avoid missleading errors being reported.
13685 * ecore.cs (ImplicitReferenceConversion): treat
13686 TypeManager.value_type as a target just like object_type. As
13691 Is valid, and needs to result in the int 1 being boxed before it
13692 is assigned to the value type v.
13694 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
13695 to validate the enumeration name.
13697 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
13698 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
13699 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
13701 * ecore.cs (TryImplicitIntConversion): When doing an
13702 implicit-enumeration-conversion, check if the type is 64-bits and
13703 perform a conversion before passing to EnumConstant.
13705 2002-09-23 Miguel de Icaza <miguel@ximian.com>
13707 * decl.cs (Error_AmbiguousTypeReference); New routine used to
13708 report ambiguous type references. Unlike the MS version, we
13709 report what the ambiguity is. Innovation at work ;-)
13711 (DeclSpace.FindType): Require a location argument to
13712 display when we display an ambiguous error.
13714 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
13716 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
13718 * expression.cs (EmitDynamicInitializers): Apply patch from
13719 hwang_rob@yahoo.ca that fixes the order in which we emit our
13722 2002-09-21 Martin Baulig <martin@gnome.org>
13724 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
13725 delegate takes no arguments.
13727 2002-09-20 Miguel de Icaza <miguel@ximian.com>
13729 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
13732 * expression.cs: Extract the underlying type.
13734 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
13736 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
13738 2002-09-19 Miguel de Icaza <miguel@ximian.com>
13740 * class.cs (TypeContainer.DefineType): We can not use the nice
13741 PackingSize with the size set to 1 DefineType method, because it
13742 will not allow us to define the interfaces that the struct
13745 This completes the fixing of bug 27287
13747 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
13748 means also structs. This fixes part of the problem.
13749 (Expresion.ImplicitReferenceConversionExists): ditto.
13751 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
13752 error if there were no errors reported during the type lookup
13753 process, to avoid duplicates or redundant errors. Without this
13754 you would get an ambiguous errors plus a type not found. We have
13755 beaten the user enough with the first error.
13757 (DeclSparce.FindType): Emit a warning if we have an ambiguous
13760 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
13761 during the resolution process, stop the lookup, this avoids
13762 repeated error reports (same error twice).
13764 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
13766 * typemanager.cs (LookupType): Redo the type lookup code to match
13767 the needs of System.Reflection.
13769 The issue is that System.Reflection requires references to nested
13770 types to begin with a "+" sign instead of a dot. So toplevel
13771 types look like: "NameSpace.TopLevelClass", and nested ones look
13772 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
13775 2002-09-19 Martin Baulig <martin@gnome.org>
13777 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
13778 says that a method always returns or always throws an exception,
13779 don't report the CS0161.
13781 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
13782 set `Returns = new_returns'.
13784 2002-09-19 Martin Baulig <martin@gnome.org>
13786 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
13787 to an enum constant, check for a CS0176.
13789 2002-09-18 Miguel de Icaza <miguel@ximian.com>
13791 * class.cs (TypeContainer.CheckPairedOperators): Now we check
13792 for operators that must be in pairs and report errors.
13794 * ecore.cs (SimpleName.DoResolveType): During the initial type
13795 resolution process, when we define types recursively, we must
13796 check first for types in our current scope before we perform
13797 lookups in the enclosing scopes.
13799 * expression.cs (MakeByteBlob): Handle Decimal blobs.
13801 (Invocation.VerifyArgumentsCompat): Call
13802 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
13803 I thought we were supposed to always call this, but there are a
13804 few places in the code where we dont do it.
13806 2002-09-17 Miguel de Icaza <miguel@ximian.com>
13808 * driver.cs: Add support in -linkres and -resource to specify the
13809 name of the identifier.
13811 2002-09-16 Miguel de Icaza <miguel@ximian.com>
13813 * ecore.cs (StandardConversionExists): Sync with the conversion
13814 code: allow anything-* to void* conversions.
13816 (FindMostSpecificSource): Use an Expression argument
13817 instead of a Type, because we might be handed over a Literal which
13818 gets a few more implicit conversions that plain types do not. So
13819 this information was being lost.
13821 Also, we drop the temporary type-holder expression when not
13824 2002-09-17 Martin Baulig <martin@gnome.org>
13826 * class.cs (PropertyBase.CheckBase): Don't check the base class if
13827 this is an explicit interface implementation.
13829 2002-09-17 Martin Baulig <martin@gnome.org>
13831 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
13832 different `IndexerName' attributes.
13834 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
13835 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
13836 virtual CommonResolve().
13838 2002-09-16 Miguel de Icaza <miguel@ximian.com>
13840 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
13841 and convert that to the UnderlyingType.
13843 * statement.cs (Foreach.Resolve): Indexers are just like variables
13844 or PropertyAccesses.
13846 * cs-tokenizer.cs (consume_string): Track line numbers and columns
13847 inside quoted strings, we were not doing this before.
13849 2002-09-16 Martin Baulig <martin@gnome.org>
13851 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
13852 resolve it. This is needed for the definite assignment check of the
13853 instance expression, fixes bug #29846.
13854 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
13856 2002-09-16 Nick Drochak <ndrochak@gol.com>
13858 * parameter.cs: Fix compile error. Cannot reference static member
13859 from an instance object. Is this an mcs bug?
13861 2002-09-14 Martin Baulig <martin@gnome.org>
13863 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
13864 multiple times. Fixes bug #30295, added test-166.cs.
13866 2002-09-14 Martin Baulig <martin@gnome.org>
13868 * statement.cs (Block.Emit): Don't emit unreachable code.
13869 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
13870 `break' statements.
13871 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
13873 2002-09-14 Martin Baulig <martin@gnome.org>
13875 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
13878 2002-09-14 Martin Baulig <martin@gnome.org>
13880 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
13881 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
13882 be false on the ms runtime.
13884 2002-09-13 Martin Baulig <martin@gnome.org>
13886 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
13887 the CS0038 error message.
13889 2002-09-12 Miguel de Icaza <miguel@ximian.com>
13891 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
13892 constant inside, return it.
13894 2002-09-12 Martin Baulig <martin@gnome.org>
13896 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
13897 implicit conversion can be done between enum types.
13899 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
13900 check whether an implicit conversion to the current enum's UnderlyingType
13901 exists and report an error if not.
13903 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
13904 without debugging support.
13906 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
13907 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
13909 2002-09-12 Martin Baulig <martin@gnome.org>
13911 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
13913 * ecore.cs (IMemberExpr.DeclaringType): New property.
13914 (SimpleName.SimpleNameResolve): Check whether we're accessing a
13915 nonstatic member of an outer type (CS0038).
13917 2002-09-11 Miguel de Icaza <miguel@ximian.com>
13919 * driver.cs: Activate the using-error detector at warning level
13920 4 (at least for MS-compatible APIs).
13922 * namespace.cs (VerifyUsing): Small buglett fix.
13924 * pending.cs (PendingImplementation): pass the container pointer.
13926 * interface.cs (GetMethods): Allow for recursive definition. Long
13927 term, I would like to move every type to support recursive
13928 definitions, not the current ordering mechanism that we have right
13931 The situation is this: Attributes are handled before interfaces,
13932 so we can apply attributes to interfaces. But some attributes
13933 implement interfaces, we will now handle the simple cases
13934 (recursive definitions will just get an error).
13936 * parameter.cs: Only invalidate types at the end if we fail to
13939 2002-09-09 Martin Baulig <martin@gnome.org>
13941 * ecore.cs (PropertyExpr.Emit): Also check for
13942 TypeManager.system_int_array_get_length so this'll also work when
13943 compiling corlib. Fixes #30003.
13945 2002-09-09 Martin Baulig <martin@gnome.org>
13947 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
13948 and throw an exception if we can't get the type's size. Fixed #30040,
13951 2002-09-09 Martin Baulig <martin@gnome.org>
13953 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
13955 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
13956 context. Fixes bug #30027.
13958 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
13959 virtual functions. Fixes bug #30043, added test-164.cs.
13961 2002-09-08 Ravi Pratap <ravi@ximian.com>
13963 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
13965 2002-09-08 Nick Drochak <ndrochak@gol.com>
13967 * driver.cs: Use an object to get the windows codepage since it's not a
13970 2002-09-08 Miguel de Icaza <miguel@ximian.com>
13972 * statement.cs (For.Emit): for infinite loops (test == null)
13973 return whether there is a break inside, not always "true".
13975 * namespace.cs (UsingEntry): New struct to hold the name of the
13976 using definition, the location where it is defined, and whether it
13977 has been used in a successful type lookup.
13979 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
13984 2002-09-06 Ravi Pratap <ravi@ximian.com>
13986 * attribute.cs : Fix incorrect code which relied on catching
13987 a NullReferenceException to detect a null being passed in
13988 where an object was expected.
13990 2002-09-06 Miguel de Icaza <miguel@ximian.com>
13992 * statement.cs (Try): flag the catch variable as assigned
13994 * expression.cs (Cast): Simplified by using ResolveType instead of
13995 manually resolving.
13997 * statement.cs (Catch): Fix bug by using ResolveType.
13999 2002-09-06 Ravi Pratap <ravi@ximian.com>
14001 * expression.cs (BetterConversion): Special case for when we have
14002 a NullLiteral as the argument and we have to choose between string
14003 and object types - we choose string the way csc does.
14005 * attribute.cs (Attribute.Resolve): Catch the
14006 NullReferenceException and report error #182 since the Mono
14007 runtime no more has the bug and having this exception raised means
14008 we tried to select a constructor which takes an object and is
14011 2002-09-05 Ravi Pratap <ravi@ximian.com>
14013 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
14014 message (1502, 1503) when we can't locate a method after overload
14015 resolution. This is much more informative and closes the bug
14018 * interface.cs (PopulateMethod): Return if there are no argument
14019 types. Fixes a NullReferenceException bug.
14021 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
14022 expressions too. Previously we were checking only in one place for
14023 positional arguments leaving out named arguments.
14025 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
14026 type to the enum type is not allowed. Remove code corresponding to
14029 (ConvertNumericExplicit): Allow explicit conversions from
14030 the underlying type to enum type. This precisely follows the spec
14031 and closes a bug filed by Gonzalo.
14033 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14036 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
14038 2002-09-03 Miguel de Icaza <miguel@ximian.com>
14040 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
14041 it was important that we stored the right value after the
14042 reduction in `converted'.
14044 2002-09-04 Martin Baulig <martin@gnome.org>
14046 * location.cs (Location.SymbolDocument): Use full pathnames for the
14049 2002-08-30 Miguel de Icaza <miguel@ximian.com>
14051 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
14052 of the expression resolve mechanism, because that will catch the
14053 SimpleName error failures.
14055 (Conditional): If we can not resolve the
14056 expression, return, do not crash.
14058 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14061 (location): display token name instead of its number.
14063 2002-08-28 Martin Baulig <martin@gnome.org>
14065 * expression.cs (Binary.ResolveOperator): Don't silently return
14066 but return an error if an operator cannot be applied between two
14069 2002-08-28 Martin Baulig <martin@gnome.org>
14071 * class.cs (Constructor.Define): Set the permission attributes
14072 correctly instead of making all constructors public.
14074 2002-08-28 Martin Baulig <martin@gnome.org>
14076 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
14077 for private members before reporting a CS0103; if we find anything,
14080 2002-08-28 Martin Baulig <martin@gnome.org>
14082 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
14083 to check whether `closure_start_type == closure_invocation_type',
14084 we also need to check whether `m.DeclaringType == closure_invocation_type'
14085 before bypassing the permission checks. We might be accessing
14086 protected/private members from the base class.
14087 (TypeManager.RealMemberLookup): Only set private_ok if private
14088 members were requested via BindingFlags.NonPublic.
14090 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
14092 * expression.cs (MemberAccess.ResolveMemberAccess): Set
14093 MethodGroupExpr.IsExplicitImpl if appropriate.
14094 (Invocation.DoResolve): Don't report the CS0120 for explicit
14095 interface implementations.
14097 2002-08-27 Martin Baulig <martin@gnome.org>
14099 * expression.cs (Invocation.DoResolve): If this is a static
14100 method and we don't have an InstanceExpression, we must report
14103 2002-08-25 Martin Baulig <martin@gnome.org>
14105 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
14106 `==' between a valuetype and an object.
14108 2002-08-25 Miguel de Icaza <miguel@ximian.com>
14110 * ecore.cs (TypeExpr): Provide a ToString method.
14112 2002-08-24 Martin Baulig <martin@gnome.org>
14114 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
14115 now called proggie.dbg and it's a binary file.
14117 2002-08-23 Martin Baulig <martin@gnome.org>
14119 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
14121 2002-08-23 Martin Baulig <martin@gnome.org>
14123 * struct.cs (MyStructInfo.ctor): Make this work with empty
14124 structs; it's not allowed to use foreach() on null.
14126 2002-08-23 Martin Baulig <martin@gnome.org>
14128 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
14129 writer the full pathname of the generated assembly.
14131 2002-08-23 Martin Baulig <martin@gnome.org>
14133 * statements.cs (FlowBranching.UsageVector.MergeChildren):
14134 A `finally' block never returns or breaks; improved handling of
14137 2002-08-23 Martin Baulig <martin@gnome.org>
14139 * statement.cs (Throw.Resolve): Allow `throw null'.
14141 2002-08-23 Martin Baulig <martin@gnome.org>
14143 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
14144 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
14145 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
14146 MemberLookup would return a wrong event if this is an explicit
14147 interface implementation and the class has an event with the same
14150 2002-08-23 Martin Baulig <martin@gnome.org>
14152 * statement.cs (Block.AddChildVariableNames): New public method.
14153 (Block.AddChildVariableName): Likewise.
14154 (Block.IsVariableNameUsedInChildBlock): Likewise.
14155 (Block.AddVariable): Check whether a variable name has already
14156 been used in a child block.
14158 * cs-parser.jay (declare_local_variables): Mark all variable names
14159 from the current block as being used in a child block in the
14162 2002-08-23 Martin Baulig <martin@gnome.org>
14164 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
14165 find the symbol writer.
14167 * driver.cs: csc also allows the arguments to /define being
14168 separated by commas, not only by semicolons.
14170 2002-08-23 Martin Baulig <martin@gnome.org>
14172 * interface.cs (Interface.GetMembers): Added static check for events.
14174 2002-08-15 Martin Baulig <martin@gnome.org>
14176 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
14177 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
14179 * ecore.cs (Expression.MemberLookup): Added documentation and explained
14180 why the MethodData.EmitDestructor() change was necessary.
14182 2002-08-20 Martin Baulig <martin@gnome.org>
14184 * class.cs (TypeContainer.FindMembers): Added static check for events.
14186 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
14188 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
14189 use Type.GetEvents(), not Type.FindMembers().
14191 2002-08-20 Martin Baulig <martin@gnome.org>
14193 * decl.cs (MemberCache): Added a special method cache which will
14194 be used for method-only searched. This ensures that a method
14195 search will return a MethodInfo with the correct ReflectedType for
14198 2002-08-20 Martin Baulig <martin@gnome.org>
14200 * decl.cs (DeclSpace.FindMembers): Made this public.
14202 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14204 * delegate.cs: fixed build on windows.
14205 [FIXME: Filed as bug #29150: MCS must report these errors.]
14207 2002-08-19 Ravi Pratap <ravi@ximian.com>
14209 * ecore.cs (StandardConversionExists): Return a false
14210 if we are trying to convert the void type to anything else
14211 since that is not allowed.
14213 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
14214 we flag error 70 in the event an event is trying to be accessed
14215 directly from outside the declaring type.
14217 2002-08-20 Martin Baulig <martin@gnome.org>
14219 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
14220 MemberCache from typemanager.cs to decl.cs.
14222 2002-08-19 Martin Baulig <martin@gnome.org>
14224 * class.cs (TypeContainer): Implement IMemberContainer.
14225 (TypeContainer.DefineMembers): Create the MemberCache.
14226 (TypeContainer.FindMembers): Do better BindingFlags checking; only
14227 return public members if BindingFlags.Public was given, check
14228 whether members are static.
14230 2002-08-16 Martin Baulig <martin@gnome.org>
14232 * decl.cs (DeclSpace.Define): Splitted this in Define and
14233 DefineMembers. DefineMembers is called first and initializes the
14236 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
14237 DefineMembers() on all our DeclSpaces.
14239 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
14240 but call DefineMembers() on all nested interfaces. We call their
14241 Define() in our new Define() function.
14243 * interface.cs (Interface): Implement IMemberContainer.
14244 (Interface.Define): Moved all code except the attribute stuf to
14246 (Interface.DefineMembers): Initialize the member cache.
14248 * typemanager.cs (IMemberFinder): Removed this interface, we don't
14249 need this anymore since we can use MemberCache.FindMembers directly.
14251 2002-08-19 Martin Baulig <martin@gnome.org>
14253 * typemanager.cs (MemberCache): When creating the cache for an
14254 interface type, add all inherited members.
14255 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
14256 to `out bool used_cache' and documented it.
14257 (TypeManager.MemberLookup): If we already used the cache in the first
14258 iteration, we don't need to do the interfaces check.
14260 2002-08-19 Martin Baulig <martin@gnome.org>
14262 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
14263 here from IMemberFinder and don't implement this interface anymore.
14264 (DeclSpace.MemberCache): Moved here from IMemberFinder.
14266 * typemanager.cs (IMemberFinder): This interface is now only used by
14267 classes which actually support the member cache.
14268 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
14269 since we only put DeclSpaces into this Hashtable.
14270 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
14271 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
14273 2002-08-16 Martin Baulig <martin@gnome.org>
14275 * typemanager.cs (ICachingMemberFinder): Removed.
14276 (IMemberFinder.MemberCache): New property.
14277 (TypeManager.FindMembers): Merged this with RealFindMembers().
14278 This function will never be called from TypeManager.MemberLookup()
14279 so we can't use the cache here, just the IMemberFinder.
14280 (TypeManager.MemberLookup_FindMembers): Check whether the
14281 IMemberFinder has a MemberCache and call the cache's FindMembers
14283 (MemberCache): Rewrote larger parts of this yet another time and
14284 cleaned it up a bit.
14286 2002-08-15 Miguel de Icaza <miguel@ximian.com>
14288 * driver.cs (LoadArgs): Support quoting.
14290 (Usage): Show the CSC-like command line arguments.
14292 Improved a few error messages.
14294 2002-08-15 Martin Baulig <martin@gnome.org>
14296 * typemanager.cs (IMemberContainer.Type): New property.
14297 (IMemberContainer.IsInterface): New property.
14299 The following changes are conditional to BROKEN_RUNTIME, which is
14300 defined at the top of the file.
14302 * typemanager.cs (MemberCache.MemberCache): Don't add the base
14303 class'es members, but add all members from TypeHandle.ObjectType
14304 if we're an interface.
14305 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
14306 is the current type.
14307 (MemberCache.CacheEntry.Container): Removed this field.
14308 (TypeHandle.GetMembers): Include inherited members.
14310 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14312 * typemanager.cs: fixed compilation and added a comment on a field that
14315 2002-08-15 Martin Baulig <martin@gnome.org>
14317 * class.cs (ConstructorInitializer.Resolve): In the
14318 Expression.MemberLookup call, use the queried_type as
14321 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
14322 declared' attribute, it's always true.
14323 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
14324 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
14325 temporary wrapper for FindMembers which tells MemberLookup whether
14326 members from the base classes are included in the return value.
14327 This will go away soon.
14328 (TypeManager.MemberLookup): Use this temporary hack here; once the
14329 new MemberCache is completed, we don't need to do the DeclaredOnly
14330 looping here anymore since the MemberCache will take care of this.
14331 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
14332 (MemberCache): When creating the MemberCache for a class, get
14333 members from the current class and all its base classes.
14334 (MemberCache.CacheEntry.Container): New field. This is a
14335 temporary hack until the Mono runtime is fixed to distinguish
14336 between ReflectedType and DeclaringType. It allows us to use MCS
14337 with both the MS runtime and the unfixed Mono runtime without
14338 problems and without accecting performance.
14339 (MemberCache.SearchMembers): The DeclaredOnly looping from
14340 TypeManager.MemberLookup is now done here.
14342 2002-08-14 Martin Baulig <martin@gnome.org>
14344 * statement.cs (MyStructInfo.MyStructInfo): Don't call
14345 Type.GetFields on dynamic types but get the fields from the
14346 corresponding TypeContainer.
14347 (MyStructInfo.GetStructInfo): Added check for enum types.
14349 * typemanager.cs (MemberList.IsSynchronized): Implemented.
14350 (MemberList.SyncRoot): Implemented.
14351 (TypeManager.FilterWithClosure): No need to check permissions if
14352 closure_start_type == closure_invocation_type, don't crash if
14353 closure_invocation_type is null.
14355 2002-08-13 Martin Baulig <martin@gnome.org>
14357 Rewrote TypeContainer.FindMembers to use a member cache. This
14358 gives us a speed increase of about 35% for the self-hosting MCS
14359 build and of about 15-20% for the class libs (both on GNU/Linux).
14361 * report.cs (Timer): New class to get enhanced profiling. This
14362 whole class is "TIMER" conditional since it remarkably slows down
14365 * class.cs (MemberList): New class. This is an IList wrapper
14366 which we're now using instead of passing MemberInfo[]'s around to
14367 avoid copying this array unnecessarily.
14368 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
14369 (ICachingMemberFinder, IMemberContainer): New interface.
14370 (TypeManager.FilterWithClosure): If `criteria' is null, the name
14371 has already been checked, otherwise use it for the name comparision.
14372 (TypeManager.FindMembers): Renamed to RealMemberFinder and
14373 provided wrapper which tries to use ICachingMemberFinder.FindMembers
14374 if possible. Returns a MemberList, not a MemberInfo [].
14375 (TypeHandle): New class, implements IMemberContainer. We create
14376 one instance of this class per type, it contains a MemberCache
14377 which is used to do the member lookups.
14378 (MemberCache): New class. Each instance of this class contains
14379 all members of a type and a name-based hash table.
14380 (MemberCache.FindMembers): This is our new member lookup
14381 function. First, it looks up all members of the requested name in
14382 the hash table. Then, it walks this list and sorts out all
14383 applicable members and returns them.
14385 2002-08-13 Martin Baulig <martin@gnome.org>
14387 In addition to a nice code cleanup, this gives us a performance
14388 increase of about 1.4% on GNU/Linux - not much, but it's already
14389 half a second for the self-hosting MCS compilation.
14391 * typemanager.cs (IMemberFinder): New interface. It is used by
14392 TypeManager.FindMembers to call FindMembers on a TypeContainer,
14393 Enum, Delegate or Interface.
14394 (TypeManager.finder_to_member_finder): New PtrHashtable.
14395 (TypeManager.finder_to_container): Removed.
14396 (TypeManager.finder_to_delegate): Removed.
14397 (TypeManager.finder_to_interface): Removed.
14398 (TypeManager.finder_to_enum): Removed.
14400 * interface.cs (Interface): Implement IMemberFinder.
14402 * delegate.cs (Delegate): Implement IMemberFinder.
14404 * enum.cs (Enum): Implement IMemberFinder.
14406 * class.cs (TypeContainer): Implement IMemberFinder.
14408 2002-08-12 Martin Baulig <martin@gnome.org>
14410 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
14412 2002-08-12 Martin Baulig <martin@gnome.org>
14414 * ecore.cs (ITypeExpression): New interface for expressions which
14416 (TypeExpression): Renamed to TypeLookupExpression.
14417 (Expression.DoResolve): If we're doing a types-only lookup, the
14418 expression must implement the ITypeExpression interface and we
14419 call DoResolveType() on it.
14420 (SimpleName): Implement the new ITypeExpression interface.
14421 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
14422 hack, the situation that we're only looking up types can't happen
14423 anymore when this method is called. Moved the type lookup code to
14424 DoResolveType() and call it.
14425 (SimpleName.DoResolveType): This ITypeExpression interface method
14426 is now doing the types-only lookup.
14427 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
14428 (ResolveFlags): Added MaskExprClass.
14430 * expression.cs (MemberAccess): Implement the ITypeExpression
14432 (MemberAccess.DoResolve): Added support for a types-only lookup
14433 when we're called via ITypeExpression.DoResolveType().
14434 (ComposedCast): Implement the ITypeExpression interface.
14436 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
14437 Expression.Resolve() with ResolveFlags.Type instead.
14439 2002-08-12 Martin Baulig <martin@gnome.org>
14441 * interface.cs (Interface.Define): Apply attributes.
14443 * attribute.cs (Attribute.ApplyAttributes): Added support for
14444 interface attributes.
14446 2002-08-11 Martin Baulig <martin@gnome.org>
14448 * statement.cs (Block.Emit): Only check the "this" variable if we
14449 do not always throw an exception.
14451 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
14452 whether the property has a set accessor.
14454 2002-08-11 Martin Baulig <martin@gnome.org>
14456 Added control flow analysis support for structs.
14458 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
14459 with control flow analysis turned off.
14460 (IVariable): New interface.
14461 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
14462 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
14463 (FieldExpr.DoResolve): Resolve the instance expression with flow
14464 analysis turned off and do the definite assignment check after the
14465 resolving when we know what the expression will resolve to.
14467 * expression.cs (LocalVariableReference, ParameterReference):
14468 Implement the new IVariable interface, only call the flow analysis
14469 code if ec.DoFlowAnalysis is true.
14470 (This): Added constructor which takes a Block argument. Implement
14471 the new IVariable interface.
14472 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
14473 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
14474 This does the definite assignment checks for struct members.
14476 * class.cs (Constructor.Emit): If this is a non-static `struct'
14477 constructor which doesn't have any initializer, call
14478 Block.AddThisVariable() to tell the flow analysis code that all
14479 struct elements must be initialized before control returns from
14482 * statement.cs (MyStructInfo): New public class.
14483 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
14484 argument to this indexer. If non-zero, check an individual struct
14485 member, not the whole struct.
14486 (FlowBranching.CheckOutParameters): Check struct members.
14487 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
14488 overloaded versions of these methods which take an additional
14489 `int field_idx' argument to check struct members.
14490 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
14491 overloaded versions of these methods which take an additional
14492 `string field_name' argument to check struct member.s
14493 (VariableInfo): Implement the IVariable interface.
14494 (VariableInfo.StructInfo): New public property. Returns the
14495 MyStructInfo instance of the variable if it's a struct or null.
14496 (Block.AddThisVariable): New public method. This is called from
14497 Constructor.Emit() for non-static `struct' constructor which do
14498 not have any initializer. It creates a special variable for the
14499 "this" instance variable which will be checked by the flow
14500 analysis code to ensure that all of the struct's fields are
14501 initialized before control returns from the constructor.
14502 (UsageVector): Added support for struct members. If a
14503 variable/parameter is a struct with N members, we reserve a slot
14504 in the usage vector for each member. A struct is considered fully
14505 initialized if either the struct itself (slot 0) or all its
14506 members are initialized.
14508 2002-08-08 Martin Baulig <martin@gnome.org>
14510 * driver.cs (Driver.MainDriver): Only report an error CS5001
14511 if there were no compilation errors.
14513 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
14514 `UnsafeContext' property to determine whether the parent is in
14515 unsafe context rather than checking the parent's ModFlags:
14516 classes nested in an unsafe class are unsafe as well.
14518 2002-08-08 Martin Baulig <martin@gnome.org>
14520 * statement.cs (UsageVector.MergeChildren): Distinguish between
14521 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
14522 we return. Added test17() and test18() to test-154.cs.
14524 2002-08-08 Martin Baulig <martin@gnome.org>
14526 * typemanager.cs (TypeManager.FilterWithClosure): If we have
14527 Family access, make sure the invoking type isn't a subclass of the
14528 queried type (that'd be a CS1540).
14530 * ecore.cs (Expression.MemberLookup): Added overloaded version of
14531 this method which takes an additional `Type invocation_type'.
14533 * expression.cs (BaseAccess.DoResolve): Use the base type as
14534 invocation and query type.
14535 (MemberAccess.DoResolve): If the lookup failed and we're about to
14536 report a CS0122, try a lookup with the ec.ContainerType - if this
14537 succeeds, we must report a CS1540.
14539 2002-08-08 Martin Baulig <martin@gnome.org>
14541 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
14542 (MethodGroupExpr): Implement the IMemberExpr interface.
14544 * expression (MemberAccess.ResolveMemberAccess): No need to have
14545 any special code for MethodGroupExprs anymore, they're now
14548 2002-08-08 Martin Baulig <martin@gnome.org>
14550 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
14551 Family, FamANDAssem and FamORAssem permissions.
14552 (TypeManager.IsSubclassOrNestedChildOf): New public method.
14554 2002-08-08 Martin Baulig <martin@gnome.org>
14556 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
14557 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
14560 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
14562 * driver.cs: implemented /resource option to embed managed resources.
14564 2002-08-07 Martin Baulig <martin@gnome.org>
14566 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
14567 (FieldBase.HasFieldInitializer): New public property.
14568 (FieldBase.GetInitializerExpression): New public method. Resolves and
14569 returns the field initializer and makes sure it is only resolved once.
14570 (TypeContainer.EmitFieldInitializers): Call
14571 FieldBase.GetInitializerExpression to get the initializer, this ensures
14572 that it isn't resolved multiple times.
14574 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
14575 the resolving process (SimpleName/MemberLookup) that we're currently
14576 emitting a field initializer (which must not access any instance members,
14577 this is an error CS0236).
14579 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
14580 argument, if the `IsFieldInitializer' flag is set, we must report and
14581 error CS0236 and not an error CS0120.
14583 2002-08-07 Martin Baulig <martin@gnome.org>
14585 * ecore.cs (IMemberExpr): New public interface.
14586 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
14587 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
14588 if the expression is an IMemberExpr.
14590 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
14591 to be null, implicitly default to `this' if we're non-static in
14592 this case. Simplified the code a lot by using the new IMemberExpr
14593 interface. Also fixed bug #28176 here.
14595 2002-08-06 Martin Baulig <martin@gnome.org>
14597 * cs-parser.jay (SimpleLookup): Removed. We need to create
14598 ParameterReferences during semantic analysis so that we can do a
14599 type-only search when resolving Cast, TypeOf and SizeOf.
14600 (block): Pass the `current_local_parameters' to the Block's
14603 * class.cs (ConstructorInitializer): Added `Parameters parameters'
14604 argument to the constructor.
14605 (ConstructorInitializer.Resolve): Create a temporary implicit
14606 block with the parameters.
14608 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
14609 references here if we aren't doing a type-only search.
14611 * statement.cs (Block): Added constructor which takes a
14612 `Parameters parameters' argument.
14613 (Block.Parameters): New public property.
14615 * support.cs (InternalParameters.Parameters): Renamed `parameters'
14616 to `Parameters' and made it public readonly.
14618 2002-08-06 Martin Baulig <martin@gnome.org>
14620 * ecore.cs (Expression.Warning): Made this public as well.
14622 * report.cs (Report.Debug): Print the contents of collections.
14624 2002-08-06 Martin Baulig <martin@gnome.org>
14626 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
14627 used to tell Resolve() which kinds of expressions it may return.
14628 (Expression.Resolve): Added overloaded version of this method which
14629 takes a `ResolveFlags flags' argument. This can be used to tell
14630 Resolve() which kinds of expressions it may return. Reports a
14632 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
14633 ResolveFlags.SimpleName.
14634 (Expression.Error118): Added overloaded version of this method which
14635 takes a `ResolveFlags flags' argument. It uses the flags to determine
14636 which kinds of expressions are allowed.
14638 * expression.cs (Argument.ResolveMethodGroup): New public method.
14639 Resolves an argument, but allows a MethodGroup to be returned.
14640 This is used when invoking a delegate.
14642 * TODO: Updated a bit.
14644 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14646 Fixed compilation with csc.
14648 * ecore.cs: Expression.Error made public. Is this correct? Should
14649 Warning be made public too?
14651 * expression.cs: use ea.Location instead of ea.loc.
14652 [FIXME: Filed as bug #28607: MCS must report these errors.]
14654 2002-08-06 Martin Baulig <martin@gnome.org>
14656 * ecore.cs (Expression.loc): Moved the location here instead of
14657 duplicating it in all derived classes.
14658 (Expression.Location): New public property.
14659 (Expression.Error, Expression.Warning): Made them non-static and
14660 removed the location argument.
14661 (Expression.Warning): Added overloaded version which takes an
14662 `int level' argument.
14663 (Expression.Error118): Make this non-static and removed the
14664 expression and location arguments.
14665 (TypeExpr): Added location argument to the constructor.
14667 * expression.cs (StaticCallExpr): Added location argument to
14669 (Indirection, PointerArithmetic): Likewise.
14670 (CheckedExpr, UnCheckedExpr): Likewise.
14671 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
14672 (StringPtr): Likewise.
14675 2002-08-05 Martin Baulig <martin@gnome.org>
14677 * expression.cs (BaseAccess.DoResolve): Actually report errors.
14679 * assign.cs (Assign.DoResolve): Check whether the source
14680 expression is a value or variable.
14682 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
14683 while resolving the corresponding blocks.
14685 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
14686 an error, don't silently return null.
14688 * statement.cs (Block.AddVariable): Do the error reporting here
14689 and distinguish between CS0128 and CS0136.
14690 (Block.DoResolve): Report all unused labels (warning CS0164).
14691 (LabeledStatement): Pass the location to the constructor.
14692 (LabeledStatement.HasBeenReferenced): New property.
14693 (LabeledStatement.Resolve): Set it to true here.
14695 * statement.cs (Return.Emit): Return success even after reporting
14696 a type mismatch error (CS0126 or CS0127), this is what csc does and
14697 it avoids confusing the users with any consecutive errors.
14699 2002-08-05 Martin Baulig <martin@gnome.org>
14701 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
14703 * const.cs (Const.LookupConstantValue): Catch circular definitions.
14705 * expression.cs (MemberAccess.DoResolve): Silently return if an
14706 error has already been reported.
14708 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
14709 error has already been reported.
14711 2002-08-05 Martin Baulig <martin@gnome.org>
14713 * statement.cs (UsageVector): Only initialize the `parameters'
14714 vector if we actually have any "out" parameters.
14716 2002-08-05 Martin Baulig <martin@gnome.org>
14718 * expression.cs (Binary.ResolveOperator): When combining delegates,
14719 they must have the same type.
14721 2002-08-05 Martin Baulig <martin@gnome.org>
14723 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
14724 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
14725 work with the ms runtime and we also don't need it: if we're a
14726 PropertyBuilder and not in the `indexer_arguments' hash, then we
14727 are a property and not an indexer.
14729 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
14730 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
14731 since the latter one doesn't work with the ms runtime.
14733 2002-08-03 Martin Baulig <martin@gnome.org>
14735 Fixed bugs #27998 and #22735.
14737 * class.cs (Method.IsOperator): New public field.
14738 (Method.CheckBase): Report CS0111 if there's already a method
14739 with the same parameters in the current class. Report CS0508 when
14740 attempting to change the return type of an inherited method.
14741 (MethodData.Emit): Report CS0179 if a method doesn't have a body
14742 and it's not marked abstract or extern.
14743 (PropertyBase): New abstract base class for Property and Indexer.
14744 (PropertyBase.CheckBase): Moved here from Property and made it work
14746 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
14747 the same so we can reuse it there.
14748 (Property, Indexer): Derive from PropertyBase.
14749 (MethodSignature.inheritable_property_signature_filter): New delegate
14750 to find properties and indexers.
14752 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
14753 argument and improved error reporting.
14755 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
14756 EmptyReadOnlyParameters and made it a property.
14758 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
14759 version of this method which takes a `PropertyInfo indexer'.
14760 (TypeManager.RegisterIndexer): New method.
14762 * class.cs: Added myself as author of this file :-)
14764 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14766 * class.cs: fixed compilation on windoze.
14768 2002-08-03 Martin Baulig <martin@gnome.org>
14770 * interface.cs (Interface.GetInterfaceBases): Check whether all
14771 base interfaces are at least as accessible than the current one.
14773 * class.cs (TypeContainer.GetClassBases): Check whether base types
14774 are at least as accessible than the current type.
14775 (TypeContainer.AsAccessible): Implemented and made non-static.
14776 (MemberBase.CheckParameters): Report errors if the accessibility
14779 * delegate.cs (Delegate.Delegate): The default visibility is
14780 internal for top-level types and private for nested types.
14781 (Delegate.Define): Report errors if the accessibility checks fail.
14783 * enum.cs (Enum.Enum): The default visibility is internal for
14784 top-level types and private for nested types.
14785 (Enum.DefineType): Compute the correct visibility.
14787 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
14788 function which takes a `bool is_toplevel' instead of a TypeContainer.
14790 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
14793 2002-08-02 Martin Baulig <martin@gnome.org>
14795 * expression.cs (LocalVariableReferenc): Added constructor which
14796 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
14797 (LocalVariableReference.IsReadOnly): New property.
14798 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
14799 variable is readonly, use our own readonly flag to do this; you can
14800 use the new constructor to get a writable reference to a read-only
14803 * cs-parser.jay (foreach_statement, using_statement): Get a writable
14804 reference to the local variable.
14806 2002-08-01 Miguel de Icaza <miguel@ximian.com>
14808 * rootcontext.cs (ResolveCore): Also include System.Exception
14810 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
14811 we reach an EmptyStatement.
14813 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
14816 * expression.cs (Binary.ResolveOperator): Check error result in
14819 use brtrue/brfalse directly and avoid compares to null.
14821 2002-08-02 Martin Baulig <martin@gnome.org>
14823 * class.cs (TypeContainer.Define): Define all nested interfaces here.
14824 Fixes bug #28407, added test-155.cs.
14826 2002-08-01 Martin Baulig <martin@gnome.org>
14828 * class.cs (Event.EmitDefaultMethod): Make this work with static
14829 events. Fixes #28311, added verify-3.cs.
14831 2002-08-01 Martin Baulig <martin@gnome.org>
14833 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
14834 `is_disposable' fields.
14835 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
14836 `hm.is_disposable' if we're using the collection pattern.
14837 (Foreach.EmitCollectionForeach): Use the correct type for the
14838 enumerator's local variable, only emit the try/finally block if
14839 necessary (fixes #27713).
14841 2002-08-01 Martin Baulig <martin@gnome.org>
14843 * ecore.cs (Expression.report118): Renamed to Error118 and made
14846 * statement.cs (Throw.Resolve): Check whether the expression is of
14847 the correct type (CS0118) and whether the type derives from
14848 System.Exception (CS0155).
14849 (Catch.Resolve): New method. Do the type lookup here and check
14850 whether it derives from System.Exception (CS0155).
14851 (Catch.CatchType, Catch.IsGeneral): New public properties.
14853 * typemanager.cs (TypeManager.exception_type): Added.
14855 2002-07-31 Miguel de Icaza <miguel@ximian.com>
14857 * driver.cs: Updated About function.
14859 2002-07-31 Martin Baulig <martin@gnome.org>
14861 Implemented Control Flow Analysis.
14863 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
14864 (EmitContext.CurrentBranching): Added.
14865 (EmitContext.StartFlowBranching): Added.
14866 (EmitContext.EndFlowBranching): Added.
14867 (EmitContext.KillFlowBranching): Added.
14868 (EmitContext.IsVariableAssigned): Added.
14869 (EmitContext.SetVariableAssigned): Added.
14870 (EmitContext.IsParameterAssigned): Added.
14871 (EmitContext.SetParameterAssigned): Added.
14872 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
14873 Added control flow analysis stuff here.
14875 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
14876 resolve the expression as lvalue.
14877 (LocalVariableReference.DoResolve): Check whether the variable has
14878 already been assigned.
14879 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
14880 the parameter as assigned here.
14881 (ParameterReference.DoResolve): Check whether the parameter has already
14883 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
14884 expression as lvalue.
14886 * statement.cs (FlowBranching): New class for the flow analysis code.
14887 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
14888 (LabeledStatement.IsDefined): New public property.
14889 (LabeledStatement.AddUsageVector): New public method to tell flow
14890 analyis that the label may be reached via a forward jump.
14891 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
14893 (VariableInfo.Number): New public field. This is used by flow analysis
14894 to number all locals of a block.
14895 (Block.CountVariables): New public property. This is the number of
14896 local variables in this block (including the locals from all parent
14898 (Block.EmitMeta): Number all the variables.
14900 * statement.cs: Added flow analysis support to all classes.
14902 2002-07-31 Martin Baulig <martin@gnome.org>
14904 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
14905 To get debugging messages, compile mcs with /define:MCS_DEBUG and
14906 then use this argument.
14908 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
14910 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
14911 use this to specify /define options.
14913 2002-07-29 Martin Baulig <martin@gnome.org>
14915 * statement.cs (Fixed): Moved all code that does variable lookups
14916 and resolvings from Emit to Resolve.
14918 * statement.cs (For): Moved all code that does variable lookups
14919 and resolvings from Emit to Resolve.
14921 * statement.cs (Using): Moved all code that does variable lookups
14922 and resolvings from Emit to Resolve.
14924 2002-07-29 Martin Baulig <martin@gnome.org>
14926 * attribute.cs (Attribute.Resolve): Explicitly catch a
14927 System.NullReferenceException when creating the
14928 CustromAttributeBuilder and report a different warning message.
14930 2002-07-29 Martin Baulig <martin@gnome.org>
14932 * support.cs (ParameterData.ParameterName): Added method to
14933 get the name of a parameter.
14935 * typemanager.cs (TypeManager.IsValueType): New public method.
14937 2002-07-29 Martin Baulig <martin@gnome.org>
14939 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
14940 is a flag which specifies that it's either ref or out.
14941 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
14942 the out parameter to `out Parameter.Modifier mod', also set the
14943 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
14945 * support.cs (InternalParameters.ParameterModifier): Distinguish
14946 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
14947 Parameter.Modifier.ISBYREF flag if it's either ref or out.
14949 * expression.cs (Argument.GetParameterModifier): Distinguish
14950 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
14951 Parameter.Modifier.ISBYREF flag if it's either ref or out.
14953 2002-07-29 Martin Baulig <martin@gnome.org>
14955 * expression.cs (ParameterReference.ParameterReference): Added
14956 `Location loc' argument to the constructor.
14958 * cs-parser.jay: Pass location to ParameterReference.
14960 2002-07-28 Miguel de Icaza <miguel@ximian.com>
14962 * statement.cs (Try): Initialize the location.
14964 * cs-parser.jay: pass location to Try.
14966 * expression.cs (Unary.Reduce): Change the prototype to return
14967 whether a constant fold could be performed or not. The result is
14968 returned in an out parameters. In the case of Indirection and
14969 AddressOf, we want to perform the full tests.
14971 2002-07-26 Miguel de Icaza <miguel@ximian.com>
14973 * statement.cs (Statement.Emit): Flag dead code.
14975 2002-07-27 Andrew Birkett <andy@nobugs.org>
14977 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
14979 2002-07-27 Martin Baulig <martin@gnome.org>
14981 * class.cs (MethodData.Define): Put back call to
14982 TypeManager.AddMethod(), accidentally commented this out.
14984 * report.cs (Debug): New public method to print debugging information,
14985 this is `[Conditional ("DEBUG")]'.
14987 2002-07-26 Martin Baulig <martin@gnome.org>
14989 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
14990 (switch_statement): Push the current_block to the switch_stack and
14991 pop it again when we're done with the switch.
14992 (switch_section): The new block is a child of the current_block.
14993 Fixes bug #24007, added test-152.cs.
14995 2002-07-27 Martin Baulig <martin@gnome.org>
14997 * expression.cs (Invocation.EmitArguments): When calling a varargs
14998 function with only its fixed arguments, we need to pass an empty
15001 2002-07-27 Martin Baulig <martin@gnome.org>
15003 Mono 0.13 has been released.
15005 2002-07-25 Miguel de Icaza <miguel@ximian.com>
15007 * driver.cs: Rename --resource to --linkres, because that is what
15008 we do currently, we dont support --resource yet.
15010 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
15012 2002-07-25 Martin Baulig <martin@gnome.org>
15014 * class.cs (MethodData): New public class. This is a `method builder'
15015 class for a method or one accessor of a Property/Indexer/Event.
15016 (MethodData.GetMethodFlags): Moved here from MemberBase.
15017 (MethodData.ApplyAttributes): Likewise.
15018 (MethodData.ApplyObsoleteAttribute): Likewise.
15019 (MethodData.ApplyConditionalAttribute): Likewise.
15020 (MethodData.ApplyDllImportAttribute): Likewise.
15021 (MethodData.CheckAbstractAndExternal): Likewise.
15022 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
15023 (MethodData.Emit): Formerly known as Method.Emit().
15024 (MemberBase): Moved everything which was specific to a single
15025 accessor/method to MethodData.
15026 (Method): Create a new MethodData and call Define() and Emit() on it.
15027 (Property, Indexer, Event): Create a new MethodData objects for each
15028 accessor and call Define() and Emit() on them.
15030 2002-07-25 Martin Baulig <martin@gnome.org>
15032 Made MethodCore derive from MemberBase to reuse the code from there.
15033 MemberBase now also checks for attributes.
15035 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
15036 (MemberBase.GetMethodFlags): Moved here from class Method and marked
15038 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
15039 `CallingConventions cc' and `Attributes opt_attrs' arguments.
15040 (MemberBase.ApplyAttributes): New virtual method; applies the
15041 attributes to a method or accessor.
15042 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
15043 (MemberBase.ApplyConditionalAttribute): Likewise.
15044 (MemberBase.ApplyDllImportAttribute): Likewise.
15045 (MemberBase.CheckAbstractAndExternal): Likewise.
15046 (MethodCore.ParameterTypes): This is now a property instead of a
15047 method, it's initialized from DoDefineParameters().
15048 (MethodCore.ParameterInfo): Removed the set accessor.
15049 (MethodCore.DoDefineParameters): New protected virtual method to
15050 initialize ParameterTypes and ParameterInfo.
15051 (Method.GetReturnType): We can now simply return the MemberType.
15052 (Method.GetMethodFlags): Override the MemberBase version and add
15053 the conditional flags.
15054 (Method.CheckBase): Moved some code from Define() here, call
15055 DoDefineParameters() here.
15056 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
15057 here to avoid some larger code duplication.
15058 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
15059 ensure that abstract and external accessors don't declare a body.
15061 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
15062 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
15063 lookup in the attribute's parent classes, so we need to abort as soon
15064 as we found the first match.
15065 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
15066 the attribute has no arguments.
15068 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
15071 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15073 * cs-parser.jay: reverted previous patch.
15075 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15077 * cs-parser.jay: fixed bug #22119.
15079 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15081 * attribute.cs: fixed compilation. The error was:
15082 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
15083 be assigned to before control leaves the current method."
15084 [FIXME: Filed as bug #28186: MCS must report this error.]
15086 2002-07-25 Martin Baulig <martin@gnome.org>
15088 * attribute.cs (Attribute.Conditional_GetConditionName): New static
15089 method to pull the condition name ouf of a Conditional attribute.
15090 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
15091 the obsolete message and error flag out of an Obsolete attribute.
15093 * class.cs (Method.GetMethodFlags): New public method to get the
15094 TypeManager.MethodFlags for this method.
15095 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
15097 (Method.Define): Get and apply the Obsolete and Conditional attributes;
15098 if we're overriding a virtual function, set the new private variable
15099 `parent_method'; call the new TypeManager.AddMethod().
15101 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
15102 the MethodBuilder and the Method in a PtrHashtable.
15103 (TypeManager.builder_to_method): Added for this purpose.
15104 (TypeManager.MethodFlags): Added IsObsoleteError.
15105 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
15106 Obsolete and Conditional arguments in MethodBuilders. If we discover
15107 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
15108 the message from the attribute.
15110 2002-07-24 Martin Baulig <martin@gnome.org>
15112 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
15113 preprocessor directives, ensure that the argument to #define/#undef is
15114 exactly one identifier and that it's actually an identifier.
15116 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
15119 2002-07-24 Martin Baulig <martin@gnome.org>
15121 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
15122 initialize it to TypeManager.object_type in the constructor.
15123 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
15124 of the `hm.get_current' method if we're using the collection pattern.
15125 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
15126 for the explicit conversion to make it work when we're using the collection
15127 pattern and the `Current' property has a different return type than `object'.
15130 2002-07-24 Martin Baulig <martin@gnome.org>
15132 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
15133 does not match, but don't report any errors. This method is called in
15134 order for all methods in a MethodGroupExpr until a matching method is
15135 found, so we don't want to bail out if the first method doesn't match.
15136 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
15137 matches, report the 123. Fixes #28070.
15139 2002-07-24 Martin Baulig <martin@gnome.org>
15141 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
15142 TypeManager.TypeToCoreType() to the top of the method so the
15143 following equality checks will work. Fixes #28107.
15145 2002-07-24 Martin Baulig <martin@gnome.org>
15147 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
15148 operand is of type uint, and the other operand is of type sbyte,
15149 short or int, the operands are converted to type long." -
15150 Actually do what this comment already told us. Fixes bug #28106,
15153 2002-07-24 Martin Baulig <martin@gnome.org>
15155 * class.cs (MethodBase): New abstract class. This is now a base
15156 class for Property, Indexer and Event to avoid some code duplication
15157 in their Define() and DefineMethods() methods.
15158 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
15159 generic methods for Define() and DefineMethods().
15160 (FieldBase): Derive from MemberBase, not MemberCore.
15161 (Property): Derive from MemberBase, not MemberCore.
15162 (Property.DefineMethod): Moved all the code from this method to the
15163 new MethodBase.DefineAccessor(), just call it with appropriate
15165 (Property.Define): Call the new Property.DoDefine(), this does some
15166 sanity checks and we don't need to duplicate the code everywhere.
15167 (Event): Derive from MemberBase, not MemberCore.
15168 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
15169 accessors, this will also make them work with interface events.
15170 (Indexer): Derive from MemberBase, not MemberCore.
15171 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
15172 (Indexer.Define): Use the new MethodBase functions.
15174 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
15175 argument to the constructor.
15176 (Interface.FindMembers): Added support for interface events.
15177 (Interface.PopluateEvent): Implemented.
15179 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
15181 2002-07-22 Miguel de Icaza <miguel@ximian.com>
15183 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
15184 but this is required to check for a method name being the same as
15185 the containing class.
15189 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15191 * interface.cs: initialize variable.
15193 2002-07-23 Martin Baulig <martin@gnome.org>
15195 Implemented the IndexerName attribute in interfaces.
15197 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
15198 name if this is an explicit interface implementation.
15199 (Indexer.InterfaceIndexerName): New public variable. If we're
15200 implementing an interface indexer, this is the IndexerName in that
15201 interface. Otherwise, it's the IndexerName.
15202 (Indexer.DefineMethod): If we're implementing interface indexer,
15203 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
15204 and Pending.ImplementIndexer methods.
15205 (Indexer.Define): Also define the PropertyBuilder if we're
15206 implementing an interface indexer and this is neither an explicit
15207 interface implementation nor do the IndexerName match the one in
15210 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
15211 If a method is defined here, then we always need to create a proxy
15212 for it. This is used when implementing interface indexers.
15213 (Pending.IsInterfaceIndexer): New public method.
15214 (Pending.ImplementIndexer): New public method.
15215 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
15216 This is used when implementing interface indexers to define a proxy
15218 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
15219 define a proxy if necessary.
15221 * interface.cs (Interface.IndexerName): New public variable.
15222 (Interface.PopulateIndexer): Set the IndexerName.
15223 (Interface.DefineIndexers): New private method. Populate all the
15224 indexers and make sure their IndexerNames match.
15226 * typemanager.cs (IndexerPropertyName): Added support for interface
15229 2002-07-22 Martin Baulig <martin@gnome.org>
15231 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
15232 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
15233 ret if HasReturnLabel.
15234 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
15237 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
15238 and set the ec.LoopBeginTryCatchLevel.
15239 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
15240 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
15241 the current ec.TryCatchLevel, the branch goes out of an exception
15242 block. In this case, we need to use Leave and not Br.
15244 2002-07-22 Martin Baulig <martin@gnome.org>
15246 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
15247 block unless the block does not always return or it is contained in
15248 another try { ... } catch { ... } block. Fixes bug #26506.
15249 Added verify-1.cs to the test suite.
15251 2002-07-22 Martin Baulig <martin@gnome.org>
15253 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
15254 then we do not always return. Fixes bug #24985.
15256 2002-07-22 Martin Baulig <martin@gnome.org>
15258 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
15259 lookup on a per-class level; ie. walk up the class hierarchy until we
15260 found at least one applicable method, then choose the best among them.
15261 Fixes bug #24463 and test-29.cs.
15263 2002-07-22 Martin Baulig <martin@gnome.org>
15265 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
15266 return types of the methods. The return type is not part of the
15267 signature and we must not check it to make the `new' modifier work.
15268 Fixes bug #27999, also added test-147.cs.
15269 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
15271 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
15272 on the method's return type.
15274 2002-07-21 Martin Baulig <martin@gnome.org>
15276 * assign.cs: Make this work if the rightmost source is a constant and
15277 we need to do an implicit type conversion. Also adding a few more tests
15278 to test-38.cs which should have caught this.
15280 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
15281 target in the makefile for this. The makefile.gnu is primarily intended
15282 for end-users who don't want to debug the compiler.
15284 2002-07-21 Martin Baulig <martin@gnome.org>
15286 * assign.cs: Improved the Assign class so it can now handle embedded
15287 assignments (X = Y = Z = something). As a side-effect this'll now also
15288 consume less local variables. test-38.cs now passes with MCS, added
15289 a few new test cases to that test.
15291 2002-07-20 Martin Baulig <martin@gnome.org>
15293 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
15294 instructions. Fixes bug #27977, also added test-146.cs.
15296 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15298 * cs-tokenizer.cs: fixed getHex ().
15300 2002-07-19 Martin Baulig <martin@gnome.org>
15302 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
15303 not Type.GetType() to lookup the array type. This is needed when
15304 we're constructing an array of a user-defined type.
15305 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
15306 single-dimensional arrays, but also for single-dimensial arrays of
15309 2002-07-19 Martin Baulig <martin@gnome.org>
15311 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
15312 this function is called, it's not allowed to share LocalBuilders
15313 among ILGenerators.
15315 2002-07-19 Martin Baulig <martin@gnome.org>
15317 * expression.cs (Argument.Resolve): Report an error 118 when trying
15318 to pass a type as argument.
15320 2002-07-18 Martin Baulig <martin@gnome.org>
15322 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
15323 Conv_R_Un for the signed `long' type.
15325 2002-07-15 Miguel de Icaza <miguel@ximian.com>
15327 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
15328 `expr' for the temporary result, as that will fail if we do
15329 multiple resolves on the same expression.
15331 2002-07-05 Miguel de Icaza <miguel@ximian.com>
15333 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
15334 ec.TypeContainer for looking up aliases.
15336 * class.cs (TypeContainer): Remove LookupAlias from here.
15338 * decl.cs (DeclSpace); Move here.
15340 2002-07-01 Miguel de Icaza <miguel@ximian.com>
15342 * class.cs (FindMembers): Only call filter if the constructor
15343 bulider is not null.
15345 Also handle delegates in `NestedTypes' now. Now we will perform
15346 type lookups using the standard resolution process. This also
15349 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
15350 This uses Expressions (the limited kind that can be parsed by the
15351 tree) instead of strings.
15353 * expression.cs (ComposedCast.ToString): Implement, used to flag
15354 errors since now we have to render expressions.
15356 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
15359 * ecore.cs (SimpleName.ToString): ditto.
15361 * cs-parser.jay: Instead of using strings to assemble types, use
15362 Expressions to assemble the type (using SimpleName, ComposedCast,
15363 MemberAccess). This should fix the type lookups in declarations,
15364 because we were using a different code path for this.
15366 * statement.cs (Block.Resolve): Continue processing statements
15367 even when there is an error.
15369 2002-07-17 Miguel de Icaza <miguel@ximian.com>
15371 * class.cs (Event.Define): Also remove the `remove' method from
15372 the list of pending items.
15374 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
15375 generate more compact code.
15377 2002-07-17 Martin Baulig <martin@gnome.org>
15379 * const.cs (Const.LookupConstantValue): Add support for constant
15380 `unchecked' and `checked' expressions.
15381 Also adding test case test-140.cs for this.
15383 2002-07-17 Martin Baulig <martin@gnome.org>
15385 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
15386 check whether mi.ReturnType implements the IEnumerator interface; the
15387 `==' and the IsAssignableFrom() will fail in this situation.
15389 2002-07-16 Ravi Pratap <ravi@ximian.com>
15391 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
15394 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15396 * expression.cs: fixed bug #27811.
15398 2002-07-14 Miguel de Icaza <miguel@ximian.com>
15400 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
15401 Molaro: when we are a ref, the value already contains a pointer
15402 value, do not take the address of it.
15404 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
15405 * removed mb-parser.jay and mb-tokenizer.cs
15407 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15409 * expression.cs: check against the building corlib void type.
15411 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
15413 * ecore.cs: fix for valuetype static readonly fields: when
15414 initializing them, we need their address, not the address of a copy.
15416 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
15418 * typemanager.cs: register also enum_type in corlib.
15420 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
15422 * class.cs: allow calling this (but not base) initializers in structs.
15424 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
15426 * ecore.cs: make sure we compare against the building base types
15429 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
15431 * typemanager.cs: fix TypeToCoreType() to handle void and object
15432 (corlib gets no more typerefs after this change).
15434 2002-07-12 Miguel de Icaza <miguel@ximian.com>
15436 * expression.cs (ArrayCreation.EmitArrayArguments): use
15437 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
15439 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
15440 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
15441 array indexes, the runtime actually forbids them.
15443 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
15444 for array arguments here.
15446 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
15447 instead of the default for ValueTypes.
15449 (New.DoEmit): Use IsValueType instead of
15450 IsSubclassOf (value_type)
15451 (New.DoResolve): ditto.
15452 (Invocation.EmitCall): ditto.
15454 * assign.cs (Assign): ditto.
15456 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
15457 Statements *are* currently doing part of their resolution during
15460 Expressions do always resolve during resolve, but statements are
15461 only required to propagate resolution to their children.
15463 2002-07-11 Miguel de Icaza <miguel@ximian.com>
15465 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
15467 (LoadAssembly): Do not add the dll if it is already specified
15469 (MainDriver): Add the System directory to the link path at the end,
15470 after all the other -L arguments.
15472 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
15473 wrong opcode for loading bytes and bools (ldelem.i1 instead of
15474 ldelem.u1) and using the opposite for sbytes.
15476 This fixes Digger, and we can finally run it.
15478 * driver.cs (UnixParseOption): Move the option parsing here.
15479 (CSCParseOption): Implement CSC-like parsing of options.
15481 We now support both modes of operation, the old Unix way, and the
15482 new CSC-like way. This should help those who wanted to make cross
15483 platform makefiles.
15485 The only thing broken is that /r:, /reference: and /lib: are not
15486 implemented, because I want to make those have the same semantics
15487 as the CSC compiler has, and kill once and for all the confussion
15488 around this. Will be doing this tomorrow.
15490 * statement.cs (Unsafe.Resolve): The state is checked during
15491 resolve, not emit, so we have to set the flags for IsUnsfe here.
15493 2002-07-10 Miguel de Icaza <miguel@ximian.com>
15495 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
15496 not catch the Error_ObjectRefRequired in SimpleName (as it is
15497 possible to have a class/instance variable name that later gets
15498 deambiguated), we have to check this here.
15500 2002-07-10 Ravi Pratap <ravi@ximian.com>
15502 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
15503 make static and put into Expression.
15505 (Event.Define): Register the private field of the event with the
15506 TypeManager so that GetFieldFromEvent can get at it.
15508 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
15509 keep track of the private field associated with an event which
15512 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
15515 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
15517 2002-07-10 Miguel de Icaza <miguel@ximian.com>
15519 * expression.cs (Binary.EmitBranchable): this routine emits the
15520 Binary expression in a branchable context. This basically means:
15521 we need to branch somewhere, not just get the value on the stack.
15523 This works together with Statement.EmitBoolExpression.
15525 * statement.cs (Statement.EmitBoolExpression): Use
15528 2002-07-09 Miguel de Icaza <miguel@ximian.com>
15530 * statement.cs (For): Reduce the number of jumps in loops.
15532 (For): Implement loop inversion for the For statement.
15534 (Break): We can be breaking out of a Try/Catch controlled section
15535 (foreach might have an implicit try/catch clause), so we need to
15536 use Leave instead of Br.
15538 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
15539 now). If the instace expression supports IMemoryLocation, we use
15540 the AddressOf method from the IMemoryLocation to extract the
15541 address instead of emitting the instance.
15543 This showed up with `This', as we were emitting the instance
15544 always (Emit) instead of the Address of This. Particularly
15545 interesting when This is a value type, as we dont want the Emit
15546 effect (which was to load the object).
15548 2002-07-08 Miguel de Icaza <miguel@ximian.com>
15550 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
15552 * statement.cs (Checked): Set the CheckedState during the resolve
15553 process too, as the ConvCast operations track the checked state on
15554 the resolve process, and not emit.
15556 * cs-parser.jay (namespace_member_declaration): Flag that we have
15557 found a declaration when we do. This is used to flag error 1529
15559 * driver.cs: Report ok when we display the help only.
15561 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
15563 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
15565 2002-07-04 Miguel de Icaza <miguel@ximian.com>
15567 * cs-tokenizer.cs (define): We also have to track locally the
15568 defines. AllDefines is just used for the Conditional Attribute,
15569 but we also need the local defines for the current source code.
15571 2002-07-03 Miguel de Icaza <miguel@ximian.com>
15573 * statement.cs (While, For, Do): These loops can exit through a
15574 Break statement, use this information to tell whether the
15575 statement is the last piece of code.
15577 (Break): Flag that we break.
15579 * codegen.cs (EmitContexts): New `Breaks' state variable.
15581 2002-07-03 Martin Baulig <martin@gnome.org>
15583 * class.cs (TypeContainer.MethodModifiersValid): Allow override
15584 modifiers in method declarations in structs. Otherwise, you won't
15585 be able to override things like Object.Equals().
15587 2002-07-02 Miguel de Icaza <miguel@ximian.com>
15589 * class.cs (Method, Property, Indexer): Do not allow the public
15590 modifier to be used in explicit interface implementations.
15592 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
15593 override modifiers in method declarations in structs
15595 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
15597 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
15598 integer or real overflow, report an error
15600 2002-07-02 Martin Baulig <martin@gnome.org>
15602 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
15603 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
15604 to tell the runtime about our newly created System.Object and
15605 System.ValueType types.
15607 2002-07-02 Miguel de Icaza <miguel@ximian.com>
15609 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
15610 struct instead of Ldarg/Starg.
15612 2002-07-02 Martin Baulig <martin@gnome.org>
15614 * expression.cs (Indirection.Indirection): Call
15615 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
15617 2002-07-02 Martin Baulig <martin@gnome.org>
15619 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
15620 ValueType, call TypeManager.TypeToCoreType() on it.
15621 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
15622 the OpCodes.Newarr argument.
15624 2002-07-02 Martin Baulig <martin@gnome.org>
15626 * expression.cs (Invocation.EmitCall): When compiling corlib,
15627 replace all calls to the system's System.Array type to calls to
15628 the newly created one.
15630 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
15631 System.Array methods.
15632 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
15633 from the system's System.Array type which must be replaced.
15635 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
15637 * typemanager.cs: load unverifiable_code_ctor so we can build
15638 corlib using the correct type. Avoid using GetTypeCode() with
15640 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
15641 TypeManager.object_type to allow building corlib.
15643 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
15645 * ecore.cs: handle System.Enum separately in LoadFromPtr().
15647 2002-07-01 Martin Baulig <martin@gnome.org>
15649 * class.cs: Make the last change actually work, we need to check
15650 whether `ifaces != null' to avoid a crash.
15652 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15654 * class.cs: when we build structs without fields that implement
15655 interfaces, we need to add the interfaces separately, since there is
15656 no API to both set the size and add the interfaces at type creation
15659 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
15661 * expression.cs: the dimension arguments to the array constructors
15662 need to be converted if they are a long.
15664 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
15666 * class.cs: don't emit ldarg.0 if there is no parent constructor
15667 (fixes showstopper for corlib).
15669 2002-06-29 Martin Baulig <martin@gnome.org>
15671 MCS now compiles corlib on GNU/Linux :-)
15673 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
15674 ie. check for MethodImplOptions.InternalCall.
15676 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
15677 and TypeManager.attribute_type are null, so we must explicitly check
15678 whether parent is not null to find out whether it's an attribute type.
15679 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
15680 and SetBuilder, not only if the property is neither abstract nor external.
15681 This is necessary to set the MethodImplOptions on the accessor methods.
15682 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
15683 SetBuilder, see Property.Emit().
15685 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
15686 populate "System.Object", "System.ValueType" and "System.Attribute" since
15687 they've already been populated from BootCorlib_PopulateCoreTypes().
15689 2002-06-29 Martin Baulig <martin@gnome.org>
15691 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
15692 is the NullLiteral, we also need to make sure that target_type is not
15695 2002-06-29 Martin Baulig <martin@gnome.org>
15697 * rootcontext.cs (RootContext.ResolveCore): We must initialize
15698 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
15699 before calling BootstrapCorlib_ResolveDelegate ().
15701 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15703 * statement.cs: fixed build-breaker. All tests passed ok.
15705 2002-06-27 Martin Baulig <martin@gnome.org>
15707 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
15708 for System.Decimal when compiling corlib.
15710 2002-06-27 Martin Baulig <martin@gnome.org>
15712 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
15713 switch blocks which contain nothing but a default clause.
15715 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
15717 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
15719 2002-06-27 Martin Baulig <martin@gnome.org>
15721 * ecore.cs (PropertyExpr.PropertyExpr): Call
15722 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
15724 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
15725 is already a TypeBuilder.
15727 2002-06-27 Martin Baulig <martin@gnome.org>
15729 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
15730 `target_type == TypeManager.array_type', not IsAssignableFrom() in
15731 the "from an array-type to System.Array" case. This makes it work
15732 when compiling corlib.
15734 2002-06-27 Martin Baulig <martin@gnome.org>
15736 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
15737 non-static PropertyExpr, set its InstanceExpression. This makes
15738 the `ICollection.Count' property work in System/Array.cs.
15740 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
15742 * driver.cs: Made error handling more consistent. Errors now
15743 tracked by Report class, so many methods which used to return int
15744 now return void. Main() now prints success/failure and
15745 errors/warnings message.
15747 Renamed '--probe' compiler argument to '--expect-error'. Removed
15748 the magic number return values (123 and 124). Now, if the
15749 expected error occurs, the compiler exits with success (exit value
15750 0). If the compilation completes without seeing that particular
15751 error, the compiler exits with failure (exit value 1). The
15752 makefile in mcs/errors has been changed to handle the new behaviour.
15754 * report.cs: Made 'expected error' number a property and renamed
15755 it from 'Probe' to 'ExpectedError'.
15757 * genericparser.cs: Removed error handling support, since it is
15758 now all done by Report class.
15760 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
15761 class, so parse() no longer returns an int.
15763 * namespace.cs: Use Report.Error instead of GenericParser.error
15765 2002-06-22 Miguel de Icaza <miguel@ximian.com>
15767 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
15768 TypeContainer.AddOperator): At the front of the list put the
15769 explicit implementations, so they get resolved/defined first.
15771 2002-06-21 Miguel de Icaza <miguel@ximian.com>
15773 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
15774 interface type is implemented by this TypeContainer. Used during
15775 explicit interface implementation.
15777 (Property.Define, Indexer.Define, Method.Define): Validate that
15778 the given interface in the explicit implementation is one of the
15779 base classes for the containing type.
15781 Also if we are explicitly implementing an interface, but there is
15782 no match in the pending implementation table, report an error.
15784 (Property.Define): Only define the property if we are
15785 not explicitly implementing a property from an interface. Use the
15786 correct name also for those properties (the same CSC uses,
15787 although that is really not needed).
15789 (Property.Emit): Do not emit attributes for explicitly implemented
15790 properties, as there is no TypeBuilder.
15792 (Indexer.Emit): ditto.
15794 Hiding then means that we do not really *implement* a pending
15795 implementation, which makes code fail.
15797 2002-06-22 Martin Baulig <martin@gnome.org>
15799 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
15800 the return value of Object.GetType(). [FIXME: we need to do this whenever
15801 we get a type back from the reflection library].
15803 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
15805 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
15807 2002-06-20 Miguel de Icaza <miguel@ximian.com>
15809 * attribute.cs: Return null if we can not look up the type.
15811 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
15812 the interface types found.
15814 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
15815 interface types found.
15817 * typemanager.cs (GetInterfaces): Make this routine returns alll
15818 the interfaces and work around the lame differences between
15819 System.Type and System.Reflection.Emit.TypeBuilder in the results
15820 result for GetInterfaces.
15822 (ExpandInterfaces): Given an array of interface types, expand and
15823 eliminate repeated ocurrences of an interface. This expands in
15824 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
15827 2002-06-21 Martin Baulig <martin@gnome.org>
15829 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
15832 2002-06-21 Martin Baulig <martin@gnome.org>
15834 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
15835 and called with one of the core types, return the corresponding typebuilder for
15838 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
15841 2002-06-21 Martin Baulig <martin@gnome.org>
15843 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
15844 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
15845 (Expression.ConvertReferenceExplicit): Likewise.
15847 * expression.cs (ElementAccess.DoResolve): Likewise.
15848 (ElementAccess.DoResolveLValue): Likewise.
15850 2002-06-10 Martin Baulig <martin@gnome.org>
15852 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
15853 add the "value" parameter to the parameter list.
15855 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
15858 2002-06-19 Miguel de Icaza <miguel@ximian.com>
15860 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
15861 the argument to an int, uint, long or ulong, per the spec. Also
15862 catch negative constants in array creation.
15864 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
15866 * class.cs: do not allow the same interface to appear twice in
15867 the definition list.
15869 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
15871 * ecore.cs: don't use ldlen with System.Array.
15873 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
15875 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
15877 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
15879 * modifiers.cs: produce correct field attributes for protected
15880 internal. Easy fix so miguel can work on ther harder stuff:-)
15882 2002-06-18 Miguel de Icaza <miguel@ximian.com>
15884 * pending.cs: New file. Move the code from class.cs here.
15885 Support clearning the pending flag for all methods (when not doing
15886 explicit interface implementation).
15888 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
15890 * rootcontext.cs: added a couple more types needed to bootstrap.
15892 2002-06-17 Miguel de Icaza <miguel@ximian.com>
15894 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
15895 constructor in the type, instead of any constructor in the type
15896 hierarchy. Thanks to Paolo for finding this bug (it showed up as
15897 a bug in the Mono runtime when applying the params attribute).
15899 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
15900 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
15902 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
15904 * expression.cs (Unary.ResolveOperator): Use TypeManager
15905 to resolve the type.
15907 2002-06-13 Ravi Pratap <ravi@ximian.com>
15909 * cs-parser.jay (enum_member_declaration): Pass in the attributes
15912 * enum.cs (AddEnumMember): Add support to store the attributes associated
15913 with each member too.
15915 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
15916 field builders too - this takes care of the enum member case.
15918 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
15920 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
15921 address-of operator on both value types and pointers.
15923 2002-06-10 Martin Baulig <martin@gnome.org>
15925 * interface.cs (Interface.PopulateIndexer): Add the indexer's
15926 PropertyBuilder to the `property_builders' list.
15928 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
15929 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
15930 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
15931 find any indexers which are inherited from an interface.
15933 2002-06-09 Martin Baulig <martin@gnome.org>
15935 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
15936 the same type as the constant if necessary. There's also a test-130.cs
15939 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
15941 * typemanager.cs (TypeManager.ChangeType): Previously known as
15942 Enum.ChangeEnumType().
15944 2002-06-09 Martin Baulig <martin@gnome.org>
15946 * expression.cs (Cast.TryReduce): Added support for consts.
15948 2002-06-08 Ravi Pratap <ravi@ximian.com>
15950 * class.cs (Accessor): Hold attributes information so we can pass
15953 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
15954 Modify to pass in attributes attached to the methods.
15956 (add_accessor_declaration, remove_accessor_declaration): Ditto.
15958 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
15959 to handle the Accessor kind :-)
15961 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
15963 2002-06-08 Martin Baulig <martin@gnome.org>
15965 * expression.cs (Unary.TryReduceNegative): Added support for
15968 2002-06-08 Martin Baulig <martin@gnome.org>
15970 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
15971 name can't be found in the `defined_names' - the caller will do a
15972 MemberLookup in this case and thus find methods in System.Enum
15973 such as Enum.IsDefined().
15975 2002-06-08 Martin Baulig <martin@gnome.org>
15977 * enum.cs (Enum.ChangeEnumType): This is a custom version of
15978 Convert.ChangeType() which works with TypeBuilder created types.
15979 (Enum.LookupEnumValue, Enum.Define): Use it here.
15981 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
15982 `TypeBuilder.BaseType != null' check.
15983 (TypeContainer.FindMembers): Only lookup parent members if we
15984 actually have a parent.
15985 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
15986 (ConstructorInitializer.Resolve): Likewise.
15988 * interface.cs (Interface.FindMembers): Added
15989 `TypeBuilder.BaseType != null' check.
15991 * rootcontext.cs (RootContext.ResolveCore): Added
15992 "System.Runtime.CompilerServices.IndexerNameAttribute" to
15993 classes_second_stage.
15995 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
15996 debug_type and trace_type when compiling with --nostdlib.
15998 2002-06-07 Martin Baulig <martin@gnome.org>
16000 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
16001 (AddField): Set it to true when adding a non-static field.
16002 (DefineType): Use `have_nonstatic_fields' to find out whether we
16003 have non-static fields, not `Fields != null'.
16005 2002-06-02 Miguel de Icaza <miguel@ximian.com>
16007 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
16008 dereferencing a null on the static-field code path)
16010 2002-05-30 Martin Baulig <martin@gnome.org>
16012 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
16013 to take command line arguments. Use reflection to call the new
16014 custom `Initialize' function on the symbol writer and pass it the
16015 command line arguments.
16017 * driver.cs (--debug-args): New command line argument to pass command
16018 line arguments to the symbol writer.
16020 2002-05-28 Miguel de Icaza <miguel@ximian.com>
16022 * assign.cs (DoResolve): Forgot to do the implicit conversion to
16023 the target type for indexers and properties. Thanks to Joe for
16026 2002-05-27 Miguel de Icaza <miguel@ximian.com>
16028 * typemanager.cs (MethodFlags): returns the method flags
16029 (Obsolete/ShouldIgnore) that control warning emission and whether
16030 the invocation should be made, or ignored.
16032 * expression.cs (Invocation.Emit): Remove previous hack, we should
16033 not do this on matching a base type, we should do this based on an attribute
16035 Only emit calls to System.Diagnostics.Debug and
16036 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
16037 on the command line.
16039 * rootcontext.cs: Global settings for tracing and debugging.
16041 * cs-tokenizer.cs (define): New utility function to track
16042 defines. Set the global settings for TRACE and DEBUG if found.
16044 2002-05-25 Ravi Pratap <ravi@ximian.com>
16046 * interface.cs (Populate*): Pass in the TypeContainer as well as
16047 the DeclSpace as parameters so that we can create EmitContexts and
16048 then use that to apply attributes etc.
16050 (PopulateMethod, PopulateEvent, PopulateProperty)
16051 (PopulateIndexer): Apply attributes everywhere.
16053 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
16056 (ApplyAttributes): Update accordingly.
16058 We now apply interface attributes for all members too.
16060 2002-05-26 Miguel de Icaza <miguel@ximian.com>
16062 * class.cs (Indexer.Define); Correctly check if we are explicit
16063 implementation (instead of checking the Name for a ".", we
16064 directly look up if the InterfaceType was specified).
16066 Delay the creation of the PropertyBuilder.
16068 Only create the PropertyBuilder if we are not an explicit
16069 interface implementation. This means that explicit interface
16070 implementation members do not participate in regular function
16071 lookups, and hence fixes another major ambiguity problem in
16072 overload resolution (that was the visible effect).
16074 (DefineMethod): Return whether we are doing an interface
16077 * typemanager.cs: Temporary hack until we get attributes in
16078 interfaces (Ravi is working on that) and we get IndexerName
16079 support in interfaces.
16081 * interface.cs: Register the indexers as properties.
16083 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
16084 warning, I have verified that this is a bug in the .NET runtime
16085 (JavaScript suffers of the same problem).
16087 * typemanager.cs (MemberLookup): When looking up members for
16088 interfaces, the parent of an interface is the implicit
16089 System.Object (so we succeed in searches of Object methods in an
16090 interface method invocation. Example: IEnumerable x; x.ToString
16093 2002-05-25 Miguel de Icaza <miguel@ximian.com>
16095 * class.cs (Event): Events should also register if they do
16096 implement the methods that an interface requires.
16098 * typemanager.cs (MemberLookup); use the new GetInterfaces
16101 (GetInterfaces): The code used to lookup interfaces for a type is
16102 used in more than one place, factor it here.
16104 * driver.cs: Track the errors at the bottom of the file, we kept
16107 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
16108 instance if the method we are calling is static!
16110 2002-05-24 Miguel de Icaza <miguel@ximian.com>
16112 * attribute.cs (ApplyAttributes): Make this function filter out
16113 the IndexerName attribute (as that attribute in reality is never
16114 applied) and return the string constant for the IndexerName
16117 * class.cs (TypeContainer.Emit): Validate that all the indexers
16118 have the same IndexerName attribute, and if so, set the
16119 DefaultName attribute on the class.
16121 * typemanager.cs: The return value might contain other stuff (not
16122 only methods). For instance, consider a method with an "Item"
16123 property and an Item method.
16125 * class.cs: If there is a problem with the parameter types,
16128 2002-05-24 Ravi Pratap <ravi@ximian.com>
16130 * ecore.cs (ImplicitConversionExists): Wrapper function which also
16131 looks at user defined conversion after making a call to
16132 StandardConversionExists - we need this for overload resolution.
16134 * expression.cs : Update accordingly the various method calls.
16136 This fixes 2 bugs filed against implicit user defined conversions
16138 2002-05-22 Miguel de Icaza <miguel@ximian.com>
16140 * statement.cs: Track the result of the assignment.
16142 2002-05-21 Miguel de Icaza <miguel@ximian.com>
16144 * expression.cs (MemberAccess): Improved error reporting for
16145 inaccessible members.
16147 2002-05-22 Martin Baulig <martin@gnome.org>
16149 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
16150 itself with debugging support.
16152 2002-05-22 Martin Baulig <martin@gnome.org>
16154 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
16155 Removed, this isn't needed anymore.
16157 2002-05-20 Martin Baulig <martin@gnome.org>
16159 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
16160 be underlying type for an enum.
16162 2002-05-20 Miguel de Icaza <miguel@ximian.com>
16164 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
16165 that splits out the loading of just the core types.
16167 * rootcontext.cs (ResolveCore): Split the struct resolution in
16168 two, so we can load the enumeration underlying types before any
16171 * expression.cs (Is): Bandaid until we fix properly Switch (see
16172 bug #24985 for details).
16174 * typemanager.cs (ImplementsInterface): The hashtable will contain
16175 a null if there are no interfaces implemented.
16177 2002-05-18 Miguel de Icaza <miguel@ximian.com>
16179 * cs-parser.jay (indexer_declarator): It is fine to have array
16182 2002-05-17 Miguel de Icaza <miguel@ximian.com>
16184 * typemanager.cs: (RegisterBuilder): New function used to register
16185 TypeBuilders that implement interfaces. Since
16186 TypeBuilder.GetInterfaces (as usual) does not work with lame
16188 (AddUserType): register interfaces.
16190 (ImplementsInterface): Use the builder_to_ifaces hash if we are
16191 dealing with TypeBuilder. Also, arrays are showing up as
16192 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
16193 methods can not be invoked on them!
16195 * ecore.cs (ExplicitReferenceConversionExists): Made public.
16196 (ImplicitReferenceConversionExists): Split out from
16197 StandardConversionExists.
16199 * expression.cs (As): We were only implementing one of the three
16200 cases for the as operator. We now implement them all.
16201 (Is): Implement the various other cases for Is as well.
16203 * typemanager.cs (CACHE): New define used to control if we want or
16204 not the FindMembers cache. Seems to have a negative impact on
16205 performance currently
16207 (MemberLookup): Nested types have full acess to
16208 enclosing type members
16210 Remove code that coped with instance/static returns for events, we
16211 now catch this in RealFindMembers.
16213 (RealFindMembers): only perform static lookup if the instance
16214 lookup did not return a type or an event.
16216 2002-05-17 Miguel de Icaza <miguel@ximian.com>
16218 * assign.cs (CompoundAssign): We pass more semantic information
16219 now to Compound Assignments than we did before: now we have all
16220 the information at hand, and now we resolve the target *before* we
16221 do the expression expansion, which allows the "CacheValue" method
16222 to have the effect we intended (before, a [x] += 1 would generate
16223 two differen ArrayAccess expressions from the ElementAccess,
16224 during the resolution process).
16226 (CompoundAssign.DoResolve): Resolve target and original_source here.
16228 2002-05-16 Miguel de Icaza <miguel@ximian.com>
16230 * expression.cs (ArrayAccess): dropped debugging information.
16232 * typemanager.cs: Small bug fix: I was always returning i_members,
16233 instead of one of i_members or s_members (depending on which had
16236 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
16237 method is invoked before any code generation takes place, and it
16238 is a mechanism to inform that the expression will be invoked more
16239 than once, and that the method should use temporary values to
16240 avoid having side effects
16242 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
16244 * ecore.cs (Expression.CacheTemporaries): Provide empty default
16247 * expression.cs (Indirection, ArrayAccess): Add support for
16248 CacheTemporaries in these two bad boys.
16250 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
16251 ldobj or ldind_ref.
16252 (StoreFromPtr): Handle stobj as well.
16254 * expression.cs (UnaryMutator): Share more code.
16256 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
16257 down: I was not tracking the Filter function as well, which
16258 was affecting the results of the cache.
16260 2002-05-15 Miguel de Icaza <miguel@ximian.com>
16262 * attribute.cs: Remove the hack to handle the CharSet property on
16265 2002-05-14 Miguel de Icaza <miguel@ximian.com>
16267 * attribute.cs (DoResolve): More uglyness, we now only try to
16268 resolve the attribute partially, to extract the CharSet
16269 information (only if we are a StructLayout attribute). Otherwise
16271 (GetExtraTypeInfo): Add some code to conditionally kill in the
16272 future this. I am more and more convinced that the .NET
16273 framework has special code to handle the attribute setting on
16276 * expression.cs (IsParamsMethodApplicable): Revert my previous
16277 foreach change here, it was wrong.
16279 2002-05-13 Miguel de Icaza <miguel@ximian.com>
16281 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
16282 (pp_expr): do not abort on unknown input, just return.
16283 (eval): abort if there are pending chars.
16285 * attribute.cs (Attribute.Resolve): Positional parameters are
16286 optional. Deal with that case.
16288 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
16289 the Ansi/Unicode/Auto information for the type.
16291 (TypeContainer.DefineType): instantiate the EmitContext here, as
16292 we will be using it during the type definition (to resolve
16293 attributes) and during the emit phase.
16295 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
16296 to pull type information out of the attributes
16298 (Attribute.Resolve): track the constructor builder, and allow for
16299 multiple invocations (structs and classes will use this).
16301 * ecore.cs (MemberLookupFinal): new version with all the
16302 parameters customizable.
16304 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
16305 constructors. Return if the result value is null (as the error
16306 would have been flagged already by MemberLookupFinal)
16308 Do not allow instances of abstract classes or interfaces to be
16311 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
16312 We have to compare the assembly property here when dealing with
16313 FamANDAssem and Assembly access modifiers, because we might be
16314 creating an assembly from *modules* (that means that we are not
16315 getting TypeBuilders for types defined in other modules that are
16316 part of this assembly).
16318 (Method.Emit): If the method is marked abstract and has a body,
16321 (TypeContainer.DefineMembers): If both the defined member and the
16322 parent name match are methods, then do not emit any warnings: let
16323 the Method.Define routine take care of flagging warnings. But if
16324 there is a mismatch (method overrides something else, or method is
16325 overriwritten by something, then emit warning).
16327 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
16328 set to null, this means `do not check for the return type on the
16331 (Method.Define): set the return type for the method signature to
16332 null, so that we get methods with the same name and parameters and
16333 different return types. This is used to flag warning 114 (you are
16334 hiding a method, and you probably want to use the new/override
16337 * typemanager.cs (MemberLookup): Implemented proper access
16338 control, closing a long standing set of bug reports. The problem
16339 was that the Framework only has two bits: Public and NonPublic,
16340 and NonPublic includes private and protected methods, but we need
16341 to enforce the FamANDAssem, FamOrAssem and Family.
16343 2002-05-11 Miguel de Icaza <miguel@ximian.com>
16345 * statement.cs (GotoCase): Return true: Ammounts to giving up
16346 knowledge on whether we return or not, and letting the other case
16347 be responsible for it.
16349 2002-05-10 Miguel de Icaza <miguel@ximian.com>
16351 * driver.cs: Do not load directories for each file processed, only
16352 do it if there is a pattern.
16354 * ecore.cs: Report readonly assigns here as well, as we might have
16355 been resolved only by MemberAccess.
16357 (SimpleName.SimpleNameResolve): Also be useful for LValue
16358 resolution. We need this to propagate assign to local readonly variables
16360 * typemanager.cs: Use a ptrhashtable for the criteria, because we
16361 do not want to reuse potential criteria memory.
16363 * class.cs (MyEventBuilder): Set reflected_type;
16365 * ecore.cs (Constantify): Added support for constifying bools.
16367 (RootContext.LookupType): Added a cache for values looked up in
16368 the declaration space.
16370 * typemanager.cs (FindMembers): Now is a front-end to
16371 RealFindMembers, and provides a two-level hashtable-based cache to
16374 15% performance improvement: from 22.5 to 19.2 seconds.
16376 * expression.cs (IsParamsMethodApplicable): use foreach.
16377 (Invocation.DoResolve): ditto.
16378 (New.DoResolve): ditto.
16379 (ArrayCreation.DoResolve): ditto.
16381 * ecore.cs (FindMostEncompassingType): use foreach.
16383 * delegate.cs (NewDelegate.DoResolve): Use foreach
16385 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
16386 (RemoveMethods): use foreach.
16388 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
16389 nested foreach statements instead of for, and also break out of
16390 the inner loop once a match is found.
16392 (Invocation.OverloadResolve): Use foreach, simplify the code.
16394 2002-05-08 Miguel de Icaza <miguel@ximian.com>
16396 * cfold.cs (BinaryFold): During an enumeration evaluation context,
16397 we actually unwrap the expression to allow for extra information
16400 * expression.cs: Use Shr_Un on unsigned operations.
16402 2002-05-08 Ravi Pratap <ravi@ximian.com>
16404 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
16405 applicable operators was not being considered correctly. This closes
16406 the bug Miguel reported.
16408 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
16410 * attribute.cs: check that the type derives from System.Attribute
16411 and report the correct error in that case (moved the duplicate code to
16412 its own method, too).
16414 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
16416 * attribute.cs: lookup attribute type name as the spec says: first the
16417 bare attribute name and then name + "Attribute" (nant compiles with
16418 mcs after this fix).
16420 2002-05-07 Miguel de Icaza <miguel@ximian.com>
16422 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
16423 Because of the way we parse things, we should try to see if a
16424 UIntConstant can fit in an integer.
16426 2002-05-07 Ravi Pratap <ravi@ximian.com>
16428 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
16429 when we are in an explicit context.
16431 (ConvertReferenceExplicit): When converting from Iface type S to Class
16432 T make sure the rules are implemented as an OR.
16434 * parameter.cs (ParameterType): Make it a property for now although the
16435 purpose really isn't anything immediate.
16437 * expression.cs (Is*Applicable): Do better checking on the parameter type
16438 of a ref/out parameter. The ones from the system assemblies are already
16439 marked with the correct type so we don't need to do any correction.
16441 * ecore.cs (StandardConversionExists): Conversion from Interface types to
16442 the object type is standard too so include that.
16444 2002-05-06 Miguel de Icaza <miguel@ximian.com>
16446 * ecore.cs (StandardConversionExists): Augment with missing code:
16447 deal with IntConstant, LongConstants and Enumerations.
16449 * assign.cs: Report the error, instead of failing silently
16451 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
16452 typecontainer that they are declared, because the
16453 typecontainer/namespace will have the list of using clauses that
16454 need to be applied.
16456 Assembly Attributes were escaping the normal registration
16459 (EmitCode): Apply attributes within an EmitContext that represents
16460 the container they were declared on.
16462 * cs-parser.jay: Track bases for structs. How did I get this wrong?
16464 2002-05-06 Ravi Pratap <ravi@ximian.com>
16466 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
16467 Revamp completely - make much cleaner as we now operate only
16470 (FindMostSpecificSource, FindMostSpecificTarget): New methods
16471 to implement the logic detailed in the spec more correctly.
16473 (UserDefinedConversion): Update accordingly.
16475 2002-05-06 Miguel de Icaza <miguel@ximian.com>
16477 * statement.cs: Return flow analysis information up.
16479 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
16482 (token): Do not consume an extra character before calling
16485 2002-05-06 Piers Haken <piersh@friskit.com>
16487 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
16489 2002-05-06 Miguel de Icaza <miguel@ximian.com>
16491 * class.cs (Constructor.Emit): Set the IsStatic flag in the
16492 EmitContext during the instance constructor initializer
16493 resolution, to stop access to instance variables.
16495 This is mandated by the spec, last paragraph of the `constructor
16496 initializers' section.
16498 2002-05-05 Miguel de Icaza <miguel@ximian.com>
16500 * cs-parser.jay, class.cs (Accessor): new class used to represent
16501 an accessor (get or set). In the past we used `null' to represent
16502 a missing accessor. But this is ambiguous because there was no
16503 way to tell in abstract indexers/properties if one of them was
16506 Now there is a way of addressing that.
16508 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
16509 instead of FindMembers.
16511 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
16512 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
16514 * attribute.cs: Treat indexers and properties as the same in terms
16515 of applying attributes
16517 * ecore.cs (FindMostEncompassedType): Use statically initialized
16518 EmptyExpressions()s like we do elsewhere to avoid creating useless
16519 objects (and we take this out of the tight loop).
16521 (GetConversionOperators): Move the code to extract the actual
16522 operators to a separate routine to clean things up.
16524 2002-05-04 Miguel de Icaza <miguel@ximian.com>
16526 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
16527 events are always registered FieldBuilders.
16529 * class.cs (FieldBase): New class shared by Fields
16531 * delegate.cs: If we are a toplevel delegate, use our full name.
16532 If we are a nested delegate, then only use our tail name.
16534 2002-05-02 Ravi Pratap <ravi@ximian.com>
16536 * expression.cs (IsApplicable): Ensure that we add the "&" to
16537 ref/out types before comparing it with the type of the argument.
16539 (IsParamsMethodApplicable): Ditto.
16541 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
16544 * delegate.cs : Handle the case when we have more than one applicable
16545 method. Flag an error only when we finish checking all.
16547 2002-05-02 Miguel de Icaza <miguel@ximian.com>
16549 * expression.cs: Add support for boolean static initializers.
16551 2002-05-01 Miguel de Icaza <miguel@ximian.com>
16553 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
16555 * parameter.cs (ComputeParameterTypes,
16556 ComputeAndDefineParameterTypes): Better error handling: now we
16557 clear the `types' cache if we fail during any of the type lookups.
16558 We also return the status code correctly to our caller
16560 * delegate.cs: If we fail to define a delegate, abort the extra
16563 * expression.cs (Binary.ResolveOperator): for
16564 operator==(object,object) and operator !=(object, object) we also
16565 have to verify that there is an implicit conversion from one to
16568 (ArrayAccess.DoResolve): Array Access can operate on
16571 2002-04-30 Miguel de Icaza <miguel@ximian.com>
16573 * assign.cs (CompoundAssign): A new class used as a "flag" that
16574 the assignment actually is happening as part of a compound
16575 assignment operator.
16577 During compound assignment, a few new rules exist to enable things
16584 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
16585 to the type of x) if y is implicitly convertible to the type of x,
16586 and the operator is a builtin operator and the return type of the
16587 operator is explicitly convertible to the type of x.
16589 * rootcontext.cs: Reset warning level to 2. 4 catches various
16590 "interesting" features in mcs, we must clean this up at some
16591 point, but currently am trying to kill other bugs ;-)
16593 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
16594 in container classes as well.
16596 * expression.cs (Binary.ResolveOperator): Handle string case
16597 before anything else (as operator overloading does emit an error
16598 before doing anything else).
16600 This code could go away when we move to a table driven model, but
16601 i could not come up with a good plan last night.
16603 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
16605 * typemanager.cs (CSharpName): reimplementation using regex.
16606 * class.cs: added null check for fields in Emit
16607 * rootcontext.cs: set warninglevel to 4
16609 2002-04-29 Miguel de Icaza <miguel@ximian.com>
16611 * typemanager.cs (CSharpName): reimplemented with Lupus
16614 2002-04-28 Miguel de Icaza <miguel@ximian.com>
16616 * statement.cs (If): correclty implement Resolve, because we were
16617 not catching sem errors in there. The same process is needed
16619 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
16622 (Statement.Warning_DeadCodeFound): Factorize code.
16623 (While): Report dead code here too.
16625 (Statement): Added Resolve virtual method to allow
16626 for resolution split from the emit code.
16628 2002-04-26 Miguel de Icaza <miguel@ximian.com>
16630 * statement.cs (EmitBoolExpression): No longer try to resolve the
16632 (MakeBoolean): New utility function that resolve, implicitly
16633 converts to boolean and tags the expression.
16636 (If, Do): Implement dead code elimination.
16637 (While): Implement loop inversion
16639 (Do, While, For, If): Resolve the expression prior to calling our
16642 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
16645 - added method Report28 (warning: program has more than one entry point)
16646 - added method IsEntryPoint, implements paragraph 10.1 of the spec
16647 - modified method Method.Define, the part at the end of the method
16649 * rootcontext.cs: added static public Location EntryPointLocation;
16651 * ../errors/cs0028.cs : Add test case for the above warning.
16654 - modified method CSharpName to allow arrays of primitive type to
16655 be printed nicely (e.g. instead of System.Int32[][] it now prints
16657 - added method CSharpSignature: returns the signature of a method
16658 in string format to be used in reporting errors, warnings, etc.
16660 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
16663 2002-04-26 Ravi Pratap <ravi@ximian.com>
16665 * delegate.cs (Define): Fix extremely silly bug where I was
16666 setting the type of the 'object' parameter of the BeginInvoke
16667 method to System.IAsyncResult instead of System.Object ;-)
16669 2002-04-26 Miguel de Icaza <miguel@ximian.com>
16671 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
16674 (Constructor.Emit): return if we fail to initialize the
16675 constructor. Another door closed!
16677 * expression.cs (New.DoResolve): Improve error message (from -6 to
16678 1501). Use DeclaredOnly lookup to find the exact constructor.
16680 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
16681 loop. This is useful.
16683 * cs-parser.jay: Adjust the default parameters so that destructors
16684 have the proper signature.
16686 2002-04-26 Martin Baulig <martin@gnome.org>
16688 * driver.cs (LoadAssembly): If `assembly' contains any characters
16689 which are only valid in path names and not in assembly names
16690 (currently slash, backslash and point), use Assembly.LoadFrom ()
16691 instead of Assembly.Load () on the `assembly' (before iteration
16692 over the link_paths).
16694 2002-04-26 Martin Baulig <martin@gnome.org>
16696 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
16698 2002-04-25 Miguel de Icaza <miguel@ximian.com>
16700 * class.cs (Property): use the new typemanager.MemberLookup
16702 (TypeContainer.MemberLookup): Implement using the
16703 TypeManager.MemberLookup now.
16705 * typemanager.cs: Make MemberLookup a function of the TypeManager,
16706 and return MemberInfos, so that these can be used without an
16707 EmitContext (what we had before).
16709 2002-04-24 Miguel de Icaza <miguel@ximian.com>
16711 * expression.cs: Fix the case where the argument to params if the
16712 type of the params. I omitted handling this before. Fixed
16714 2002-04-22 Miguel de Icaza <miguel@ximian.com>
16716 * driver.cs: Call BootCorlib_PopulateCoreType
16718 * class.cs (Property.CheckBase): Check for properties only, not
16721 * interface.cs: Temporary hack: try/catch around the
16722 CustomAttributeBuilder, because I am getting an exception that I
16725 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
16726 types whose definitions are required to be there (attributes are
16727 defined before standard types).
16729 Compute definitions as we boot the various types, as they are used
16730 immediately (value_type class will need object_type, but if we do
16731 not initialize object_type, we will pass a null, which will let
16732 the runtime pick the System.Object from the existing corlib, which
16733 is not what we want).
16735 2002-04-22 Patrik Torstensson <totte@labs2.com>
16737 * cs-tokenizer.cs: fixed a number of trim() issues.
16739 2002-04-22 Ravi Pratap <ravi@ximian.com>
16741 * expression.cs (Argument.Type): Ensure that we return the correct
16742 type when we have out or ref parameters [in which case we
16745 2002-04-22 Miguel de Icaza <miguel@ximian.com>
16747 * class.cs (Property, Indexer): Allow extern modifier in there.
16749 * typemanager.cs (InitBaseTypes): Initializes object_type and
16750 value_type, since those will be used early on during the bootstrap
16751 process to compile corlib.
16753 (InitCoreTypes): Move code from here to InitBaseTypes.
16755 2002-04-21 Miguel de Icaza <miguel@ximian.com>
16757 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
16758 single-dimension arrays as using the ldlen opcode.
16760 Daniel Lewis discovered this optimization.
16762 * typemanager.cs: Add signature for System.Array::get_Length
16764 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16766 * statement.cs: report the error when the foreach does not apply to an
16767 array nor a collection.
16769 2002-04-19 Miguel de Icaza <miguel@ximian.com>
16771 * expression.cs: Add implicit conversions to the operator ~.
16773 * constant.cs (DecimalConstant.Emit): Emit decimal value.
16775 * typemanager.cs: Locate the decimal constructor.
16777 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16779 * attribute.cs: use the new property of TypeOf.
16780 * expression.cs: added 'get' property around typearg.
16782 These changes fix a build breaker reported by NickD. Is this the
16783 correct way to fix? If not, please, revert my changes and make it
16786 2002-04-17 Miguel de Icaza <miguel@ximian.com>
16788 * attribute.cs: Add support for typeof in attribute invocations.
16789 I am not sure that this is right though.
16791 2002-04-14 Duncan Mak <duncan@ximian.com>
16793 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
16794 Binary.Operator.Division case.
16796 2002-04-13 Ravi Pratap <ravi@ximian.com>
16798 * class.cs (DefineType): Ensure that we do a proper check on
16799 attribute types and also register it with the TypeManager.
16801 (TypeContainer.Targets): The default for attribute types is
16802 AttributeTargets.All.
16804 * attribute.cs (ApplyAttributes): Registering the attribute type
16805 is done elsewhere, not when we discover we have a Usage attribute.
16807 2002-04-12 Ravi Pratap <ravi@ximian.com>
16809 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
16810 and get rid of is_delegate parameter.
16812 * everywhere : update.
16814 2002-04-12 Ravi Pratap <ravi@ximian.com>
16816 * cs-parser.jay (compilation_unit): Revamp completely to use
16817 some new ideas that I got from Rhys' grammar to solve the problems
16818 with assembly level attributes.
16820 (outer_declaration): New grammar production.
16822 (attribute_sections): Add.
16824 (opt_attributes): Base on attribute_sections
16826 (namespace_declaration): Allow opt_attributes to tackle the case
16827 when we have assembly level attributes - we are clever in this
16830 * attribute.cs (ApplyAttributes): Do not worry about assembly
16831 attributes in the non-global context.
16833 * rootcontext.cs (AddGlobalAttributes): Go back to using this
16834 instead of SetGlobalAttributes.
16836 * class.cs, rootcontext.cs : Ensure we define and generate
16837 attribute types before anything else.
16839 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
16840 and flag the new error -20 for the case when the attribute type
16841 does not have valid targets specified. csc does not catch this.
16843 * ../errors/errors.txt : update for error # -20
16845 2002-04-11 Ravi Pratap <ravi@ximian.com>
16847 * support.cs (InternalParameters.ParameterModifier): Do some null
16848 checking and return sane values.
16850 * class.cs (Method.Define): If we are a PInvoke method, ensure
16851 that we are static and extern. Report error # 601
16853 * ../errors/cs0601.cs : Add test case for the above error.
16855 2002-04-07 Ravi Pratap <ravi@ximian.com>
16857 * rootcontext.cs (attribute_types): We need to keep type of
16858 all attribute types separately and emit code for them first.
16860 (RegisterAttribute) : Implement.
16862 * class.cs (DefineType): Check if the current Type is a custom
16863 attribute type and register it accordingly.
16865 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
16866 adding the first attribute twice and rename to
16868 (SetGlobalAttributes): this.
16870 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
16873 * attribute.cs (ApplyAttributes): Take an additional argument telling us
16874 if we are processing global arguments. Hmm, I am unsure of this.
16876 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16878 * expression.cs: added static array of strings to avoid calling
16879 Enum.ToString () for Operator in Binary. Significant recover of
16882 2002-04-10 Miguel de Icaza <miguel@ximian.com>
16884 * class.cs (FindMembers): Allow the Builders of the various
16885 members to be null. If they are skip them. This only happens
16886 during the PInvoke declaration.
16888 2002-04-09 Miguel de Icaza <miguel@ximian.com>
16890 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
16891 failure, so we do not keep going afterwards.
16893 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
16894 wanted to pass `false' as the `is_delegate' argument. If this is
16895 the case, why not use delegate_type == null to mean `is_delegate =
16896 false' and anything else as is_delegate = true.
16898 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
16900 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
16901 code for the section, not the beginning of the tests.
16903 2002-04-08 Miguel de Icaza <miguel@ximian.com>
16905 * cfold.cs: Handle operator + (Enum x, Underlying x)
16907 * expression.cs (Binary): same. Warn about errors where we have
16908 Enum/Enum in operator + as well.
16910 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
16913 - added support for switch(bool)
16914 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
16915 - add TableSwitchEmit() to handle table-based switch statements
16917 2002-04-05 Ravi Pratap <ravi@ximian.com>
16919 * expression.cs (Invocation.OverloadResolve): Factor out code which
16920 does parameter compatibility checking with arguments so that we can
16921 re-use the code even from Delegate.VerifyApplicability
16923 (VerifyArgumentsCompat): Move above code here.
16925 * delegate.cs (VerifyApplicability): Get rid of duplicate code
16926 and instead make a call to the above method.
16928 2002-03-31 Ravi Pratap <ravi@ximian.com>
16930 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
16931 We use it to keep track of classes which are attribute types.
16933 2002-04-02 Miguel de Icaza <miguel@ximian.com>
16935 * delegate.cs (Delegate.Define): Correctly define the types in the
16936 presence of fixed and array parameters.
16938 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
16941 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
16942 include NonPublic after the first iteration.
16944 * class.cs (Indexer.CheckBase): Only check if both parents are
16947 * cs-parser.jay (accessor_body): If empty, set to null.
16949 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
16950 same code path here to resolve constants names that we did have in
16951 MemberAccess.DoResolve. There is too much code duplicated here.
16953 2002-04-01 Miguel de Icaza <miguel@ximian.com>
16955 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
16957 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
16960 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
16961 tokens, numbers and strings.
16963 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
16966 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
16967 asyncronous parameters and the regular parameters.
16969 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
16970 specify the target directory.
16972 * expression.cs: (This.DoResolve): Simplify
16973 (As.Emit): Optimize, do not generate IsInst if the expression is
16974 always of the given type.
16976 (Is.DoResolve): Bug fix, we were reporting both always/never for
16979 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
16980 creating too many unnecessary arrays.
16982 2002-03-31 Miguel de Icaza <miguel@ximian.com>
16984 * class.cs (EmitFieldInitializer): Use Assign expression to assign
16985 fields instead of rolling our own initializer. Takes care of all
16986 implicit conversions, and drops unnecessary static checks/argument.
16988 2002-03-31 Dick Porter <dick@ximian.com>
16990 * driver.cs: use the GetDirectories() return values properly, and
16991 use "/" as path separator.
16993 2002-03-30 Miguel de Icaza <miguel@ximian.com>
16995 * expression.cs (Unary): Optimize - - expr into expr.
16996 (Binary): Optimize a + (-b) into a -b.
16998 * codegen.cs (CodeGen): Made all methods static.
17000 2002-03-29 Miguel de Icaza <miguel@ximian.com>
17004 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
17005 TypeBuilder property.
17007 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
17010 * tree.cs: Removed the various RecordXXXX, and replaced with a
17011 single RecordDecl. Removed all the accessor methods, and just
17012 left a single access point Type
17014 * enum.cs: Rename DefineEnum to DefineType.
17016 * decl.cs: New abstract method `DefineType' used to unify the
17017 Defines for Enumerations, Interfaces, TypeContainers and
17020 (FindType): Moved LookupInterfaceOrClass here. Moved the
17021 LookupBaseClasses method that used to live in class.cs and
17022 interface.cs here, and renamed to FindType.
17024 * delegate.cs: Implement DefineType. Take advantage of the
17025 refactored pattern for locating the parent builder without taking
17026 the parent_builder argument (which we know does not work if we are
17027 nested, and triggering a toplevel definition).
17029 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17031 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
17032 accessibility of a member has changed during override and report
17035 * class.cs (Method.Define, Property.Define): Only complain on
17036 overrides if the method is private, any other accessibility is
17037 fine (and since we just checked the permission is the same, we are
17040 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
17041 and elif are processed always. The other pre-processing
17042 directives are only processed if we are "taking" the path
17044 2002-03-29 Martin Baulig <martin@gnome.org>
17046 * class.cs (Method.Emit): Only emit symbolic debugging info if the
17047 current location is not Null.
17049 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
17050 a separate method so we can profile it.
17052 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
17053 `span.Seconds' are just seconds, but no minutes or hours.
17054 (MainDriver): Profile the CodeGen.SaveSymbols calls.
17056 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17058 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
17059 Remove the gratuitous set of Final:
17061 // If an interface implementation, then we can set Final.
17062 if (((flags & MethodAttributes.Abstract) == 0) &&
17063 implementing.DeclaringType.IsInterface)
17064 flags |= MethodAttributes.Final;
17066 I do not know what I was smoking when I used that.
17069 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
17070 step into fixing the name resolution issues for delegates and
17071 unifying the toplevel name resolution.
17073 2002-03-28 Martin Baulig <martin@gnome.org>
17075 * class.cs (Method.Emit): If we have a symbol writer, call its
17076 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
17077 tell it about the current method.
17079 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
17080 writer that we're going to emit the first byte of IL code for a new
17081 statement (a new source line).
17082 (EmitContext.EmitTopBlock): If we have a symbol writer, call
17083 EmitContext.Mark() before emitting any code.
17085 * location.cs (SymbolDocument): Return null when we're Null.
17087 * statement.cs (Statement): Moved the `Location loc' variable here.
17088 (Statement.EmitBoolExpression): If we have a symbol writer, call
17089 ec.Mark() before emitting any code to tell it that we're at the
17090 beginning of a new statement.
17091 (StatementExpression): Added `Location' argument to the constructor.
17092 (Block): Added public readonly variable `StartLocation' and public
17093 variable `EndLocation'. The latter is to be set using SetEndLocation().
17094 (Block): Added constructor which takes a start and end location.
17095 (Block.SetEndLocation): New method. This sets the end location.
17096 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
17097 local variables we create.
17098 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
17099 each statement and do also mark the begin and end of the block.
17101 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
17102 tell it the current lexer.Location, use Location.Null for the end of the
17104 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
17105 current block, set its end location using SetEndLocation().
17106 (statement_expression): StatementExpression constructor now takes the
17107 lexer.Location as additional argument.
17108 (for_statement, declare_local_variables): Likewise.
17109 (declare_local_variables): When creating a new implicit block, use the
17110 new Block constructor and pass it the lexer.Location.
17112 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17114 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
17115 members also on the parent interfaces recursively.
17117 2002-03-27 Miguel de Icaza <miguel@ximian.com>
17119 * report.cs: Use new formats, since Gonzalo finished the missing
17122 * expression.cs (Binary.ResolveOperator): added missing operator|
17123 operator& and operator^ for bool/bool.
17125 * cs-parser.jay: CheckDef now takes a Location argument that is
17126 used to report errors more precisly (instead of reporting the end
17127 of a definition, we try to track something which is a lot closer
17128 to the source of the problem).
17130 * cs-tokenizer.cs: Track global token use, so we can properly flag
17131 the use of #define/#undef after the first token has been seen.
17133 Also, rename the reportXXXX to Error_DescriptiveName
17135 * decl.cs (DeclSpace.IsTopLevel): Move property here from
17136 TypeContainer, so that Enum and Interface can use this too.
17138 * class.cs (TypeContainer.LookupInterfaceOrClass,
17139 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
17140 `builder' argument. Typically this was used to pass the parent
17141 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
17144 The problem is that a nested class could trigger the definition of
17145 a toplevel class, and the builder would be obviously wrong in that
17148 So we drop this argument, and we compute dynamically the
17149 TypeBuilder/ModuleBuilder (the correct information was available
17150 to us anyways from DeclSpace.Parent)
17152 * interface.cs (Interface.DefineInterface): Drop builder
17153 parameter cleanup like class.cs
17155 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
17158 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
17161 (Try.Emit): Propagate the returns value from the statement.
17163 (Return.Emit): Even if we are leavning
17165 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
17167 * modifiers.cs: Fix the computation of MethodAttributes flags.
17169 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
17171 * driver.cs: allow compilation of files that start with '/'.
17172 Add a default case when checking the argument of --target.
17174 2002-03-25 Miguel de Icaza <miguel@ximian.com>
17176 * interface.cs: Implement the same search algorithm for types in
17177 the interface code.
17179 * delegate.cs: Do not allow multiple definition.
17181 * Recovered ChangeLog that got accidentally amputated
17183 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
17185 * rootcontext.cs: Load manually enum to allow core classes to
17186 contain enumerations.
17188 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
17189 Update to new static methods in TypeManager.
17191 * typemanager.cs (GetMethod, GetConstructor): Use our
17192 implementation of FindMembers to find the members, since during
17193 corlib compilation, the types are TypeBuilders and GetMethod and
17194 GetConstructor do not work.
17196 Make all methods in TypeManager static.
17198 (InitCodeHelpers): Split the functionality from
17199 the InitCodeTypes function.
17201 * driver.cs: Call InitCodeHelpers after we have populated the
17204 * cs-parser.jay (delegate_declaration): we did not used to compute
17205 the delegate name correctly for void delegates.
17207 2002-03-24 Miguel de Icaza <miguel@ximian.com>
17209 * rootcontext.cs (RootContext): Init the interface_resolve_order
17210 and type_container_resolve_order always.
17212 (ResolveCore, BootstrapCorlib_ResolveClass,
17213 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
17214 compiler when compiling with --nostdlib
17216 * class.cs (TypeContainer.DefineType): Check that our parent is
17217 not null. This test is most important when we are bootstraping
17220 * codegen.cs: Split out the symbol writing code.
17222 2002-03-25 Martin Baulig <martin@gnome.org>
17224 * driver.cs (-g): Made -g an alias for --debug.
17226 2002-03-24 Martin Baulig <martin@gnome.org>
17228 * codegen.cs (SymbolWriter): New public variable. Returns the
17229 current symbol writer.
17230 (CodeGen): Added `bool want_debugging_support' argument to the
17231 constructor. If true, tell the ModuleBuild that we want debugging
17232 support and ask it for the ISymbolWriter.
17233 (Save): If we have a symbol writer, call it's Close() method after
17234 saving the assembly.
17236 * driver.c (--debug): New command line argument to create a
17237 debugger information file.
17239 * location.cs (SymbolDocument): New public property. Returns an
17240 ISymbolDocumentWriter object for the current source file or null
17241 if we don't have a symbol writer.
17243 2002-03-21 Miguel de Icaza <miguel@ximian.com>
17245 * driver.cs (LoadAssembly): Correctly return when all the paths
17246 have been tried and not before.
17248 * statement.cs (Switch.Emit): return the actual coverage for this
17249 statement (returns/not-returns)
17251 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
17252 switch of the statement if we are the last switch section. That
17253 kills two problems: try/catch problems (we used to emit an empty
17254 nop at the end) and switch statements where all branches would
17257 2002-03-19 Miguel de Icaza <miguel@ximian.com>
17259 * driver.cs: Add default assemblies (the equivalent to the
17260 Microsoft CSC.RSP file)
17262 * cs-tokenizer.cs: When updating `cols and setting it to zero,
17263 also update tokens_seen and set it to false.
17265 * driver.cs: Implement --recurse for Mike.
17267 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
17268 correctly splitting out the paths.
17270 2002-03-18 Miguel de Icaza <miguel@ximian.com>
17272 * interface.cs (Interface.PopulateProperty): Instead of using
17273 `parent' as the declaration space for the set parameters, use
17276 * support.cs (InternalParameters): InternalParameters constructor
17277 takes a DeclSpace instead of a TypeContainer.
17279 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
17280 types are being initialized, load the address of it before calling
17283 (New): Provide a mechanism to disable the generation of local
17284 value type temporaries when the caller will be providing us with
17285 an address to store it.
17287 (ArrayCreation.EmitDynamicInitializers): Use it.
17289 2002-03-17 Miguel de Icaza <miguel@ximian.com>
17291 * expression.cs (Invocation.EmitArguments): Only probe for array
17292 property if there is more than one argument. Sorry about that.
17294 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
17295 empty param arrays.
17297 * class.cs (Method.LabelParameters): Fix incorrect code path that
17298 prevented the `ParamArrayAttribute' from being applied to the
17301 2002-03-16 Miguel de Icaza <miguel@ximian.com>
17303 * support.cs (ReflectionParameters): Correctly compute whether the
17304 last argument is a params array. Fixes the problem with
17307 * typemanager.cs: Make the assemblies array always be non-null
17308 (empty, but non-null)
17310 * tree.cs (RecordDecl): New function that abstracts the recording
17311 of names. This reports error 101, and provides a pointer to the
17312 previous declaration. Fixes a crash in the compiler.
17314 * cs-parser.jay (constructor_declaration): Update to new grammar,
17315 and provide a constructor_body that can be empty.
17317 2002-03-15 Miguel de Icaza <miguel@ximian.com>
17319 * driver.cs: Add support for --resources.
17321 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
17322 Make all types for the various array helper methods be integer.
17324 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
17325 CheckState to ConvCast.
17327 (ConvCast): Now it takes a `checked' state argument, to avoid
17328 depending on the emit context for the conversion, and just using
17329 the resolve time setting.
17331 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
17332 instead of Invocation.EmitArguments. We do not emit the original
17333 arguments, instead we emit those which have been converted to
17334 unsigned int expressions.
17336 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
17338 * codegen.cs: ditto.
17340 * expression.cs (LocalVariableReference): Drop the use of the
17341 Store function that depended on the variable index.
17343 * statement.cs (VariableInfo): Drop the `Idx' property from this
17344 class, as this is not taking into account the indexes for
17345 temporaries tat we generate during the execution, getting the
17348 * class.cs: First emit class initializers, then call the parent
17351 * expression.cs (Binary): Fix opcode emision.
17352 (UnaryMutator.EmitCode): Support checked code generation
17354 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
17355 matches for events for both the Static and Instance scans,
17356 pointing to the same element. Fix that.
17358 2002-03-14 Miguel de Icaza <miguel@ximian.com>
17360 * rootcontext.cs (ResolveTree): Always set the
17361 interface_resolve_order, because nested interfaces will be calling
17364 * class.cs (GetInterfaceOrClass): Track the same resolution
17365 process used by TypeManager.LookupType. This fixes the nested
17366 type lookups in class declarations (separate path from
17369 (TypeContainer.DefineType): Also define nested interfaces.
17370 (TypeContainer.RegisterOrder): New public function used to
17371 register the order in which child interfaces need to be closed.
17373 Nested interfaces need to be closed after their parents have been
17376 * interface.cs (InterfaceAttr): Put all the logic for computing
17377 the interface attribute here.
17379 (DefineInterface): Register our interface order with the
17380 RootContext or with the TypeContainer depending on the case.
17382 2002-03-12 Miguel de Icaza <miguel@ximian.com>
17384 * cs-parser.jay: rework foreach statement to work with the new
17385 changes to the policy on SimpleNames.
17387 * report.cs: support Stacktrace on warnings as well.
17389 * makefile: drop --unsafe and /unsafe from the compile.
17391 2002-03-13 Ravi Pratap <ravi@ximian.com>
17393 * ecore.cs (StandardConversionExists): Modify to take an Expression
17394 as the first parameter. Ensure we do null -> reference type conversion
17397 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
17398 temporary Expression objects.
17400 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
17402 * interface.cs: workaround bug in method overloading resolution
17403 (there is already a bugzilla bug for it).
17405 2002-03-12 Miguel de Icaza <miguel@ximian.com>
17407 We could also solve this problem by having a separate path for
17408 performing type lookups, instead of DoResolve, we could have a
17409 ResolveType entry point, and only participating pieces of the
17410 production (simplename, deref, array) would implement this.
17412 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
17413 signal SimpleName to only resolve type names and not attempt to
17414 resolve anything else.
17416 * expression.cs (Cast): Set the flag.
17418 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
17420 * class.cs: Only report 108 if there is no `new' modifier.
17422 * cs-parser.jay: rework foreach statement to work with the new
17423 changes to the policy on SimpleNames.
17425 * report.cs: support Stacktrace on warnings as well.
17427 * makefile: drop --unsafe and /unsafe from the compile.
17429 2002-03-11 Miguel de Icaza <miguel@ximian.com>
17431 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
17432 lookups here, instead of doing that at parse time. This means
17433 that our grammar will not introduce `LocalVariableReferences' as
17434 expressions at this point. That solves the problem of code like
17438 static void Main ()
17442 This is only half the fix. The full fix requires parameters to
17443 also be handled in this way.
17445 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
17446 makes the use more obvious of the DeclSpace. The
17447 ec.TypeContainer.TypeBuilder is now only used to pull the
17448 TypeBuilder for it.
17450 My theory is that I can get rid of the TypeBuilder completely from
17451 the EmitContext, and have typecasts where it is used (from
17452 DeclSpace to where it matters).
17454 The only pending problem is that the code that implements Aliases
17455 is on TypeContainer, and probably should go in DeclSpace.
17457 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
17458 lookups here, instead of doing that at parse time. This means
17459 that our grammar will not introduce `LocalVariableReferences' as
17460 expressions at this point. That solves the problem of code like
17464 static void Main ()
17468 This is only half the fix. The full fix requires parameters to
17469 also be handled in this way.
17471 * class.cs (Property.DefineMethod): When implementing an interface
17472 method, set newslot, when implementing an abstract method, do not
17473 set the flag (before we tried never setting it, or always setting
17474 it, which is the difference).
17475 (Indexer.DefineMethod): same.
17476 (Method.DefineMethod): same.
17478 * ecore.cs: Only set the status used flag if we get back a Field.
17480 * attribute.cs: Temporary hack, so Paolo can keep working.
17482 2002-03-08 Ravi Pratap <ravi@ximian.com>
17484 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
17485 the unmanaged type in the case we have a MarshalAs attribute.
17487 (Resolve): Handle the case when we are parsing the special MarshalAs
17488 attribute [we need to store the unmanaged type to use later]
17490 * typemanager.cs (marshal_as_attr_type): Built in type for the
17491 MarshalAs Attribute.
17493 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
17494 on parameters and accordingly set the marshalling info.
17496 2002-03-09 Miguel de Icaza <miguel@ximian.com>
17498 * class.cs: Optimizing slightly by removing redundant code after
17499 we switched to the `NoTypes' return value.
17500 (Property.DefineMethod): use NoTypes here too.
17502 This fixes the bug I introduced in my last batch of changes.
17504 2002-03-05 Ravi Pratap <ravi@ximian.com>
17506 * tree.cs (RecordEnum): Add. We now keep track of enums too.
17508 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
17509 Enums since those are types too.
17511 * cs-parser.jay (enum_declaration): Record enums as we parse them.
17513 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
17514 thanks to a call during the lookup process.
17516 2002-03-07 Miguel de Icaza <miguel@ximian.com>
17518 * statement.cs (Foreach): Lots of work to accomodate a particular
17519 kind of foreach statement that I had not kept in mind. It is
17520 possible to have foreachs on classes that provide a GetEnumerator
17521 method that return objects that implement the "pattern" for using
17522 a foreach, there is no need to support GetEnumerator
17525 This is needed to compile nant.
17527 * decl.cs: Only report 114 if the member is not `Finalize' and if
17528 the warning level is at least 2.
17530 * class.cs: Moved the compare function from Method to
17533 (MethodSignature.InheritableMemberSignatureCompare): Add new
17534 filter function that is used to extract inheritable methods from a
17537 (Method.Define): Use the new `inheritable_method_signature_filter'
17540 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
17543 2002-03-06 Miguel de Icaza <miguel@ximian.com>
17545 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
17547 * cs-parser.jay: Add opt_semicolon to the interface declaration.
17549 * expression.cs: Pass location information to
17550 ConvertImplicitStandard.
17552 * class.cs: Added debugging code to track return values from
17555 2002-03-05 Miguel de Icaza <miguel@ximian.com>
17557 * expression.cs (Is.DoResolve): If either side of the `is' is an
17558 interface, do not flag the warning.
17560 * ecore.cs (ImplicitReferenceConversion): We need a separate test
17563 * report.cs: Allow for --fatal to be used with --probe.
17565 * typemanager.cs (NoTypes): Move the definition for the empty Type
17568 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
17570 (TypeContainer.DefineProxy): New function used to proxy to parent
17571 implementations when implementing interfaces.
17572 (TypeContainer.ParentImplements): used to lookup if our parent
17573 implements a public function that is required by an interface.
17574 (TypeContainer.VerifyPendingMethods): Hook this up.
17576 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
17577 `modules' and `assemblies' arraylists into arrays. We only grow
17578 these are the very early start up of the program, so this improves
17579 the speedof LookupType (nicely measured).
17581 * expression.cs (MakeByteBlob): Replaced unsafe code with
17582 BitConverter, as suggested by Paolo.
17584 * cfold.cs (ConstantFold.Binary): Special case: perform constant
17585 folding of string concatenation, but if either side is a string,
17586 and the other is not, then return null, and let the runtime use
17587 the concatenation on the string plus the object (using
17588 `Object.ToString').
17590 2002-03-04 Miguel de Icaza <miguel@ximian.com>
17592 Constant Folding has been implemented now.
17594 * expression.cs (Unary.Reduce): Do not throw an exception, catch
17595 the error instead on types that are not supported in one's
17598 * constant.cs (Constant and all children): New set of functions to
17599 perform implict and explicit conversions.
17601 * ecore.cs (EnumConstant): Implement the new functions to perform
17602 conversion by proxying to the child expression.
17604 * codegen.cs: (ConstantCheckState): Constant evaluation has its
17605 own separate setting that can not be turned off from the command
17606 line using --unchecked or --checked and is only controlled using
17607 the checked/unchecked statements and expressions. This setting is
17608 used by the constant folder to flag errors.
17610 * expression.cs (CheckedExpr, UncheckedExpr): Set the
17611 ConstantCheckState as well.
17613 During Resolve, they also have to flag the state, because the
17614 constant folder runs completely in the Resolve phase.
17616 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
17619 2002-03-01 Miguel de Icaza <miguel@ximian.com>
17621 * cfold.cs: New file, this file contains the constant folder.
17623 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
17624 argument to track whether we are using the resulting address to
17625 load or store a value and provide better error messages.
17627 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
17628 new AddressOf arguments.
17630 * statement.cs (Foreach.EmitCollectionForeach): Update
17632 * expression.cs (Argument.Emit): Call AddressOf with proper
17633 arguments to track usage.
17635 (New.DoEmit): Call AddressOf with new arguments.
17637 (Unary.Emit): Adjust AddressOf call.
17639 2002-03-01 Ravi Pratap <ravi@ximian.com>
17641 * cs-parser.jay (member_access): Change the case for pre-defined types
17642 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
17645 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
17648 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
17649 essentially like methods and apply attributes like MethodImplOptions to them too.
17651 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
17654 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
17655 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
17658 * Update code everywhere accordingly.
17660 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
17662 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
17664 2002-02-28 Ravi Pratap <ravi@ximian.com>
17666 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
17667 try performing lookups against those instead of jumping straight into using
17668 the 'using' clauses.
17670 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
17672 (LookupType): Perform lookups in implicit parents too.
17674 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
17675 sequence as RootContext.LookupType.
17677 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
17678 the various cases of namespace lookups into this method.
17680 2002-03-01 Miguel de Icaza <miguel@ximian.com>
17682 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
17683 in positional arguments)
17685 * class.cs (Operator): Update the AllowedModifiers to contain
17688 * cs-parser.jay: Update operator declaration to allow for the
17689 operator body to be empty.
17691 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
17694 2002-02-27 Miguel de Icaza <miguel@ximian.com>
17696 * class.cs (Method.Emit): Label parameters.
17698 * driver.cs: Return 1 or 0 as the program exit code.
17700 2002-02-26 Miguel de Icaza <miguel@ximian.com>
17702 * expression.cs: Special case the `null' object when trying to
17703 auto-compute the type, as anything can be explicitly converted to
17706 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
17707 spotting this Paolo.
17709 (Expression.ImplicitNumericConversion): Perform comparissions of
17710 the type using the underlying type in the case of an enumeration
17711 rather than using the enumeration type for the compare.
17713 Cope with the underlying == type case, which is not possible to
17716 (Expression.ConvertNumericExplicit): Perform comparissions of
17717 the type using the underlying type in the case of an enumeration
17718 rather than using the enumeration type for the compare.
17720 * driver.cs: If the user does not supply an extension, assume .exe
17722 * cs-parser.jay (if_statement): Rewrote so that we can track the
17723 location for the if statement.
17725 * expression.cs (Binary.ConstantFold): Only concat strings when
17726 the operation is "+", not everything ;-)
17728 * statement.cs (Statement.EmitBoolExpression): Take a location
17730 (If, While, Do): Track location.
17732 * expression.cs (Binary.ResolveOperator): In the object + string
17733 case, I was missing a call to ConvertImplicit
17735 2002-02-25 Ravi Pratap <ravi@ximian.com>
17737 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
17738 Location arguments. Ensure we use RootContext.LookupType to do our work
17739 and not try to do a direct Type.GetType and ModuleBuilder.GetType
17741 * interface.cs (PopulateMethod): Handle the type of the parameter being
17744 * expression.cs (Invocation.BetterFunction): Handle the case when we
17745 have a params method with no fixed arguments and a call is made with no
17748 2002-02-25 Miguel de Icaza <miguel@ximian.com>
17750 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
17751 the verbatim-string-literal
17753 * support.cs (InternalParameters.ParameterModifier): handle null
17755 (InternalParameters.ParameterType): ditto.
17757 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
17758 duplicating the name of the variable parameter.
17759 (GetParameterByName): Fix bug where we were not looking up array
17760 paramters if they were the only present (thanks Paolo!).
17761 (GetParameterInfo): We only have an empty set of types if both
17762 fixed and array are set to null.
17763 (GetParameterInfo-idx): Handle FixedParameter == null
17765 * cs-parser.jay: Handle the case where there is no catch
17766 statements (missing null test).
17768 2002-02-22 Miguel de Icaza <miguel@ximian.com>
17770 * driver.cs (MainDriver): Be conservative on our command line
17773 Catch DirectoryNotFoundException when calling GetFiles.
17775 (SplitPathAndPattern): Used to split the input specification into
17776 a path and a pattern that we can feed to Directory.GetFiles.
17778 2002-02-21 Miguel de Icaza <miguel@ximian.com>
17780 * statement.cs (Fixed): Implement the last case of the Fixed
17781 statement (string handling).
17783 * expression.cs (StringPtr): New class used to return a char * to
17784 a string; Used by the Fixed statement.
17786 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
17788 * expression.cs (Binary.ResolveOperator): Remove redundant
17789 MemberLookup pn parent type.
17790 Optimize union call, we do not need a union if the types are the same.
17791 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
17794 Specialize the use of MemberLookup everywhere, instead of using
17795 the default settings.
17797 (StackAlloc): Implement stackalloc keyword.
17799 * cs-parser.jay: Add rule to parse stackalloc.
17801 * driver.cs: Handle /h, /help, /?
17803 * expression.cs (MakeByteBlob): Removed the hacks we had in place
17804 before we supported unsafe code.
17806 * makefile: add --unsafe to the self compilation of mcs.
17808 2002-02-20 Miguel de Icaza <miguel@ximian.com>
17810 * expression.cs (PointerArithmetic): New class that is used to
17811 perform pointer arithmetic.
17812 (Binary.Resolve): Handle pointer arithmetic
17813 Handle pointer comparission.
17814 (ArrayPtr): Utility expression class that is used to take the
17815 address of an array.
17817 (ElementAccess): Implement array access for pointers
17819 * statement.cs (Fixed): Implement fixed statement for arrays, we
17820 are missing one more case before we are done.
17822 * expression.cs (Indirection): Implement EmitAssign and set the
17823 ExprClass to Variable. This allows pointer dereferences to be
17824 treated as variables, and to have values assigned to them.
17826 * ecore.cs (Expression.StoreFromPtr): New utility function to
17827 store values dereferencing.
17829 2002-02-20 Ravi Pratap <ravi@ximian.com>
17831 * expression.cs (Binary.ResolveOperator): Ensure that we are
17832 not trying to operate on a void type - this fixes the reported
17835 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
17836 the parent implementation is sealed.
17838 * ../errors/cs0239.cs : Add.
17840 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
17842 * typemanager.cs (unverifiable_code_type): Corresponds to
17843 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
17844 which have unsafe code in them.
17846 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
17849 2002-02-19 Miguel de Icaza <miguel@ximian.com>
17851 * cs-tokenizer.cs: Add support for @"litreal strings"
17853 Make tokenizer accept pre-processor directives
17854 on any column (remove the old C-like limitation).
17856 * rootcontext.cs (EmitCode): Emit any global attributes.
17857 (AddGlobalAttributes): Used to keep track of assembly attributes.
17859 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
17861 * cs-parser.jay: Add support for global attributes.
17863 2002-02-17 Miguel de Icaza <miguel@ximian.com>
17865 * expression.cs (Indirection): New helper class. Unary will
17866 create Indirection classes to be able to implement the
17867 IMemoryLocation interface on it.
17869 2002-02-16 Miguel de Icaza <miguel@ximian.com>
17871 * cs-parser.jay (fixed_statement): reference the right statement.
17873 * statement.cs (Fixed.Emit): Finish implementing the fixed
17874 statement for the &x case.
17876 2002-02-14 Miguel de Icaza <miguel@ximian.com>
17878 * class.cs (Property.Define, Method.Define): Remove newslot when
17881 * modifiers.cs: My use of NewSlot when `Abstract' was set was
17882 wrong. NewSlot should only be used if the `new' keyword is present.
17884 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
17885 locating our system dir. Sorry about this.
17887 2002-02-13 Miguel de Icaza <miguel@ximian.com>
17889 * driver.cs (GetSystemDir): Compute correctly the location of our
17890 system assemblies. I was using the compiler directory instead of
17891 the library directory.
17893 2002-02-13 Ravi Pratap <ravi@ximian.com>
17895 * expression.cs (BetterFunction): Put back in what Miguel commented out
17896 since it is the correct fix. The problem is elsewhere ;-)
17898 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
17899 parameters of the parms method are themselves compatible or not !
17901 (StandardConversionExists): Fix very dangerous bug where we were forgetting
17902 to check that a class implements an interface before saying that an implicit
17903 conversion was allowed. Use ImplementsInterface to do the checking.
17905 2002-02-13 Miguel de Icaza <miguel@ximian.com>
17907 * class.cs (Method.Define): Track whether we are an explicit
17908 implementation or not. And only call DefineMethodOverride if we
17909 are an explicit implementation.
17911 (Property.DefineMethod): Ditto.
17913 2002-02-11 Ravi Pratap <ravi@ximian.com>
17915 * expression.cs (BetterFunction): Catch hideous bug which was
17916 preventing us from detecting ambiguous calls due to implicit casts i.e
17919 2002-01-29 Miguel de Icaza <miguel@ximian.com>
17921 * support.cs (Pair): Remove un-needed method. I figured why I was
17922 getting the error in cs-parser.jay, the variable in a foreach loop
17923 is readonly, and the compiler does not really treat this as a variable.
17925 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
17926 instead of EQUALS in grammar.
17928 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
17930 * expression.cs (Unary.DoResolve): Check whether the argument is
17933 2002-01-28 Miguel de Icaza <miguel@ximian.com>
17935 * support.cs: Api for Pair to set a value. Despite the fact that
17936 the variables are public the MS C# compiler refuses to compile
17937 code that accesses the field if the variable is part of a foreach
17940 * statement.cs (Fixed): Begin implementation of the fixed
17943 (Block.AddVariable): Return the VariableInfo on success and null
17944 on failure instead of true/false.
17946 * cs-parser.jay (foreach): Catch errors on variables already
17947 defined (we were ignoring this value before) and properly unwind
17948 the block hierarchy
17950 (fixed_statement): grammar for the fixed statement.
17952 2002-01-25 Miguel de Icaza <miguel@ximian.com>
17954 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
17955 pointer types to be incretemented.
17957 (SizeOf): Implement.
17959 * cs-parser.jay (pointer_member_access): Implement
17960 expr->IDENTIFIER production.
17962 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
17963 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
17966 (Unary): Implement indirection.
17968 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
17969 use in non-unsafe context).
17971 (SimpleName.DoResolve): Check for pointers in field access on safe
17974 (Expression.LoadFromPtr): Factor the load-indirect code in this
17975 function. This was duplicated in UnboxCast and ParameterReference
17977 2002-01-24 Miguel de Icaza <miguel@ximian.com>
17979 * expression.cs (ComposedCast): report an error if a pointer cast
17980 is used in a safe region.
17982 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
17983 pointer type casts in unsafe context.
17985 * codegen.cs (EmitContext): Set up IsUnsafe.
17987 * cs-parser.jay (non_expression_type): Add productions for pointer
17990 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
17991 code. We should not use force into static mode if the method is
17992 not virtual. Fixes bug in MIS
17994 * statement.cs (Do.Emit, While.Emit, For.Emit,
17995 Statement.EmitBoolExpression): Add support to Do and While to
17996 propagate infinite loop as `I do return' semantics.
17998 Improve the For case to also test for boolean constants.
18000 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
18001 to the list of attributes we can add.
18003 Remove `EmitContext' argument.
18005 * class.cs (Method.Define): Apply parameter attributes.
18006 (Constructor.Define): Apply parameter attributes.
18007 (MethodCore.LabelParameters): Move here the core of labeling
18010 * support.cs (ReflectionParameters.ParameterModifier,
18011 InternalParameters.ParameterModifier): Use IsByRef on the type and
18012 only return the OUT bit for these parameters instead of in/out/ref
18015 This is because I miss-understood things. The ParameterInfo.IsIn
18016 and IsOut represent whether the parameter has the [In] and [Out]
18019 2002-01-22 Miguel de Icaza <miguel@ximian.com>
18021 * ecore.cs (FieldExpr.Emit): Release temporaries.
18023 * assign.cs (LocalTemporary.Release): new function.
18025 * codegen.cs (EmitContext.GetTemporaryStorage,
18026 EmitContext.FreeTemporaryStorage): Rework the way we deal with
18027 temporary storage. Now we can "put back" localbuilders when we
18030 2002-01-21 Miguel de Icaza <miguel@ximian.com>
18032 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
18033 need to make a copy of the variable to generate verifiable code.
18035 2002-01-19 Miguel de Icaza <miguel@ximian.com>
18037 * driver.cs: Compute dynamically the system directory.
18039 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
18040 Slower, but more generally useful. Used by the abstract
18041 registering implementation.
18043 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
18044 the rules for the special rule on Type/instances. First check if
18045 we have the same name, and if so, try that special static path
18046 rather than the instance path.
18048 2002-01-18 Miguel de Icaza <miguel@ximian.com>
18050 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
18053 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
18054 Enum, ValueType, Delegate or Array for non-corlib compiles.
18056 * cs-tokenizer.cs: Catch long identifiers (645)
18058 * typemanager.cs (IndexerPropetyName): Ravi never tested this
18061 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
18062 fix, we were returning too early, so we were not registering
18063 pending methods from abstract classes.
18065 Do not register pending methods if the class is abstract.
18067 * expression.cs (Conditional.DoResolve): Report circular implicit
18068 conversions when we neecd to compute it for conditional
18071 (Is.DoResolve): If the expression is always of the provided type,
18072 flag warning 183. If the expression can not ever be of the
18073 provided type flag warning 184.
18075 * class.cs: Catch 169 as well.
18077 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
18080 2002-01-18 Nick Drochak <ndrochak@gol.com>
18082 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
18084 2002-01-17 Miguel de Icaza <miguel@ximian.com>
18086 * interface.cs: (PopulateMethod): Check for pointers being defined
18087 only if the unsafe context is active.
18088 (PopulateProperty): ditto.
18089 (PopulateIndexer): ditto.
18091 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
18092 specified. If pointers are present, make sure that they are
18093 present in an unsafe context.
18094 (Constructor, Constructor.Define): ditto.
18095 (Field, Field.Define): ditto.
18096 (Property, Property.Define): ditto.
18097 (Event, Event.Define): ditto.
18099 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
18100 hashtable if there are classes or structs defined.
18102 * expression.cs (LocalVariableReference.DoResolve): Simplify this
18103 code, as the constant resolution moved.
18105 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
18106 the metadata, so we can flag error 133.
18108 * decl.cs (MemberCore.UnsafeOK): New function to test that a
18109 pointer is being declared in an unsafe context.
18111 2002-01-16 Miguel de Icaza <miguel@ximian.com>
18113 * modifiers.cs (Modifiers.Check): Require a Location argument.
18114 Report error 227 for Unsafe use.
18116 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
18118 * statement.cs (For.Emit): If the test is null, then report that
18119 we do `return', as we wont reach anything afterwards.
18121 (Switch.SwitchGoverningType): Track the expression that matched
18124 * driver.cs: Allow negative numbers as an error code to flag.
18126 * cs-parser.jay: Handle 1551.
18128 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
18130 2002-01-15 Miguel de Icaza <miguel@ximian.com>
18132 * cs-parser.jay: Report 1518 (type declaration can only contain
18133 class, struct, interface, enum or delegate)
18135 (switch_label): Report 1523 (keywords `case' or `default' must
18138 (opt_switch_sections): Report 1522 (empty switch)
18140 * driver.cs: Report 1515 (response file specified multiple times)
18141 Report 1516 (Source file specified multiple times).
18143 * expression.cs (Argument.Resolve): Signal 1510
18145 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
18146 access not allowed in static code)
18148 2002-01-11 Ravi Pratap <ravi@ximian.com>
18150 * typemanager.cs (IsPointerType): Utility method which we are going
18153 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
18154 the object type, so we take care of that.
18156 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
18158 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
18159 added to non-params parameters :-)
18161 * typemanager.cs (CSharpName): Include 'void' type too.
18163 (void_ptr_type): Include in the set of core types.
18165 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
18168 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
18171 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
18172 completely forgotten about it.
18174 2002-01-10 Ravi Pratap <ravi@ximian.com>
18176 * cs-parser.jay (pointer_type): Add. This begins our implementation
18177 of parsing rules for unsafe code.
18179 (unsafe_statement): Implement.
18181 (embedded_statement): Modify to include the above.
18183 * statement.cs (Unsafe): Implement new class for unsafe blocks.
18185 * codegen.cs (EmitContext.InUnsafe): Add. This determines
18186 if the current context is an unsafe one.
18188 * cs-parser.jay (local_variable_pointer_type): Since local variable types
18189 are handled differently, we need separate rules for them.
18191 (local_variable_declaration): Update to use local_variable_pointer_type
18192 to allow variable declarations of unmanaged pointer types.
18194 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
18195 in unsafe contexts.
18197 * ../errors/cs0214.cs : Add.
18199 2002-01-16 Nick Drochak <ndrochak@gol.com>
18201 * makefile: remove 'response' file when cleaning.
18203 2002-01-15 Miguel de Icaza <miguel@ximian.com>
18205 * cs-parser.jay: Report 1524.
18207 2002-01-14 Miguel de Icaza <miguel@ximian.com>
18209 * typemanager.cs (RegisterMethod): drop checking if we have
18210 registered this from here
18212 2002-01-12 Miguel de Icaza <miguel@ximian.com>
18214 * class.cs (Method.EmitDestructor): Implement calling our base
18217 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
18218 value of InFinally.
18220 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
18221 this routine and will wrap the call in a try/catch block. Deal
18224 2002-01-11 Miguel de Icaza <miguel@ximian.com>
18226 * ecore.cs (Expression.MemberLookup): instead of taking a
18227 parameter `same_type' that was used to tell whether we could
18228 access private members we compute our containing type from the
18231 (FieldExpr): Added partial support for volatile fields. This does
18232 not work for volatile fields exposed from assemblies, as I can not
18233 figure out how to extract the modreq from it.
18235 Updated all the source files to use this.
18237 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
18238 because it is referenced by MemberLookup very often.
18240 2002-01-09 Ravi Pratap <ravi@ximian.com>
18242 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
18243 TypeBuilder.GetCustomAttributes to retrieve what we need.
18245 Get rid of redundant default_member_attr_type as this is the same as
18246 default_member_type which already exists.
18248 * interface.cs, attribute.cs : Update accordingly.
18250 2002-01-08 Miguel de Icaza <miguel@ximian.com>
18252 * typemanager.cs: Enable IndexerPropertyName again. It does not
18253 work for TYpeBuilders though. Ravi, can you please fix this?
18255 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
18257 * expression.cs (Argument.Emit): Handle the case of ref objects
18258 being passed to ref functions;
18260 (ParameterReference.EmitLoad): Loads the content of the pointer
18261 without dereferencing.
18263 2002-01-07 Miguel de Icaza <miguel@ximian.com>
18265 * cs-tokenizer.cs: Implemented the pre-processing expressions.
18267 2002-01-08 Ravi Pratap <ravi@ximian.com>
18269 * class.cs (Indexer.DefineMethod): Incorporate the interface
18270 type in the name of the method if we are doing explicit interface
18273 * expression.cs (ConversionExists): Remove as it is completely obsolete.
18275 (BetterConversion): Fix extremely trivial bug where we were referring to
18276 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
18279 * ../errors/bug16.cs : Add although we have fixed it.
18281 2002-01-07 Miguel de Icaza <miguel@ximian.com>
18283 * expression.cs (BaseIndexer): Begin implementation.
18285 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
18287 * cs-parser.jay (indexer_declarator): Use qualified_identifier
18288 production directly to remove a shift/reduce, and implement
18289 explicit interface implementation.
18291 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
18292 after a floating point suffix.
18294 * expression.cs (DoNumericPromotions): Improved the conversion for
18295 uint/uint. If we have a constant, we avoid doing a typecast to a
18298 * class.cs (Indexer): Implement explicit interface implementation
18301 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
18303 * class.cs: make the default instance constructor public and hidebysig.
18305 2001-01-03 Ravi Pratap <ravi@ximian.com>
18307 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
18308 so we can call it from elsewhere.
18310 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
18311 we emit it internally if the class has a defined indexer; otherwise the user
18312 emits it by decorating the class definition with the DefaultMemberAttribute.
18314 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
18315 attribute is not used on a type which defines an indexer.
18317 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
18318 character when we skip whitespace.
18320 * ../errors/cs0646.cs : Add.
18322 2002-01-03 Miguel de Icaza <miguel@ximian.com>
18324 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
18327 * makefile: Add practical target `mcs3.exe' which builds the third
18328 generation compiler.
18330 * expression.cs (New): Fix structures constructor calling.
18332 * class.cs (Property, Method, Indexer): Emit Final flag on the
18333 method if we are an interface implementation and we are not
18336 * ecore.cs (PropertyExpr): New public field `IsBase', tells
18337 whether this property is referencing a `base' method.
18339 * expression.cs (Invocation.EmitCall): take an extra argument:
18340 is_base, this is used to determine whether the `call' or
18341 `callvirt' opcode should be used.
18344 * delegate.cs: update EmitCall.
18346 * class.cs (Method.Define): Set NewSlot for the cases where we are
18347 not implementing an interface method.
18349 (Property.Define): ditto.
18351 2002-01-02 Miguel de Icaza <miguel@ximian.com>
18353 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
18354 'r'. Allows mcs to parse itself fully.
18356 2002-01-02 Ravi Pratap <ravi@ximian.com>
18358 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
18359 of the number of initializers that require the InitializeArray method.
18361 (CheckIndices): Store the Expression in all cases - not the plain value. Also
18362 update the above field where necessary.
18364 (MakeByteBlob): Update accordingly.
18366 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
18369 (EmitDynamicInitializers): Update in accordance with the new optimization.
18371 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
18372 same OpCode applies.
18374 * cs-parser.jay : Fix some glaring errors I introduced.
18376 2002-01-01 Ravi Pratap <ravi@ximian.com>
18378 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
18379 so that we can check for name clashes there too.
18381 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
18382 for interface indexers.
18384 * interfaces.cs (Define): Emit the default member attribute.
18386 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
18387 variable was being referred to while setting the value ;-)
18389 2002-01-01 Miguel de Icaza <miguel@ximian.com>
18391 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
18392 byte-by-byte information when we know the data is zero.
18394 Make the block always a multiple of 4, because
18395 DefineInitializedData has a bug.
18397 * assign.cs: Fix, we should assign from the temporary, not from
18400 * expression.cs (MakeByteBlob): Fix my incorrect code.
18402 2001-12-31 Miguel de Icaza <miguel@ximian.com>
18404 * typemanager.cs (EnumToUnderlying): This function is used to get
18405 the underlying type from an enumeration, because it does not
18408 * constant.cs: Use the I4_S form for values between -128 and 127.
18410 * statement.cs (Block.LookupLabel): Looks up a label.
18411 (Block): Drop support for labeled blocks.
18413 (LabeledStatement): New kind of statement that represents a label
18416 (Goto): Finally implement this bad boy.
18418 * cs-parser.jay: Update to reflect new mechanism to implement
18421 2001-12-30 Miguel de Icaza <miguel@ximian.com>
18423 * codegen.cs (EmitContext.This): a codegen property that keeps the
18424 a single instance of this instead of creating many different this
18427 * delegate.cs (Delegate.DoResolve): Update to use the property;
18429 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
18431 * expression.cs (BaseAccess.DoResolve): Ditto.
18433 2001-12-29 Ravi Pratap <ravi@ximian.com>
18435 * typemanager.cs (methodimpl_attr_type): Add to hold the type
18436 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
18438 (InitCoreTypes): Update accordingly.
18440 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
18441 so we can quickly store the state.
18443 (ApplyAttributes): Set the correct implementation flags
18444 for InternalCall methods.
18446 2001-12-29 Miguel de Icaza <miguel@ximian.com>
18448 * expression.cs (EmitCall): if a method is not virtual, then do
18449 not use callvirt on it.
18451 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
18452 user defined stuff) requires the use of stobj, which takes an
18453 address on the stack instead of an array and an index. So emit
18454 the Ldelema operation for it.
18456 (EmitStoreOpcode): Use stobj for valuetypes.
18458 (UnaryMutator.EmitCode): Use the right 1 value depending on
18459 whether we are dealing with int64/uint64, float or doubles.
18461 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
18462 constructors that I implemented last night.
18464 (Constructor.IsDefault): Fix to work properly for static
18467 * cs-parser.jay (CheckDef): report method signature errors.
18468 Update error number 103 to be 132.
18470 * decl.cs: New AdditionResult enumeration value: MethodExists.
18471 Although we do this check for methods later on in the semantic
18472 analysis, catching repeated default constructors is so easy that
18473 we catch these here.
18475 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
18478 (ParameterReference.EmitAssign, Emit): handle
18481 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
18482 (ArrayAccess.EmitStoreOpcode): ditto.
18484 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
18486 * expression.cs (MakeByteBlob): Complete all the missing types
18487 (uint, short, ushort, byte, sbyte)
18489 * class.cs: Only init instance field initializers on instance
18492 Rename `constructors' to instance_constructors.
18494 (TypeContainer.AddConstructor): Only add constructors to the list
18495 if it is not static.
18497 Make sure that we handle default_static_constructor independently
18498 everywhere where we handle instance_constructors
18500 2001-12-28 Miguel de Icaza <miguel@ximian.com>
18502 * class.cs: Do not lookup or create a base initializer for a
18503 static constructor.
18505 (ConstructorInitializer.Resolve): use the proper type to lookup
18508 * cs-parser.jay: Report error 1585 (modifiers between type and name).
18510 * enum.cs, interface.cs: Remove CloseType, this is taken care by
18513 * decl.cs: CloseType is now an virtual method, the default
18514 implementation just closes this type.
18516 2001-12-28 Ravi Pratap <ravi@ximian.com>
18518 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
18519 to PreserveSig by default. Also emit HideBySig on such methods.
18521 Basically, set the defaults to standard values.
18523 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
18524 argument, if candidate is better, it can't be worse than the best !
18526 (Invocation): Re-write bits to differentiate between methods being
18527 applicable in their expanded form and their normal form - for params
18530 Get rid of use_standard everywhere as only standard conversions are allowed
18531 in overload resolution.
18533 More spec conformance.
18535 2001-12-27 Miguel de Icaza <miguel@ximian.com>
18537 * driver.cs: Add --timestamp, to see where the compiler spends
18540 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
18541 `this' in static code.
18543 (SimpleName.DoResolve): Implement in terms of a helper function
18544 that allows static-references to be passed upstream to
18547 (Expression.ResolveWithSimpleName): Resolve specially simple
18548 names when called by MemberAccess to implement the special
18551 (Expression.ImplicitReferenceConversion): Handle conversions from
18552 Null to reference types before others, as Null's type is
18555 * expression.cs (Invocation.EmitCall): Handle the special case of
18556 calling methods declared on a reference type from a ValueType
18557 (Base classes System.Object and System.Enum)
18559 (MemberAccess.Resolve): Only perform lookups on Enumerations if
18560 the left hand side is a TypeExpr, not on every enumeration.
18562 (Binary.Resolve): If types are reference types, then do a cast to
18563 object on operators != and == of both arguments.
18565 * typemanager.cs (FindMembers): Extract instance and static
18566 members if requested.
18568 * interface.cs (PopulateProperty): Use void_type instead of null
18569 as the return type for the setter method.
18571 (PopulateIndexer): ditto.
18573 2001-12-27 Ravi Pratap <ravi@ximian.com>
18575 * support.cs (ReflectionParameters): Fix minor bug where we
18576 were examining the wrong parameter for the ParamArray attribute.
18578 Cope with requests for the type of the parameter at position
18579 greater than the params parameter's. We now return the element
18580 type of the params array as that makes more sense.
18582 * expression.cs (Invocation.IsParamsMethodApplicable): Update
18583 accordingly as we no longer have to extract the element type
18586 (Invocation.OverloadResolve): Update.
18588 2001-12-27 Miguel de Icaza <miguel@ximian.com>
18590 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
18591 against IEnumerator, test whether the return value is a descendant
18592 of the IEnumerator interface.
18594 * class.cs (Indexer.Define): Use an auxiliary method to implement
18595 the other bits of the method definition. Begin support for
18596 explicit interface implementation.
18598 (Property.DefineMethod): Use TypeManager.void_type instead of null
18599 for an empty return value.
18601 2001-12-26 Miguel de Icaza <miguel@ximian.com>
18603 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
18604 dealing with a FieldExpr which is composed of a FieldBuilder, in
18605 the code path we did extract the constant, but we should have
18606 obtained the underlying value to be able to cast it (otherwise we
18607 end up in an infinite loop, this is what Ravi was running into).
18609 (ArrayCreation.UpdateIndices): Arrays might be empty.
18611 (MemberAccess.ResolveMemberAccess): Add support for section
18612 14.5.4.1 that deals with the special case of E.I when E is a type
18613 and something else, that I can be a reference to a static member.
18615 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
18616 handle a particular array type to create byte blobs, it is just
18617 something we dont generate byteblobs for.
18619 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
18622 * location.cs (Push): remove the key from the hashtable that we
18623 are about to add. This happens for empty files.
18625 * driver.cs: Dispose files after we have parsed them.
18627 (tokenize): new function that only runs the tokenizer on its
18628 input, for speed testing.
18630 2001-12-26 Ravi Pratap <ravi@ximian.com>
18632 * class.cs (Event.Define): Define the private field only if there
18633 are no accessors defined.
18635 * expression.cs (ResolveMemberAccess): If there is no associated
18636 field with the event, that means we have an event defined with its
18637 own accessors and we should flag error cs0070 since transforming
18638 ourselves into a field is not valid in that case.
18640 * ecore.cs (SimpleName.DoResolve): Same as above.
18642 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
18643 and charset to sane values.
18645 2001-12-25 Ravi Pratap <ravi@ximian.com>
18647 * assign.cs (DoResolve): Perform check on events only if they
18648 are being accessed outside the declaring type.
18650 * cs-parser.jay (event_declarations): Update rules to correctly
18651 set the type of the implicit parameter etc.
18653 (add_accessor, remove_accessor): Set current local parameters.
18655 * expression.cs (Binary): For delegate addition and subtraction,
18656 cast the return value from the method into the appropriate delegate
18659 2001-12-24 Ravi Pratap <ravi@ximian.com>
18661 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
18662 of these as the workaround is unnecessary.
18664 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
18665 delegate data - none of that is needed at all.
18667 Re-write bits to extract the instance expression and the delegate method
18670 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
18673 * attribute.cs (ApplyAttributes): New method to take care of common tasks
18674 of attaching attributes instead of duplicating code everywhere.
18676 * everywhere : Update code to do attribute emission using the above method.
18678 2001-12-23 Miguel de Icaza <miguel@ximian.com>
18680 * expression.cs (IsParamsMethodApplicable): if there are not
18681 parameters, return immediately.
18683 * ecore.cs: The 0 literal can be implicity converted to an enum
18686 (SimpleName.DoResolve): First lookup the type, then lookup the
18689 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
18690 want to get its address. If the InstanceExpression is not
18691 addressable, store the result in a temporary variable, then get
18694 * codegen.cs: Only display 219 errors on warning level or above.
18696 * expression.cs (ArrayAccess): Make it implement the
18697 IMemoryLocation interface.
18699 (Binary.DoResolve): handle the operator == (object a, object b)
18700 and operator != (object a, object b) without incurring into a
18701 BoxedCast (because 5 != o should never be performed).
18703 Handle binary enumerator operators.
18705 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
18706 value type, otherwise use Ldelem_ref.
18708 Use precomputed names;
18710 (AddressOf): Implement address of
18712 * cs-parser.jay (labeled_statement): Fix recursive block
18713 addition by reworking the production.
18715 * expression.cs (New.DoEmit): New has a special case:
18717 If we are dealing with a ValueType, we have a few
18718 situations to deal with:
18720 * The target of New is a ValueType variable, that is
18721 easy, we just pass this as the variable reference
18723 * The target of New is being passed as an argument,
18724 to a boxing operation or a function that takes a
18727 In this case, we need to create a temporary variable
18728 that is the argument of New.
18731 2001-12-23 Ravi Pratap <ravi@ximian.com>
18733 * rootcontext.cs (LookupType): Check that current_type is not null before
18734 going about looking at nested types.
18736 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
18737 not implement the IAssignMethod interface any more.
18739 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
18740 where we tranform them into FieldExprs if they are being resolved from within
18741 the declaring type.
18743 * ecore.cs (SimpleName.DoResolve): Do the same here.
18745 * assign.cs (DoResolve, Emit): Clean up code considerably.
18747 * ../errors/bug10.cs : Add.
18749 * ../errors/cs0070.cs : Add.
18751 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
18753 * assign.cs : Get rid of EventIsLocal everywhere.
18755 2001-12-23 Miguel de Icaza <miguel@ximian.com>
18757 * ecore.cs (ConvertIntLiteral): finished the implementation.
18759 * statement.cs (SwitchLabel): Convert the value we are using as a
18760 key before looking up the table.
18762 2001-12-22 Miguel de Icaza <miguel@ximian.com>
18764 * codegen.cs (EmitTopBlock): Require a Location argument now.
18766 * cs-parser.jay (constructor_declarator): We need to setup
18767 current_local_parameters before we parse the
18768 opt_constructor_initializer, to allow the variables to be bound
18769 to the constructor arguments.
18771 * rootcontext.cs (LookupType): First lookup nested classes in our
18772 class and our parents before we go looking outside our class.
18774 * expression.cs (ConstantFold): Extract/debox the values at the
18777 * rootcontext.cs (EmitCode): Resolve the constants first before we
18778 resolve the types. This is not really needed, but it helps debugging.
18780 * statement.cs: report location.
18782 * cs-parser.jay: pass location to throw statement.
18784 * driver.cs: Small bug fix.
18786 * report.cs: Updated format to be 4-zero filled digits.
18788 2001-12-22 Ravi Pratap <ravi@ximian.com>
18790 * expression.cs (CheckIndices): Fix minor bug where the wrong
18791 variable was being referred to ;-)
18793 (DoEmit): Do not call EmitStaticInitializers when the
18794 underlying type is System.Object.
18796 2001-12-21 Ravi Pratap <ravi@ximian.com>
18798 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
18799 and do the usual workaround for SRE.
18801 * class.cs (MyEventBuilder.EventType): New member to get at the type
18802 of the event, quickly.
18804 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
18806 * assign.cs (Assign.DoResolve): Handle the case when the target
18807 is an EventExpr and perform the necessary checks.
18809 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
18812 (SimpleName.MemberStaticCheck): Include check for EventExpr.
18814 (EventExpr): Set the type in the constructor itself since we
18815 are meant to be born fully resolved.
18817 (EventExpr.Define): Revert code I wrote earlier.
18819 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
18820 instance expression is null. The instance expression is a This in that case
18821 or a null, depending on whether it is a static method or not.
18823 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
18824 refers to more than one method.
18826 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
18827 and accordingly flag errors.
18829 2001-12-21 Miguel de Icaza <miguel@ximian.com>
18831 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
18833 2001-12-22 Miguel de Icaza <miguel@ximian.com>
18835 * location.cs (ToString): Provide useful rutine.
18837 2001-12-21 Miguel de Icaza <miguel@ximian.com>
18839 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
18840 objects, return the actual integral boxed.
18842 * statement.cs (SwitchLabel): define an ILLabel for each
18845 (Switch.CheckSwitch): If the value is a Literal, extract
18846 the underlying literal.
18848 Also in the unused hashtable we had, add the SwitchLabel so we can
18849 quickly look this value up.
18851 * constant.cs: Implement a bunch of new constants. Rewrite
18852 Literal based on this. Made changes everywhere to adapt to this.
18854 * expression.cs (Expression.MakeByteBlob): Optimize routine by
18855 dereferencing array only once, and also copes with enumrations.
18857 bytes are two bytes wide, not one.
18859 (Cast): Perform constant conversions.
18861 * ecore.cs (TryImplicitIntConversion): Return literals instead of
18862 wrappers to the literals here.
18864 * expression.cs (DoNumericPromotions): long literals can converted
18865 to ulong implicity (this is taken care of elsewhere, but I was
18866 missing this spot).
18868 * ecore.cs (Expression.Literalize): Make the return type Literal,
18869 to improve type checking.
18871 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
18873 2001-12-20 Miguel de Icaza <miguel@ximian.com>
18875 * literal.cs: Revert code from ravi that checked the bounds. The
18876 bounds are sane by the definition of the type itself.
18878 * typemanager.cs: Fix implementation of ImplementsInterface. We
18879 need to actually look up in our parent hierarchy for interfaces
18882 * const.cs: Use the underlying type for enumerations
18884 * delegate.cs: Compute the basename for the delegate creation,
18885 that should fix the delegate test case, and restore the correct
18886 Type Lookup semantics in rootcontext
18888 * rootcontext.cs: Revert Ravi's last patch. The correct way of
18889 referencing a nested type with the Reflection API is using the "+"
18892 * cs-parser.jay: Do not require EOF token at the end.
18894 2001-12-20 Ravi Pratap <ravi@ximian.com>
18896 * rootcontext.cs (LookupType): Concatenate type names with
18897 a '.' instead of a '+' The test suite passes again.
18899 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
18900 field of the enumeration.
18902 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
18903 the case when the member is an EventExpr.
18905 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
18906 static has an associated instance expression.
18908 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
18910 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
18912 * class.cs (Event.Define): Register event and perform appropriate checks
18915 We define the Add and Remove methods even if the use provides none because
18916 in that case, we provide default implementations ourselves.
18918 Define a private field of the type of the event. This is done by the CSC compiler
18919 and we should be doing it too ;-)
18921 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
18922 More methods we use in code we generate.
18924 (multicast_delegate_type, delegate_type): Two separate types since the distinction
18927 (InitCoreTypes): Update accordingly for the above.
18929 * class.cs (Event.Emit): Generate code for default accessors that we provide
18931 (EmitDefaultMethod): Do the job in the above.
18933 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
18936 2001-12-20 Miguel de Icaza <miguel@ximian.com>
18938 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
18939 builders even if we were missing one.
18941 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
18942 pass the Basename as our class name instead of the Name. The
18943 basename will be correctly composed for us.
18945 * parameter.cs (Paramters): Now takes a Location argument.
18947 * decl.cs (DeclSpace.LookupType): Removed convenience function and
18948 make all the code call directly LookupType in RootContext and take
18949 this chance to pass the Location information everywhere.
18951 * Everywhere: pass Location information.
18953 2001-12-19 Miguel de Icaza <miguel@ximian.com>
18955 * class.cs (Constructor.Define): Updated way of detecting the
18956 length of the parameters.
18958 (TypeContainer.DefineType): Use basename as the type name for
18961 (TypeContainer.Define): Do not recursively define types here, as
18962 definition is taken care in order by the RootContext.
18964 * tree.cs: Keep track of namespaces in a per-file basis.
18966 * parameter.cs (Parameter.ComputeSignature): Update to use
18969 (Parameters.GetSignature): ditto.
18971 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
18972 instead of a TypeContainer.
18974 (Interface.SemanticAnalysis): Use `this' instead of our parent to
18975 resolve names. Because we need to be resolve in our context, not
18978 * driver.cs: Implement response files.
18980 * class.cs (TypeContainer.DefineType): If we are defined, do not
18981 redefine ourselves.
18983 (Event.Emit): Emit the code for add/remove handlers.
18984 (Event.Define): Save the MethodBuilders for add/remove.
18986 * typemanager.cs: Use pair here too.
18988 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
18989 DictionaryEntry requires the first argument to be non-null.
18991 (enum_declaration): Compute full name for registering the
18994 (delegate_declaration): Instead of using
18995 formal_parameter_list, use opt_formal_parameter_list as the list
18998 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
18999 (EventParsing): New property that controls whether `add' and
19000 `remove' are returned as tokens or identifiers (for events);
19002 2001-12-19 Ravi Pratap <ravi@ximian.com>
19004 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
19005 use MyEventBuilder only and let it wrap the real builder for us.
19007 (MyEventBuilder): Revamp constructor etc.
19009 Implement all operations that we perform on EventBuilder in precisely the same
19012 (FindMembers): Update to use the EventBuilder member.
19014 (Event.Emit): Update accordingly.
19016 2001-12-18 Ravi Pratap <ravi@ximian.com>
19018 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
19019 by calling the appropriate methods.
19021 (GetCustomAttributes): Make stubs as they cannot possibly do anything
19024 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
19026 2001-12-17 Ravi Pratap <ravi@ximian.com>
19028 * delegate.cs (Delegate.Populate): Check that the return type
19029 and various parameters types are indeed accessible.
19031 * class.cs (Constructor.Define): Same here.
19033 (Field.Define): Ditto.
19035 (Event.Define): Ditto.
19037 (Operator.Define): Check that the underlying Method defined itself
19038 correctly - so it's MethodBuilder should not be null.
19040 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
19041 expression happens to be null.
19043 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
19044 members but as of now we don't seem to be able to do anything really useful with it.
19046 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
19047 not the EventBuilder.
19049 2001-12-18 Miguel de Icaza <miguel@ximian.com>
19051 * cs-tokenizer.cs: Add support for defines.
19052 Add support for #if, #elif, #else, #endif
19054 (eval_var): evaluates a variable.
19055 (eval): stubbed for evaluating functions.
19057 * cs-parser.jay: Pass the defines information
19059 * driver.cs: Add --define command line option.
19061 * decl.cs: Move MemberCore here.
19063 Make it the base class for DeclSpace. This allows us to catch and
19064 report 108 and 109 for everything now.
19066 * class.cs (TypeContainer.Define): Extract all the members
19067 before populating and emit the warning 108 (new keyword required
19068 to override) instead of having each member implement this.
19070 (MemberCore.Define): New abstract method, we will be using this in
19071 the warning reporting engine in Populate.
19073 (Operator.Define): Adjust to new MemberCore protocol.
19075 * const.cs (Const): This does not derive from Expression, it is a
19076 temporary object we use to create fields, it is a MemberCore.
19078 * class.cs (Method.Define): Allow the entry point to be in a
19081 * driver.cs: Rewrite the argument handler to clean it up a bit.
19083 * rootcontext.cs: Made it just an auxiliary namespace feature by
19084 making everything static.
19086 * driver.cs: Adapt code to use RootContext type name instead of
19089 * delegate.cs: Remove RootContext argument.
19091 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
19094 * class.cs (Event.Define): The lookup can fail.
19096 * cs-tokenizer.cs: Begin implementation of pre-procesor.
19098 * expression.cs: Resolve the this instance before invoking the code.
19100 2001-12-17 Miguel de Icaza <miguel@ximian.com>
19102 * cs-parser.jay: Add a production in element_access that allows
19103 the thing to become a "type" reference. This way we can parse
19104 things like "(string [])" as a type.
19106 Note that this still does not handle the more complex rules of
19110 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
19112 * ecore.cs: (CopyNewMethods): new utility function used to
19113 assemble the list of methods from running FindMembers.
19115 (MemberLookup): Rework FindMembers so that
19117 2001-12-16 Miguel de Icaza <miguel@ximian.com>
19119 * class.cs (TypeContainer): Remove Delegates who fail to be
19122 * delegate.cs (Populate): Verify that we dont get null return
19123 values. TODO: Check for AsAccessible.
19125 * cs-parser.jay: Use basename to emit error 574 (destructor should
19126 have the same name as container class), not the full name.
19128 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
19129 possible representation.
19131 Also implements integer type suffixes U and L.
19133 2001-12-15 Miguel de Icaza <miguel@ximian.com>
19135 * expression.cs (ArrayCreation.DoResolve): We need to do the
19136 argument resolution *always*.
19138 * decl.cs: Make this hold the namespace. Hold the root context as
19140 (LookupType): Move here.
19142 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
19144 * location.cs (Row, Name): Fixed the code, it was always returning
19145 references to the first file.
19147 * interface.cs: Register properties defined through interfaces.
19149 * driver.cs: Add support for globbing on the command line
19151 * class.cs (Field): Make it derive from MemberCore as well.
19154 2001-12-15 Ravi Pratap <ravi@ximian.com>
19156 * class.cs (Event::Define): Check that the type of the event is a delegate
19157 type else flag error #66.
19159 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
19162 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
19163 values of EntryPoint, CharSet etc etc.
19165 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
19167 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
19168 be null and we should ignore this. I am not sure if this is really clean. Apparently,
19169 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
19170 which needs this to do its work.
19172 * ../errors/cs0066.cs : Add.
19174 2001-12-14 Miguel de Icaza <miguel@ximian.com>
19176 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
19179 * class.cs: (MethodSignature.MethodSignature): Removed hack that
19180 clears out the parameters field.
19181 (MemberSignatureCompare): Cleanup
19183 (MemberCore): New base class used to share code between MethodCore
19186 (RegisterRequiredImplementations) BindingFlags.Public requires
19187 either BindingFlags.Instace or Static. Use instance here.
19189 (Property): Refactored code to cope better with the full spec.
19191 * parameter.cs (GetParameterInfo): Return an empty array instead
19194 * class.cs (Property): Abstract or extern properties have no bodies.
19196 * parameter.cs (GetParameterInfo): return a zero-sized array.
19198 * class.cs (TypeContainer.MethodModifiersValid): Move all the
19199 method modifier validation to the typecontainer so we can reuse
19200 this on properties.
19202 (MethodCore.ParameterTypes): return an empty sized array of types.
19204 (Property.Define): Test property modifier validity.
19206 Add tests for sealed/override too.
19208 (Method.Emit): abstract or extern methods have no bodies.
19210 2001-12-14 Ravi Pratap <ravi@ximian.com>
19212 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
19215 (Method::Define, ::Emit): Modify accordingly.
19217 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
19219 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
19221 * makefile: Pass in /unsafe.
19223 2001-12-13 Miguel de Icaza <miguel@ximian.com>
19225 * class.cs (MakeKey): Kill routine.
19227 * class.cs (TypeContainer.Define): Correctly define explicit
19228 method implementations (they require the full interface name plus
19231 * typemanager.cs: Deply the PtrHashtable here and stop using the
19232 lame keys. Things work so much better.
19234 This of course broke everyone who depended on `RegisterMethod' to
19235 do the `test for existance' test. This has to be done elsewhere.
19237 * support.cs (PtrHashtable): A hashtable that avoid comparing with
19238 the object stupid Equals method (because, that like fails all over
19239 the place). We still do not use it.
19241 * class.cs (TypeContainer.SetRequiredInterface,
19242 TypeContainer.RequireMethods): Killed these two routines and moved
19243 all the functionality to RegisterRequiredImplementations.
19245 (TypeContainer.RegisterRequiredImplementations): This routine now
19246 registers all the implementations required in an array for the
19247 interfaces and abstract methods. We use an array of structures
19248 which can be computed ahead of time to reduce memory usage and we
19249 also assume that lookups are cheap as most classes will not
19250 implement too many interfaces.
19252 We also avoid creating too many MethodSignatures.
19254 (TypeContainer.IsInterfaceMethod): Update and optionally does not
19255 clear the "pending" bit if we find that there are problems with
19258 (TypeContainer.VerifyPendingMethods): Update to report errors of
19259 methods that look like implementations but are not.
19261 (TypeContainer.Define): Add support for explicit interface method
19264 2001-12-12 Miguel de Icaza <miguel@ximian.com>
19266 * typemanager.cs: Keep track of the parameters here instead of
19267 being a feature of the TypeContainer.
19269 * class.cs: Drop the registration of parameters here, as
19270 InterfaceMethods are also interface declarations.
19272 * delegate.cs: Register methods with the TypeManager not only with
19273 the TypeContainer. This code was buggy.
19275 * interface.cs: Full registation here.
19277 2001-12-11 Miguel de Icaza <miguel@ximian.com>
19279 * expression.cs: Remove reducer for binary expressions, it can not
19282 * const.cs: Put here the code that used to go into constant.cs
19284 * constant.cs: Put here the code for constants, this is a new base
19285 class for Literals.
19287 * literal.cs: Make Literal derive from Constant.
19289 2001-12-09 Miguel de Icaza <miguel@ximian.com>
19291 * statement.cs (Return.Emit): Report error 157 if the user
19292 attempts to return from a finally block.
19294 (Return.Emit): Instead of emitting a return, jump to the end of
19297 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
19298 LocalBuilder to store the result of the function. ReturnLabel is
19299 the target where we jump.
19302 2001-12-09 Radek Doulik <rodo@ximian.com>
19304 * cs-parser.jay: remember alias in current namespace
19306 * ecore.cs (SimpleName::DoResolve): use aliases for types or
19309 * class.cs (LookupAlias): lookup alias in my_namespace
19311 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
19313 (LookupAlias): lookup alias in this and if needed in parent
19316 2001-12-08 Miguel de Icaza <miguel@ximian.com>
19320 * rootcontext.cs: (ModuleBuilder) Made static, first step into
19321 making things static. I need this to avoid passing the
19322 TypeContainer when calling ParameterType.
19324 * support.cs (InternalParameters.ParameterType): Remove ugly hack
19325 that did string manipulation to compute the type and then call
19326 GetType. Use Parameter.ParameterType instead.
19328 * cs-tokenizer.cs: Consume the suffix for floating values.
19330 * expression.cs (ParameterReference): figure out whether this is a
19331 reference parameter or not. Kill an extra variable by computing
19332 the arg_idx during emission.
19334 * parameter.cs (Parameters.GetParameterInfo): New overloaded
19335 function that returns whether a parameter is an out/ref value or not.
19337 (Parameter.ParameterType): The type of the parameter (base,
19338 without ref/out applied).
19340 (Parameter.Resolve): Perform resolution here.
19341 (Parameter.ExternalType): The full type (with ref/out applied).
19343 * statement.cs (Using.Emit, Using.EmitExpression): Implement
19344 support for expressions on the using statement.
19346 2001-12-07 Miguel de Icaza <miguel@ximian.com>
19348 * statement.cs (Using.EmitLocalVariableDecls): Split the
19349 localvariable handling of the using statement.
19351 (Block.EmitMeta): Keep track of variable count across blocks. We
19352 were reusing slots on separate branches of blocks.
19354 (Try.Emit): Emit the general code block, we were not emitting it.
19356 Check the type of the declaration to be an IDisposable or
19357 something that can be implicity converted to it.
19359 Emit conversions if required.
19361 * ecore.cs (EmptyExpression): New utility class.
19362 (Expression.ImplicitConversionExists): New utility function.
19364 2001-12-06 Miguel de Icaza <miguel@ximian.com>
19366 * statement.cs (Using): Implement.
19368 * expression.cs (LocalVariableReference): Support read only variables.
19370 * statement.cs: Remove the explicit emit for the Leave opcode.
19371 (VariableInfo): Add a readonly field.
19373 2001-12-05 Miguel de Icaza <miguel@ximian.com>
19375 * ecore.cs (ConvCast): new class used to encapsulate the various
19376 explicit integer conversions that works in both checked and
19377 unchecked contexts.
19379 (Expression.ConvertNumericExplicit): Use new ConvCast class to
19380 properly generate the overflow opcodes.
19382 2001-12-04 Miguel de Icaza <miguel@ximian.com>
19384 * statement.cs: The correct type for the EmptyExpression is the
19385 element_type, not the variable type. Ravi pointed this out.
19387 2001-12-04 Ravi Pratap <ravi@ximian.com>
19389 * class.cs (Method::Define): Handle PInvoke methods specially
19390 by using DefinePInvokeMethod instead of the usual one.
19392 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
19393 above to do the task of extracting information and defining the method.
19395 2001-12-04 Ravi Pratap <ravi@ximian.com>
19397 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
19398 of the condition for string type.
19400 (Emit): Move that here.
19402 (ArrayCreation::CheckIndices): Keep string literals in their expression
19405 (EmitDynamicInitializers): Handle strings appropriately.
19407 2001-12-04 Miguel de Icaza <miguel@ximian.com>
19409 * codegen.cs (EmitContext): Replace multiple variables with a
19410 single pointer to the current Switch statement.
19412 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
19415 2001-12-03 Miguel de Icaza <miguel@ximian.com>
19419 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
19422 (Foreach.Emit): Foreach on arrays was not setting
19423 up the loop variables (for break/continue).
19425 (GotoCase): Semi-implented.
19427 2001-12-03 Ravi Pratap <ravi@ximian.com>
19429 * attribute.cs (CheckAttribute): Handle system attributes by using
19430 Attribute.GetAttributes to examine information we need.
19432 (GetValidPlaces): Same here.
19434 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
19436 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
19438 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
19440 (Method::Define): Set appropriate flags if we have a DllImport attribute.
19442 (Method::Emit): Handle the case when we are a PInvoke method.
19444 2001-12-03 Miguel de Icaza <miguel@ximian.com>
19446 * expression.cs: Use ResolveWithSimpleName on compound names.
19448 2001-12-02 Ravi Pratap <ravi@ximian.com>
19450 * constant.cs (EmitConstant): Make sure we resolve the associated expression
19451 before trying to reduce it.
19453 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
19455 * constant.cs (LookupConstantValue): Implement.
19457 (EmitConstant): Use the above in emitting the constant.
19459 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
19460 that are user-defined by doing a LookupConstantValue on them.
19462 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
19465 2001-11-29 Miguel de Icaza <miguel@ximian.com>
19467 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
19469 (BaseAccess.DoResolve): Implement.
19471 (MemberAccess.DoResolve): Split this routine into a
19472 ResolveMemberAccess routine that can be used independently
19474 2001-11-28 Miguel de Icaza <miguel@ximian.com>
19476 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
19477 As that share bits of the implementation. Is returns a boolean,
19478 while As returns the Type that is being probed.
19480 2001-12-01 Ravi Pratap <ravi@ximian.com>
19482 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
19483 instead of a Literal - much easier.
19485 (EnumInTransit): Remove - utterly useless :-)
19487 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
19489 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
19491 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
19492 chain when we have no associated expression.
19494 2001-11-30 Ravi Pratap <ravi@ximian.com>
19496 * constant.cs (Define): Use Location while reporting the errror.
19498 Also emit a warning when 'new' is used and there is no inherited
19501 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
19504 (LookupEnumValue): Implement to lookup an enum member's value and define it
19507 (Populate): Re-write accordingly to use the above routine.
19509 2001-11-27 Miguel de Icaza <miguel@ximian.com>
19511 * expression.cs (This): Fix prototype for DoResolveLValue to
19512 override the base class DoResolveLValue.
19514 * cs-parser.cs: Report errors cs574 and cs575 (destructor
19517 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
19518 (we need to load the address of the field here). This fixes
19521 (FieldExpr.DoResolveLValue): Call the DoResolve
19522 function to initialize the Instance expression.
19524 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
19525 correctly the GetEnumerator operation on a value type.
19527 * cs-parser.jay: Add more simple parsing error catches.
19529 * statement.cs (Switch): Add support for string switches.
19530 Handle null specially.
19532 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
19534 2001-11-28 Ravi Pratap <ravi@ximian.com>
19536 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
19538 (declare_local_constant): New helper function.
19540 * statement.cs (AddConstant): Keep a separate record of constants
19542 (IsConstant): Implement to determine if a variable is a constant.
19544 (GetConstantExpression): Implement.
19546 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
19548 * statement.cs (IsVariableDefined): Re-write.
19550 2001-11-27 Ravi Pratap <ravi@ximian.com>
19552 * class.cs (TypeContainer::FindMembers): Look for constants
19553 in the case when we are looking for MemberTypes.Field
19555 * expression.cs (MemberAccess::DoResolve): Check that in the
19556 case we are a FieldExpr and a Literal, we are not being accessed
19557 by an instance reference.
19559 * cs-parser.jay (local_constant_declaration): Implement.
19561 (declaration_statement): Implement for constant declarations.
19563 2001-11-26 Miguel de Icaza <miguel@ximian.com>
19565 * statement.cs (Switch): Catch double defaults.
19567 (Switch): More work on the switch() statement
19568 implementation. It works for integral values now, need to finish
19572 2001-11-24 Miguel de Icaza <miguel@ximian.com>
19574 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
19575 integer literals into other integer literals. To be used by
19578 2001-11-24 Ravi Pratap <ravi@ximian.com>
19580 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
19583 (EmitDynamicInitializers): Cope with the above since we extract data
19584 directly from ArrayData now.
19586 (ExpectInitializers): Keep track of whether initializers are mandatory
19589 (Bounds): Make it a hashtable to prevent the same dimension being
19590 recorded for every element in that dimension.
19592 (EmitDynamicInitializers): Fix bug which prevented the Set array method
19595 Also fix bug which was causing the indices to be emitted in the reverse
19598 2001-11-24 Miguel de Icaza <miguel@ximian.com>
19600 * expression.cs (ArrayCreation): Implement the bits that Ravi left
19601 unfinished. They do not work, because the underlying code is
19604 2001-11-22 Miguel de Icaza <miguel@ximian.com>
19606 * cs-parser.jay: Remove bogus fixme.
19608 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
19609 on Switch statement.
19611 2001-11-23 Ravi Pratap <ravi@ximian.com>
19613 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
19616 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
19617 parameter. Apparently, any expression is allowed.
19619 (ValidateInitializers): Update accordingly.
19621 (CheckIndices): Fix some tricky bugs thanks to recursion.
19623 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
19624 I was being completely brain-dead.
19626 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
19627 and re-write acordingly.
19629 (DelegateInvocation): Re-write accordingly.
19631 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
19633 (MakeByteBlob): Handle types more correctly.
19635 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
19636 initialization from expressions but it is incomplete because I am a complete
19639 2001-11-22 Miguel de Icaza <miguel@ximian.com>
19641 * statement.cs (If.Emit): Fix a bug that generated incorrect code
19642 on If. Basically, we have to return `true' (ie, we do return to
19643 our caller) only if both branches of the if return.
19645 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
19646 short-circuit operators, handle them as short circuit operators.
19648 (Cast.DoResolve): Resolve type.
19649 (Cast.Cast): Take an expression as the target type.
19651 * cs-parser.jay (cast_expression): Remove old hack that only
19652 allowed a limited set of types to be handled. Now we take a
19653 unary_expression and we resolve to a type during semantic
19656 Use the grammar productions from Rhys to handle casts (this is
19657 not complete like Rhys syntax yet, we fail to handle that corner
19658 case that C# has regarding (-x), but we will get there.
19660 2001-11-22 Ravi Pratap <ravi@ximian.com>
19662 * class.cs (EmitFieldInitializer): Take care of the case when we have a
19663 field which is an array type.
19665 * cs-parser.jay (declare_local_variables): Support array initialization too.
19667 * typemanager.cs (MakeKey): Implement.
19669 (everywhere): Use the above appropriately.
19671 * cs-parser.jay (for_statement): Update for array initialization while
19672 declaring variables.
19674 * ecore.cs : The error message was correct, it's the variable's names that
19675 were misleading ;-) Make the code more readable.
19677 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
19678 the correct type etc.
19680 (ConvertExplicit): Handle Enum types by examining the underlying type.
19682 2001-11-21 Ravi Pratap <ravi@ximian.com>
19684 * parameter.cs (GetCallingConvention): Always return
19685 CallingConventions.Standard for now.
19687 2001-11-22 Miguel de Icaza <miguel@ximian.com>
19689 * expression.cs (Binary.ResolveOperator): Update the values of `l'
19690 and `r' after calling DoNumericPromotions.
19692 * ecore.cs: Fix error message (the types were in the wrong order).
19694 * statement.cs (Foreach.ProbeCollectionType): Need to pass
19695 BindingFlags.Instance as well
19697 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
19698 implicit int literal conversion in an empty cast so that we
19699 propagate the right type upstream.
19701 (UnboxCast): new class used to unbox value types.
19702 (Expression.ConvertExplicit): Add explicit type conversions done
19705 (Expression.ImplicitNumericConversion): Oops, forgot to test for
19706 the target type before applying the implicit LongLiterals to ULong
19709 2001-11-21 Miguel de Icaza <miguel@ximian.com>
19711 * cs-parser.jay (for_statement): Reworked the way For works: now
19712 we declare manually any variables that are introduced in
19713 for_initializer to solve the problem of having out-of-band code
19714 emition (that is what got for broken).
19716 (declaration_statement): Perform the actual variable declaration
19717 that used to be done in local_variable_declaration here.
19719 (local_variable_declaration): Do not declare anything, just pass
19720 the information on a DictionaryEntry
19722 2001-11-20 Ravi Pratap <ravi@ximian.com>
19724 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
19725 re-write of the logic to now make it recursive.
19727 (UpdateIndices): Re-write accordingly.
19729 Store element data in a separate ArrayData list in the above methods.
19731 (MakeByteBlob): Implement to dump the array data into a byte array.
19733 2001-11-19 Ravi Pratap <ravi@ximian.com>
19735 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
19738 * constant.cs (Define): Implement.
19740 (EmitConstant): Re-write fully.
19742 Pass in location info.
19744 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
19747 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
19748 DictionaryEntry since we need location info too.
19750 (constant_declaration): Update accordingly.
19752 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
19753 code into another method : UpdateIndices.
19755 2001-11-18 Ravi Pratap <ravi@ximian.com>
19757 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
19758 some type checking etc.
19760 2001-11-17 Ravi Pratap <ravi@ximian.com>
19762 * expression.cs (ArrayCreation::ValidateInitializers): Implement
19763 bits to provide dimension info if the user skips doing that.
19765 Update second constructor to store the rank correctly.
19767 2001-11-16 Ravi Pratap <ravi@ximian.com>
19769 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
19770 and try to implement.
19772 * ../errors/cs0150.cs : Add.
19774 * ../errors/cs0178.cs : Add.
19776 2001-11-16 Miguel de Icaza <miguel@ximian.com>
19778 * statement.cs: Implement foreach on multi-dimensional arrays.
19780 * parameter.cs (Parameters.GetParameterByName): Also lookup the
19781 name of the params argument.
19783 * expression.cs: Use EmitStoreOpcode to get the right opcode while
19784 initializing the array.
19786 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
19787 we can use this elsewhere.
19789 * statement.cs: Finish implementation of foreach for single
19792 * cs-parser.jay: Use an out-of-band stack to pass information
19793 around, I wonder why I need this.
19795 foreach_block: Make the new foreach_block the current_block.
19797 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
19798 function used to return a static Parameters structure. Used for
19799 empty parameters, as those are created very frequently.
19801 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
19803 2001-11-15 Ravi Pratap <ravi@ximian.com>
19805 * interface.cs : Default modifier is private, not public. The
19806 make verify test passes again.
19808 2001-11-15 Ravi Pratap <ravi@ximian.com>
19810 * support.cs (ReflectionParameters): Fix logic to determine
19811 whether the last parameter is a params one. Test 9 passes again.
19813 * delegate.cs (Populate): Register the builders we define with
19814 RegisterParameterForBuilder. Test 19 passes again.
19816 * cs-parser.jay (property_declaration): Reference $6 instead
19817 of $$ to get at the location.
19819 (indexer_declaration): Similar stuff.
19821 (attribute): Ditto.
19823 * class.cs (Property): Register parameters for the Get and Set methods
19824 if they exist. Test 23 passes again.
19826 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
19827 call to EmitArguments as we are sure there aren't any params arguments.
19828 Test 32 passes again.
19830 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
19831 IndexOutOfRangeException.
19833 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
19834 Test 33 now passes again.
19836 2001-11-15 Miguel de Icaza <miguel@ximian.com>
19838 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
19839 broke a bunch of things. Will have to come up with a better way
19840 of tracking locations.
19842 * statement.cs: Implemented foreach for single dimension arrays.
19844 2001-11-09 Miguel de Icaza <miguel@ximian.com>
19846 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
19847 an error. This removes the lookup from the critical path.
19849 * cs-parser.jay: Removed use of temporary_loc, which is completely
19852 2001-11-14 Miguel de Icaza <miguel@ximian.com>
19854 * support.cs (ReflectionParameters.ParameterModifier): Report
19855 whether the argument is a PARAMS argument or not.
19857 * class.cs: Set the attribute `ParamArrayAttribute' on the
19858 parameter argument.
19860 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
19861 and cons_param_array_attribute (ConstructorInfo for
19862 ParamArrayAttribute).,
19864 * codegen.cs: Emit the return using the `Return' statement, that
19865 way we can report the error correctly for missing return values.
19867 * class.cs (Method.Emit): Clean up.
19869 * expression.cs (Argument.Resolve): Take another argument: the
19870 location where this argument is used. Notice that this is not
19871 part of the "Argument" class as to reduce the size of the
19872 structure (we know the approximate location anyways).
19874 Test if the argument is a variable-reference, if not, then
19875 complain with a 206.
19877 (Argument.Emit): Emit addresses of variables.
19879 (Argument.FullDesc): Simplify.
19881 (Invocation.DoResolve): Update for Argument.Resolve.
19883 (ElementAccess.DoResolve): ditto.
19885 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
19886 method should be virtual, as this method is always virtual.
19888 (NewDelegate.DoResolve): Update for Argument.Resolve.
19890 * class.cs (ConstructorInitializer.DoResolve): ditto.
19892 * attribute.cs (Attribute.Resolve): ditto.
19894 2001-11-13 Miguel de Icaza <miguel@ximian.com>
19896 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
19898 * expression.cs (ParameterReference): Drop IStackStorage and implement
19899 IAssignMethod instead.
19901 (LocalVariableReference): ditto.
19903 * ecore.cs (FieldExpr): Drop IStackStorage and implement
19904 IAssignMethod instead.
19906 2001-11-13 Miguel de Icaza <miguel@ximian.com>
19908 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
19909 enumerations that are used in heavily used structures derive from
19910 byte in a laughable and pathetic attempt to reduce memory usage.
19911 This is the kind of pre-optimzations that you should not do at
19912 home without adult supervision.
19914 * expression.cs (UnaryMutator): New class, used to handle ++ and
19915 -- separatedly from the other unary operators. Cleans up the
19916 code, and kills the ExpressionStatement dependency in Unary.
19918 (Unary): Removed `method' and `Arguments' from this class, making
19919 it smaller, and moving it all to SimpleCall, so I can reuse this
19920 code in other locations and avoid creating a lot of transient data
19921 strucutres when not required.
19923 * cs-parser.jay: Adjust for new changes.
19925 2001-11-11 Miguel de Icaza <miguel@ximian.com>
19927 * enum.cs (Enum.Populate): If there is a failure during
19930 * cs-parser.jay (opt_enum_base): we used to catch type errors
19931 here, but this is really incorrect. The type error should be
19932 catched during semantic analysis.
19934 2001-12-11 Ravi Pratap <ravi@ximian.com>
19936 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
19937 current_local_parameters as expected since I, in my stupidity, had forgotten
19940 * attribute.cs (GetValidPlaces): Fix stupid bug.
19942 * class.cs (Method::Emit): Perform check on applicability of attributes.
19944 (Constructor::Emit): Ditto.
19946 (Field::Emit): Ditto.
19948 (Field.Location): Store location information.
19950 (Property, Event, Indexer, Operator): Ditto.
19952 * cs-parser.jay (field_declaration): Pass in location for each field.
19954 * ../errors/cs0592.cs : Add.
19956 2001-11-12 Ravi Pratap <ravi@ximian.com>
19958 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
19960 (InitCoreTypes): Update accordingly.
19962 (RegisterAttrType, LookupAttr): Implement.
19964 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
19965 info about the same.
19967 (Resolve): Update to populate the above as necessary.
19969 (Error592): Helper.
19971 (GetValidPlaces): Helper to the above.
19973 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
19975 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
19977 2001-11-12 Ravi Pratap <ravi@ximian.com>
19979 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
19981 * ../errors/cs0617.cs : Add.
19983 2001-11-11 Ravi Pratap <ravi@ximian.com>
19985 * enum.cs (Emit): Rename to Populate to be more consistent with what
19986 we expect it to do and when exactly it is called.
19988 * class.cs, rootcontext.cs : Update accordingly.
19990 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
19991 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
19993 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
19995 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
19996 of a fieldinfo using the above, when dealing with a FieldBuilder.
19998 2001-11-10 Ravi Pratap <ravi@ximian.com>
20000 * ../errors/cs0031.cs : Add.
20002 * ../errors/cs1008.cs : Add.
20004 * ../errrors/cs0543.cs : Add.
20006 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
20009 (FindMembers): Implement.
20011 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
20012 enums and delegates too.
20014 (enum_types): Rename to builder_to_enum.
20016 (delegate_types): Rename to builder_to_delegate.
20018 * delegate.cs (FindMembers): Implement.
20020 2001-11-09 Ravi Pratap <ravi@ximian.com>
20022 * typemanager.cs (IsEnumType): Implement.
20024 * enum.cs (Emit): Re-write parts to account for the underlying type
20025 better and perform checking etc.
20027 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
20028 of the underlying type.
20030 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
20033 * enum.cs (error31): Helper to report error #31.
20035 * cs-parser.jay (enum_declaration): Store location of each member too.
20037 * enum.cs (member_to_location): New hashtable.
20039 (AddEnumMember): Update location hashtable.
20041 (Emit): Use the location of each member while reporting errors.
20043 2001-11-09 Miguel de Icaza <miguel@ximian.com>
20045 * cs-parser.jay: A for_initializer if is a
20046 local_variable_declaration really ammount to have an implicit
20047 block with the variable declaration and no initializer for for.
20049 * statement.cs (For.Emit): Cope with null initializers.
20051 This fixes the infinite loop on for initializers.
20053 2001-11-08 Miguel de Icaza <miguel@ximian.com>
20055 * enum.cs: More cleanup.
20057 * ecore.cs: Remove dead code.
20059 * class.cs (Property.Emit): More simplification.
20060 (Event.Emit): ditto.
20062 Reworked to have less levels of indentation.
20064 2001-11-08 Ravi Pratap <ravi@ximian.com>
20066 * class.cs (Property): Emit attributes.
20076 * enum.cs (Emit): Ditto.
20078 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
20081 * class.cs (Field, Event, etc.): Move attribute generation into the
20082 Emit method everywhere.
20084 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
20085 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
20086 as we had no way of defining nested enums !
20088 * rootcontext.cs : Adjust code accordingly.
20090 * typemanager.cs (AddEnumType): To keep track of enum types separately.
20092 2001-11-07 Ravi Pratap <ravi@ximian.com>
20094 * expression.cs (EvalConstantExpression): Move into ecore.cs
20096 * enum.cs (Enum): Rename some members and make them public and readonly
20097 according to our convention.
20099 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
20102 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
20104 (Enum::Emit): Write a simple version for now which doesn't try to compute
20105 expressions. I shall modify this to be more robust in just a while.
20107 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
20109 (TypeContainer::CloseType): Create the Enum types too.
20111 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
20113 * expression.cs (EvalConstantExpression): Get rid of completely.
20115 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
20116 user-defined values and other cases.
20118 (IsValidEnumLiteral): Helper function.
20120 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
20121 out there in the case we had a literal FieldExpr.
20123 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
20125 (Literalize): Revamp a bit to take two arguments.
20127 (EnumLiteral): New class which derives from Literal to wrap enum literals.
20129 2001-11-06 Ravi Pratap <ravi@ximian.com>
20131 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
20133 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
20135 (Resolve): Use the above to ensure we have proper initializers.
20137 2001-11-05 Ravi Pratap <ravi@ximian.com>
20139 * expression.cs (Expression::EvalConstantExpression): New method to
20140 evaluate constant expressions.
20142 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
20144 2001-11-07 Miguel de Icaza <miguel@ximian.com>
20146 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
20149 (Binary.ResolveOperator): Handle operator != (object a, object b)
20150 and operator == (object a, object b);
20152 (Binary.DoNumericPromotions): Indicate whether the numeric
20153 promotion was possible.
20155 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
20158 Made the ArrayAccess implement interface IAssignMethod instead of
20159 IStackStore as the order in which arguments are passed reflects
20162 * assign.cs: Instead of using expr.ExprClass to select the way of
20163 assinging, probe for the IStackStore/IAssignMethod interfaces.
20165 * typemanager.cs: Load InitializeArray definition.
20167 * rootcontext.cs (RootContext.MakeStaticData): Used to define
20168 static data that can be used to initialize arrays.
20170 2001-11-05 Miguel de Icaza <miguel@ximian.com>
20172 * expression.cs: Handle operator== and operator!= for booleans.
20174 (Conditioal.Reduce): Implement reducer for the ?: operator.
20176 (Conditional.Resolve): Implement dead code elimination.
20178 (Binary.Resolve): Catch string literals and return a new
20179 concatenated string.
20181 (Unary.Reduce): Implement reduction of unary expressions.
20183 * ecore.cs: Split out the expression core handling here.
20185 (Expression.Reduce): New method used to perform constant folding
20186 and CSE. This is needed to support constant-expressions.
20188 * statement.cs (Statement.EmitBoolExpression): Pass true and false
20189 targets, and optimize for !x.
20191 2001-11-04 Ravi Pratap <ravi@ximian.com>
20193 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
20194 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
20195 set custom atttributes.
20197 * literal.cs (Literal::GetValue): New abstract method to return the actual
20198 value of the literal, cast as an object.
20200 (*Literal): Implement GetValue method.
20202 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
20203 expressions to the arraylist but objects of type Argument.
20205 * class.cs (TypeContainer::Emit): Emit our attributes too.
20207 (Method::Emit, Constructor::Emit): Ditto.
20209 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
20210 to be ignoring earlier.
20212 2001-11-03 Ravi Pratap <ravi@ximian.com>
20214 * attribute.cs (AttributeSection::Define): Implement to do the business
20215 of constructing a CustomAttributeBuilder.
20217 (Attribute): New trivial class. Increases readability of code.
20219 * cs-parser.jay : Update accordingly.
20221 (positional_argument_list, named_argument_list, named_argument): New rules
20223 (attribute_arguments): Use the above so that we are more correct.
20225 2001-11-02 Ravi Pratap <ravi@ximian.com>
20227 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
20228 to perform all checks for a method with a params parameter.
20230 (Invocation::OverloadResolve): Update to use the above method and therefore
20231 cope correctly with params method invocations.
20233 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
20236 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
20237 constructors in our parent too because we can't afford to miss out on
20240 * attribute.cs (AttributeSection): New name for the class Attribute
20242 Other trivial changes to improve readability.
20244 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
20245 use the new class names.
20247 2001-11-01 Ravi Pratap <ravi@ximian.com>
20249 * class.cs (Method::Define): Complete definition for params types too
20251 (Indexer::Define): Ditto.
20253 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
20254 Cope everywhere with a request for info about the array parameter.
20256 2001-11-01 Ravi Pratap <ravi@ximian.com>
20258 * tree.cs (RecordNamespace): Fix up to check for the correct key.
20260 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
20261 local_variable_type to extract the string corresponding to the type.
20263 (local_variable_type): Fixup the action to use the new helper method.
20265 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
20268 * expression.cs : Clean out code which uses the above.
20270 2001-10-31 Ravi Pratap <ravi@ximian.com>
20272 * typemanager.cs (RegisterMethod): Check if we already have an existing key
20273 and bale out if necessary by returning a false.
20275 (RegisterProperty): Ditto.
20277 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
20278 and print out appropriate error messages.
20280 * interface.cs (everywhere): Ditto.
20282 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
20283 location to constructor.
20285 * class.cs (Property, Event, Indexer): Update accordingly.
20287 * ../errors/cs111.cs : Added.
20289 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
20290 of a method, as laid down by the spec.
20292 (Invocation::OverloadResolve): Use the above method.
20294 2001-10-31 Ravi Pratap <ravi@ximian.com>
20296 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
20297 now take a TypeContainer and a Parameters object.
20299 (ParameterData): Modify return type of ParameterModifier method to be
20300 Parameter.Modifier and not a string.
20302 (ReflectionParameters, InternalParameters): Update accordingly.
20304 * expression.cs (Argument::GetParameterModifier): Same here.
20306 * support.cs (InternalParameters::ParameterType): Find a better way of determining
20307 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
20308 symbol in it at all so maybe this is only for now.
20310 2001-10-30 Ravi Pratap <ravi@ximian.com>
20312 * support.cs (InternalParameters): Constructor now takes an extra argument
20313 which is the actual Parameters class.
20315 (ParameterDesc): Update to provide info on ref/out modifiers.
20317 * class.cs (everywhere): Update call to InternalParameters to pass in
20318 the second argument too.
20320 * support.cs (ParameterData): Add ParameterModifier, which is a method
20321 to return the modifier info [ref/out etc]
20323 (InternalParameters, ReflectionParameters): Implement the above.
20325 * expression.cs (Argument::ParameterModifier): Similar function to return
20326 info about the argument's modifiers.
20328 (Invocation::OverloadResolve): Update to take into account matching modifiers
20331 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
20332 a new SetFormalParameters object which we pass to InternalParameters.
20334 2001-10-30 Ravi Pratap <ravi@ximian.com>
20336 * expression.cs (NewArray): Merge into the ArrayCreation class.
20338 2001-10-29 Ravi Pratap <ravi@ximian.com>
20340 * expression.cs (NewArray): Merge classes NewBuiltinArray and
20341 NewUserdefinedArray into one as there wasn't much of a use in having
20344 * expression.cs (Argument): Change field's name to ArgType from Type.
20346 (Type): New readonly property which returns the proper type, taking into
20347 account ref/out modifiers.
20349 (everywhere): Adjust code accordingly for the above.
20351 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
20352 whether we are emitting for a ref or out parameter.
20354 * expression.cs (Argument::Emit): Use the above field to set the state.
20356 (LocalVariableReference::Emit): Update to honour the flag and emit the
20359 * parameter.cs (Attributes): Set the correct flags for ref parameters.
20361 * expression.cs (Argument::FullDesc): New function to provide a full desc.
20363 * support.cs (ParameterData): Add method ParameterDesc to the interface.
20365 (ReflectionParameters, InternalParameters): Implement the above method.
20367 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
20370 (Invocation::FullMethodDesc): Ditto.
20372 2001-10-29 Miguel de Icaza <miguel@ximian.com>
20374 * cs-parser.jay: Add extra production for the second form of array
20377 * expression.cs (ArrayCreation): Update to reflect the above
20380 * Small changes to prepare for Array initialization.
20382 2001-10-28 Miguel de Icaza <miguel@ximian.com>
20384 * typemanager.cs (ImplementsInterface): interface might be null;
20385 Deal with this problem;
20387 Also, we do store negative hits on the cache (null values), so use
20388 this instead of calling t.GetInterfaces on the type everytime.
20390 2001-10-28 Ravi Pratap <ravi@ximian.com>
20392 * typemanager.cs (IsBuiltinType): New method to help determine the same.
20394 * expression.cs (New::DoResolve): Get rid of array creation code and instead
20395 split functionality out into different classes.
20397 (New::FormArrayType): Move into NewBuiltinArray.
20399 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
20402 (NewBuiltinArray): New class to handle creation of built-in arrays.
20404 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
20405 account creation of one-dimensional arrays.
20407 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
20409 (NewUserdefinedArray::DoResolve): Implement.
20411 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
20413 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
20414 we maintain inside the TypeManager. This is necessary to perform lookups on the
20417 (LookupType): Update to perform GetType on the module builders too.
20419 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
20421 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
20423 2001-10-23 Ravi Pratap <ravi@ximian.com>
20425 * expression.cs (New::DoResolve): Implement guts of array creation.
20427 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
20429 2001-10-27 Miguel de Icaza <miguel@ximian.com>
20431 * expression.cs: Fix bug I introduced lsat night that broke
20434 (Expression.Resolve): Report a 246 error (can not resolve name)
20435 if we find a SimpleName in the stream.
20437 (Expression.ResolveLValue): Ditto.
20439 (Expression.ResolveWithSimpleName): This function is a variant of
20440 ResolveName, this one allows SimpleNames to be returned without a
20441 warning. The only consumer of SimpleNames is MemberAccess
20443 2001-10-26 Miguel de Icaza <miguel@ximian.com>
20445 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
20446 might arrive here. I have my doubts that this is correct.
20448 * statement.cs (Lock): Implement lock statement.
20450 * cs-parser.jay: Small fixes to support `lock' and `using'
20452 * cs-tokenizer.cs: Remove extra space
20454 * driver.cs: New flag --checked, allows to turn on integer math
20457 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
20458 Threading.Monitor.Exit
20460 2001-10-23 Miguel de Icaza <miguel@ximian.com>
20462 * expression.cs (IndexerAccess::DoResolveLValue): Set the
20463 Expression Class to be IndexerAccess.
20465 Notice that Indexer::DoResolve sets the eclass to Value.
20467 2001-10-22 Miguel de Icaza <miguel@ximian.com>
20469 * class.cs (TypeContainer::Emit): Emit code for indexers.
20471 * assign.cs (IAssignMethod): New interface implemented by Indexers
20472 and Properties for handling assignment.
20474 (Assign::Emit): Simplify and reuse code.
20476 * expression.cs (IndexerAccess, PropertyExpr): Implement
20477 IAssignMethod, clean up old code.
20479 2001-10-22 Ravi Pratap <ravi@ximian.com>
20481 * typemanager.cs (ImplementsInterface): New method to determine if a type
20482 implements a given interface. Provides a nice cache too.
20484 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
20487 (ConvertReferenceExplicit): Ditto.
20489 * delegate.cs (Delegate::Populate): Update to define the parameters on the
20490 various methods, with correct names etc.
20492 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
20493 Operator.UnaryNegation.
20495 * cs-parser.jay (operator_declarator): Be a little clever in the case where
20496 we have a unary plus or minus operator.
20498 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
20501 * everywhere : update accordingly.
20503 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
20506 * class.cs (Method::Define): For the case where we are implementing a method
20507 inherited from an interface, we need to set the MethodAttributes.Final flag too.
20508 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
20510 2001-10-21 Ravi Pratap <ravi@ximian.com>
20512 * interface.cs (FindMembers): Implement to work around S.R.E
20515 * typemanager.cs (IsInterfaceType): Implement.
20517 (FindMembers): Update to handle interface types too.
20519 * expression.cs (ImplicitReferenceConversion): Re-write bits which
20520 use IsAssignableFrom as that is not correct - it doesn't work.
20522 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
20523 and accordingly override EmitStatement.
20525 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
20526 using the correct logic :-)
20528 2001-10-19 Ravi Pratap <ravi@ximian.com>
20530 * ../errors/cs-11.cs : Add to demonstrate error -11
20532 2001-10-17 Miguel de Icaza <miguel@ximian.com>
20534 * assign.cs (Assign::Resolve): Resolve right hand side first, and
20535 then pass this as a hint to ResolveLValue.
20537 * expression.cs (FieldExpr): Add Location information
20539 (FieldExpr::LValueResolve): Report assignment to readonly
20542 (Expression::ExprClassFromMemberInfo): Pass location information.
20544 (Expression::ResolveLValue): Add new method that resolves an
20547 (Expression::DoResolveLValue): Default invocation calls
20550 (Indexers): New class used to keep track of indexers in a given
20553 (IStackStore): Renamed from LValue, as it did not really describe
20554 what this did. Also ResolveLValue is gone from this interface and
20555 now is part of Expression.
20557 (ElementAccess): Depending on the element access type
20559 * typemanager.cs: Add `indexer_name_type' as a Core type
20560 (System.Runtime.CompilerServices.IndexerNameAttribute)
20562 * statement.cs (Goto): Take a location.
20564 2001-10-18 Ravi Pratap <ravi@ximian.com>
20566 * delegate.cs (Delegate::VerifyDelegate): New method to verify
20567 if two delegates are compatible.
20569 (NewDelegate::DoResolve): Update to take care of the case when
20570 we instantiate a delegate from another delegate.
20572 * typemanager.cs (FindMembers): Don't even try to look up members
20573 of Delegate types for now.
20575 2001-10-18 Ravi Pratap <ravi@ximian.com>
20577 * delegate.cs (NewDelegate): New class to take care of delegate
20580 * expression.cs (New): Split the delegate related code out into
20581 the NewDelegate class.
20583 * delegate.cs (DelegateInvocation): New class to handle delegate
20586 * expression.cs (Invocation): Split out delegate related code into
20587 the DelegateInvocation class.
20589 2001-10-17 Ravi Pratap <ravi@ximian.com>
20591 * expression.cs (New::DoResolve): Implement delegate creation fully
20592 and according to the spec.
20594 (New::DoEmit): Update to handle delegates differently.
20596 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
20597 because of which we were printing out arguments in reverse order !
20599 * delegate.cs (VerifyMethod): Implement to check if the given method
20600 matches the delegate.
20602 (FullDelegateDesc): Implement.
20604 (VerifyApplicability): Implement.
20606 * expression.cs (Invocation::DoResolve): Update to accordingly handle
20607 delegate invocations too.
20609 (Invocation::Emit): Ditto.
20611 * ../errors/cs1593.cs : Added.
20613 * ../errors/cs1594.cs : Added.
20615 * delegate.cs (InstanceExpression, TargetMethod): New properties.
20617 2001-10-16 Ravi Pratap <ravi@ximian.com>
20619 * typemanager.cs (intptr_type): Core type for System.IntPtr
20621 (InitCoreTypes): Update for the same.
20623 (iasyncresult_type, asynccallback_type): Ditto.
20625 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
20628 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
20631 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
20632 the builders for the 4 members of a delegate type :-)
20634 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
20637 * expression.cs (New::DoResolve): Implement guts for delegate creation.
20639 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
20641 2001-10-15 Miguel de Icaza <miguel@ximian.com>
20643 * statement.cs (Break::Emit): Implement.
20644 (Continue::Emit): Implement.
20646 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
20647 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
20648 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
20649 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
20652 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
20653 properties that track the label for the current loop (begin of the
20654 loop and end of the loop).
20656 2001-10-15 Ravi Pratap <ravi@ximian.com>
20658 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
20659 use of emitting anything at all.
20661 * class.cs, rootcontext.cs : Get rid of calls to the same.
20663 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
20665 (Populate): Define the constructor correctly and set the implementation
20668 * typemanager.cs (delegate_types): New hashtable to hold delegates that
20671 (AddDelegateType): Implement.
20673 (IsDelegateType): Implement helper method.
20675 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
20677 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
20678 and accordingly handle it.
20680 * delegate.cs (Populate): Take TypeContainer argument.
20681 Implement bits to define the Invoke method. However, I still haven't figured out
20682 how to take care of the native int bit :-(
20684 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
20685 Qualify the name of the delegate, not its return type !
20687 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
20690 (StandardConversionExists): Checking for array types turns out to be recursive.
20692 (ConvertReferenceExplicit): Implement array conversion.
20694 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
20696 2001-10-12 Ravi Pratap <ravi@ximian.com>
20698 * cs-parser.jay (delegate_declaration): Store the fully qualified
20699 name as it is a type declaration.
20701 * delegate.cs (ReturnType, Name): Rename members to these. Make them
20704 (DefineDelegate): Renamed from Define. Does the same thing essentially,
20705 as TypeContainer::DefineType.
20707 (Populate): Method in which all the definition of the various methods (Invoke)
20710 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
20713 (CloseDelegate): Finally creates the delegate.
20715 * class.cs (TypeContainer::DefineType): Update to define delegates.
20716 (Populate, Emit and CloseType): Do the same thing here too.
20718 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
20719 delegates in all these operations.
20721 2001-10-14 Miguel de Icaza <miguel@ximian.com>
20723 * expression.cs: LocalTemporary: a new expression used to
20724 reference a temporary that has been created.
20726 * assign.cs: Handle PropertyAccess back here, so that we can
20727 provide the proper semantic access to properties.
20729 * expression.cs (Expression::ConvertReferenceExplicit): Implement
20730 a few more explicit conversions.
20732 * modifiers.cs: `NEW' modifier maps to HideBySig.
20734 * expression.cs (PropertyExpr): Make this into an
20735 ExpressionStatement, and support the EmitStatement code path.
20737 Perform get/set error checking, clean up the interface.
20739 * assign.cs: recognize PropertyExprs as targets, and if so, turn
20740 them into toplevel access objects.
20742 2001-10-12 Miguel de Icaza <miguel@ximian.com>
20744 * expression.cs: PropertyExpr::PropertyExpr: use work around the
20747 * typemanager.cs: Keep track here of our PropertyBuilders again to
20748 work around lameness in SRE.
20750 2001-10-11 Miguel de Icaza <miguel@ximian.com>
20752 * expression.cs (LValue::LValueResolve): New method in the
20753 interface, used to perform a second resolution pass for LValues.
20755 (This::DoResolve): Catch the use of this in static methods.
20757 (This::LValueResolve): Implement.
20759 (This::Store): Remove warning, assigning to `this' in structures
20762 (Invocation::Emit): Deal with invocation of
20763 methods on value types. We need to pass the address to structure
20764 methods rather than the object itself. (The equivalent code to
20765 emit "this" for structures leaves the entire structure on the
20766 stack instead of a pointer to it).
20768 (ParameterReference::DoResolve): Compute the real index for the
20769 argument based on whether the method takes or not a `this' pointer
20770 (ie, the method is static).
20772 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
20773 value types returned from functions when we need to invoke a
20774 method on the sturcture.
20777 2001-10-11 Ravi Pratap <ravi@ximian.com>
20779 * class.cs (TypeContainer::DefineType): Method to actually do the business of
20780 defining the type in the Modulebuilder or Typebuilder. This is to take
20781 care of nested types which need to be defined on the TypeBuilder using
20782 DefineNestedMethod.
20784 (TypeContainer::GetClassBases): Implement. Essentially the code from the
20785 methods in RootContext, only ported to be part of TypeContainer.
20787 (TypeContainer::GetInterfaceOrClass): Ditto.
20789 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
20791 * interface.cs (Interface::DefineInterface): New method. Does exactly
20792 what RootContext.CreateInterface did earlier, only it takes care of nested types
20795 (Interface::GetInterfaces): Move from RootContext here and port.
20797 (Interface::GetInterfaceByName): Same here.
20799 * rootcontext.cs (ResolveTree): Re-write.
20801 (PopulateTypes): Re-write.
20803 * class.cs (TypeContainer::Populate): Populate nested types too.
20804 (TypeContainer::Emit): Emit nested members too.
20806 * typemanager.cs (AddUserType): Do not make use of the FullName property,
20807 instead just use the name argument passed in as it is already fully
20810 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
20811 to TypeContainer mapping to see if a type is user-defined.
20813 * class.cs (TypeContainer::CloseType): Implement.
20815 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
20816 the default constructor.
20818 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
20821 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
20823 * interface.cs (CloseType): Create the type here.
20825 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
20828 Remove all the methods which are now in TypeContainer.
20830 2001-10-10 Ravi Pratap <ravi@ximian.com>
20832 * delegate.cs (Define): Re-write bits to define the delegate
20835 2001-10-10 Miguel de Icaza <miguel@ximian.com>
20837 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
20839 * expression.cs (ImplicitReferenceConversion): handle null as well
20840 as a source to convert to any reference type.
20842 * statement.cs (Return): Perform any implicit conversions to
20843 expected return type.
20845 Validate use of return statement.
20847 * codegen.cs (EmitContext): Pass the expected return type here.
20849 * class.cs (Method, Constructor, Property): Pass expected return
20850 type to EmitContext.
20852 2001-10-09 Miguel de Icaza <miguel@ximian.com>
20854 * expression.cs: Make DoResolve take an EmitContext instead of a
20857 Replaced `l' and `location' for `loc', for consistency.
20859 (Error, Warning): Remove unneeded Tc argument.
20861 * assign.cs, literal.cs, constant.cs: Update to new calling
20864 * codegen.cs: EmitContext now contains a flag indicating whether
20865 code is being generated in a static method or not.
20867 * cs-parser.jay: DecomposeQI, new function that replaces the old
20868 QualifiedIdentifier. Now we always decompose the assembled
20869 strings from qualified_identifier productions into a group of
20872 2001-10-08 Miguel de Icaza <miguel@ximian.com>
20874 * rootcontext.cs: Deal with field-less struct types correctly now
20875 by passing the size option to Define Type.
20877 * class.cs: Removed hack that created one static field.
20879 2001-10-07 Miguel de Icaza <miguel@ximian.com>
20881 * statement.cs: Moved most of the code generation here.
20883 2001-10-09 Ravi Pratap <ravi@ximian.com>
20885 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
20888 (ElementAccess): Remove useless bits for now - keep checks as the spec
20891 2001-10-08 Ravi Pratap <ravi@ximian.com>
20893 * expression.cs (ElementAccess::DoResolve): Remove my crap code
20894 and start performing checks according to the spec.
20896 2001-10-07 Ravi Pratap <ravi@ximian.com>
20898 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
20899 rank_specifiers instead.
20901 (rank_specifiers): Change the order in which the rank specifiers are stored
20903 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
20905 * expression.cs (ElementAccess): Implement the LValue interface too.
20907 2001-10-06 Ravi Pratap <ravi@ximian.com>
20909 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
20910 except that user defined conversions are not included.
20912 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
20913 perform the conversion of the return type, if necessary.
20915 (New::DoResolve): Check whether we are creating an array or an object
20916 and accordingly do the needful.
20918 (New::Emit): Same here.
20920 (New::DoResolve): Implement guts of array creation.
20922 (New::FormLookupType): Helper function.
20924 2001-10-07 Miguel de Icaza <miguel@ximian.com>
20926 * codegen.cs: Removed most of the code generation here, and move the
20927 corresponding code generation bits to the statement classes.
20929 Added support for try/catch/finalize and throw.
20931 * cs-parser.jay: Added support for try/catch/finalize.
20933 * class.cs: Catch static methods having the flags override,
20934 virtual or abstract.
20936 * expression.cs (UserCast): This user cast was not really doing
20937 what it was supposed to do. Which is to be born in fully resolved
20938 state. Parts of the resolution were being performed at Emit time!
20942 2001-10-05 Miguel de Icaza <miguel@ximian.com>
20944 * expression.cs: Implicity convert the result from UserCast.
20946 2001-10-05 Ravi Pratap <ravi@ximian.com>
20948 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
20949 prevented it from working correctly.
20951 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
20952 merely ConvertImplicit.
20954 2001-10-05 Miguel de Icaza <miguel@ximian.com>
20956 * typemanager.cs: Make the LookupTypeContainer function static,
20957 and not per-instance.
20959 * class.cs: Make static FindMembers (the one that takes a Type
20962 * codegen.cs: Add EmitForeach here.
20964 * cs-parser.jay: Make foreach a toplevel object instead of the
20965 inline expansion, as we need to perform semantic analysis on it.
20967 2001-10-05 Ravi Pratap <ravi@ximian.com>
20969 * expression.cs (Expression::ImplicitUserConversion): Rename to
20970 UserDefinedConversion.
20972 (Expression::UserDefinedConversion): Take an extra argument specifying
20973 whether we look for explicit user conversions too.
20975 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
20977 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
20979 (ExplicitUserConversion): Make it a call to UserDefinedConversion
20980 with the appropriate arguments.
20982 * cs-parser.jay (cast_expression): Record location too.
20984 * expression.cs (Cast): Record location info.
20986 (Expression::ConvertExplicit): Take location argument.
20988 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
20989 to determine if we are doing explicit conversions.
20991 (UserCast::Emit): Update accordingly.
20993 (Expression::ConvertExplicit): Report an error if everything fails.
20995 * ../errors/cs0030.cs : Add.
20997 2001-10-04 Miguel de Icaza <miguel@ximian.com>
20999 * modifiers.cs: If the ABSTRACT keyword is present, also set the
21000 virtual and newslot bits.
21002 * class.cs (TypeContainer::RegisterRequiredImplementations):
21003 Record methods we need.
21005 (TypeContainer::MakeKey): Helper function to make keys for
21006 MethodBases, since the Methodbase key is useless.
21008 (TypeContainer::Populate): Call RegisterRequiredImplementations
21009 before defining the methods.
21011 Create a mapping for method_builders_to_methods ahead of time
21012 instead of inside a tight loop.
21014 (::RequireMethods): Accept an object as the data to set into the
21015 hashtable so we can report interface vs abstract method mismatch.
21017 2001-10-03 Miguel de Icaza <miguel@ximian.com>
21019 * report.cs: Make all of it static.
21021 * rootcontext.cs: Drop object_type and value_type computations, as
21022 we have those in the TypeManager anyways.
21024 Drop report instance variable too, now it is a global.
21026 * driver.cs: Use try/catch on command line handling.
21028 Add --probe option to debug the error reporting system with a test
21031 * report.cs: Add support for exiting program when a probe
21032 condition is reached.
21034 2001-10-03 Ravi Pratap <ravi@ximian.com>
21036 * expression.cs (Binary::DoNumericPromotions): Fix the case when
21037 we do a forcible conversion regardless of type, to check if
21038 ForceConversion returns a null.
21040 (Binary::error19): Use location to report error.
21042 (Unary::error23): Use location here too.
21044 * ../errors/cs0019.cs : Check in.
21046 * ../errors/cs0023.cs : Check in.
21048 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
21049 case of a non-null MethodInfo object with a length of 0 !
21051 (Binary::ResolveOperator): Flag error if overload resolution fails to find
21052 an applicable member - according to the spec :-)
21053 Also fix logic to find members in base types.
21055 (Unary::ResolveOperator): Same here.
21057 (Unary::report23): Change name to error23 and make first argument a TypeContainer
21058 as I was getting thoroughly confused between this and error19 :-)
21060 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
21061 (::FindMostEncompassedType): Implement.
21062 (::FindMostEncompassingType): Implement.
21063 (::StandardConversionExists): Implement.
21065 (UserImplicitCast): Re-vamp. We now need info about most specific
21066 source and target types so that we can do the necessary conversions.
21068 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
21069 mathematical union with no duplicates.
21071 2001-10-03 Miguel de Icaza <miguel@ximian.com>
21073 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
21074 in order from base classes to child classes, so that we can in
21075 child classes look up in our parent for method names and
21076 attributes (required for handling abstract, virtual, new, override
21077 constructs: we need to instrospect our base class, and if we dont
21078 populate the classes in order, the introspection might be
21079 incorrect. For example, a method could query its parent before
21080 the parent has any methods and would determine that the parent has
21081 no abstract methods (while it could have had them)).
21083 (RootContext::CreateType): Record the order in which we define the
21086 2001-10-02 Miguel de Icaza <miguel@ximian.com>
21088 * class.cs (TypeContainer::Populate): Also method definitions can
21089 fail now, keep track of this.
21091 (TypeContainer::FindMembers): Implement support for
21092 DeclaredOnly/noDeclaredOnly flag.
21094 (Constructor::Emit) Return the ConstructorBuilder.
21096 (Method::Emit) Return the MethodBuilder.
21097 Check for abstract or virtual methods to be public.
21099 * rootcontext.cs (RootContext::CreateType): Register all the
21100 abstract methods required for the class to be complete and the
21101 interface methods that must be implemented.
21103 * cs-parser.jay: Report error 501 (method requires body if it is
21104 not marked abstract or extern).
21106 * expression.cs (TypeOf::Emit): Implement.
21108 * typemanager.cs: runtime_handle_type, new global type.
21110 * class.cs (Property::Emit): Generate code for properties.
21112 2001-10-02 Ravi Pratap <ravi@ximian.com>
21114 * expression.cs (Unary::ResolveOperator): Find operators on base type
21115 too - we now conform exactly to the spec.
21117 (Binary::ResolveOperator): Same here.
21119 * class.cs (Operator::Define): Fix minor quirk in the tests.
21121 * ../errors/cs0215.cs : Added.
21123 * ../errors/cs0556.cs : Added.
21125 * ../errors/cs0555.cs : Added.
21127 2001-10-01 Miguel de Icaza <miguel@ximian.com>
21129 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
21130 single integer which is really efficient
21132 2001-10-01 Ravi Pratap <ravi@ximian.com>
21134 * expression.cs (Expression::ImplicitUserConversion): Use location
21135 even in the case when we are examining True operators.
21137 * class.cs (Operator::Define): Perform extensive checks to conform
21138 with the rules for operator overloading in the spec.
21140 * expression.cs (Expression::ImplicitReferenceConversion): Implement
21141 some of the other conversions mentioned in the spec.
21143 * typemanager.cs (array_type): New static member for the System.Array built-in
21146 (cloneable_interface): For System.ICloneable interface.
21148 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
21149 we start resolving the tree and populating types.
21151 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
21153 2001-10-01 Miguel de Icaza <miguel@ximian.com>
21155 * expression.cs (Expression::ExprClassFromMemberInfo,
21156 Expression::Literalize): Create literal expressions from
21157 FieldInfos which are literals.
21159 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
21160 type casts, because they were wrong. The test suite in tests
21163 (ImplicitNumericConversion): ushort to ulong requires a widening
21166 Int32 constant to long requires widening cast as well.
21168 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
21169 for integers because the type on the stack is not i4.
21171 2001-09-30 Miguel de Icaza <miguel@ximian.com>
21173 * expression.cs (report118): require location argument.
21175 * parameter.cs: Do not dereference potential null value.
21177 * class.cs: Catch methods that lack the `new' keyword when
21178 overriding a name. Report warnings when `new' is used without
21179 anything being there to override.
21181 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
21183 * class.cs: Only add constructor to hashtable if it is non-null
21184 (as now constructors can fail on define).
21186 (TypeManager, Class, Struct): Take location arguments.
21188 Catch field instance initialization in structs as errors.
21190 accepting_filter: a new filter for FindMembers that is static so
21191 that we dont create an instance per invocation.
21193 (Constructor::Define): Catch errors where a struct constructor is
21196 * cs-parser.jay: Pass location information for various new
21199 * delegate.cs (Delegate): take a location argument.
21201 * driver.cs: Do not call EmitCode if there were problesm in the
21202 Definition of the types, as many Builders wont be there.
21204 * decl.cs (Decl::Decl): Require a location argument.
21206 * cs-tokenizer.cs: Handle properly hex constants that can not fit
21207 into integers, and find the most appropiate integer for it.
21209 * literal.cs: Implement ULongLiteral.
21211 * rootcontext.cs: Provide better information about the location of
21212 failure when CreateType fails.
21214 2001-09-29 Miguel de Icaza <miguel@ximian.com>
21216 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
21219 * expression.cs (Binary::CheckShiftArguments): Add missing type
21221 (Binary::ResolveOperator): Add type to the logical and and logical
21222 or, Bitwise And/Or and Exclusive Or code paths, it was missing
21225 (Binary::DoNumericPromotions): In the case where either argument
21226 is ulong (and most signed types combined with ulong cause an
21227 error) perform implicit integer constant conversions as well.
21229 2001-09-28 Miguel de Icaza <miguel@ximian.com>
21231 * expression.cs (UserImplicitCast): Method should always be
21233 (Invocation::BetterConversion): Simplified test for IntLiteral.
21235 (Expression::ImplicitNumericConversion): Split this routine out.
21236 Put the code that performs implicit constant integer conversions
21239 (Expression::Resolve): Become a wrapper around DoResolve so we can
21240 check eclass and type being set after resolve.
21242 (Invocation::Badness): Remove this dead function
21244 (Binary::ResolveOperator): Do not compute the expensive argumnets
21245 unless we have a union for it.
21247 (Probe::Emit): Is needs to do an isinst and then
21248 compare against null.
21250 (::CanConvert): Added Location argument. If the Location argument
21251 is null (Location.Null), then we do not report errors. This is
21252 used by the `probe' mechanism of the Explicit conversion. We do
21253 not want to generate an error for something that the user
21254 explicitly requested to be casted. But the pipeline for an
21255 explicit cast first tests for potential implicit casts.
21257 So for now, if the Location is null, it means `Probe only' to
21258 avoid adding another argument. Might have to revise this
21261 (ClassCast): New class used to type cast objects into arbitrary
21262 classes (used in Explicit Reference Conversions).
21264 Implement `as' as well.
21266 Reverted all the patches from Ravi below: they were broken:
21268 * The use of `level' as a mechanism to stop recursive
21269 invocations is wrong. That was there just to catch the
21270 bug with a strack trace but not as a way of addressing
21273 To fix the problem we have to *understand* what is going
21274 on and the interactions and come up with a plan, not
21275 just get things going.
21277 * The use of the type conversion cache that I proposed
21278 last night had an open topic: How does this work across
21279 protection domains. A user defined conversion might not
21280 be public in the location where we are applying the
21281 conversion, a different conversion might be selected
21282 (ie, private A->B (better) but public B->A (worse),
21283 inside A, A->B applies, but outside it, B->A will
21286 * On top of that (ie, even if the above is solved),
21287 conversions in a cache need to be abstract. Ie, `To
21288 convert from an Int to a Short use an OpcodeCast', not
21289 `To convert from an Int to a Short use the OpcodeCast on
21290 the variable 5' (which is what this patch was doing).
21292 2001-09-28 Ravi Pratap <ravi@ximian.com>
21294 * expression.cs (Invocation::ConversionExists): Re-write to use
21295 the conversion cache
21297 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
21298 cache all conversions done, not just user-defined ones.
21300 (Invocation::BetterConversion): The real culprit. Use ConversionExists
21301 to determine if a conversion exists instead of acutually trying to
21302 perform the conversion. It's faster too.
21304 (Expression::ConvertExplicit): Modify to use ConversionExists to check
21305 and only then attempt the implicit conversion.
21307 2001-09-28 Ravi Pratap <ravi@ximian.com>
21309 * expression.cs (ConvertImplicit): Use a cache for conversions
21310 already found. Check level of recursion and bail out if necessary.
21312 2001-09-28 Miguel de Icaza <miguel@ximian.com>
21314 * typemanager.cs (string_concat_string_string, string_concat_object_object):
21315 Export standard methods that we expect for string operations.
21317 * statement.cs (Block::UsageWarning): Track usage of variables and
21318 report the errors for not used variables.
21320 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
21323 2001-09-27 Miguel de Icaza <miguel@ximian.com>
21325 * codegen.cs: remove unnneded code
21327 * expression.cs: Removed BuiltinTypeAccess class
21329 Fix the order in which implicit conversions are
21332 The previous fixed dropped support for boxed conversions (adding a
21333 test to the test suite now)
21335 (UserImplicitCast::CanConvert): Remove test for source being null,
21336 that code is broken. We should not feed a null to begin with, if
21337 we do, then we should track the bug where the problem originates
21338 and not try to cover it up here.
21340 Return a resolved expression of type UserImplicitCast on success
21341 rather than true/false. Ravi: this is what I was talking about,
21342 the pattern is to use a static method as a "constructor" for
21345 Also, do not create arguments until the very last minute,
21346 otherwise we always create the arguments even for lookups that
21347 will never be performed.
21349 (UserImplicitCast::Resolve): Eliminate, objects of type
21350 UserImplicitCast are born in a fully resolved state.
21352 * typemanager.cs (InitCoreTypes): Init also value_type
21353 (System.ValueType).
21355 * expression.cs (Cast::Resolve): First resolve the child expression.
21357 (LValue): Add new method AddressOf to be used by
21360 Change the argument of Store to take an EmitContext instead of an
21361 ILGenerator, because things like FieldExpr need to be able to call
21362 their children expression to generate the instance code.
21364 (Expression::Error, Expression::Warning): Sugar functions for
21367 (Expression::MemberLookup): Accept a TypeContainer instead of a
21368 Report as the first argument.
21370 (Expression::ResolvePrimary): Killed. I still want to improve
21371 this as currently the code is just not right.
21373 (Expression::ResolveMemberAccess): Simplify, but it is still
21376 (Unary::Resolve): Catch errors in AddressOf operators.
21378 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
21379 index to a byte for the short-version, or the compiler will choose
21380 the wrong Emit call, which generates the wrong data.
21382 (ParameterReference::Emit, ::Store): same.
21384 (FieldExpr::AddressOf): Implement.
21386 * typemanager.cs: TypeManager: made public variable instead of
21389 * driver.cs: document --fatal.
21391 * report.cs (ErrorMessage, WarningMessage): new names for the old
21392 Error and Warning classes.
21394 * cs-parser.jay (member_access): Turn built-in access to types
21395 into a normal simplename
21397 2001-09-27 Ravi Pratap <ravi@ximian.com>
21399 * expression.cs (Invocation::BetterConversion): Fix to cope
21400 with q being null, since this was introducing a bug.
21402 * expression.cs (ConvertImplicit): Do built-in conversions first.
21404 2001-09-27 Ravi Pratap <ravi@ximian.com>
21406 * expression.cs (UserImplicitCast::Resolve): Fix bug.
21408 2001-09-27 Ravi Pratap <ravi@ximian.com>
21410 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
21411 I had introduced long ago (what's new ?).
21413 * expression.cs (UserImplicitCast::CanConvert): Static method to do
21414 the work of all the checking.
21415 (ConvertImplicit): Call CanConvert and only then create object if necessary.
21416 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
21418 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
21419 that is the right way.
21421 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
21422 overloading resolution. Use everywhere instead of cutting and pasting code.
21424 (Binary::ResolveOperator): Use MakeUnionSet.
21426 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
21427 we have to convert to bool types. Not complete yet.
21429 2001-09-27 Miguel de Icaza <miguel@ximian.com>
21431 * typemanager.cs (TypeManager::CSharpName): support ushort.
21433 * expression.cs (Expression::TryImplicitIntConversion): Attempts
21434 to provide an expression that performsn an implicit constant int
21435 conversion (section 6.1.6).
21436 (Expression::ConvertImplicitRequired): Reworked to include
21437 implicit constant expression conversions.
21439 (Expression::ConvertNumericExplicit): Finished.
21441 (Invocation::Emit): If InstanceExpression is null, then it means
21442 that we perform a call on this.
21444 2001-09-26 Miguel de Icaza <miguel@ximian.com>
21446 * expression.cs (Unary::Emit): Remove some dead code.
21447 (Probe): Implement Resolve and Emit for `is'.
21448 (Expression::ConvertImplicitRequired): Attempt to do constant
21449 expression conversions here. Maybe should be moved to
21450 ConvertImplicit, but I am not sure.
21451 (Expression::ImplicitLongConstantConversionPossible,
21452 Expression::ImplicitIntConstantConversionPossible): New functions
21453 that tell whether is it possible to apply an implicit constant
21454 expression conversion.
21456 (ConvertNumericExplicit): Started work on explicit numeric
21459 * cs-parser.jay: Update operator constants.
21461 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
21462 (Parameters::GetSignature): Hook up VerifyArgs here.
21463 (Parameters::VerifyArgs): Verifies that no two arguments have the
21466 * class.cs (Operator): Update the operator names to reflect the
21467 ones that the spec expects (as we are just stringizing the
21470 * expression.cs (Unary::ResolveOperator): Fix bug: Use
21471 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
21472 previous usage did only work for our methods.
21473 (Expression::ConvertImplicit): Handle decimal implicit numeric
21474 conversions as well.
21475 (Expression::InternalTypeConstructor): Used to invoke constructors
21476 on internal types for default promotions.
21478 (Unary::Emit): Implement special handling for the pre/post
21479 increment/decrement for overloaded operators, as they need to have
21480 the same semantics as the other operators.
21482 (Binary::ResolveOperator): ditto.
21483 (Invocation::ConversionExists): ditto.
21484 (UserImplicitCast::Resolve): ditto.
21486 2001-09-26 Ravi Pratap <ravi@ximian.com>
21488 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
21489 operator, return after emitting body. Regression tests pass again !
21491 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
21492 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
21493 (Invocation::OverloadResolve): Ditto.
21494 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
21496 * everywhere : update calls to the above methods accordingly.
21498 2001-09-26 Miguel de Icaza <miguel@ximian.com>
21500 * assign.cs (Assign): Make it inherit from ExpressionStatement.
21502 * expression.cs (ExpressionStatement): New base class used for
21503 expressions that can appear in statements, so that we can provide
21504 an alternate path to generate expression that do not leave a value
21507 (Expression::Emit, and all the derivatives): We no longer return
21508 whether a value is left on the stack or not. Every expression
21509 after being emitted leaves a single value on the stack.
21511 * codegen.cs (EmitContext::EmitStatementExpression): Use the
21512 facilties of ExpressionStatement if possible.
21514 * cs-parser.jay: Update statement_expression.
21516 2001-09-25 Miguel de Icaza <miguel@ximian.com>
21518 * driver.cs: Change the wording of message
21520 2001-09-25 Ravi Pratap <ravi@ximian.com>
21522 * expression.cs (Binary::ResolveOperator): Had forgottten to set
21523 the type of the expression to the return type of the method if
21524 we have an overloaded operator match ! The regression tests pass again !
21525 (Unary::ResolveOperator): Ditto.
21527 * expression.cs (Invocation::ConversionExists): Correct the member lookup
21528 to find "op_Implicit", not "implicit" ;-)
21529 (UserImplicitCast): New class to take care of user-defined implicit conversions.
21530 (ConvertImplicit, ForceConversion): Take TypeContainer argument
21532 * everywhere : Correct calls to the above accordingly.
21534 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
21535 (ConvertImplicit): Do user-defined conversion if it exists.
21537 2001-09-24 Miguel de Icaza <miguel@ximian.com>
21539 * assign.cs: track location.
21540 (Resolve): Use implicit conversions on assignment.
21542 * literal.cs: Oops. Not good, Emit of short access values should
21543 pass (Bytes) or the wrong argument will be selected.
21545 * expression.cs (Unary::Emit): Emit code for -expr.
21547 (Unary::ResolveOperator): Handle `Substract' for non-constants
21548 (substract from zero from the non-constants).
21549 Deal with Doubles as well.
21551 (Expression::ConvertImplicitRequired): New routine that reports an
21552 error if no implicit conversion exists.
21554 (Invocation::OverloadResolve): Store the converted implicit
21555 expressions if we make them
21557 2001-09-24 Ravi Pratap <ravi@ximian.com>
21559 * class.cs (ConstructorInitializer): Take a Location argument.
21560 (ConstructorBaseInitializer): Same here.
21561 (ConstructorThisInitializer): Same here.
21563 * cs-parser.jay : Update all calls accordingly.
21565 * expression.cs (Unary, Binary, New): Take location argument.
21566 Update accordingly everywhere.
21568 * cs-parser.jay : Update all calls to the above to take a location
21571 * class.cs : Ditto.
21573 2001-09-24 Ravi Pratap <ravi@ximian.com>
21575 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
21576 (Invocation::BetterConversion): Same here
21577 (Invocation::ConversionExists): Ditto.
21579 (Invocation::ConversionExists): Implement.
21581 2001-09-22 Ravi Pratap <ravi@ximian.com>
21583 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
21584 Also take an additional TypeContainer argument.
21586 * All over : Pass in TypeContainer as argument to OverloadResolve.
21588 * typemanager.cs (CSharpName): Update to check for the string type and return
21591 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
21594 2001-09-21 Ravi Pratap <ravi@ximian.com>
21596 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
21597 (Invocation::BetterFunction): Implement.
21598 (Invocation::BetterConversion): Implement.
21599 (Invocation::ConversionExists): Skeleton, no implementation yet.
21601 Okay, things work fine !
21603 2001-09-21 Miguel de Icaza <miguel@ximian.com>
21605 * typemanager.cs: declare and load enum_type, delegate_type and
21608 * expression.cs (Expression::Emit): Now emit returns a value that
21609 tells whether a value is left on the stack or not. This strategy
21610 might be reveted tomorrow with a mechanism that would address
21611 multiple assignments.
21612 (Expression::report118): Utility routine to report mismatches on
21615 (Unary::Report23): Report impossible type/operator combination
21618 (Unary::IsIncrementableNumber): Whether the type can be
21619 incremented or decremented with add.
21620 (Unary::ResolveOperator): Also allow enumerations to be bitwise
21622 (Unary::ResolveOperator): Implement ++, !, ~,
21624 (Invocation::Emit): Deal with new Emit convetion.
21626 * All Expression derivatives: Updated their Emit method to return
21627 whether they leave values on the stack or not.
21629 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
21630 stack for expressions that are statements.
21632 2001-09-20 Miguel de Icaza <miguel@ximian.com>
21634 * expression.cs (LValue): New interface. Must be implemented by
21636 (LocalVariableReference, ParameterReference, FieldExpr): Implement
21639 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
21640 interface for generating code, simplifies the code.
21642 2001-09-20 Ravi Pratap <ravi@ximian.com>
21644 * expression.cs (everywhere): Comment out return statements in ::Resolve
21645 methods to avoid the warnings.
21647 2001-09-20 Miguel de Icaza <miguel@ximian.com>
21649 * driver.cs (parse): Report error 2001 if we can not open the
21652 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
21655 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
21658 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
21659 otherwise nested blocks end up with the same index.
21661 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
21663 * expression.cs: Instead of having FIXMEs in the Resolve
21664 functions, throw exceptions so it is obvious that we are facing a
21667 * cs-parser.jay (invocation_expression): Pass Location information.
21669 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
21670 Use a basename for those routines because .NET does not like paths
21673 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
21676 2001-09-19 Miguel de Icaza <miguel@ximian.com>
21678 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
21679 are loading the correct data types (throws an exception if not).
21680 (TypeManager::InitCoreTypes): Use CoreLookupType
21682 * expression.cs (Unary::ResolveOperator): return the child
21683 expression for expressions which are just +expr.
21684 (Unary::ResolveOperator): Return negative literals for -LITERAL
21685 expressions (otherwise they are Unary {Literal}).
21686 (Invocation::Badness): Take into account `Implicit constant
21687 expression conversions'.
21689 * literal.cs (LongLiteral): Implement long literal class.
21690 (IntLiteral): export the `Value' of the intliteral.
21692 2001-09-19 Ravi Pratap <ravi@ximian.com>
21694 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
21696 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
21697 instead of 'Operator'
21699 * expression.cs (Binary::ResolveOperator): Update accordingly.
21700 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
21703 * cs-parser.jay (unary_expression): Update to use the new names.
21705 * gen-treedump.cs (GetUnary): Same here.
21707 * expression.cs (Unary::Resolve): Implement.
21708 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
21709 operators are found instead of making noise ;-)
21710 (Unary::ResolveOperator): New method to do precisely the same thing which
21711 Binary::ResolveOperator does for Binary expressions.
21712 (Unary.method, .Arguments): Add.
21713 (Unary::OperName): Implement.
21714 (Unary::ForceConversion): Copy and Paste !
21716 * class.cs (Operator::Define): Fix a small bug for the case when we have
21719 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
21720 for the inbuilt operators. Only overloading works for now ;-)
21722 2001-09-18 Miguel de Icaza <miguel@ximian.com>
21724 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
21725 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
21727 * expression.cs (This::Emit): Implement.
21728 (This::Resolve): Implement.
21729 (TypeOf:Resolve): Implement.
21730 (Expression::ResolveSimpleName): Add an implicit this to instance
21732 (MemberAccess::Resolve): Deal with Parameters and Fields.
21733 Bind instance variable to Field expressions.
21734 (FieldExpr::Instance): New field used to track the expression that
21735 represents the object instance.
21736 (FieldExpr::Resolve): Track potential errors from MemberLookup not
21738 (FieldExpr::Emit): Implement.
21740 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
21741 the last instruction contains a return opcode to avoid generating
21742 the last `ret' instruction (this generates correct code, and it is
21743 nice to pass the peverify output).
21745 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
21746 initializer for static and instance variables.
21747 (Constructor::Emit): Allow initializer to be null in the case of
21748 static constructors. Only emit initializer for instance
21751 (TypeContainer::FindMembers): Return a null array if there are no
21754 Also fix the code for the MemberTypes.Method branch, as it was not
21755 scanning that for operators (or tried to access null variables before).
21757 * assign.cs (Assign::Emit): Handle instance and static fields.
21761 * driver.cs: Stop compilation if there are parse errors.
21763 * cs-parser.jay (constructor_declaration): Provide default base
21764 initializer for non-static constructors.
21765 (constructor_declarator): Do not provide a default base
21766 initializers if none was specified.
21767 Catch the fact that constructors should not have parameters.
21769 * class.cs: Do not emit parent class initializers for static
21770 constructors, that should be flagged as an error.
21772 2001-09-18 Ravi Pratap <ravi@ximian.com>
21774 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
21775 Move back code into TypeContainer::Populate.
21777 2001-09-18 Ravi Pratap <ravi@ximian.com>
21779 * class.cs (TypeContainer::AddConstructor): Fix the check to
21780 compare against Name, not Basename.
21781 (Operator::OpType): Change Plus and Minus to Add and Subtract.
21783 * cs-parser.jay : Update accordingly.
21785 * class.cs (TypeContainer::FindMembers): For the case where we are searching
21786 for methods, don't forget to look into the operators too.
21787 (RegisterMethodBuilder): Helper method to take care of this for
21788 methods, constructors and operators.
21789 (Operator::Define): Completely revamp.
21790 (Operator.OperatorMethod, MethodName): New fields.
21791 (TypeContainer::Populate): Move the registering of builders into
21792 RegisterMethodBuilder.
21793 (Operator::Emit): Re-write.
21795 * expression.cs (Binary::Emit): Comment out code path to emit method
21796 invocation stuff for the case when we have a user defined operator. I am
21797 just not able to get it right !
21799 2001-09-17 Miguel de Icaza <miguel@ximian.com>
21801 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
21804 (Expression::MemberLookup): Provide a version that allows to
21805 specify the MemberTypes and BindingFlags.
21807 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
21808 so it was not fetching variable information from outer blocks.
21810 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
21811 Beforefieldinit as it was buggy.
21813 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
21814 that Ravi put here.
21816 * class.cs (Constructor::Emit): Only emit if block is not null.
21817 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
21818 deal with this by semantically definining it as if the user had
21821 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
21822 constructors as we now "emit" them at a higher level.
21824 (TypeContainer::DefineDefaultConstructor): Used to define the
21825 default constructors if none was provided.
21827 (ConstructorInitializer): Add methods Resolve and Emit.
21829 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
21831 2001-09-17 Ravi Pratap <ravi@ximian.com>
21833 * class.cs (TypeContainer::EmitDefaultConstructor): Register
21834 the default constructor builder with our hashtable for methodbuilders
21837 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
21838 and argument_count is 0 in which case we have a match.
21839 (Binary::ResolveOperator): More null checking and miscellaneous coding
21842 2001-09-17 Ravi Pratap <ravi@ximian.com>
21844 * rootcontext.cs (IsNameSpace): Compare against null.
21846 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
21848 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
21849 and Unary::Operator.
21851 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
21854 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
21855 we have overloaded operators.
21856 (Binary::ResolveOperator): Implement the part which does the operator overload
21859 * class.cs (Operator::Emit): Implement.
21860 (TypeContainer::Emit): Emit the operators we have too.
21862 * expression.cs (Binary::Emit): Update to emit the appropriate code for
21863 the case when we have a user-defined operator.
21865 2001-09-17 Miguel de Icaza <miguel@ximian.com>
21867 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
21869 2001-09-16 Ravi Pratap <ravi@ximian.com>
21871 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
21872 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
21873 (Constructor::Emit): Implement.
21874 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
21875 if we have no work to do.
21876 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
21879 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
21880 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
21882 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
21885 2001-09-15 Ravi Pratap <ravi@ximian.com>
21887 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
21889 (Tree::RecordNamespace): Method to do what the name says ;-)
21890 (Tree::Namespaces): Property to get at the namespaces hashtable.
21892 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
21895 * rootcontext.cs (IsNamespace): Fixed it :-)
21897 2001-09-14 Miguel de Icaza <miguel@ximian.com>
21899 * class.cs (TypeContainer::FindMembers): Add support for
21901 (MethodCore): New class that encapsulates both the shared aspects
21902 of a Constructor and a Method.
21903 (Method, Constructor): Factored pieces into MethodCore.
21905 * driver.cs: Added --fatal which makes errors throw exceptions.
21906 Load System assembly as well as part of the standard library.
21908 * report.cs: Allow throwing exceptions on errors for debugging.
21910 * modifiers.cs: Do not use `parent', instead use the real type
21911 container to evaluate permission settings.
21913 * class.cs: Put Ravi's patch back in. He is right, and we will
21914 have to cope with the
21916 2001-09-14 Ravi Pratap <ravi@ximian.com>
21918 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
21919 FamORAssem, not FamANDAssem.
21921 2001-09-14 Miguel de Icaza <miguel@ximian.com>
21923 * driver.cs: Added --parse option that only parses its input files
21926 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
21927 incorrect. IsTopLevel is not used to tell whether an object is
21928 root_types or not (that can be achieved by testing this ==
21929 root_types). But to see if this is a top-level *class* (not
21930 necessarly our "toplevel" container).
21932 2001-09-14 Ravi Pratap <ravi@ximian.com>
21934 * enum.cs (Enum::Define): Modify to call the Lookup method on the
21935 parent instead of a direct call to GetType.
21937 2001-09-14 Ravi Pratap <ravi@ximian.com>
21939 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
21940 Modifiers.TypeAttr. This should just be a call to that method.
21942 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
21943 object so that we can determine if we are top-level or not.
21945 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
21948 * enum.cs (Enum::Define): Ditto.
21950 * modifiers.cs (FieldAttr): Re-write.
21952 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
21953 (TypeContainer::HaveStaticConstructor): New property to provide access
21954 to precisely that info.
21956 * modifiers.cs (MethodAttr): Re-write.
21957 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
21959 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
21960 of top-level types as claimed.
21962 2001-09-13 Miguel de Icaza <miguel@ximian.com>
21964 * expression.cs (MemberLookup): Fruitless attempt to lookup
21965 constructors. Maybe I need to emit default constructors? That
21966 might be it (currently .NET emits this for me automatically).
21967 (Invocation::OverloadResolve): Cope with Arguments == null.
21968 (Invocation::EmitArguments): new function, shared by the new
21969 constructor and us.
21970 (Invocation::Emit): Handle static and instance methods. Emit
21971 proper call instruction for virtual or non-virtual invocations.
21972 (New::Emit): Implement.
21973 (New::Resolve): Implement.
21974 (MemberAccess:Resolve): Implement.
21975 (MethodGroupExpr::InstanceExpression): used conforming to the spec
21976 to track instances.
21977 (FieldExpr::Resolve): Set type.
21979 * support.cs: Handle empty arguments.
21981 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
21982 SimpleLookup): Auxiliary routines to help parse a qualifier
21985 Update qualifier_identifier rule.
21987 * codegen.cs: Removed debugging messages.
21989 * class.cs: Make this a global thing, this acts just as a "key" to
21990 objects that we might have around.
21992 (Populate): Only initialize method_builders_to_methods once.
21994 * expression.cs (PropertyExpr): Initialize type from the
21997 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
21998 Resolve pattern. Attempt to implicitly convert value to boolean.
22001 * expression.cs: Set the type for the int32/int32 argument case.
22002 (Binary::ResolveOperator): Set the return type to boolean for
22003 comparission operators
22005 * typemanager.cs: Remove debugging print code.
22007 (Invocation::Resolve): resolve type.
22009 * class.cs: Allocate a MemberInfo of the correct size, as the code
22010 elsewhere depends on the test to reflect the correct contents.
22012 (Method::) Keep track of parameters, due to System.Reflection holes
22014 (TypeContainer::Populate): Keep track of MethodBuilders to Method
22017 (TypeContainer::FindMembers): Use ArrayList and then copy an array
22018 of the exact size and return that.
22020 (Class::LookupMethodByBuilder): New function that maps
22021 MethodBuilders to its methods. Required to locate the information
22022 on methods because System.Reflection bit us again.
22024 * support.cs: New file, contains an interface ParameterData and
22025 two implementations: ReflectionParameters and InternalParameters
22026 used to access Parameter information. We will need to grow this
22029 * expression.cs (Invocation::GetParameterData): implement a cache
22030 and a wrapper around the ParameterData creation for methods.
22031 (Invocation::OverloadResolve): Use new code.
22033 2001-09-13 Ravi Pratap <ravi@ximian.com>
22035 * class.cs (TypeContainer::EmitField): Remove and move into
22036 (Field::Define): here and modify accordingly.
22037 (Field.FieldBuilder): New member.
22038 (TypeContainer::Populate): Update accordingly.
22039 (TypeContainer::FindMembers): Implement.
22041 2001-09-13 Miguel de Icaza <miguel@ximian.com>
22043 * statement.cs: (VariableInfo::VariableType): New field to be
22044 initialized with the full type once it is resolved.
22046 2001-09-12 Miguel de Icaza <miguel@ximian.com>
22048 * parameter.cs (GetParameterInfo): Use a type cache to compute
22049 things only once, and to reuse this information
22051 * expression.cs (LocalVariableReference::Emit): Implement.
22052 (OpcodeCast::Emit): fix.
22054 (ParameterReference::Resolve): Implement.
22055 (ParameterReference::Emit): Implement.
22057 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
22058 that are expressions need to stay as Expressions.
22060 * typemanager.cs (CSharpName): Returns the C# name of a type if
22063 * expression.cs (Expression::ConvertImplicit): New function that
22064 implements implicit type conversions.
22066 (Expression::ImplicitReferenceConversion): Implements implicit
22067 reference conversions.
22069 (EmptyCast): New type for transparent casts.
22071 (OpcodeCast): New type for casts of types that are performed with
22072 a sequence of bytecodes.
22074 (BoxedCast): New type used for casting value types into reference
22075 types. Emits a box opcode.
22077 (Binary::DoNumericPromotions): Implements numeric promotions of
22078 and computation of the Binary::Type.
22080 (Binary::EmitBranchable): Optimization.
22082 (Binary::Emit): Implement code emission for expressions.
22084 * typemanager.cs (TypeManager): Added two new core types: sbyte
22087 2001-09-12 Ravi Pratap <ravi@ximian.com>
22089 * class.cs (TypeContainer::FindMembers): Method which does exactly
22090 what Type.FindMembers does, only we don't have to use reflection. No
22091 implementation yet.
22093 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
22094 typecontainer objects as we need to get at them.
22095 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
22097 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
22098 typecontainer object.
22100 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
22101 of just a Report object.
22103 2001-09-11 Ravi Pratap <ravi@ximian.com>
22105 * class.cs (Event::Define): Go back to using the prefixes "add_" and
22107 (TypeContainer::Populate): Now define the delegates of the type too.
22108 (TypeContainer.Delegates): Property to access the list of delegates defined
22111 * delegates.cs (Delegate::Define): Implement partially.
22113 * modifiers.cs (TypeAttr): Handle more flags.
22115 2001-09-11 Ravi Pratap <ravi@ximian.com>
22117 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
22119 (Operator::Define): Re-write logic to get types by using the LookupType method
22120 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
22121 (Indexer::Define): Ditto.
22122 (Event::Define): Ditto.
22123 (Property::Define): Ditto.
22125 2001-09-10 Ravi Pratap <ravi@ximian.com>
22127 * class.cs (TypeContainer::Populate): Now define operators too.
22128 (TypeContainer.Operators): New property to access the list of operators
22130 (Operator.OperatorMethodBuilder): New member to hold the method builder
22131 for the operator we are defining.
22132 (Operator::Define): Implement.
22134 2001-09-10 Ravi Pratap <ravi@ximian.com>
22136 * class.cs (Event::Define): Make the prefixes of the accessor methods
22137 addOn_ and removeOn_
22139 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
22140 of the location being passed in too. Ideally, this should go later since all
22141 error reporting should be done through the Report object.
22143 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
22144 (Populate): Iterate thru the indexers we have and define them too.
22145 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
22146 for the get and set accessors.
22147 (Indexer::Define): Implement.
22149 2001-09-09 Miguel de Icaza <miguel@ximian.com>
22151 * expression.cs (Binary::Resolve): Beginning of it. I scratched
22152 my previous implementation, did not work.
22154 * typemanager.cs: Add a couple of missing types (the longs).
22156 * literal.cs: Use TypeManager.bool_type instead of getting it.
22158 * expression.cs (EventExpr): New kind of expressions.
22159 (Expressio::ExprClassFromMemberInfo): finish
22161 2001-09-08 Miguel de Icaza <miguel@ximian.com>
22163 * assign.cs: Emit stores to static fields differently.
22165 2001-09-08 Ravi Pratap <ravi@ximian.com>
22167 * Merge in changes and adjust code to tackle conflicts. Backed out my
22168 code in Assign::Resolve ;-)
22170 2001-09-08 Ravi Pratap <ravi@ximian.com>
22172 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
22173 instead Report.Error and also pass in the location.
22174 (CSharpParser::Lexer): New readonly property to return the reference
22175 to the Tokenizer object.
22176 (declare_local_variables): Use Report.Error with location instead of plain
22180 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
22181 (Operator.CheckBinaryOperator): Ditto.
22183 * cs-parser.jay (operator_declarator): Update accordingly.
22185 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
22186 (CheckBinaryOperator): Same here.
22188 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
22189 on the name without any prefixes of namespace names etc. This is because we
22190 already might have something already fully qualified like
22191 'System.Console.WriteLine'
22193 * assign.cs (Resolve): Begin implementation. Stuck ;-)
22195 2001-09-07 Ravi Pratap <ravi@ximian.com>
22197 * cs-tokenizer.cs (location): Return a string which also contains
22200 * expression.cs (ElementAccess): New class for expressions of the
22201 type 'element access.'
22202 (BaseAccess): New class for expressions of the type 'base access.'
22203 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
22206 * cs-parser.jay (element_access): Implement action.
22207 (base_access): Implement actions.
22208 (checked_expression, unchecked_expression): Implement.
22210 * cs-parser.jay (local_variable_type): Correct and implement.
22211 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
22213 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
22215 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
22216 name and the specifiers.
22218 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
22220 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
22221 making them all public ;-)
22223 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
22226 2001-09-07 Miguel de Icaza <miguel@ximian.com>
22228 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
22230 (FieldExpr, PropertyExprs): New resolved expressions.
22231 (SimpleName::MemberStaticCheck): Perform static checks for access
22232 to non-static fields on static methods. Maybe this should be
22233 generalized for MemberAccesses.
22234 (SimpleName::ResolveSimpleName): More work on simple name
22237 * cs-parser.jay (primary_expression/qualified_identifier): track
22238 the parameter index.
22240 * codegen.cs (CodeGen::Save): Catch save exception, report error.
22241 (EmitContext::EmitBoolExpression): Chain to expression generation
22242 instead of temporary hack.
22243 (::EmitStatementExpression): Put generic expression code generation.
22245 * assign.cs (Assign::Emit): Implement variable assignments to
22246 local variables, parameters and fields.
22248 2001-09-06 Miguel de Icaza <miguel@ximian.com>
22250 * statement.cs (Block::GetVariableInfo): New method, returns the
22251 VariableInfo for a variable name in a block.
22252 (Block::GetVariableType): Implement in terms of GetVariableInfo
22254 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
22255 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
22257 2001-09-06 Ravi Pratap <ravi@ximian.com>
22259 * cs-parser.jay (operator_declaration): Continue on my quest : update
22260 to take attributes argument.
22261 (event_declaration): Ditto.
22262 (enum_declaration): Ditto.
22263 (indexer_declaration): Ditto.
22265 * class.cs (Operator::Operator): Update constructor accordingly.
22266 (Event::Event): Ditto.
22268 * delegate.cs (Delegate::Delegate): Same here.
22270 * enum.cs (Enum::Enum): Same here.
22272 2001-09-05 Ravi Pratap <ravi@ximian.com>
22274 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
22276 * ../tests/cs0658.cs : New file to demonstrate error 0658.
22278 * attribute.cs (Attributes): New class to encapsulate all attributes which were
22279 being passed around as an arraylist.
22280 (Attributes::AddAttribute): Method to add attribute sections.
22282 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
22283 (struct_declaration): Update accordingly.
22284 (constant_declaration): Update.
22285 (field_declaration): Update.
22286 (method_header): Update.
22287 (fixed_parameter): Update.
22288 (parameter_array): Ditto.
22289 (property_declaration): Ditto.
22290 (destructor_declaration): Ditto.
22292 * class.cs (Struct::Struct): Update constructors accordingly.
22293 (Class::Class): Ditto.
22294 (Field::Field): Ditto.
22295 (Method::Method): Ditto.
22296 (Property::Property): Ditto.
22297 (TypeContainer::OptAttribute): update property's return type.
22299 * interface.cs (Interface.opt_attributes): New member.
22300 (Interface::Interface): Update to take the extra Attributes argument.
22302 * parameter.cs (Parameter::Parameter): Ditto.
22304 * constant.cs (Constant::Constant): Ditto.
22306 * interface.cs (InterfaceMemberBase): New OptAttributes field.
22307 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
22308 the attributes as a parameter.
22309 (InterfaceProperty): Update constructor call.
22310 (InterfaceEvent): Ditto.
22311 (InterfaceMethod): Ditto.
22312 (InterfaceIndexer): Ditto.
22314 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
22315 pass the attributes too.
22316 (interface_event_declaration): Ditto.
22317 (interface_property_declaration): Ditto.
22318 (interface_method_declaration): Ditto.
22319 (interface_declaration): Ditto.
22321 2001-09-05 Miguel de Icaza <miguel@ximian.com>
22323 * class.cs (Method::Define): Track the "static Main" definition to
22324 create an entry point.
22326 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
22327 EntryPoint if we find it.
22329 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
22330 (EmitContext::ig): Make this variable public.
22332 * driver.cs: Make the default output file be the first file name
22333 with the .exe extension.
22335 Detect empty compilations
22337 Handle various kinds of output targets. Handle --target and
22338 rename -t to --dumper.
22340 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
22341 methods inherited from Expression return now an Expression. This
22342 will is used during the tree rewriting as we resolve them during
22345 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
22346 the spec. Missing entirely is the information about
22347 accessability of elements of it.
22349 (Expression::ExprClassFromMemberInfo): New constructor for
22350 Expressions that creates a fully initialized Expression based on
22351 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
22354 (Invocation::Resolve): Begin implementing resolution of invocations.
22356 * literal.cs (StringLiteral): Implement Emit.
22358 2001-09-05 Ravi Pratap <ravi@ximian.com>
22360 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
22363 2001-09-04 Ravi Pratap <ravi@ximian.com>
22365 * cs-parser.jay (attribute_arguments): Implement actions.
22366 (attribute): Fix bug in production. Implement action.
22367 (attribute_list): Implement.
22368 (attribute_target): Implement.
22369 (attribute_target_specifier, opt_target_specifier): Implement
22370 (CheckAttributeTarget): New method to check if the attribute target
22372 (attribute_section): Implement.
22373 (opt_attributes): Implement.
22375 * attribute.cs : New file to handle attributes.
22376 (Attribute): Class to hold attribute info.
22378 * cs-parser.jay (opt_attribute_target_specifier): Remove production
22379 (attribute_section): Modify production to use 2 different rules to
22380 achieve the same thing. 1 s/r conflict down !
22381 Clean out commented, useless, non-reducing dimension_separator rules.
22383 * class.cs (TypeContainer.attributes): New member to hold list
22384 of attributes for a type.
22385 (Struct::Struct): Modify to take one more argument, the attribute list.
22386 (Class::Class): Ditto.
22387 (Field::Field): Ditto.
22388 (Method::Method): Ditto.
22389 (Property::Property): Ditto.
22391 * cs-parser.jay (struct_declaration): Update constructor call to
22392 pass in the attributes too.
22393 (class_declaration): Ditto.
22394 (constant_declaration): Ditto.
22395 (field_declaration): Ditto.
22396 (method_header): Ditto.
22397 (fixed_parameter): Ditto.
22398 (parameter_array): Ditto.
22399 (property_declaration): Ditto.
22401 * constant.cs (Constant::Constant): Update constructor similarly.
22402 Use System.Collections.
22404 * parameter.cs (Parameter::Parameter): Update as above.
22406 2001-09-02 Ravi Pratap <ravi@ximian.com>
22408 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
22409 (TypeContainer.delegates): New member to hold list of delegates.
22411 * cs-parser.jay (delegate_declaration): Implement the action correctly
22412 this time as I seem to be on crack ;-)
22414 2001-09-02 Miguel de Icaza <miguel@ximian.com>
22416 * rootcontext.cs (RootContext::IsNamespace): new function, used to
22417 tell whether an identifier represents a namespace.
22419 * expression.cs (NamespaceExpr): A namespace expression, used only
22420 temporarly during expression resolution.
22421 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
22422 utility functions to resolve names on expressions.
22424 2001-09-01 Miguel de Icaza <miguel@ximian.com>
22426 * codegen.cs: Add hook for StatementExpressions.
22428 * class.cs: Fix inverted test for static flag in methods.
22430 2001-09-02 Ravi Pratap <ravi@ximian.com>
22432 * class.cs (Operator::CheckUnaryOperator): Correct error number used
22433 to make it coincide with MS' number.
22434 (Operator::CheckBinaryOperator): Ditto.
22436 * ../errors/errors.txt : Remove error numbers added earlier.
22438 * ../errors/cs1019.cs : Test case for error # 1019
22440 * ../errros/cs1020.cs : Test case for error # 1020
22442 * cs-parser.jay : Clean out commented cruft.
22443 (dimension_separators, dimension_separator): Comment out. Ostensibly not
22444 used anywhere - non-reducing rule.
22445 (namespace_declarations): Non-reducing rule - comment out.
22447 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
22448 with TypeContainer::AddEnum.
22450 * delegate.cs : New file for delegate handling classes.
22451 (Delegate): Class for declaring delegates.
22453 * makefile : Update.
22455 * cs-parser.jay (delegate_declaration): Implement.
22457 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
22459 * class.cs (Event::Define): Implement.
22460 (Event.EventBuilder): New member.
22462 * class.cs (TypeContainer::Populate): Update to define all enums and events
22464 (Events): New property for the events arraylist we hold. Shouldn't we move to using
22465 readonly fields for all these cases ?
22467 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
22469 * class.cs (Property): Revamp to use the convention of making fields readonly.
22470 Accordingly modify code elsewhere.
22472 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
22473 the Define method of the Property class.
22475 * class.cs : Clean up applied patch and update references to variables etc. Fix
22477 (TypeContainer::Populate): Update to define all the properties we have. Also
22478 define all enumerations.
22480 * enum.cs (Define): Implement.
22482 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
22484 * cs-parser.jay (overloadable_operator): The semantic value is an
22485 enum of the Operator class.
22486 (operator_declarator): Implement actions.
22487 (operator_declaration): Implement.
22489 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
22490 validity of definitions.
22491 (Operator::CheckBinaryOperator): Static method to check for binary operators
22492 (TypeContainer::AddOperator): New method to add an operator to a type.
22494 * cs-parser.jay (indexer_declaration): Added line to actually call the
22495 AddIndexer method so it gets added ;-)
22497 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
22498 already taken care of by the MS compiler ?
22500 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
22502 * class.cs (Operator): New class for operator declarations.
22503 (Operator::OpType): Enum for the various operators.
22505 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
22507 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
22508 ostensibly handle this in semantic analysis.
22510 * cs-parser.jay (general_catch_clause): Comment out
22511 (specific_catch_clauses, specific_catch_clause): Ditto.
22512 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
22513 (catch_args, opt_catch_args): New productions.
22514 (catch_clause): Rewrite to use the new productions above
22515 (catch_clauses): Modify accordingly.
22516 (opt_catch_clauses): New production to use in try_statement
22517 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
22518 and re-write the code in the actions to extract the specific and
22519 general catch clauses by being a little smart ;-)
22521 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
22522 Hooray, try and catch statements parse fine !
22524 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
22526 * statement.cs (Block::GetVariableType): Fix logic to extract the type
22527 string from the hashtable of variables.
22529 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
22530 I end up making that mistake ;-)
22531 (catch_clauses): Fixed gross error which made Key and Value of the
22532 DictionaryEntry the same : $1 !!
22534 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
22536 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
22538 * cs-parser.jay (event_declaration): Correct to remove the semicolon
22539 when the add and remove accessors are specified.
22541 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
22543 * cs-parser.jay (IndexerDeclaration): New helper class to hold
22544 information about indexer_declarator.
22545 (indexer_declarator): Implement actions.
22546 (parsing_indexer): New local boolean used to keep track of whether
22547 we are parsing indexers or properties. This is necessary because
22548 implicit_parameters come into picture even for the get accessor in the
22549 case of an indexer.
22550 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
22552 * class.cs (Indexer): New class for indexer declarations.
22553 (TypeContainer::AddIndexer): New method to add an indexer to a type.
22554 (TypeContainer::indexers): New member to hold list of indexers for the
22557 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
22559 * cs-parser.jay (add_accessor_declaration): Implement action.
22560 (remove_accessor_declaration): Implement action.
22561 (event_accessors_declaration): Implement
22562 (variable_declarators): swap statements for first rule - trivial.
22564 * class.cs (Event): New class to hold information about event
22566 (TypeContainer::AddEvent): New method to add an event to a type
22567 (TypeContainer::events): New member to hold list of events.
22569 * cs-parser.jay (event_declaration): Implement actions.
22571 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
22573 * cs-parser.jay (dim_separators): Implement. Make it a string
22574 concatenating all the commas together, just as they appear.
22575 (opt_dim_separators): Modify accordingly
22576 (rank_specifiers): Update accordingly. Basically do the same
22577 thing - instead, collect the brackets here.
22578 (opt_rank_sepcifiers): Modify accordingly.
22579 (array_type): Modify to actually return the complete type string
22580 instead of ignoring the rank_specifiers.
22581 (expression_list): Implement to collect the expressions
22582 (variable_initializer): Implement. We make it a list of expressions
22583 essentially so that we can handle the array_initializer case neatly too.
22584 (variable_initializer_list): Implement.
22585 (array_initializer): Make it a list of variable_initializers
22586 (opt_array_initializer): Modify accordingly.
22588 * expression.cs (New::NType): Add enumeration to help us
22589 keep track of whether we have an object/delegate creation
22590 or an array creation.
22591 (New:NewType, New::Rank, New::Indices, New::Initializers): New
22592 members to hold data about array creation.
22593 (New:New): Modify to update NewType
22594 (New:New): New Overloaded contructor for the array creation
22597 * cs-parser.jay (array_creation_expression): Implement to call
22598 the overloaded New constructor.
22600 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
22602 * class.cs (TypeContainer::Constructors): Return member
22603 constructors instead of returning null.
22605 2001-08-26 Miguel de Icaza <miguel@ximian.com>
22607 * typemanager.cs (InitCoreTypes): Initialize the various core
22608 types after we have populated the type manager with the user
22609 defined types (this distinction will be important later while
22610 compiling corlib.dll)
22612 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
22613 on Expression Classification. Now all expressions have a method
22614 `Resolve' and a method `Emit'.
22616 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
22617 generation from working. Also add some temporary debugging
22620 2001-08-24 Miguel de Icaza <miguel@ximian.com>
22622 * codegen.cs: Lots of code generation pieces. This is only the
22623 beginning, will continue tomorrow with more touches of polish. We
22624 handle the fundamentals of if, while, do, for, return. Others are
22625 trickier and I need to start working on invocations soon.
22627 * gen-treedump.cs: Bug fix, use s.Increment here instead of
22630 * codegen.cs (EmitContext): New struct, used during code
22631 emission to keep a context. Most of the code generation will be
22634 * cs-parser.jay: Add embedded blocks to the list of statements of
22635 this block. So code generation proceeds in a top down fashion.
22637 2001-08-23 Miguel de Icaza <miguel@ximian.com>
22639 * statement.cs: Add support for multiple child blocks.
22641 2001-08-22 Miguel de Icaza <miguel@ximian.com>
22643 * codegen.cs (EmitCode): New function, will emit the code for a
22644 Block of code given a TypeContainer and its ILGenerator.
22646 * statement.cs (Block): Standard public readonly optimization.
22647 (Block::Block constructors): Link children.
22648 (Block::Child): Child Linker.
22649 (Block::EmitVariables): Emits IL variable declarations.
22651 * class.cs: Drop support for MethodGroups here, delay until
22653 (Method::): Applied the same simplification that I did before, and
22654 move from Properties to public readonly fields.
22655 (Method::ParameterTypes): Returns the parameter types for the
22656 function, and implements a cache that will be useful later when I
22657 do error checking and the semantic analysis on the methods is
22659 (Constructor::GetCallingConvention): Renamed from CallingConvetion
22660 and made a method, optional argument tells whether this is a class
22661 or a structure to apply the `has-this' bit.
22662 (Method::GetCallingConvention): Implement, returns the calling
22664 (Method::Define): Defines the type, a second pass is performed
22665 later to populate the methods.
22667 (Constructor::ParameterTypes): implement a cache similar to the
22668 one on Method::ParameterTypes, useful later when we do semantic
22671 (TypeContainer::EmitMethod): New method. Emits methods.
22673 * expression.cs: Removed MethodGroup class from here.
22675 * parameter.cs (Parameters::GetCallingConvention): new method.
22677 2001-08-21 Miguel de Icaza <miguel@ximian.com>
22679 * class.cs (TypeContainer::Populate): Drop RootContext from the
22682 (Constructor::CallingConvention): Returns the calling convention.
22683 (Constructor::ParameterTypes): Returns the constructor parameter
22686 (TypeContainer::AddConstructor): Keep track of default constructor
22687 and the default static constructor.
22689 (Constructor::) Another class that starts using `public readonly'
22690 instead of properties.
22692 (Constructor::IsDefault): Whether this is a default constructor.
22694 (Field::) use readonly public fields instead of properties also.
22696 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
22697 track of static constructors; If none is used, turn on
22698 BeforeFieldInit in the TypeAttributes.
22700 * cs-parser.jay (opt_argument_list): now the return can be null
22701 for the cases where there are no arguments.
22703 (constructor_declarator): If there is no implicit `base' or
22704 `this', then invoke the default parent constructor.
22706 * modifiers.cs (MethodAttr): New static function maps a set of
22707 modifiers flags into a MethodAttributes enum
22708 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
22709 MethodAttr, TypeAttr to represent the various mappings where the
22710 modifiers are used.
22711 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
22713 2001-08-19 Miguel de Icaza <miguel@ximian.com>
22715 * parameter.cs (GetParameterInfo): Fix bug where there would be no
22718 * interface.cs (PopulateIndexer): Implemented the code generator
22719 for interface indexers.
22721 2001-08-17 Miguel de Icaza <miguel@ximian.com>
22723 * interface.cs (InterfaceMemberBase): Now we track the new status
22726 (PopulateProperty): Implement property population. Woohoo! Got
22727 Methods and Properties going today.
22729 Removed all the properties for interfaces, and replaced them with
22730 `public readonly' fields.
22732 2001-08-16 Miguel de Icaza <miguel@ximian.com>
22734 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
22735 initialize their hashtables/arraylists only when they are needed
22736 instead of doing this always.
22738 * parameter.cs: Handle refs and out parameters.
22740 * cs-parser.jay: Use an ArrayList to construct the arguments
22741 instead of the ParameterCollection, and then cast that to a
22744 * parameter.cs: Drop the use of ParameterCollection and use
22745 instead arrays of Parameters.
22747 (GetParameterInfo): Use the Type, not the Name when resolving
22750 2001-08-13 Miguel de Icaza <miguel@ximian.com>
22752 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
22753 and instead use public readonly fields.
22755 * class.cs: Put back walking code for type containers.
22757 2001-08-11 Miguel de Icaza <miguel@ximian.com>
22759 * class.cs (MakeConstant): Code to define constants.
22761 * rootcontext.cs (LookupType): New function. Used to locate types
22764 2001-08-08 Miguel de Icaza <miguel@ximian.com>
22766 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
22767 this System.Reflection code is. Kudos to Microsoft
22769 * typemanager.cs: Implement a type cache and avoid loading all
22770 types at boot time. Wrap in LookupType the internals. This made
22771 the compiler so much faster. Wow. I rule!
22773 * driver.cs: Make sure we always load mscorlib first (for
22774 debugging purposes, nothing really important).
22776 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
22777 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
22779 * rootcontext.cs: Lookup types on their namespace; Lookup types
22780 on namespaces that have been imported using the `using' keyword.
22782 * class.cs (TypeContainer::TypeAttr): Virtualize.
22783 (Class::TypeAttr): Return attributes suitable for this bad boy.
22784 (Struct::TypeAttr): ditto.
22785 Handle nested classes.
22786 (TypeContainer::) Remove all the type visiting code, it is now
22787 replaced with the rootcontext.cs code
22789 * rootcontext.cs (GetClassBases): Added support for structs.
22791 2001-08-06 Miguel de Icaza <miguel@ximian.com>
22793 * interface.cs, statement.cs, class.cs, parameter.cs,
22794 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
22795 Drop use of TypeRefs, and use strings instead.
22797 2001-08-04 Miguel de Icaza <miguel@ximian.com>
22801 * class.cs (Struct::Struct): set the SEALED flags after
22802 checking the modifiers.
22803 (TypeContainer::TypeAttr): new property, returns the
22804 TypeAttributes for a class.
22806 * cs-parser.jay (type_list): Oops, list production was creating a
22807 new list of base types.
22809 * rootcontext.cs (StdLib): New property.
22810 (GetInterfaceTypeByName): returns an interface by type name, and
22811 encapsulates error handling here.
22812 (GetInterfaces): simplified.
22813 (ResolveTree): Encapsulated all the tree resolution here.
22814 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
22817 * driver.cs: Add support for --nostdlib, to avoid loading the
22818 default assemblies.
22819 (Main): Do not put tree resolution here.
22821 * rootcontext.cs: Beginning of the class resolution.
22823 2001-08-03 Miguel de Icaza <miguel@ximian.com>
22825 * rootcontext.cs: Provide better error reporting.
22827 * cs-parser.jay (interface_base): set our $$ to be interfaces.
22829 * rootcontext.cs (CreateInterface): Handle the case where there
22830 are no parent interfaces.
22832 (CloseTypes): Routine to flush types at the end.
22833 (CreateInterface): Track types.
22834 (GetInterfaces): Returns an array of Types from the list of
22835 defined interfaces.
22837 * typemanager.c (AddUserType): Mechanism to track user types (puts
22838 the type on the global type hash, and allows us to close it at the
22841 2001-08-02 Miguel de Icaza <miguel@ximian.com>
22843 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
22844 RecordInterface instead.
22846 * cs-parser.jay: Updated to reflect changes above.
22848 * decl.cs (Definition): Keep track of the TypeBuilder type that
22849 represents this type here. Not sure we will use it in the long
22850 run, but wont hurt for now.
22852 * driver.cs: Smaller changes to accomodate the new code.
22854 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
22857 * rootcontext.cs (CreateInterface): New method, used to create
22858 the System.TypeBuilder type for interfaces.
22859 (ResolveInterfaces): new entry point to resolve the interface
22861 (CodeGen): Property, used to keep track of the code generator.
22863 2001-07-26 Miguel de Icaza <miguel@ximian.com>
22865 * cs-parser.jay: Add a second production for delegate_declaration
22868 (enum_body): Put an opt_comma here instead of putting it on
22869 enum_body or enum_member_declarations so we can handle trailing
22870 commas on enumeration members. Gets rid of a shift/reduce.
22872 (type_list): Need a COMMA in the middle.
22874 (indexer_declaration): Tell tokenizer to recognize get/set
22876 * Remove old targets.
22878 * Re-add the parser target.
22880 2001-07-13 Simon Cozens <simon@simon-cozens.org>
22882 * cs-parser.jay: Add precendence rules for a number of operators
22883 ot reduce the number of shift/reduce conflicts in the grammar.
22885 2001-07-17 Miguel de Icaza <miguel@ximian.com>
22887 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
22890 Get rid of old crufty code.
22892 * rootcontext.cs: Use this to keep track of the parsed
22893 representation and the defined types available to the program.
22895 * gen-treedump.cs: adjust for new convention.
22897 * type.cs: Split out the type manager, and the assembly builder
22900 * typemanager.cs: the type manager will live here now.
22902 * cil-codegen.cs: And the code generator here.
22904 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
22906 * makefile: Fixed up for easy making.
22908 2001-07-13 Simon Cozens <simon@simon-cozens.org>
22910 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
22913 (unary_expression): Expand pre_increment_expression and
22914 post_decrement_expression to reduce a shift/reduce.
22916 2001-07-11 Simon Cozens
22918 * cs-tokenizer.cs: Hex numbers should begin with a 0.
22920 Improve allow_keyword_as_indent name.
22922 2001-06-19 Miguel de Icaza <miguel@ximian.com>
22924 * Adjustments for Beta2.
22926 2001-06-13 Miguel de Icaza <miguel@ximian.com>
22928 * decl.cs: Added `Define' abstract method.
22929 (InTransit): new property, used to catch recursive definitions.
22931 * interface.cs: Implement `Define'.
22933 * modifiers.cs: Map Modifiers.constants to
22934 System.Reflection.TypeAttribute flags.
22936 * class.cs: Keep track of types and user-defined types.
22937 (BuilderInit): New method for creating an assembly
22938 (ResolveType): New function to launch the resolution process, only
22939 used by interfaces for now.
22941 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
22942 that are inserted into the name space.
22944 2001-06-08 Miguel de Icaza <miguel@ximian.com>
22946 * ARGH. I have screwed up my tree so many times due to the use of
22947 rsync rather than using CVS. Going to fix this at once.
22949 * driver.cs: Objetify driver. Load assemblies, use assemblies to
22952 2001-06-07 Miguel de Icaza <miguel@ximian.com>
22954 * Experiment successful: Use System.Type rather that our own
22957 2001-05-25 Miguel de Icaza <miguel@ximian.com>
22959 * cs-parser.jay: Removed nsAliases from here.
22961 Use new namespaces, handle `using XXX;'
22963 * namespace.cs: Reimplemented namespace handling, use a recursive
22964 definition of the class. Now we can keep track of using clauses
22965 and catch invalid using clauses.
22967 2001-05-24 Miguel de Icaza <miguel@ximian.com>
22969 * gen-treedump.cs: Adapted for all the renaming.
22971 * expression.cs (Expression): this class now has a Type property
22972 which returns an expression Type.
22974 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
22975 `Type', as this has a different meaning now in the base
22977 2001-05-22 Miguel de Icaza <miguel@ximian.com>
22979 * interface.cs, class.cs: Removed from all the sources the
22980 references to signature computation, as we can not do method
22981 signature computation during the parsing time, as we are not
22982 trying to solve at that point distinguishing:
22986 void a (NS.Blah x) {}
22989 Which depending on the context might be valid or not, as we do not
22990 know if Blah is the same thing as NS.Blah at that point.
22992 * Redid everything so the code uses TypeRefs now instead of
22993 Types. TypeRefs are just temporary type placeholders, that need
22994 to be resolved. They initially have a pointer to a string and the
22995 current scope in which they are used. This is used later by the
22996 compiler to resolve the reference to an actual Type.
22998 * DeclSpace is no longer a CIR.Type, and neither are
22999 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
23000 are all DeclSpaces, but no Types.
23002 * type.cs (TypeRefManager): This implements the TypeRef manager,
23003 which keeps track of all the types that need to be resolved after
23004 the parsing has finished.
23006 2001-05-13 Miguel de Icaza <miguel@ximian.com>
23008 * ARGH. We are going to have to store `foreach' as a class rather
23009 than resolving it, as we need to verify error 1579 after name
23010 resolution. *OR* we could keep a flag that says `This request to
23011 IEnumerator comes from a foreach statement' which we can then use
23012 to generate the error.
23014 2001-05-10 Miguel de Icaza <miguel@ximian.com>
23016 * class.cs (TypeContainer.AddMethod): we now add methods to the
23017 MethodGroup instead of the method hashtable.
23019 * expression.cs: Add MethodGroup abstraction, which gets us one
23020 step closer to the specification in the way we handle method
23023 * cs-parser.jay (primary_expression): qualified_identifier now
23024 tried to match up an identifier to a local variable reference or
23025 to a parameter reference.
23027 current_local_parameters is now a parser global variable that
23028 points to the current parameters for the block, used during name
23031 (property_declaration): Now creates an implicit `value' argument to
23034 2001-05-09 Miguel de Icaza <miguel@ximian.com>
23036 * parameter.cs: Do not use `param' arguments as part of the
23037 signature, per the spec.
23039 2001-05-08 Miguel de Icaza <miguel@ximian.com>
23041 * decl.cs: Base class for classes, structs and interfaces. This
23042 is the "Declaration Space"
23044 * cs-parser.jay: Use CheckDef for checking declaration errors
23045 instead of having one on each function.
23047 * class.cs: Factor out some code for handling error handling in
23048 accordance to the "Declarations" section in the "Basic Concepts"
23049 chapter in the ECMA C# spec.
23051 * interface.cs: Make all interface member classes derive from
23052 InterfaceMemberBase.
23054 2001-05-07 Miguel de Icaza <miguel@ximian.com>
23056 * Many things: all interfaces are parsed and generated in
23057 gen-treedump. Support for member variables, constructors,
23058 destructors, properties, constants is there.
23060 Beginning of the IL backend, but very little done, just there for
23063 2001-04-29 Miguel de Icaza <miguel@ximian.com>
23065 * cs-parser.jay: Fix labeled statement.
23067 * cs-tokenizer.cs (escape): Escape " and ' always.
23068 ref_line, ref_name: keep track of the line/filename as instructed
23069 by #line by the compiler.
23072 2001-04-27 Miguel de Icaza <miguel@ximian.com>
23074 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
23075 to match the values in System.CodeDOM.
23077 Divid renamed to Divide.
23079 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
23081 (Statements.set): remove.
23083 * System.CodeDOM/CodeCatchClause.cs: always have a valid
23086 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
23087 falseStatements always have valid values.
23089 * cs-parser.jay: Use System.CodeDOM now.