1 2006-04-30 Raja R Harinath <harinath@gmail.com>
3 * flowanalysis.cs (Reachability): Make 4-argument constructor
5 (Reachability.Meet): Rename from 'And'. Remove static variant.
6 (Reachability.Always): Rename from the highly misleading
8 (FlowBranching.Merge): Update to changes. Mark an impossible
9 situation with a 'throw'.
10 (*): Update to changes.
12 2006-04-29 Raja R Harinath <harinath@gmail.com>
14 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
16 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
17 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
18 (*): Update to changes.
19 * statement.cs: Update to changes.
21 2006-04-28 Marek Safar <marek.safar@seznam.cz>
24 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
26 2006-04-28 Raja R Harinath <harinath@gmail.com>
28 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
31 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
32 argument to two arguments: an usage-vector and a bool. Move call
33 to FlowBranching.Merge () ...
34 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
36 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
37 handling of loop and switch reachability to ...
38 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
40 2006-04-27 Raja R Harinath <harinath@gmail.com>
42 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
43 handling to FlowBranchingLoop.InLoop.
44 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
46 2006-04-26 Marek Safar <marek.safar@seznam.cz>
49 anonymous.cs.cs (AnonymousMethod.DoResolve): Moved the check whether
50 anonymous method is allowed from AnonymousContainer here.
52 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
54 2006-04-24 Raja R Harinath <rharinath@novell.com>
57 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
59 2006-04-23 Marek Safar <marek.safar@seznam.cz>
62 constant.cs (FloatConstant.Reduce): Add range checking for checked context.
63 (DoubleConstant.Reduce): Ditto.
65 2006-04-23 Raja R Harinath <rharinath@novell.com>
67 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
68 Remove 'lvalue_right_side' argument. Move parts to ...
69 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
70 (LocalVariable.DoResolveLValue): ... these.
72 2006-04-21 Raja R Harinath <rharinath@novell.com>
75 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
76 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
77 (LocalVariableReference.DoResolveBase): Use it to implement new
79 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
80 (Argument.Resolve): Simplify. Move CS1510 check ...
81 * ecore.cs (Expression.ResolveLValue): ... here.
82 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
83 (PropertyExpr.DoResolveLValue): Likewise.
84 (FieldExpr.Report_AssignToReadonly): Likewise.
85 (FieldExpr.DoResolve): Add 'out_access' argument. Use
86 LValueMemberAccess or LValueMemberOutAccess on instance depending
88 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
89 DoResolve as appropriate.
91 2006-04-20 Raja R Harinath <rharinath@novell.com>
94 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
95 implicit conversions on 'out' and 'ref' arguments.
97 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
98 improve clarity. Remove dead code.
101 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
102 (Catch.Resolve): Resolve VarBlock if it exists.
104 2006-04-19 Miguel de Icaza <miguel@novell.com>
106 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
107 twice, this was some residual code, the enumerator was emitted
108 properly in the two branche of if later.
112 Thanks to Martin for finding the source of the problem
114 2006-04-19 Raja R Harinath <rharinath@novell.com>
116 * expression.cs (Cast.ResolveLValue): Remove. The result of a
117 cast is never an lvalue.
118 (Cast.DoResolve, Cast.ResolveRest): Combine.
119 (Argument.Emit): Simplify slightly. Move 'Expr is
120 IMemoryLocation' check ...
121 (Argument.Resolve): ... here.
122 (Argument.Error_LValueRequired): Remove. Inline into only user.
124 Simplifications. Fix cs0191-2.cs
125 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
126 CS1649 and CS1651 to ...
127 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
128 the actual selection of the error code and message to a lookup
129 table. Add a dummy return value to simplify callsites.
130 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
131 readonly fields of other instances of the same type. Move CS0197
133 * expression.cs (Argument.Resolve): ... here. Simplify code.
134 Ensure that ec.InRefOutArgumentResolving is only set during LValue
135 resolution of an out or ref argument. The code simplification
136 above uses this invariant.
138 2006-04-18 Raja R Harinath <rharinath@novell.com>
140 Possibly fix #77752. Fix cs1690-[4-7].cs.
141 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
142 CheckMarshallByRefAccess. Drop parameter.
143 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
145 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
147 * report.cs (AllWarnings): Add CS1690.
148 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
150 (LocalVariableReference.DoResolveBase): Update.
152 2006-04-09 Marek Safar <marek.safar@seznam.cz>
154 class.cs (MethodOrOperator): Moved common parts from method class.
155 detect obsolete attributes.
156 (Method.Define): Simplified as it reuses code from base.
157 (Constructor.ValidAttributeTargets): Fixed issue found during
159 (Destructor.ValidAttributeTargets): Fixed issue found during
161 (Operator): Finished refactoring set off by #78020. Operator class is now
162 ordinary method class.
164 * anonymous.cs: Updated.
166 2006-04-09 Marek Safar <marek.safar@seznam.cz>
168 (Constructor.Emit): Don't emit the attributes twice.
170 2006-04-09 Marek Safar <marek.safar@seznam.cz>
172 class.cs (Operator.Emit): Extracted code from MethodData to correctly
173 detect obsolete attributes.
174 (Method.CreateEmitContext): Moved to MethodOrOperator.
176 2006-04-09 Marek Safar <marek.safar@seznam.cz>
179 class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
180 customized exception to make crash detection easier.
181 (MethodOrOperator): Started to work on new base class for methods and
183 (Method): Derives from MethodOrOperator.
184 (Constructor.Emit): Emits its own attributes.
185 (AbstractPropertyEventMethod.Emit): Ditto.
186 (Operator): Derives from MethodOrOperator, will refactor fully in extra
188 (Operator.Emit): It's temporary more tricky than should be.
190 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
192 * report.cs (InternalErrorException): Add ctor with inner exception.
194 2006-04-08 Marek Safar <marek.safar@seznam.cz>
197 ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
200 2006-04-07 Marek Safar <marek.safar@seznam.cz>
203 expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
206 2006-04-06 Marek Safar <marek.safar@seznam.cz>
208 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
209 attribute is present and Guid not.
210 (Interface.ApplyAttributeBuilder): Ditto.
212 * attribute.cs: Add error message.
214 2006-04-06 Marek Safar <marek.safar@seznam.cz>
218 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
219 sources (it's composite) so hold them in extra array as they are used in
220 Emit phase only. It worked in the previous versions by mistake.
221 (Attribute.Emit): Emit attribute for more owners when exist.
223 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
224 it has now different behaviour.
226 2006-04-04 Marek Safar <marek.safar@seznam.cz>
228 * constant.cs (Constant.IsDefaultInitializer): New method.
232 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
233 re-initialize default values. It saves KBs almost for every assembly.
234 Thanks Zoltan for the idea.
235 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
236 (ArrayCreation.DoResolve): Resolve only once.
237 (ArrayCreation.Emit): Emit static initializer only when it is faster.
238 (ArrayCreation.GetAttributableValue): Cope with optimized values.
240 2006-04-03 Zoltan Varga <vargaz@gmail.com>
242 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
245 2006-04-01 Marek Safar <marek.safar@seznam.cz>
247 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
248 in an embedded statement too.
250 2006-04-01 Raja R Harinath <rharinath@novell.com>
253 * typemanager.cs (IsNestedChildOf): Drop generic arguments before
257 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
260 * report.cs (SymbolRelatedToPreviousError): Drop generic type
261 arguments before checking whether a type is reflected or not.
264 * expression.cs (Invocation.IsApplicable): Ensure a generic method
265 definition doesn't take part in overload resolution.
266 (Invocation.IsParamsMethodApplicable): Likewise.
267 (Invocation.OverloadResolve): When replacing a reflected override
268 method with its base definition, ensure that type arguments are
271 2006-04-01 Marek Safar <marek.safar@seznam.cz>
275 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
278 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
280 2006-03-31 Marek Safar <marek.safar@seznam.cz>
282 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
285 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
286 LocalTemporary change.
288 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
290 (ClassOrStruct.DefineFieldInitializers): Implemented static field
291 initializers optimization.
292 (ClassOrStruct.TypeAttr): Moved from modifiers.
293 (Constructor.CheckBase): Don't crash when static ctor has parameters.
294 (FieldBase.ResolveInitializer): Resolves initializer.
295 (FieldBase.HasDefaultInitializer): New property.
297 * cs-parser.jay: Removed message.
299 * expression.cs (CompilerGeneratedThis): New specialization.
301 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
303 2006-03-28 Marek Safar <marek.safar@seznam.cz>
305 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
307 2006-03-27 Marek Safar <marek.safar@seznam.cz>
309 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
310 be now EnumConstants only.
312 2006-03-27 Marek Safar <marek.safar@seznam.cz>
314 * attribute.cs, driver.cs: Reset more caches.
316 2006-03-26 Marek Safar <marek.safar@seznam.cz>
318 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
320 2006-03-26 Marek Safar <marek.safar@seznam.cz>
322 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
323 for easier reuse. Updated all overrides.
324 (IntegralConstant): New base class for all integral constants.
325 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
326 of the constant range, report custom error.
327 (UIntConstant.Reduce): Fixed uint conversion.
329 * ecore.cs, literal.cs: Reduce updates.
331 2006-03-26 Marek Safar <marek.safar@seznam.cz>
335 * class.cs (Constructor.Define): Removed extra if for default ctors.
336 A patch from Atsushi Enomoto.
338 2006-03-26 Marek Safar <marek.safar@seznam.cz>
340 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
341 GetAttributableValue.
343 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
346 * convert.cs (ImplicitConversionRequired): Error message moved to
349 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
350 automatic implicit conversion of an output value.
351 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
353 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
355 (TypeOf.GetAttributableValue): Add extra handling for object type.
357 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
358 special error message.
360 2006-03-25 Marek Safar <marek.safar@seznam.cz>
362 * class.cs (Constructor.Emit): Don't crash when struct ctor is
364 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
365 compatible with MS runtime.
367 2006-03-23 Marek Safar <marek.safar@seznam.cz>
369 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
370 attribute arguments here.
372 * class.cs (Indexer.Define): The check was moved to attribute class.
374 2006-03-21 Marek Safar <marek.safar@seznam.cz>
376 * expression.cs (StringConcat.Append): Reverted back to no warning state.
378 2006-03-21 Marek Safar <marek.safar@seznam.cz>
380 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
382 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
385 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
387 * doc-bootstrap.cs : fix build.
389 2006-03-20 Marek Safar <marek.safar@seznam.cz>
391 * expression.cs (StringConcat.Append): Issue a warning when empty string
394 2006-03-20 Marek Safar <marek.safar@seznam.cz>
396 * assign.cs (CompoundAssign.ResolveSource): Removed.
398 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
401 * class.cs (TypeContainer.FindMethods): Removed.
402 (TypeContainer.CheckMemberUsage): Made static.
404 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
406 * constant.cs (CheckRange): Removed unused type argument.
407 (CheckUnsigned): Removed unused type argument.
409 * cs-parser.jay: Updated after MemberAccess clean up.
410 Uses Length for empty string test.
412 * cs-tokenizer.cs: Uses Length for empty string test.
413 (IsCastToken): Made static.
414 (is_hex): Made static.
415 (real_type_suffix): Made static.
417 * decl.cs (SetupCache): Made static.
418 (OnGenerateDocComment): Removed unused ds argument.
420 * delegate.cs (VerifyDelegate): Removed unused argument.
422 * doc.cs: Uses Length for empty string test.
424 * driver.cs: Uses Length for empty string test.
426 * enum.cs (IsValidEnumType): Made static
428 * expression.cs (EnumLiftUp): Removed unused argument.
429 (ResolveMethodGroup): Ditto.
430 (BetterConversion): Ditto.
431 (GetVarargsTypes): Ditto.
432 (UpdateIndices): Ditto.
433 (ValidateInitializers): Ditto.
434 (MemberAccess.ctor): Ditto.
435 (GetIndexersForType): Ditto.
437 * flowanalysis.cs: (MergeFinally): Removed unused argument.
439 * iterators.cs: Updated after MemberAccess clean up.
441 * location.cs: Uses Length for empty string test.
443 * namespace.cs: Uses Length for empty string test.
445 * report.cs (CheckWarningCode): Made static.
447 * statement.cs (LabeledStatement): Removed unused argument.
449 * typemanager.cs (FilterNone): Removed.
451 2006-03-18 Marek Safar <marek.safar@seznam.cz>
453 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
458 2006-03-18 Marek Safar <marek.safar@seznam.cz>
460 * cs-parser.jay.cs: __arglist is not allowed for delegates.
462 2006-03-18 Marek Safar <marek.safar@seznam.cz>
466 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
468 (AnonymousMethod.ImplicitStandardConversionExists): New method.
469 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
470 Add more error reporting; Fixed issue with params.
472 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
474 * cs-parser.jay: AnonymousMethod requires host container.
476 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
478 2006-03-18 Raja R Harinath <harinath@gmail.com>
480 * class.cs: Change 'TypeContainer ds' constructor argument to
481 'DeclSpace parent'. Some classes were missed below due to
482 different naming convention.
484 * class.cs (MemberCore.Parent): Delete. This makes the
485 ParentContainer changes below enforceable by the compiler.
487 Treat pointers to enclosing declaration space as 'DeclSpace', not
489 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
490 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
492 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
494 (Block.AddThisVariable): Likewise.
495 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
496 (AbstractPropertyEventMethod.Emit): Likewise.
497 (AbstractPropertyEventMethod.EmitMethod): Likewise.
498 (GetMethod.Define, SetMethod.Define): Likewise.
499 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
500 (DelegateMethod.EmitMethod): Likewise.
502 Fix regression test-partial-13.cs.
503 Rationalize use of PartialContainer. Ensure that the partial
504 class semantics can be tied to type-correctness, i.e., any
505 violation will cause a compile error.
506 * class.cs, const.cs: Access all fields that belong to class
507 TypeContainer via ParentContainer. Arguments of EmitContexts and
508 Resolve()-like functions still use 'Parent'.
510 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
511 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
512 (PropertyMethod.CheckModifiers): Remove unused argument.
513 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
516 2006-03-28 Raja R Harinath <rharinath@novell.com>
518 * decl.cs (DeclSpace.LookupGeneric): Update to changes.
520 2006-03-17 Raja R Harinath <harinath@gmail.com>
522 Make semantics of PartialContainer simpler.
523 * decl.cs (DeclSpace.IsPartial): Remove.
524 * class.cs (TypeContainer.IsPartial): Likewise.
525 (TypeContainer..ctor): Set PartialContainer to point to self.
526 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
527 (TypeContainer.FindNestedType): Likewise.
528 (MemberCore.ParentContainer): Simplify. Remove deprecation.
530 2006-03-17 Marek Safar <marek.safar@seznam.cz>
532 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
534 2006-03-15 Marek Safar <marek.safar@seznam.cz>
536 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
539 2006-03-15 Marek Safar <marek.safar@seznam.cz>
541 * class.cs (Operator.Define): An error for base conversion was not
544 2006-03-13 Marek Safar <marek.safar@seznam.cz>
546 A fix for #77593, #77574.
548 * class.cs (MethodCore.CheckBase): Another if for operator.
550 2006-03-18 Marek Safar <marek.safar@seznam.cz>
554 * expression.cs (VerifyArgumentsCompat): Reverted to double error
555 reporting, it's more tricky than I thought.
557 2006-03-09 Marek Safar <marek.safar@seznam.cz>
559 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
562 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
563 (DelegateCreation.ImplicitStandardConversionExists): New method for just
566 * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
569 2006-03-04 Marek Safar <marek.safar@seznam.cz>
573 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
574 (Event.Define): ditto
575 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
577 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
578 Removed redundant code and set NewSlot for Invoke method too.
580 * parameter.cs (Parameters.ctor): Add custom, type ctor.
581 (Parameters.MergeGenerated): New method. Use this method when you merge
582 compiler generated argument with user arguments.
584 2006-03-03 Marek Safar <marek.safar@seznam.cz>
586 * attribute.cs (ResolveAsTypeTerminal): Removed.
588 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
589 specialization for predefined types; 30% speed up.
590 Finally placed obsolete check to right place.
591 (Expression.ResolveType): Removed.
593 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
594 Updated after ResolveType was removed.
596 * expression.cs (Cast.ctor): Check void cast.
597 (Binary.ResolveAsTypeTerminal): Is never type.
598 (Conditional.ResolveAsTypeTerminal): Is never type.
600 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
602 2006-03-26 Marek Safar <marek.safar@seznam.cz>
604 * rootcontext.cs (ResolveCore): Removed System.INullableValue.
606 2006-03-23 Martin Baulig <martin@ximian.com>
608 * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
609 type check if either of the types is an open generic type.
611 2006-03-23 Martin Baulig <martin@ximian.com>
614 (Convert.ExplicitTypeParameterConversion): New method; implement
615 explicit type parameter conversions.
617 2006-03-23 Martin Baulig <martin@ximian.com>
619 * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
620 blindly allow all conversions if we do not have any constraints.
622 2006-02-27 Marek Safar <marek.safar@seznam.cz>
624 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
625 these two separated members to simplify the code.
626 (Attribute.Resolve): Refactored to use new fields and methods.
627 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
628 implemented obsolete attribute checking.
629 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
630 implemented obsolete checking again. It look line never ending quest ;-)
631 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
633 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
635 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
637 *class.cs (Property.Define): Add RegisterProperty call.
639 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
640 argument groups (only 2).
642 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
643 encoding expression to arguments.
644 (Expression.ExprClassToResolveFlags): Just turned to property.
646 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
647 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
648 optimized as well as implemented support for zero-length attributes.
650 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
651 Add caching of PropertyInfo's.
653 2006-02-25 Marek Safar <marek.safar@seznam.cz>
655 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
656 error multiple times.
658 2006-02-25 Marek Safar <marek.safar@seznam.cz>
660 New partial class implementation.
661 A fix for #77027, #77029, #77403
663 * attribute.cs (Attributable): Made attributes protected.
665 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
666 the replacements of ClassPart and PartialContainer.
667 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
668 (TypeContainer.AddInterface): Ditto.
669 (TypeContainer.AddPartial): The main method for partial classes. It checks
670 for errors and merges ModFlags and attributes. At the end class is added to
672 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
674 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
675 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
676 from the rest of partial classes.
677 (TypeContainer.GetClassBases): Simplified.
678 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
680 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
681 (TypeContainer.HasExplicitLayout): Uses Flags now.
682 (PartialContainer): Removed.
683 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
684 (StaticClass): Was merged with Class.
685 (Class.GetClassBases): class and static class bases are verified here.
686 (Class.TypeAttr): Added static attributes when class is static.
687 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
688 (MemberBase): In some cases we need to call parent container for partial
689 class. It should be eliminated but it's not easy now.
691 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
693 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
694 partial classed to accumulate class comments.
695 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
697 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
699 * driver.cs (MainDriver): Tree.GetDecl was removed.
701 * modifiers.cs (Modifiers): Add partial modifier.
703 * tree.cs (Tree.decl): Removed.
704 (RootTypes): Started to use this class more often for root types
707 2006-03-23 Raja R Harinath <rharinath@novell.com>
709 * generic.cs (TypeParameter.UpdateConstraints): Update
710 'constraints' if null.
712 2006-02-22 Marek Safar <marek.safar@seznam.cz>
716 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
717 external interface does not have an attribute.
719 2006-02-22 Marek Safar <marek.safar@seznam.cz>
721 Another prerequisites for new partial classs implementation.
723 * attribute.cs (Attribute.Equal): Implemented.
724 (Attribute.Emit): Changed as attributes can be applied more than twice.
725 (Attributes.Emit): Check for duplicate attributes here.
727 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
728 as a parameter, clean-up.
730 2006-02-11 Marek Safar <marek.safar@seznam.cz>
734 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
735 contains obsolete attribute check which can in some cases look for base
736 type of current class which is not initialized yet.
737 (TypeContainer.BaseType): Replacement of ptype.
739 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
741 2006-02-11 Marek Safar <marek.safar@seznam.cz>
743 First of prerequisites for new partial classs implemention.
745 * attribute.cs (Attributable): Extended by ResolveContext;
746 Attributes finally have correct context for resolving in all cases.
747 (AttachTo): Attribute owner is assigned here.
749 * codegen.cs (IResolveContext): Introduce new interface to hold
750 all information needed in resolving phase.
751 (EmitContext): Implements IResolveContext; more clean-up needed here.
753 * decl.cs (MemberCore): Implemented IResolveContext.
755 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
756 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
757 parameter.cs, statement.cs, tree.cs, typemanager.cs:
758 Refactored to use new IResolveContext instead of EmitContext; cleanup
760 2006-03-22 Raja R Harinath <rharinath@novell.com>
762 Support ParameterDefaultValueAttribute in gmcs. Also applied to
763 mcs to keep code differences small.
764 * attribute.cs (Attribute.GetParameterDefaultValue): New.
765 * typemanager.cs (parameter_default_value_attribute_type): New.
766 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
769 2006-03-22 Martin Baulig <martin@ximian.com>
772 (Nullable.NullableLiteral): Derive from `NullLiteral'.
775 (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
776 instead of the normal `NullLiteral'.
778 2006-03-21 Martin Baulig <martin@ximian.com>
781 * generic.cs (TypeManager.InferType): If `pt' is a generic
782 parameter, don't check whether `pt == at'.
784 2006-03-20 Raja R Harinath <rharinath@novell.com>
787 * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
788 (TypeParameter.Resolve): Update to change.
789 (ConstraintChecker.CheckConstraints): Resolve type-argument
790 constraints before use.
792 2006-03-16 Martin Baulig <martin@ximian.com>
795 (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
796 and don't have any instance constructors, also lookup in the base class.
797 (TypeManager.IsNullableValueType): New public method.
799 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
800 `BindingFlags.DeclaredOnly' flag and set `used_cache'.
801 (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
803 * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
804 instead of just TypeManager.IsNullableType() to determine whether
805 a lifted operator exists.
806 (UnaryMutator.DoResolve): Likewise.
807 (Conditional.DoResolve): Likewise.
808 (Binary.DoResolve): A lifted operator only exists if both operands
809 are valuetypes and at least one of them is a nullable type.
811 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
813 * iterator.cs : yield break is allowed in try statement which has
814 catch clauses. Fixed bug #77767.
816 2006-03-12 Martin Baulig <martin@ximian.com>
818 * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
819 private IsSignatureEqual() to compare types; see the comment in
820 that method; fixes #77674.
822 2006-03-10 Raja R Harinath <rharinath@novell.com>
824 * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
825 (Expression.ResolveAsTypeTerminal): Likewise.
826 * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
827 * expression.cs, generic.cs, iterators.cs: Likewise.
828 * parameter.cs, statement.cs, typemanager.cs: Likewise.
830 2006-03-09 Martin Baulig <martin@ximian.com>
832 * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
833 TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
835 2006-03-09 Martin Baulig <martin@ximian.com>
837 * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
838 `prepared' flag is set.
840 * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
841 (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
842 issues; see gtest-254.cs.
844 2006-03-07 Martin Baulig <martin@ximian.com>
846 * generic.cs (TypeManager.InferType): Allow infering
847 `IEnumerable<T>' with an array of T; see gtest-251.cs.
849 2006-03-06 Martin Baulig <martin@ximian.com>
852 (TypeManager.InferType): Fix gtest-250.cs.
855 (TypeManager.IsSubclassOf): Also check the base class.
858 (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
861 2006-03-01 Raja R Harinath <rharinath@novell.com>
864 * expression.cs (ParameterReference.DoResolveBase): Change return
866 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
870 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
873 * typemanager.cs (GetFullNameSignature): Don't nullref on
876 2006-02-16 Martin Baulig <martin@ximian.com>
879 (TypeManager.GetGenericFieldDefinition): New public method; use it
880 instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
882 2006-02-14 Martin Baulig <martin@ximian.com>
884 * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
886 2006-02-14 Martin Baulig <martin@ximian.com>
889 (TypeManager.DropGenericMethodArguments): New public method; don't
890 use GetGenericMethodDefinition() on something which is not a
893 2006-02-14 Martin Baulig <martin@ximian.com>
896 (ConstraintChecker.CheckConstraints): If a type parameter has the
897 `struct' constraint, the type must be a non-nullable valuetype.
899 2006-02-10 Martin Baulig <martin@ximian.com>
902 (TypeManager.IsOverride): Make this work for instantiated methods
903 in a generic class; fixes #77509.
904 (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
905 rather than calling it directly; fixes #77488.
907 2006-02-08 Martin Baulig <martin@ximian.com>
909 * generic.cs (ConstraintChecker.CheckConstraints): Move the error
910 reporting into CheckConstraint() so we can use the correctly
913 2006-02-08 Martin Baulig <martin@ximian.com>
915 * expression.cs (BaseAccess): Add support for generic methods.
917 * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
918 the new MethodGroupExpr.
920 2006-02-07 Martin Baulig <martin@ximian.com>
922 * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
923 also reference types; fixes #77483.
925 2006-02-07 Martin Baulig <martin@ximian.com>
928 (TypeManager.IsGenericMethod): We now return whether something is
929 an instantiated generic method (and not a generic method def).
930 (TypeManager.IsGenericMethodDefinition): New public method.
933 (TypeManager.CSharpSignature): Only include type arguments for
934 "real" generic methods, not for any instantiated method.
935 (TypeManager.GetMethodName): Likewise, but also allow generic
936 method definitions here.
938 2006-02-06 Miguel de Icaza <miguel@novell.com>
940 * codegen.cs (EmitScopeInitFromBlock): check here the
941 capture_context, there is no need to make two calls to the
944 * anonymous.cs: Add some debugging messages that might help me
945 track other instances of this problem in the future (the
946 regression of test 467).
948 * cs-parser.jay: track the variable block, as we need to initalize
949 any captured variables declared in this block for the "catch"
950 portion of the "Try" statement.
952 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
953 scope initialization for captured variables.
955 Also, move the emit for the variables after the block location has
958 2006-02-06 Marek Safar <marek.safar@seznam.cz>
960 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
962 2006-02-06 Martin Baulig <martin@ximian.com>
964 * class.cs (TypeContainer.DefineType): If we're a struct, pass
965 `TypeManager.value_type' as parent type to
966 ModuleBuilder.DefineType(). Fixes #77358.
968 2006-02-02 Miguel de Icaza <miguel@novell.com>
970 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
971 commit yesterday, the initialization for the roots is necessary.
972 What is not necessary is the scope activation.
974 2006-02-02 Raja R Harinath <rharinath@novell.com>
976 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
977 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
979 (Argument.Resolve): Remove CS0206 checks.
981 2006-02-01 Miguel de Icaza <miguel@novell.com>
983 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
984 scopes for all the roots, the scopes will now be emitted when the
985 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
987 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
988 code. This reduces a lot of existing cruft.
990 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
991 that the ScopeInfo is generated as we enter the scope, not at the
992 time of use, which is what we used to do before.
994 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
995 every time a Block is about to be emitted if we have a
998 2006-02-01 Raja R Harinath <rharinath@novell.com>
1000 * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
1001 attribute for mscorlib too.
1003 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
1005 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
1007 * typemanager.cs (cons_param_array_attribute): Make private.
1008 (Reset): Set it to null.
1009 (InitCoreHelpers): Don't initialize it.
1010 (ConsParamArrayAttribute): New. Initialize it as needed.
1011 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
1013 2006-01-31 Miguel de Icaza <miguel@novell.com>
1015 * expression.cs: There might be errors reported during the
1016 selection of applicable methods. If there are errors, do not
1017 continue execution as it will lead the compiler to crash.
1019 2006-01-30 Miguel de Icaza <miguel@novell.com>
1021 * expression.cs: Member access is not allowed on anonymous
1022 methods. Fixes #77402.
1024 2006-01-30 Raja R Harinath <rharinath@novell.com>
1027 * cs-parser.jay (VariableDeclaration): Don't set
1028 current_array_type to null.
1029 (field_declaration, event_declaration, declaration_statement):
1030 Set it to null here.
1032 2006-01-29 Raja R Harinath <harinath@gmail.com>
1035 * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
1037 2006-01-28 Raja R Harinath <harinath@gmail.com>
1039 * typemanager.cs (GenericParameterPosition): New.
1042 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
1044 * doc.cs : To process "include" elements, first we should create
1045 another list than XmlNodeList, because it could result in node
1046 removal, which could result in that the XmlNodeList gives up
1049 2006-01-25 Miguel de Icaza <miguel@novell.com>
1051 * expression.cs: Introduce an error report that we were not
1052 catching before. Gonzalo ran into it.
1054 2006-01-23 Miguel de Icaza <miguel@novell.com>
1056 A fix for bug: #76957
1058 * iterators.cs (MoveNextMethod.CreateMethodHost): call
1059 ComputeMethodHost before creating the method, this is a new
1062 * anonymous.cs (AnonymousContainer): Now we track all the scopes
1063 that this method references (RegisterScope). The actual scope
1064 where the method is hosted is computed with the ComputeMethodHost
1065 before we create the method.
1067 Moved the Deepest routine here.
1069 (AnonymousContainer.ComputeMethodHost): New routine used to
1070 compute the proper ScopeInfo that will host the anonymous method.
1072 (ScopeInfo): Deal with multiple roots. The problem was that we
1073 did not have a unique root where all ScopeInfos could be hanged
1074 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
1077 Remove AdjustMethodScope which is now computed at the end. Remove
1078 LinkScope which did a partial link, instead link all ScopeInfos
1079 before code generation from the new "LinkScopes" routine.
1081 Simplify all the Add* routines as they no longer need to maintain
1082 the tree, they just need to record that they are using variables
1085 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1086 routines to produce the forest of ScopeInfo trees.
1088 * class.cs (TypeContainer.AppendMethod): This is just like
1089 AddMethod, but ensures that an interface implementation method
1090 (IEnumerable.XXX) is not inserted at the beginning of the queue of
1091 methods, but at the end.
1093 We use this functionality to ensure that the generated MoveNext
1094 method in the iterator class is resolved/emitted before the
1095 enumerator methods created.
1097 This is required because the MoveNext method computes the right
1098 ScopeInfo for the method. And the other methods will eventually
1099 need to resolve and fetch information computed from the anonymous
1103 2006-01-23 Raja R Harinath <rharinath@novell.com>
1105 Improve implementation of section 14.4.2.2 (Better function member).
1106 * expression.cs (Invocation.MoreSpecific): Compare all type
1107 arguments before deciding if one type is more specific than
1108 another. Handle array types too. Return the more specific type.
1109 (Invocation.BetterFunction): Add more tie-breaking rules from
1110 section 14.4.2.2. Perform "more specific" check after
1111 other tie-breaking rules. Compare all parameter types before
1112 choosing the "more specific" method.
1114 2006-01-21 Raja R Harinath <harinath@gmail.com>
1115 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1118 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
1120 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
1121 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
1123 2006-01-18 Martin Baulig <martin@ximian.com>
1125 * class.cs (TypeContainer.AddToMemberContainer): Use
1126 `symbol.MemberName.MethodName' instead of just `symbol.Name';
1129 2006-01-18 Martin Baulig <martin@ximian.com>
1131 Fix #76417: a generic class may now have methods which may unify
1132 for some type parameter substitutions.
1134 * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
1135 for methods which may unify anymore.
1137 * expression.cs (Invocation.MoreSpecific): New private static
1138 method; checks whether one method is more specific than another
1139 according to 14.4.2.2 of the spec.
1140 (Invocation.BetterFunction): Implement the tie-breaking rules from
1141 14.4.2.2 of the spec: if two methods unify for some type parameter
1142 substitution, we need to pick the more specific one.
1144 2006-01-18 Raja R Harinath <rharinath@novell.com>
1146 Fix #76656, cs0231-2.cs.
1147 * cs-parser.jay (formal_parameter_list): Make error case catch
1149 (parenthesized_expression_0): Add CS1026 check.
1150 (invocation_expression): Remove unused { $$ = lexer.Location }.
1152 2006-01-17 Raja R Harinath <rharinath@novell.com>
1155 * cs-parser.jay (statement_expression): Don't list out the
1156 individual statement-expressions. Convert syntax error into
1159 2006-01-16 Raja R Harinath <rharinath@novell.com>
1162 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
1163 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
1164 CheckIntermediateModification.
1165 (FieldExpr.DoResolve): Add new two-argument version that
1166 allows us to resolve the InstanceExpression as an lvalue.
1167 The one-argument variant is now just a wrapper.
1168 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
1169 Resolve the lhs as an lvalue if the it has a value type.
1170 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
1171 from Assign.DoResolve.
1172 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
1173 resolved as an lvalue.
1174 (PropertyExpr.DoResolve): Update.
1175 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
1176 has a value type. Move CS1612 check here from
1177 CheckIntermediateModification.
1178 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
1179 * expression.cs (EmptyExpression.OutAccess): New. Used as the
1180 'right_side' of a ResolveLValue on an 'out' argument.
1181 (EmptyExpression.LValueMemberAccess): New. Used as the
1182 'right_side' of a propagated ResolveLValue on a value type.
1183 (LocalVariableReference.DoResolveBase): Recognize
1184 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
1186 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
1187 EmptyExpression.Null.
1189 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
1191 * typemanager.cs : added IsGenericParameter(). In gmcs it returns
1192 Type.IsGenericParameter(). Fixed bug #77183.
1193 * doc.cs : it is now identical to doc.cs in mcs.
1195 2006-01-16 Martin Baulig <martin@ximian.com>
1197 * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
1199 2006-01-16 Martin Baulig <martin@ximian.com>
1201 * typemanager.cs (TypeManager.CSharpSignature): Make this work for
1202 ctors; fixes #77250.
1204 2006-01-12 Miguel de Icaza <miguel@novell.com>
1206 This fixes the problem where we used ldfld instead of ldflda to
1207 load the "THIS" pointer on captured parameters, when THIS is a
1208 value type. See bug #77205.
1210 * iterators.cs (CapturedThisReference.Emit): Pass false to
1211 EmitThis (we do not need the address).
1213 * codegen.cs (EmitThis): it needs to know whether we need the
1214 address of `this' or not. This is used by value types.
1216 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
1217 every other call passes false.
1219 2006-01-12 Raja R Harinath <rharinath@novell.com>
1222 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
1224 * expression.cs (Invocation.OverloadResolve): Update.
1225 (Invocation.DoResolve): Avoid double resolution of invocation.
1227 2006-01-11 Raja R Harinath <rharinath@novell.com>
1230 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
1231 unary negation of floating point types as 0-expr; negation cannot
1232 overflow in floating point types.
1235 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
1236 on operands of 'void' type.
1239 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
1240 and ExclusiveOr for boolean constants too.
1242 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
1244 * expression.cs: Fix Console.WriteLine ((this = x).foo);
1246 2006-01-12 Miguel de Icaza <miguel@novell.com>
1248 * cs-tokenizer.cs (Position): New class used to save and restore
1249 the position state in the tokenizer. Before this patch the save
1250 and restore was not complete enough so the line and columns would
1251 start to drift and the debugger and stack traces will get the
1254 2006-01-10 Martin Baulig <martin@ximian.com>
1257 (TypeParameter.InflateConstraints): New public method.
1259 * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
1260 constraints; fixes #77042.
1262 2006-01-10 Martin Baulig <martin@ximian.com>
1264 * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
1265 instead of the `TypeBuilder' for this "<>THIS" variable; fixes
1268 2006-01-09 Raja R Harinath <rharinath@novell.com>
1271 * expression.cs (Invocation.OverloadResolve): Replace reflected
1272 override methods with their base virtual methods, rather than
1274 * typemanager.cs (TypeManager.GetOverride): New.
1276 2005-12-21 Miguel de Icaza <miguel@novell.com>
1278 * driver.cs: Report the case of no source files and no -out:
1281 2005-12-20 Raja R Harinath <rharinath@novell.com>
1284 * expression.cs (ComposedCast.GetSignatureForError): Define.
1286 2006-01-05 Jb Evain <jbevain@gmail.com>
1288 * class.cs (Property.Define, Indexer.Define): do not tag the
1289 properties as SpecialName | RTSpecialName.
1291 2006-01-04 Miguel de Icaza <miguel@novell.com>
1293 * class.cs (MethodCore.IsDuplicateImplementation): This method was
1294 doing a low-level comparission of parameter types. It was lacking
1295 a check for __argslist.
1297 2005-12-30 Miguel de Icaza <miguel@novell.com>
1299 * expression.cs (ParameterReference.DoResolveBase): Allow
1300 reference parameters if they are local to this block.
1302 This allows the ref and out parameters of a delegate to be used in
1303 an anonymous method, for example:
1305 delegate void set (out int x);
1307 set s = delegate (out int x){
1311 This is used by functionality introduced late in the C# language.
1313 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1314 method that take ref and out parameters.
1316 Fixes #77119 which was a late change in the spec.
1318 2005-12-23 Miguel de Icaza <miguel@novell.com>
1320 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1321 parent if its the same scope. Fixes #77060.
1323 2005-12-22 Marek Safar <marek.safar@seznam.cz>
1325 * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
1327 2005-12-21 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1329 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
1330 errors 1726 for strong named assemblies with InternalsVisibleToAttribute
1331 that doesn't contain the full public key. This is a update of the
1332 friend assemblies in .Net 2.0 release.
1334 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1338 * namespace.cs (NamespaceEntry): Add extern_aliases as a
1339 ListDictionary, to contain the ExternAliasEntry entries (in
1340 addition to the NamespaceEntry.aliases hashtable). This field is
1341 shared between the original entry and its doppelganger (bodyless
1343 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1344 extern_aliases field.
1345 (NamespaceEntry.Lookup): Move the IsImplicit check after the
1346 lookup in extern_aliases.
1348 2005-12-16 Raja R Harinath <rharinath@novell.com>
1351 * class.cs (TypeContainer.Mark_HasEquals): New.
1352 (TypeContainer.Mark_HasGetHashCode): New.
1353 (ClassPart): Override them.
1354 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1356 * generic.cs (GenericMethod.DefineMembers): Update to changes.
1357 (TypeParameter.TypeParameter): Change type of 'parent' argument to
1361 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1362 'parent' argument to the base constructor.
1364 Remove all mention of TypeContainer from decl.cs.
1365 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1366 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1367 (DeclSpace.DeclSpace): Likewise.
1368 (DeclSpace.DefineMembers): Remove unused argument.
1369 * cs-parser.jay (pop_current_class): Update to changes. Simplify
1370 debugging check -- we don't care if the debug code throws an
1371 InvalidCastException instead of an InternalErrorException.
1372 * class.cs (TypeContainer.DefineMembers): Update to changes.
1373 (TypeContainer.DoDefineMembers): Likewise.
1374 (TypeContainer.GetMethods): Likewise.
1375 (PropertyMember.Define): Likewise.
1376 (MemberBase.Parent): New property that forwards to
1377 MemberCore.Parent, but ensures that we get a TypeContainer.
1378 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1379 (RootContext.PopulateTypes): Likewise. Remove special case code
1380 for !RootContext.StdLib: DefineMembers is idempotent.
1382 2005-12-13 Marek Safar <marek.safar@seznam.cz>
1384 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1386 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
1388 * doc.cs : The search for referenced namespace was insufficient to
1389 get global one as it used to do. Fixed bug #76965.
1391 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
1393 * doc.cs : check name in cref in the last phase that whether it is
1396 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1398 * cs-tokenizer.cs : reverted the latest change: it somehow broke
1401 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1403 * doc.cs : so it turned out that we cannot skip override check for
1404 interface members. Fixed bug #76954.
1406 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1408 * cs-tokenizer.cs : fixed bug #75984:
1409 - #warning and #error should not be handled when the source line
1411 - #line is not checked strictly when the source line is disabled.
1412 - #define and #undef is on the other hand checked strictly at any
1415 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
1417 * cs-tokenizer.cs : missing Location (actually, filename) in one of
1420 2005-12-15 Raja R Harinath <rharinath@novell.com>
1422 * generic.cs (TypeManager.IsGeneric): Remove unused method.
1424 * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
1427 2005-12-14 Martin Baulig <martin@ximian.com>
1429 * typemanager.cs (TypeManager.GetFullName): Make this public;
1430 `Type.Fullname' now never returns null.
1432 * class.cs (Method.Define): Use TypeManager.GetFullName() for
1433 explicit interface implementations; we're now using the same
1434 naming convention than csc does.
1436 2005-12-14 Miguel de Icaza <miguel@novell.com>
1438 * convert.cs (ExplicitConversionCore): Check the return value from
1439 ExplicitConversionCore which can return null on failure. Fixes #76914
1441 2005-12-09 Raja R Harinath <rharinath@novell.com>
1443 * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
1444 instead of IsGenericInstance.
1445 * generic.cs (TypeManager.IsEqual): Likewise. Delete redundant
1446 code that's now covered by the more general test.
1447 * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
1449 * generic.cs (DropGenericTypeArguments): New. Captures the common
1450 pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
1451 * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
1452 * generic.cs, report.cs, typemanager.cs: Likewise.
1454 2005-12-08 Martin Baulig <martin@ximian.com>
1456 * generic.cs (TypeArguments.Resolve): Added CS1547 check.
1458 * typemanager.cs (TypeManager.CSharpSignature): Include type
1459 arguments in the signature of a generic method.
1461 2005-12-07 Martin Baulig <martin@ximian.com>
1463 Add support for custom attributes on type parameters.
1465 * cs-parser.jay (type_arguments): Added `opt_attributes'.
1467 * generic.cs (TypeParameterName): New public class; we use this
1468 instead of a `string' to store the name of a type parameter, so we
1469 can also have `Attributes'.
1470 (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
1471 array instead of a `string[]' array.
1472 (TypeParameter.ctor): We now also take an `Attributes' argument.
1473 (TypeParameter.EmitAttributes): New public method; emit our
1474 `OptAttributes' here.
1475 (GenericMethod.EmitAttributes): New public method; emit the custom
1476 attributes on all our type parameters.
1478 * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
1479 our type parameters.
1480 (MethodData.Define): If we're a generic method, call
1481 EmitAttributes() on it.
1483 2005-12-07 Martin Baulig <martin@ximian.com>
1486 (ConstraintChecker): New public abstract class; move the
1487 constraint checking here from `ConstructedType' and also do
1488 constraint checking for generic methods here.
1490 * expression.cs (Invocation.OverloadResolve): Use
1491 ConstraintChecker.CheckConstraints() if we resolved to a generic
1494 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1496 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1498 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1500 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1501 (FieldBase.Initializer): Initializer is now optional.
1502 (EventField.Define): Only event field can have initializer.
1504 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1506 * const.cs (Const): Reuse initializer.
1508 * cs-parser.jay: Updated after FieldBase changes.
1509 Added current_array_type to simplify array initializers.
1511 * ecore.cs (NullCast.IsDefaultValue): Implemented.
1513 * expression.cs, iterators.cs: Updated.
1515 * namespace.cs (NamespaceEntry): Made UsingFound private.
1517 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1519 * parameterCollection.cs: Obsolete, removed.
1520 * parser.cs: Obsolete, removed.
1522 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1525 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1527 * enum.cs (Enum.Define): Set obsolete context here.
1529 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
1532 - FindDocumentedMember() now expects 1) paramList as null
1533 when "we don't have to check the number of parameters" and
1534 2) Type.EmptyTypes when "there is no arguments".
1535 - Introduced FoundMember struct to hold the exact type which was
1536 used to find the documented member (the above change broke
1537 test-xml-044; it might be better just to use DeclaringType than
1538 what MS does, like this change does, but it depends on usage.)
1540 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
1542 * doc.cs : documented member might be from DeclaringType for nested
1543 types. Fixed bug #76782.
1545 2005-12-03 Ben Maurer <bmaurer@ximian.com>
1547 * anonymous.cs: Have the param code handle leaving copies on the
1548 stack etc. Allows anonymous params to take part in the assignment
1549 code (++, +=, etc). Fixes bug #76550
1551 * expression.cs: Handle the prepare_for_load/leave_copy by passing
1552 it down to the anon code.
1554 * iterators.cs: Use dummy var here
1556 * codegen.cs: Handle new vars
1558 2005-12-01 Marek Safar <marek.safar@seznam.cz>
1561 * class.cs (MethodData.Define): Set proper Obsolete context.
1563 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1565 (FieldExpr.DoResolve): Ditto.
1567 2005-12-01 Marek Safar <marek.safar@seznam.cz>
1570 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1571 parent is not obsolete.
1573 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
1575 * doc.cs : (FindDocumentedMember) find parameterless members first
1576 and get CS0419 in the early stage. Fixed first case of bug #76727.
1578 2005-11-30 Marek Safar <marek.safar@seznam.cz>
1581 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1582 no error was reported.
1584 *expression.cs (Binary.DoResolve): left can be null.
1586 2005-12-06 Raja R Harinath <rharinath@novell.com>
1588 * class.cs (MethodCore.CheckGenericOverride): Delete unused
1589 abstract method and all overrides.
1590 * support.cs (ParameterData.GenericConstraints): Delete.
1591 (ReflectionParameters.type_params): Delete.
1592 (ReflectionParameters.ReflectionParameters): Make private.
1593 (ReflectionParameters.GetConstaints): New factory method.
1594 * generic.cs (TypeParameterDefineType): Use it.
1595 (TypeManager.GetTypeParameterConstraints): Likewise.
1597 2005-11-22 Marek Safar <marek.safar@seznam.cz>
1600 * class.cs (MethodData.Emit): Parameters should be labeled first.
1602 2005-11-21 Marek Safar <marek.safar@seznam.cz>
1605 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1607 2005-11-18 Marek Safar <marek.safar@seznam.cz>
1609 * attribute.cs (AreParametersCompliant): Moved to Parameter.
1611 * class.cs (MethodCore): Parameter clean up.
1612 (IMethodData): Added ParameterInfo.
1613 (MethodData): Parameter clean up.
1614 (Indexer.Define): Parameter clean up.
1626 * typemanager.cs: Parameter clean up.
1628 * delegate.cs (Define): Get rid of duplicated code.
1630 * expression.cs (ParameterReference): Removed useless parameters
1632 (Invocation): Ditto.
1634 * parameter.cs (ParamsParameter): New class, params specialization.
1635 (ArglistParameter): Attemp to separate arglist.
1636 (Parameter): Refactored to be reusable and faster.
1637 (Parameter.Modifier): Made understandable.
1638 (Parameters): Changed to be used as a class for `this' assembly
1639 parameters. Refactored to use new specialized classes.
1641 * support.cs (ParameterData): Added Types property.
1642 (InternalParameters): Deleted.
1644 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1646 * doc.cs : the previous patch does not actually fix the bug.
1647 PropertyInfo override check is now implemented and really fixed it.
1648 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
1650 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1652 * doc.cs : apply "override filter" also to properties.
1655 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1657 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
1658 no need to check overrides. For classes, omit those results from
1659 interfaces since they must exist in the class. Fixed bug #76726.
1661 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1663 * typemanager.cs : (GetFullNameSignature) differentiate indexers
1664 with different parameters. Fixed the second problem in #76685.
1666 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1668 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
1669 get expected 'protected' access in CheckValidFamilyAccess()).
1672 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1674 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
1675 Fixed bug #76705. CS1569 was incorrectly commented out.
1677 2005-11-23 Martin Baulig <martin@ximian.com>
1679 * generic.cs (Constraints.Define): Removed.
1680 (TypeParameter.DefineConstraints): Removed.
1681 (TypeParameter.DefineType): Call SetGenericParameterAttributes()
1682 on the GenericTypeParameterBuilder here.
1684 2005-11-23 Martin Baulig <martin@ximian.com>
1686 * typemanager.cs (TypeManager.GetProperty): Make this public.
1688 * generic.cs (Nullable.NullableInfo.ctor): Use
1689 TypeManager.GetProperty() rather than using reflection directly.
1691 2005-11-17 Martin Baulig <martin@ximian.com>
1693 * expression.cs (Indexers.GetIndexersForType): Added support for
1694 generic parameters; fixes #76587.
1696 2005-11-17 Martin Baulig <martin@ximian.com>
1699 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
1700 inherit the scope from our parent. Fixes #76653.
1702 2005-11-15 Martin Baulig <martin@ximian.com>
1704 * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
1705 instead of `ScopeTypeBuilder' to refer to the "current" type.
1706 (AnonymousMethod.CreateScopeType): Correctly create the helper
1707 class if we're inside a generic type definition.
1709 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
1711 * doc.cs : use Invocation.IsOverride() to do real override check.
1712 * expression.cs : made Invocation.IsOverride() internal.
1714 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
1716 * doc.cs : use TypeManager.FindMembers() instead of (possible)
1717 TypeBuilder.FindMembers() and filter overriden base members out.
1720 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1722 * doc.cs : ref/out parameters are represented as '@' (instead of
1723 '&' in type FullName). Fixed bug #76630 (additionally crefs).
1725 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1727 * doc.cs : when there was no '.' in cref to methods in doc comment,
1728 then parameters were missing in the output. Fixed bug #76691.
1730 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1732 * driver.cs : don't output docs when there is an error.
1735 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1738 Now it should detect indexers. Fixed primary concern in bug #76685.
1739 Fixed CS0419 message to not show the identical member signature in
1742 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1744 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
1745 instead of Type.FindMembers() since it does not handle events.
1748 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
1750 * codegen.cs: Fixed typo (speficied -> specified).
1752 2005-11-11 Marek Safar <marek.safar@seznam.cz>
1755 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
1757 2005-11-11 Marek Safar <marek.safar@seznam.cz>
1759 * attribute.cs: Changed error message.
1761 * cs-tokenizer.cs: One more check.
1763 2005-11-10 Marek Safar <marek.safar@seznam.cz>
1765 * statement.cs (Block.Resolve): Ignore empty statement.
1767 2005-11-10 Marek Safar <marek.safar@seznam.cz>
1769 * report.cs: Made error/warning methods more strict to avoid
1772 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
1773 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
1774 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
1775 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
1777 2005-11-11 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1779 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute):
1780 Use the more explicit AssemblyName.FullName instead of
1781 AssemblyName.Name to report errors.
1783 2005-11-11 Marek Safar <marek.safar@seznam.cz>
1785 * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
1788 2005-11-10 Marek Safar <marek.safar@seznam.cz>
1798 * report.cs: Fixed error reporting and typos.
1800 * generic.cs (TypeParameter.GetSignatureForError): New method.
1801 (ConstructedType.GetSignatureForError): Instead of DeclarationName.
1803 * typemanager.cs (GetFullName): Refactored.
1805 2005-11-08 Marek Safar <marek.safar@seznam.cz>
1807 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
1808 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
1810 * class.cs (TypeContainer.IsComImport): New property.
1811 (Constructor.Define): Create proper ctor for ComImport types.
1813 * expression.cs (New.CheckComImport): Fixed.
1815 2005-11-07 Miguel de Icaza <miguel@novell.com>
1817 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
1818 that a parameter has been captured does not mean that we do not
1819 have to do the rest of the processing. This fixes the second part
1820 of #76592. If there was another anonymous method capturing
1821 values in the past, the Scope would never be set for the second
1822 method that captured the same parameter.
1824 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
1825 properly manipulate the stack. Second part of fix for #76592.
1827 * expression.cs (New): Add support for invoking "new" on
1828 interfaces that have been flagged with the ComImport attribute and
1829 the CoClass. Fixes #76637
1831 * statement.cs (Try.DoEmit): When a variable is captured, do not
1832 try to emit the vi.LocalBuilder variable as it has been captured.
1833 Create a temporary variable and store the results on the
1834 FieldBuilder. Fixes #76642
1836 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1838 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
1840 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
1842 * expression.cs (Binary.DoResolve): Added && optimalization.
1844 * typemanager.cs (AddUserType): Removed useless argument.
1846 2005-11-04 Marek Safar <marek.safar@seznam.cz>
1848 * statement.cs (Block.variables): Uses ListDictionary.
1850 2005-11-03 Marek Safar <marek.safar@seznam.cz>
1853 * class.cs (PartialContainer.EmitType): Customized to emit
1854 security attributes.
1855 (ClassPart.ApplyAttributeBuilder): Transform security attribute
1856 for partial classes.
1858 2005-11-03 Marek Safar <marek.safar@seznam.cz>
1861 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
1862 access has to be fixed.
1864 * typemanager.cs (IsUnmanagedType): Wrong common field type.
1866 2005-11-01 Marek Safar <marek.safar@seznam.cz>
1869 * ecore.cs (NullCast.Reduce): Implemented.
1871 * expression.cs (ArrayCreation.CheckIndices): Correcly check
1874 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
1876 (Foreach.Resolve): Catch null properly.
1878 2005-10-29 Marek Safar <marek.safar@seznam.cz>
1880 * cs-tokenizer.cs: Warning text fix.
1882 * driver.cs: AllWarningNumbers exposed on public interface.
1884 * report.cs (): Reviewed warning numbers.
1885 (IsValidWarning): Use binary search.
1887 2005-10-29 Marek Safar <marek.safar@seznam.cz>
1889 * driver.cs: Implemeted resource visibility.
1890 (Resources): New class for code sharing between /res: and
1893 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1895 decl.cs (CurrentTypeParameters): Fixed to be public.
1897 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1899 generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
1901 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1903 gmcs.exe.sources: Use CryptoConvert.cs from corlib.
1905 2005-11-05 Kornél Pál <kornelpal@hotmail.com>
1907 * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
1909 2005-11-04 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1911 Add friend assembly access support.
1912 * typemanager.cs: assembly_internals_vis_attrs
1913 cache for friend assembly access.
1914 (TypeManager.IsFriendAssembly): New method for
1915 checking friend assembly access.
1916 (TypeManager.Error_FriendAccessNameNotMatching): New
1918 (TypeManager.CompareKeyTokens): Likewise.
1919 (TypeManager.Filter): Handle friend accessible
1922 * namespace.cs (RootNamespace.GetTypeInAssembly): Return
1923 friend accessible types.
1925 * ecore.cs (Expression.IsAccessorAccessible): Handle
1926 friend accessible properties.
1928 * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
1931 2005-10-28 Marek Safar <marek.safar@seznam.cz>
1934 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
1937 * convert (Convert.ImplicitReferenceConversion): NullCast holds
1940 * ecore.cs (NullCast): Child is contant only.
1942 * literal.cs (NullLiteral.Reduce): null can be converted to any
1945 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
1947 * driver.cs: Use Encoding.Default as default code page instead
1950 2005-10-27 Raja R Harinath <rharinath@novell.com>
1953 * expression.cs (Invocation.Error_InvalidArguments): Handle
1954 __arglist parameters.
1955 (Invocation.VerifyArgumentsCompat): Likewise.
1956 * support.cs (ReflectionParameters.GetSignatureForError): Print
1957 __arglist parameters.
1958 (InternalParamters.GetSignatureForError): Likewise.
1959 * parameter.cs (Parameters.GetSignatureForError): Likewise.
1961 2005-10-26 Marek Safar <marek.safar@seznam.cz>
1963 * attribute.cs (GetPropertyValue): Made public.
1965 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
1967 Add new property WrapNonExceptionThrows to handle 2.0 assembly
1969 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
1972 * driver.cs: Reflect method name change.
1974 * statement.cs (Try.Resolve): Warn when try has both general
1977 * typemanager.cs: runtime_compatibility_attr_type new predefined
1980 2005-10-26 Raja R Harinath <harinath@gmail.com>
1983 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
1984 treat it as an empty parameter list.
1986 2005-10-26 Raja R Harinath <rharinath@novell.com>
1989 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
1990 ResolveAsTypeStep silent.
1991 * statement.cs (Block.AddConstant): Mark block as used.
1992 (Block.ResolveMeta): Avoid piling on error messages
1993 if a constant initializer resolution fails.
1995 2005-10-25 Raja R Harinath <rharinath@novell.com>
1997 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
1999 (NamespaceEntry.VerifyAllUsing): New.
2000 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
2001 behaviour. Delegates actual resolution of alias to ...
2002 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
2003 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
2005 * driver.cs (Driver.MainDriver): Update.
2007 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
2008 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
2010 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
2012 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
2013 RootNamespace.DefineNamespacesForAll.
2015 2005-10-24 Raja R Harinath <harinath@gmail.com>
2017 * typemanager.cs (assemblies, external_aliases, modules)
2018 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
2019 (ComputeNamespaces, GetRootNamespace): Remove extra staging
2020 overhead. Move resposibility ...
2021 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
2022 * driver.cs, attribute.cs, codegen.cs: Update to changes.
2024 2005-10-23 Raja R Harinath <harinath@gmail.com>
2026 * namespace.cs (RootNamespace.all_namespaces): Renamed from
2027 cached_namespaces. Improve usage.
2028 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
2029 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
2030 Move from GlobalRootNamespace and simplify.
2031 (RootNamespace.Global): Make instance variable.
2032 (RootNamespace.RootNamespace): Add "alias name" parameter.
2033 (GlobalRootNamespace): Simplify drastically.
2034 (Namespace.Lookup): Don't use GetNamespace.
2035 * typemanager.cs (GetRootNamespace): Rename from
2036 ComputeNamespaceForAlias.
2037 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2039 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2041 * anonymous.cs (AnonymousContainer): Don't crash when container
2044 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2046 * expression.cs (Binary.DoResolve): Warn when comparing same
2049 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2052 * expression.cs (Binary.DoResolve): It looks like there are no
2053 convetsion rules in enum context.
2055 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2057 Add support for extern alias qualifiers.
2058 * typemanager.cs: Move some LookupTypeReflection code
2059 to namespace.cs, to have cleaner code. Added some methods
2060 to help us keep track of the extern aliased references.
2061 * driver.cs: Add suport for extern alias assemblies on command
2062 line and check for their warnings/errors. Also keep track of the
2063 extern aliased assemblies.
2064 * namespace.cs: Move the global functionality of Namespace
2065 to GlobalRootNamespace/RootNamespace. Now the global namespace
2066 is GlobalRootNamespace.Globa. Also the code moved from
2067 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
2068 Finally added LocalAliasEntry (AliasEntry before) and
2069 ExternAliasEntry, to handle alias statements.
2070 * cs-parser.jay: Add support in the grammar for extern alias
2072 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
2073 Update callings to Namespace (now in GlobalRootNamespace).
2075 2005-10-25 Martin Baulig <martin@ximian.com>
2077 * convert.cs (ImplicitTypeParameterConversion): Make base
2078 interfaces actually work; fixes #76557.
2080 2005-10-25 Martin Baulig <martin@ximian.com>
2083 (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
2084 all the type parameters; fixes #76551.
2086 2005-10-25 Martin Baulig <martin@ximian.com>
2091 (GenericMethod.ctor): Added `Expression return_type' and
2092 `Parameters parameters' arguments.
2093 (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
2094 parameter and return types to check their constraints if they're
2097 * codegen.cs (EmitContext.ResolvingGenericMethod): New public
2100 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
2101 constraints of a generic type if `ec.ResolvingGenericMethod'.
2103 * class.cs (MethodCore.DoDefineParameters): Set
2104 `ec.ResolvingGenericMethod' if we're a generic method.
2105 (MemberBase.MemberType): Likewise.
2107 2005-10-25 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2109 * typemanager.cs (TypeManager): Added
2110 TypeManager.internals_visible_attr_type to cache
2111 S.R.CompilerServices.InternalsVisibleToAttribute.
2113 * codegen.cs (AssemblyClass): Added checks for
2114 InternalsVisibleToAttribute in new method
2115 CheckInternalsVisibleAttribute () and also cache the
2116 AssemblyName in AssemblyClass.Name.
2118 2005-10-24 Martin Baulig <martin@ximian.com>
2121 (TypeManager.ExpandInterfaces): Added overloaded version which
2122 just takes a `Type[]' array.
2125 (Constraints.Resolve): Don't expand the interfaces here; ie. we
2126 just use the interfaces which were explicitly specified and not
2127 the interfaces they inherit. Fixes #76482.
2128 (TypeParameter.FindMembers): Expand the interfaces here.
2130 2005-10-21 Martin Baulig <martin@ximian.com>
2133 (Constraints.Resolve): Also resolve the actual types here.
2134 (Constraints.ResolveTypes): Just check the constraints here.
2135 Fixes #76363; see gtest-218.cs.
2137 2005-10-21 Martin Baulig <martin@ximian.com>
2140 (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
2141 instead of a `BoxedCast'; fixes gtest-217.cs.
2143 2005-10-20 Atsushi Enomoto <atsushi@ximian.com>
2145 * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
2146 1) "new()" is specified as generic parameter constraint and 2) the
2147 type is TypeBuilder and 3) the type is abstract even if it has a
2148 default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
2150 2005-10-20 Martin Baulig <martin@ximian.com>
2153 (GenericConstraints.TypeParameter): New public property.
2154 (TypeParameter.ctor): Also take a `DeclSpace' argument.
2155 (TypeParameter.DeclSpace): New public property.
2156 (TypeParameter.DefineType): Inflate the constraints if our
2157 `DeclSpace' is an `Iterator'.
2159 2005-10-19 Atsushi Enomoto <atsushi@ximian.com>
2161 * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added
2162 GenericMethod argument to compare methods' generic type arguments.
2165 2005-10-19 Martin Baulig <martin@ximian.com>
2167 * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
2168 not ResolveType() when resolving the base type, so we're not
2169 checking the constraints here.
2170 (TypeContainer.ResolveType): Call ResolveType() on our base_type
2173 2005-10-19 Martin Baulig <martin@ximian.com>
2175 * generic.cs (ConstructedType.CheckConstraints): Committing
2176 untested fix for #76441.
2178 2005-10-18 Raja R Harinath <rharinath@novell.com>
2181 * class.cs (TypeContainer.DefineType): Move updating of
2182 topological sort earlier in the code.
2183 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2185 2005-10-18 Marek Safar <marek.safar@seznam.cz>
2188 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
2190 * constant.cs (Constant.TryReduce): Moved from Cast class.
2191 (Reduce): Made little bit more OO and fixed missing conversions.
2193 * ecore.cs (Reduce): Implemented.
2194 (Binary.EnumLiftUp): New method to upgrade values to enum values.
2196 * literal.cs (Reduce): Implemented.
2198 * class.cs: Reverted Miguel's wrong commit.
2200 2005-10-14 Miguel de Icaza <miguel@novell.com>
2202 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2204 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
2206 * cs-parser.jay, expression.cs : CS0214 was missing error location
2207 for constants. Fixed bug #76404.
2209 2005-10-10 Raja R Harinath <rharinath@novell.com>
2211 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2213 (PropertyExpr.EmitCall): Likewise.
2214 * expression.cs (Invocation.EmitArguments): Handle case where
2216 (Invocation.EmitCall): Avoid allocating temporary variable if
2217 there are no arguments.
2219 2005-10-11 Marek Safar <marek.safar@seznam.cz>
2222 * convert.cs (ExplicitConversionCore): Fixed object->enum
2225 2005-10-07 Raja R Harinath <rharinath@novell.com>
2228 * convert.cs (ImplicitConversionStandard): Move conversion of
2229 void* to arbitrary pointer types ...
2230 (ExplicitConversionStandard): .. here.
2231 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2232 error to always print typenames.
2234 2005-10-07 Raja R Harinath <rharinath@novell.com>
2236 * convert.cs (GetConversionOperator): Rename from
2237 GetConversionOperators. Move operator selection code from ...
2238 (UserDefinedConversion): ... here.
2240 2005-10-06 Marek Safar <marek.safar@seznam.cz>
2242 * convert.cs (ExplicitConversionCore): Removed duplicate enum
2245 2005-10-05 Marek Safar <marek.safar@seznam.cz>
2247 * assign.cs (Assign.DoResolve): Error method changed.
2249 * cfold.cs (DoConstantNumericPromotions): Error method changed.
2251 * const.cs (ResolveValue): Reset in_transit immediately.
2253 * constant.cs: Error method changed.
2255 * convert.cs: Removed useless location parameter.
2256 (ExplicitNumericConversion): Don't do double enum check.
2257 (ExplicitConversionCore): Renamed from ExplicitConversion.
2258 (ExplicitUnsafe): Extracted from ExplicitConversion.
2259 (ExplicitConversion): Uses for error reporting.
2261 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2263 (ResolveBoolean): Uses common error method.
2264 (CastToDecimal): Get rid of ec.
2265 (CastFromDecimal): Optimized.
2266 (ConvCast): Get rid of ec.
2268 * enum.cs (ResolveValue): Reset in_transit immediately.
2269 (Emit): Return after first error.
2271 * expression.cs: Convert changes.
2273 * literal.cs: Error method changed.
2275 * statement.cs: Error method changed.
2277 2005-10-06 Raja R Harinath <rharinath@novell.com>
2279 Fix gtest-131.cs and gtest-211.cs.
2280 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
2281 Only emit code for a label if it is used. Unreachable code can
2282 violate ECMA evaluation stack invariants.
2284 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2286 * anonymous.cs: Implemented ExprClassName.
2288 * assign.cs (Assign.DoResolve): Don't chrash when type is not
2291 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2294 * class.cs (StaticClass.DefineContainerMembers): Report protected
2297 * codegen.cs: if(ed) PRODUCTION.
2299 * convert.cs (Error_CannotImplicitConversion): Better error
2302 * cs-parser.jay: More error checks.
2304 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2306 * driver.cs (CSCParseOption): Enabled wrong option check.
2308 * ecore.cs (Expression.ExprClassName): Turned to property.
2309 (MemberExpr.CheckIntermediateModification): For checking boxed
2310 value types modification.
2312 * statement.cs (Fixed.Resolve): Expression type must be
2313 convertible to fixed type.
2314 (CollectionForeach.GetEnumeratorFilter,TryType):
2315 Small refactoring for easier error checking.
2317 2005-09-26 Marek Safar <marek.safar@seznam.cz>
2319 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2322 * class.cs (GeneratedBaseInitializer): New class for customization
2323 compiler generated initializers.
2324 (MemberBase.DoDefine): Check Obsolete attribute here.
2325 (FieldMember.DoDefine): Ditto.
2327 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2330 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2331 (MemberCore.GetObsoleteAttribute): Removed argument.
2332 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2333 (MemberCore.CheckObsoleteType): New helper.
2337 * statement.cs: Updates after MemberCore changes.
2339 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2340 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2342 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2343 obsolete attribute for compiler construct.
2344 (As.DoResolve): Cache result.
2346 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2348 2005-10-01 Miguel de Icaza <miguel@novell.com>
2350 * expression.cs (Probe): instead of having a "Type probe_type"
2351 keep the extra information as a TypeExpr probe_type_expr since the
2352 "As" operator needs to perform some type checks.
2354 * (As.DoResolve): If the type is a type parameter, ensure that it
2355 is constrained by a class.
2357 2005-09-22 Miguel de Icaza <miguel@novell.com>
2359 * statement.cs (Lock): Use the TemporaryVariable class instead of
2360 manually using local variables as those do not work when variables
2363 * ecore.cs: Moved the TemporaryVariable class from being a nested
2364 class inside Foreach to be a public class that can be employed in
2367 2005-09-19 Marek Safar <marek.safar@seznam.cz>
2369 * cs-parser.jay: interface_accessors replaced by
2370 accessor_declarations.
2372 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2375 * statement.cs (GotoCase.Resolve): Convert null constant to
2377 (SwitchLabel.ResolveAndReduce): Ditto.
2378 (SwitchLabel.NullStringCase): Custom null stamp.
2379 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2381 typemanager.cs (CSharpSignature): Don't skip first argument
2384 2005-09-16 Marek Safar <marek.safar@seznam.cz>
2386 * cfold.cs, constant.cs, convert.cs, ecore.cs,
2387 expression.cs, iterators.cs, literal.cs: Store constants and
2390 * class.cs (MemberBase.ShortName): Pass location.
2392 * cs-parser.jay: Some location fixes.
2394 * ecore.cs (Expression.Location): Made virtual.
2396 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2399 * const.cs (Const.ResolveValue): Check for assigning non-null
2400 value to reference type.
2402 2005-09-26 Raja R Harinath <rharinath@novell.com>
2405 * expression.cs (This.VerifyFixed): In a value type T, the type of
2406 'this' is T&, iow, 'this' is either an out or ref parameter. In a
2407 value type R, 'this' is treated as a value parameter.
2409 2005-09-05 Miguel de Icaza <miguel@novell.com>
2411 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2412 if the underlying types are the same, otherwise we need to produce
2413 code that will do the proper cast.
2415 This was exposed by Marek's constant rewrite which produced
2416 invalid code for the call site:
2419 void Method (X v) {}
2423 This fixes test-49.cs
2425 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2427 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2428 Type/Object should be allowed as well. Fixed bug #75968.
2430 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2432 * expression.cs : (Binary.DoResolve): when one is enum constant and
2433 another is constant 0, then return enum one *as enum type*.
2436 2005-10-04 Martin Baulig <martin@ximian.com>
2438 * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
2439 `SetMemberIsUsed()' work for generics, too.
2441 2005-10-04 Martin Baulig <martin@ximian.com>
2443 * expression.cs (DelegateInvocation.EmitStatement): Make this work
2444 for corlib. Fixes #75691.
2446 2005-09-28 Marek Safar <marek.safar@seznam.cz>
2449 * driver.cs: Fix compilation files with full root path.
2451 2005-09-25 Miguel de Icaza <miguel@novell.com>
2453 * report.cs (SymbolRelatedToPreviousError): Format the output so
2454 it does not use an open parenthesis that is never closed.
2456 * driver.cs: Follow coding guidelines
2458 2005-09-18 Miguel de Icaza <miguel@novell.com>
2460 * driver.cs: Set InEmacs based on the environment variable EMACS.
2462 * location.cs (InEmacs): in this mode, do not report column
2463 location as it confuses Emacs.
2465 2005-10-03 Raja R Harinath <rharinath@novell.com>
2467 * support.cs (SeekableStreamReader.Position): Don't error out when
2468 the requested position is just beyond the end of the current
2471 2005-09-28 Raja R Harinath <rharinath@novell.com>
2473 * support.cs (SeekableStreamReader): Simplify drastically. Don't
2474 try to keep in sync with the byte count of the underlying Stream.
2475 However, this limits us to a window size of 2048 characters: i.e.,
2476 the maximum lookahead of our lexer/parser can be 2048 characters.
2478 2005-09-22 Martin Baulig <martin@ximian.com>
2480 * driver.cs: Removed a debugging FIXME.
2482 2005-09-21 Raja R Harinath <rharinath@novell.com>
2484 * cs-parser.jay (type_arguments): Add CS1644 check.
2485 * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
2487 2005-09-15 Raja R Harinath <rharinath@novell.com>
2489 * Makefile (PROGRAM): Make profile specific.
2490 (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
2491 the current directory.
2494 * expression.cs (Invocation.EmitCall): Remove optimization on
2495 this_call since it doesn't handle 'this' being a value type.
2497 2005-09-05 Geoff Norton <gnorton@customerdna.com>
2499 * driver.cs: Ensure file handles are closed after parsing
2501 2005-09-05 Miguel de Icaza <miguel@novell.com>
2503 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2504 if the underlying types are the same, otherwise we need to produce
2505 code that will do the proper cast.
2507 This was exposed by Marek's constant rewrite which produced
2508 invalid code for the call site:
2511 void Method (X v) {}
2515 This fixes test-49.cs
2517 2005-09-05 Martin Baulig <martin@ximian.com>
2519 * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
2520 instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
2522 * cs-parser.jay (delegate_declaration): Small fix for #75852.
2524 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2526 * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
2527 to be a pointer type due to the spec 25.2, so check if declaring
2528 type is generic type definition. Fixed bug #75772.
2530 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2533 * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
2534 both types are not defined by methods.
2535 * expression.cs : (Invocation.IsApplicable): it should work when
2536 the argument type is equal to the parameter type, not only when
2537 ImplicitConversionExists() returns true.
2539 2005-09-02 Raja R Harinath <rharinath@novell.com>
2541 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2545 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2546 flow-branching for LocalVariableReferences in case we were invoked
2547 from a MemberAccess.
2548 * expression.cs (LocalVariableReference.VerifyAssigned): New.
2550 (LocalVariableReference.DoResolveBase): ... this.
2551 (MemberAccess.Resolve): Do the check that was disabled during
2554 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
2557 (PartialContainer.Create): check abstract/sealed/static strictly
2558 but abstract/sealed can exist only at one side. Fixed bug #75883.
2560 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
2563 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2564 specified, don't default to UnmanagedType.I4.
2566 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
2568 * expression.cs : conditional operator should check possibly
2569 incorrect assign expression. Fixed bug #75946.
2571 2005-08-30 Raja R Harinath <rharinath@novell.com>
2574 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2575 (ScopeInfo.EmitScopeType): Use it to construct field names from
2576 names of captured locals.
2579 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2580 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2581 Pass 'target_type' to BoxedCast. Don't default to 'object'.
2582 (ExplicitConversion): Remove enum cases already handled by
2583 implicit conversion. Move implicit conversion check to the beginning.
2584 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2585 * expression.cs (ArrayCreation.EmitDynamicInitializers):
2586 Don't treat System.Enum as a struct.
2588 2005-08-30 Jb Evain <jbevain@gmail.com>
2590 * attribute.cs: handles as expression in parameters.
2592 2005-08-30 Raja R Harinath <rharinath@novell.com>
2595 * class.cs (TypeContainer.VerifyClsName): Don't use a
2596 PartialContainer when verifying CLS compliance.
2597 (AbstractPropertyEventMethod): Set Parent here, ...
2598 (PropertyMethod): ... not here.
2600 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
2602 * attribute.cs : escaped attribute name should not be allowed to be
2603 resolved (e.g. @class as classAttribute). Fixed bug #75930.
2605 2005-08-29 Raja R Harinath <rharinath@novell.com>
2608 * convert.cs (ImplicitStandardConversionExists): Allow zero also
2609 when converting a long constant to unsigned long.
2610 * expression.cs (Invocation.OverloadResolve): Add sanity check to
2611 detect where IsApplicable and VerifyArgumentsCompat disagree.
2613 2005-08-29 Raja R Harinath <rharinath@novell.com>
2614 and Carlos Alberto Cortez <carlos@unixmexico.org>
2617 * class.cs (TypeContainer.CanElideInitializer): New helper.
2618 (TypeContainer.EmitFieldInitializers): Use it to determine if we
2619 can safely emitting the initializer of a field.
2621 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2623 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2624 allowed inside a switch (without loop). Fixed bug #75433.
2626 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
2628 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2629 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2631 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2633 * driver.cs : kinda reverting the default encoding changes (not exact
2634 revert since I noticed that "codepage:reset" might not work fine).
2636 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2638 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2639 Location. Now getter and setter store location correctly.
2640 (errors/cs0111-12.cs now reports the expected location.)
2642 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2644 * driver.cs : Use default encoding on the environment.
2645 Removed (now that) extra parameter for SeekableStreamReader.
2646 * support.cs : (SeekableStreamReader) third .ctor() argument for
2647 StreamReader is not required (always true). preamble size could
2648 be acquired in simpler and safe way.
2650 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
2652 * cs-parser.jay: report CS0642 at warning level 3
2653 and report CS0642 for an if else statement also
2654 fixes bug #74745. Patch by John Luke (and a bit
2656 Removed extra CS0642 warning check for "while",
2658 * statement.cs: In Block.Resolve(), CS0642 check
2659 is reimplemented to check a sequence of an empty
2660 statement and a block.
2662 Both fix bug #66777.
2664 2005-08-24 Marek Safar <marek.safar@seznam.cz>
2666 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2667 detection until I fix it.
2669 * cs-tokenizer.cs: Changed error message.
2671 * cs-parser.jay: Fixed 2 error locations.
2673 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2674 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2677 * enum.cs (GetSignatureForError): Fixed.
2679 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2683 * typemanager.cs (RegisterProperty): Removed.
2685 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2687 2005-08-24 Raja R Harinath <rharinath@novell.com>
2690 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2691 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2693 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2695 * expression.cs : tiny fix is required for not warning positive ulong.
2698 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2700 * expression.cs : add CS0652 check for constant and integral
2701 expression. Fixed bug #53974.
2703 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2705 * expression.cs : in DoNumericPromotions(), check if there is implicit
2706 conversion overload for string (to check CS0034). Fixed bug #52492.
2708 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2710 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2712 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2714 * ecore.cs : report location when it is *not* Null.
2716 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2722 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2723 correctly. Fixed bug #75721.
2725 2005-08-23 Raja R Harinath <rharinath@novell.com>
2727 * support.cs (SeekableStreamReader.Position): Avoid an expensive
2728 loop that performs 'min (pos, char_count)'.
2731 * expression.cs (Unary.ResolveOperator): Don't discard implicit
2732 converted value in Operator.OnesComplement.
2734 2005-08-22 Ben Maurer <bmaurer@ximian.com>
2736 * anonymous.cs: If the anon method is pulled into a helper class,
2737 it needs to be `internal' not `private'. Fixes runtime behavior on
2740 2005-08-17 Marek Safar <marek.safar@seznam.cz>
2743 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2746 2005-08-16 Marek Safar <marek.safar@seznam.cz>
2748 The big constants rewrite
2749 Fix #75746, #75685 and more
2750 As a side effect saved 1MB for MWF ;-)
2752 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2753 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2754 enum based for corlib compilation.
2756 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2759 * class.cs (FixedField.Define): Use ResolveAsConstant.
2761 * const.cs (IConstant): Interface constants and enums.
2762 (Const.ResolveValue): New method for constant resolvning.
2763 (ExternalConstant): Constants from imported assemblies.
2765 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2766 conversion; like enums.
2767 (Constant.ToType): Converts this constant to different type.
2768 (Constant.Increment): Adds 1.
2770 * convert.cs (ImplicitConversionRequired): Simplified.
2772 * cs-parser.jay: Create EnumMember directly.
2774 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
2776 * doc.cs (GenerateEnumDocComment): Removed.
2778 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
2779 (ConvertIntLiteral): Removed.
2780 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
2782 * enum.cs (EnumMember): Implement IConstant.
2783 (Enum.IsValidEnumConstant): Removed.
2784 (Enum.GetNextDefaultValue): Removed.
2785 (Enum.FindMembers): Updated.
2786 (Enum.GenerateDocComment): Iterate enum members.
2788 * expression.cs (Cast.TryReduce): Handle enums correctly.
2789 (New.Constantify): Made public.
2790 (MemberAccess.DoResolve): Removed contant specific if(s).
2792 * literal.cs (NullLiteral): Implement new abstract methods.
2794 * statement.cs (GotoCase.Resolve): Use new constant methods.
2795 (SwitchLabel.ResolveAndReduce): Use new constant methods.
2797 * typemanager.cs (LookupEnum): Removed.
2798 (IsEnumType): Fixed to work with corlib.
2799 (RegisterConstant): Removed.
2800 (LookupConstant): Removed.
2801 (GetConstant): Changed to work with IConstant.
2803 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
2805 * location.cs : Fixed overflown (>255) column number.
2807 2005-08-03 Raja R Harinath <rharinath@novell.com>
2809 First cut of the qualified-alias-member feature.
2810 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
2812 * cs-parser.jay (DOUBLE_COLON): New token.
2813 (namespace_or_type_name): Add rule for recognizing
2814 qualified-alias-members.
2815 (primary_expression): Likewise.
2816 (element_access): Allow QualifiedAliasMember as a possible
2817 type-bearing expression.
2818 (local_variable_type, local_variable_pointer_type): Likewise.
2819 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
2820 aliases in the current and enclosing namespace declarations.
2821 (NamespaceEntry.UsingAlias): Add CS0440 warning.
2822 * decl.cs (MemberName.is_double_colon): New.
2823 (MemberName.MemberName): Add new constructor for alias-member.
2824 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2825 * expression.cs (QualifiedAliasMember): New expression type.
2827 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2829 * location.cs : it borked when no argument was specified.
2831 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2833 * location.cs : tiny ToString() format fix.
2835 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2837 * statement.cs : oops, it was missing.
2839 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2841 A set of fixes for precise line/column location.
2844 "token" field now holds a file/line "delta", a line number offset
2845 from the segment, and a column number. See also:
2846 http://lists.ximian.com/pipermail/mono-devel-list/2004-
2847 December/009508.html
2848 Removed static IsNull. Use instance IsNull property instead.
2850 For some tokens it stores Location. For Identifier it stores
2851 LocatedToken which is a pair of string name and location.
2852 Column numbers are adjusted only at getChar().
2854 Use Location.ToString() for reporting (it now contains column).
2856 Largely modified to use LocatedToken instead of
2857 string (IDENTIFIER), and to acquire Location from some tokens.
2858 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2859 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2861 Now MemberName holds Location. DeclSpace.ctor() receives Location
2862 as a parameter. Removed extra parameters to all derived classes.
2863 Replaced Location.IsNull() with instance property.
2864 * assign.cs, expression.cs :
2865 Added .ctor() overload that omits Location.
2867 Added "nameEscaped" flag that indicates the identifier was escaped
2868 in the source file. This fixes bug #57047.
2870 2005-09-02 Martin Baulig <martin@ximian.com>
2872 * class.cs: Make CS3005 a warning, not an error.
2874 2005-08-02 Marek Safar <marek.safar@seznam.cz>
2876 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2877 New method, looking for lo-case imported cls type.
2879 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2882 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2884 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2886 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2888 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2890 Optimized to save 3.5 MB for SWF compilation.
2892 2005-08-01 Marek Safar <marek.safar@seznam.cz>
2894 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2895 (PartialContainer.Create): Moved logic AddToContainer.
2896 (PartialContainer.MarkForDuplicationCheck): Shares name.
2898 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2901 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
2903 (Namespace.GetSignatureForError): New method.
2905 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
2906 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
2908 2005-08-01 Raja R Harinath <rharinath@novell.com>
2911 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
2912 member lookup rather than qualifier_type, since qualifier_type can
2915 2005-08-01 Marek Safar <marek.safar@seznam.cz>
2917 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
2920 2005-07-31 Miguel de Icaza <miguel@novell.com>
2922 * statement.cs: Copy the local exception into the exception
2923 captured local. Fixes 75674
2925 2005-07-31 Raja R Harinath <harinath@gmail.com>
2928 * expression.cs (Invocation.OverloadResolve): Don't report error
2929 CS1501 if error CS1502 has been reported.
2930 (New.DoResolve): Delegate CS1501 reporting to
2931 Invocation.OverloadResolve.
2934 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
2935 invariant-meaning-in-block property in an enclosing block if
2938 2005-07-29 Marek Safar <marek.safar@seznam.cz>
2940 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
2941 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
2942 (Switch.CheckSwitch): Just save 50kb for SWF.
2944 2005-07-27 Martin Baulig <martin@ximian.com>
2946 * anonymous.cs (CaptureContext.AddField): Added
2947 `AnonymousContainer am' argument; compute its toplevel scope if
2948 it's not already computed. Fixes #75649.
2950 2005-07-26 Raja R Harinath <rharinath@novell.com>
2953 * class.cs (Constructor.Emit): Reset block to null if the block
2956 2005-07-25 Marek Safar <marek.safar@seznam.cz>
2958 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
2960 2005-07-25 Marek Safar <marek.safar@seznam.cz>
2962 * class.cs (MethodData.Define): Check whether accessor implementing
2963 interface is public.
2965 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
2967 2005-07-22 Marek Safar <marek.safar@seznam.cz>
2970 * namespace.cs (LookupType): Moved same type check to...
2972 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
2975 2005-07-21 Raja R Harinath <rharinath@novell.com>
2977 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
2978 already found a typebuilder.
2979 * class.cs (MethodCore.IsDuplicateImplementation): Compare
2980 MemberNames, not strings.
2982 * const.cs (Error_ExpressionMustBeConst):
2983 Rename from Error_EpressionMustBeConst.
2984 * const.cs, class.cs, statement.cd: Update.
2986 2005-07-21 Marek Safar <marek.safar@seznam.cz>
2990 * const.cs (Const.LookupConstantValue): Report missing contant expression
2992 (Error_EpressionMustBeConstant): Only one error method.
2994 * class.cs, statement.c: Updated.
2996 2005-07-20 Raja R Harinath <rharinath@novell.com>
2998 * statement.cs (Block.Flags): Add back HasVarargs.
2999 (Block.flags): Make protected.
3000 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3002 * typemanager.cs (types, typecontainers, user_types): Remove.
3003 (UserTypes, TypeContainers): Likewise.
3004 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3005 (CleanUp, Reset): Update.
3006 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
3007 (GetNestedType): Use Type.GetNestedType.
3008 (CoreLookupType): Take two arguments, the namespace and the
3009 basename of the type. Update to use the Namespace.Lookup
3011 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3012 (RealMemberLookup): Use IsNestedChildOf instead of playing with
3013 string concatenation and substring matches.
3014 * class.cs, enum.cs, delegate.cs: Update to changes.
3016 2005-07-20 Marek Safar <marek.safar@seznam.cz>
3018 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3019 Expression and made virtual.
3021 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3022 (ImplicitStandardConversionExists): Fixed `byte' typo ?
3024 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3026 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3029 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3032 2005-07-18 Marek Safar <marek.safar@seznam.cz>
3035 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3036 AssemblyCultureAttribute is not used on executable.
3039 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3041 2005-07-16 Raja R Harinath <rharinath@novell.com>
3044 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3045 New. Reports CS0252/CS0253.
3046 Mostly taken from preliminary patch by Duncak Mak.
3047 (Binary.DoResolveOperator): Store results of operator lookup.
3048 Use them to detect if we need to warn about unintended reference
3051 2005-07-15 Raja R Harinath <rharinath@novell.com>
3054 * namespace.cs (Namespace.Lookup): Add back location parameter.
3055 (Namespace.LookupType): Add CS0436 report. Add location parameter.
3056 * delegate.cs, ecore.cs, expression.cs: Update to changes.
3058 * codegen.cs (EmitContext.DeclSpace): Make readonly.
3059 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3060 (Namespace.LookupType): ... this.
3061 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3063 * typemanager.cs (LookupTypeReflection): Remove buggy code that
3064 purported to handle pointers.
3065 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3068 2005-07-15 Marek Safar <marek.safar@seznam.cz>
3070 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3073 2005-07-15 Raja R Harinath <rharinath@novell.com>
3075 * namespace.cs (Namespace.Lookup): Drop location parameter.
3076 (NamespaceEntry.LookupAlias): Remove. Merge into ...
3077 (NamespaceEntry.Lookup): ... this.
3078 (NamespaceEntry.Error_AmbiguousTypeReference):
3079 Move here from DeclSpace.
3080 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3082 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3083 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3084 Move to NamespaceEntry.
3085 * delegate.cs, expression.cs: Update to changes.
3087 2005-08-31 Martin Baulig <martin@ximian.com>
3089 Committing a patch from Atsushi Enomoto for #75850.
3091 * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
3092 Prefer a generic enumerator over a non-generic one.
3094 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
3096 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3097 * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3099 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3101 * driver.cs : reverting default encoding change as well as mcs.
3103 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3105 * driver.cs, support.cs : merged r48826.
3107 > could you integrate your mcs changes to gmcs otherwise
3108 > gmcs cannot compile some files.
3110 2005-08-20 Martin Baulig <martin@ximian.com>
3112 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3113 scope if we don't already have it.
3115 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
3116 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
3119 2005-07-31 Miguel de Icaza <miguel@novell.com>
3121 * statement.cs: Copy the local exception into the exception
3122 captured local. Fixes 75674
3124 2005-07-15 Marek Safar <marek.safar@seznam.cz>
3126 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3129 2005-08-12 Martin Baulig <martin@ximian.com>
3131 * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
3132 for nested types here to avoid hitting the cache too early.
3134 2005-08-09 Miguel de Icaza <miguel@novell.com>
3136 * enum.cs: On the new compiler CLS error 3005 is now a warning not
3139 2005-08-03 Martin Baulig <martin@ximian.com>
3141 Make iterators in generic methods work; see gtest-191.cs.
3144 (Constraints.Resolve): Protect against being called twice.
3147 (TypeContainer.GetClassBases): Make this `protected virtual'.
3149 * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
3150 (Iterator.GetClassBases): Override this and compute the base
3152 (Iterator.DefineNestedTypes): If we're a generic method, all our
3153 method type parameters become class type parameters on the proxy
3157 (ToplevelBlock.Parameters): Make this a property, not a field.
3158 (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
3160 2005-08-03 Martin Baulig <martin@ximian.com>
3162 * typemanager.cs (TypeManager.IsSubclassOf): Use
3163 `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
3164 (TypeManager.GetFullName_recursed): Improved.
3166 2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3169 * ecore.cs (Expression.IsAccessorAccessible): Change the check for
3170 Private accessor case, using TypeManager.IsPrivateAccessible instead of
3171 invocation_type == mi.DeclaringType, since the first one also checks
3172 other condition used by generic instances.
3174 2005-07-27 Martin Baulig <martin@ximian.com>
3176 * anonymous.cs (CaptureContext.AddField): Added
3177 `AnonymousContainer am' argument; compute its toplevel scope if
3178 it's not already computed. Fixes #75649.
3180 2005-07-14 Marek Safar <marek.safar@seznam.cz>
3182 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3183 CheckAttributeType and refactored.
3184 (Attribute.ResolvePossibleAttributeType): Changed to reuse
3185 ResolveAsTypeTerminal error handling.
3186 (ResolveAsTypeTerminal): Introduced because of global attributes extra
3188 (GetSignatureForError): Print errors in same way.
3191 * codegen.cs: Reflect attribute GetSignatureForError change.
3194 * expression.cs: Add silent parameter to ResolveAsTypeStep.
3196 * namespace.cs (UsingEntry): Refactored to make fields private.
3199 statement.cs: Error_UnexpectedKind has extra parameter.
3201 2005-07-14 Raja R Harinath <rharinath@novell.com>
3203 * ecore.cs (IAlias): Remove.
3204 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
3205 that implement the interface.
3206 * namespace.cs (Namespace): Likewise.
3207 (Namespace.declspaces): Renamed from 'defined_names'.
3208 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
3209 DeclSpace instead of an IAlias.
3210 * tree.cs (Tree.AddDecl): Update.
3212 2005-07-12 Raja R Harinath <rharinath@novell.com>
3214 * statement.cs (Block.Flags); Remove HasVarargs.
3215 (Block.HasVarargs): Move to ToplevelBlock.
3216 (Block.ThisVariable, Block.AddThisVariable): Likewise.
3217 (Block.Variables): Make protected. Initialize variable hashtable
3219 (Block.AddVariable): Update.
3220 (Block.Resolve): Update to changes.
3221 (ToplevelBlock.HasVarargs): New boolean.
3222 (ToplevelBlock.ThisVariable): Move here from Block.
3223 (ToplevelBlock.AddThisVariable): Likewise.
3224 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
3225 * expression.cs (This.ResolveBase): Update to changes.
3226 (ArglistAccess.DoResolve): Likewise.
3228 2005-07-11 Marek Safar <marek.safar@seznam.cz>
3231 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3233 * class.cs (TypeContainer.VerifyMembers): Distinguish between
3234 not used and not used & assigned.
3235 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3237 2005-07-11 Marek Safar <marek.safar@seznam.cz>
3240 * expression.cs (Is.DoResolve): null is never provided type.
3242 2005-07-08 Marek Safar <marek.safar@seznam.cz>
3245 * cs-parser.jay: Less strict event error rule to catch more errors.
3247 2005-07-11 Martin Baulig <martin@ximian.com>
3249 * generic.cs (ConstructedType.CheckConstraints): Improve the check
3250 for the constructor constraint: we do not only have to check
3251 whether the class has a public constructor, but also ensure that
3252 it's parameterless. Fixes #75492.
3254 2005-07-11 Martin Baulig <martin@ximian.com>
3256 * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
3257 between type parameters if they either have the reference type
3258 constraint or the class constraint.
3260 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
3262 * generic.cs: Use MakeGenericType instead of BindGenericParameters.
3264 2005-07-07 Marek Safar <marek.safar@seznam.cz>
3267 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3268 (ExtractSecurityPermissionSet): Cope with self referencing security
3269 attributes properly.
3271 * driver.cs (SetOutputFile): Made public property OutputFile.
3273 2005-07-07 Raja R Harinath <rharinath@novell.com>
3276 * class.cs (TypeContainer.first_nonstatic_field): Rename from
3277 has_nonstatic_fields. Make into a FieldBase pointer.
3278 (TypeContainer.AddField): Add CS0282 check.
3279 (TypeContainer.EmitType): Update.
3281 2005-07-06 Miguel de Icaza <miguel@novell.com>
3283 * cs-tokenizer.cs (consume_identifier): Do not create strings to
3284 compare if they start with __.
3286 2005-07-06 Raja R Harinath <rharinath@novell.com>
3288 * statement.cs (Switch.SwitchGoverningType): Only look at
3289 UserCasts that don't need implicit standard conversions to one of
3290 the allowed switch types (Fixes test-322.cs).
3291 (LocalInfo.Resolve): Re-enable sanity-test.
3293 2005-07-06 Marek Safar <marek.safar@seznam.cz>
3295 * cs-tokenizer.cs (consume_identifier): Detect double undescores
3297 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3299 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3301 2005-07-06 Raja R Harinath <rharinath@novell.com>
3304 * ecore.cs (SimpleName.GetSignatureForError): Add.
3305 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3306 (MemberAccess.GetSignatureForError): Add.
3308 2005-07-05 Marek Safar <marek.safar@seznam.cz>
3310 The big error and warning messages review.
3340 * typemanager.cs: Updated.
3342 * class.cs: (MethodCore.SetYields): Moved here to share.
3343 (PropertyMethod.Define): Moved iterator setup here.
3345 * iterators.cs: Add orig_method to have full access to parent
3348 2005-07-05 Raja R Harinath <rharinath@novell.com>
3350 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3351 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3352 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3353 variable of struct type.
3354 * expression.cs (Unary.ResolveOperator): Update to change.
3355 (Indirection.VerifyFixed): Likewise.
3356 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3357 (ParameterReference.VerifyFixed): Value parameters are fixed.
3358 (This.VerifyFixed): Treat 'this' as a value parameter.
3359 * statement.cs (LocalInfo.IsFixed): Remove.
3361 2005-07-01 Martin Baulig <martin@ximian.com>
3363 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3364 `ec.EmitThis ()' to get the correct scope.
3366 2005-07-01 Martin Baulig <martin@ximian.com>
3368 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3369 instance is a ParameterReference; fixes #75299.
3371 2005-06-30 Raja R Harinath <rharinath@novell.com>
3374 * expression.cs (Indexers.map): Remove.
3375 (Indexers.Append): Filter out inaccessible setters and getters.
3376 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3379 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
3381 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3382 (FieldExpr.Emit, PropertyExpr.Emit): Update.
3383 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3384 * expression.cs (Invocation.EmitCall): Add CS0120 check.
3386 2005-06-30 Marek Safar <marek.safar@seznam.cz>
3389 * class.cs (FieldBase.GetInitializerExpression): One more field
3392 2005-06-28 Miguel de Icaza <miguel@novell.com>
3394 * pending.cs: Do not define a proxy if the base method is virtual,
3395 it will be picked up by the runtime (bug 75270).
3397 2005-07-08 Martin Baulig <martin@ximian.com>
3399 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3400 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3402 2005-07-07 Martin Baulig <martin@ximian.com>
3404 * generic.cs (ConstructedType.CheckConstraint): Use
3405 ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
3406 called recursively; fixes #75329.
3408 2005-07-06 Martin Baulig <martin@ximian.com>
3410 * generic.cs (TypeManager.InferTypeArguments): Added support for
3411 anonymous methods; fixes #75461.
3413 2005-07-01 Martin Baulig <martin@ximian.com>
3415 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3416 `ec.EmitThis ()' to get the correct scope.
3418 2005-07-01 Martin Baulig <martin@ximian.com>
3420 * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
3421 instance is `This'; fixes #75299.
3423 2005-06-30 Martin Baulig <martin@ximian.com>
3425 * class.cs (Indexer): Implement IIteratorContainer; added support
3426 for iterators in indexers.
3429 (EmitContext.CurrentIterator): Make this a property, not a field.
3431 * anonymous.cs (AnonymousContainer.Iterator): New public property.
3433 2005-06-28 Miguel de Icaza <miguel@novell.com>
3435 * pending.cs: Do not define a proxy if the base method is virtual,
3436 it will be picked up by the runtime (bug 75270).
3438 2005-06-28 Martin Baulig <martin@ximian.com>
3440 * cs-parser.jay (interface_method_declaration): Avoid a
3441 reduce/reduce conflict by moving some of the code into a separate
3442 `interface_method_declaration_body' rule; fixes #75368.
3444 2005-06-28 Martin Baulig <martin@ximian.com>
3446 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
3447 array check after the check for TypeBuilder's.
3449 2005-06-21 Raja R Harinath <rharinath@novell.com>
3451 * convert.cs (FindMostEncompassedType): Add two trivial special
3452 cases (number_of_types == 0 || number_of_types == 1).
3453 (FindMostEncompasingType): Likewise.
3455 2005-06-17 Raja R Harinath <rharinath@novell.com>
3457 Some cleanups preparing for the fix of #75283.
3458 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3460 (EventExpr.InstanceResolve): Likewise.
3461 (EventExpr.DoResolve): Remove redundant checks.
3463 2005-06-08 Miguel de Icaza <miguel@novell.com>
3465 * class.cs: Small fix.
3467 2005-06-08 Raja R Harinath <rharinath@novell.com>
3470 * class.cs (GetPartialBases): Fix return value check of
3473 2005-06-07 Raja R Harinath <rharinath@novell.com>
3475 Ensure that partial classes are registered in their enclosing
3476 namespace. Initial part of fix of #75160.
3477 * tree.cs (Tree.RecordDecl): Add new namespace argument.
3478 Register declspace with namespace here, not in
3479 DeclSpace.RecordDecl.
3480 * cs-parser.jay: Pass namespace to RecordDecl.
3481 * class.cs (PartialContainer.Create): Likewise.
3482 (ClassPart.DefineType): New sanity-check. Throws an exception if
3484 * decl.cs (Declspace.RecordDecl): Remove.
3485 * namespace.cs (NamespaceEntry.DefineName): Remove.
3487 2005-06-06 Marek Safar <marek.safar@seznam.cz>
3489 * rootcontext.cs: Reset TargetExt as well.
3491 2005-06-03 Raja R Harinath <rharinath@novell.com>
3493 * ecore.cs (Expression.Resolve): Emit CS0654 error when
3496 2005-06-02 Raja R Harinath <rharinath@novell.com>
3498 Fix #75080, cs0119.cs.
3499 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
3501 (Expression.Resolve): ... this. Use it. Remove bogus code
3502 allowing ExprClass.Type and ExprClass.Namespace for
3503 ResolveFlags.VariableOrValue.
3504 (Expression.Resolve) [1-argument variant]: Change default resolve
3505 flags based on language version.
3506 (Expression.Error_UnexpectedKind): Use a simple string array
3507 rather than an ArrayList.
3508 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3510 (TypeOfVoid.DoResolve): Likewise.
3511 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
3512 flags argument -- it always has the same value.
3514 2005-05-31 Raja R Harinath <rharinath@novell.com>
3517 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3518 Use it in the error message.
3519 * assign.cs, expression.cs, statement.cs: Update.
3521 2005-05-30 Raja R Harinath <rharinath@novell.com>
3524 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3525 the "almostMatchedMember" case too.
3526 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3527 that failed the accessibility checks to 'almost_match'.
3529 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
3531 * attribute.cs: Use internal MethodBuilder methods to set
3532 ExactSpelling and SetLastError on PInvoke methods, instead
3533 of passing them via charset. Fixes #75060.
3535 2005-05-27 Raja R Harinath <rharinath@novell.com>
3537 * parameter.cs (Parameter): Remove TODO comment.
3538 (Parameter.DefineParameter): Remove Location parameter.
3539 (Parameters.LabelParameters): Likewise.
3540 * class.cs (Constructor.Emit): Update to change.
3541 (MethodData.Emit): Likewise.
3542 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
3543 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3545 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
3548 Removed Parameters.Location and added Parameter.Location instead.
3549 Removed Location parameter from Emit() and GetSignature().
3556 Modified all related calls.
3558 2005-06-21 Martin Baulig <martin@ximian.com>
3560 * generic.cs (NullCoalescingOperator.Emit): Make this work if the
3561 left-hand side is not a nullable type; fixes #75328.
3563 2005-06-21 Martin Baulig <martin@ximian.com>
3566 (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
3567 (TypeManager.GetFullNameSignature): Likewise.
3569 * convert.cs (Convert.Error_CannotImplicitConversion): Compare
3570 `source.FullName' and `target.FullName' to check whether there are
3571 two conflicting definitions.
3573 2005-06-21 Martin Baulig <martin@ximian.com>
3575 * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
3576 a BoxedCast - also for reference types - to be compatible with csc.
3578 2005-06-21 Martin Baulig <martin@ximian.com>
3580 * expression.cs (MemberAccess.DoResolve): Add support for nested
3581 types in a generic instance; fixes #75320.
3583 2005-06-20 Martin Baulig <martin@ximian.com>
3585 * generic.cs (TypeManager.InferType): Also walk the class
3586 hierarchy for generic instances; fixes #75261.
3588 2005-06-17 Martin Baulig <martin@ximian.com>
3590 * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
3591 to make things work for corlib.
3593 2005-06-15 Martin Baulig <martin@ximian.com>
3595 * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
3596 obsolete `SecurityAction' values.
3598 2005-06-06 Marek Safar <marek.safar@seznam.cz>
3600 * rootcontext.cs: Reset TargetExt as well.
3602 2005-06-09 Martin Baulig <martin@ximian.com>
3604 * delegate.cs (Delegate.VerifyMethod): Added
3605 `MethodGroupExpr old_mg' argument; inherit its
3606 `HasTypeParameters'; fix #75085.
3608 2005-06-09 Martin Baulig <martin@ximian.com>
3610 * expression.cs (Invocation.OverloadResolve): Correctly handle
3611 generic methods for the SetMemberIsUsed(); fix #75064.
3613 2005-06-09 Martin Baulig <martin@ximian.com>
3615 * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
3618 2005-06-08 Martin Baulig <martin@ximian.com>
3620 * cs-parser.jay (nullable_type_or_conditional): If we put the
3621 nullable back and our `type' is a `ComposedCast', remove the
3622 nullable from it. Fixes #75156.
3624 * expression.cs (ComposedCast.RemoveNullable): New public method.
3626 2005-06-08 Martin Baulig <martin@ximian.com>
3628 The big Iterators rewrite :-)
3630 * iterators.cs: Rewrite this to use the anonymous methods framework.
3632 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3633 before the TypeContainers; see 2test-21.cs.
3636 (TypeContainer.DefineType): Don't create a new EmitContext if we
3637 already have one (this only happens if we're an Iterator).
3638 (TypeContainer.Define): Also call Define() on all our iterators.
3639 (Method.CreateEmitContext): Added support for iterators.
3642 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3643 (AnonymousContainer.CreateMethodHost): Moved here from
3644 AnonymousMethod and made abstract.
3645 (AnonymousContainer.CreateScopeType): New abstract method.
3646 (AnonymousContainer.IsIterator): New public property.
3647 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3648 get the ScopeTypeBuilder rather than manually defining it here.
3649 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3652 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3653 before RootContext.DefineTypes().
3655 * codegen.cs (EmitContext.RemapToProxy): Removed.
3656 (EmitContext.CurrentAnonymousMethod): Changed type from
3657 AnonymousMethod -> AnonymousContainer.
3658 (EmitContext.ResolveTopBlock): Protect from being called twice.
3659 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3660 (EmitContext.EmitThis): Removed the iterators hacks; use the
3661 anonymous methods framework for that.
3664 (ToplevelBlock.Container): Make this a property, not a field.
3665 (ToplevelBlock.ReParent): New public method; move the
3666 ToplevelBlock into a new container.
3667 (Foreach.TemporaryVariable): Simplify.
3669 2005-06-05 Martin Baulig <martin@ximian.com>
3671 * statement.cs (LocalInfo.CompilerGenerated): New flag.
3672 (Block.AddTemporaryVariable): New public method; creates a new
3673 `LocalInfo' for a temporary variable.
3674 (Block.EmitMeta): Create the LocalBuilders for all the temporary
3676 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3677 non-iterator variables.
3679 2005-06-05 Martin Baulig <martin@ximian.com>
3681 * statement.cs (Foreach.TemporaryVariable): Create the
3682 LocalBuilder in the Emit phase and not in Resolve since in some
3683 situations, we don't have an ILGenerator during Resolve; see
3684 2test-19.cs for an example.
3686 2005-06-04 Martin Baulig <martin@ximian.com>
3688 The big Foreach rewrite - Part II.
3690 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3691 with `PropertyInfo ienumerator_getcurrent'.
3693 * codegen.cs (VariableStorage): Removed.
3696 (Foreach): Derive from Statement, not ExceptionStatement.
3697 (Foreach.CollectionForeach): New nested class. Moved all the code
3698 dealing with collection foreach here.
3699 (Foreach.ForeachHelperMethods): Removed.
3700 (Foreach.TemporaryVariable): Implement IMemoryLocation.
3702 2005-05-23 Martin Baulig <martin@ximian.com>
3704 * statement.cs (Try.DoResolve): Don't create a `finally' if we
3705 don't need to. Fix #75014.
3707 2005-05-26 Raja R Harinath <rharinath@novell.com>
3709 Improve user-defined conversion handling.
3710 * convert.cs (GetConversionOperators): Rewrite. Return only the
3711 applicable operators.
3712 (AddConversionOperators): New. Helper for GetConversionOperators.
3713 (FindMostEncompassedType, FindMostEncompassingType): Verify that
3714 there is only one most encompassed/encompassing type.
3715 (FindMostSpecificSource, FindMostSpecificTarget): Remove
3716 "applicable operator" handling.
3717 (UserConversion): Move cache here from GetConversionOperators.
3718 Directly cache the chosen operator, rather than the whole
3720 (ExplicitNumericConversion): Fix buggy implementation of Decimal
3721 case. Allow conversion of decimal to sbyte and byte too.
3722 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3723 New static methods. Used to avoid allocating EmptyExpressions in
3726 2005-05-24 Duncan Mak <duncan@novell.com>
3728 * ecore.cs (CastFromDecimal): New class for casting a decimal to
3729 another class, used in Convert.ExplicitNumericConversion.
3730 (CastToDecimal): New class, similar to above, but casts to
3731 System.Decimal, used in Convert.ImplicitNumericConversion and also
3732 in explicit convesion from double/float to decimal.
3734 * convert.cs (ImplicitNumericConversion): Handle implicit
3735 conversions to System.Decimal.
3736 (ExplicitNumericConversion): handle explicit conversions to
3741 2005-05-20 Miguel de Icaza <miguel@novell.com>
3743 * typemanager.cs: Do not throw an exception in the TypeBuilder
3744 case, we take care of it on the TypeCode.
3746 2005-05-17 Marek Safar <marek.safar@seznam.cz>
3748 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3751 * cs-parser.jay: Catch more lexical errors.
3753 * report.cs: Add one more Error method.
3756 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3758 2005-05-20 Martin Baulig <martin@ximian.com>
3760 * class.cs (TypeContainer.CircularDepException): Removed.
3761 (TypeContainer.DefineType): Removed the `InTransit' stuff.
3762 (TypeContainer.CheckRecursiveDefinition): Check for circular class
3763 (CS0146) and interface (CS0529) dependencies here.
3765 2005-05-20 Martin Baulig <martin@ximian.com>
3767 * expression.cs (New.DoResolve): Move the CS0712 check above the
3768 CS0144 check; otherwise it can never be reached.
3770 2005-05-20 Martin Baulig <martin@ximian.com>
3772 * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
3774 2005-05-20 Martin Baulig <martin@ximian.com>
3776 * class.cs (TypeContainer.DefineType): Fix CS0698 check.
3778 * typemanager.cs (TypeManager.IsAttributeType): New public method.
3780 2005-05-19 Martin Baulig <martin@ximian.com>
3783 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3784 to disable error reporting.
3786 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3787 here since we don't want to report an error; see the new test-336.cs.
3789 2005-05-19 Raja R Harinath <rharinath@novell.com>
3791 * statement.cs (ToplevelBlock.GetParameterReference)
3792 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3793 Move here from class Block.
3794 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3795 * expression.cs (ParameterReference.DoResolveBase): Likewise.
3797 2005-05-18 Martin Baulig <martin@ximian.com>
3802 (FlowBranching.Reachability): Add non-static public And() and Or()
3804 (FlowBranchingSwitch): New class; do the `break_origins' thing
3805 like in FlowBranchingLoop.
3806 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3807 reachability, not just locals and parameters.
3808 (FlowBranching.MergeChild): Remove some of the hacks for loop and
3809 switch; MergeBreakOrigins() now takes care of that.
3811 2005-05-18 Martin Baulig <martin@ximian.com>
3813 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3814 a loop and may leave it, reset the barrier; fixes #74974.
3816 2005-05-16 Raja R Harinath <rharinath@novell.com>
3818 Fix test-382.cs. Emit values of decimal constants.
3819 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3821 (TypeContainer.AddField): ... this.
3822 (TypeContainer.EmitFieldInitializers): Allow the list of fields
3823 with initializers to include 'Const's.
3824 (ClassPart.RegisterFieldForInitialization): Forward to
3826 * const.cs (Const.Const): Pass initializer to base class.
3827 (Const.Define): In case of decimal constants, register them for
3828 initialization in a static constructor.
3830 2005-05-14 Martin Baulig <martin@ximian.com>
3832 * statement.cs (Block.Resolve): Correctly handle unreachable code;
3833 do not call ResolveUnreachable() on unreachable statements in
3834 here, see the comment in the source code.
3836 2005-05-13 Raja R Harinath <rharinath@novell.com>
3839 * expression.cs (BinaryResolveOperator): If one of the operands of
3840 an equality comparison is 'null' and the other is a pointer type,
3841 convert the null to a NullPointer.
3842 * convert.cs (ImplicitReferenceConversion): If the expression is a
3843 NullLiteral and the target type is a pointer type, return a
3844 NullPointer instead.
3845 (ImplicitConversionStandard): Likewise.
3847 2005-05-13 Marek Safar <marek.safar@seznam.cz>
3849 * cs-parser.jay: Set readonly context based on special constructs.
3851 * expression.cs (LocalVariableReference.DoResolveBase): Improved
3852 readonly variable error handling.
3854 * rootcontext.cs (EmitCode): Don't verify members when error
3857 * statement.cs (LocalInfo): Add reaodnly context information.
3858 (SetReadOnlyContext, GetReadOnlyContext): New methods.
3860 2005-05-17 Martin Baulig <martin@ximian.com>
3862 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3865 2005-05-13 Martin Baulig <martin@ximian.com>
3867 * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
3868 handle unreachable blocks.
3870 2005-05-13 Martin Baulig <martin@ximian.com>
3873 (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
3874 (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
3877 2005-05-13 Martin Baulig <martin@ximian.com>
3879 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3880 instance variable, not a local. Fix #74873.
3881 (Block.ResolveUnreachable): Set it to true here.
3883 2005-05-12 Martin Baulig <martin@ximian.com>
3885 * cs-parser.jay (property_declaration): Pass the `current_class',
3886 not the `current_container' to Property's .ctor. Fixes #74912.
3888 2005-05-11 Martin Baulig <martin@ximian.com>
3890 * typemanager.cs (Closure): Copy this from MCS and merge all the
3891 GMCS-specific changes into it.
3893 2005-05-12 Raja R Harinath <harinath@gmail.com>
3896 * typemanager.cs (unmanaged_enclosing_types): New.
3897 (IsUnmanagedType): Avoid infloops by using
3898 'unmanaged_enclosing_types' to talk with recursive invocations.
3900 2005-05-11 Duncan Mak <duncan@novell.com>
3902 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3903 continuing to process for 'arg'.
3904 (handle_preprocessing_directive): Check the argument of the #endif
3905 directive and report error CS1025 if there are any trailing
3908 According to the C# spec, having even whitespace after the #endif
3909 directive is illegal; however, because we call arg.TrimEnd ()
3910 beforehand, we have the same behavior as csc, allowing whitespace
3911 after the directive.
3915 2005-05-11 Marek Safar <marek.safar@seznam.cz>
3919 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3920 (Constructor.GetObsoleteAttribute): Implemented correctly.
3922 2005-05-10 Martin Baulig <martin@ximian.com>
3924 * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
3925 resolve the type; fixes #74864.
3926 (DefaultValueExpression): Create the LocalTemporary in Emit(), not
3927 in DoResolve(); fixes #74862.
3929 2005-05-10 Martin Baulig <martin@ximian.com>
3931 * support.cs (ReflectionParameters.ParameterModifier): Use
3932 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3933 and `ParameterAttributes.In'. Fixes #74884.
3935 2005-05-10 Martin Baulig <martin@ximian.com>
3937 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
3938 the cache if we're just looking for `MemberTypes.NestedType' in a
3941 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3942 constraints if we're still resolving the type tree.
3943 (Expression.MemberLookup): If we're resolving the type tree, only
3944 look for `MemberTypes.NestedType' since we're only interested in
3947 * class.cs (TypeContainer.DefineType): Don't resolve the type
3948 parameters here; do this later in ResolveType() after the type
3949 tree has been resolved.
3950 (TypeContainer.ResolveType): New public method; this is called
3951 after the type tree is resolved and before the types are being
3952 populated. We resolve the generic constraints here.
3953 (TypeContainer.DoDefineMember): Check the constraints on our base
3954 class and interfaces.
3956 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
3957 set the `ResolvingTypeTree' flag on the EmitContext.
3959 * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
3961 2005-05-10 Marek Safar <marek.safar@seznam.cz>
3963 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3965 * expression.cs (Argument.GetParameterModifier): Turned to property.
3966 (Invocation.Error_InvalidArguments): Add more descriptive errors.
3968 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3971 2005-05-09 Raja R Harinath <rharinath@novell.com>
3974 * decl.cs (MemberCache.AddMethods): Register override methods,
3975 rather than non-override methods.
3976 * typemanager.cs (RegisterOverride): New.
3977 (IsOverride): Update.
3979 2005-05-09 Marek Safar <marek.safar@seznam.cz>
3981 * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
3983 2005-05-06 Martin Baulig <martin@ximian.com>
3986 (Attributable.IsClsComplianceRequired): Fix typo in the method name.
3987 (AttributeTester.AnalyzeTypeCompliance): Add generics support.
3989 2005-05-09 Marek Safar <marek.safar@seznam.cz>
3993 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3994 recursive declaration.
3996 * statement.cs (Block.ResolveMeta): Report any error in resolving.
3998 2005-05-06 Marek Safar <marek.safar@seznam.cz>
4000 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
4002 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
4004 2005-05-05 Raja R Harinath <rharinath@novell.com>
4007 * decl.cs (DeclSpace.FamilyAccessible):
4008 Use TypeManager.IsNestedFamilyAccessible.
4010 Fix reopened #64812.
4011 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
4014 2005-05-04 Raja R Harinath <rharinath@novell.com>
4015 Abin Thomas <projectmonokochi@rediffmail.com>
4016 Anoob V E <projectmonokochi@rediffmail.com>
4017 Harilal P R <projectmonokochi@rediffmail.com>
4020 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
4021 allow access to all static members.
4023 2005-05-04 Martin Baulig <martin@ximian.com>
4025 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
4027 2005-05-04 Martin Baulig <martin@ximian.com>
4031 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
4032 section at the end; make things work if `default' is not the last
4035 2005-05-04 Martin Baulig <martin@ximian.com>
4039 * statement.cs (Switch): Replaced the `got_default' field with a
4040 `default_section' one.
4041 (Switch.CheckSwitch): Set `default_section' here.
4042 (Switch.Resolve): If we're a constant switch and the constant is
4043 not found, use the default section.
4045 2005-05-03 Martin Baulig <martin@ximian.com>
4047 * expression.cs (ArrayAccess.EmitGetLength): New public method.
4049 * statement.cs (Foreach.ArrayForeach): New nested class.
4050 (Foreach.TemporaryVariable): New nested class.
4051 (Foreach.EmitArrayForeach): Removed; this is now in the new
4054 2005-05-03 Raja R Harinath <rharinath@novell.com>
4056 * pending.cs (BaseImplements): Move the #74773 fix here. This is
4058 (VerifyPendingMethods): Revert change below.
4060 * typemanager.cs (IsOverride, RegisterNonOverride): New.
4061 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
4062 that used to trigger warning -28. Remove warning -28.
4063 * expression.cs (Invocation.OverloadResolve): Use
4064 TypeManager.IsOverride to distinguish override methods.
4067 * pending.cs (VerifyPendingMethods): If a base type implements the
4068 requested interface, don't bother checking individual methods of
4069 the base type. As a side-effect, this prevents the creation of
4070 unnecessary proxies.
4072 2005-05-02 Martin Baulig <martin@ximian.com>
4076 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4077 Also `And' the locals if the old vector is null.
4078 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
4079 null; in this case we basically reset all the variables.
4081 2005-05-02 Martin Baulig <martin@ximian.com>
4085 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
4086 Added `FlowBranching branching' argument; always `and' the
4087 variables instead of `or'ing them unless we're an infinite loop.
4089 * statement.cs (While.Resolve): Create a new sibling unless we're
4092 2005-05-02 Martin Baulig <martin@ximian.com>
4096 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
4097 arguments; use it instead of creating a new TopLevelBlock.
4098 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
4099 our ConstructorInitializer.
4102 (TopLevelBlock.TopLevelBranching): New public property.
4103 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
4104 and create our `TopLevelBranching'.
4106 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
4107 anonymous method host, use `block.TopLevelBranching' rather than
4108 creating a new branching.
4110 2005-04-20 Miguel de Icaza <miguel@novell.com>
4112 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
4113 a ScopeInfo, if any of the current children is a child of the new
4114 entry, move those children there.
4116 2005-04-30 Martin Baulig <martin@ximian.com>
4118 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
4119 at the beginning of a SwitchSection. Fix #73335.
4121 2005-04-27 Marek Safar <marek.safar@seznam.cz>
4124 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
4126 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
4127 (FieldExpr.DoResolve): Obsolete members are ignored for field
4130 2005-04-26 Marek Safar <marek.safar@seznam.cz>
4132 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
4133 of arrays detection.
4135 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
4137 (Field.VerifyClsCompliance): Volatile fields are not compliant.
4139 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
4142 2005-04-25 Ben Maurer <bmaurer@ximian.com>
4144 * cs-parser.jay: Use the prefered version of -unsafe in error
4147 2005-04-22 Marek Safar <marek.safar@seznam.cz>
4149 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4152 2005-04-20 John Luke <john.luke@gmail.com>
4154 * driver.cs: fix typo in error message, --outout to --output
4156 2005-04-30 Martin Baulig <martin@ximian.com>
4158 * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
4159 handle the .NET 2.x security attributes.
4161 2005-04-30 Martin Baulig <martin@ximian.com>
4164 (TypeManager.ExpandInterfaces): Don't add things twice.
4167 (TypeContainer.VerifyClsCompliance): Allow generic instances.
4169 2005-04-29 Martin Baulig <martin@ximian.com>
4171 * generic.cs (Constraints.ResolveTypes): Expand interfaces.
4173 * anonymous.cs: Added support for anonymous generic methods.
4175 2005-04-29 Martin Baulig <martin@ximian.com>
4177 * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
4180 2005-04-29 Martin Baulig <martin@ximian.com>
4182 * generic.cs (TypeManager.HasConstructorConstraint): Removed.
4184 * expression.cs (New.DoResolve): Fix the CS0304 check.
4186 2005-04-29 Martin Baulig <martin@ximian.com>
4188 * typemanager.cs (TypeManager.GetFullName): Updated to the new
4191 * class.cs (MethodCore.IsDuplicateImplementation): If we're an
4192 explicit interface implementation, compare the interface types.
4193 (MethodData.Define): Use the new naming scheme from the latest
4195 (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
4197 * decl.cs (MemberName.GetMemberName): Removed.
4198 (MemberName.MethodName, FullName): New properties.
4200 2005-04-25 Raja R Harinath <rharinath@novell.com>
4202 * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
4204 2005-04-22 Martin Baulig <martin@ximian.com>
4206 * generic.cs (GenericMethod): Create the EmitContext in the
4207 `Define()'; in `Define(MethodBuilder)', create the type parameters
4208 before calling `Define()'. Fixes #73933.
4210 2005-04-22 Martin Baulig <martin@ximian.com>
4213 (Constraints.Resolve): Make things work wrt. the new type lookup system.
4214 (ConstructedType.ResolveAsTypeTerminal): Don't override this.
4216 * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
4217 ConstructedType, check its constraints.
4219 2005-04-20 Marek Safar <marek.safar@seznam.cz>
4221 * codegen.cs (InRefOutArgumentResolving): New field.
4223 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4224 fields outside contructor.
4226 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4228 2005-04-19 Miguel de Icaza <miguel@novell.com>
4230 * anonymous.cs (CaptureContext.EmitParameterInstance): The
4231 parameter code was not completed ever, so it was not as up-to-date
4232 as local variables. Must finish it.
4234 The bug fix was to compare the Toplevel of the block, not the
4235 current block. Thanks for Ben for pointing this out.
4237 2005-04-19 Raja R Harinath <rharinath@novell.com>
4239 * decl.cs (AddMethods): Use the declaring type of the problem
4240 method to determine if we want to squash a warning.
4242 2005-04-19 Marek Safar <marek.safar@seznam.cz>
4244 * attribute.cs: Removed debug output.
4246 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4248 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4251 2005-04-18 Raja R Harinath <rharinath@novell.com>
4254 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4255 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4256 all null comparisons against reference types.
4258 2005-04-18 Marek Safar <marek.safar@seznam.cz>
4261 * class.cs (TypeContainer.CircularDepException) New nested
4263 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4264 (TypeContainer.DefineType): Removed error, reset InTransit before
4266 (Class.DefineType): Throw exception when is in Transit.
4267 Catch exception and report error.
4268 (Struct.DefineType): Throw exception when is in Transit.
4269 Catch exception and report error.
4270 (Interface.DefineType): Throw exception when is in Transit.
4271 Catch exception and report error.
4273 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4274 handle nested exception handlers.
4276 * flowanalysis.cs (InTryWithCatch): New method, search for try with
4279 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4280 InFinally and InCatch storage.
4282 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4283 (Catch.Resolve): Set and Restore ec.InCatch.
4284 (Try.Resolve): Set and Restore ec.InFinally.
4285 (Try.HasCatch): True when try has catch.
4287 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
4289 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4290 for the same event member, so exclude such cases from warning 419.
4293 2005-04-16 Miguel de Icaza <miguel@novell.com>
4295 * expression.cs (Binary.ResolveOperator): Apply patch from John
4296 Luke to fix bug 59864: operators &, | and ^ on enumerations
4297 require that the same enum type on both sides.
4299 * driver.cs: Add warnings to old flag usage, this is to assist
4300 people who produce Makefiles and hope that the Makefiles will be
4303 * class.cs (TypeContainer.EmitType): Moved the definition of the
4304 special $PRIVATE$ field from the resolve phase to the Emit phase.
4305 During resolve we do not know if we are a struct with
4306 HasExplicitLayout, we know this only after the attributes for the
4309 Set the FieldOffset to zero on the dummy field that we create for
4310 the class. Fixes 74590.
4312 2005-04-16 Raja R Harinath <rharinath@novell.com>
4315 * ecore.cs (PropertyExpr.resolved): New.
4316 (DoResolve): Use it to handle a case of double resolution here.
4317 Handle a case of identical-name-and-type-name.
4318 * expression.cs (ArrayCreation.CheckIndices): Avoid double
4319 resolution by storing the results of expression resolution back
4320 into the "probes" array.
4322 2005-04-15 Raja R Harinath <rharinath@novell.com>
4324 Fix cs0208-7.cs and cs0208-8.cs.
4325 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4326 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
4327 error reporting to point out the reason a struct is not unmanaged.
4329 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4331 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
4332 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4334 2005-04-13 Raja R Harinath <rharinath@novell.com>
4337 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4338 IdenticalNameAndTypeName here.
4339 (EventExpr.InstanceResolve): Likewise.
4341 2005-04-13 Marek Safar <marek.safar@seznam.cz>
4343 C# 2.0 DefaultCharSetAttribute implementation
4345 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4346 which allows us to set GlobalNamespace for every resolve.
4347 (Attribute.ResolveArguments): Cut from Resolve.
4348 (Attribute.GetCharSetValue): Returns CharSet named argument.
4349 (Attribute.DefinePInvokeMethod): Gets default charset from
4351 (GlobalAttribute.ResolveAsTypeStep): Override.
4352 (GlobalAttribute.ResolveArguments): Override.
4354 * class.cs (TypeAttr): Is protected.
4356 * codegen.cs (ModuleClass.DefaultCharSet): New member.
4357 (ModuleClass.DefaultCharSetType): New memeber.
4358 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4360 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4361 charset from module.
4363 * delegate.cs (TypeAttr): Override.
4364 (Delegate.DefineType): Use this TypeAttr.
4366 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4367 at very early stage (before types are defined) to resolve model
4368 module attributes. It will probably not work with corlib but it
4371 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4372 charset from module.
4374 * typemanager.cs (default_charset_type): New type.
4376 2005-04-13 Raja R Harinath <rharinath@novell.com>
4378 * decl.cs (MemberCache.AddMethods): Don't warn if
4379 System.Object.Finalize has buggy MethodAttributes.
4381 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4384 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4386 * doc.cs : detect ambiguous reference to overloaded members.
4387 Fixed bug #71603. MS 1.1 csc does not detect it.
4389 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4391 * doc.cs : delegates must not be referenced with parameters.
4394 2005-04-12 Miguel de Icaza <miguel@novell.com>
4396 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4398 2005-04-10 Miguel de Icaza <miguel@novell.com>
4400 * driver.cs (MainDriver): Stop processing if the CLS stage found
4403 (CompilerCallableEntryPoint.InvokeCompiler): Always
4404 reset after execution; Take a TextWriter argument for the
4407 * report.cs: Use the error stream instead of hardcoding stderr.
4409 2005-04-09 Miguel de Icaza <miguel@novell.com>
4411 * class.cs: Reduce code paths to test, too small of an
4412 optimization to make it worth the extra testing. Always perform
4415 2005-04-08 Raja R Harinath <rharinath@novell.com>
4418 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4419 operators that had errors reported on them.
4421 2005-04-08 Marek Safar <marek.safar@seznam.cz>
4423 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4425 (Attribute.Resolve): Add named argument type checking.
4427 * class.cs (FixedField.Define): Use IsPrimitiveType
4429 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4431 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4432 unsafe parameter types.
4434 * statement.cs (Using.ResolveExpression): Add better error description.
4436 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4438 2005-04-08 Raja R Harinath <rharinath@novell.com>
4441 * attribute.cs (Attribute.GetAttributeUsage): Resolve
4442 AttributeUsageAttribute in the emitcontext of the attribute class,
4443 not in the emitcontext of the attributable entity it was attached to.
4444 * cs-parser.jay: Use 'current_class', not 'current_container',
4445 when creating a GlobalAttribute.
4447 2005-04-08 Alp Toker <alp@atoker.com>
4449 * pending.cs: The fix to #58413 failed to compile methods implementing
4450 interfaces with/without params modifiers and vice versa, even though
4451 params modifiers aren't part of the signature. Make the modifier check
4452 less strict as in csc.
4454 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
4455 Anoob V E <projectmonokochi@rediffmail.com>
4456 Harilal P R <projectmonokochi@rediffmail.com>
4459 * pending.cs (TypeAndMethods.mods): New. Store the parameter
4460 modifiers of pending methods.
4461 (PendingImplementation.PendingImplementation): Initialize it.
4462 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4463 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4464 with ParameterData. Add check for modifiers.
4465 * class.cs (MethodData.Define): Update to changes.
4467 2005-04-07 Raja R Harinath <rharinath@novell.com>
4469 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4471 2005-04-07 Marek Safar <marek.safar@seznam.cz>
4473 * class.cs (PropertyMethod.Define): Check private accessor in abstract
4476 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4479 * typemanager.cs: Registered RequiredAttributeAttribute.
4481 2005-04-06 Marek Safar <marek.safar@seznam.cz>
4483 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4484 Warning CS0169 is back at level 3.
4485 (IMethodData.SetMemberIsUsed): New method.
4487 * decl.cs (IsUsed): New value; moved from FieldBase.Status
4488 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4490 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4492 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4494 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4497 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4500 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4501 to avoid the problems with nested types.
4503 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
4504 Anoob V.E <projectmonokochi@rediffmail.com>
4505 Harilal P.R <projectmonokochi@rediffmail.com>
4506 Raja R Harinath <rharinath@novell.com>
4509 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4511 * typemanager (GetConstructor): Make public.
4513 2005-04-05 John Luke <john.luke@gmail.com>
4514 Raja R Harinath <rharinath@novell.com>
4517 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4518 struct too. Return false quicker in a few cases.
4519 (VerifyUnManaged): Use it.
4521 2005-04-05 Raja R Harinath <rharinath@novell.com>
4524 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4525 not 'unreachable_seen'.
4527 2005-04-04 Marek Safar <marek.safar@seznam.cz>
4529 * attribute.cs (Attribute.GetValue): Removed unused.
4531 * codegen.cs (CodeGen.TrimExt): Removed unused.
4533 * cs-parser.jay (output): Removed unused.
4535 * cs-tokenizer.cs (hex_digits): Removed unused.
4537 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4539 * expression.cs (Indirection.LoadExprValue): Removed unused.
4540 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4542 * iterators.cs (Iterator.param_types): Removed unused.
4544 * statement.cs (Goto.block): Removed unused.
4545 (ToplevelBlock.did): Removed unused.
4546 (Switch.ResolveConstantSwitch): Removed unused.
4548 2005-04-01 Ben Maurer <bmaurer@ximian.com>
4550 * rootcontext.cs: Allow mcs to bootstrap with the compilation
4553 2005-04-19 Martin Baulig <martin@ximian.com>
4555 Merged r42462 from MCS and made it work for GMCS.
4557 * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
4559 * generic.cs (GenericMethod.Define): Removed `return_type' argument.
4561 2005-04-01 Raja R Harinath <rharinath@novell.com>
4563 Fix #74232 and cs0208-3.cs.
4564 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4565 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4566 unmanaged type. Don't use FieldBuilders when 't' is a
4567 TypeBuilder. Use ModFlags and MemberType fields.
4568 * class.cs (MemberBase.member_type): Rename from MemberType.
4569 (MemberBase.MemberType): New property. Determines member_type on
4571 (MemberBase.DoDefine): Don't initialize MemberType here.
4572 (FieldMember.Define): Likewise.
4574 2005-04-01 Marek Safar <marek.safar@seznam.cz>
4577 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4578 Attributes are emitted there.
4580 2005-04-01 Raja R Harinath <rharinath@novell.com>
4582 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4583 keyword in 'partial enum' too.
4584 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4586 Report from Kamil Skalski <nazgul@omega.pl>.
4589 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4590 have partial containers too.
4592 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4593 in block' checks to Block.CheckInvariantMeaningInBlock.
4594 * statement.cs (Block.GetKnownVariableInfo): Make private.
4595 (Block.IsVariableUsedInChildBlock): Remove.
4596 (Block.IsVariableUsedInBlock): Likewise.
4597 (Block.CheckInvariantMeaningInBlock): New. Show location of
4598 conflicting declaration.
4599 (Block.AddVariable): Make error messages less long-winded and more
4600 specific. Show location of conflicting declaration.
4601 * parameter.cs (Parameters.Location): New readonly property.
4603 2005-03-31 Raja R Harinath <rharinath@novell.com>
4605 Clean up semantics of invoking ResolveMemberAccess.
4606 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4607 can have an instance, ensure that we pass in a non-TypeExpression
4608 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
4609 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4610 argument. Update to changes and simplify.
4611 (FieldExpr.Emitinstance): Remove CS0120 check.
4612 (PropertyExpr.EmitInstance): Likewise.
4613 * expression.cs (Argument.Resolve): Likewise.
4614 (Invocation.DoResolve): Update to changes in semantics of
4617 2005-03-31 Marek Safar <marek.safar@seznam.cz>
4620 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4623 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4625 2005-03-31 Raja R Harinath <rharinath@novell.com>
4627 Fix difference in behaviour with commandline invocation.
4628 * driver.cs (Driver.Reset): New.
4629 (CompilerCallableEntryPoint): Call it.
4631 * statement.cs (If.Resolve): Avoid spurious "uninitialized
4632 variable" warnings if the boolean expression failed to resolve.
4634 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
4636 * attribute.cs: Fix the union of several permissions when some of them
4637 are unrestricted (so the result isn't an unrestricted permission set).
4640 2005-03-30 Raja R Harinath <rharinath@novell.com>
4642 * ecore.cs (MemberExpr): New class. Convert from interface
4644 (MemberExpr.ResolveMemberAccess): Refactor and move here from
4645 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
4647 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4648 (MethodGroupExpr.IsExplicitImpl): Remove.
4649 (Expression.GetFieldFromEvent): Remove.
4650 (SimpleName.MemberStaticCheck): Remove.
4651 (SimpleName.DoSimpleNameResolve): Update to changes.
4652 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4653 (MemberAccess.IdenticalNameAndTypeName): Remove.
4654 (MemberAccess.error176): Move to MemberExpr.
4655 (MemberAccess.DoResolve): Update to changes.
4656 (BaseAccess.DoResolve): Likewise.
4658 2005-03-30 Marek Safar <marek.safar@seznam.cz>
4660 C# 2.0 Conditional attribute class implementation
4662 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4663 Analyzes class whether it has attribute which has ConditionalAttribute
4664 and its condition is not defined.
4666 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4667 (Class.IsExcluded): New method. Search for at least one defined
4668 condition in ConditionalAttribute of attribute class.
4670 2005-03-30 Raja R Harinath <rharinath@novell.com>
4672 * ecore.cs (PropertyExpr): Derive from Expression, not
4673 ExpressionStatement.
4674 (PropertyExpr.EmitStatement): Remove.
4676 2005-03-29 Raja R Harinath <rharinath@novell.com>
4679 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4680 internal field "value__" of an enum be private. The examples for
4681 "value__" that I found on MSDN all used FieldAttributes.Private.
4683 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4684 Don't mention IL method attribute names.
4686 Fix #47991. Remove a TODO.
4687 * statement.cs (Block.Toplevel): Make into a field.
4688 (Block.Parameters): Move into ToplevelBlock.
4689 (Block.known_variables): Rename from child_variable_names.
4690 (Block.Block): Remove variants that take Parameters. Initialize
4691 'Toplevel' with the immediately surrounding toplevel block.
4692 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
4693 LocalInfo parameter.
4694 (Block.GetKnownVariableInfo): New.
4695 (Block.IsVariableNameUsedInChildBlock): Update.
4696 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
4697 the block, even though it may not be in scope.
4698 (Block.AddVariable): Remove Parameters parameter. Use
4699 Toplevel.Parameters instead.
4700 (Block.AddConstant): Remove Parameters parameter.
4701 (Block.GetParameterReference): Update to use Toplevel.Parameters.
4702 (Block.IsParamaterReference): Likewise.
4703 (Block.IsLocalParameter): Likewise. Simplify a lot.
4704 (ToplevelBlock.Parameters): New. Moved from Block.
4705 (ToplevelBlock.ToplevelBlock): Update to changes. Always
4706 initialize Parameters to a non-null value.
4707 * cs-parser.jay: Update to changes.
4708 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4709 simple names that mean different things in the same block. Use
4710 Block.IsVariableNameUsedInBlock.
4712 2005-03-28 Raja R Harinath <rharinath@novell.com>
4714 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4716 2005-03-26 Raja R Harinath <harinath@acm.org>
4719 * assign.cs (Assign.DoResolve): When the RHS of an assignment
4720 fails to resolve, ensure that the LHS is still resolved as an
4723 2005-03-25 Raja R Harinath <harinath@acm.org>
4725 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4727 (Enum.current_ec): Remove.
4728 (Enum.LookupEnumValue): Remove EmitContext argument.
4729 Just uses the one created during DefineType.
4730 (Enum.FindMembers): Update.
4731 * expression.cs (MemberAccess.DoResolve): Update.
4733 2005-03-22 Marek Safar <marek.safar@seznam.cz>
4735 * assign.cs (Assign.DoResolve): Check for CS1717 when
4736 source and target are same (uses Equals).
4738 * expression.cs (LocalVariableReference, ParameterReference,
4739 This): Implemented Equals, GetHashCode.
4741 * statement.cs (Block.GetParameterReference): Removed useless
4744 2005-03-22 Raja R Harinath <rharinath@novell.com>
4747 * statement.cs (Block.AddVariable): Ensure that we skip implicit
4748 blocks before deciding whether the error is cs0136 or cs0128.
4750 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4751 (using_alias_directive, using_namespace_directive): Pass
4752 MemberName, not an expression to Namespace.UsingAlias and
4754 (MakeName): Use the MemberName of the namespace.
4755 * namespace.cs (Namespace.MemberName): New.
4756 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4757 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4759 * decl.cs (MemberName.Name): Make readonly.
4760 (MemberName.FromDotted): New "constructor".
4761 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4762 (MemberCore.Name): Compute from MemberName on demand.
4763 (MemberCore.SetMemberName): Provide a way to change the
4765 (MemberCore.AddToContainer): Don't take a fullname parameter.
4766 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4767 fully qualified name of the container to the member name.
4768 (TypeContainer.AddToTypeContainer): Use a fully qualified name
4769 only if the type is a member of the root container.
4770 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4771 MemberName.Left rather than searching for an embedded ".".
4772 (PartialContainer.CreatePart): Update to changes in RootContext.
4773 (MemberBase.ShortName): Turn into a property. Use
4774 MemberCore.SetMemberName.
4775 (MemberBase.ExplicitInterfaceName): Remove.
4776 (MemberBase.UpdateMemberName): Remove.
4777 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4778 (PropertyBase.SetMemberName): New override.
4779 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4780 (Tree.GetDecl): New.
4781 (Tree.AllDecls): Rename from Decls.
4782 * attribute.cs, enum.cs, report.cs: Update to changes.
4783 * driver.cs (MainDriver): Use MemberName.FromDotted on
4784 RootContext.MainClass.
4786 2005-03-21 Marek Safar <marek.safar@seznam.cz>
4788 * class.cs (FixedField.Define): Check for CS1664 and more sanity
4791 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4793 2005-03-18 Marek Safar <marek.safar@seznam.cz>
4795 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4796 property accessor modifiers.
4798 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4799 fixed buffer attribute (CS1716).
4800 (PropertyMethod.HasCustomAccessModifier): When property accessor
4801 has custom modifier.
4803 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4805 (PropertyExpr.DoResolveLValue): Add CS0272.
4807 2005-03-17 Miguel de Icaza <miguel@novell.com>
4809 * convert.cs: When converting to a pointer, use the proper Conv.U
4810 or Conv.I depending on the source data type.
4812 * cs-tokenizer.cs: Make the size for large decimal constants,
4815 2005-03-17 Martin Baulig <martin@ximian.com>
4817 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4818 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
4820 2005-03-17 Martin Baulig <martin@ximian.com>
4822 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4823 to bool so we can return an error condition.
4824 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4827 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
4829 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4832 2005-03-16 Raja R Harinath <rharinath@novell.com>
4834 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4835 Refactor to avoid traversing the list of assemblies, and to avoid
4836 string concatenation.
4837 * typemanager.cs (guid_attr_type): Remove.
4838 (negative_hits, pointers, references): Remove hashes.
4840 (GetConstructedType): New. Uses type_hash to handle constructed
4841 types (arrays, references, pointers).
4842 (GetReferenceType, GetPointerType): Use it.
4843 (GetNestedType): New. Uses type_hash to handle nested types of
4845 (LookupType, LookupTypeDirect): Remove.
4846 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
4847 'types' hash and LookupTypeReflection directly.
4848 (params_string, params_object): Use GetConstructedType.
4849 * namespace.cs (Namespace.cached_types): New. Cache of reflected
4851 (Namespace.Lookup): Use cached_types.
4852 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4853 provided by old TypeManager.LookupType.
4854 * rootcontext.cs (MakeFQN): Remove.
4855 * decl.cs (DeclSpace.MakeFQN): Likewise.
4856 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4857 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4858 TypeManager.GetConstructedType.
4859 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4861 2005-04-16 Zoltan Varga <vargaz@freemail.hu>
4863 * cs-parser.jay: Fix build.
4865 2005-03-15 Marek Safar <marek.safar@seznam.cz>
4867 * class.cs (TypeContainer.CircularDepException) New nested
4868 (MethodCore.CheckBase): Report CS1715 for properties and indexers.
4870 * cs-parser.jay: Reports CS1527 for any namespace element.
4872 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4875 * expression.cs (ParameterReference.IsAssigned): Changed error to
4877 (Error_WrongNumArguments): Moved CS0245 detection here.
4879 * statement.cs (Return.Resolve): Add CS1622 report.
4881 2005-03-11 Marek Safar <marek.safar@seznam.cz>
4883 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4885 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
4887 * attribute.cs expression.cs: Get rid of some allocations.
4889 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
4891 * doc.cs : just eliminate the latest change.
4893 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4895 * doc.cs : commented out the latest change. It breaks xml-030.cs
4897 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4899 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4900 fail. So invoke CreateType() in FindDocumentedType().
4902 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4904 * cs-tokenizer.cs : added IsKeyword().
4905 * doc.cs : Detect keyword incorrectly used as identifier.
4906 Allow identifiers prefixed by @.
4908 2005-03-10 Marek Safar <marek.safar@seznam.cz>
4910 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4911 It caused exception in namespace resolving (again!).
4913 * class.cs (Class.ctor): Removed exit.
4914 (PropertyMethod.ctor): ditto.
4916 * codegen.cs (Codegen.Reset): Reset static data.
4917 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4919 * cs-tokenizer.cs (Cleanup): Removed.
4921 * driver.cs (GetSystemDir): Rewrote to one line command.
4922 It caused problem with unloaded dynamic modules.
4923 (UnixParseOption): Removed Exit.
4924 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4925 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4926 Now can be mcs used as library.
4928 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4931 * location.cs (Reset): Reset static data.
4933 * namespace.cs (Reset): Reset static data.
4935 * report.cs (Report.Reset): Reset static data.
4937 * rootcontext.cs (RootContext.Reset): Reset static data.
4939 * tree.cs (RootTypes.ctor): Use Location.Null
4941 * typemanager.cs (TypeManager.Reset): Reset static data.
4942 (CoreLookupType): Removed Exit.
4943 (TypeHandle.Reset): Reset static data.
4945 2005-03-10 Raja R Harinath <rharinath@novell.com>
4948 * typemanager.cs (ComputeNamespaces): Import namespaces from
4949 referenced modules too.
4951 2005-03-09 Raja R Harinath <rharinath@novell.com>
4953 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4956 2005-03-09 Raja R Harinath <rharinath@novell.com>
4958 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4959 enclosing DeclSpace. This ensures that a name-lookup populates
4960 more caches and there are fewer 'TypeExpression's. Carve out
4961 nested type lookup into ...
4962 (LookupNestedTypeInHierarchy): ... this.
4964 2005-04-15 Martin Baulig <martin@ximian.com>
4966 Merged r41590 from MCS and make it work in the generics land.
4968 * generic.cs (TypeParameter.UpdateConstraints): Removed the
4971 * class.cs (PartialContainer.UpdateConstraints): Removed.
4972 (PartialContainer.CheckConstraints): Removed.
4973 (PartialContainer.SetParameterInfo): Store the constraints here.
4974 (PartialContainer.DefineTypeParameters): New public method;
4975 resolve the type parameter's constraints here. Note that the
4976 PartialContainer doesn't have an EmitContext anymore, so we must
4977 do this in the ClassPart.
4979 2005-03-09 Raja R Harinath <rharinath@novell.com>
4981 Clean up a few partial-class semantics.
4982 Fixes test-357.cs and cs1618-2.cs.
4983 * cs-parser.jay (struct_declaration): Use 'current_class' as
4984 parent of newly-created struct. Remove call to Register ().
4985 Use 'pop_current_class' to complete handing the current struct.
4986 (interface_declaration): Likewise.
4987 (class_declaration): Likewise.
4988 (enum_declaration): Use 'current_class' as parent of newly created
4990 (delegate_declaration): Likewise.
4991 (pop_current_class): New function. This is used to handle closing
4992 up the 'current_class' and 'current_container', and pointing them
4993 to the enclosing class/container.
4994 (CSharpParser): Initialize 'current_class' too.
4995 * decl.cs (MemberCore): Add check for invariant: a partial
4996 container is not a parsed entity, and thus does not enclose any
4998 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4999 (DeclSpace.BaseTypeExpr): Use it.
5000 (DeclSpace.LookupType): Add check for invariant.
5001 * class.cs (TypeContainer): Add check for invariant: a nested
5002 class should have the same NamespaceEntry as its enclosing class.
5003 (TypeContainer.EmitFieldInitializers): Make virtual.
5004 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
5006 (TypeContainer.Register): Remove.
5007 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
5008 null. Use TypeResolveEmitContext for resolving base types and
5009 interfaces. Move initialization of Parts.TypeBuilder here from
5011 (TypeContainer.DefineNestedTypes): ... here.
5012 (PartialContainer): Take a Namespace not a NamespaceEntry.
5013 (PartialContainer.Create): Don't use Register. Call the
5014 appropriate Add... function directly.
5015 (ClassPart): Take both the PartialContainer and the enclosing
5016 class as constructor arguments.
5017 (ClassPart.EmitFieldInitializers): Override.
5018 (ClassPart.PartFindNestedTypes): Remove.
5019 (FieldBase.GetInitializerExpression): Resolve the initializer
5020 expression in the emit context of the enclosing class.
5021 * tree.cs (RootTypes): Remove Register ().
5023 2005-03-08 Marek Safar <marek.safar@seznam.cz>
5025 * cs-parser.jay: Removed CS0134.
5027 * driver.cs: Removed CS1901.
5029 * expression.cs (SizeOf.DoResolve): Don't report CS0233
5030 for predefined types.
5032 2005-03-07 Duncan Mak <duncan@novell.com>
5034 * codegen.cs (Save): Catch UnauthorizedAccessException as
5035 well. Fixes bug #73454.
5037 2005-03-07 Marek Safar <marek.safar@seznam.cz>
5039 * cs-tokenizer.cs (xtoken): Add CS1035.
5041 * class.cs (MethodData.Define): Add CS0683.
5042 (FieldMember.ctor): Add CS0681.
5044 2005-03-07 Raja R Harinath <rharinath@novell.com>
5046 * ecore.cs (SimpleName.DoResolve): Rename from
5047 SimpleName.DoResolveAllowStatic.
5048 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
5049 Pass 'intermediate' flag to MemberStaticCheck.
5050 (SimpleName.MemberStaticCheck): Skip "static check" only in case
5051 of "intermediate" lookups via MemberAccess.
5052 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
5053 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
5055 2005-03-07 Raja R Harinath <rharinath@novell.com>
5058 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
5059 slipped in because of variable names that are identical to a
5060 builtin type's BCL equivalent ('string String;', 'int Int32;').
5061 (PropertyExpr.EmitInstance): Likewise.
5063 2005-03-04 Marek Safar <marek.safar@seznam.cz>
5065 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
5067 * report.cs (warning_ignore_table): Made public.
5069 2005-03-04 Raja R Harinath <rharinath@novell.com>
5072 * class.cs (MethodData.Emit): Pass 'container' to
5073 container.GetObsoleteAttribute instead of 'container.Parent'.
5075 2005-03-03 Marek Safar <marek.safar@seznam.cz>
5077 * cs-parser.jay: Add 1534 error test.
5079 * iterators.cs (Yield.CheckContext): Add error 1629.
5080 (Iterator.ctor): Save unsafe modifier.
5081 (MoveNextMethod.DoEmit): Restore unsafe context.
5083 * namespace.cs (UsingAlias): Better error message.
5085 2005-03-03 Dan Winship <danw@novell.com>
5087 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
5088 the warning message [#73219]
5090 2005-03-03 Raja R Harinath <rharinath@novell.com>
5092 Fix compile with MCS 1.0.0.0.
5093 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
5094 w_restore to not depend on string constant folding.
5096 2005-03-03 Raja R Harinath <rharinath@novell.com>
5098 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
5099 CS0246 check to users who passed 'silent = false'.
5100 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
5102 (SimpleName.SimpleNameResolve): Update.
5103 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
5104 (MemberAccess.IdenticalNameAndTypeName): Update.
5105 * doc.cs (FindDocumentedTypeNonArray): Update.
5107 2005-03-03 Raja R Harinath <rharinath@novell.com>
5109 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
5110 * parameters.cs (ComputeAndDefineParameters): Remove.
5111 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
5112 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
5113 Use GetParameterInfo.
5115 2005-03-02 Marek Safar <marek.safar@seznam.cz>
5117 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
5119 2005-03-02 Raja R Harinath <rharinath@novell.com>
5121 Unify DeclSpace.LookupType and DeclSpace.FindType.
5122 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
5123 is in charge of defining nested types on demand.
5124 (DeclSpace.LookupType): Use it when the current_type is a
5125 TypeBuilder. Use LookupTypeDirect for reflected types.
5126 (DeclSpace.FindType): Remove.
5127 (DeclSpace.LookupInterfaceOrClass): Likewise.
5128 (DeclSpace.DefineTypeAndParents): Likewise.
5129 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
5130 DeclSpace.LookupType.
5131 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
5132 * typemanager.cs (LookupType): Simplify.
5133 (AddUserType): Remove type from negative_hits.
5134 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
5135 * class.cs (TypeContainer.FindMembers): Move handling of nested
5137 (TypeContainer.FindMembers_NestedTypes): ... here.
5138 (TypeContainer.FindNestedType): Implement override.
5139 (ClassPart.FindNestedType): Delegate to PartialContainer.
5140 (ClassPart.PartFindNestedType): Looks up the nested types of the
5143 2005-04-14 Martin Baulig <martin@ximian.com>
5145 * generic.cs (ConstructedType): Moved all the type lookup and
5146 nested class logic into SimpleName.
5147 (ConstructedType.ResolveConstructedType): Our underlying type is
5148 already fully resolved; all the type lookup stuff is in
5151 * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
5152 constructed types here instead of in ConstructedType.
5154 * decl.cs (MemberName.GetTypeExpression): Always create a
5155 SimpleName, not a ConstructedType.
5156 (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
5158 2005-03-02 Martin Baulig <martin@ximian.com>
5160 * class.cs (TypeContainer.DoDefineMembers): We also need a default
5161 static constructor in static classes.
5163 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
5165 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
5166 sizeParamIndex is not specified.
5168 2005-03-01 Marek Safar <marek.safar@seznam.cz>
5171 * report.cs (WarningMessage.IsEnabled): Missing null check.
5173 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5175 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
5176 in the fields and not in the properties.
5178 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
5180 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
5183 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5185 * attribute.cs: Small refactoring (improved robustness).
5186 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
5187 (ValidateGuid): Removed.
5188 (Resolve): Removed referenced to above mentioned.
5189 (GetAttributeUsage): Made private and changed to work without
5191 (GetIndexerAttributeValue): Don't crash.
5192 (GetConditionalAttributeValue): Ditto.
5193 (GetClsCompliantAttributeValue): Ditto.
5194 (ExtractSecurityPermissionSet): All attributes exceptions are
5196 (GetPropertyValue): New helper.
5197 (GetMethodImplOptions): New method.
5198 (DefinePInvokeMethod): Reuse common code. Implemented handling of
5199 some missing properties.
5201 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5202 (Method.ApplyAttributeBuilder): Updated.
5204 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5207 2005-02-28 Raja R Harinath <rharinath@novell.com>
5210 * report.cs (Report.SymbolRelatedToPreviousError): Handle
5211 non-simple types (array, pointer, reference).
5213 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5215 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5217 * class.cs (MethodCore.IsDuplicateImplementation): Special error
5219 (Method.CheckBase): Catch wrong destructor here.
5220 (MethodData.Define): Add errors 550, 668.
5222 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5224 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5226 * pending.cs (VerifyPendingMethods): Add error 551.
5228 * typemanager.cs (CSharpName): Next error report helper.
5230 2005-02-25 Marek Safar <marek.safar@seznam.cz>
5232 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5233 attributes. Removed useless attribute double check.
5234 It saves almost 2MBs for corlib.
5236 2005-02-25 Raja R Harinath <rharinath@novell.com>
5239 * statement.cs (ExpressionStatement.Resolve): Make robust to being
5240 called twice in case of error.
5242 2005-02-23 Chris Toshok <toshok@ximian.com>
5244 Fix compiler portions of #72827.
5245 * statement.cs (Block.Emit): call Begin/EndScope on the
5246 EmitContext instead of the ILGenerator.
5248 * codegen.cs (EmitContext.BeginScope): new method, call
5249 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5251 (EmitContext.BeginScope): same, but EndScope and CloseScope
5253 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5254 offset and call the superclass's OpenScope(int) with it.
5255 (SymbolWriter.CloseScope): get the current il
5256 offset and call superclass's CloseScope(int) with it.
5258 2005-02-23 Marek Safar <marek.safar@seznam.cz>
5260 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5261 CS1677 for out and ref as well.
5263 * class.cs (Method.Define): Add error CS1599 detection.
5265 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5267 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5269 * delegate.cs (Delegate.Define): Add error CS1599 detection.
5271 * support.cs.cs (ModifierDesc): New helper method.
5273 2005-02-23 Raja R Harinath <rharinath@novell.com>
5274 Abin Thomas <projectmonokochi@rediffmail.com>
5275 Anoob V E <projectmonokochi@rediffmail.com>
5276 Harilal P R <projectmonokochi@rediffmail.com>
5279 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5280 MemberLookup (used for error reporting) actually returns a result.
5281 Fix error report number (122, not 112).
5283 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
5284 Anoob V E <projectmonokochi@rediffmail.com>
5285 Harilal P R <projectmonokochi@rediffmail.com>
5288 * pending.cs (PendingImplementation.GetAbstractMethods):
5289 Find NonPublic members too.
5291 2005-02-22 Marek Safar <marek.safar@seznam.cz>
5293 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5296 * class.cs (MethodCore.CheckMethodAgainstBase):
5297 Add error 239 report.
5299 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5301 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5303 * class.cs (Operator.Define): Add error 217 report.
5305 2005-02-21 Raja R Harinath <rharinath@novell.com>
5308 * expression.cs (Invocation.IsApplicable): Make public.
5309 (Invocation.IsParamsMethodApplicable): Likewise.
5310 * delegate.cs (Delegate.VerifyApplicability): Don't use
5311 Invocation.VerifyArgumentCompat for parameter applicability
5312 testing. Use Invocation.IsApplicable and
5313 Invocation.IsParamsMethodApplicable.
5315 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5317 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5319 * class.cs (Operator.Define): Add error 217 report.
5321 2005-02-21 Raja R Harinath <rharinath@novell.com>
5323 * namespace.cs (UsingEntry.Resolve): Undo change below.
5325 2005-02-21 Raja R Harinath <rharinath@novell.com>
5328 * ecore.cs (Expression.MemberLookupFailed): Add argument to
5329 disable the error message when the extended MemberLookup also
5331 (Expression.MemberLookupFinal): Update.
5332 (SimpleName.DoSimpleNameResolve): Update.
5333 * expression.cs (MemberAccess.ResolveNamespaceOrType):
5334 Don't use MemberLookupFinal.
5335 (New.DoResolve): Update.
5336 (BaseAccess.CommonResolve): Update.
5338 2005-02-21 Raja R Harinath <rharinath@novell.com>
5341 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5342 occured previously, don't resolve again.
5344 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5347 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5348 argument. Call ResolveAttributeUsage for unresolved.
5349 when types doesn't match ctor arguments.
5351 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5352 for nested attribute classes.
5353 (Class.attribute_usage): Removed.
5354 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5355 for attribute class.
5357 * ecore.cs (IsAttribute): Removed.
5359 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5361 * rootcontext.cs (RegisterAttribute): Removed, attributes are
5363 (attribute_types): Removed.
5364 (EmitCode): Global attributes are emited as the latest.
5366 2005-02-18 Marek Safar <marek.safar@seznam.cz>
5368 * class.cs (EmitFieldInitializers): Don't emit field initializer
5369 for default values when optimilization is on.
5371 * constant.cs (Constant.IsDefaultValue): New property.
5373 * driver.cs: Add /optimize handling.
5377 * literal.cs: Implement new IsDefaultValue property.
5379 * rootcontext.cs (Optimize): New field, holds /optimize option.
5381 2005-02-18 Raja R Harinath <rharinath@novell.com>
5383 Fix crasher in re-opened #72347.
5384 * namespace.cs (Namespace.Lookup): Return null if
5385 DeclSpace.DefineType returns null.
5388 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5390 2005-02-18 Raja R Harinath <rharinath@novell.com>
5392 Fix remainder of #63202. Change semantics of DoResolveLValue: it
5393 now returns null if it cannot resolve to an lvalue.
5394 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5395 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5396 returned null. Remove check for SimpleName.
5397 (EventExpr.DoResolveLValue): New.
5398 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5399 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
5401 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
5403 (Unary.ResolveOperator): Move CS0211 check ...
5404 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
5406 (Unary.DoResolveLValue): Simplify.
5407 (AddressOf.DoResolveLValue): New.
5408 (ArrayAccess.DoResolveLValue): New.
5410 2005-02-16 Marek Safar <marek.safar@seznam.cz>
5412 * attribute.cs (Attribute.Resolve): Add arguments casting for
5413 when types doesn't match ctor arguments.
5415 2005-02-16 Raja R Harinath <rharinath@novell.com>
5417 Fix parts of #63202.
5418 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5419 lookup of operator in base type. Ensure that all checks happen
5420 when the operator resolves to an "op_..." method.
5422 2005-02-15 Raja R Harinath <rharinath@novell.com>
5425 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5426 'ignore_cs0104' parameter. Pass it to ...
5427 (NamespaceEntry.Lookup): ... this.
5428 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5429 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5430 (TypeLookupExpression.DoResolveAsTypeStep): Update.
5431 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5432 Update. Request that cs0104 errors be ignored.
5433 (ComposedCast.ResolveAsTypeStep): Update.
5435 2005-02-14 Raja R Harinath <rharinath@novell.com>
5438 * expression.cs (Invocation.BetterFunction): Remove support for
5439 comparing virtual functions and their overrides.
5440 (Invocation.IsOverride): New.
5441 (Invocation.OverloadResolve): Don't consider 'override' functions
5442 during candidate selection. Store them in a lookaside list.
5443 If the selected method is a 'virtual' function, use the list to
5444 find any overrides that are closer to the LHS type.
5446 2005-02-14 Marek Safar <marek.safar@seznam.cz>
5448 * expression.cs (New.DoResolve): Add complex core type reduction.
5449 (New.Constantify): Converts complex core type syntax like 'new int ()'
5452 2005-02-14 Raja R Harinath <rharinath@novell.com>
5454 * decl.cs (EntryType.EntryType): New constructor to create an
5455 updated copy of a cache entry.
5456 (MemberCache.AddMethods): Use it.
5457 (MemberCache.ClearDeclaredOnly): Remove.
5458 (MemberCache.MemberCache): Update.
5460 2005-02-11 Miguel de Icaza <miguel@novell.com>
5462 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5463 variable. This one is represents the actual low-level declaration
5464 of the method, as opposed to the semantic level `IsStatic'.
5466 An anonymous method which is hosted into a static method might be
5467 actually an instance method. IsStatic would reflect the
5468 container, while MethodIsStatic represents the actual code
5471 * expression.cs (ParameterReference): Use the new MethodIsStatic
5472 instead of IsStatic.
5474 * anonymous.cs (AnonymousMethod.Compatible): Pass the
5475 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5476 set on the current EmitContext.
5478 * expression.cs (Cast): Overload DoResolveLValue so we can pass
5479 resolve our casted expression as an LValue. This triggers the
5480 proper LValue processing that is later required by Assign.
5484 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5486 2005-02-11 Marek Safar <marek.safar@seznam.cz>
5488 C# 2.0 Fixed buffer implementation
5490 * anonymous.cs: Update after RegisterHelperClass renaming.
5492 * attribute.cs (AttributeTester.fixed_buffer_cache):
5493 Cache of external fixed buffers.
5494 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5495 implementation if field is fixed buffer else null.
5498 (TypeContainer.AddField): Accept FieldMember instead of Field.
5499 (FieldBase.IsFieldClsCompliant): Extracted code from
5500 VerifyClsCompliance descendant customization.
5501 (FixedField): New class handles fixed buffer fields.
5502 (FixedFieldExternal): Keeps information about imported fixed
5504 (IFixedField): Make access to internal or external fixed buffer
5507 * cs-parser.jay: Add fixed buffer parsing.
5509 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5512 * expression.cs (Indirection): Extended implementation to accept
5514 (PointerArithmetic.Emit): Get element from fixed buffer as well.
5515 (ElementAccess.MakePointerAccess): Get type as parameter.
5516 (DoResolve): Add fixed buffer field expression conversion.
5517 (DoResolveLValue): Ditto.
5518 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5519 (ArrayPtr): Derives from FixedBufferPtr.
5520 (ArrayPtr.Emit): Add extra emit for array elements.
5522 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5524 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5525 for compiler generated types.
5526 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5528 * statement.cs (Fixed): Refactored to be easier add fixed buffer
5529 and consume less memory.
5530 (Fixed.Resolve): Add fixed buffer case.
5532 * typemanager.cs (compiler_generated_attr_ctor,
5533 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5534 (HasElementType): Add our own implementation to work on every
5537 2005-02-11 Miguel de Icaza <miguel@novell.com>
5539 * anonymous.cs (CaptureContext): Track whether `this' has been
5542 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
5543 only captured `this' if it was implicitly done (instance
5544 methods/variables were used).
5546 * codegen.cs (EmitContext.CaptureThis): New method to flag that
5547 `this' must be captured.
5549 2005-01-30 Miguel de Icaza <miguel@novell.com>
5551 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5552 is null it means that there has been no need to capture anything,
5553 so we just create a sibling.
5555 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5557 Just a partial fix. The other half is fairly elusive.
5559 2005-02-10 Raja R Harinath <rharinath@novell.com>
5561 Fix #52586, cs0121-4.cs.
5562 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
5563 and return a hashtable.
5564 (MemberCache.ClearDeclaredOnly): New.
5565 (MemberCache.MemberCache): Update to change. Make a deep copy of
5566 the method_hash of a base type too.
5567 (MemberCache.AddMethods): Adapt to having a deep copy of the base
5568 type methods. Overwrite entries with the same MethodHandle so
5569 that the ReflectedType is correct. The process leaves in base
5570 virtual functions and their overrides as distinct entries.
5571 (CacheEntry): Now a class instead of a struct. It shouldn't alter
5572 matters since it was boxed in a ArrayList before.
5573 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5575 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
5576 case of a virtual function and its override (choose the overload
5578 (Invocation.OverloadResolve): Avoid 'override' members during
5579 'applicable_type' calculation.
5581 2005-03-28 Raja R Harinath <rharinath@novell.com>
5583 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5584 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5585 GetTypeHandle. It is possible for a reflected type to derive from
5586 a TypeBuilder (e.g., int[] derives from the TypeBuilder
5587 System.Array during mscorlib compilation).
5588 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5589 contain a method_hash, don't create one either. Don't create a
5590 deep copy of the base cache's method_hash.
5591 (MemberCache.SetupCache): Rename back from DeepCopy.
5592 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5593 already initialized. If we see an override function, add its
5594 underlying base virtual function to the member_hash too.
5596 2005-02-09 Raja R Harinath <rharinath@novell.com>
5598 Combine two near-redundant caches.
5599 * typemanager.cs (method_params): Rename from method_internal_params.
5600 (TypeManager.GetParameterData): New. Replace
5601 Invocation.GetParameterData.
5602 (TypeManager.LookupParametersByBuilder): Remove.
5603 * expression.cs (Invocation.method_parameter_cache): Remove.
5604 (Invocation.GetParameterData): Remove.
5606 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5609 2005-02-08 Raja R Harinath <rharinath@novell.com>
5612 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5613 TypeManager.multicast_delegate_type is null, resolve it by looking
5614 up "System.MulticastDelegate".
5615 * rootcontext.cs (RootContext.ResolveCore): Simplify.
5617 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
5618 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
5619 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
5622 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5623 (LabeledStatement.AddReference): New. Set 'referenced'.
5624 (Goto.Resolve): Use it.
5626 2005-02-05 John Luke <john.luke@gmail.com>
5628 * driver.cs: remove duplicate -doc line in Usage ()
5630 2005-02-04 Raja R Harinath <rharinath@novell.com>
5632 * location.cs (Location.AddFile): Fix CS2002 error report.
5634 2005-02-02 Martin Baulig <martin@ximian.com>
5636 * delegate.cs (Delegate.DefineType): Report an internal error if
5637 TypeManager.multicast_delegate_type is null. See bug #72015 for
5640 2005-02-02 Raja R Harinath <rharinath@novell.com>
5642 Fix a crasher in a variant of #31984.
5643 * const.cs (Constant.CheckBase): New override that defers the
5644 new-or-override check in case the base type hasn't been populated
5646 (Constant.Define): Ensure the new-or-override check is performed.
5648 2005-02-01 Duncan Mak <duncan@ximian.com>
5650 * const.cs (LookupConstantValue): Check that `ce' is not null
5651 before calling GetValue ().
5653 2005-02-01 Raja R Harinath <rharinath@novell.com>
5655 Fix test-334.cs (#69519).
5656 * cs-parser.jay (using_alias_directive): Pass in an expression to
5657 NamespaceEntry.UsingAlias.
5658 (using_namespace_directive): Pass in an expression to
5659 NamespaceEntry.Using.
5660 (namespace_name): Don't flatten to a string.
5661 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5662 (NamespaceEntry.AliasEntry.Resolve): Lookup using
5664 (NamespaceEntry.UsingEntry): Likewise.
5665 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5667 (NamespaceEntry.LookupForUsing): Remove.
5668 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5670 (NamespaceEntry.Lookup): Remove support for dotted names.
5672 2005-02-01 Raja R Harinath <rharinath@novell.com>
5674 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5676 (NamespaceEntry.ImplicitParent): Compute on demand.
5677 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5678 parallels the current.
5679 (NamespaceEntry.LookupForUsing): Use it.
5680 (NamespaceEntry.Lookup): If the current namespace-entry is
5681 implicit, don't search aliases and using tables.
5683 2005-02-01 Raja R Harinath <rharinath@novell.com>
5686 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5688 (TypeContainer.BaseCache): Compute on demand.
5689 (TypeContainer.FindMembers): Define constants and types if they're
5690 not already created.
5691 (FieldMember.Define): Move resetting of ec.InUnsafe before error
5693 * const.cs (Constant.Define): Make idempotent.
5695 2005-01-29 Miguel de Icaza <miguel@novell.com>
5697 * pending.cs: Produce better code (no nops produced by using Ldarg
5700 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5701 i - 1' it should be arg + 1.
5705 2005-01-28 Raja R Harinath <rharinath@novell.com>
5707 * attribute.cs (Attribute.CheckAttributeType): Make private
5709 (Attribute.ResolveType): Make virtual.
5710 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5711 handling of RootContext.Tree.Types.
5713 2005-01-27 Raja R Harinath <rharinath@novell.com>
5715 Update attribute-handling to use the SimpleName/MemberAccess
5717 * cs-parser.jay (attribute): Pass in an expression to the
5718 constructors of Attribute and GlobalAttribute.
5719 * attribute.cs (Attribute): Take an expression for the name.
5720 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
5721 passed in attribute name expression.
5722 (Attribute.CheckAttributeType): Use it.
5723 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5724 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5725 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
5726 argument to prevent error messages if the lookup fails.
5728 2005-01-27 Marek Safar <marek.safar@seznam.cz>
5730 * expression.cs (Indirection): Implemented IVariable interface
5731 to support indirection in AddressOf operator.
5732 (PointerArithmetic.Emit): Add optimalization for case where
5733 result can be precomputed.
5735 2005-01-26 Martin Baulig <martin@ximian.com>
5737 * class.cs (TypeContainer.AttributeTargets): Return the correct
5738 AttributeTargets depending on our `Kind' instead of throwing an
5739 exception; fixes #71632.
5741 2005-01-26 Marek Safar <marek.safar@seznam.cz>
5744 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5747 2005-03-17 Martin Baulig <martin@ximian.com>
5749 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5750 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
5752 2005-03-17 Martin Baulig <martin@ximian.com>
5754 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5755 to bool so we can return an error condition.
5756 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5759 2005-03-17 Martin Baulig <martin@ximian.com>
5761 * generic.cs (TypeMananager.IsIEnumerable): New public method.
5763 * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
5764 converting from an array-type of T to `IEnumerable<T>'.
5766 2005-03-16 Martin Baulig <martin@ximian.com>
5768 * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
5769 (Nullable.LiftedUnaryMutator): New public class.
5771 * expression.cs (UnaryMutator.DoResolve): Added support for
5774 2005-03-14 Martin Baulig <martin@ximian.com>
5776 * generic.cs (Nullable.NullCoalescingOperator): Implemented.
5778 2005-03-14 Martin Baulig <martin@ximian.com>
5780 * generic.cs (Nullable.LiftedBinaryOperator): Added support for
5781 the comparision operators `<', `>', `<=' and `>='.
5783 2005-03-13 Martin Baulig <martin@ximian.com>
5786 (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
5787 avoid confusion with the `NullLiteral'.
5788 (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
5790 2005-03-13 Martin Baulig <martin@ximian.com>
5792 * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
5793 comparing arbitrary types with the null literal.
5795 2005-03-13 Martin Baulig <martin@ximian.com>
5797 * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
5798 boolean operators '&&', '||', '&' and '|'.
5799 (Nullable.OperatorTrueOrFalse): New public class.
5801 * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
5802 instead of a `StaticCallExpr'; added support for nullables.
5804 2005-03-10 Martin Baulig <martin@ximian.com>
5807 (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
5808 rather than `etype.IsSubclassOf (TypeManager.value_type)'.
5810 2005-03-07 Martin Baulig <martin@ximian.com>
5812 * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
5813 it work if `expr' is not an IMemoryLocation.
5814 (Nullable.Lifted): Implement IMemoryLocation.
5815 (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
5818 2005-03-05 Martin Baulig <martin@ximian.com>
5820 * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
5821 (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
5822 (Nullable): Added support for lifted unary and binary operators.
5824 * expression.cs (Unary.DoResolve): Added support for nullable types.
5825 (Binary.DoResolve): Likewise.
5826 (Conditional.DoResolve): Likewise.
5828 2005-03-02 Martin Baulig <martin@ximian.com>
5830 * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
5832 * class.cs (ClassPart.SetParameterInfo): Override this.
5833 (PartialContainer.SetParameterInfo): Override this.
5834 (TypeContainer.CheckConstraints): New protected method.
5835 (PartialContainer.CheckConstraints): Override this and check
5836 whether the same contraints were specified in all parts of a
5837 partial generic type definition.
5838 (PartialContainer.UpdateConstraints): New public method.
5840 * generic.cs (TypeParameter.UpdateConstraints): New public method.
5842 2005-03-02 Martin Baulig <martin@ximian.com>
5844 Committing a patch from Carlos Alberto Cortez to fix #72887.
5846 * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
5847 casts from `T []' to `int []'.
5849 2005-03-02 Martin Baulig <martin@ximian.com>
5851 * generic.cs (TypeManager.IsEqual): Make this symmetric.
5853 * expression.cs (Binary.ResolveOperator): When resolving a
5854 BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
5855 `=='. Fixes #71866. See gen-127.cs.
5857 2005-03-02 Martin Baulig <martin@ximian.com>
5859 * class.cs (TypeContainer.DoDefineMembers): We also need a default
5860 static constructor in static classes.
5862 2005-03-02 Martin Baulig <martin@ximian.com>
5865 (NullableType.Name, NullableType.FullName): Add a "?" to the name.
5866 (Nullable.LiftedConversion): Added support for user-defined
5869 * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
5871 * cs-parser.jay: Use ComposedCast everywhere instead of
5872 NullableType, so we don't need to check for NullableType
5874 (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
5875 case where we'll be resolved into a `parenthesized_expression_0'
5879 (Convert.UserDefinedConversion): Added nullable conversions.
5881 2005-02-28 Martin Baulig <martin@ximian.com>
5883 * generic.cs (TypeManager.IsNullableType): New static method.
5884 (Nullable): New abstract class.
5885 (Nullable.NullLiteral): New public class.
5886 (Nullable.LiftedConversion): New public class.
5888 * cs-parser.jay (non_expression_type): Changed `builtin_types' to
5889 `builtin_types opt_nullable'.
5892 (Convert.ImplicitConversionStandard): Added nullable conversions.
5893 (Convert.ExplicitConversionStandard): Likewise.
5894 (Convert.ExplicitConversion): Likewise.
5896 2005-02-26 Martin Baulig <martin@ximian.com>
5898 * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
5899 begin with a "?", for instance "?[]". Don't do a type lookup if
5902 2005-02-25 Martin Baulig <martin@ximian.com>
5904 The first part of Nullable Types :-)
5906 * generic.cs (NullableType): New public class.
5907 (NullCoalescingOperator): New public class.
5908 (TypeArguments.Resolve): Add a CS0306 check.
5910 * cs-parser.jay (opt_error_modifier): Removed, this was unused.
5911 (opt_nullable): New rule.
5912 (type): Added `opt_nullable' to `namespace_or_type_name',
5913 `builtin_types' and `pointer_type'.
5914 (array_type): Added `opt_nullable'.
5915 (opt_rank_specifier_or_nullable): New rule; this is the
5916 combination of `opt_rank_specifier' and `opt_nullable'.
5917 (opt_error): New rule; catch errors here.
5918 (nullable_type_or_conditional): New rule; we use this to check for
5919 nullable and still detect the conditional operator.
5920 (local_variable_type): Use `opt_rank_specifier_or_nullable'
5921 instead `opt_rank_specifier'.
5923 * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
5926 2005-02-24 Martin Baulig <martin@ximian.com>
5928 * README, README.Changes: Removed; they're old and obsolete.
5930 2005-02-22 Martin Baulig <martin@ximian.com>
5932 * generic.cs (TypeParameter.Resolve): If resolving the constraints
5933 returned an error, set `constraints' to null to avoid a crash
5935 (TypeParameter.ResolveType): Likewise.
5937 2005-02-22 Martin Baulig <martin@ximian.com>
5940 (Constraints.ResolveTypes): Protect against being called twice.
5941 (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
5942 (TypeParameter.ResolveType): New public method; calls
5943 constraints.ResolveTypes().
5944 (TypeParameter.DefineType): Moved constraints.ResolveType() out
5945 into the new ResolveType().
5946 (GenericMethod.Define): Call ResolveType() on all our
5949 2005-02-21 Martin Baulig <martin@ximian.com>
5952 (TypeManager.generic_nullable_type): New static public field.
5953 (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
5956 (RootContext.ResolveCore): Resolve "System.Nullable`1".
5958 2005-02-15 Martin Baulig <martin@ximian.com>
5960 * generic.cs (ConstructedType.Constraints): Correctly check
5961 constraints if the argument type is a type parameter; fixes
5964 2005-02-02 Martin Baulig <martin@ximian.com>
5966 * delegate.cs (Delegate.DefineType): Report an internal error if
5967 TypeManager.multicast_delegate_type is null. See bug #72015 for
5970 2005-01-29 Miguel de Icaza <miguel@novell.com>
5972 * pending.cs: Produce better code (no nops produced by using Ldarg
5975 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5976 i - 1' it should be arg + 1.
5980 2005-01-26 Martin Baulig <martin@ximian.com>
5982 * cs-parser.jay (indexer_declarator): Don't report an error if we
5983 have type parameters since we can be an explicit interface
5984 implementation; fixes #71449.
5986 2005-01-26 Martin Baulig <martin@ximian.com>
5988 * class.cs (TypeContainer.AttributeTargets): Return the correct
5989 AttributeTargets depending on our `Kind' instead of throwing an
5990 exception; fixes #71632.
5992 2005-01-26 Martin Baulig <martin@ximian.com>
5994 * delegate.cs (Delegate.DefineType): Correctly define our type
5995 parameters. Fixes #71483.
5997 2005-01-25 Raja R Harinath <rharinath@novell.com>
6000 * expression.cs (MemberAccess.DoResolve): Don't complain with
6001 cs0572 when the LHS of a member access has identical name and type
6004 2005-01-25 Marek Safar <marek.safar@seznam.cz>
6007 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
6009 Create custom PermissionSet only for PermissionSetAttribute.
6011 2005-01-24 Marek Safar <marek.safar@seznam.cz>
6014 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
6015 delegates in static class.
6017 2005-01-24 Martin Baulig <martin@ximian.com>
6019 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6020 merging an implicit block, just use its reachability.
6022 * statement.cs (Block.Resolve): Make the unreachable code check
6023 work wrt. implicit blocks; see test-337 from #63842.
6025 2005-01-21 Alp Toker <alp@atoker.com>
6027 * cs-parser.jay: destructor_declaration's container is PartialContainer
6028 not Class when partial types are used, so use Kind prop instead of
6031 2005-01-22 Miguel de Icaza <miguel@ximian.com>
6033 * cs-parser.jay: Improve error reporting when an interface
6036 2005-01-20 Dick Porter <dick@ximian.com>
6038 * support.cs: SeekableStreamReader fix from Sandor Dobos
6039 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
6040 chars are read. Fixes bug 70369.
6042 2005-01-20 Raja R Harinath <rharinath@novell.com>
6044 * cs-parser.jay (catch_clause): Simplify current_block handling
6047 2005-01-17 Miguel de Icaza <miguel@ximian.com>
6049 * convert.cs (ImplicitStandardConversionExists): Synchronize the
6050 code with ImplicitStandardConversion to handle the implicit
6051 conversion of method groups into valid delegate invocations.
6053 The problem is that in parameter handling we were using this code
6054 path. Fixes bug #64698
6056 2005-01-19 Raja R Harinath <rharinath@novell.com>
6058 * cs-parser.jay: Fix several infelicities.
6059 - Avoid assigning to the parser value stack. Code like
6060 '$3 = null' is unclean. Synthesize a value for the code block
6062 - Avoid using oob_stack for storing location information. Use ...
6063 (_mark_): ... this. New (empty) rule. Saves the current location
6065 (foreach_statement): Avoid using oob_stack for current_block
6066 handling. Use technique used in for_statement and
6067 using_statement. Synthesize a value for the code block to store
6068 additional intermediate information.
6070 2005-01-13 Miguel de Icaza <miguel@ximian.com>
6072 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
6073 of a different type is only allowed to private fields of a
6074 containing type, not on fields of a base class.
6076 See test-174.cs and error cs0122-9.cs
6078 2005-01-13 Raja R Harinath <rharinath@novell.com>
6080 Fix test-335.cs (bug #58126).
6081 * cs-parser.jay (argument): Split out non-expression parts of the
6082 rule into 'non_simple_argument'.
6083 (invocation_expression): Support parenthesized invocations with
6084 multiple arguments, and with single non-simple arguments.
6086 2005-01-13 Raja R Harinath <rharinath@novell.com>
6088 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
6091 2005-01-12 Raja R Harinath <rharinath@novell.com>
6093 Fix cs0038-1.cs, cs1640-6.cs.
6094 * ecore.cs (Expression.Resolve): Remove special-case for
6095 SimpleName in error-handling.
6096 (Expression.almostMatchedMembers): Relax access permission to
6098 (Expression.MemberLookupFailed): Handle duplicates in
6099 almostMatchedMembers list.
6100 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
6101 * expression.cs (New.DoResolve): Report CS1540 for more cases.
6102 * typemanager.cs (GetFullNameSignature): Use the MethodBase
6103 overload if the passed in MemberInfo is a MethodBase.
6105 2005-01-25 Martin Baulig <martin@ximian.com>
6108 (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
6110 2005-01-12 Marek Safar <marek.safar@seznam.cz>
6113 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
6114 for non-CAS & merge permission sets properly.
6116 2005-01-11 Raja R Harinath <rharinath@novell.com>
6118 Improve standard-compliance of simple name and member access
6119 resolution. Fixes bugs #52697, #57200, #67520, #69519.
6120 * ecore.cs (FullNamedExpression): New abstract base class
6121 for Namespaces and TypeExpressions.
6122 (ResolveFlags.SimpleName): Remove.
6123 (SimpleName): Remove support for dotted names.
6124 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
6125 DeclSpace.FindType and DeclSpace.LookupType.
6126 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
6127 (Expression.ExprClassName): Make member function.
6128 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
6129 a namespace. Remove creation of dotted "SimpleName"s.
6130 (MemberAccess.DoResolve): Likewise.
6131 * decl.cs (DeclSpace.Cache): Make private.
6132 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
6133 (DeclSpace.FindType): Update.
6134 (DeclSpace.LookupType): Move here from RootContext. Return a
6135 FullNamedExpression.
6136 * namespace.cs (Namespace): Derive from FullNamedExpression
6137 so that it can be part of expression resolution.
6138 (Namespace.Lookup): Return an FullNamedExpression.
6139 (NamespaceEntry.LookupAlias): Lookup aliases only in current
6141 * rootcontext.cs (NamespaceLookup): Remove.
6142 (LookupType): Move to DeclSpace.
6143 * attribute.cs (CheckAttributeType): Update.
6144 * doc.cs (FindDocumentedType): Remove allowAlias argument.
6145 (FindDocumentedTypeNonArray): Likewise.
6147 2005-01-11 Raja R Harinath <rharinath@novell.com>
6149 Fix cs0509.cs, cs1632.cs.
6150 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
6151 is the same as IsInterface.
6152 (TypeContainer.GetClassBases): Likewise.
6153 * statement.cs (LabeledStatement.ig): New field.
6154 (LabeledStatement.LabelTarget): Save ILGenerator which created the
6156 (LabeledStatement.DoEmit): Check that the label was created with
6157 the same ILGenerator.
6159 2005-01-10 Marek Safar <marek.safar@seznam.cz>
6162 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
6163 accessors to its properties.
6165 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
6166 from accessors to property.
6168 2005-01-10 Marek Safar <marek.safar@seznam.cz>
6171 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
6174 2005-01-08 Miguel de Icaza <miguel@ximian.com>
6176 * attribute.cs: Check for null and empty strings.
6178 I have lost another battle to Paolo.
6180 2005-01-07 Marek Safar <marek.safar@seznam.cz>
6183 * class.cs (PropertyMethod): Set Parent field in ctors.
6184 (SetMethod.InternalParameters): Add unsafe switch hack.
6185 Override MarkForDuplicationCheck where it is appropriate.
6187 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
6188 It says whether container allows members with the same name.
6190 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
6191 Removed is_method parameter.
6193 2005-01-06 Duncan Mak <duncan@ximian.com>
6195 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6196 because the previous change led to incorrect reporting of CS1032
6197 ("Cannot define/undefine preprocessor symbols after first token in
6198 file"). Instead of using `tokens_seen' as the only flag that
6199 triggers CS1040, introduce `comments_seen'. This new flag is used
6200 to signify having seen comments on the current line, so it is
6201 unset after a newline.
6203 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
6205 * doc.cs : When searching for a type, find nested type too.
6206 This fixes bug #71040.
6208 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
6211 - Warn missing member comment on those classes which also does not
6212 have doc comments. Fixed bug #71041.
6213 - Don't warn missing doc comment on default constructor.
6216 2005-01-06 Duncan Mak <duncan@ximian.com>
6218 * cs-tokenizer.cs (xtoken): After handling traditional C-style
6219 comments, set `tokens_seen' to true. This allows us to detect
6220 misplaced preprocessor directives (i.e. not at the beginning of
6221 the a line, nor after whitespaces). In that case, report error
6222 CS1040. This fixes bug #56460.
6224 * cs-parser.jay (interface_member_declaration): Add checks for
6225 IsExplicitImpl, and report CS0541 error if an interface member is
6226 defined as an explicit interface declaration.
6228 2005-01-06 Marek Safar <marek.safar@seznam.cz>
6231 * class.cs (PropertyMethod): Set Parent field in ctors.
6232 (SetMethod.InternalParameters): Add unsafe switch hack.
6234 * decl.cs (MemberCore.Parent): Cannot be readonly.
6236 2005-01-06 Raja R Harinath <rharinath@novell.com>
6238 * decl.cs (DeclSpace.ResolveType): Remove.
6239 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
6240 Merge in code from ...
6241 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
6242 * class.cs, enum.cs: Update to changes.
6244 2005-01-06 Miguel de Icaza <miguel@ximian.com>
6246 * anonymous.cs: Ensure that we init the scope of our parent if it
6247 has not been initialized yet.
6249 2004-12-30 Duncan Mak <duncan@ximian.com>
6251 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6252 if field.FieldBuilder is null. Fixes #70758.
6254 * convert.cs: Fixed some typos and updated some of the comments.
6255 (ImplicitStandardConversionExists):
6256 (TryImplicitIntConversion): If `target_type' is an interface and
6257 the type of `ic' implements this interface, return true or a new
6258 BoxedCast instead of null. This fixes #70468.
6260 2004-12-29 Duncan Mak <duncan@ximian.com>
6262 * expression.cs (Argument.Emit): Check that Expr is
6263 IMemoryLocation before casting to it, and report CS1510 otherwise.
6267 2004-12-21 Ben Maurer <bmaurer@ximian.com>
6269 * statement.cs (Block.ThisVariable): remove the recursion here, to
6270 make the --profile more sane.
6272 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
6274 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6275 assembly, by JB Evain.
6277 2004-12-17 Raja R Harinath <rharinath@novell.com>
6279 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
6280 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6281 "parent" refers to enclosing type/class. "base" refers to superclass.
6283 2004-12-17 Raja R Harinath <rharinath@novell.com>
6285 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6286 Ensure that we only have GlobalAttributes.
6287 * attribute.cs (Attribute.Emit): Make non-virtual.
6288 (GlobalAttribute.Emit): Remove.
6289 (Attribute.Resolve): Make virtual.
6290 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
6291 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6292 the argument. Don't create one.
6293 (Attribute.GetObsoleteAttribute): Likewise.
6294 (Attribute.GetClsCompliantAttributeValue): Likewise.
6295 * class.cs, decl.cs: Update to changes.
6297 2004-12-17 Marek Safar <marek.safar@seznam.cz>
6299 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6301 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6303 * statement.cs (Foreach.Resolve): Add error 186 report.
6305 2004-12-16 Marek Safar <marek.safar@seznam.cz>
6307 * expression.cs (Conditional.DoResolve): Add warning 429.
6309 * statement.cs (If.Resolve): Add warning 665.
6311 2004-12-16 Raja R Harinath <rharinath@novell.com>
6313 New invariant: RootContext.Tree.Types.NamespaceEntry == null
6314 except when in the parser, and in GlobalAttribute.
6315 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6316 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6317 RootContext.Tree.Types.NamespaceEntry once work is done.
6318 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
6319 and resets RootContext.Tree.Types.NamespaceEntry.
6321 2004-12-15 Marek Safar <marek.safar@seznam.cz>
6323 * cs-parser.jay: Don't create a block for every variable.
6325 2004-12-14 Miguel de Icaza <miguel@ximian.com>
6327 * location.cs: Provide extra information.
6329 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6330 variables from the captured environment, it is the ldarg_0.
6332 2004-12-14 Marek Safar <marek.safar@seznam.cz>
6334 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6337 * class.cs: Changed warning level for 169 to avoid developer
6338 displeasure from warning flooding. It will be changed back when they
6339 fix most of current BCL warnings.
6341 * RootContext.cs: Pushed default WarningLevel to 3.
6343 * statement.cs: Removed unused variable.
6345 2004-12-14 Marek Safar <marek.safar@seznam.cz>
6347 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6348 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6349 Add error 502 report.
6350 (StaticClass.DefineType): Add error 441 report.
6351 (Class.AllowedModifiersProp): New virtual property as temporary
6352 extension to AllowedModifiers.
6353 (Class.DefineType): Add error 418 report. Moved ModFlags check here
6354 to share implementation with StaticClass and don't call virtual
6357 * driver.cs (MainDriver): Add error 1558 test.
6359 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6360 report. Moved error 36 test here.
6362 * statement.cs (Throw.Resolve): Add error 724 report.
6364 * typemanager.cs: Add out_attribute_type core type.
6366 2004-12-13 Marek Safar <marek.safar@seznam.cz>
6368 * class.cs (TypeContainer.VerifyClsCompliance): Add error
6370 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6372 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6375 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6377 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
6378 Add error 3023 report.
6379 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6381 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6384 2004-12-12 John Luke <john.luke@gmail.com>
6386 * driver.cs (AddArgs): take -- into account when
6387 adding arguments, fixes bug 65710
6389 2004-12-12 Martin Baulig <martin@ximian.com>
6391 * expression.cs (Unary.TryReduceNegative): Added support for
6392 SByteConstant and ByteConstant.
6393 (Unary.Reduce): Check error values from TryReduceNegative().
6395 2004-12-10 Marek Safar <marek.safar@seznam.cz>
6397 * attributes.cs (Attribute.Resolve): Avoid multiple error report
6398 and report exception as error 182.
6400 2004-12-10 Raja R Harinath <rharinath@novell.com>
6402 * driver.cs (Main): Fix message when there are warnings.
6404 2004-12-09 Miguel de Icaza <miguel@ximian.com>
6406 * delegate.cs: Fixed my fix from yesterday, sorry about that.
6408 2004-12-09 Marek Safar <marek.safar@seznam.cz>
6410 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
6411 Reduced number of warnings.
6413 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6415 2004-12-08 Miguel de Icaza <miguel@ximian.com>
6417 * driver.cs: Removed message.
6419 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6421 2004-12-08 <vargaz@freemail.hu>
6423 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6425 2004-12-08 Martin Baulig <martin@ximian.com>
6427 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6428 instead of a CS3002 for properties and indexer.
6430 2004-12-08 Martin Baulig <martin@ximian.com>
6432 * decl.cs (MemberName.ToString): Make this work again.
6434 2004-12-08 Marek Safar <marek.safar@seznam.cz>
6436 * attribute.cs (Resolve): Add error 591 detection.
6438 * class.cs (FieldMember.Define): Add error 1547 detection.
6439 (Indexer.Define): Add error 620 detection.
6440 (Operator.Define): Add error 590 detection.
6442 * ecore.cs: Missing argument for error 79.
6444 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6447 2004-12-07 Marek Safar <marek.safar@seznam.cz>
6450 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6453 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
6455 * cs-parser.jay : handle doc comments on implicit/explicit operators.
6456 Some operator comments were suppressed.
6457 * doc.cs : Implicit/explicit operator name in doc comments are like
6458 "op_Explicit(type)~returnType", so added suffix handling.
6460 2005-01-21 Alp Toker <alp@atoker.com>
6462 * cs-parser.jay: destructor_declaration's container is PartialContainer
6463 not Class when partial types are used, so use Kind prop instead of 'is'.
6465 2004-12-12 Martin Baulig <martin@ximian.com>
6467 * expression.cs (Unary.TryReduceNegative): Added support for
6468 SByteConstant and ByteConstant.
6469 (Unary.Reduce): Check error values from TryReduceNegative().
6471 2004-12-11 Martin Baulig <martin@ximian.com>
6473 * support.cs (ReflectionParameters.ParameterName): If we have a
6474 `gpd', call `ParameterName' on it.
6476 * parameter.cs (Parameter.GetParameterAttributes): New static method.
6478 * pending.cs (PendingImplementation.DefineProxy): Call
6479 DefineParameter() for all of the MethodBuilder's arguments.
6481 2004-12-09 Martin Baulig <martin@ximian.com>
6483 * doc.cs (DocUtil): Make this a static class.
6485 2004-12-09 Martin Baulig <martin@ximian.com>
6487 * expression.cs (Invocation.InferType): Moved the type inference
6488 implementation into TypeManager.
6490 * generics.cs (TypeManager): Moved the type inference
6491 implementation here.
6493 2004-12-09 Martin Baulig <martin@ximian.com>
6495 * typemanager.cs (TypeManager): Make this a partial class.
6498 (TypeManager): Move the generics part of `TypeManager' here.
6500 2004-12-08 Martin Baulig <martin@ximian.com>
6502 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6503 instead of a CS3002 for properties and indexer. Added CS3024
6504 check for generic interfaces.
6506 * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
6507 instances are not CLS-compliant.
6509 2004-12-08 Martin Baulig <martin@ximian.com>
6512 (void_pointer_expression): New rule for `void*', `void**' etc.
6513 (typeof_expression): Add `void_pointer_expression'; fixes #66846.
6515 2004-12-08 Martin Baulig <martin@ximian.com>
6517 * expression.cs (Invocation.InferType): Removed the hack for
6518 MethodCore.MayUnify().
6520 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
6523 * class.cs (MethodCore.MayUnify): Use
6524 TypeManager.MayBecomeEqualGenericTypes().
6526 2004-12-08 Martin Baulig <martin@ximian.com>
6528 * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
6529 parameter, box it. Fixes #69233.
6531 2004-12-08 Martin Baulig <martin@ximian.com>
6533 * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
6534 have the ctor constraint. Fixes #68326.
6536 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
6538 * cs-parser.jay : interface comment was not consumed because of
6539 extra opt_semicolon before doc handling.
6541 2004-12-03 Raja R Harinath <rharinath@novell.com>
6543 Fix test-327.cs, test-328.cs, and put in early infrastructure
6544 for eventually fixing #52697.
6545 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6546 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6548 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6549 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6550 (VerifyUsing, error246): Update.
6551 * rootcontext.cs (RootContext.NamespaceLookup): Just use
6552 'NamespaceEntry.LookupNamespaceOrType'.
6554 2004-12-07 Martin Baulig <martin@ximian.com>
6556 * driver.cs: Call it "BETA SOFTWARE" :-)
6558 2004-12-06 Raja R Harinath <rharinath@novell.com>
6560 Fix crash on cs0657-17.cs.
6561 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6562 Use RootContext.Tree.Types, not 'new RootTypes ()'.
6563 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6564 the case where the NamespaceEntry gets overwritten.
6566 2004-12-06 Marek Safar <marek.safar@seznam.cz>
6568 Fixed #69195, #56821
6569 * ecore.cs (ResolveBoolean): Tiny refactoring.
6571 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6572 of right expression resolving when left is false constant and
6573 operator is LogicalAnd OR true constant and operator is LogicalOr.
6575 * statement.cs (ResolveUnreachable): Always reports warning.
6577 2004-12-05 Miguel de Icaza <miguel@ximian.com>
6579 * class.cs: Distinguish between 1721 and 1722 (just a little help
6580 for the programmer).
6582 2004-12-03 Miguel de Icaza <miguel@ximian.com>
6584 * delegate.cs: Only allow this on new versions of the language.
6586 2004-12-02 Duncan Mak <duncan@ximian.com>
6588 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6590 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6591 here as a static method. Take an additional bool out parameter
6592 `must_do_cs1540_check' for signaling to InstanceResolve.
6593 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6594 member field from PropertyExpr class and made it an argument of
6596 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6597 check for MarshalByRefObject, and report CS0122 instead of CS1540.
6598 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6599 and `remove_accessor' as well as InstanceResolve: report CS0122
6604 2004-12-07 Martin Baulig <martin@ximian.com>
6606 * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
6607 and CS0692 where appropriate.
6609 2004-12-06 Martin Baulig <martin@ximian.com>
6611 * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
6612 IsDuplicateImplementation() and improved it.
6614 * expression.cs (Invocation.InferTypeArguments): Added
6615 `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
6616 and removed the "ref" modifier from `infered_types'.
6618 * decl.cs (MemberName.ToString): Removed the exception.
6620 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
6622 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6623 comments are allowed.
6625 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6627 * delegate.cs: Add checks for subtypes in paramaters and return values
6628 in VerifyMethod () to add support for Covariance/Contravariance
6631 2004-12-02 Miguel de Icaza <miguel@ximian.com>
6633 * report.cs: Remove extra closing parenthesis.
6635 * convert.cs (Error_CannotImplicitConversion): If the name of the
6636 types are the same, provide some extra information.
6638 2004-12-02 Marek Safar <marek.safar@seznam.cz>
6641 * attribute.cs (Resolve): Improved implementation of params
6642 attribute arguments.
6644 * support.cs (ParameterData): Add HasParams to be faster.
6646 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
6648 all things are for /doc support:
6650 * doc.cs: new file that supports XML documentation generation.
6651 * mcs.exe.sources: added doc.cs.
6653 Handle /doc command line option.
6654 Report error 2006 instead of 5 for missing file name for /doc.
6655 Generate XML documentation when required, after type resolution.
6657 Added support for picking up documentation (/// and /** ... */),
6658 including a new XmlCommentState enumeration.
6660 Added lines to fill Documentation element for field, constant,
6661 property, indexer, method, constructor, destructor, operator, event
6662 and class, struct, interface, delegate, enum.
6663 Added lines to warn incorrect comment.
6665 Added Documentation field (passed only when /doc was specified).
6667 Added DocComment, DocCommentHeader, GenerateDocComment() and
6668 OnGenerateDocComment() and some supporting private members for
6669 /doc feature to MemberCore.
6671 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6673 Added overriden DocCommentHeader.
6675 Added overriden DocCommentHeader and GenerateDocComment().
6677 2004-12-01 Miguel de Icaza <miguel@ximian.com>
6679 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6680 unwrapping the enumeration values, chain to
6681 DoConstantNumericPromotions again, so we can promote things to the
6682 fundamental types (takes care of enums that are bytes, sbytes).
6686 2004-12-01 Raja R Harinath <rharinath@novell.com>
6688 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6689 Fix long-standing bug in type-lookup. Use FindType instead of
6690 LookupType when ec.ResolvingTypeTree.
6691 (Attribute.ResolveType, Attribute.Resolve)
6692 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6694 (Attributes.Search): Remove internal version. Update.
6695 (Attributes.SearchMulti): Update.
6696 (Attributes.GetClsCompliantAttribute): Remove.
6697 (Attributes.GetIndexerNameAttribute): Remove.
6698 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6699 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6700 * class.cs (Indexer.Define): Likewise.
6702 2004-12-01 Marek Safar <marek.safar@seznam.cz>
6705 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6706 MarshallByReference members access.
6708 * expression.cs: Use CheckMarshallByRefAccess;
6709 Better error CS0197 message.
6711 * report.cs: Print whole related error message.
6713 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6715 * class (GetClassBases): Better error 60 report.
6716 (EventProperty): Disabled warning 67 detection.
6718 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6721 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6723 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6726 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6729 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6731 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6733 2004-11-26 Miguel de Icaza <miguel@ximian.com>
6735 * attribute.cs (Attribute.Resolve): Refine error reporting and
6736 report a cs0117 if the identifier does not exist, to distinguish
6737 from 0617 which is a miss-use of the actual identifier.
6739 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6740 between cs0070 and cs0079.
6742 * class.cs (MemberBase.DoDefine): When reporting a wrong
6743 accessibility level, we use MethodCore to compare instead of
6744 Method (this was a regression in some refactoring effort).
6746 So now we correctly report cs0056 again.
6748 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6749 testing the target_type (which was known to be object_type) and
6750 not the source type (which is anonymous_method).
6752 Fixed reporting of error cs1660.
6754 * expression.cs (UserCast.Source): Expose the underlying cast.
6756 * statement.cs (Switch.SwitchGoverningType): Sort the list of
6757 allowed types to find a match to int32 first (most common).
6759 In addition, it ignores any ImplicitUserConversions that did an
6760 internal implicit conversion (as the switch statement allows only
6761 one integral conversion to exist).
6763 * class.cs (PartialContainer.Create): rename `name' to
6764 `member_name' for clarity. Then replace the string calls with a
6765 call to MemberName.GetPartialName, as now using
6766 MemberName.ToString is an error (this is due to the side effects
6767 it had, that were fixed in the past).
6769 This will restore the error reporting on a number of partial class
6770 errors that were missusing this (and getting an exception as a
6771 results, which is now just a plain textual warning, because
6772 yyparse debug output would crash otherwise).
6774 2004-11-26 Raja R Harinath <rharinath@novell.com>
6776 * Makefile (PROGRAM_INSTALL_DIR): Remove.
6778 2004-11-25 Ben Maurer <bmaurer@ximian.com>
6780 * rootcontext.cs (LookupType): Make sure to cache lookups that
6781 don't give us a negative result. This saves about 5% of corlib
6784 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6786 * report.cs (AbstractMessage.Print): messages are sent to stderr
6788 * class.cs (TypeContainer.GetClassBases): It is an error to have a
6789 non-interface in the list of interfaces (at this point, either
6790 parent was properly set, or a base class is being listed in the
6791 interfaces section).
6793 This flags error 1722, and resolves the crash from bug 69259.
6795 2004-11-25 Ben Maurer <bmaurer@ximian.com>
6797 * statement.cs (Using.EmitExpressionFinally): make this work right
6798 for valuetypes. Fixes 69926.
6800 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6802 * const.cs (Const.ChangeType): Cope with the "0 literal can be
6803 converted to an enum" here, before we try to change the underlying
6804 type. This code exists, but it is a different code path than the
6805 one used while encoding constants.
6807 (ImplicitReferenceConversionExists): In addition, resynchronized
6808 the code here, so it matches the same code in
6809 ImplicitReferenceConversionExists for the `from any class-type S
6810 to any interface-type T'.
6812 2004-11-25 Marek Safar <marek.safar@seznam.cz>
6814 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6816 2004-11-24 Miguel de Icaza <miguel@ximian.com>
6818 * cs-parser.jay: Use verbosity accordingly.
6820 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6822 * expression.cs (Unary.ResolveOperator): Do not report warning;
6823 AddressOf reads from variable.
6825 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6827 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6831 * attribute.cs (Attributable): Removed CheckTargets.
6832 (Attributes.Emit): Explicit attribute targets are tested here.
6834 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6835 not enabled for interfaces.
6837 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6838 (GetAssemblyName): Ouch next bug there.
6840 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6842 * expression.cs: Error 275 added.
6844 2004-11-23 Marek Safar <marek.safar@seznam.cz>
6846 Fix bug #69177 (Implemented decimal constant support)
6848 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6849 (BinaryFold): Add DecimalConstant.
6851 * const.cs (Define): Decimal constant
6853 (ChangeType): Add decimal type handling.
6854 (LookupConstantValue): Don't set value for decimal type but
6855 emit DecimalConstantAttribute. Needed for constant optimization.
6857 * constant.cs (ToDecimal): New method.
6858 (ConvertToDecimal): New method.
6859 (IntConstant): Implemented ConvertToDecimal.
6860 (DecimalConstant.Emit): Emit optimized version for decimals in
6863 * expression.cs (ResolveOperator): Changed order of constant
6864 reduction to work correctly with native types which have
6865 overloaded operators.
6866 (ResolveMemberAccess): Extract constant value from attribute
6869 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6871 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6872 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6873 (ChangeType): Decimal is special.
6874 (TypeToCoreType): Add decimal type.
6876 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6878 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6881 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6883 * class.cs (EventField.ApplyAttributeBuilder): Fix error
6886 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6888 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6890 * pending.cs (PendingImplementation): Grab only interfaces.
6892 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6894 * statement.cs (ForeachHelperMethods): Add location member and
6895 error 202 detection.
6897 2004-11-18 Marek Safar <marek.safar@seznam.cz>
6899 * expression.cs (DoResolveBase): Fixed wrong warning for out
6902 2004-12-04 Martin Baulig <martin@ximian.com>
6904 * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
6905 to check whether the conversion is ok.
6907 * typemanager.cs (TypeManager.GetTypeArguments): Just return
6908 `Type.EmptyTypes' if we're not a generic TypeContainer.
6910 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6912 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6913 old bug: when converting from the null literal to a pointer,
6914 return an EmptyCast, not the NullLiteral.
6916 This fixes #69921, the recent null_type changes probably made this
6919 2004-12-03 Martin Baulig <martin@ximian.com>
6921 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6922 method as our child, call AnonymousMethod.Compatible() on it.
6924 2004-12-02 Miguel de Icaza <miguel@ximian.com>
6926 * class.cs (FieldBase): Use an unused bit field from the field to
6927 encode the `has_offset' property from the FieldMember. This saves
6928 a couple of Ks on bootstrap compilation.
6930 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6931 method as our child, return the AnonymousMethod resolved
6934 * expression.cs (New.DoResolve): Allow return values from
6935 NewDelegate to also include AnonymousMethods.
6939 2004-11-29 Raja R Harinath <rharinath@novell.com>
6941 * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
6943 * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
6944 System.Runtime.InteropServices._Exception, since it's a base
6945 interface of the core type System.Exception in the net_2_0 profile.
6947 2004-11-27 Martin Baulig <martin@ximian.com>
6949 * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
6951 2004-11-26 Raja R Harinath <rharinath@novell.com>
6953 * Makefile: Convert to use executable.make.
6954 * gmcs.exe.sources: New.
6956 2004-11-25 Martin Baulig <martin@ximian.com>
6958 * expression.cs (Invocation.InferType): Added support for byref types.
6960 2004-11-25 Martin Baulig <martin@ximian.com>
6962 * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
6963 in TypeManager.TypeToCoreType().
6965 2004-11-25 Martin Baulig <martin@ximian.com>
6967 * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
6968 "Dispose" method from the `current_type'.
6969 (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
6970 DoDefineMembers() instead of using the MethodBuilder; this is
6971 required for generic iterators.
6973 * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
6975 2004-11-24 Martin Baulig <martin@ximian.com>
6977 * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
6979 2004-11-20 Martin Baulig <martin@ximian.com>
6981 * expression.cs (Invocation.InferType): Correctly infer generic
6982 instances; see gen-103.cs.
6983 (Invocation.InferTypeArguments): If a generic method doesn't have
6984 any unbound type parameters, we don't need to infer anything.
6986 2004-11-19 Raja R Harinath <rharinath@novell.com>
6988 * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
6990 2004-11-17 Raja R Harinath <rharinath@novell.com>
6992 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6993 (TypeHandle.GetMemberCache): New.
6994 (TypeHandle.TypeHandle): Update.
6995 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6996 (TypeManager.LookupParentInterfacesCache):
6997 Rename from LookupInterfaceCache. Optimize slightly.
6998 (TypeManager.MemberLookup_FindMembers): Update.
6999 * decl.cs (MemberCache.MemberCache): Set Container to null in the
7001 (AddCacheContents): Rename from AddHashtable.
7002 * class.cs (TypeContainer.parent_container): Remove.
7003 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
7004 (TypeContainer.DoDefineMembers): Don't initialize it.
7005 Update to name changes.
7007 2004-11-17 Miguel de Icaza <miguel@ximian.com>
7009 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
7010 that factors the code to check access modifiers on override.
7012 (PropertyBase): Use the code here.
7014 Patch from Lluis S'anchez, fixes bug #69361.
7016 2004-11-15 Miguel de Icaza <miguel@ximian.com>
7018 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
7019 routine that is used to report the use of a captured variable
7020 whose address has been taken.
7022 There are two checks: one when variables are being captured and
7023 the other check is when the address of a variable is taken.
7025 (because an anonymous methods might be resolved before *or* after
7026 the address has been taken) and
7028 * expression.cs (Conditional.DoResolve): Remove the special
7029 casing that Martin added to trueExpr and falseExpr being both
7030 NullLiteral. We get the right behavior now just by introducing
7031 the null_type into the compiler.
7033 * convert.cs (ExplicitConversion): Change the code to use
7034 null_type instead of testing `expr is NullLiteral'.
7035 (ImplicitConversionStandard): use null_type too.
7036 (ImplicitReferenceConversionExists): use null_type too.
7037 (ImplicitReferenceConversion): use null_type too.
7039 * literal.cs: The type of `NullLiteral' is now null_type instead
7041 (Resolve): Set the type here.
7043 * typemanager.cs: Introduce null_type.
7045 2004-11-18 Martin Baulig <martin@ximian.com>
7048 (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
7050 2004-11-18 Martin Baulig <martin@ximian.com>
7052 * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
7054 2004-11-18 Martin Baulig <martin@ximian.com>
7056 * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
7057 of a `DeclSpace'. If one of our constraints is a `ConstructedType',
7058 call ResolveConstructedType() on it to resolve it without checking
7060 (Constraints.ResolveTypes): Check them here.
7061 (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
7062 but don't check constraints.
7063 (ConstructedType.ResolveAsTypeTerminal): Override this and also
7064 check constraints here.
7065 (ConstructedType.ResolveConstructedType): New public method. This
7066 is called from DoResolveAsTypeStep() and Constraints.Resolve() to
7067 resolve ourselves without checking constraints.
7069 * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
7071 2004-11-18 Martin Baulig <martin@ximian.com>
7074 (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
7076 * delegate.cs (Delegate.DefineType): Always create the EmitContext.
7078 2004-11-18 Martin Baulig <martin@ximian.com>
7080 * ecore.cs (TypeExpr.ResolveType): Removed.
7081 (Expression.ResolveAsTypeTerminal): We always return a fully
7082 resolved `TypeExpr', so we can just access its `Type'.
7084 * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
7086 2004-11-17 Martin Baulig <martin@ximian.com>
7088 * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
7089 sure we don't return any unresolved TypeExpr's.
7090 (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
7092 (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
7094 * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
7095 unresolved `ConstructedType's.
7097 2004-11-17 Martin Baulig <martin@ximian.com>
7099 * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
7101 2004-11-17 Martin Baulig <martin@ximian.com>
7104 (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
7106 * decl.cs (DeclSpace.ResolveType): Removed.
7107 (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
7109 2004-11-17 Martin Baulig <martin@ximian.com>
7111 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
7112 direction, like FindMembers() does. Fixes #69546, testcase is in
7115 2004-11-16 Martin Baulig <martin@ximian.com>
7117 This is based on a patch from Marek Safar, see bug #69082.
7118 Fixes bugs #63705 and #67130.
7120 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
7121 method; create a MemberCache for an interface type and cache the
7124 * decl.cs (IMemberContainer.ParentContainer): Removed.
7125 (IMemberContainer.ParentCache): New property.
7126 (MemberCache.SetupCacheForInterface): Removed.
7127 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
7128 to create a cache for an interface's "parent".
7130 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
7133 2004-11-14 Ben Maurer <bmaurer@ximian.com>
7135 * statement.cs: Avoid adding bools to a hashtable.
7137 2004-11-15 Martin Baulig <martin@ximian.com>
7139 * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
7141 2004-11-11 Martin Baulig <martin@ximian.com>
7143 * typemanager.cs (TypeManager.GetMethodName): New method.
7145 * class.cs (MethodData.Define): Include the generic arity in the
7146 name of an explicit interface; also add it to the method name.
7148 * pending.cs (PendingImplementation.InterfaceMethod): The method
7149 name now includes the generic arity.
7151 2004-11-07 Miguel de Icaza <miguel@ximian.com>
7153 * expression.cs (Invocation.OverloadResolve): Flag error if we are
7154 calling an unsafe method from a safe location.
7156 2004-11-06 Marek Safar <marek.safar@seznam.cz>
7159 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
7161 2004-11-06 Miguel de Icaza <miguel@ximian.com>
7163 * namespace.cs (VerifyUsing): use GetPartialName instead of
7166 2004-11-05 Miguel de Icaza <miguel@ximian.com>
7168 * statement.cs (Return.Resolve): Fix regression in typo: if
7169 `in_exc', we have to request a NeedReturnLabel, this was a typo
7170 introduced in the anonymous method check-in. Fixes #69131.
7172 * Indexers were using the ShortName when defining themselves,
7173 causing a regression in the compiler bootstrap when applying the
7174 patch from 2004-11-02 (first part), now they use their full name
7175 and the bug is gone.
7177 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
7179 * driver.cs: Strip the path from the names of embedded resources. Fixes
7182 2004-11-04 Raja R Harinath <rharinath@novell.com>
7184 Fix error message regression: cs0104-2.cs.
7185 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
7186 (AliasEntry.Resolve): Update.
7187 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
7189 (RootContext.LookupType): Update.
7191 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
7193 * cs-parser.jay: Add support for handling accessor modifiers
7194 * class: Add support port accessor modifiers and error checking,
7195 define PropertyMethod.Define as virtual (not abstract anymore)
7196 * ecore.cs: Add checking for proeprties access with access modifiers
7197 * iterators.cs: Modify Accessor constructor call based in the modified
7199 2004-11-02 Ben Maurer <bmaurer@ximian.com>
7201 * expression.cs (StringConcat): Handle being called twice,
7202 as when we have a concat in a field init with more than two
7205 2004-11-02 Miguel de Icaza <miguel@ximian.com>
7207 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
7208 special case explicit implementations, we should always produce
7209 the .property or .event declaration.
7211 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
7212 since it will not return correct data if people use this
7213 unresolved in the presence of using statements (see test-313).
7215 * class.cs (MethodData.Define): If we are an explicit interface
7216 implementation, set the method name to the full name of the
7217 interface plus the name of the method.
7219 Notice that using the method.MethodName.GetFullName() does not
7220 work, as it will only contain the name as declared on the source
7221 file (it can be a shorthand in the presence of using statements)
7222 and not the fully qualifed type name, for example:
7226 class D : ICloneable {
7227 object ICloneable.Clone () {
7231 Would produce a method called `ICloneable.Clone' instead of
7232 `System.ICloneable.Clone'.
7234 * namespace.cs (Alias.Resolve): Use GetPartialName.
7236 2004-11-01 Marek Safar <marek.safar@seznam.cz>
7238 * cs-parser.jay: Add error 1055 report.
7240 2004-11-01 Miguel de Icaza <miguel@ximian.com>
7242 * assign.cs (Assign.DoResolve): Only do the transform of
7243 assignment into a New if the types are compatible, if not, fall
7244 through and let the implicit code deal with the errors and with
7245 the necessary conversions.
7247 2004-11-01 Marek Safar <marek.safar@seznam.cz>
7249 * cs-parser.jay: Add error 1031 report.
7251 * cs-tokenizer.cs: Add location for error 1038.
7253 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7255 * cs-parser.jay: Add error 1016 report.
7257 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7259 * cs-parser.jay: Add errors 1575,1611 report.
7261 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7263 * cs-parser.jay: Add error 1001 report.
7265 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7268 * attribute.cs (GetMarshal): Add method argument for
7269 caller identification.
7271 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7272 agument for GetMarshal and RuntimeMissingSupport.
7274 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7276 * attribute.cs (ExtractSecurityPermissionSet): Removed
7277 TypeManager.code_access_permission_type.
7279 * typemanager.cs: Removed TypeManager.code_access_permission_type.
7281 2004-10-27 Miguel de Icaza <miguel@ximian.com>
7283 * expression.cs (LocalVariableReference.DoResolveLValue): Check
7284 for obsolete use of a variable here. Fixes regression on errors
7285 cs0619-25 and cs0619-26.
7287 2004-10-27 Marek Safar <marek.safar@seznam.cz>
7289 Fix #62358, implemented security attribute encoding.
7291 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7292 Tests permitted SecurityAction for assembly or other types.
7293 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7294 data from SecurityPermissionAttribute to PermisionSet class.
7296 * class.cs (ApplyAttributeBuilder): Added special handling
7297 for System.Security.Permissions.SecurityAttribute based types.
7299 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7300 special handling for System.Security.Permissions.SecurityAttribute
7303 * enum.cs (ApplyAttributeBuilder): Added special handling
7304 for System.Security.Permissions.SecurityAttribute based types.
7306 * parameter.cs (ApplyAttributeBuilder): Added special handling
7307 for System.Security.Permissions.SecurityAttribute based types.
7309 * rootcontext.cs: Next 2 core types.
7311 * typemanager.cs (TypeManager.security_permission_attr_type):
7312 Built in type for the SecurityPermission Attribute.
7313 (code_access_permission_type): Build in type.
7315 2004-10-17 Miguel de Icaza <miguel@ximian.com>
7317 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7318 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7319 all of this information into
7320 EmitContext.EmitCapturedVariableInstance.
7322 * codegen.cs (EmitCapturedVariableInstance): move here the
7323 funcionality of emitting an ldarg.0 in the presence of a
7324 remapping. This centralizes the instance emit code.
7326 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7327 then emit a load of this: it means that we have reached the
7328 topmost ScopeInfo: the one that contains the pointer to the
7329 instance of the class hosting the anonymous method.
7331 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7332 captures to the topmost CaptureContext.
7334 2004-10-12 Miguel de Icaza <miguel@ximian.com>
7336 * expression.cs (LocalVariableReference): Move the knowledge about
7337 the iterators into codegen's EmitCapturedVariableInstance.
7339 2004-10-11 Miguel de Icaza <miguel@ximian.com>
7341 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7342 all code paths return a value from an anonymous method (it is the
7343 same as the 161 error, but for anonymous methods).
7345 2004-10-08 Miguel de Icaza <miguel@ximian.com>
7347 The introduction of anonymous methods in the compiler changed
7348 various ways of doing things in the compiler. The most
7349 significant one is the hard split between the resolution phase
7350 and the emission phases of the compiler.
7352 For instance, routines that referenced local variables no
7353 longer can safely create temporary variables during the
7354 resolution phase: they must do so from the emission phase,
7355 since the variable might have been "captured", hence access to
7356 it can not be done with the local-variable operations from the runtime.
7360 (Block.Flags): New flag `IsTopLevel' to indicate that this block
7361 is a toplevel block.
7363 (ToplevelBlock): A new kind of Block, these are the blocks that
7364 are created by the parser for all toplevel method bodies. These
7365 include methods, accessors and anonymous methods.
7367 These contain some extra information not found in regular blocks:
7368 A pointer to an optional CaptureContext (for tracking captured
7369 local variables and parameters). A pointer to the parent
7372 (Return.Resolve): Catch missmatches when returning a value from an
7373 anonymous method (error 1662).
7374 Invoke NeedReturnLabel from the Resolve phase instead of the emit
7377 (Break.Resolve): ditto.
7379 (SwitchLabel): instead of defining the labels during the
7380 resolution phase, we now turned the public ILLabel and ILLabelCode
7381 labels into methods called GetILLabelCode() and GetILLabel() that
7382 only define the label during the Emit phase.
7384 (GotoCase): Track the SwitchLabel instead of the computed label
7385 (its contained therein). Emit the code by using
7386 SwitchLabel.GetILLabelCode ().
7388 (LocalInfo.Flags.Captured): A new flag has been introduce to track
7389 whether the Local has been captured or not.
7391 (LocalInfo.IsCaptured): New property, used to tell whether the
7392 local has been captured.
7394 * anonymous.cs: Vastly updated to contain the anonymous method
7397 The main classes here are: CaptureContext which tracks any
7398 captured information for a toplevel block and ScopeInfo used to
7399 track the activation frames for various local variables.
7401 Each toplevel block has an optional capture context associated
7402 with it. When a method contains an anonymous method both the
7403 toplevel method and the anonymous method will create a capture
7404 context. When variables or parameters are captured, they are
7405 recorded on the CaptureContext that owns them, for example:
7409 MyDelegate d = delegate {
7414 Here `a' will be recorded as captured on the toplevel
7415 CapturedContext, the inner captured context will not have anything
7416 (it will only have data if local variables or parameters from it
7417 are captured in a nested anonymous method.
7419 The ScopeInfo is used to track the activation frames for local
7420 variables, for example:
7422 for (int i = 0; i < 10; i++)
7423 for (int j = 0; j < 10; j++){
7424 MyDelegate d = delegate {
7429 At runtime this captures a single captured variable `i', but it
7430 captures 10 different versions of the variable `j'. The variable
7431 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7432 recorded on a child.
7434 The toplevel ScopeInfo will also track information like the `this'
7435 pointer if instance variables were referenced (this is necessary
7436 as the anonymous method lives inside a nested class in the host
7437 type of the method).
7439 (AnonymousMethod): Expanded to track the Toplevel, implement
7440 `AnonymousMethod.Compatible' to tell whether an anonymous method
7441 can be converted to a target delegate type.
7443 The routine now also produces the anonymous method content
7445 (AnonymousDelegate): A helper class that derives from
7446 DelegateCreation, this is used to generate the code necessary to
7447 produce the delegate for the anonymous method that was created.
7449 * assign.cs: API adjustments for new changes in
7450 Convert.ImplicitStandardConversionExists.
7452 * class.cs: Adjustments to cope with the fact that now toplevel
7453 blocks are of type `ToplevelBlock'.
7455 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7456 insteda of standard blocks.
7458 Flag errors if params arguments are passed to anonymous methods.
7460 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7461 `CurrentAnonymousMethod' which points to the current Anonymous
7462 Method. The variable points to the AnonymousMethod class that
7463 holds the code being compiled. It is set in the new EmitContext
7464 created for the anonymous method.
7466 (EmitContext.Phase): Introduce a variable and an enumeration to
7467 assist in enforcing some rules about when and where we are allowed
7468 to invoke certain methods (EmitContext.NeedsReturnLabel is the
7469 only one that enfonces this right now).
7471 (EmitContext.HaveCaptureInfo): new helper method that returns
7472 whether we have a CapturedContext initialized.
7474 (EmitContext.CaptureVariable): New method used to register that a
7475 LocalInfo must be flagged for capturing.
7477 (EmitContext.CapturedParameter): New method used to register that a
7478 parameters must be flagged for capturing.
7480 (EmitContext.CapturedField): New method used to register that a
7481 field must be flagged for capturing.
7483 (EmitContext.HaveCapturedVariables,
7484 EmitContext.HaveCapturedFields): Return whether there are captured
7485 variables or fields.
7487 (EmitContext.EmitMethodHostInstance): This is used to emit the
7488 instance for the anonymous method. The instance might be null
7489 (static methods), this (for anonymous methods that capture nothing
7490 and happen to live side-by-side with the current method body) or a
7491 more complicated expression if the method has a CaptureContext.
7493 (EmitContext.EmitTopBlock): Routine that drives the emission of
7494 code: it will first resolve the top block, then emit any metadata
7495 and then emit the code. The split is done so that we can extract
7496 any anonymous methods and flag any captured variables/parameters.
7498 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7499 during this phase, the ILGenerator should not be used as labels
7500 and local variables declared here might not be accessible to any
7501 code that is part of an anonymous method.
7503 Exceptions to this include the temporary variables that are
7504 created by some statements internally for holding temporary
7507 (EmitContext.EmitMeta): New routine, in charge of emitting all the
7510 (EmitContext.TemporaryReturn): This method is typically called
7511 from the Emit phase, and its the only place where we allow the
7512 ReturnLabel to be defined other than the EmitMeta. The reason is
7513 that otherwise we would have to duplicate a lot of logic in the
7514 Resolve phases of various methods that today is on the Emit
7517 (EmitContext.NeedReturnLabel): This no longer creates the label,
7518 as the ILGenerator is not valid during the resolve phase.
7520 (EmitContext.EmitThis): Extended the knowledge in this class to
7521 work in anonymous methods in addition to iterators.
7523 (EmitContext.EmitCapturedVariableInstance): This emits whatever
7524 code is necessary on the stack to access the instance to a local
7525 variable (the variable will be accessed as a field).
7527 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7528 EmitContext.EmitAddressOfParameter): Routines to support
7529 parameters (not completed at this point).
7531 Removals: Removed RemapLocal and RemapLocalLValue. We probably
7532 will also remove the parameters.
7534 * convert.cs (Convert): Define a `ConstantEC' which points to a
7535 null. This is just to prefity some code that uses
7536 ImplicitStandardConversion code and do not have an EmitContext
7539 The idea is to flag explicitly that at that point in time, it is
7540 known that the conversion will not trigger the delegate checking
7541 code in implicit conversions (which requires a valid
7544 Everywhere: pass new EmitContext parameter since
7545 ImplicitStandardConversionExists now requires it to check for
7546 anonymous method conversions.
7548 (Convert.ImplicitStandardConversionExists): If the type of an
7549 expression is the anonymous_method_type, and the type is a
7550 delegate, we invoke the AnonymousMethod.Compatible method to check
7551 whether an implicit conversion is possible.
7553 (Convert.ImplicitConversionStandard): Only do implicit method
7554 group conversions if the language level is not ISO_1.
7556 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7557 MethodInfo for the Invoke method. used by Delegate and
7560 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7561 method conversions if the target type is a delegate.
7563 Removed extra debugging nops.
7565 (LocalVariableReference): Turn the `local_info' into a public
7568 Add `prepared' field, the same hack used for FieldExprs to cope
7569 with composed assignments, as Local variables do not necessarily
7570 operate purely on the stack as they used to: they can be captured
7573 Add `temp' for a temporary result, like fields.
7575 Refactor DoResolve and DoResolveLValue into DoResolveBase.
7577 It now copes with Local variables that are captured and emits the
7578 proper instance variable to load it from a field in the captured
7581 (ParameterReference.DoResolveBase): During the resolve phase,
7582 capture parameters if we are in an anonymous method.
7584 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7585 anonymous method, use the EmitContext helper routines to emit the
7586 parameter reference.
7588 * iterators.cs: Set RemapToProxy to true/false during the
7591 * parameters.cs (GetParameterByName): New helper method.
7593 * typemanager.cs (anonymous_method_type) a new type that
7594 represents an anonyous method. This is always an internal type,
7595 used as a fencepost to test against the anonymous-methodness of an
7598 2004-10-20 Marek Safar <marek.safar@seznam.cz>
7600 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7602 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7604 2004-11-10 Martin Baulig <martin@ximian.com>
7606 * expression.cs (Invocation.BetterFunction): If two methods have
7607 equal parameter types, but only one of them is generic, the
7608 non-generic one wins.
7609 (New.DoResolve): Don't set `is_struct' to false if we're a generic
7610 instance; just use `Type.IsValueType' to determine whether
7611 something is a struct or not.
7612 (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
7613 so we can be called multiple times.
7615 2004-11-10 Martin Baulig <martin@ximian.com>
7617 * generic.cs (TypeParameter.DefineConstraints): New public method.
7618 (TypeParameter.CheckAccessLevel): Override this and return true.
7619 (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
7620 override ResolveType() anymore.
7621 (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
7623 2004-11-10 Martin Baulig <martin@ximian.com>
7625 * rootcontext.cs (RootContext.LookupType): If we're a nested type,
7626 call DeclSpace.ResolveNestedType() on it.
7628 2004-11-10 Martin Baulig <martin@ximian.com>
7630 * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
7631 non-null, call ParameterModifier() on it.
7633 2004-11-10 Martin Baulig <martin@ximian.com>
7636 (Iterators): Added `current_type' and `this_type' fields.
7637 (Iterators.DefineIterator): Create a new EmitContext and store it
7638 in `ec'; compute `this_type'.
7640 2004-11-10 Martin Baulig <martin@ximian.com>
7643 (TypeManager.IsPrivateAccessible): New public method.
7644 (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
7646 2004-11-10 Martin Baulig <martin@ximian.com>
7648 * class.cs (TypeContainer.DefineType): Call
7649 TypeBuilder.DefineGenericParameters() before resolving the type
7651 (MethodData.parent_method): New protected field.
7652 (MethodData..ctor): Added `MethodInfo parent_method' argument.
7653 (MethodData.Define): Compute `parent_method'.
7656 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7657 (MemberCore.GetClsCompliantAttributeValue): Likewise.
7658 (DeclSpace.ec): New protected field; store the EmitContext here.
7659 (DeclSpace.EmitContext): New public property.
7660 (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
7661 (DeclSpace.ResolveNestedType): New public method.
7662 (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
7663 (DeclSpace.NestedAccessible): Added `Type tb' argument.
7664 (DeclSpace.FamilyAccessible): Likewise.
7665 (DeclSpace.FindType): Call ResolveNestedType() for nested types.
7666 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7669 * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
7672 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7673 (Enum.Emit): Don't create a new EmitContext.
7675 2004-10-18 Martin Baulig <martin@ximian.com>
7677 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7678 `Type' directly, but call ResolveType() on it.
7679 (Catch.Resolve): Likewise.
7680 (Foreach.Resolve): Likewise.
7682 2004-10-18 Martin Baulig <martin@ximian.com>
7684 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7685 `Type' directly, but call ResolveType() on it.
7686 (Probe.DoResolve): Likewise.
7687 (ArrayCreation.LookupType): Likewise.
7688 (TypeOf.DoResolve): Likewise.
7689 (SizeOf.DoResolve): Likewise.
7691 2004-10-18 Raja R Harinath <rharinath@novell.com>
7693 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7696 2004-10-17 John Luke <john.luke@gmail.com>
7698 * class.cs (Operator.GetSignatureForError): use CSharpName
7700 * parameter.cs (Parameter.GetSignatureForError): Returns
7701 correct name even if was not defined.
7703 2004-10-13 Raja R Harinath <rharinath@novell.com>
7706 * class.cs (TypeContainer.EmitContext): New property.
7707 (DefineNestedTypes): Create an emitcontext for each part.
7708 (MethodCore.DoDefineParameters): Use container's emitcontext.
7709 Pass type array to InternalParameters.
7710 (MemberBase.DoDefine): Use container's emitcontext.
7711 (FieldMember.Define): Likewise.
7712 (Event.Define): Likewise.
7713 (SetMethod.GetParameterInfo): Change argument to EmitContext.
7714 Pass type array to InternalParameters.
7715 (SetIndexerMethod.GetParameterInfo): Likewise.
7716 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7717 * delegate.cs (Define): Pass emitcontext to
7718 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
7719 array to InternalParameters.
7720 * expression.cs (ParameterReference.DoResolveBase): Pass
7721 emitcontext to GetParameterInfo.
7722 (ComposedCast.DoResolveAsTypeStep): Remove check on
7723 ec.ResolvingTypeTree.
7724 * parameter.cs (Parameter.Resolve): Change argument to
7725 EmitContext. Use ResolveAsTypeTerminal.
7726 (Parameter.GetSignature): Change argument to EmitContext.
7727 (Parameters.ComputeSignature): Likewise.
7728 (Parameters.ComputeParameterTypes): Likewise.
7729 (Parameters.GetParameterInfo): Likewise.
7730 (Parameters.ComputeAndDefineParameterTypes): Likewise.
7731 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
7732 * support.cs (InternalParameters..ctor): Remove variant that takes
7734 * typemanager.cs (system_intptr_expr): New.
7735 (InitExpressionTypes): Initialize it.
7737 2004-10-12 Chris Toshok <toshok@ximian.com>
7739 * cs-parser.jay: fix location for try_statement and catch_clause.
7741 2004-10-18 Martin Baulig <martin@ximian.com>
7743 * class.cs (FieldMember.Define): Don't access the TypeExpr's
7744 `Type' directly, but call ResolveType() on it.
7745 (MemberBase.DoDefine): Likewise.
7747 * expression.cs (New.DoResolve): Don't access the TypeExpr's
7748 `Type' directly, but call ResolveType() on it.
7749 (ComposedCast.DoResolveAsTypeStep): Likewise.
7751 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7752 `Type' directly, but call ResolveType() on it.
7754 2004-10-17 John Luke <john.luke@gmail.com>
7756 * class.cs (Operator.GetSignatureForError): use CSharpName
7758 * parameter.cs (Parameter.GetSignatureForError): Returns
7759 correct name even if was not defined.
7761 2004-10-13 Raja R Harinath <rharinath@novell.com>
7764 * class.cs (TypeContainer.EmitContext): New property.
7765 (DefineNestedTypes): Create an emitcontext for each part.
7766 (MethodCore.DoDefineParameters): Use container's emitcontext.
7767 Pass type array to InternalParameters.
7768 (MemberBase.DoDefine): Use container's emitcontext.
7769 (FieldMember.Define): Likewise.
7770 (Event.Define): Likewise.
7771 (SetMethod.GetParameterInfo): Change argument to EmitContext.
7772 Pass type array to InternalParameters.
7773 (SetIndexerMethod.GetParameterInfo): Likewise.
7774 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7775 * delegate.cs (Define): Pass emitcontext to
7776 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
7777 array to InternalParameters.
7778 * expression.cs (ParameterReference.DoResolveBase): Pass
7779 emitcontext to GetParameterInfo.
7780 (ComposedCast.DoResolveAsTypeStep): Remove check on
7781 ec.ResolvingTypeTree.
7782 * parameter.cs (Parameter.Resolve): Change argument to
7783 EmitContext. Use ResolveAsTypeTerminal.
7784 (Parameter.GetSignature): Change argument to EmitContext.
7785 (Parameters.ComputeSignature): Likewise.
7786 (Parameters.ComputeParameterTypes): Likewise.
7787 (Parameters.GetParameterInfo): Likewise.
7788 (Parameters.ComputeAndDefineParameterTypes): Likewise.
7789 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
7790 * support.cs (InternalParameters..ctor): Remove variant that takes
7792 * typemanager.cs (system_intptr_expr): New.
7793 (InitExpressionTypes): Initialize it.
7795 2004-10-12 Chris Toshok <toshok@ximian.com>
7797 * cs-parser.jay: fix location for try_statement and catch_clause.
7799 2004-10-07 Raja R Harinath <rharinath@novell.com>
7801 More DeclSpace.ResolveType avoidance.
7802 * decl.cs (MemberCore.InUnsafe): New property.
7803 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
7804 with newly created EmitContext.
7805 (FieldMember.Define): Likewise.
7806 * delegate.cs (Delegate.Define): Likewise.
7807 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7808 only if normal name-lookup fails.
7809 (TypeExpr.DoResolve): Enable error-checking.
7810 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7811 (SizeOf.DoResolve): Likewise.
7812 (ComposedCast.DoResolveAsTypeStep): Likewise.
7813 (StackAlloc.DoResolve): Likewise.
7814 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7815 (Block.Unsafe): New property.
7816 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7817 (Unsafe): Set 'unsafe' flag of contained block.
7818 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7819 (Fixed.Resolve): Likewise.
7820 (Catch.Resolve): Likewise.
7821 (Using.ResolveLocalVariableDecls): Likewise.
7822 (Foreach.Resolve): Likewise.
7824 2004-10-05 John Luke <john.luke@gmail.com>
7826 * cs-parser.jay: add location to error CS0175
7828 2004-10-04 Miguel de Icaza <miguel@ximian.com>
7830 * ecore.cs (Expression.Constantity): Add support for turning null
7833 * const.cs (Const.Define): Allow constants to be reference types
7834 as long as the value is Null.
7836 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
7838 * namespace.cs (NamespaceEntry.Using): No matter which warning
7839 level is set, check if this namespace name has already been added.
7841 2004-10-03 Ben Maurer <bmaurer@ximian.com>
7843 * expression.cs: reftype [!=]= null should always use br[true,false].
7846 2004-10-03 Marek Safar <marek.safar@seznam.cz>
7849 * attribute.cs: Enum conversion moved to
7850 GetAttributeArgumentExpression to be applied to the all
7853 2004-10-01 Raja R Harinath <rharinath@novell.com>
7855 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7856 * class.c (TypeContainer.DefineType): Flag error if
7857 base types aren't accessible due to access permissions.
7858 * decl.cs (DeclSpace.ResolveType): Move logic to
7859 Expression.ResolveAsTypeTerminal.
7860 (DeclSpace.ResolveTypeExpr): Thin layer over
7861 Expression.ResolveAsTypeTerminal.
7862 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7863 Refactor code into NestedAccess. Use it.
7864 (DeclSpace.NestedAccess): New.
7865 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7866 argument to silence errors. Check access permissions.
7867 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7868 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7869 (Cast.DoResolve): Likewise.
7870 (New.DoResolve): Likewise.
7871 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7872 (TypeOf.DoResolve): Likewise.
7874 * expression.cs (Invocation.BetterConversion): Return the Type of
7875 the better conversion. Implement section 14.4.2.3 more faithfully.
7876 (Invocation.BetterFunction): Make boolean. Make correspondence to
7877 section 14.4.2.2 explicit.
7878 (Invocation.OverloadResolve): Update.
7879 (Invocation): Remove is_base field.
7880 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
7881 (Invocation.Emit): Likewise.
7883 2004-09-24 Marek Safar <marek.safar@seznam.cz>
7885 * cs-parser.jay: Reverted 642 warning fix.
7887 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7890 * decl.cs (FindMemberWithSameName): Indexer can have more than
7893 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7895 * expression.cs (LocalVariableReference.DoResolveLValue):
7896 Do not report warning 219 for out values.
7897 (EmptyExpression.Null): New member to avoid extra allocations.
7899 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7901 * cs-parser.jay: Fix wrong warning 642 report.
7903 * cs-tokenizer.cs (CheckNextToken): New helper;
7904 Inspect next character if is same as expected.
7906 2004-09-23 Martin Baulig <martin@ximian.com>
7908 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7909 (Convert.ImplicitReferenceConversionExists): Likewise.
7911 2004-11-09 Raja R Harinath <rharinath@novell.com>
7913 * Makefile (DISTFILES): Comment out a few missing files.
7915 2004-10-29 Raja R Harinath <rharinath@novell.com>
7917 * Makefile (bootstrap_libs,bootstrap_libfiles): New.
7918 (bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
7919 (gmcs.exe): Invoke bootstrap-libs.
7920 (clean-local): Clean the net_2_0_bootstrap profile too.
7921 (PROGRAM_INSTALL_DIR): New.
7922 (install-local): Use it.
7924 2004-10-13 Martin Baulig <martin@ximian.com>
7926 * generic.cs (TypeManager.InflatedConstraints): New nested class.
7927 (TypeParameter.DefineType): If we're a method type parameter and
7928 that method is overriding something, "inflate" its constraints.
7930 2004-10-12 Martin Baulig <martin@ximian.com>
7932 * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
7933 and have type arguments, create and resolve a ConstructedType.
7935 2004-10-12 Martin Baulig <martin@ximian.com>
7937 * decl.cs (MemberCache.FindMemberToOverride): Use
7938 TypeManager.IsEqual() to compare the parameters and Type.Equals()
7939 to compare the invocationType.
7941 * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
7942 When comparing two type parameters, only do the signature-only
7943 comparision for method type parameters.
7945 2004-10-11 Martin Baulig <martin@ximian.com>
7947 * report.cs: Don't make --fatal abort on warnings, we have
7948 -warnaserror for that.
7950 2004-10-11 Martin Baulig <martin@ximian.com>
7953 (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
7954 (TypeManager.IsEqual): Call ourself recursively instead of using
7957 2004-10-11 Martin Baulig <martin@ximian.com>
7959 * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
7960 on our own type parameters, not on the ones we inherit from a containing
7963 * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
7966 * generic.cs (TypeParameter.Define): We may only be called once.
7968 * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
7969 instead of TypeManager.IsEqual().
7971 2004-09-28 Martin Baulig <martin@ximian.com>
7974 (GenericConstraints.EffectiveBaseClass): New public property.
7975 (TypeParameter.GenericConstraints): New public property.
7976 (ConstructedType.CheckConstraints): Improved.
7978 * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
7979 (Convert.TypeParameterConversion): New private method; use this in
7980 ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
7981 for all conversions related to type parameters.
7983 2004-09-24 Martin Baulig <martin@ximian.com>
7985 * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
7986 type parameter conversions for type parameters which are known to
7989 2004-09-24 Martin Baulig <martin@ximian.com>
7991 * generic.cs (GenericConstraints): Added `IsReferenceType' and
7992 `IsValueType' properties.
7994 * support.cs (ReflectionConstraints): Use
7995 Type.GetGenericParameterConstraints() instead of the old hack.
7997 2004-09-24 Martin Baulig <martin@ximian.com>
7999 * generic.cs (GenericConstraints): Moved here and made it an
8002 * support.cs (GenericConstraints): Moved to generic.cs.
8004 2004-09-24 Martin Baulig <martin@ximian.com>
8007 (ReflectionConstraints): Un-nested this class and made it public.
8010 (TypeManager.GetTypeParameterConstraints): New public method.
8011 (TypeManager.HasConstructorConstraint): Use the attributes.
8013 2004-09-24 Martin Baulig <martin@ximian.com>
8015 * support.cs (GenericConstraints): Replaced `HasConstructor',
8016 `IsReferenceType' and `IsValueType' with `Attributes'.
8017 (ReflectionParameters.ReflectionConstraints): Removed the Create()
8018 method and made the .ctor public.
8020 * generic.cs (Constraints.Attributes): New public property.
8021 (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
8022 `IsReferenceType' -> `HasReferenceTypeConstraint' and
8023 `IsValueType' -> `HasValueTypeConstraint'.
8025 2004-09-23 Martin Baulig <martin@ximian.com>
8027 * generic.cs (Constraints): Reflect latest runtime changes.
8029 2004-09-23 Martin Baulig <martin@ximian.com>
8031 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8032 (Convert.ImplicitReferenceConversionExists): Likewise.
8034 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8036 * class.cs (Operator.Define): Add error 448 and 559 report.
8038 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8040 * class.cs (MemberBase.IsTypePermitted): New protected
8041 method for checking error CS0610.
8043 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8045 * class.cs (TypeContainer.HasExplicitLayout): New property
8046 Returns whether container has StructLayout attribute set Explicit.
8047 (FieldMember): New abstract class for consts and fields.
8048 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
8049 (Field): Reuse FieldMember.
8051 * const.cs (Const): Reuse FieldMember.
8053 * rootcontext.cs: EmitConstants call moved to class.
8055 2004-09-22 Martin Baulig <martin@ximian.com>
8057 Marek and me just fixed one of our oldest bugs: #28562 :-)
8059 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
8061 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
8062 we're an EnumConstant, just return that.
8063 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
8064 an EnumConstant. In this case, we need to use GetValueAsEnumType()
8065 to get the value which'll actually be written into the attribute.
8066 However, we have to use GetValue() to access the attribute's value
8069 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8071 * constant.cs (Constant.IsNegative): New abstract property
8074 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
8075 (StackAlloc.DoResolve): Reused IsNegative.
8077 2004-09-22 Martin Baulig <martin@ximian.com>
8079 * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
8080 public method; like LookupTypeContainer, but also works for
8083 * report.cs (Report.SymbolRelatedToPreviousError): Use
8084 TypeManager.LookupGenericTypeContainer().
8086 2004-09-22 Martin Baulig <martin@ximian.com>
8088 Thanks to Peter Sestoft for this bug report.
8090 * expression.cs (Conditional): If both the `trueExpr' and the
8091 `falseExpr' is a NullLiteral, return a NullLiteral.
8093 2004-09-22 Martin Baulig <martin@ximian.com>
8095 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
8096 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
8097 for the "get_Current" call.
8099 2004-09-21 Martin Baulig <martin@ximian.com>
8101 * convert.cs (Convert.ImplicitReferenceConversion): When
8102 converting to an interface type, first check whether we're
8103 converting from a reference type.
8105 2004-09-14 Martin Baulig <martin@ximian.com>
8107 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
8109 2004-09-14 Marek Safar <marek.safar@seznam.cz>
8112 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
8113 called and is obsolete then this member suppress message
8114 when call is inside next [Obsolete] method or type.
8116 * expression.cs: Use TestObsoleteMethodUsage member.
8118 2004-09-14 Martin Baulig <martin@ximian.com>
8120 * genericparser.cs: Removed.
8122 2004-09-13 Marek Safar <marek.safar@seznam.cz>
8124 * class.cs (MethodCore.CheckBase): Fix bug #65757.
8126 2004-09-12 Marek Safar <marek.safar@seznam.cz>
8128 * attribute.cs (Attribute.Resolve): Add error 653 report.
8130 * class.cs (Class.ApplyAttributeBuilder): Add error 641
8132 (Method.ApplyAttributeBuilder): Add error 685 report.
8133 (Operator.Define): Add error 564 report.
8135 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
8137 * expression.cs (Invocation.DoResolve): Add error
8140 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
8143 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8145 * class.cs (ConstructorInitializer.Resolve):
8146 Wrong error number (515->516).
8148 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8150 * class.cs (Indexer.Define): Add error 631 report.
8152 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8154 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
8156 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8158 * expression.cs (Probe.DoResolve): Add error CS0241 report.
8160 2004-09-10 Marek Safar <marek.safar@seznam.cz>
8162 * cs-parser.jay: Added error CS0241 report.
8164 2004-09-10 Raja R Harinath <rharinath@novell.com>
8166 * cs-parser.jay (fixed_statement): Introduce a scope for the
8167 declaration in the 'fixed' statement.
8169 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8171 * cs-parser.jay: Added CS0230 error report.
8173 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8175 * cs-parser.jay: Added errors CS0231 and CS0257 report.
8177 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8179 * expression.cs (Argument.Resolve): Added error CS0192 and
8182 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8184 C# 2.0 #pragma warning feature
8186 * cs-tokenizer.cs (PreProcessPragma): New method;
8187 Handles #pragma directive.
8189 * report.cs (WarningRegions): New class; Support
8190 class for #pragma warning directive. It tests whether
8191 warning is enabled for a given line.
8193 2004-09-08 Miguel de Icaza <miguel@ximian.com>
8195 * const.cs: Add more descriptive error report, tahnks to
8198 2004-09-08 Marek Safar <marek.safar@seznam.cz>
8200 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
8202 2004-09-07 Miguel de Icaza <miguel@ximian.com>
8204 * expression.cs: Apply patch from Ben: Remove dead code from
8205 ArrayCreation, and remove the TurnintoConstant call in const.cs,
8206 as that code just threw an exception anwyays.
8208 * const.cs: Remove the call to the turnintoconstant, for details
8211 * literal.cs: The type of the null-literal is the null type; So
8212 we use a placeholder type (literal.cs:System.Null, defined here)
8215 * expression.cs (Conditional.DoResolve): Remove some old code that
8216 is no longer needed, conversions have been fixed.
8218 (ArrayCreationExpression.DoResolve): Return false if we fail to
8219 resolve the inner expression.
8221 2004-09-07 Raja R Harinath <rharinath@novell.com>
8224 * cs-parser.jay (delegate_declaration): Record a delegate
8225 declaration as a type declaration.
8226 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
8228 2004-09-06 Miguel de Icaza <miguel@ximian.com>
8230 * parameter.cs: Do not crash if the type can not be resolved.
8232 * expression.cs: Report errors with unsafe pointers, fixes #64896
8234 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
8236 * expression.cs: Pointer arith always needs to do a conv.i
8237 if the operand is a long. fix 65320
8239 2004-09-04 Marek Safar <marek.safar@seznam.cz>
8241 Fixed cs0619-37.cs, cs0619-38.cs
8243 * enum.cs (GetObsoleteAttribute): Removed.
8245 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
8246 on Enum member is double staged. The first is tested member
8249 2004-09-04 Marek Safar <marek.safar@seznam.cz>
8251 Fixed #56986, #63631, #65231
8253 * class.cs: (TypeContainer.AddToMemberContainer): New method,
8254 adds member to name container.
8255 (TypeContainer.AddToTypeContainer): New method, adds type to
8257 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8258 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8259 AddOperator): Simplified by reusing AddToMemberContainer.
8260 (TypeContainer.UserDefinedStaticConstructor): Changed to property
8262 (Method.CheckForDuplications): Fixed implementation to test all
8264 (MemberBase): Detection whether member is explicit interface
8265 implementation is now in constructor.
8266 (MemberBase.UpdateMemberName): Handles IndexerName.
8267 (Accessor): Changed to keep also location information.
8268 (AbstractPropertyEventMethod): Is derived from MemberCore.
8269 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8270 will be emited or not.
8271 (PropertyBase.AreAccessorsDuplicateImplementation):
8272 Tests whether accessors are not in collision with some method.
8273 (Operator): Is derived from MethodCore to simplify common
8276 * decl.cs (Flags.TestMethodDuplication): Test for duplication
8278 (DeclSpace.AddToContainer): Adds the member to defined_names
8279 table. It tests for duplications and enclosing name conflicts.
8281 * enum.cs (EnumMember): Clean up to reuse the base structures
8283 2004-09-03 Martin Baulig <martin@ximian.com>
8285 Merged latest changes into gmcs. Please keep this comment in
8286 here, it makes it easier for me to see what changed in MCS since
8287 the last time I merged.
8289 2004-09-03 Martin Baulig <martin@ximian.com>
8291 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8292 into TypeContainer, to make partial classes work again.
8294 2004-09-03 Martin Baulig <martin@ximian.com>
8296 * rootcontext.cs (RootContext.V2): Removed.
8298 2004-03-23 Martin Baulig <martin@ximian.com>
8300 * expression.cs (Invocation.OverloadResolve): Added `bool
8301 may_fail' argument and use it instead of the Location.IsNull() hack.
8303 2004-09-09 Martin Baulig <martin@ximian.com>
8305 * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
8307 2004-09-09 Martin Baulig <martin@ximian.com>
8309 * generic.cs (TypeParameter.DefineType): Added support for
8310 explicit interface methods.
8312 2004-09-09 Martin Baulig <martin@ximian.com>
8314 * README.Changes: New document. Started to list important changes
8315 between MCS and GMCS here.
8317 2004-09-08 Martin Baulig <martin@ximian.com>
8320 (TypeContainer.CheckRecursiveDefinition): New protected method.
8321 (TypeContainer.DefineType): Move the CS0146 check into
8322 CheckRecursiveDefinition().
8324 2004-09-06 Martin Baulig <martin@ximian.com>
8326 * generic.cs (ConstructedType.CheckConstraints): Allow builtin
8327 types for the constructor constraint.
8329 2004-09-03 Martin Baulig <martin@ximian.com>
8331 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8332 into TypeContainer, to make partial classes work again.
8334 2004-09-03 Martin Baulig <martin@ximian.com>
8336 * rootcontext.cs (RootContext.V2): Removed.
8338 2004-03-23 Martin Baulig <martin@ximian.com>
8340 * expression.cs (Invocation.OverloadResolve): Added `bool
8341 may_fail' argument and use it instead of the Location.IsNull() hack.
8343 2004-09-03 Martin Baulig <martin@ximian.com>
8345 Merged latest changes into gmcs. Please keep this comment in
8346 here, it makes it easier for me to see what changed in MCS since
8347 the last time I merged.
8349 2004-09-03 Raja R Harinath <rharinath@novell.com>
8352 * expression.cs (BetterConversion): Don't allow either conversion
8353 to be null. Remove redundant implicit conversion test when 'q ==
8354 null' -- when this function is invoked, we already know that the
8355 implicit conversion exists.
8356 (BetterFunction): Assume that 'best' is non-null. Remove
8357 redundant reimplementation of IsApplicable when 'best' is null.
8358 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
8359 number of arguments.
8360 (IsAncestralType): Extract from OverloadResolve.
8361 (OverloadResolve): Make robust to the MethodGroupExpr being
8362 unsorted. Implement all the logic of Section 14.5.5.1, and
8363 support overloading of methods from multiple applicable types.
8364 Clean up logic somewhat. Don't pass null methods to BetterFunction.
8366 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
8367 (RealError, Warning): Append type of report to related symbol.
8369 2004-09-03 Marek Safar <marek.safar@seznam.cz>
8371 * enum.cs: Fixed CLS-Compliance checks for enum members.
8372 Error tests cs3008-8.cs, cs3014-8.cs
8374 2004-09-02 Marek Safar <marek.safar@seznam.cz>
8376 Fixed bug #62342, #63102
8377 * class.cs: ImplementIndexer uses member.IsExplicitImpl
8378 like ImplementMethod.
8380 2004-09-02 Marek Safar <marek.safar@seznam.cz>
8382 * attribute.cs (Attribute.GetAttributeArgumentExpression):
8385 2004-09-02 Martin Baulig <martin@ximian.com>
8387 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8388 TypeManager.GetArgumentTypes() rather than calling GetParameters()
8391 2004-09-01 Marek Safar <marek.safar@seznam.cz>
8393 C# 2.0 Static classes implemented
8395 * class.cs (TypeContainer): instance_constructors,
8396 initialized_fields, initialized_static_fields,
8397 default_constructor, base_inteface_types are protected to be
8398 accessible from StaticClass.
8399 (TypeContainer.DefineDefaultConstructor): New virtual method
8400 for custom default constructor generating
8401 (StaticClass): New class to handle "Static classes" feature.
8403 * cs-parser.jay: Handle static keyword on class like instance
8406 * driver.cs: Added "/langversion" command line switch with two
8407 options (iso-1, default).
8409 2004-08-31 Marek Safar <marek.safar@seznam.cz>
8411 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8413 2004-08-31 Miguel de Icaza <miguel@ximian.com>
8415 * delegate.cs: Style.
8417 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
8419 * delegate.cs: Add seperate instance expr field for miguel.
8421 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
8423 * PointerArithmetic (Resolve): make sure we are not doing
8424 pointer arith on void*. Also, make sure we are resolved
8425 by not setting eclass until resolve.
8427 All callers: Make sure that PointerArithmetic gets resolved.
8429 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
8431 * ArrayCreation (LookupType): If the type does not resolve
8432 to an array, give an error.
8434 2004-08-27 Marek Safar <marek.safar@seznam.cz>
8436 * statement.cs (Try.Resolve): Fixed bug #64222
8438 2004-08-27 Martin Baulig <martin@ximian.com>
8441 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8444 2004-08-26 Marek Safar <marek.safar@seznam.cz>
8446 * ecore.cs (Constantify): Get underlying type via
8447 System.Enum.GetUnderlyingType to avoid StackOverflow on the
8448 Windows in special cases.
8450 2004-08-26 Marek Safar <marek.safar@seznam.cz>
8452 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8453 for obtaining also private methods.
8454 (GetRemoveMethod): Used GetRemoveMethod (true)
8455 for obtaining also private methods.
8457 2004-09-02 Martin Baulig <martin@ximian.com>
8459 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8460 TypeManager.GetArgumentTypes() rather than calling GetParameters()
8463 2004-08-27 Martin Baulig <martin@ximian.com>
8466 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8469 2004-08-25 Martin Baulig <martin@ximian.com>
8471 * support.cs (ReflectionParameters..ctor): If this is a generic
8472 method, retrieve and store its type parameters.
8473 (InternalParameters..ctor): Added `TypeParameter[]' argument.
8474 (ReflectionParameters.GenericConstraints): The argument specifies
8475 the type parameter, not the method parameter.
8476 (InternalParameters.GenericConstraints): Likewise.
8478 * generic.cs (TypeParameter.DefineType): Correctly handle
8479 constraints wrt. generic methods in interfaces and their
8482 2004-08-24 Martin Baulig <martin@ximian.com>
8484 * generic.cs (TypeParameter.IsSubclassOf): New public method.
8485 (Constraints.IsSubclassOf): New internal method.
8487 * typemanager.cs (TypeManager.FindMembers): Added special support
8488 for GenericTypeParameterBuilder's.
8489 (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
8492 2004-08-24 Martin Baulig <martin@ximian.com>
8495 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8496 this for accessibility checks.
8497 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8498 IsNestedFamilyAccessible.
8499 (TypeManager.IsSubclassOf): New method, do what the name actually
8502 2004-08-24 Martin Baulig <martin@ximian.com>
8504 * expression.cs (MemberAccess.DoResolve): When resolving ourselves
8505 as a SimpleName, include the generic arity.
8507 2004-08-24 Martin Baulig <martin@ximian.com>
8509 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8510 MethodAttributes.HideBySig for operators.
8512 2004-08-23 Martin Baulig <martin@ximian.com>
8514 Back to the old error reporting system :-)
8516 * report.cs (Message): Removed.
8517 (Report.MessageData, ErrorData, WarningData): Removed.
8518 (Report.Error, Warning): Back to the old system.
8520 2004-08-23 Martin Baulig <martin@ximian.com>
8522 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8524 * class.cs (TypeContainer.ParentContainer): New public virtual
8525 method; replaces the explicit interface implementation.
8526 (ClassPart.ParentContainer): Override.
8528 2004-08-23 Martin Baulig <martin@ximian.com>
8530 * statement.cs (Switch): Added support for constant switches; see
8531 #59428 or test-285.cs.
8533 2004-08-22 Marek Safar <marek.safar@seznam.cz>
8536 * statement.cs (GetEnumeratorFilter): Removed useless
8537 logic because C# specs is strict. GetEnumerator must be
8540 2004-08-22 Martin Baulig <martin@ximian.com>
8542 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8543 a switch and may break, reset the barrier. Fixes #59867.
8545 2004-08-22 Marek Safar <marek.safar@seznam.cz>
8547 CLS-Compliance speed up (~5% for corlib)
8549 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8550 New method. Tests container for CLS-Compliant names
8552 * class.cs (TypeContainer.VerifyClsName): New method.
8553 Checks whether container name is CLS Compliant.
8554 (Constructor): Implements IMethodData.
8556 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8557 low-case table for CLS Compliance test.
8558 (MemberCache.VerifyClsParameterConflict): New method.
8559 Checks method parameters for CS3006 error.
8561 * enum.cs (EnumMember): Is derived from MemberCore.
8562 (Enum.VerifyClsName): Optimized for better performance.
8564 2004-08-06 Marek Safar <marek.safar@seznam.cz>
8566 * report.cs: Renamed Error_T to Error and changed all
8569 2004-08-06 Marek Safar <marek.safar@seznam.cz>
8571 * class.cs (TypeContainer.IndexerArrayList): New inner class
8572 container for indexers.
8573 (TypeContainer.DefaultIndexerName): New constant for default
8574 indexer name. Replaced all "Item" with this constant.
8575 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8577 * typemanager.cs (TypeManager.default_member_ctor): Cache here
8578 DefaultMemberAttribute constructor.
8580 2004-08-05 Martin Baulig <martin@ximian.com>
8582 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8585 2004-08-05 Marek Safar <marek.safar@seznam.cz>
8587 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8588 multi platforms problem.
8590 * compiler.csproj: Included shared files.
8592 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8594 Fix bug 60333, 55971 in the more general way
8595 * attribute.cs (Attribute.GetAttributeArgumentExpression):
8596 Added arg_type argument for constant conversion.
8597 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8599 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8602 * class.cs (TypeContainer ): New inner classes MethodArrayList,
8603 OperatorArrayList, MethodCoreArrayList for typecontainer
8604 containers. Changed class member types to these new types.
8605 (MethodArrayList.DefineMembers): Added test for CS0659.
8607 2004-08-04 Miguel de Icaza <miguel@ximian.com>
8609 * cfold.cs: Synchronize the folding with the code in expression.cs
8610 Binary.DoNumericPromotions for uint operands.
8612 * attribute.cs: Revert patch from Raja, it introduced a regression
8613 while building Blam-1.2.1 (hard to isolate a test case).
8615 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8619 (TypeContainer.Define): Renamed to DefineContainerMembers because of
8621 (MethodCore.parent_method): New member. The method we're overriding
8622 if this is an override method.
8623 (MethodCore.CheckBase): Moved from Method class and made common.
8624 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8626 (MethodCore.CheckForDuplications): New abstract method. For custom
8627 member duplication search in a container
8628 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8629 method and its return type.
8630 (Event.conflict_symbol): New member. Symbol with same name in the
8634 (MemberCache.FindMemberWithSameName): New method. The method
8635 is looking for conflict with inherited symbols.
8637 2004-08-04 Martin Baulig <martin@ximian.com>
8639 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8641 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8643 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8645 * report.cs (Message): New enum for better error, warning reference in
8647 (MessageData): New inner abstract class. It generally handles printing of
8648 error and warning messages.
8649 Removed unused Error, Warning, Message methods.
8651 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8653 Fix for cs0592-8.cs test
8655 (Attributable.ValidAttributeTargets): Made public.
8656 (Attribute.ExplicitTarget): New member for explicit target value.
8657 (Attribute.CheckTargets): Now we translate explicit attribute
8658 target to Target here.
8660 2004-08-03 Ben Maurer <bmaurer@ximian.com>
8662 * ecore.cs (MethodGroupExpr): new IsBase property.
8664 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8666 * delegate.cs (DelegateCreation): store a MethodGroupExpr
8667 rather than an instance expr.
8669 (DelegateCreation.Emit): Use the method group rather than
8670 the instance expression. Also, if you have base.Foo as the
8671 method for a delegate, make sure to emit ldftn, not ldftnvirt.
8673 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
8675 (NewDelegate.DoResolve): Only check for the existance of Invoke
8676 if the method is going to be needed. Use MethodGroupExpr.
8678 (NewDelegate.Emit): Remove, DelegateCreation implements this.
8680 * expression.cs: For pointer arith., make sure to use
8681 the size of the type, not the size of the pointer to
8684 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8687 * class.cs (Class): Added error CS0502 test.
8689 2004-08-03 John Luke <jluke@cfl.rr.com>
8690 Raja R Harinath <rharinath@novell.com>
8693 * attribute.cs (Attribute.complained_before): New flag.
8694 (Attribute.ResolveType, Attribute.Resolve),
8695 (Attribute.DefinePInvokeMethod): Set it.
8696 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8698 2004-08-03 Martin Baulig <martin@ximian.com>
8700 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8701 use a user-defined operator; we still need to do numeric
8702 promotions in case one argument is a builtin type and the other
8703 one has an implicit conversion to that type. Fixes #62322.
8705 2004-08-18 Martin Baulig <martin@ximian.com>
8707 * class.cs (Method.Define): Use the correct method name when
8708 creating the MethodBuilder for a generic method.
8710 2004-08-17 Martin Baulig <martin@ximian.com>
8712 * generic.cs (Constraints): Support type parameter constraints.
8714 2004-08-16 Martin Baulig <martin@ximian.com>
8716 * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
8717 (Token.GENERIC_DIMENSION): New token; this is returned if we
8718 encounter an unbound generic type in a typeof() expression.
8720 * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
8721 this token is only generated while parsing a typeof() expression.
8722 (typeof_expression): Removed the old unbound_type hack.
8724 * generic.cs (TypeArguments.IsUnbound): New public property.
8726 * decl.cs (MemberName): Added support for unbound types.
8728 2004-08-14 Martin Baulig <martin@ximian.com>
8731 (TypeManager.IsEqualGenericInstance): New static method.
8732 (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
8733 just used to check accessibility, so follow the rules of 26.1.6.
8735 * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
8736 ConstructedType instead of a TypeExpression if we have type arguments.
8738 * cs-parser.jay (typeof_expression): Support unbound generic types.
8740 * ecore.cs (UnboundTypeExpression): New public class.
8742 2004-08-12 Martin Baulig <martin@ximian.com>
8744 * typemanager.cs (TypeManager.IsNestedChildOf): Use
8745 TypeManager.IsEqual() rather than `=='.
8747 * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
8748 generic instances as well.
8750 2004-08-12 Martin Baulig <martin@ximian.com>
8752 * expression.cs (Invocation.InferType): We can only infer method
8753 type parameters. Fixes #62647.
8755 2004-08-11 Martin Baulig <martin@ximian.com>
8757 * class.cs (TypeContainer.DefineType): Create the TypeBuilder
8758 before resolving the base classes.
8760 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8762 * Makefile: install .mdb file too.
8764 2004-08-05 Martin Baulig <martin@ximian.com>
8766 * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
8767 initializer, the current type is just the TypeBuilder, not the
8768 instantiated generic type.
8769 (FieldExpr.IsFieldInitializer): New public property.
8771 2004-08-04 Martin Baulig <martin@ximian.com>
8773 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8775 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8777 2004-08-03 Martin Baulig <martin@ximian.com>
8779 * class.cs (MethodData.Define): If we're an explicit
8780 implementation, remove the generic arity from the type name.
8782 2004-08-03 Martin Baulig <martin@ximian.com>
8784 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8785 use a user-defined operator; we still need to do numeric
8786 promotions in case one argument is a builtin type and the other
8787 one has an implicit conversion to that type. Fixes #62322.
8789 2004-08-02 Martin Baulig <martin@ximian.com>
8791 * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
8793 (TypeContainer.GetClassBases): Return the unexpanded list of
8794 interfaces; we expand them later.
8795 (TypeContainer.DefineType): After creating the TypeBuilder, call
8796 TypeManager.ExpandInterfaces() to get an expanded and resolved
8799 * ecore.cs (TypeExpr.GetInterfaces): Removed
8801 * generics.cs (Constraints.InterfaceConstraints): Remove.
8802 (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
8803 register the interface constraints.
8806 (TypeManager.AddUserType): Removed the `ifaces' argument.
8807 (TypeManager.AddTypeParameter): Likewise.
8808 (TypeManager.AddUserInterface): Removed, was unused.
8809 (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
8810 `TypeExpr[]' array for the interfaces.
8811 (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
8812 has been defined, returns a list of the resolved interfaces types.
8813 (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
8814 (TypeManager.GetExplicitInterfaces): Likewise.
8816 2004-08-02 Martin Baulig <martin@ximian.com>
8818 * expression.cs (Invocation.EmitCall): If we're invoking a method
8819 on a type parameter, use the new `Constrained' prefix opcode.
8821 2004-08-02 Martin Baulig <martin@ximian.com>
8823 * statement.cs (LocalInfo.Flags): Added `IsThis'.
8824 (LocalInfo.IsThis): New public property.
8825 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8827 2004-08-01 Martin Baulig <martin@ximian.com>
8829 * class.cs (TypeContainer.GetClassBases): Don't set the default
8830 here since we may get called from GetPartialBases().
8831 (TypeContainer.DefineType): If GetClassBases() didn't return a
8832 parent, use the default one.
8834 2004-07-30 Martin Baulig <martin@ximian.com>
8836 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8838 * class.cs (SourceMethod): New public class, derive from the
8839 symbol writer's ISourceMethod.
8840 (Method): Use the new symbol writer API.
8842 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8843 as argument and use the new symbol writer.
8846 (SourceFile): Implement the symbol writer's ISourceFile.
8847 (Location.SymbolDocument): Removed.
8848 (Location.SourceFile): New public property.
8850 * symbolwriter.cs: Use the new symbol writer API.
8852 2004-07-30 Raja R Harinath <rharinath@novell.com>
8854 * Makefile (install-local): Remove. Functionality moved to
8857 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
8859 * Makefile: Install mcs.exe.config file together with mcs.exe.
8860 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8861 correct runtime version.
8863 2004-07-25 Martin Baulig <martin@ximian.com>
8866 (TypeContainer.RegisterOrder): Removed, this was unused.
8867 (TypeContainer, interface_order): Removed.
8868 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8869 TypeContainer as argument since we can also be called with a
8870 `PartialContainer' for a partial class/struct/interface.
8871 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8872 of checking whether we're an `Interface' - we could be a
8874 (PartialContainer.Register): Override; call
8875 AddClass()/AddStruct()/AddInterface() on our parent.
8877 * cs-parser.jay (interface_member_declaration): Add things to the
8878 `current_container', not the `current_class'.
8880 * rootcontext.cs (RegisterOrder): The overloaded version which
8881 takes an `Interface' was unused, removed.
8883 * typemanager.cs (TypeManager.LookupInterface): Return a
8884 `TypeContainer', not an `Interface'.
8885 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8886 contain a `PartialContainer' for an interface, so check it's
8887 `Kind' to figure out what it is.
8889 2004-07-25 Martin Baulig <martin@ximian.com>
8891 * class.cs (Class.DefaultTypeAttributes): New public constant.
8892 (Struct.DefaultTypeAttributes): Likewise.
8893 (Interface.DefaultTypeAttributes): Likewise.
8894 (PartialContainer.TypeAttr): Override this and add the
8895 DefaultTypeAttributes.
8897 2004-07-25 Martin Baulig <martin@ximian.com>
8899 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8900 we can just use the `Parent' field instead.
8902 2004-07-25 Martin Baulig <martin@ximian.com>
8904 * class.cs (TypeContainer.Emit): Renamed to EmitType().
8906 2004-07-25 Martin Baulig <martin@ximian.com>
8908 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8909 our parts before defining any methods.
8910 (TypeContainer.VerifyImplements): Make this virtual.
8911 (ClassPart.VerifyImplements): Override and call VerifyImplements()
8912 on our PartialContainer.
8914 2004-07-25 Martin Baulig <martin@ximian.com>
8916 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8918 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8919 argument, we can just use the `Parent' field instead.
8922 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
8923 (MemberBase.DoDefine): Likewise.
8925 2004-07-24 Martin Baulig <martin@ximian.com>
8927 * decl.cs (MemberCore.Parent): New public field.
8928 (DeclSpace.Parent): Moved to MemberCore.
8930 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8931 (MemberBase.ctor): Added TypeContainer argument, pass it to our
8933 (FieldBase, Field, Operator): Likewise.
8934 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8935 (EventField, Event): Likewise.
8937 2004-07-23 Martin Baulig <martin@ximian.com>
8939 * class.cs (PartialContainer): New public class.
8940 (ClassPart): New public class.
8941 (TypeContainer): Added support for partial classes.
8942 (TypeContainer.GetClassBases): Splitted some of the functionality
8943 out into GetNormalBases() and GetPartialBases().
8945 * cs-tokenizer.cs (Token.PARTIAL): New token.
8946 (Tokenizer.consume_identifier): Added some hacks to recognize
8947 `partial', but only if it's immediately followed by `class',
8948 `struct' or `interface'.
8950 * cs-parser.jay: Added support for partial clases.
8952 2004-07-23 Martin Baulig <martin@ximian.com>
8954 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8955 a `DeclSpace' and also made it readonly.
8956 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8957 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8958 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8960 * cs-parser.jay: Pass the `current_class', not the
8961 `current_container' (at the moment, this is still the same thing)
8962 to a new Method, Property, Event, Indexer or Constructor.
8964 2004-07-23 Martin Baulig <martin@ximian.com>
8966 * cs-parser.jay (CSharpParser): Added a new `current_class' field
8967 and removed the `current_interface' one.
8968 (struct_declaration, class_declaration, interface_declaration):
8969 Set `current_class' to the newly created class/struct/interface;
8970 set their `Bases' and call Register() before parsing their body.
8972 2004-07-23 Martin Baulig <martin@ximian.com>
8974 * class.cs (Kind): New public enum.
8975 (TypeContainer): Made this class abstract.
8976 (TypeContainer.Kind): New public readonly field.
8977 (TypeContainer.CheckDef): New public method; moved here from
8979 (TypeContainer.Register): New public abstract method.
8980 (TypeContainer.GetPendingImplementations): New public abstract
8982 (TypeContainer.GetClassBases): Removed the `is_class' and
8983 `is_iface' parameters.
8984 (TypeContainer.DefineNestedTypes): Formerly known as
8986 (ClassOrStruct): Made this class abstract.
8988 * tree.cs (RootTypes): New public type.
8990 2004-07-20 Martin Baulig <martin@ximian.com>
8992 * tree.cs (Tree.RecordNamespace): Removed.
8993 (Tree.Namespaces): Removed.
8995 * rootcontext.cs (RootContext.IsNamespace): Removed.
8997 * cs-parser.jay (namespace_declaration): Just create a new
8998 NamespaceEntry here.
9000 2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
9002 * Makefile: Install gmcs.exe.config file together with gmcs.exe.
9003 * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
9004 entry to make sure it runs in the correct runtime version.
9006 2004-07-18 Martin Baulig <martin@ximian.com>
9008 * generic.cs (ConstructedType.CheckConstraints): Improved
9009 constraints checking.
9011 2004-07-18 Martin Baulig <martin@ximian.com>
9013 * expression.cs (Invocation.BetterMethod): Call
9014 TypeManager.TypeToCoreType() on all types and removed my previous
9015 hack; we're already doig the right thing here.
9017 2004-07-17 Martin Baulig <martin@ximian.com>
9019 * decl.cs (MemberName.MakeName): Create the "class`1" names here.
9021 2004-07-16 Martin Baulig <martin@ximian.com>
9023 * iterators.cs: Added generics support.
9025 2004-07-16 Martin Baulig <martin@ximian.com>
9027 * iterators.cs: Rewrote this. We're now using one single Proxy
9028 class for both the IEnumerable and the IEnumerator interface and
9029 `Iterator' derives from Class so we can use the high-level API.
9031 * class.cs (TypeContainer.AddIterator): New method.
9032 (TypeContainer.DoDefineType): New protected virtual method, which
9033 is called from DefineType().
9034 (TypeContainer.DoDefineMembers): Call DefineType() and
9035 DefineMembers() on all our iterators.
9036 (TypeContainer.Emit): Call Emit() on all our iterators.
9037 (TypeContainer.CloseType): Call CloseType() on all our iterators.
9039 * codegen.cs (EmitContext.CurrentIterator): New public field.
9041 2004-07-15 Martin Baulig <martin@ximian.com>
9044 (TypeManager.not_supported_exception_type): New type.
9046 2004-07-14 Martin Baulig <martin@ximian.com>
9049 (TypeManager.generic_ienumerable_type): New type.
9050 (TypeManager.generic_ienumerator_type): New type.
9053 (RootContext.interfaces_first_stage): Added
9054 "System.Collections.Generic.IEnumerator`1" and
9055 "System.Collections.Generic.IEnumerable`1".
9057 2004-07-14 Martin Baulig <martin@ximian.com>
9059 * iterators.cs: Use real error numbers.
9061 2004-07-14 Martin Baulig <martin@ximian.com>
9063 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
9064 requires this to be a System.Collection.IEnumerable and not a
9065 class implementing that interface.
9066 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
9068 2004-07-13 Marek Safar <marek.safar@seznam.cz>
9070 * class.cs: Fixed previous fix, it broke some error tests.
9072 2004-07-12 Martin Baulig <martin@ximian.com>
9074 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
9077 2004-07-14 Martin Baulig <martin@ximian.com>
9079 * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
9080 an exclamation mark (!) for the generic arity to reflect the
9081 latest spec changes; ie. use "System.Collections.Generic.IList`1".
9083 2004-07-13 Martin Baulig <martin@ximian.com>
9085 * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
9086 specifiers being part of a type argument.
9088 2004-07-13 Martin Baulig <martin@ximian.com>
9090 * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
9091 name for generic types.
9093 2004-07-13 Martin Baulig <martin@ximian.com>
9095 * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
9098 2004-07-09 Miguel de Icaza <miguel@ximian.com>
9100 * assign.cs (LocalTemporary): Add new argument: is_address,If
9101 `is_address' is true, then the value that we store is the address
9102 to the real value, and not the value itself.
9104 * ecore.cs (PropertyExpr): use the new local temporary
9105 stuff to allow us to handle X.Y += z (where X is a struct)
9107 2004-07-08 Martin Baulig <martin@ximian.com>
9109 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
9110 not always return, just like we're doing in Using.Resolve().
9112 2004-07-07 Miguel de Icaza <miguel@ximian.com>
9114 * cs-parser.jay (fixed_statement): flag this as Pinned.
9116 2004-07-06 Miguel de Icaza <miguel@ximian.com>
9118 * typemanager.cs (TypeManager): Removed MakePinned method, this
9119 mechanism is replaced with the .NET 2.x compatible mechanism of
9120 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
9122 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
9123 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
9124 `IsFixed' property which has a different meaning.
9126 2004-07-02 Raja R Harinath <rharinath@novell.com>
9128 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
9129 visible from inside a nested class, not just the names of the
9130 immediately enclosing class.
9133 2004-06-24 Raja R Harinath <rharinath@novell.com>
9135 * expression.cs (BetterConversion): Remove buggy special-case
9136 handling of "implicit constant expression conversions". At this
9137 point, we already know that the conversion is possible -- we're
9138 only checking to see which is better.
9140 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9142 * cs-parser.jay: Added error CS0210 test.
9144 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9146 * cs-parser.jay: Added error CS0134 test.
9148 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9151 * cs-parser.jay: Added error CS0145 test.
9153 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9155 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
9157 2004-06-23 Ben Maurer <bmaurer@ximian.com>
9159 * expression.cs (StackAlloc.Resolve): The argument may not
9160 be a constant; deal with this case.
9162 2004-06-23 Marek Safar <marek.safar@seznam.cz>
9164 * attribute.cs (IndexerName_GetIndexerName): Renamed to
9165 GetIndexerAttributeValue.
9166 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
9168 * class.cs (Indexer.Define): Added error tests for CS0415,
9171 2004-06-23 Miguel de Icaza <miguel@ximian.com>
9173 * attribute.cs (Attribute.Resolve): Keep field code in sync with
9176 2004-06-23 Martin Baulig <martin@ximian.com>
9178 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
9179 neither return nor throw, reset the barrier as well. Fixes #60457.
9181 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
9183 * class.cs : EventAttributes is now set to None by default.
9184 This fixes bug #60459.
9186 2004-06-18 Marek Safar <marek.safar@seznam.cz>
9189 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9190 Don't throw exception but return null (it's sufficient now).
9192 2004-06-18 Marek Safar <marek.safar@seznam.cz>
9194 * typemanager.cs (GetArgumentTypes): Faster implementation.
9196 2004-06-18 Martin Baulig <martin@ximian.com>
9198 * attribute.cs (Attribute.Resolve): Check whether we're an
9199 EmptyCast which a Constant child. Fixes #60333.
9201 2004-06-17 Ben Maurer <bmaurer@ximian.com>
9203 * statement.cs (EmitCollectionForeach): Account for the fact that
9204 not all valuetypes are in areas which we can take the address of.
9205 For these variables, we store to a temporary variable. Also, make
9206 sure that we dont emit a `callvirt' on a valuetype method.
9208 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9210 * expression.cs (StackAlloc.DoReSolve): Added test for
9211 negative parameter (CS0247).
9213 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9216 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
9218 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9221 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
9224 2004-06-14 Marek Safar <marek.safar@seznam.cz>
9226 Fix bug #58254 & cs1555.cs, cs1556.cs
9227 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
9229 2004-06-14 Marek Safar <marek.safar@seznam.cz>
9231 * cs-parser.jay: Added error CS1669 test for indexers.
9233 2004-06-18 Martin Baulig <martin@ximian.com>
9235 * generics.cs (GenericMethod.ctor): Don't take an Attributes
9236 argument. Fixes #60441.
9238 2004-06-16 Ben Maurer <bmaurer@ximian.com>
9239 * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
9240 The name needs to have the actual name of the method in order
9241 for other tests (such as the one in OverloadResolve for Invoke
9242 on a delegate) to work. As well, it does not really help
9243 error reporting because the method group had multiple methods.
9244 * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
9245 Make profiling work.
9247 2004-06-13 Martin Baulig <martin@ximian.com>
9249 * cs-parser.jay: Don't allow generic attributes.
9251 2004-06-13 Martin Baulig <martin@ximian.com>
9253 * class.cs (MemberBase.DoDefineBase): New protected method.
9254 (MemberBase.DoDefine): Compute the `flags' in the new
9255 DoDefineBase() which must be called first.
9256 (Method.Define): Call DoDefineBase() first so we have the flags
9257 when defining the generic method.
9259 * cs-parser.jay (interface_method_declaration): Support generic methods.
9261 2004-06-13 Martin Baulig <martin@ximian.com>
9263 * decl.cs (TypeName): Removed.
9264 (MemberName): Removed TypeName and MemberNow; now we just have
9267 * cs-parser.jay: Don't distinguish between type arguments and type
9268 parameters in the grammar and simplified the rules a bit. The
9269 reduce/reduce conflicts are now gone (except the one we inherited
9272 2004-06-11 Martin Baulig <martin@ximian.com>
9274 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9275 call this twice: for params and varargs methods.
9277 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9280 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9282 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9284 * attribute.cs (Attribute.GetValidTargets): Made public.
9287 (AbstractPropertyEventMethod): New class for better code sharing.
9288 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
9290 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
9292 2004-06-09 Martin Baulig <martin@ximian.com>
9294 * cs-parser.jay: Removed a reduce/reduce conflict.
9296 2004-06-03 Martin Baulig <martin@ximian.com>
9298 * generic.cs (ConstructedType.GetMemberAccess): Renamed to
9299 GetSimpleName() and return a SimpleName.
9301 * ecore.cs (SimpleName.Arguments): New public field.
9302 (SimpleName): Added overloaded ctor which takes an additional
9303 TypeArguments argument.
9304 (SimpleName.SimpleNameResolve): Added support for generic methods.
9305 (MethodGroupExpr.ResolveGeneric): New public method. The code was
9306 formerly in MemberAccess.DoResolve(), but we also need it in
9307 SimpleNameResolve().
9309 * expression.cs (MemberAccess.DoResolve): Use the new
9310 MethodGroupExpr.ResolveGeneric().
9312 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9314 * decl.cs: If possible, use lookuptypedirect here. We can only do
9315 this if there is no `.' after the namespace. Avoids using
9316 LookupType, which does lots of slow processing.
9317 (FindNestedType) New method, does what it says :-).
9318 * namespace.cs: use LookupTypeDirect.
9319 * rootcontext.cs: use membercache, if possible.
9320 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9322 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9325 According to the spec,
9327 In a member access of the form E.I, if E is a single identifier,
9328 and if the meaning of E as a simple-name (§7.5.2) is a constant,
9329 field, property, localvariable, or parameter with the same type as
9330 the meaning of E as a type-name (§3.8), then both possible
9331 meanings of E are permitted.
9333 We did not check that E as a simple-name had the same type as E as
9336 This trivial check gives us 5-7% on bootstrap time.
9338 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9340 * expression.cs (Invocation.OverloadResolve): Avoid the
9341 use of hashtables and boxing here by allocating on demand.
9343 2004-05-30 Martin Baulig <martin@ximian.com>
9345 * rootcontext.cs (RootContext.LookupType): Don't cache things if
9346 we're doing a silent lookup. Don't try to lookup nested types in
9347 TypeManager.object_type (thanks to Ben Maurer).
9349 2004-05-30 Martin Baulig <martin@ximian.com>
9351 Committing a patch from Ben Maurer.
9353 * rootcontext.cs (RootContext.LookupType): Cache negative results.
9355 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9357 * convert.cs: add a trivial cache for overload operator resolution.
9359 2004-05-31 Marek Safar <marek.safar@seznam.cz>
9362 (AttributeTester.GetObsoleteAttribute): Returns instance of
9363 ObsoleteAttribute when type is obsolete.
9366 (TypeContainer.VerifyObsoleteAttribute): Override.
9367 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
9368 (MethodCode.VerifyObsoleteAttribute): Override.
9369 (MemberBase.VerifyObsoleteAttribute): Override.
9372 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
9373 and report proper error.
9376 (Delegate.VerifyObsoleteAttribute): Override.
9379 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
9380 and report proper error.
9381 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
9384 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
9388 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
9389 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
9390 Added test for ObsoleteAttribute.
9393 (Catch): Derived from Statement.
9395 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9397 * decl.cs: If possible, use lookuptypedirect here. We can only do
9398 this if there is no `.' after the namespace. Avoids using
9399 LookupType, which does lots of slow processing.
9400 (FindNestedType) New method, does what it says :-).
9401 * namespace.cs: use LookupTypeDirect.
9402 * rootcontext.cs: use membercache, if possible.
9403 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9405 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9408 According to the spec,
9410 In a member access of the form E.I, if E is a single identifier,
9411 and if the meaning of E as a simple-name (§7.5.2) is a constant,
9412 field, property, localvariable, or parameter with the same type as
9413 the meaning of E as a type-name (§3.8), then both possible
9414 meanings of E are permitted.
9416 We did not check that E as a simple-name had the same type as E as
9419 This trivial check gives us 5-7% on bootstrap time.
9421 2004-05-30 Marek Safar <marek.safar@seznam.cz>
9423 Fixed bug #59071 & cs0160.cs
9424 * statement.cs (Try.Resolve): Check here whether order of catch
9425 clauses matches their dependencies.
9427 2004-05-30 Marek Safar <marek.safar@seznam.cz>
9430 * ecore.cs (SimpleName.SimpleNameResolve): Added test for
9433 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9435 * expression.cs (Invocation.OverloadResolve): Avoid the
9436 use of hashtables and boxing here by allocating on demand.
9438 2004-05-30 Martin Baulig <martin@ximian.com>
9440 * rootcontext.cs (RootContext.LookupType): Don't cache things if
9441 we're doing a silent lookup. Don't try to lookup nested types in
9442 TypeManager.object_type (thanks to Ben Maurer).
9444 2004-05-30 Martin Baulig <martin@ximian.com>
9446 Committing a patch from Ben Maurer.
9448 * rootcontext.cs (RootContext.LookupType): Cache negative results.
9450 2004-05-29 Martin Baulig <martin@ximian.com>
9452 * class.cs (IMethodData.ShouldIgnore): New method.
9454 * typemanager.cs (TypeManager.MethodFlags): Don't take a
9455 `Location' argument, we don't need it anywhere. Use
9456 `IMethodData.ShouldIgnore ()' instead of
9457 `MethodData.GetMethodFlags ()'.
9458 (TypeManager.AddMethod): Removed.
9459 (TypeManager.AddMethod2): Renamed to AddMethod.
9461 2004-05-29 Martin Baulig <martin@ximian.com>
9463 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9465 * convert.cs (Convert.ImplicitReferenceConversion): If we're
9466 converting from a class type S to an interface type and we already
9467 have an object on the stack, don't box it again. Fixes #52578.
9469 2004-05-29 Martin Baulig <martin@ximian.com>
9471 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9472 Added support for `params' parameters. Fixes #59267.
9474 2004-05-29 Martin Baulig <martin@ximian.com>
9476 * literal.cs (NullPointer): Provide a private .ctor which sets
9477 `type' to TypeManager.object_type. Fixes #59048.
9479 2004-05-29 Martin Baulig <martin@ximian.com>
9481 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9482 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
9484 * ecore.cs (EventExpr.instance_expr): Make the field private.
9486 2004-05-26 Marek Safar <marek.safar@seznam.cz>
9488 Fixed bug #50080 & cs0214-2.cs
9489 * expression.cs (Cast.DoResolve): Check unsafe context here.
9491 * statement.cs (Resolve.DoResolve): Likewise.
9493 2004-05-26 Martin Baulig <martin@ximian.com>
9495 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9497 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9498 (RootContext.LookupType): Pass down the `silent' flag.
9500 2004-05-25 Martin Baulig <martin@ximian.com>
9503 (MethodGroupExpr.IdenticalTypeName): New public property.
9504 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9505 expression actually refers to a type.
9507 2004-05-25 Martin Baulig <martin@ximian.com>
9509 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9510 for #56176 and made it actually work.
9512 2004-05-25 Martin Baulig <martin@ximian.com>
9514 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9515 (FieldExpr, PropertyExpr): Override and implement
9516 CacheTemporaries. Fixes #52279.
9518 2004-05-25 Miguel de Icaza <miguel@ximian.com>
9520 * location.cs: In the new compiler listing a file twice is a
9521 warning, not an error.
9523 2004-05-24 Martin Baulig <martin@ximian.com>
9525 * enum.cs (Enum.DefineType): For the `BaseType' to be a
9526 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
9528 2004-05-24 Martin Baulig <martin@ximian.com>
9530 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9531 walking the `using' list. Fixes #53921.
9533 2004-05-24 Martin Baulig <martin@ximian.com>
9535 * const.cs (Const.LookupConstantValue): Added support for
9536 EmptyCast's; fixes #55251.
9538 2004-05-24 Martin Baulig <martin@ximian.com>
9540 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9541 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9542 which does the CS0135 check. The reason is that we first need to
9543 check whether the variable actually exists.
9545 2004-05-24 Martin Baulig <martin@ximian.com>
9547 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9548 than RootContext.LookupType() to find the explicit interface
9551 2004-05-24 Raja R Harinath <rharinath@novell.com>
9553 * Makefile: Simplify. Use executable.make.
9554 * mcs.exe.sources: New file. List of sources of mcs.exe.
9556 2004-05-24 Anders Carlsson <andersca@gnome.org>
9560 Use the invariant culture when doing String.Compare for CLS case
9563 2004-05-23 Martin Baulig <martin@ximian.com>
9565 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9566 don't have any dots. Fixes #52622, added cs0246-8.cs.
9568 * namespace.cs (NamespaceEntry.Lookup): Likewise.
9570 2004-05-23 Marek Safar <marek.safar@seznam.cz>
9572 * class.cs (MemberBase.Define): Reuse MemberType member for
9573 resolved type. Other methods can use it too.
9575 2004-05-23 Martin Baulig <martin@ximian.com>
9577 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9578 the variable also exists in the current block (otherwise, we need
9579 to report a CS0103). Fixes #58670.
9581 2004-05-23 Martin Baulig <martin@ximian.com>
9583 * flowanalysis.cs (Reachability.Reachable): Compute this
9584 on-the-fly rather than storing it as a field.
9586 2004-05-23 Martin Baulig <martin@ximian.com>
9588 * flowanalysis.cs (Reachability.And): Manually compute the
9589 resulting `barrier' from the reachability.
9591 2004-05-23 Marek Safar <marek.safar@seznam.cz>
9594 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9595 instance of ObsoleteAttribute when symbol is obsolete.
9598 (IMethodData): Extended interface for ObsoleteAttribute support.
9600 2004-05-22 Marek Safar <marek.safar@seznam.cz>
9602 * attribute.cs: Fix bug #55970
9604 2004-05-22 Marek Safar <marek.safar@seznam.cz>
9608 (GetObsoleteAttribute): New method. Creates the instance of
9610 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9611 ObsoleteAttribute when member is obsolete.
9612 (AttributeTester.Report_ObsoleteMessage): Common method for
9613 Obsolete error/warning reporting.
9616 (TypeContainer.base_classs_type): New member for storing parent type.
9619 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9620 for this MemberCore.
9622 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9624 * attribute.cs, const.cs: Fix bug #58590
9626 2004-05-21 Martin Baulig <martin@ximian.com>
9628 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9629 out parameters if the end of the method is unreachable. Fixes
9632 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9634 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9635 Hari was right, why extra method.
9637 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9639 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9641 2004-05-20 Martin Baulig <martin@ximian.com>
9643 * delegate.cs: Convert this file to Unix mode - like the original
9646 2004-05-20 Martin Baulig <martin@ximian.com>
9648 * attribute.cs: Convert this file to Unix mode - like the original
9651 2004-05-19 Marek Safar <marek.safar@seznam.cz>
9653 Fix bug #58688 (MCS does not report error when the same attribute
9656 * attribute.cs (Attribute.Emit): Distinction between null and default.
9658 2004-05-19 Raja R Harinath <rharinath@novell.com>
9660 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9661 of a top-level attribute without an attribute target.
9662 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
9664 (Attribute.Conditional_GetConditionName),
9665 (Attribute.Obsolete_GetObsoleteMessage): Update.
9666 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
9667 part of ScanForIndexerName.
9668 (Attribute.CanIgnoreInvalidAttribute): New function.
9669 (Attribute.ScanForIndexerName): Move to ...
9670 (Attributes.ScanForIndexerName): ... here.
9671 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9672 (Attributes.Search): New internal variant that can choose not to
9673 complain if types aren't resolved. The original signature now
9675 (Attributes.GetClsCompliantAttribute): Use internal variant, with
9676 complaints suppressed.
9677 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9678 only if it not useful.
9679 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9680 top-level for attributes that are shared between the assembly
9681 and a top-level class.
9682 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9683 * class.cs: Update to reflect changes.
9684 (DefineIndexers): Fuse loops.
9685 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
9686 a couple more variants of attribute names.
9688 2004-05-18 Marek Safar <marek.safar@seznam.cz>
9690 Fix bug #52585 (Implemented explicit attribute declaration)
9693 (Attributable.ValidAttributeTargets): New abstract method. It gets
9694 list of valid attribute targets for explicit target declaration.
9695 (Attribute.Target): It holds target itself.
9696 (AttributeSection): Removed.
9697 (Attribute.CheckTargets): New method. It checks whether attribute
9698 target is valid for the current element.
9701 (EventProperty): New class. For events that are declared like
9702 property (with add and remove accessors).
9703 (EventField): New class. For events that are declared like field.
9706 * cs-parser.jay: Implemented explicit attribute target declaration.
9708 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
9709 Override ValidAttributeTargets.
9712 (ReturnParameter): Class for applying custom attributes on
9714 (ParameterAtribute): New class. Class for applying custom
9715 attributes on the parameter type.
9717 2004-05-17 Miguel de Icaza <miguel@ximian.com>
9719 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9722 (Method): Allow UNSAFE here.
9724 * modifiers.cs: Support unsafe reporting.
9726 2004-05-17 Marek Safar <marek.safar@seznam.cz>
9728 * decl.cs: Fix bug #58478.
9730 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9732 * statement.cs: When checking for unreachable code on an EmptyStatement,
9733 set the location. Fixes bug #58488.
9735 2004-05-13 Miguel de Icaza <miguel@ximian.com>
9737 * driver.cs: Add -pkg handling.
9739 From Gonzalo: UseShelLExecute=false
9741 2004-05-12 Marek Safar <marek.safar@seznam.cz>
9744 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9746 (Attribute.IsClsCompliaceRequired): Moved to base for better
9748 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9749 when attribute is AttributeUsageAttribute.
9750 (Attribute.GetValidTargets): Simplified.
9751 (Attribute.GetAttributeUsage): New method returns AttributeUsage
9752 attribute for this type.
9753 (Attribute.ApplyAttributes): Method renamed to Emit and make
9755 (GlobalAttributeSection): New class for special handling of global
9756 attributes (assembly, module).
9757 (AttributeSection.Emit): New method.
9759 * class.cs: Implemented Attributable abstract methods.
9760 (MethodCore.LabelParameters): Moved to Parameter class.
9761 (Accessor): Is back simple class.
9762 (PropertyMethod): Implemented Attributable abstract class.
9763 (DelegateMethod): Implemented Attributable abstract class.
9764 (Event): New constructor for disctintion between normal Event
9765 and Event with accessors.
9767 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9769 * codegen.cs, const.cs, decl.cs, delegate.cs:
9770 (CommonAssemblyModulClass): Implemented Attributable abstract class
9773 * enum.cs: Implement IAttributeSupport interface.
9774 (EnumMember): New class for emum members. Implemented Attributable
9778 (ParameterBase): Is abstract.
9779 (ReturnParameter): New class for easier [return:] attribute handling.
9781 * typemanager.cs: Removed builder_to_attr.
9783 2004-05-11 Raja R Harinath <rharinath@novell.com>
9786 * attribute.cs (Attribute.GetPositionalValue): New function.
9787 * class.cs (TypeContainer.VerifyMembers): New function.
9788 (TypeContainer.Emit): Use it.
9789 (ClassOrStruct): New base class for Class and Struct.
9790 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
9791 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9793 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9794 then each non-static field should have a FieldOffset attribute.
9795 Otherwise, none of the fields should have a FieldOffset attribute.
9796 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
9797 and FieldOffset attributes.
9798 * typemanager.cs (TypeManager.struct_layout_attribute_type)
9799 (TypeManager.field_offset_attribute_type): New core types.
9800 (TypeManager.InitCoreTypes): Initialize them.
9802 2004-05-11 Michal Moskal <malekith@pld-linux.org>
9804 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9805 Return correct type.
9808 2004-05-09 Miguel de Icaza <miguel@ximian.com>
9810 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9811 be implicitly converted to ulong.
9813 * expression.cs: The logic for allowing operator &, | and ^ worked
9814 was wrong, it worked before because we did not report an error in
9815 an else branch. Fixes 57895.
9817 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9818 allow volatile fields to be reference types.
9820 2004-05-07 Miguel de Icaza <miguel@ximian.com>
9822 * driver.cs: Add support for /debug-
9824 2004-05-07 Raja R Harinath <rharinath@novell.com>
9826 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
9827 Add a 'complain' parameter to silence errors.
9828 (Attribute.Resolve): Update to changes. Put in sanity check to catch
9829 silently overlooked type-resolutions.
9830 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9832 (Attributes.Search): New function.
9833 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9834 (Attributes.GetAttributeFullName): Remove hack.
9835 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
9836 Update to reflect changes.
9837 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9838 Use Attributes.Search instead of nested loops.
9840 2004-05-07 Marek Safar <marek.safar@seznam.cz>
9843 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9844 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9845 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9847 * report.cs: (Report.Warning): Renamed to Warning_T because of
9848 parameter collision.
9850 2004-05-05 Raja R Harinath <rharinath@novell.com>
9852 * expression.cs (MemberAccess.ResolveMemberAccess):
9853 Exit with non-zero status after Report.Error.
9854 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9856 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9858 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9860 * support.cs: Don't hang when the file is empty.
9862 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9864 * support.cs: In SeekableStreamReader, compute the preamble size of the
9865 underlying stream. Position changes should take into account that initial
9868 2004-05-03 Todd Berman <tberman@sevenl.net>
9870 * driver.cs: remove unused GetSysVersion function.
9872 2004-05-03 Todd Berman <tberman@sevenl.net>
9874 * driver.cs: Remove the hack from saturday, as well as the hack
9875 from jackson (LoadAssemblyFromGac), also adds the CWD to the
9876 link_paths to get that bit proper.
9878 2004-05-01 Todd Berman <tberman@sevenl.net>
9880 * driver.cs: Try a LoadFrom before a Load, this checks the current
9881 path. This is currently a bug in mono that is be fixed, however, this
9882 provides a workaround for now. This will be removed when the bug
9885 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
9887 * CryptoConvert.cs: Updated to latest version. Fix issue with
9888 incomplete key pairs (#57941).
9890 2004-05-01 Todd Berman <tberman@sevenl.net>
9892 * driver.cs: Remove '.' from path_chars, now System.* loads properly
9895 2004-04-30 Jackson Harper <jackson@ximian.com>
9897 * codegen.cs: Open keys readonly.
9899 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9901 * typemanager.cs: don't report cyclic struct layout when a struct
9902 contains 2 or more fields of the same type. Failed for Pango.AttrShape
9903 which has 2 Pango.Rectangle fields.
9905 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
9907 * expression.cs: Handle IntPtr comparisons with IL code
9908 rather than a method call.
9910 2004-04-29 Martin Baulig <martin@ximian.com>
9912 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
9913 the list of PropertyInfo's in class hierarchy and find the
9914 accessor. Fixes #56013.
9916 2004-04-29 Martin Baulig <martin@ximian.com>
9918 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9920 2004-04-29 Martin Baulig <martin@ximian.com>
9922 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9924 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9926 2004-04-29 Martin Baulig <martin@ximian.com>
9928 * class.cs (ConstructorInitializer.Resolve): Check whether the
9929 parent .ctor is accessible. Fixes #52146.
9931 2004-04-29 Martin Baulig <martin@ximian.com>
9933 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9935 * statement.cs (Using.EmitLocalVariableDecls): Use
9936 TypeManager.idisposable_type, not typeof (IDisposable).
9937 (Foreach.EmitCollectionForeach): Added support for valuetypes.
9939 2004-04-29 Martin Baulig <martin@ximian.com>
9941 * class.cs (Event.Define): Don't emit the field and don't set
9942 RTSpecialName and SpecialName for events on interfaces. Fixes
9945 2004-04-29 Raja R Harinath <rharinath@novell.com>
9947 Refactor Attribute.ApplyAttributes.
9948 * attribute.cs (Attributable): New base class for objects that can
9949 have Attributes applied on them.
9950 (Attribute): Make AttributeUsage fields public.
9951 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9952 (Attribute.IsInternalCall): New property.
9953 (Attribute.UsageAttr): Convert to a public read-only property.
9954 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9955 (Attribute.ResolveType, Attribute.Resolve)
9956 (Attribute.ScanForIndexerName): Update to reflect changes.
9957 (Attribute.CheckAttributeTarget): Re-format.
9958 (Attribute.ApplyAttributes): Refactor, to various
9959 Attributable.ApplyAttributeBuilder methods.
9960 * decl.cs (MemberCore): Make Attributable.
9961 * class.cs (Accessor): Make Attributable.
9962 (MethodData.ApplyAttributes): Use proper attribute types, not
9964 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9965 (TypeContainer.ApplyAttributeBuilder)
9966 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9967 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
9968 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9969 (Operator.ApplyAttributeBuilder): New factored-out methods.
9970 * const.cs (Const.ApplyAttributeBuilder): Likewise.
9971 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9972 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9973 * parameter.cs (ParameterBase): New Attributable base class
9974 that can also represent Return types.
9975 (Parameter): Update to the changes.
9977 2004-04-29 Jackson Harper <jackson@ximian.com>
9979 * driver.cs: Prefer the corlib system version when looking for
9980 assemblies in the GAC. This is still a hack, but its a better hack
9983 2004-04-29 Marek Safar <marek.safar@seznam.cz>
9985 * decl.cs, enum.cs: Improved error 3005 reporting.
9987 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9988 (related_symbols): New private member for list of symbols
9989 related to reported error/warning.
9991 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9993 2004-04-29 Martin Baulig <martin@ximian.com>
9995 * ecore.cs (Expression.Constantify): If we're an enum and
9996 TypeManager.TypeToCoreType() doesn't give us another type, use
9997 t.UnderlyingSystemType. Fixes #56178.
9999 2004-04-29 Martin Baulig <martin@ximian.com>
10001 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
10002 interfaces and for each interface, only add members directly
10003 declared in that interface. Fixes #53255.
10005 2004-04-28 Martin Baulig <martin@ximian.com>
10007 * expression.cs (ConditionalLogicalOperator): Use a temporary
10008 variable for `left' to avoid that we evaluate it more than once;
10011 2004-04-28 Martin Baulig <martin@ximian.com>
10013 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
10016 2004-04-28 Martin Baulig <martin@ximian.com>
10018 * statement.cs (LocalInfo.Resolve): Check whether the type is not
10021 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
10022 whether the type is not void (CS1547).
10024 2004-04-28 Martin Baulig <martin@ximian.com>
10026 * expression.cs (Unary.DoResolveLValue): Override this and report
10027 CS0131 for anything but Operator.Indirection.
10029 2004-04-28 Martin Baulig <martin@ximian.com>
10031 Committing a patch from Ben Maurer; see bug #50820.
10033 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10036 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10039 2004-04-28 Martin Baulig <martin@ximian.com>
10041 Committing a patch from Ben Maurer; see bug #50820.
10043 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10046 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10049 2004-04-28 Martin Baulig <martin@ximian.com>
10051 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
10052 (Block.AddLabel): Call DoLookupLabel() to only search in the
10055 2004-04-28 Martin Baulig <martin@ximian.com>
10057 * cfold.cs (ConstantFold.BinaryFold): Added special support for
10058 comparing StringConstants and NullLiterals in Equality and Inequality.
10060 2004-04-28 Jackson Harper <jackson@ximian.com>
10062 * driver.cs: Attempt to load referenced assemblies from the
10063 GAC. This is the quick and dirty version of this method that
10064 doesnt take into account versions and just takes the first
10065 canidate found. Will be good enough for now as we will not have more
10066 then one version installed into the GAC until I update this method.
10068 2004-04-28 Martin Baulig <martin@ximian.com>
10070 * typemanager.cs (TypeManager.CheckStructCycles): New public
10071 static method to check for cycles in the struct layout.
10073 * rootcontext.cs (RootContext.PopulateTypes): Call
10074 TypeManager.CheckStructCycles() for each TypeContainer.
10075 [Note: We only need to visit each type once.]
10077 2004-04-28 Martin Baulig <martin@ximian.com>
10079 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
10081 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
10082 success and added `out object value'. Use a `bool resolved' field
10083 to check whether we've already been called rather than
10084 `ConstantValue != null' since this breaks for NullLiterals.
10086 2004-04-28 Raja R Harinath <rharinath@novell.com>
10088 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
10089 setting of this flag, since the 'set' method may be non-public.
10091 2004-04-28 Raja R Harinath <rharinath@novell.com>
10093 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
10094 check on current_vector.Block.
10096 2004-04-27 Martin Baulig <martin@ximian.com>
10098 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
10099 a field initializer. Fixes #56459.
10101 2004-04-27 Martin Baulig <martin@ximian.com>
10103 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
10104 we're not attempting to use an indexer. Fixes #52154.
10106 2004-04-27 Martin Baulig <martin@ximian.com>
10108 * statement.cs (Return): Don't create a return label if we don't
10109 need it; reverts my change from January 20th. Thanks to Ben
10112 2004-04-27 Martin Baulig <martin@ximian.com>
10114 According to the spec, `goto' can only leave a nested scope, but
10117 * statement.cs (Block.LookupLabel): Only lookup in the current
10118 block, don't recurse into parent or child blocks.
10119 (Block.AddLabel): Check in parent and child blocks, report
10120 CS0140/CS0158 if we find a duplicate.
10121 (Block): Removed this indexer for label lookups.
10122 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
10123 this already does the error reporting for us.
10126 (FlowBranching.UsageVector.Block): New public variable; may be null.
10127 (FlowBranching.CreateSibling): Added `Block' argument.
10128 (FlowBranching.LookupLabel): New public virtual method. Lookup a
10129 label for the target of a `goto' and check whether we're not
10130 leaving a `finally'.
10132 2004-04-27 Martin Baulig <martin@ximian.com>
10134 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10135 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
10138 2004-04-27 Martin Baulig <martin@ximian.com>
10140 * statement.cs (Block.AddLabel): Also check for implicit blocks
10141 and added a CS0158 check.
10143 2004-04-27 Martin Baulig <martin@ximian.com>
10145 * flowanalysis.cs (FlowBranchingLoop): New class.
10146 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
10147 UsageVector's instead of an ArrayList.
10148 (FlowBranching.Label): Likewise.
10149 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
10150 (FlowBranching.AddBreakVector): New method.
10152 2004-04-27 Miguel de Icaza <miguel@ximian.com>
10154 * attribute.cs: Small regression fix: only convert the type if we
10155 the type is different, fixes System.Drawing build.
10157 2004-04-27 Martin Baulig <martin@ximian.com>
10159 * attribute.cs (Attribute.Resolve): If we have a constant value
10160 for a named field or property, implicity convert it to the correct
10163 2004-04-27 Raja R Harinath <rharinath@novell.com>
10165 * statement.cs (Block.Block): Implicit blocks share
10166 'child_variable_names' fields with parent blocks.
10167 (Block.AddChildVariableNames): Remove.
10168 (Block.AddVariable): Mark variable as "used by a child block" in
10169 every surrounding block.
10170 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
10171 been used in a child block, complain about violation of "Invariant
10172 meaning in blocks" rule.
10173 * cs-parser.jay (declare_local_variables): Don't use
10174 AddChildVariableNames.
10175 (foreach_statement): Don't create an implicit block: 'foreach'
10176 introduces a scope.
10178 2004-04-23 Miguel de Icaza <miguel@ximian.com>
10180 * convert.cs (ImplicitNumericConversion): 0 is also positive when
10181 converting from 0L to ulong. Fixes 57522.
10183 2004-04-22 Marek Safar <marek.safar@seznam.cz>
10185 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
10186 derived class hides via 'new' keyword field from base class (test-242.cs).
10187 TODO: Handle this in the more general way.
10189 * class.cs (CheckBase): Ditto.
10191 2004-04-22 Marek Safar <marek.safar@seznam.cz>
10193 * decl.cs (caching_flags): New member for storing cached values
10195 (MemberCore.Flags): New enum where bit flags for caching_flags
10197 (MemberCore.cls_compliance): Moved to caching_flags.
10198 (DeclSpace.Created): Moved to caching_flags.
10200 * class.cs: Use caching_flags instead of DeclSpace.Created
10202 2004-04-21 Miguel de Icaza <miguel@ximian.com>
10204 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
10205 if we are only a derived class, not a nested class.
10207 * typemanager.cs: Same as above, but do this at the MemberLookup
10208 level (used by field and methods, properties are handled in
10209 PropertyExpr). Allow for the qualified access if we are a nested
10212 2004-04-21 Marek Safar <marek.safar@seznam.cz>
10214 * class.cs: Refactoring.
10215 (IMethodData): New inteface; Holds links to parent members
10216 to avoid member duplication (reduced memory allocation).
10217 (Method): Implemented IMethodData interface.
10218 (PropertyBase): New inner classes for get/set methods.
10219 (PropertyBase.PropertyMethod): Implemented IMethodData interface
10220 (Event): New inner classes for add/remove methods.
10221 (Event.DelegateMethod): Implemented IMethodData interface.
10223 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
10224 EmitContext (related to class.cs refactoring).
10226 2004-04-21 Raja R Harinath <rharinath@novell.com>
10228 * delegate.cs (Delegate.VerifyApplicability): If the number of
10229 arguments are the same as the number of parameters, first try to
10230 verify applicability ignoring any 'params' modifier on the last
10234 2004-04-08 Martin Baulig <martin@ximian.com>
10236 Merged latest changes into gmcs. Please keep this comment in
10237 here, it makes it easier for me to see what changed in MCS since
10238 the last time I merged.
10240 2004-04-16 Raja R Harinath <rharinath@novell.com>
10242 * class.cs (TypeContainer.AddIndexer): Use
10243 'ExplicitInterfaceName' to determine if interface name was
10244 explicitly specified. 'InterfaceType' is not initialized at this time.
10245 (TypeContainer.DefineIndexers): Remove use of temporary list. The
10246 Indexers array is already in the required order. Initialize
10247 'IndexerName' only if there are normal indexers.
10248 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10249 (TypeContainer.Emit): Emit DefaultMember attribute only if
10250 IndexerName is initialized.
10253 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
10255 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10258 2004-04-15 Raja R Harinath <rharinath@novell.com>
10260 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10264 * attribute.cs (Attribute.Resolve): Check for duplicate named
10268 2004-04-15 Miguel de Icaza <miguel@ximian.com>
10270 * iterators.cs (MarkYield): track whether we are in an exception,
10271 and generate code accordingly. Use a temporary value to store the
10272 result for our state.
10274 I had ignored a bit the interaction of try/catch with iterators
10275 since their behavior was not entirely obvious, but now it is
10276 possible to verify that our behavior is the same as MS .NET 2.0
10280 2004-04-14 Miguel de Icaza <miguel@ximian.com>
10282 * iterators.cs: Avoid creating temporaries if there is no work to
10285 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10286 Enumerations, use TypeManager.EnumToUnderlying and call
10289 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10292 (This.Emit): Use EmitContext.EmitThis to emit our
10295 (This.EmitAssign): Ditto.
10297 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
10298 codepaths, we will move all the functionality into
10301 (FieldExpr.EmitAssign): Ditto.
10303 This fixes several hidden bugs that I uncovered while doing a code
10304 review of this today.
10306 * codegen.cs (EmitThis): reworked so the semantics are more clear
10307 and also support value types "this" instances.
10309 * iterators.cs: Changed so that for iterators in value types, we
10310 do not pass the value type as a parameter.
10312 Initialization of the enumerator helpers is now done in the caller
10313 instead of passing the parameters to the constructors and having
10314 the constructor set the fields.
10316 The fields have now `assembly' visibility instead of private.
10318 2004-04-11 Miguel de Icaza <miguel@ximian.com>
10320 * expression.cs (Argument.Resolve): Check if fields passed as ref
10321 or out are contained in a MarshalByRefObject.
10323 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
10324 another compiler type.
10326 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
10328 * class.cs (Indexer.Define): use the new name checking method.
10329 Also, return false on an error.
10330 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
10331 (is_identifier_[start/part]_character): make static.
10333 2004-04-10 Miguel de Icaza <miguel@ximian.com>
10335 * expression.cs (Binary.ResolveOperator): Do no append strings
10336 twice: since we can be invoked more than once (array evaluation)
10337 on the same concatenation, take care of this here. Based on a fix
10338 from Ben (bug #56454)
10340 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
10342 * codegen.cs: Fix another case where CS1548 must be reported (when
10343 delay-sign isn't specified and no private is available #56564). Fix
10344 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
10345 error when MCS is used on the MS runtime and we need to delay-sign
10346 (which seems unsupported by AssemblyBuilder - see #56621).
10348 2004-04-08 Marek Safar <marek.safar@seznam.cz>
10350 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
10351 (TypeManager.ComputeNamespaces): Faster implementation for
10354 * compiler.csproj: Updated AssemblyName to mcs.
10356 2004-05-11 Jackson Harper <jackson@ximian.com>
10358 * Makefile: Preserve MONO_PATH
10360 2004-05-11 Jackson Harper <jackson@ximian.com>
10362 * Makefile: Use mono and mcs to build gmcs
10364 2004-05-03 Miguel de Icaza <miguel@ximian.com>
10366 * codegen.cs: Add patch from Robert Shade
10367 <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
10370 2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
10372 * CryptoConvert.cs: Updated to latest version. Fix issue with
10373 incomplete key pairs (#57941).
10375 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
10377 * codegen.cs: Fix another case where CS1548 must be reported (when
10378 delay-sign isn't specified and no private is available #56564). Fix
10379 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
10380 error when MCS is used on the MS runtime and we need to delay-sign
10381 (which seems unsupported by AssemblyBuilder - see #56621).
10383 2004-04-29 Jackson Harper <jackson@ximian.com>
10385 * Makefile: Set MONO_PATH to use the bootstrap corlib
10386 * driver.cs: Check the GAC for referenced assemblies.
10388 2004-04-29 Martin Baulig <martin@ximian.com>
10390 * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
10392 2004-04-07 Martin Baulig <martin@ximian.com>
10394 * expression.cs (Binary.ResolveOperator): Added special case for
10395 Equality/Inequality between a type parameter and a null literal.
10397 2004-04-07 Martin Baulig <martin@ximian.com>
10399 * convert.cs: Check null literal -> type parameter conversions.
10401 2004-04-07 Martin Baulig <martin@ximian.com>
10403 * generic.cs (ConstructedType.CheckConstraints): Enforce the
10404 `class' and `struct' constraints.
10406 2004-04-07 Martin Baulig <martin@ximian.com>
10408 * generic.cs (SpecialConstraint): New public enum.
10409 (Constraints.Resolve): Added support for the `class' and `struct'
10412 * cs-parser.jay (type_parameter_constraint): Added support for the
10413 `class' and `struct' constraints.
10415 2004-04-07 Martin Baulig <martin@ximian.com>
10417 * support.cs (GenericConstraints): Replaced `Types' by
10418 `ClassConstraint' and `InterfaceConstraints'; added
10419 `HasClassConstraint'.
10421 2004-04-07 Martin Baulig <martin@ximian.com>
10424 (Constraints.InterfaceConstraints): New public property.
10425 (Constraints.Types): Make this property public
10426 (TypeParameter): Implement IMemberContainer.
10427 (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
10428 instead of a TypeBuilder/MethodBuilder; pass the interface
10429 constraints to TypeManager.AddTypeParameter().
10430 (TypeParameter.DefineType): Just take an EmitContext and no
10431 TypeBuilder/MethodBuilder. Use the new public API.
10433 * typemanager.cs (TypeManager.AddTypeParameter): Added
10434 `TypeExpr[]' argument; add the interfaces to the
10435 `builder_to_ifaces' hash.
10436 (TypeManager.LookupMemberContainer): For
10437 GenericTypeParameterBuilders, get the TypeParameter from the
10438 `builder_to_type_param'.
10439 (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
10440 the TypeParameter and call FindMembers on it.
10442 2004-04-07 Martin Baulig <martin@ximian.com>
10445 (MethodCore.GenericMethod): Moved this field here from Method.
10446 (MethodCore.IsDuplicateImplementation): Take the number of type
10447 parameters into account if we're a generic method.
10449 * expression.cs (Invocation.InferTypeArguments): Don't return true
10450 if `arguments' is null; we still need to check whether we actually
10451 don't need to infer anything in this case.
10452 (MemberAccess): Merged the functionality from GenericMemberAccess
10455 * generic.cs (GenericMemberAccess): Removed.
10457 2004-04-05 Martin Baulig <martin@ximian.com>
10459 * decl.cs (MemberCore): For generic classes, interfaces and
10460 structs, `Name' now includes the number of type parameters
10461 ("Stack!1.Node!1").
10462 (DeclSpace.FindType): Removed the `num_type_args' argument; we now
10463 encode the number of type arguments in the type name.
10465 * expression.cs (Expression.MemberLookup): Removed the
10466 `num_type_args' argument; we now encode the number of type
10467 arguments in the type name.
10469 * ecore.cs (SimpleName): Encode the number of type arguments in
10470 the type name itself.
10472 * generic.cs (ConstructedType): Likewise.
10474 * tree.cs (Tree.RecordDecl): Take a `string' instead of a
10475 `MemberName'; we now include the number of type parameters in the
10478 * typemanager.cs (TypeManager.CheckGeneric): Removed.
10479 (TypeManager.MemberLookup): Removed the
10480 `num_type_args' argument; we now encode the number of type
10481 arguments in the type name.
10483 2004-04-03 Martin Baulig <martin@ximian.com>
10485 * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
10486 (MemberCore.MemberName): Moved here from MemberBase.
10487 (DeclSpace.SetParameterInfo): Just take the constraints as an
10488 ArrayList; we already have the type parameters in our
10489 `MemberName'; also do the CS0080 reporting here.
10491 * cs-parser.jay (struct_declaration): Use `member_name' instead of
10492 `IDENTIFIER opt_type_parameter_list'; when constructing our
10493 `MemberName', it'll already include our type parameters.
10494 (class_declaration, interface_declaration): Likewise.
10495 (delegate_declaration): Likewise.
10496 (MakeName): Take a MemberName and return a MemberName.
10497 The following two changes are required to avoid shift/reduce conflicts:
10498 (member_name): Don't include a TypeName anymore; ie. this is now
10499 just 'IDENTIFIER opt_type_parameter_list'.
10500 (property_declaration, event_declaration): Use a
10501 `namespace_or_type_name' instead of a `member_name'.
10503 2004-04-03 Martin Baulig <martin@ximian.com>
10505 * decl.cs (MemberName): Renamed to `TypeName' and created a new
10506 `MemberName' class.
10507 (TypeName): Formerly known as MemberName.
10509 * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
10510 instead of a `MemberName'.
10512 * cs-parser.jay (namespace_or_type_name): Create a TypeName.
10513 (member_name): New rule; create a MemberName.
10515 2004-04-02 Martin Baulig <martin@ximian.com>
10517 * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
10518 (CS0305 and CS0308).
10520 2004-04-02 Martin Baulig <martin@ximian.com>
10522 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
10523 support for nested types.
10525 2004-04-02 Martin Baulig <martin@ximian.com>
10527 * ecore.cs (IAlias): New public interface.
10528 (TypeExpr, TypeExpression): Implement IAlias.
10529 (TypeAliasExpression): New public class.
10531 * namespace.cs (Namespace): Implement IAlias.
10532 (Namespace.Lookup): Return an IAlias instead on an object.
10533 (Namespace.DefineName): Take an IAlias instead of an object.
10534 (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
10536 (NamespaceEntry.UsingAlias): Take a Membername instead of an
10538 (NamespaceEntry.LookupAlias): Return an IAlias instead on an
10540 (NamespaceEntry.Lookup): Likewise.
10542 * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
10545 * decl.cs (DeclSpace): Implement IAlias.
10546 (DeclSpace.LookupAlias): Return an IAlias instead of a string.
10548 * generic.cs (ConstructedType): Improved error checking.
10550 2004-04-02 Martin Baulig <martin@ximian.com>
10552 * convert.cs: Added type parameter conversions.
10555 (UnboxCast.Emit): Emit an `unbox.any' for type params.
10556 (ClassCast.Emit): If the source type is a type parameter, box it.
10557 If the target type is a type parameter, emit an `unbox.any'
10558 instead of a `classcast'.1
10560 2004-04-01 Martin Baulig <martin@ximian.com>
10562 * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
10564 2004-04-01 Martin Baulig <martin@ximian.com>
10566 * generic.cs (ConstructedType.CheckConstraints): Use
10567 Convert.ImplicitStandardConversionExists(); user-defined implicit
10568 conversions are not allowed according to the spec.
10570 2004-03-30 Martin Baulig <martin@ximian.com>
10572 * expression.cs (New): Added support for type parameters.
10575 (TypeManager.activator_type): New public static field.
10576 (TypeManager.activator_create_instance): Likewise.
10578 2004-03-30 Martin Baulig <martin@ximian.com>
10580 * typemanager.cs (TypeManager.HasConstructorConstraint): New
10583 2004-03-30 Martin Baulig <martin@ximian.com>
10585 * generic.cs (ConstructedType.CheckConstraints): Actually follow
10586 the spec here: the argument type must be convertible to the
10589 2004-03-30 Martin Baulig <martin@ximian.com>
10592 (TypeParameter.Define, TypeParameter.DefineMethod): Call
10593 TypeManager.AddTypeParameter().
10594 (ConstructedType.CheckConstraints): Re-enable this and actually
10595 check whether we have a constructor constraint.
10598 (TypeManager.builder_to_type_param): New static field.
10599 (TypeManager.AddTypeParameter): New static method.
10600 (TypeManager.LookupTypeParameter): New public method.
10602 2004-03-30 Martin Baulig <martin@ximian.com>
10604 * generic.cs (TypeParameter.DefineType): Return a boolean and use
10605 the new API to actually define the constructor constraint.
10608 (TypeManager.new_constraint_attr_type): New static field.
10609 (TypeManager.InitCoreTypes): Initialize it.
10611 2004-03-30 Martin Baulig <martin@ximian.com>
10613 * generic.cs (Constraints): Completed error checking, use correct
10616 2004-03-29 Martin Baulig <martin@ximian.com>
10618 * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
10620 * expression.cs (Invocation.InferTypeArguments): Added overloaded
10621 public version which takes a `ParameterData pd' instead of an
10624 2004-03-29 Martin Baulig <martin@ximian.com>
10626 * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
10629 2004-03-29 Martin Baulig <martin@ximian.com>
10631 * expression.cs (Argument.ResolveMethodGroup): If we're a
10632 ConstructedType, call GetMemberAccess() on it.
10634 2004-03-29 Martin Baulig <martin@ximian.com>
10636 * class.cs (MethodBase.CheckGenericOverride): New abstract method.
10637 (MethodCore.CheckGenericOverride): When overriding a generic
10638 method, check whether the constraints match.
10640 * support.cs (GenericConstraints): New public interface.
10641 (ParameterData.GenericConstraints): New public method.
10643 * parameter.cs (Parameter.Resolve): Check whether we're a generic
10644 method parameter and compute our constraints if appropriate.
10645 (Parameter.GenericConstraints): New public property.
10647 * generic.cs (Constraints): Implement GenericConstraints.
10649 2004-03-29 Martin Baulig <martin@ximian.com>
10651 * decl.cs (MemberCache.FindMemberToOverride): Use
10652 `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
10654 2004-03-29 Martin Baulig <martin@ximian.com>
10656 * generic.cs (GenericMethod.Define): Resolve our type parameters.
10658 2004-03-29 Martin Baulig <martin@ximian.com>
10660 * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
10661 not allowed on non-generic declarations").
10663 2004-03-29 Martin Baulig <martin@ximian.com>
10665 * expression.cs (Invocation.InferTypeArguments): Added overloaded
10666 public version of this method.
10668 * class.cs (MethodCore.IsDuplicateImplementation): Use
10669 Invocation.InferTypeArguments() to check this.
10671 2004-03-29 Martin Baulig <martin@ximian.com>
10673 * convert.cs: Use TypeManager.IsDelegateType() instead of
10674 comparing types correctly.
10676 2004-03-29 Martin Baulig <martin@ximian.com>
10678 * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
10679 types directly to make it work for generic instances.
10681 * typemanager.cs (TypeManager.IsSubclassOf): New static method.
10683 2004-03-29 Martin Baulig <martin@ximian.com>
10685 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
10686 support for arrays.
10688 2004-03-24 Martin Baulig <martin@ximian.com>
10690 * decl.cs (DeclSpace.FindType): Also use
10691 TypeManager.CheckGeneric() for types from the using clauses.
10693 2004-03-23 Martin Baulig <martin@ximian.com>
10695 * expression.cs (Invocation.OverloadResolve): Added `bool
10696 may_fail' argument and use it instead of the Location.IsNull() hack.
10698 2004-03-23 Martin Baulig <martin@ximian.com>
10700 * expression.cs (Invocation.InferType): Use correct type inference
10703 2004-03-23 Martin Baulig <martin@ximian.com>
10705 * ecore.cs (MethodGroupExpr.Name): Use
10706 TypeManager.CSharpSignature() instead of just the name.
10708 * expression.cs (Invocation.OverloadResolve): Provide better error
10710 (Invocation.DoResolve): OverloadResolve() never returns null
10711 without reporting an error, so removed the error -6 reporting here.
10713 2004-03-23 Martin Baulig <martin@ximian.com>
10715 * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
10718 * cs-parser.jay (delegate_declaration): Support generic delegates.
10720 * delegate.cs: Support generic delegates.
10722 2004-03-22 Martin Baulig <martin@ximian.com>
10724 * expression.cs (Invocation.InferParamsTypeArguments): New static
10725 method; does type inference for params arguments.
10727 2004-03-21 Martin Baulig <martin@ximian.com>
10729 * typemanager.cs (TypeManager.IsGenericMethod): New public static
10730 method; checks whether a method is a generic method.
10732 * expression.cs (Invocation.InferTypeArguments): New static method;
10733 infer type arguments for generic method invocation.
10735 * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
10736 property; we set this to true if we're resolving a generic method
10737 invocation and the user specified type arguments, ie. we're not
10738 doing type inference.
10740 2004-03-20 Martin Baulig <martin@ximian.com>
10742 * class.cs (MethodData.DeclaringType): New public property.
10743 (MethodData.Define): Set DeclaringType here.
10744 (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
10745 instead of OperatorMethodBuilder.DeclaringType.
10747 2004-03-20 Martin Baulig <martin@ximian.com>
10749 * cs-tokenizer.cs (xtoken): Return a special
10750 Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
10752 * cs-parser.jay (default_value_expression): Switch to the new
10755 2004-03-19 Martin Baulig <martin@ximian.com>
10757 * decl.cs (MemberName): New class. We use this to "construct"
10758 namespace_or_type_name's.
10760 * generics.cs (TypeArguments.GetDeclarations): New public method;
10761 returns the type arguments as a string[] and reports a CS0081 if
10762 one of them is not an identifier.
10764 * class.cs (MemberBase): The .ctor now takes the name as a
10765 MemberName instead of a string.
10766 (MemberBase.ExplicitInterfaceName): Changed type from string to
10768 (MemberBase.DoDefine): If we're an explicit implementation, the
10769 InterfaceType may be a generic instance.
10771 * cs-parser.jay (namespace_or_type_name): Return a MemberName.
10772 (namespace_name): Call MemberName.GetName () to transform the
10773 MemberName into a string and ensure we don't have any type
10775 (type_name): Call MemberName.GetTypeExpression() to transfrom the
10776 MemberName into an expression.
10777 (method_header): Use namespace_or_type_name instead of member_name.
10779 2004-04-07 Miguel de Icaza <miguel@ximian.com>
10781 * rootcontext.cs: Add new types to the boot resolution.
10783 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10784 MulticastDelegate is not allowed.
10786 * typemanager.cs: Add new types to lookup: System.TypedReference
10789 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10790 check for TypedReference or ArgIterator, they are not allowed.
10792 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10793 makes us properly catch 1510 in some conditions (see bug 56016 for
10796 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
10798 * CryptoConvert.cs: update from corlib version
10801 2004-04-05 Miguel de Icaza <miguel@ximian.com>
10803 * class.cs (Indexer.Define): Check indexername declaration
10805 2004-04-05 Marek Safar <marek.safar@seznam.cz>
10807 * attribute.cs (IsClsCompliant): Fixed problem with handling
10808 all three states (compliant, not-compliant, undetected).
10810 2004-03-30 Marek Safar <marek.safar@seznam.cz>
10812 * attribute.cs (Attribute): Location is now public.
10813 (Resolve): Store resolved arguments (pos_values) in attribute class.
10814 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10815 (GetClsCompliantAttributeValue): New method that gets
10816 CLSCompliantAttribute value.
10817 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10818 if exists else null.
10819 (AttributeTester): New class for CLS-Compliant verification routines.
10821 * class.cs (Emit): Add CLS-Compliant verification.
10822 (Method.GetSignatureForError): Implemented.
10823 (Constructor.GetSignatureForError): Implemented
10824 (Constructor.HasCompliantArgs): Returns if constructor has
10825 CLS-Compliant arguments.
10826 (Constructor.Emit): Override.
10827 (Construcor.IsIdentifierClsCompliant): New method; For constructors
10828 is needed to test only parameters.
10829 (FieldBase.GetSignatureForError): Implemented.
10830 (TypeContainer): New member for storing base interfaces.
10831 (TypeContainer.FindMembers): Search in base interfaces too.
10833 * codegen.cs (GetClsComplianceAttribute): New method that gets
10834 assembly or module CLSCompliantAttribute value.
10835 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10837 (ModuleClass.Emit): Add error 3012 test.
10839 * const.cs (Emit): Override and call base for CLS-Compliant tests.
10841 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10842 state for all decl types.
10843 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10844 if CLS-Compliant tests are required.
10845 (IsClsCompliaceRequired): New method. Analyze whether code
10846 must be CLS-Compliant.
10847 (IsExposedFromAssembly): New method. Returns true when MemberCore
10848 is exposed from assembly.
10849 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10850 value or gets cached value.
10851 (HasClsCompliantAttribute): New method. Returns true if MemberCore
10852 is explicitly marked with CLSCompliantAttribute.
10853 (IsIdentifierClsCompliant): New abstract method. This method is
10854 used to testing error 3005.
10855 (IsIdentifierAndParamClsCompliant): New method. Common helper method
10856 for identifier and parameters CLS-Compliant testing.
10857 (VerifyClsCompliance): New method. The main virtual method for
10858 CLS-Compliant verifications.
10859 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10860 null. I don't know why is null (too many public members !).
10861 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10862 and get value of first CLSCompliantAttribute that found.
10864 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10865 (VerifyClsCompliance): Override and add extra tests.
10867 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10868 clscheck- disable CLS-Compliant verification event if assembly is has
10869 CLSCompliantAttribute(true).
10871 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10872 ApllyAttribute is now called in emit section as in the other cases.
10873 Possible future Emit integration.
10874 (IsIdentifierClsCompliant): New override.
10875 (VerifyClsCompliance): New override.
10876 (GetEnumeratorName): Returns full enum name.
10878 * parameter.cs (GetSignatureForError): Implemented.
10880 * report.cs (WarningData): New struct for Warning message information.
10881 (LocationOfPreviousError): New method.
10882 (Warning): New method. Reports warning based on the warning table.
10883 (Error_T): New method. Reports error based on the error table.
10885 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10886 verifications are done here.
10888 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10890 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10891 CLSCompliantAttribute.
10892 (all_imported_types): New member holds all imported types from other
10894 (LoadAllImportedTypes): New method fills static table with exported types
10895 from all referenced assemblies.
10896 (Modules): New property returns all assembly modules.
10898 2004-03-30 Miguel de Icaza <miguel@ximian.com>
10900 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10901 throwing a parser error.
10903 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10904 which removes the hardcoded get_/set_ prefixes for properties, as
10905 IL allows for the properties to be named something else.
10909 * expression.cs: Do not override operand before we know if it is
10910 non-null. Fix 56207
10912 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10914 * typemanager.cs: support for pinned variables.
10916 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10918 * decl.cs, typemanager.cs: Avoid using an arraylist
10919 as a buffer if there is only one result set.
10921 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
10923 * expression.cs: Make sure you cant call a static method
10924 with an instance expression, bug #56174.
10926 2004-03-29 Miguel de Icaza <miguel@ximian.com>
10928 * class.cs (IsDuplicateImplementation): Improve error reporting to
10929 flag 663 (method only differs in parameter modifier).
10931 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10932 in preprocessor directives.
10934 * location.cs (LookupFile): Allow for the empty path.
10936 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
10937 better approach for some of that patch, but its failing with the
10938 CharSet enumeration. For now try/catch will do.
10940 * typemanager.cs: Do not crash if a struct does not have fields.
10943 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10945 * expression.cs: cs0213, cant fix a fixed expression.
10948 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10950 * cs-parser.jay: detect invalid embeded statements gracefully.
10953 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
10955 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10958 the invocation type may not be a subclass of the tye of the item/
10959 The type of the item must be a subclass of the invocation item.
10964 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
10966 * attribute.cs: Added methods to get a string and a bool from an
10967 attribute. Required to information from AssemblyKeyFileAttribute,
10968 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10969 * codegen.cs: Modified AssemblyName creation to include support for
10970 strongnames. Catch additional exceptions to report them as CS1548.
10971 * compiler.csproj: Updated include CryptoConvert.cs.
10972 * compiler.csproj.user: Removed file - user specific configuration.
10973 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
10974 Mono.Security assembly. The original class is maintained and tested in
10975 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10976 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10977 like CSC 8.0 (C# v2) supports.
10978 * Makefile: Added CryptoConvert.cs to mcs sources.
10979 * rootcontext.cs: Added new options for strongnames.
10981 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
10983 * driver.cs: For --expect-error, report error code `2'
10984 if the program compiled with no errors, error code `1' if
10985 it compiled with an error other than the one expected.
10987 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
10989 * compiler.csproj: Updated for Visual Studio .NET 2003.
10990 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10991 * compiler.sln: Updated for Visual Studio .NET 2003.
10993 2004-03-24 Ravi Pratap M <ravi@ximian.com>
10995 * expression.cs: Fix bug #47234. We basically need to apply the
10996 rule that we prefer the conversion of null to a reference type
10997 when faced with a conversion to 'object' (csc behaviour).
10999 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11001 * statement.cs: Shorter form for foreach, eliminates
11002 a local variable. r=Martin.
11004 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11006 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
11007 checks if we can use brtrue/brfalse to test for 0.
11008 * expression.cs: use the above in the test for using brtrue/brfalse.
11009 cleanup code a bit.
11011 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11013 * expression.cs: Rewrite string concat stuff. Benefits:
11015 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
11016 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
11017 rather than a concat chain.
11019 * typemanager.cs: Add lookups for more concat overloads.
11021 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11023 * expression.cs: Emit shorter il code for array init.
11040 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
11042 * statement.cs: Before, two switch blocks would be merged if the
11043 total size of the blocks (end_item - begin_item + 1) was less than
11044 two times the combined sizes of the blocks.
11046 Now, it will only merge if after the merge at least half of the
11051 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
11053 * class.cs : csc build fix for GetMethods(). See bug #52503.
11055 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
11057 * expression.cs: Make sure fp comparisons work with NaN.
11058 This fixes bug #54303. Mig approved this patch a long
11059 time ago, but we were not able to test b/c the runtime
11062 2004-03-19 Miguel de Icaza <miguel@ximian.com>
11064 * ecore.cs (TypExpr.GetHashCode): implement this overload.
11066 2004-03-19 Martin Baulig <martin@ximian.com>
11068 * class.cs (MemberCore.IsDuplicateImplementation): Check whether
11069 two overloads may unify for some type parameter substitutions and
11070 report a CS0408 if appropriate.
11072 2004-03-19 Martin Baulig <martin@ximian.com>
11074 * class.cs (MemberCore.IsDuplicateImplementation): Report the
11075 error here and not in our caller.
11077 2004-03-19 Martin Baulig <martin@ximian.com>
11079 * interface.cs: Completely killed this file.
11080 (Interface): We're now a TypeContainer and live in class.cs.
11082 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
11083 argument; we're now also called for interfaces.
11084 (TypeContainer.DefineMembers): Allow this method being called
11086 (TypeContainer.GetMethods): New public method; formerly known as
11087 Interface.GetMethod(). This is used by PendingImplementation.
11088 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
11089 it's now private and non-static.
11090 (Interface): Moved this here; it's now implemented similar to
11092 (Method, Property, Event, Indexer): Added `bool is_interface'
11093 argument to their .ctor's.
11094 (MemberBase.IsInterface): New public field.
11096 * cs-parser.jay: Create normal Method, Property, Event, Indexer
11097 instances instead of InterfaceMethod, InterfaceProperty, etc.
11098 (opt_interface_base): Removed; we now use `opt_class_base' instead.
11099 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
11101 2004-03-19 Martin Baulig <martin@ximian.com>
11103 * class.cs (MethodCore.IsDuplicateImplementation): New private
11104 method which does the CS0111 checking.
11105 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
11106 Use IsDuplicateImplementation().
11108 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
11110 * decl.cs (FindMemberToOverride): New method to find the correct
11111 method or property to override in the base class.
11113 - Make Method/Property use the above method to find the
11114 version in the base class.
11115 - Remove the InheritableMemberSignatureCompare as it is now
11118 This patch makes large code bases much faster to compile, as it is
11119 O(n) rather than O(n^2) to do this validation.
11121 Also, it fixes bug 52458 which is that nested classes are not
11122 taken into account when finding the base class member.
11124 Reviewed/Approved by Martin.
11126 2004-03-17 Martin Baulig <martin@ximian.com>
11128 * expression.cs (MemberAccess.DoResolve): Take the parent's number
11129 of type arguments into account; use the `real_num_type_args'
11130 approach like in DoResolveAsTypeStep().
11132 * generic.cs (GenericMemberAccess.DoResolve): Make this work for
11135 2004-03-17 Marek Safar <marek.safar@seznam.cz>
11137 * interface.cs: In all interface classes removed redundant
11138 member initialization.
11140 2004-03-16 Martin Baulig <martin@ximian.com>
11142 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11144 2004-03-15 Miguel de Icaza <miguel@ximian.com>
11146 * decl.cs (DefineTypeAndParents): New helper method to define a
11147 type's containers before the type itself is defined; This is a
11148 bug exposed by the recent changes to Windows.Forms when an
11149 implemented interface was defined inside a class that had not been
11152 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
11154 (Check): Loop correctly to report errors modifiers
11155 (UNSAFE was not in the loop, since it was the same as TOP).
11157 * interface.cs: Every interface member now takes a ModFlags,
11158 instead of a "is_new" bool, which we set on the base MemberCore.
11160 Every place where we called "UnsafeOk" in the interface, now we
11161 call the proper member (InterfaceMethod.UnsafeOK) instead to get
11162 the unsafe settings from the member declaration instead of the
11163 container interface.
11165 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
11167 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11168 `set_indexer_name' to the pending bits (one per type).
11170 We fixed a bug today that was picking the wrong method to
11171 override, since for properties the existing InterfaceMethod code
11172 basically ignored the method name. Now we make sure that the
11173 method name is one of the valid indexer names.
11175 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
11177 * support.cs (SeekableStreamReader): Keep track of stream byte
11178 positions and don't mix them with character offsets to the buffer.
11180 Patch from Gustavo Giráldez
11182 2004-03-15 Marek Safar <marek.safar@seznam.cz>
11184 * interface.cs (InterfaceSetGetBase): Removed double member
11185 initialization, base class does it as well.
11187 2004-03-13 Martin Baulig <martin@ximian.com>
11189 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
11190 when compiling corlib.
11192 2004-03-13 Miguel de Icaza <miguel@ximian.com>
11194 * convert.cs (ExplicitConversion): We were reporting an error on
11195 certain conversions (object_type source to a value type, when the
11196 expression was `null') before we had a chance to pass it through
11197 the user defined conversions.
11199 * driver.cs: Replace / and \ in resource specifications to dots.
11202 * class.cs: Add check for duplicate operators. Fixes 52477
11204 2004-03-11 Miguel de Icaza <miguel@ximian.com>
11206 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
11207 that are in the middle of the statements, not only at the end.
11210 * class.cs (TypeContainer.AddField): No longer set the
11211 `HaveStaticConstructor' flag, now we call it
11212 `UserDefineStaticConstructor' to diferentiate the slightly
11213 semantic difference.
11215 The situation is that we were not adding BeforeFieldInit (from
11216 Modifiers.TypeAttr) to classes that could have it.
11217 BeforeFieldInit should be set to classes that have no static
11222 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
11224 And most importantly Zoltan's comment:
11226 http://bugzilla.ximian.com/show_bug.cgi?id=44229
11228 "I think beforefieldinit means 'it's ok to initialize the type sometime
11229 before its static fields are used', i.e. initialization does not need
11230 to be triggered by the first access to the type. Setting this flag
11231 helps the JIT to compile better code, since it can run the static
11232 constructor at JIT time, and does not need to generate code to call it
11233 (possibly lots of times) at runtime. Unfortunately, mcs does not set
11234 this flag for lots of classes like String.
11236 csc sets this flag if the type does not have an explicit static
11237 constructor. The reasoning seems to be that if there are only static
11238 initalizers for a type, and no static constructor, then the programmer
11239 does not care when this initialization happens, so beforefieldinit
11242 This bug prevents the AOT compiler from being usable, since it
11243 generates so many calls to mono_runtime_class_init that the AOT code
11244 is much slower than the JITted code. The JITted code is faster,
11245 because it does not generate these calls if the vtable is type is
11246 already initialized, which is true in the majority of cases. But the
11247 AOT compiler can't do this."
11249 2004-03-10 Miguel de Icaza <miguel@ximian.com>
11251 * class.cs (MethodData.Emit): Refactor the code so symbolic
11252 information is generated for destructors; For some reasons we
11253 were taking a code path that did not generate symbolic information
11256 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
11258 * class.cs: Create a Constructor.CheckBase method that
11259 takes care of all validation type code. The method
11260 contains some code that was moved from Define.
11262 It also includes new code that checks for duplicate ctors.
11263 This fixes bug #55148.
11265 2004-03-09 Joshua Tauberer <tauberer@for.net>
11267 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
11268 a { ... }-style array creation invokes EmitStaticInitializers
11269 which is not good for reference-type arrays. String, decimal
11270 and now null constants (NullCast) are not counted toward
11271 static initializers.
11273 2004-03-05 Martin Baulig <martin@ximian.com>
11275 * location.cs (SourceFile.HasLineDirective): New public field;
11276 specifies whether the file contains or is referenced by a "#line"
11278 (Location.DefineSymbolDocuments): Ignore source files which
11279 either contain or are referenced by a "#line" directive.
11281 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
11283 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
11284 direct access to our parent, so check the method inline there.
11286 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
11288 * expression.cs (Invocation.EmitCall): Miguel's last commit
11289 caused a regression. If you had:
11294 In Foo the implict this would be null.
11296 2004-02-27 Miguel de Icaza <miguel@ximian.com>
11298 * expression.cs (Invocation.EmitCall): If the method is not
11299 virtual, do not emit a CallVirt to it, use Call.
11301 * typemanager.cs (GetFullNameSignature): Improve the method to
11302 cope with ".ctor" and replace it with the type name.
11304 * class.cs (ConstructorInitializer.Resolve): Now the method takes
11305 as an argument the ConstructorBuilder where it is being defined,
11306 to catch the recursive constructor invocations.
11308 2004-03-16 Martin Baulig <martin@ximian.com>
11310 * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
11311 ConstructedType, call ResolveType() on it to get the type rather
11312 than just using `expr.Type'.
11314 2004-03-16 Martin Baulig <martin@ximian.com>
11316 * generics.cs (ConstructedType.GetMemberAccess): Take the
11317 EmitContext instead on the TypeExpr and use
11318 ec.TypeContainer.CurrentType/ec.ContainerType.
11320 2004-03-16 Martin Baulig <martin@ximian.com>
11322 * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
11323 parameters before aliases.
11325 2004-03-16 Martin Baulig <martin@ximian.com>
11327 * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
11328 New oublic function; checks whether two generic instances may become
11329 equal under some instantiations (26.3.1).
11331 * class.cs (TypeContainer.Define): Call
11332 TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
11335 2004-03-16 Martin Baulig <martin@ximian.com>
11337 * class.cs (TypeContainer.GetClassBases): Moved
11338 Error_TypeParameterAsBase() here and also check whether the base
11339 class is not an attribute.
11341 2004-03-16 Martin Baulig <martin@ximian.com>
11343 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11345 2004-03-16 Martin Baulig <martin@ximian.com>
11347 * class.cs (Error_TypeParameterAsBase): Use correct error number
11350 2004-03-16 Martin Baulig <martin@ximian.com>
11352 * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
11355 * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
11358 2004-03-15 Martin Baulig <martin@ximian.com>
11360 * typemanager.cs (TypeManager.GetFullName): New public method.
11361 (TypeManager.MemberLookup): Added `int_num_type_arguments'
11362 argument; only return members with the correct number of type
11364 (TypeManager.CheckGeneric): Allow -1 to bypass the check.
11365 (TypeManager.FilterWithClosure): Call CheckGeneric() to check
11366 whether the number of type arguments matches.
11368 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
11369 not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
11371 * expression.cs (MemberAccess): Added public `NumTypeArguments'
11372 field; it's set by the protected .ctor when we're actually a
11373 GenericMemberAccess.
11374 (MemberAccess.ResolveAsTypeStep): Compute the total number of type
11375 arguments and pass it to MemberLookupFinal ().
11377 * ecore.cs (Expression.MemberLookup): Added `int
11378 num_type_arguments' argument; only return members with the correct
11379 number of type arguments.
11380 (Expression.MemberLookupFailed): Check whether the MemberLookup
11381 failed because we did not have the correct number of type
11382 arguments; report CS0305 in this case.
11384 * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
11385 `e.ResolveAsTypeTerminal()' already did so.
11387 2004-03-15 Martin Baulig <martin@ximian.com>
11389 * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
11390 we're a ConstructedType; in this case, the caller must report an
11391 error (for instance CS0131).
11393 * generic.cs (TypeArguments): Added Location argument to the .ctor.
11394 (TypeArguments.Resolve): Actually report errors here.
11396 2004-03-15 Miguel de Icaza <miguel@ximian.com>
11398 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11399 `set_indexer_name' to the pending bits (one per type).
11401 We fixed a bug today that was picking the wrong method to
11402 override, since for properties the existing InterfaceMethod code
11403 basically ignored the method name. Now we make sure that the
11404 method name is one of the valid indexer names.
11406 2004-03-15 Martin Baulig <martin@ximian.com>
11408 * typemanager.cs (TypeManager.IndexerPropertyName): Added support
11409 for generic instances.
11411 2004-03-13 Martin Baulig <martin@ximian.com>
11413 * class.cs (TypeContainer.DefineType): Call
11414 TypeManager.AddUserType() immediately after creating the
11415 TypeBuilder; pass all type parameters when creating the
11418 * decl.cs (DeclSpace.FindNestedType): New public method.
11419 (DeclSpace.FindType): Added `int num_type_args' argument; only
11420 return types with the correct number of type parameters.
11421 (DeclSpace.CountTypeParams): New public property.
11423 * ecore.cs (SimpleName.ctor): Added overloaded version which takes
11424 the number of type parameters; defaults to zero.
11426 * generic.cs (TypeArguments.Count): New public property.
11427 (ConstructedType.DoResolveAsTypeStep): First call
11428 ds.FindNestedType() to find out whether we're nested in the
11429 current generic type; in this case, we inherit all type parameters
11430 from the current class.
11432 * rootcontext.cs (RootContext.NamespaceLookup): Added `int
11433 num_type_args' argument.
11434 (RootContext.LookupType): Added overloaded version which takes the
11435 number of type arguments; only return types with the correct
11436 number of type arguments.
11438 * typemanager.cs (TypeManager.CheckGeneric): New public function;
11439 checks whether `Type t' has `int num_type_args'.
11441 2004-03-13 Martin Baulig <martin@ximian.com>
11443 * generic.cs (GenericMethod.DefineType): New method; calls
11444 DefineType() on all the type parameters.
11446 * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
11447 (MethodData.Define): If we're a generic method, call
11448 GenericMethod.DefineType() to define the type parameters.
11450 2004-03-10 Martin Baulig <martin@ximian.com>
11452 * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
11453 instead of IsAssignableFrom.
11455 2004-03-10 Martin Baulig <martin@ximian.com>
11457 * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
11459 * support.cs (ParameterData.HasArrayParameter): New property.
11460 (ReflectionParameters.ctor): Take a MethodBase instead of a
11461 ParameterInfo[]. If we have any type parameters, get the generic
11462 method definition and ask it whether we have variable arguments.
11464 2004-02-26 Miguel de Icaza <miguel@ximian.com>
11466 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11467 routines to check if a type is an enumerable/enumerator allow
11468 classes that implement the IEnumerable or IEnumerator interfaces.
11470 * class.cs (Property, Operator): Implement IIteratorContainer, and
11471 implement SetYields.
11473 (Property.Define): Do the block swapping for get_methods in the
11474 context of iterators. We need to check if Properties also
11475 include indexers or not.
11477 (Operator): Assign the Block before invoking the
11478 OperatorMethod.Define, so we can trigger the Iterator code
11481 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
11482 Property and Operator classes are not created when we parse the
11483 declarator but until we have the block completed, so we use a
11484 singleton SimpleIteratorContainer.Simple to flag whether the
11485 SetYields has been invoked.
11487 We propagate this setting then to the Property or the Operator to
11488 allow the `yield' to function.
11490 2004-02-25 Marek Safar <marek.safar@seznam.cz>
11492 * codegen.cs: Implemented attribute support for modules.
11493 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11494 Assembly/Module functionality.
11496 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11497 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11498 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11500 2004-02-16 Marek Safar <marek.safar@seznam.cz>
11502 * interface.cs (FindMembers): The operation is performed on all base
11503 interfaces and not only on the first. It is required for future CLS Compliance patch.
11505 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
11507 * statement.cs, codegen.cs:
11508 This patch deals with patterns such as:
11510 public class List : IEnumerable {
11512 public MyEnumerator GetEnumerator () {
11513 return new MyEnumerator(this);
11516 IEnumerator IEnumerable.GetEnumerator () {
11520 public struct MyEnumerator : IEnumerator {
11525 Before, there were a few things we did wrong:
11526 1) we would emit callvirt on a struct, which is illegal
11527 2) we emited ldarg when we needed to emit ldarga
11528 3) we would mistakenly call the interface methods on an enumerator
11529 type that derived from IEnumerator and was in another assembly. For example:
11531 public class MyEnumerator : IEnumerator
11533 Would have the interface methods called, even if there were public impls of the
11534 method. In a struct, this lead to invalid IL code.
11536 2004-02-11 Marek Safar <marek.safar@seznam.cz>
11538 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11541 * delegate.cs (Define): Fixed crash when delegate type is undefined.
11543 2004-02-11 Miguel de Icaza <miguel@ximian.com>
11545 * cs-parser.jay: Fix small regression: we were not testing V2
11546 compiler features correctly.
11548 * interface.cs: If the emit context is null, then create one
11550 2004-02-09 Marek Safar <marek.safar@seznam.cz>
11552 * decl.cs (GetSignatureForError): New virtual method to get full name
11553 for error messages.
11555 * attribute.cs (IAttributeSupport): New interface for attribute setting.
11556 Now it is possible to rewrite ApplyAttributes method to be less if/else.
11558 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11559 Duplicated members and code in these classes has been removed.
11560 Better encapsulation in these classes.
11562 2004-02-07 Miguel de Icaza <miguel@ximian.com>
11564 * assign.cs (Assign.DoResolve): When dealing with compound
11565 assignments, there is a new rule in ECMA C# 2.4 (might have been
11566 there before, but it is documented here) that states that in:
11570 If b is of type int, and the `op' is a shift-operator, then the
11571 above is evaluated as:
11575 * expression.cs (Binary.ResolveOperator): Instead of testing for
11576 int/uint/long/ulong, try to implicitly convert to any of those
11577 types and use that in pointer arithmetic.
11579 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11580 method to print information for from the type, not from the
11581 null-method we were given.
11583 2004-02-01 Duncan Mak <duncan@ximian.com>
11585 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11586 parsing for cmd, fixes bug #53694.
11588 2004-02-04 Marek Safar <marek.safar@seznam.cz>
11590 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11591 in the member name duplication tests. Property and operator name duplication
11592 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11594 2004-02-03 Marek Safar <marek.safar@seznam.cz>
11596 * interface.cs (PopulateMethod): Fixed crash when interface method
11597 returns not existing type (error test cs0246-3.cs).
11599 2004-02-02 Ravi Pratap M <ravi@ximian.com>
11601 * cs-parser.jay (interface_accessors): Re-write actions to also
11602 store attributes attached to get and set methods. Fix spelling
11605 (inteface_property_declaration): Modify accordingly.
11607 (InterfaceAccessorInfo): New helper class to store information to pass
11608 around between rules that use interface_accessors.
11610 * interface.cs (Emit): Apply attributes on the get and set
11611 accessors of properties and indexers too.
11613 * attribute.cs (ApplyAttributes): Modify accordingly to use the
11614 right MethodBuilder when applying attributes to the get and set accessors.
11616 2004-01-31 Miguel de Icaza <miguel@ximian.com>
11618 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11620 2004-01-26 Miguel de Icaza <miguel@ximian.com>
11622 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11624 2004-01-25 Miguel de Icaza <miguel@ximian.com>
11626 * cs-parser.jay: Remove YIELD token, instead use the new grammar
11627 changes that treat `yield' specially when present before `break'
11628 or `return' tokens.
11630 * cs-tokenizer.cs: yield is no longer a keyword.
11632 2004-01-23 Marek Safar <marek.safar@seznam.cz>
11634 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11635 setting for default constructors.
11636 For default constructors are almost every time set wrong Modifier. The
11637 generated IL code has been alright. But inside mcs this values was
11638 wrong and this was reason why several of my CLS Compliance tests
11641 2004-02-27 Martin Baulig <martin@ximian.com>
11643 * generics.cs (ConstructedType.ResolveType): Make the nested type
11644 stuff actually work.
11646 2004-02-25 Martin Baulig <martin@ximian.com>
11648 * decl.cs (DeclSpace.CurrentTypeParameters): New protected
11649 property; returns the type parameters just from the current type,
11650 ie. with the ones from outer classes.
11651 (DeclSpace.LookupGeneric): First search in the current class, then
11653 (DeclSpace.initialize_type_params): When hiding a type parameter
11654 from an outer class, put it into the `type_param_list' anyways.
11656 * expression.cs (MemberAccess.expr): Made this field protected.
11658 * class.cs (TypeContainer.Define): The `CurrentType' just contains
11659 the type parameters from the current class.
11661 * generic.cs (ConstructedType.ResolveType): Support nested generic
11662 types by taking the type parameters which we inherit from outer
11663 classes into account.
11664 (GenericMemberAccess.ResolveAsTypeStep): Override this and added
11665 support for nested generic types.
11667 2004-02-23 Martin Baulig <martin@ximian.com>
11669 * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
11670 field and check whether we're nested inside a generic type.
11671 (DeclSpace.ResolveType): If we're resolving to a generic type
11672 definition, create a ConstructedType and return its resolved type.
11673 (DeclSpace.initialize_type_params): New private method;
11674 initializes the `type_param_list' field from the type parameters
11675 from this and all enclosing classes.
11676 (DeclSpace.TypeParameters): Call initialize_type_params() unless
11677 we're already initialized.
11679 2004-02-23 Martin Baulig <martin@ximian.com>
11681 * class.cs (Method.Define): Create the generic method before
11682 calling DoDefine().
11683 (Memberbase.DoDefine): Added DeclSpace argument (in addition to
11684 the TypeContainer one); we use this for generic methods.
11686 * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
11687 parent's TypeBuilder.
11689 2004-02-18 Martin Baulig <martin@ximian.com>
11691 * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
11692 to check for equality.
11694 2004-02-05 Martin Baulig <martin@ximian.com>
11696 * ecore.cs (FieldExpr.DoResolveLValue): If we have an
11697 `ec.TypeContainer.CurrentType', use it instead of
11698 `ec.ContainerType' to check whether we're in the type's ctor.
11700 2004-01-29 Martin Baulig <martin@ximian.com>
11702 * expression.cs (Invocation.DoResolve): If we're a
11703 `ConstructedType', then we're actually a generic method, so
11704 rewrite the expr as a GenericMemberAccess.
11706 * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
11707 here; manually parse it into a string.
11709 2004-01-28 Martin Baulig <martin@ximian.com>
11711 * typemanager.cs (TypeManager.IsEqual): New static method.
11712 (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
11713 check for equality instead of using `=='.
11715 2004-01-26 Martin Baulig <martin@ximian.com>
11717 * decl.cs (DeclSpace.CurrentType): New public field.
11719 * expression.cs (This.ResolveBase): If we have an
11720 `ec.TypeContainer.CurrentType', use it instead of
11721 `ec.ContainerType'.
11723 * class.cs (TypeContainer.DefineType): If we're a generic type,
11724 create the `CurrentType' (unresolved).
11725 (TypeContainer.GenericType): New private field.
11726 (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
11727 it and store it in `GenericType' before creating the MemberCache.
11728 (TypeContainer.GetMembers): If we have a `GenericType', call
11729 TypeManager.FindMembers() on it.
11731 * interface.cs (Interface.GenericType): New private field.
11732 (Interface.DefineType): If we're a generic type, create the
11733 `CurrentType' (unresolved).
11734 (Interface.DefineMembers): If we have a `CurrentType', resolve it
11735 and store it in `GenericType' before creating the MemberCache.
11736 (Interface.GetMembers): If we have a `GenericType', call
11737 TypeManager.FindMembers() on it.
11739 2004-01-22 Martin Baulig <martin@ximian.com>
11741 * cs-parser.jay (namespace_or_type_name): Return an Expression,
11742 not a QualifiedIdentifier. This is what `type_name_expression'
11743 was previously doing.
11744 (type_name_expression): Removed; the code is now in
11745 `namespace_or_type_name'.
11746 (qualified_identifier): Removed, use `namespace_or_type_name'
11748 (QualifiedIdentifier): Removed this class.
11750 2004-01-22 Martin Baulig <martin@ximian.com>
11752 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11753 not a string as alias name.
11755 2004-01-21 Miguel de Icaza <miguel@ximian.com>
11757 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11758 #52730 bug, and instead compute correctly the need to use a
11759 temporary variable when requesting an address based on the
11760 static/instace modified of the field and the constructor.
11762 2004-01-21 Martin Baulig <martin@ximian.com>
11764 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11765 class and namespace before looking up aliases. Fixes #52517.
11767 2004-01-21 Martin Baulig <martin@ximian.com>
11769 * flowanalysis.cs (UsageVector.Merge): Allow variables being
11770 assinged in a 'try'; fixes exception4.cs.
11772 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11773 * class.cs : Implemented parameter-less constructor for TypeContainer
11775 * decl.cs: Attributes are now stored here. New property OptAttributes
11777 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11779 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11781 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11783 * typemanager.cs (CSharpSignature): Now reports also inner class name.
11784 (CSharpSignature): New method for indexer and property signature.
11786 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11788 * pending.cs (IsVirtualFilter): Faster implementation.
11790 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11792 * typemanager.cs: Avoid inclusion of same assembly more than once.
11794 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11796 * cs-parser.jay: Fixed problem where the last assembly attribute
11797 has been applied also to following declaration (class, struct, etc.)
11799 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11801 * class.cs: Added error CS0538, CS0539 reporting.
11802 Fixed crash on Microsoft runtime when field type is void.
11804 * cs-parser.jay: Added error CS0537 reporting.
11806 * pending.cs: Added error CS0535 reporting.
11807 Improved error report for errors CS0536, CS0534.
11809 2004-01-20 Miguel de Icaza <miguel@ximian.com>
11811 Merge a few bits from the Anonymous Method MCS tree.
11813 * statement.cs (ToplevelBlock): New class for toplevel methods,
11814 will hold anonymous methods, lifted variables.
11816 * cs-parser.jay: Create toplevel blocks for delegates and for
11817 regular blocks of code.
11819 2004-01-20 Martin Baulig <martin@ximian.com>
11821 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11822 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11823 and `NeedExplicitReturn'; added `IsLastStatement'.
11824 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11825 have a `ReturnLabel' or we're not unreachable.
11827 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11828 child's reachability; don't just override ours with it. Fixes
11829 #58058 (lluis's example).
11830 (FlowBranching): Added public InTryOrCatch(), InCatch(),
11831 InFinally(), InLoop(), InSwitch() and
11832 BreakCrossesTryCatchBoundary() methods.
11834 * statement.cs (Return): Do all error checking in Resolve().
11835 Unless we are the last statement in a top-level block, always
11836 create a return label and jump to it.
11837 (Break, Continue): Do all error checking in Resolve(); also make
11838 sure we aren't leaving a `finally'.
11839 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11840 statement in a top-level block.
11841 (Block.Flags): Added `IsDestructor'.
11842 (Block.IsDestructor): New public property.
11844 2004-01-20 Martin Baulig <martin@ximian.com>
11846 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11848 2004-01-20 Martin Baulig <martin@ximian.com>
11850 * statement.cs (Statement.ResolveUnreachable): New public method.
11851 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11852 (Block.Resolve): Resolve unreachable statements.
11854 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
11856 * expression.cs: We need to fix the case where we do
11857 not have a temp variable here.
11859 * assign.cs: Only expression compound assignments need
11860 temporary variables.
11862 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
11864 * flowanalysis.cs: Reduce memory allocation in a few ways:
11865 - A block with no variables should not allocate a bit
11867 - A method with no out parameters does not need any tracking
11868 for assignment of the parameters, so we need not allocate
11871 public readonly Type[] VariableTypes;
11872 public readonly string[] VariableNames;
11873 Are redundant. The data is already stored in the variable
11874 map, so we need not allocate another array for it.
11875 - We need to add alot of checks for if (params | locals) == null
11876 due to the first two changes.
11878 2004-01-18 Miguel de Icaza <miguel@ximian.com>
11880 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11881 implement IMemoryLocation, we store a copy on a local variable and
11882 take the address of it. Patch from Benjamin Jemlich
11884 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11885 to use a special "type_name_expression" rule which reduces the
11886 number of "QualifiedIdentifier" classes created, and instead
11887 directly creates MemberAccess expressions.
11889 2004-01-17 Miguel de Icaza <miguel@ximian.com>
11891 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11892 that fixes #52853. Null literal assignment to ValueType
11894 * class.cs (MethodData.Emit): Instead of checking the name of the
11895 method to determine if its a destructor, create a new derived
11896 class from Method called Destructor, and test for that.
11898 * cs-parser.jay: Create a Destructor object instead of a Method.
11900 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11904 2004-01-16 Miguel de Icaza <miguel@ximian.com>
11906 * expression.cs (Binary.ResolveOperator): Perform an implicit
11907 conversion from MethodGroups to their delegate types on the
11908 Addition operation.
11910 * delegate.cs: Introduce a new class DelegateCreation that is the
11911 base class for `NewDelegate' and `ImplicitDelegateCreation',
11912 factor some code in here.
11914 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11915 conversion from MethodGroups to compatible delegate types.
11917 * ecore.cs (Expression.Resolve): Do not flag error 654
11918 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11919 we allow conversions from MethodGroups to delegate types now.
11921 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11922 assignments in v2 either.
11924 2004-01-10 Miguel de Icaza <miguel@ximian.com>
11926 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11927 static read-only fields in ctors.
11929 Applied patch from Benjamin Jemlich
11931 * expression.cs (UnaryMutator): Avoid leaking local variables.
11933 2004-01-09 Miguel de Icaza <miguel@ximian.com>
11935 * cs-tokenizer.cs (IsCastToken): Allow the various native types
11936 here to return true, as they can be used like this:
11938 (XXX) int.MEMBER ()
11940 Fixed 49836 and all the other dups
11942 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
11944 * driver.cs: Implement /win32res and /win32icon.
11946 2004-01-08 Miguel de Icaza <miguel@ximian.com>
11948 * cs-parser.jay: Add a rule to improve error handling for the
11949 common mistake of placing modifiers after the type.
11951 2004-01-07 Miguel de Icaza <miguel@ximian.com>
11953 * cs-parser.jay (interface_event_declaration): Catch
11954 initialization of events on interfaces, and report cs0068
11956 * cs-parser.jay (interface_event_declaration): Catch
11957 initialization of events.
11959 * ecore.cs: Better report missing constructors.
11961 * expression.cs (Binary.ResolveOperator): My previous bug fix had
11962 the error reporting done in the wrong place. Fix.
11964 * expression.cs (Binary.ResolveOperator): Catch the
11965 operator + (E x, E y) error earlier, and later allow for implicit
11966 conversions in operator +/- (E e, U x) from U to the underlying
11969 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11970 52596, if the container class is abstract, the default constructor
11971 is protected otherwise its public (before, we were always public).
11973 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11976 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11977 Jemlich that fixes bug #52597, MCS was generating invalid code for
11978 idisposable structs. Thanks to Ben for following up with this
11981 2004-01-06 Miguel de Icaza <miguel@ximian.com>
11983 * driver.cs: Allow assemblies without code to be generated, fixes
11986 2004-01-07 Nick Drochak <ndrochak@gol.com>
11988 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11990 2004-01-05 Miguel de Icaza <miguel@ximian.com>
11992 * cs-parser.jay: Add rules to improve error reporting if fields or
11993 methods are declared at the namespace level (error 116)
11995 * Add rules to catch event add/remove
11997 2004-01-04 David Sheldon <dave-mono@earth.li>
11999 * expression.cs: Added matching ")" to error message for
12002 2004-01-03 Todd Berman <tberman@gentoo.org>
12004 * ecore.cs, attribute.cs:
12005 Applying fix from #52429.
12007 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12009 * ecore.cs, expression.cs, statement.cs:
12010 Total rewrite of how we handle branching. We
12011 now handle complex boolean expressions with fewer
12012 jumps. As well if (x == 0) no longer emits a ceq.
12014 if (x is Foo) is much faster now, because we generate
12017 Overall, we get a pretty big improvement on our benchmark
12018 tests. The code we generate is smaller and more readable.
12020 I did a full two-stage bootstrap. The patch was reviewed
12021 by Martin and Miguel.
12023 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12025 * cs-parser.jay: Make primary_expression not take a QI.
12026 we dont need this because the member_access rule covers
12027 us here. So we replace the rule with just IDENTIFIER.
12029 This has two good effects. First, we remove a s/r conflict.
12030 Second, we allocate many fewer QualifiedIdentifier objects.
12032 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12034 * attribute.cs: Handle MarshalAs attributes as pseudo, and
12035 set the correct information via SRE. This prevents
12036 hanging on the MS runtime. Fixes #29374.
12038 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12040 * convert.cs: correctly handle conversions to value types
12041 from Enum and ValueType as unboxing conversions.
12043 Fixes bug #52569. Patch by Benjamin Jemlich.
12045 2004-01-02 Ravi Pratap <ravi@ximian.com>
12047 * expression.cs (BetterConversion): Prefer int -> uint
12048 over int -> ulong (csc's behaviour). This fixed bug #52046.
12050 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
12052 * decl.cs (MemberCache.FindMembers): now returns a
12055 * typemanager.cs: In general, go with with ^^.
12056 (CopyNewMethods): take an IList.
12057 (RealMemberLookup): Only allocate an arraylist
12058 if we copy from two sets of methods.
12060 This change basically does two things:
12061 1) Fewer array lists allocated due to CopyNewMethods.
12062 2) the explicit cast in MemberList costed ALOT.
12064 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
12066 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
12067 a hashtable to avoid needless string allocations when an identifier is
12068 used more than once (the common case).
12070 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
12072 * pending.cs: MS's TypeBuilder.GetInterfaces ()
12073 is broken, it will not return anything. So, we
12074 have to use the information we have in mcs to
12077 * typemanager.cs: Add a cache for GetInterfaces,
12078 since this will now be used more often (due to ^^)
12080 (GetExplicitInterfaces) New method that gets the
12081 declared, not effective, interfaces on a type
12082 builder (eg, if you have interface IFoo, interface
12083 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
12086 This patch makes MCS able to bootstrap itself on
12089 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
12091 * expression.cs: Remove the Nop's that Miguel put
12094 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12096 * report.cs, codegen.cs: Give the real stack trace to
12097 the error when an exception is thrown.
12099 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12101 * decl.cs: only allocate hashtables for ifaces if
12104 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12106 * expression.cs: fix the error from cs0121-2.cs
12107 (a parent interface has two child interfaces that
12108 have a function with the same name and 0 params
12109 and the function is called through the parent).
12111 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
12113 * class.cs, rootcontext.cs, typmanager.cs: do not
12116 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
12118 * codegen.cs: remove stack for the ec flow branching.
12119 It is already a linked list, so no need.
12121 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
12123 * Makefile: Allow custom profiler here.
12125 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
12127 * typemanager.cs (LookupType):
12128 - Use a static char [], because split takes
12129 a param array for args, so it was allocating
12131 - Do not store true in a hashtable, it boxes.
12133 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
12135 * flowanalysis.cs: bytify common enums.
12137 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12139 * modifiers.cs: Add a new set of flags for the
12140 flags allowed on explicit interface impls.
12141 * cs-parser.jay: catch the use of modifiers in
12142 interfaces correctly.
12143 * class.cs: catch private void IFoo.Blah ().
12145 All related to bug #50572.
12147 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12149 * decl.cs: Rewrite the consistant accessability checking.
12150 Accessability is not linear, it must be implemented in
12151 a tableish way. Fixes #49704.
12153 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12155 * expression.cs: Handle negation in a checked context.
12156 We must use subtraction from zero. Fixes #38674.
12158 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
12160 * class.cs: Ignore static void main in DLLs.
12161 * rootcontext.cs: Handle the target type here,
12162 since we are have to access it from class.cs
12163 * driver.cs: account for the above.
12165 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
12167 * report.cs: Give line numbers and files if available.
12169 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
12171 * driver.cs: Implement /addmodule.
12173 * typemanager.cs: Change 'modules' field so it now contains Modules not
12176 2003-12-20 Martin Baulig <martin@ximian.com>
12178 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
12179 (FieldBase.IsAssigned): Removed this field.
12180 (FieldBase.SetAssigned): New public method.
12181 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
12183 2003-12-20 Martin Baulig <martin@ximian.com>
12185 * expression.cs (LocalVariableReference.DoResolve): Don't set
12186 `vi.Used' if we're called from DoResolveLValue().
12188 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
12189 returns the usage vector it just merged into the current one -
12190 pass this one to UsageWarning().
12191 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
12192 of the `EmitContext', don't call this recursively on our children.
12194 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
12196 * driver.cs: Implement /target:module.
12198 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
12200 * support.cs (CharArrayHashtable): New helper class.
12202 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
12203 char arrays, not strings, so we can avoid creating a string in
12204 consume_identifier if the identifier is a keyword.
12206 2003-12-16 Martin Baulig <martin@ximian.com>
12208 * statement.cs (LocalInfo.Assigned): Removed this property.
12209 (LocalInfo.Flags): Removed `Assigned'.
12210 (LocalInfo.IsAssigned): New public method; takes the EmitContext
12211 and uses flow analysis.
12212 (Block.UsageWarning): Made this method private.
12213 (Block.Resolve): Call UsageWarning() if appropriate.
12215 * expression.cs (LocalVariableReference.DoResolve): Always set
12216 LocalInfo.Used here.
12218 2003-12-13 Martin Baulig <martin@ximian.com>
12220 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
12221 any value here; we're now using flow analysis to figure out
12222 whether a statement/block returns a value.
12224 2003-12-13 Martin Baulig <martin@ximian.com>
12226 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
12228 (FlowBranching.MergeFinally): Don't call
12229 `branching.CheckOutParameters()' here, this is called in
12231 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
12232 when adding the `finally' vector.
12234 2003-12-13 Martin Baulig <martin@ximian.com>
12237 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
12238 actually work and also fix #48962.
12240 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
12242 * decl.cs: Do not check System.Object for nested types,
12243 since we know it does not have any. Big bang for buck:
12246 Run 1: 8.35 seconds
12247 Run 2: 8.32 seconds
12248 corlib: 17.99 seconds
12250 Run 1: 8.17 seconds
12251 Run 2: 8.17 seconds
12252 corlib: 17.39 seconds
12254 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
12256 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
12257 time we are returning 0 members, so we save alot here.
12259 2003-12-11 Martin Baulig <martin@ximian.com>
12261 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
12262 `MergeChild()', also just take the `FlowBranching' as argument;
12263 call Merge() on it and return the result.
12264 (FlowBranching.Merge): We don't need to do anything if we just
12267 2003-12-11 Martin Baulig <martin@ximian.com>
12269 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
12270 them in an `ArrayList' to reduce memory usage. Thanks to Ben
12271 Maurer for this idea.
12273 2003-12-11 Martin Baulig <martin@ximian.com>
12275 * flowanalysis.cs (MergeResult): This class is now gone; we now
12276 use the `UsageVector' for this. The reason for this is that if a
12277 branching just has one sibling, we don't need to "merge" them at
12278 all - that's the next step to do.
12279 (FlowBranching.Merge): We now return a `UsageVector' instead of a
12282 2003-12-11 Martin Baulig <martin@ximian.com>
12284 Reworked flow analyis and made it more precise and bug-free. The
12285 most important change is that we're now using a special `Reachability'
12286 class instead of having "magic" meanings of `FlowReturns'. I'll
12287 do some more cleanups and optimizations and also add some more
12288 documentation this week.
12290 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
12291 largely reworked this class.
12292 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
12293 the new `Reachability' class instead of having "magic" values here.
12294 (FlowBranching): We're now using an instance of `Reachability'
12295 instead of having separate `Returns', `Breaks' etc. fields.
12297 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
12298 based on flow analysis; ignore the return value of block.Emit ().
12300 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
12302 * driver.cs typemanager.cs: Find the mono extensions to corlib even
12303 if they are private.
12305 2003-12-09 Martin Baulig <martin@ximian.com>
12307 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
12308 call them directly on the UsageVector.
12310 2003-12-09 Martin Baulig <martin@ximian.com>
12312 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
12313 Changed return type from `FlowReturns' to `Reachability'.
12315 2003-12-09 Martin Baulig <martin@ximian.com>
12317 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
12318 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
12319 `Reachable' fields with a single `Reachability' one.
12321 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12323 * class.cs (FindMembers): Remove foreach's.
12328 Run 1: 8.74 seconds
12329 Run 2: 8.71 seconds
12332 Run 1: 8.64 seconds
12333 Run 2: 8.58 seconds
12336 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12341 This patch does a few things:
12342 1. EmptyStatement is now a singleton, so it is never reallocated.
12343 2. All blah is EmptyStatement constructs have been changed to
12344 blah == EmptyStatement.Value, which is much faster and valid
12345 now that EmptyStatement is a singleton.
12346 3. When resolving a block, rather than allocating a new array for
12347 the non-empty statements, empty statements are replaced with
12348 EmptyStatement.Value
12349 4. Some recursive functions have been made non-recursive.
12350 Mainly the performance impact is from (3), however (1) and (2) are needed for
12351 this to work. (4) does not make a big difference in normal situations, however
12352 it makes the profile look saner.
12357 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12358 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12359 Total memory allocated: 56397 KB
12362 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
12363 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
12364 Total memory allocated: 55666 KB
12366 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12368 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
12369 than the hashtable in a hashtable version
12371 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
12372 we always end up concating a string. This results in a huge perf
12373 loss, because many strings have to be tracked by the GC. In this
12374 patch, we first use a hashtable that works with two keys, so that
12375 the strings do not need to be concat'ed.
12379 Run 1: 8.74 seconds
12380 Run 2: 8.71 seconds
12383 Run 1: 8.65 seconds
12384 Run 2: 8.56 seconds
12386 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12388 * Makefile: Add a new target `do-time' that does a quick and simple
12389 profile, leaving easy to parse output.
12391 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
12393 * codegen.cs (Init): Create the dynamic assembly with
12394 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
12396 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
12398 * support.cs: Make the PtrHashtable use only one
12399 instance of its comparer.
12401 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
12403 * typemanager.cs: Fix lookup of GetNamespaces.
12405 2003-11-29 Miguel de Icaza <miguel@ximian.com>
12407 * expression.cs: Removed redundant line.
12409 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
12410 ArrayLists, use for loops with bounds.
12412 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
12415 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
12416 arraylists, use for loop with bounds.
12418 The above three changes give us a 0.071 second performance
12419 improvement out of 3.294 seconds down to 3.223. On my machine
12420 the above changes reduced the memory usage by 1,387 KB during
12421 compiler bootstrap.
12423 * cs-parser.jay (QualifiedIdentifier): New class used to represent
12424 QualifiedIdentifiers. Before we created a new string through
12425 concatenation, and mostly later on, the result would be
12426 manipulated by DecomposeQI through string manipulation.
12428 This reduced the compiler memory usage for bootstrapping from
12429 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
12430 compile times in 0.05 seconds.
12432 2003-11-28 Dick Porter <dick@ximian.com>
12434 * support.cs: Do string compares with the Invariant culture.
12442 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
12443 the comparison is done with the Invariant culture.
12445 2003-11-27 Miguel de Icaza <miguel@ximian.com>
12447 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
12448 GetEnumerator method.
12450 (ProbeCollectionType): Iterate starting at the most specific type
12451 upwards looking for a GetEnumerator
12453 * expression.cs: Shift count can be up to 31 for int/uint and 63
12456 2003-11-26 Miguel de Icaza <miguel@ximian.com>
12458 * statement.cs (Block.LookupLabel): Also look for the label on the
12459 children blocks. Use a hash table to keep track of visited
12462 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12463 we actually did transform the other operand, otherwise fall back
12464 to the common codepath that casts to long.
12466 * cs-tokenizer.cs: Use the same code pattern as the int case.
12467 Maybe I should do the parsing myself, and avoid depending on the
12468 Parse routines to get this done.
12470 2003-11-25 Miguel de Icaza <miguel@ximian.com>
12472 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
12473 which fixes bug 51347. This time test it.
12475 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12476 attributes for example can not tell the difference between these.
12477 The difference was only a syntax feature of the language.
12479 * attribute.cs: Apply attributes to delegates.
12481 * delegate.cs: Call the apply attributes method.
12483 2003-11-24 Miguel de Icaza <miguel@ximian.com>
12485 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12486 comparing 0 vs Byte.MinValue, not the value
12488 (ImplicitConversionRequired): When reporting a conversion error,
12489 use error 31 to print out the constant error instead of the
12492 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
12493 which fixes bug 51347.
12495 2003-11-22 Miguel de Icaza <miguel@ximian.com>
12497 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
12498 which fixes the -warnaserror command line option.
12500 2003-11-21 Miguel de Icaza <miguel@ximian.com>
12502 * cfold.cs (DoNumericPromotions): During constant folding of
12503 additions on UIntConstant, special case intconstants with
12504 IntConstants like we do on the expression binary operator.
12506 2003-11-12 Miguel de Icaza <miguel@ximian.com>
12508 * convert.cs (ImplicitReferenceConversion): We were missing a case
12509 (System.Enum are not value types or class types, so we need to
12510 classify them separatedly).
12512 * driver.cs: We do not support error 2007.
12514 2003-11-12 Jackson Harper <jackson@ximian.com>
12516 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
12517 system directory. Also use the full file name so users can
12518 libraries names mscorlib-o-tron.dll in a non system dir.
12520 2004-01-04 David Sheldon <dave-mono@earth.li>
12522 * expression.cs: Added matching ")" to error message for CS0077.
12524 2003-12-19 Martin Baulig <martin@ximian.com>
12526 * typemanager.cs (TypeManager.IsEqualGenericType): New public
12527 static method; see documentation in the method.
12528 (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
12530 * convert.cs (Convert.ImplicitReferenceConversion,
12531 Convert.ImplicitReferenceConversionExists): Add support for
12532 generic type declarations; see gen-36.cs.
12534 2003-12-19 Martin Baulig <martin@ximian.com>
12536 * pending.cs (Pending.InterfaceMethod): Use
12537 `Type.IsAssignableFrom()' instead of `=='.
12539 2003-12-18 Martin Baulig <martin@ximian.com>
12541 * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
12544 * convert.cs (Convert.ImplicitStandardConversionExists): Use
12545 `expr_type.Equals (target_type)' instead of `=='.
12547 2003-12-08 Martin Baulig <martin@ximian.com>
12549 * generics.cs (Constraints.Types): Removed.
12550 (Constraints.Resolve): Just resolve everything to TypeExpr's, not
12552 (Constraints.ResolveTypes): New public method; resolves the
12553 TypeExpr's to Type's.
12554 (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
12555 longer takes the constraints.
12556 (TypeParameter.DefineMethod): Likewise.
12557 (TypeParameter.DefineType): New public method. Calls
12558 `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
12561 2003-12-08 Martin Baulig <martin@ximian.com>
12563 * convert.cs (Convert.ImplicitConversionStandard): Use
12564 `expr_type.Equals (target_type)' instead of `=='.
12566 2003-12-08 Martin Baulig <martin@ximian.com>
12568 * typemanager.cs (TypeManager.GetReferenceType): Call
12569 `Type.MakeByRefType ()'.
12571 2003-12-08 Martin Baulig <martin@ximian.com>
12573 * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
12574 just has some special meaning in some situations. For instance,
12575 it is allowed to use `where' as the name of a variable etc.
12577 2003-12-04 Martin Baulig <martin@ximian.com>
12579 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12580 `Type.MakeArrayType()' for array types.
12582 2003-11-18 Miguel de Icaza <miguel@ximian.com>
12584 * expression.cs (Invocation.VerifyArgumentsCompat): Remove
12587 (SizeOf.DoResolve): assign the `type_queried' field. This gets
12590 2003-11-16 Martin Baulig <martin@ximian.com>
12592 * codegen.cs (EmitContext.IsGeneric): Removed.
12594 * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
12595 ResolveGeneric() on the DeclSpace.
12597 2003-11-16 Martin Baulig <martin@ximian.com>
12599 * generic.cs (TypeArguments.Resolve):
12600 `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
12601 `ResolveType()' on it to get the Type.
12603 2003-11-15 Martin Baulig <martin@ximian.com>
12605 * generic.cs (ConstructedType.GetInterfaces): Override this.
12607 2003-11-14 Martin Baulig <martin@ximian.com>
12609 * interface.cs (Interface.DefineType): Define all type parameters
12610 before adding the interfaces we inherit.
12612 2003-11-11 Martin Baulig <martin@ximian.com>
12614 * generic.cs (ConstructedType.ResolveType): Always call
12615 `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
12617 2003-11-10 Martin Baulig <martin@ximian.com>
12619 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12620 (TypeManager.InitCoreTypes): Initialize them here, but instead of
12621 calling `ResolveType()' on them, directly assign their `Type'.
12623 2003-11-08 Martin Baulig <martin@ximian.com>
12625 * generic.cs (ConstructedType): Override `IsClass' etc.
12627 2003-11-08 Martin Baulig <martin@ximian.com>
12629 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12630 return value and the `out parent' parameter.
12631 (TypeContainer.DefineType): Moved the CS0644 check into
12632 GetClassBases(). Don't pass the interface types to the
12633 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12634 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12636 * ecore.cs (TypeExpr.IsAttribute): New property.
12637 (TypeExpr.GetInterfaces): New method.
12639 * interface.cs (Interface.GetInterfaceTypeByName): Return a
12640 TypeExpr instead of a Type.
12641 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12642 (Interface.DefineType): Don't pass the interface types to the
12643 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12644 them later and then call `TypeBulider.AddInterfaceImplementation()'.
12646 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12647 instead of a `Type[]'.
12648 (TypeManager.RegisterBuilder): Likewise.
12649 (TypeManager.AddUserInterface): Likewise.
12650 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12651 `Type[]' and also return a `TypeExpr[]'.
12652 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12654 2003-11-08 Martin Baulig <martin@ximian.com>
12656 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12659 2003-11-08 Martin Baulig <martin@ximian.com>
12661 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12662 TypeManager.ResolveExpressionTypes().
12664 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12665 instead of an Expression.
12666 (TypeExpr): This is now an abstract base class for `TypeExpression'.
12667 (TypeExpression): New public class; formerly known as `TypeExpr'.
12669 * expression.cs (ComposedCast): Derive from TypeExpr.
12671 * typemanager.cs (TypeManager.system_*_expr): These are now
12672 TypExpr's instead of Expression's.
12673 (TypeManager.ResolveExpressionTypes): New public static function;
12674 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12677 2003-11-06 Miguel de Icaza <miguel@ximian.com>
12679 * expression.cs (New.DoResolve): Do not dereference value that
12680 might be a null return.
12682 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12683 sure that the constant value has the right type. Fixes an
12684 unreported bug, similar to 50425.
12686 * const.cs (Const.LookupConstantValue): Call
12687 ImplicitStandardConversionExists before doing a conversion to
12688 avoid havng the TypeManager.ChangeType do conversions.
12690 Reduced the number of casts used
12692 (Const.ChangeType): New routine to enable reuse of the constant
12693 type changing code from statement.
12695 * typemanager.cs (ChangeType): Move common initialization to
12696 static global variables.
12700 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12701 every value type to go through, even if it was void. Fix that.
12703 * cs-tokenizer.cs: Use is_identifier_start_character on the start
12704 character of the define, and the is_identifier_part_character for
12705 the rest of the string.
12707 2003-11-05 Miguel de Icaza <miguel@ximian.com>
12709 * expression.cs (UnaryMutator.EmitCode): When I updated
12710 LocalVariableReference.DoResolve, I overdid it, and dropped an
12711 optimization done on local variable references.
12713 2003-11-04 Miguel de Icaza <miguel@ximian.com>
12715 * ecore.cs: Convert the return from Ldlen into an int.
12717 2003-10-20 Miguel de Icaza <miguel@ximian.com>
12719 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12720 the accessibility, this is a special case for toplevel non-public
12721 classes (internal for instance).
12723 2003-10-20 Nick Drochak <ndrochak@gol.com>
12725 * ecore.cs: Fix typo and build. Needed another right paren.
12727 2003-10-19 Miguel de Icaza <miguel@ximian.com>
12729 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
12730 `internal' case regular and protected, but not allowing protected
12731 to be evaluated later. Bug 49840
12733 2003-10-15 Miguel de Icaza <miguel@ximian.com>
12735 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12736 to kb.Nlast, and not the kb.nFirst to isolate the switch
12739 Extract the underlying type, so enumerations of long/ulong are
12740 treated like long/ulong.
12742 2003-10-14 Miguel de Icaza <miguel@ximian.com>
12744 * expression.cs (New): Overload the meaning of RequestedType to
12745 track the possible creation of the NewDelegate type, since
12746 DoResolve is invoked more than once for new constructors on field
12749 See bugs: #48800 and #37014
12751 * cs-parser.jay (declare_local_constants): Take an arraylist
12752 instead of a single constant.
12754 (local_constant_declaration): It should take a
12755 constant_declarators, not a constant_declarator. Fixes 49487
12757 * convert.cs: Fix error report.
12759 2003-10-13 Jackson Harper <jackson@ximian.com>
12761 * typemanager.cs (TypeToCoreType): Add float and double this fixes
12764 2003-11-03 Martin Baulig <martin@ximian.com>
12766 * expression.cs (ArrayAccess.GetStoreOpcode): Added
12767 `out bool has_type_arg'; if set, we need to pass the type to
12769 (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
12770 Stelem_Any/Ldelem_Any for generic parameters.
12772 2003-11-02 Martin Baulig <martin@ximian.com>
12774 * expression.cs (Invocation.EmitCall): Use
12775 `TypeManager.IsValueType()' to check whether it's a value type.
12776 Don't set `struct_call' when calling a method on a type parameter.
12778 2003-11-02 Martin Baulig <martin@ximian.com>
12780 * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
12781 and removed the TypeBuilder argument.
12783 * typemanager.cs (TypeManager.IsValueType): Return
12784 `t.IsGenericParameter || t.IsValueType'.
12786 2003-10-25 Martin Baulig <martin@ximian.com>
12788 * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
12789 call ConstructedType.Resolve() on it.
12791 * generic.cs (ConstructedType.Resolve): Set `type' on success.
12793 2003-10-25 Martin Baulig <martin@ximian.com>
12795 * class.cs (TypeContainer.GetClassBases): Changed
12796 `out Type parent' into `out TypeExpr parent'. Moved CS0644 and
12797 CS8214 reporting here.
12798 (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
12799 instead of a `Type' for our parent. In case of a recursive
12800 declaration (see tests/gen-23.cs for an example), our parent is a
12801 ConstructedType and it doesn't have its type set. So, first
12802 create our own TypeBuilder, then call constructed.Resolve() to get
12803 the parent's type and finally TypeBuilder.SetParent() it.
12805 * ecore.cs (TypeExpr.Name): New public virtual property.
12808 (ConstructedType): We're now a TypeExpr and not just an Expression.
12809 (ConstructedType.ResolveAsTypeStep): Don't resolve our type
12810 arguments here; this is done later.
12811 (ConstructedType.Resolve): New public method to resolve the type
12812 arguments and bind them.
12814 2003-10-21 Martin Baulig <martin@ximian.com>
12816 * convert.cs: Use `TypeManager.IsValueType' instead of
12817 'type.IsValueType' everywhere.
12819 * typemanager.cs (TypeManager.IsValueType): Return true for type
12820 parameters. The reason for this is that we need to box a type
12821 parameter when converting it to a reference type.
12823 * cs-parser.jay: Added support for default value expressions.
12825 * generics.cs (DefaultValueExpression): New public class.
12827 2003-10-17 Martin Baulig <martin@ximian.com>
12829 * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
12830 TypeContainer so we can also use this for Interfaces.
12831 (TypeParameter.Resolve): Likewise.
12833 * interface.cs (Interface.DefineType): Added support for generic
12836 * cs-parser.jay: Added support for generic structs and interfaces.
12838 2003-10-17 Martin Baulig <martin@ximian.com>
12840 * generic.cs (GenericMemberAccess.DoResolve): We can now actually
12841 call generic methods :-)
12843 2003-10-16 Martin Baulig <martin@ximian.com>
12845 * cs-parser.jay (namespace_or_type_name): Only create a
12846 GenericMemberAccess if we actually have type arguments.
12848 2003-10-13 Martin Baulig <martin@ximian.com>
12850 * class.cs (Method.Define): If we're a generic method, call
12851 TypeBuilder.DefineGenericMethod () before resolving
12853 (MethodData): Added .ctor which takes an additional MethodBuilder
12854 argument; this is used for generic methods.
12855 (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
12856 we already have a MethodBuilder.
12858 2003-10-10 Martin Baulig <martin@ximian.com>
12860 * class.cs (Method): Added .ctor which takes a `GenericMethod'
12861 instead of a `DeclSpace'. This is used for generic methods.
12863 * cs-parser.jay (method_header): Added support for generic
12864 methods; create a `GenericMethod' instance and pass it to the
12865 `Method's .ctor; it'll be used as the `DeclSpace' to lookup
12866 parameters and locals.
12868 * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
12869 since we already have the location. Check whether we're a generic
12870 type declaration or a generic method and create the correct type
12873 * generic.cs (TypeParameter.DefineMethod): New public method.
12874 (GenericMethod): New public class; derives from DeclSpace and is
12875 used for generic methods.
12877 2003-10-09 Martin Baulig <martin@ximian.com>
12879 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12881 (MethodCore.DoDefineParameters): Removed the TypeContainer
12882 argument; use the DeclSpace which was passed to the .ctor instead.
12883 (MethodCore.CheckParameter): Take a DeclSpace instead of a
12884 TypeContainer; we only need a DeclSpace here.
12886 2003-10-09 Martin Baulig <martin@ximian.com>
12888 * class.cs (MethodData): Added additional `DeclSpace ds' argument
12890 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12891 EmitContext's .ctor.
12893 2003-10-09 Martin Baulig <martin@ximian.com>
12895 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12896 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12897 AsAccessible(), moved them as well.
12899 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12901 2003-10-07 Miguel de Icaza <miguel@ximian.com>
12903 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12904 generation for >=, as spotted by Paolo, bug 48679.
12905 Patch from David Waite.
12907 * cs-tokenizer.cs: Add handling for #pragma.
12909 * cs-parser.jay: Allow for both yield and yield return in the
12910 syntax. The anti-cobolization of C# fight will go on!
12912 * class.cs (TypeBuilder.DefineType): Catch error condition here
12913 (Parent.DefineType erroring out and returning null).
12915 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12916 coping with enumerations variables, we were mistakenly processing
12917 them as a regular value type instead of built-in types. Fixes the
12920 * typemanager.cs (IsBuiltinOrEnum): New method.
12922 2003-09-30 Miguel de Icaza <miguel@ximian.com>
12924 * cs-parser.jay: Upgrade: yield now needs the return clause.
12926 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12928 * cs-parser.jay : Renamed yyName to yyNames related to jay.
12930 2003-09-29 Martin Baulig <martin@ximian.com>
12932 * typemanager.cs (TypeManager.GetMethodFlags): Added support for
12933 inflated generic methods.
12935 * generics.cs (ConstructedType): Distinguish between open and
12936 closed constructed types; correctly resolve the arguments.
12938 2003-09-22 Martin Baulig <martin@ximian.com>
12940 * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
12941 all type arguments meet their constraints.
12943 2003-09-19 Martin Baulig <martin@ximian.com>
12945 * decl.cs (MemberCache.SetupCacheForInterface): Take a
12946 `MemberCache parent' argument. Normally, an interface doesn't
12947 have a parent type except System.Object, but we use this in gmcs
12948 for generic type parameters.
12950 2003-09-18 Martin Baulig <martin@ximian.com>
12952 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12953 on `type.IsInterface'; don't check whether the type has a parent
12954 to determine whether it's an interface.
12956 2003-09-17 Martin Baulig <martin@ximian.com>
12958 * generic.cs (ConstructedType.ToString): Always use `name' as the
12961 2003-09-15 Martin Baulig <martin@ximian.com>
12963 * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
12965 * generic.cs (Constraints.Resolve): New public method; this is
12966 called to resolve the constraint types and to check whether all
12967 the constraints are correct.
12968 (Constraints.Types): New public property.
12969 (TypeParameter.Resolve): New public method; resolves all the
12970 type's constraints.
12972 * class.cs (TypeContainer.DefineType): Call
12973 TypeParameter.Resolve() before actually defining the type.
12975 2003-09-15 Martin Baulig <martin@ximian.com>
12977 * class.cs (TypeContainer.DefineType): Added an error flag to
12978 avoid reporting duplicate CS0146's ("class definition is
12981 * driver.cs (Driver.MainDriver): Abort if
12982 RootContext.ResolveTree() reported any errors.
12984 2003-09-07 Martin Baulig <martin@ximian.com>
12986 * report.cs (Error, Warning): Added overloaded versions which take
12987 a `params object[] args' and call String.Format().
12989 2003-09-07 Martin Baulig <martin@ximian.com>
12991 * decl.cs (DeclSpace..ctor): Don't call
12992 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12993 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
12994 (DeclSpace.RecordDecl): New method.
12996 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12998 2003-09-02 Ravi Pratap <ravi@ximian.com>
13000 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
13001 value attributes to be applied to ParameterBuilders.
13003 * class.cs (MethodCore.LabelParameters): Make static and more
13004 generic so that it can be used from other places - like interface
13005 methods, for instance.
13007 * interface.cs (Interface.Emit): Call LabelParameters before
13008 emitting attributes on the InterfaceMethod.
13010 2003-09-07 Martin Baulig <martin@ximian.com>
13012 * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
13013 if the number of type parameters doesn't match.
13015 2003-09-04 Martin Baulig <martin@ximian.com>
13017 * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
13018 for arrays of generic type params (ie. `!0[]').
13020 2003-09-04 Martin Baulig <martin@ximian.com>
13022 * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
13025 2003-09-04 Martin Baulig <martin@ximian.com>
13027 * decl.cs (DeclSpace.LookupGeneric): New method.
13028 (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
13031 * generic.cs (TypeParameterExpr): Take a TypeParameter as
13032 argument, not just a string.
13033 (TypeParameter.Define): New public method; this is called to
13034 actually define the generic parameter; after this, you can use the
13035 new `Type' property to get the type.
13037 2003-09-04 Martin Baulig <martin@ximian.com>
13039 * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
13040 is now an ArrayList; initialize the result of the `TypeParameters'
13042 (DeclSpace.GetGenericData): Removed.
13043 (DeclSpace.LookupGeneric): Temporarily removed; we need to
13044 implement this in a different way.
13045 (DeclSpace.GetTypeParameters): Removed; there's now a
13046 `TypeParameters' property.
13047 (DeclSpace.TypeParameters): New public property.
13049 * generic.cs (Constraints): Make this class public.
13050 (TypeParameter): New public class.
13052 2003-09-04 Martin Baulig <martin@ximian.com>
13054 * decl.cs (DeclSpace.GetTypeParameters): New method to return the
13055 generic parameters.
13057 * class.cs (TypeContainer.DefineType): Call
13058 TypeBuilder.DefineGenericParameter () on all generic parameters if
13059 this is a generic type.
13061 2003-08-28 Martin Baulig <martin@ximian.com>
13063 * sample-stack.il: Compile this with ilasm: "ilasm /dll
13066 * sample-hello.cs: Compile this with gmcs: "gmcs
13067 /r:sample-stack.dll sample-hello.cs".
13069 2003-08-28 Martin Baulig <martin@ximian.com>
13071 * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
13072 the parameters to the generic type.
13074 2003-08-28 Martin Baulig <martin@ximian.com>
13076 * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
13078 2003-08-28 Martin Baulig <martin@ximian.com>
13080 * cs-parser.jay (opt_type_argument_list): Use
13081 `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
13082 (primary_expression): Replace `qualified_identifier' with `type_name'.
13083 (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
13085 * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
13086 parser to check whether it is syntactically a type parameter list;
13087 return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
13090 2003-08-26 Martin Baulig <martin@ximian.com>
13092 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
13093 resolving aliases; fixes #47927.
13095 2003-08-26 Martin Baulig <martin@ximian.com>
13097 * statement.cs (Using.DoResolve): This is internally emitting a
13098 try/finally clause, so we need to set ec.NeedExplicitReturn if we
13099 do not always return. Fixes #47681.
13101 2003-08-26 Martin Baulig <martin@ximian.com>
13103 * decl.cs (MemberCore): Moved WarningNotHiding(),
13104 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
13106 (AdditionResult): Make this nested in DeclSpace.
13107 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
13108 argument; call NamespaceEntry.Define() unless we're nested in a
13111 * namespace.cs (Namespace.DefineName): New public function. This
13112 is called from DeclSpace's .ctor to add
13113 (Namespace.Lookup): Include DeclSpaces in the lookup.
13115 * class.cs (Operator): Derive from MemberBase, not MemberCore.
13117 * const.cs (Const): Derive from MemberBase, not MemberCore.
13119 2003-08-25 Martin Baulig <martin@ximian.com>
13121 * convert.cs (Convert.ExplicitReferenceConversion): When
13122 converting from an interface type to a class, unbox if the target
13123 type is a struct type. Fixes #47822.
13125 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13127 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
13130 2003-08-22 Martin Baulig <martin@ximian.com>
13132 * class.cs (TypeManager.DefineType): When defining a nested type,
13133 call DefineType() on our parent; fixes #47801.
13135 2003-08-22 Martin Baulig <martin@ximian.com>
13137 * class.cs (MethodData.Define): While checking if a method is an
13138 interface implementation, improve the test a bit more to fix #47654.
13140 2003-08-22 Martin Baulig <martin@ximian.com>
13142 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
13143 correctly; fixes #47722.
13145 2003-08-22 Martin Baulig <martin@ximian.com>
13147 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
13148 LocalVariableReference, ensure it's not read-only. Fixes #47536.
13150 * statement.cs (Fixed.DoResolve): Make all variables read-only.
13152 2003-08-22 Martin Baulig <martin@ximian.com>
13154 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
13155 can only be assigned in static constructors. Fixes #47161.
13157 2003-08-22 Martin Baulig <martin@ximian.com>
13159 Rewrote and improved the flow analysis code.
13161 * flowbranching.cs (FlowBranching): Make this class abstract.
13162 (FlowBranching.CreateBranching): New static function to create a
13163 new flow branching.
13164 (FlowBranchingBlock, FlowBranchingException): New classes.
13165 (FlowBranching.UsageVector.Type): New public readonly field.
13166 (FlowBranching.UsageVector.Breaks): Removed the setter.
13167 (FlowBranching.UsageVector.Returns): Removed the setter.
13168 (FlowBranching.UsageVector): Added Break(), Return(),
13169 NeverReachable() and Throw() methods to modify the reachability.
13170 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
13171 done by FlowBranching.Merge().
13172 (FlowBranching.UsageVector.MergeChild): New method; merges the
13173 merge result into the current vector.
13174 (FlowBranching.Merge): New abstract method to merge a branching.
13176 2003-08-12 Martin Baulig <martin@ximian.com>
13178 * expression.cs (Indirection.CacheTemporaries): Create the
13179 LocalTemporary with the pointer type, not its element type.
13181 2003-08-10 Miguel de Icaza <miguel@ximian.com>
13183 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
13184 token was a keyword or not.
13186 Add `error' options where an IDENTIFIER was expected; Provide
13187 CheckToken and CheckIdentifierToken convenience error reporting
13190 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
13192 * decl.cs: Rename `NamespaceEntry Namespace' public field into
13193 NameSpaceEntry NameSpaceEntry.
13195 (LookupInterfaceOrClass): Avoid creating a full qualified name
13196 from namespace and name: avoid doing lookups when we know the
13197 namespace is non-existant. Use new Tree.LookupByNamespace which
13198 looks up DeclSpaces based on their namespace, name pair.
13200 * driver.cs: Provide a new `parser verbose' to display the
13201 exception thrown during parsing. This is turned off by default
13202 now, so the output of a failure from mcs is more graceful.
13204 * namespace.cs: Track all the namespaces defined in a hashtable
13207 (IsNamespace): New method
13209 2003-08-09 Miguel de Icaza <miguel@ximian.com>
13211 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
13212 we know that we need to concatenate (full typename can never be
13217 * statement.cs: Use a bitfield; Do not initialize to null things
13218 which are done by the constructor by default.
13220 * cs-parser.jay: bug fix, parameter was 4, not 3.
13222 * expression.cs: Just use the property;
13224 * statement.cs: No need for GetVariableInfo method.
13226 2003-08-08 Martin Baulig <martin@ximian.com>
13228 * flowanalysis.cs (FlowReturns): This is now nested in the
13229 `FlowBranching' class.
13230 (MyBitVector): Moved this here from statement.cs.
13231 (FlowBranching.SiblingType): New enum type.
13232 (FlowBranching.CreateSibling): Added `SiblingType' argument.
13234 2003-08-07 Martin Baulig <martin@ximian.com>
13236 * flowanalysis.cs (FlowBranchingType): This is now nested in the
13237 `FlowBranching' class and called `BranchingType'.
13239 2003-08-07 Martin Baulig <martin@ximian.com>
13241 * flowanalysis.cs: Moved all the control flow analysis code into
13244 2003-08-07 Martin Baulig <martin@ximian.com>
13246 * assign.cs (Assign.DoResolve): `target' must either be an
13247 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
13250 2003-08-07 Miguel de Icaza <miguel@ximian.com>
13252 * expression.cs (BinaryMethod): This kind of expression is created by the
13253 Binary class if it determines that the operator has to be handled
13256 (BinaryDelegate): This kind of expression is created if we are
13257 dealing with a + or - operator on delegates.
13259 (Binary): remove method, argumetns, and DelegateOperator: when
13260 dealing with methods,
13262 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
13264 * statement.cs (Block): use bitfields for the three extra booleans
13265 we had in use. Remove unused topblock parameter.
13267 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
13269 * assign.cs: Drop extra unneeded tests.
13271 2003-08-06 Miguel de Icaza <miguel@ximian.com>
13273 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
13275 * statement.cs (Foreach): Use VariableStorage instead of
13278 * codegen.cs (VariableStorage): New class used by clients that
13279 require a variable stored: locals or fields for variables that
13280 need to live across yield.
13282 Maybe provide a convenience api for EmitThis+EmitLoad?
13284 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
13287 2003-08-05 Miguel de Icaza <miguel@ximian.com>
13289 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
13290 RemapParameterLValue): New methods that are used to turn a
13291 precomputed FieldInfo into an expression like this:
13295 The idea is to use this instead of making LocalVariableReference
13296 have more than one meaning.
13298 * cs-parser.jay: Add error production to BASE.
13300 * ecore.cs: Deal with TypeManager.GetField returning null, which
13301 is now a valid return value.
13303 (FieldExprNoAddress): New expression for Fields whose address can
13306 * expression.cs (LocalVariableReference): During the resolve
13307 phases, create new expressions if we are in a remapping context.
13308 Remove code that dealt with remapping here.
13310 (ParameterReference): same.
13312 (ProxyInstance): New expression, like the `This' expression, but
13313 it is born fully resolved. We know what we are doing, so remove
13314 the errors that are targeted to user-provided uses of `this'.
13316 * statement.cs (Foreach): our variable is now stored as an
13317 Expression; During resolution, follow the protocol, dont just
13318 assume it will return this.
13320 2003-08-06 Martin Baulig <martin@ximian.com>
13322 * support.cs (SeekableStreamReader.cs): New public class.
13324 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
13325 SeekableStreamReader instead of the normal StreamReader.
13327 2003-08-04 Martin Baulig <martin@ximian.com>
13329 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
13330 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
13331 deambiguate casts and delegate invocations.
13332 (parenthesized_expression): Use the new tokens to ensure this is
13333 not a cast of method invocation.
13335 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
13336 when reading a `)' and Deambiguate_CloseParens () was previously
13339 * expression.cs (ParenthesizedExpression): New class. This is
13340 just used for the CS0075 test.
13341 (Binary.DoResolve): Check for CS0075.
13343 2003-07-29 Ravi Pratap <ravi@ximian.com>
13345 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
13346 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
13347 reference comparison.
13349 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
13350 examine the ReturnType for equality - this is necessary in the
13351 cases of implicit and explicit operators whose signature also
13352 includes the return type.
13354 2003-07-26 Miguel de Icaza <miguel@ximian.com>
13356 * namespace.cs: Cache the result of the namespace computation,
13357 instead of computing it every time.
13359 2003-07-24 Miguel de Icaza <miguel@ximian.com>
13361 * decl.cs: Use a global arraylist that we reuse over invocations
13362 to avoid excesive memory consumption. Reduces memory usage on an
13363 mcs compile by one meg (45 average).
13365 * typemanager.cs (LookupTypeReflection): In .NET pointers are
13366 private, work around that.
13368 2003-07-23 Miguel de Icaza <miguel@ximian.com>
13370 * literal.cs (IntLiteral): Define Zero and One static literals.
13372 * cs-parser.jay (integer_literal): use static literals to reduce
13373 memory usage for the most used literals (0, 1 and -1). 211kb
13374 reduced in memory usage.
13376 Replace all calls to `new ArrayList' with `new
13377 ArrayList(4)' which is a good average number for most allocations,
13378 and also requires only 16 bytes of memory for its buffer by
13381 This reduced MCS memory usage in seven megabytes for the RSS after
13384 2003-07-28 Ravi Pratap <ravi@ximian.com>
13386 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
13387 handle params methods the correct way by forming only one
13388 applicable set with params and normal methods in them. Earlier we
13389 were looking at params methods only if we found no normal methods
13390 which was not the correct thing to do.
13392 (Invocation.BetterFunction): Take separate arguments indicating
13393 when candidate and the best method are params methods in their
13396 This fixes bugs #43367 and #46199.
13398 * attribute.cs: Documentation updates.
13400 (CheckAttribute): Rename to CheckAttributeTarget.
13401 (GetValidPlaces): Rename to GetValidTargets.
13403 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
13404 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
13408 2003-07-28 Miguel de Icaza <miguel@ximian.com>
13410 * codegen.cs: Compute IsGeneric correctly.
13412 * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
13415 Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
13416 OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
13417 regressions, and I was chasing more bugs than I required.
13419 * interface.cs: Use expressions for base type names (like classes
13420 and structs have been doing for a while now), and resolve that.
13421 This patch should probably go into head as well.
13423 This makes it one less user of FindType.
13425 2003-07-24 Miguel de Icaza <miguel@ximian.com>
13427 This compiler can not self host currently. Need to fix that.
13429 * Makefile: compile to `gmcs.exe'
13431 * driver.cs: Turn on v2 by default on gmcs.
13433 * generic.cs (ConstructedType): Does no longer take a container
13434 type argument; That will be taken care of later.
13436 (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
13437 Use SimpleName to resolve for now, so we can continue the work on
13438 the parser, until we get Type.GetType that understands generics.
13440 (ConstructedType.ToString): Implement
13442 (TypeArguments.Resolve): Resolve the child expressions as types.
13444 * cs-parser.jay: Rename interface_constraints to
13445 type_parameter_constraints
13447 (namespace_or_type_name): Only use constructed types for the basic
13448 construction, we will deal with identifier<...> later.
13450 (type/type_name): No longer call DecomposeQI, as
13451 namespace_or_type_name is always decoded now.
13453 2003-07-22 Ravi Pratap <ravi@ximian.com>
13455 * expression.cs (Invocation.OverloadResolve): Follow the spec more
13456 closely: we eliminate methods in base types when we have an
13457 applicable method in a top-level type.
13459 Please see section 14.5.5.1 for an exact description of what goes
13462 This fixes bug #45127 and a host of other related to corlib compilation.
13464 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13465 array is the method corresponding to the top-level type (this is
13466 because of the changes made to icall.c) so we change this
13469 (MethodGroupExpr.Name): This too.
13471 * typemanager.cs (GetElementType): New method which does the right
13472 thing when compiling corlib.
13474 * everywhere: Make use of the above in the relevant places.
13476 2003-07-22 Martin Baulig <martin@ximian.com>
13478 * cs-parser.jay (invocation_expression): Moved
13479 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
13480 `cast_expression', but create a InvocationOrCast which later
13481 resolves to either an Invocation or a Cast.
13483 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
13484 method; call this before EmitStatement() to make sure that this
13485 expression can be used as a statement.
13487 * expression.cs (InvocationOrCast): New class; resolves to either
13488 an Invocation or a Cast.
13490 * statement.cs (StatementExpression): Call ResolveStatement() on
13491 the ExpressionStatement before emitting it.
13493 2003-07-21 Martin Baulig <martin@ximian.com>
13495 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
13496 `ref' and `out' attributes match; fixes #46220.
13497 (MemberAccess.ResolveMemberAccess): You can't reference a type
13498 through an expression; fixes #33180.
13499 (Indexers.GetIndexersForType): Don't return the indexers from
13500 interfaces the class implements; fixes #46502.
13502 2003-07-21 Martin Baulig <martin@ximian.com>
13504 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
13505 CS0661 checks; fixes bug #30442.
13507 2003-07-21 Martin Baulig <martin@ximian.com>
13509 * decl.cs (AdditionResult): Added `Error'.
13511 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
13513 * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
13514 cs0031.cs actually work.
13516 2003-07-20 Miguel de Icaza <miguel@ximian.com>
13518 * cs-parser.jay (namespace_name): do not use
13519 namespace_or_type_name, use qualified_identifier, because
13520 namespace_or_type_name will soon return a composed expression
13521 instead of a string.
13523 (namespace_or_type_name): Instead of returning a string, now this
13524 production returns an expression.
13526 * codegen.cs (EmitContext): Setup IsGeneric property based on
13527 whether our DeclSpace is generic, our the method is generic.
13529 * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
13530 the method is generic.
13532 * cs-parser.jay (type_arguments, opt_type_argument_list,
13533 type_parameters, type_parameter_list, opt_type_parameter_list,
13534 type_parameter,, opt_type_parameter_constraints_clauses,
13535 type_parameter_constraints_clauses,
13536 type_parameter_constraint_clause, type_parameter_constraint,
13537 interface_constraints): Add new production
13539 * decl.cs (DeclSpace): IsGeneric, flag to track whether this
13540 DeclSpace is generic or not.
13542 (DeclSpace.SetParameterInfo): New routine, used to set the
13543 parameter info for a type.
13545 (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
13546 returns a GenericTypeExpr
13548 * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
13549 generic, lookup the generic argument.
13551 * attribute.cs: Do not allow TypeParameterExpressions in
13554 * class.cs: Do not allow the Main method to be defined in a
13557 * expression.cs (SizeOf): Do not allow generic types to be used as
13558 arguments to sizeof.
13560 * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
13561 it: whether a type is generic or not. Only works for types we are
13562 currently building for now.
13564 2003-07-20 Martin Baulig <martin@ximian.com>
13566 * namespace.cs: Fixed that bug which caused a crash when compiling
13567 the debugger's GUI.
13569 2003-07-20 Miguel de Icaza <miguel@ximian.com>
13571 * typemanager.cs (LookupTypeReflection): Never expose types which
13572 are NotPublic, NestedPrivate, NestedAssembly, or
13573 NestedFamANDAssem. We used to return these, and later do a check
13574 that would report a meaningful error, but the problem is that we
13575 would not get the real match, if there was a name override.
13577 2003-07-18 Miguel de Icaza <miguel@ximian.com>
13579 * namespace.cs (Namespace, Name): Do not compute the namespace
13580 name dynamically, compute it in the constructor. This reduced
13581 memory usage by 1697 KB.
13583 * driver.cs: Use --pause to pause at the end.
13585 2003-07-17 Peter Williams <peter@newton.cx>
13587 * Makefile: Change the name of the test target so that it doesn't
13588 conflict with the recursive test target.
13590 2003-07-17 Miguel de Icaza <miguel@ximian.com>
13592 * expression.cs (LocalVariableReference.Emit, EmitAssign,
13593 AddressOf): Do not use EmitThis, that was wrong, use the actual
13596 2003-07-15 Miguel de Icaza <miguel@ximian.com>
13598 * class.cs (MethodData.Define): While checking if a method is an
13599 interface implementation, improve the test: If we are not public
13600 (use new test here: use the computed MethodAttributes directly,
13601 instead of the parsed modifier flags) check if the `implementing'
13602 method comes from an interface or not.
13604 * pending.cs (VerifyPendingMethods): Slightly better error
13607 * makefile: add test target that does the mcs bootstrap.
13609 2003-07-16 Ravi Pratap <ravi@ximian.com>
13611 * interface.cs (Define): Do nothing here since there are no
13612 members to populate etc. Move the attribute emission out of here
13613 since this was just totally the wrong place to put it. Attribute
13614 application happens during the 'Emit' phase, not in the 'Define'
13617 (Emit): Add this method and move the attribute emission here
13619 * rootcontext.cs (EmitCode): Call the Emit method on interface
13622 2003-07-14 Ravi Pratap M <ravi@ximian.com>
13624 * expression.cs (OverloadResolve): Report error only if Location
13625 is not 'Null' which means that there was a probe going on.
13627 2003-07-14 Martin Baulig <martin@ximian.com>
13629 * expression.cs (ConditionalLogicalOperator): New public class to
13630 implement user defined conditional logical operators.
13631 This is section 14.11.2 in the spec and bug #40505.
13633 2003-07-14 Martin Baulig <martin@ximian.com>
13635 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13637 2003-07-14 Martin Baulig <martin@ximian.com>
13639 * codegen.cs (EmitContext.InFixedInitializer): New public field.
13641 * ecore.cs (IVariable.VerifyFixed): New interface method.
13643 * expression.cs (Unary.ResolveOperator): When resolving the `&'
13644 operator, check whether the variable is actually fixed. Fixes bug
13645 #36055. Set a variable definitely assigned when taking its
13646 address as required by the spec.
13648 * statement.cs (LocalInfo.IsFixed): New field.
13649 (LocalInfo.MakePinned): Set `IsFixed' to true.
13651 2003-07-14 Ravi Pratap M <ravi@ximian.com>
13653 * attribute.cs (Attribute.Resolve): While doing a Member lookup
13654 for .ctors, ensure that we only ask for members declared in the
13655 attribute type (BindingFlags.DeclaredOnly).
13659 * expression.cs (Error_WrongNumArguments): Report error 1501
13660 correctly the way CSC does.
13662 2003-07-13 Martin Baulig <martin@ximian.com>
13664 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13665 lookup on the fully qualified name, to make things like "X.X" work
13666 where "X.X" is a fully qualified type name, but we also have a
13667 namespace "X" in the using list. Fixes #41975.
13669 2003-07-13 Martin Baulig <martin@ximian.com>
13671 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13672 function. If we're a CompoundAssign, we need to create an embedded
13673 CompoundAssign, not an embedded Assign.
13674 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13677 2003-07-13 Martin Baulig <martin@ximian.com>
13679 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13680 work to fix bug #46088.
13682 2003-07-13 Ravi Pratap <ravi@ximian.com>
13684 * class.cs (Operator.Emit): Do not emit attributes here - it is
13685 taken care of by the Method class that we delegate too. This takes
13686 care of bug #45876.
13688 2003-07-10 Martin Baulig <martin@ximian.com>
13690 * expression.cs (TypeOfVoid): New class.
13691 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
13693 2003-07-10 Martin Baulig <martin@ximian.com>
13695 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13698 2003-07-10 Martin Baulig <martin@ximian.com>
13700 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13701 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13703 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13705 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13707 2003-07-10 Martin Baulig <martin@ximian.com>
13709 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13710 of decimal. Fixes #42850.
13712 NOTE: I also fixed the created byte blob, but this doesn't work on
13713 the MS runtime and csc never produces any byte blobs for decimal
13716 2003-07-10 Martin Baulig <martin@ximian.com>
13718 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13719 structs; fixes #32068.
13720 (Block.AddChildVariableNames): Fixed #44302.
13722 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13724 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
13726 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13728 * attribute.cs: And this test is onger needed.
13730 2003-07-08 Martin Baulig <martin@ximian.com>
13732 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13733 inaccessible types. Fixes #36313.
13735 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13737 * namespace.cs (NamespaceEntry): Create implicit entries for all
13738 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13739 implicit entries for N1.N2 and N1.
13741 2003-07-08 Martin Baulig <martin@ximian.com>
13743 Rewrote the handling of namespaces to fix a lot of the issues
13744 wrt. `using' aliases etc.
13746 * namespace.cs (Namespace): Splitted this class into a
13747 per-assembly `Namespace' and a per-file `NamespaceEntry'.
13749 * typemanager.cs (TypeManager.IsNamespace): Removed.
13750 (TypeManager.ComputeNamespaces): Only compute namespaces from
13751 loaded assemblies here, not the namespaces from the assembly we're
13752 currently compiling.
13754 2003-07-08 Martin Baulig <martin@ximian.com>
13756 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13758 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13760 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13763 I thought about the memory savings here, but LookupTypeReflection
13764 is used under already very constrained scenarios. Compiling
13765 corlib or mcs only exposes one hit, so it would not really reduce
13766 any memory consumption.
13768 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13770 * typemanager.cs: fixes bug #45889 by only adding public types from
13771 other assemblies to the list of known types.
13773 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13775 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13776 on the type we resolved.
13778 2003-07-05 Martin Baulig <martin@ximian.com>
13780 * pending.cs (PendingImplementation.ParentImplements): Don't
13781 create the proxy if the parent is abstract.
13783 * class.cs (TypeContainer.DefineIndexers): Process explicit
13784 interface implementations first. Fixes #37714.
13786 2003-07-04 Miguel de Icaza <miguel@ximian.com>
13788 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13789 defined recursively; but since we modify the input parameters
13790 (left is set to `this' temporarily), we reset this value if the
13791 left_is_explicit is false, which gives the original semantics to
13794 * literal.cs (NullPointer): new class used to represent a null
13795 literal in a pointer context.
13797 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13798 type is a pointer, use a NullPointer object instead of a
13799 NullLiteral. Closes 43687
13801 (ExplicitConversion): Convert pointer values using
13802 the conv opcode to the proper type.
13804 * ecore.cs (New): change ValueTypeVariable property into a method,
13805 that returns whether the valuetype is suitable for being used.
13807 * expression.cs (Binary.DoNumericPromotions): Only return if we
13808 the int constant was a valid uint, and we can return both left and
13809 right as uints. If not, we continue processing, to trigger the
13810 type conversion. This fixes 39018.
13812 * statement.cs (Block.EmitMeta): During constant resolution, set
13813 the CurrentBlock property on the emitcontext, so that we resolve
13814 constants propertly.
13816 2003-07-02 Martin Baulig <martin@ximian.com>
13818 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13819 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13821 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13822 than emitting it here.
13824 * statement.cs: Fixed some more flow analysis bugs.
13826 2003-07-02 Martin Baulig <martin@ximian.com>
13828 * class.cs (MethodData.Define): When implementing interface
13829 methods, set Final unless we're Virtual.
13831 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
13832 check work for interface methods.
13834 2003-07-01 Martin Baulig <martin@ximian.com>
13836 * ecore.cs (EmitContext.This): Replaced this property with a
13837 GetThis() method which takes a Location argument. This ensures
13838 that we get the correct error location for a CS0188.
13840 2003-07-01 Miguel de Icaza <miguel@ximian.com>
13842 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13843 ImplicitStandardConversion.
13845 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13847 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
13849 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13852 2003-06-30 Miguel de Icaza <miguel@ximian.com>
13854 * class.cs (Constructor.Define): Turn off initlocals for unsafe
13857 (MethodData.Define): Turn off initlocals for unsafe methods.
13859 2003-06-29 Miguel de Icaza <miguel@ximian.com>
13861 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13862 complete; Fixes #37521.
13864 * delegate.cs: Use Modifiers.TypeAttr to compute the
13865 TypeAttributes, instead of rolling our own. This makes the flags
13866 correct for the delegates.
13868 2003-06-28 Miguel de Icaza <miguel@ximian.com>
13870 * class.cs (Constructor.Define): Set the private flag for static
13871 constructors as well.
13873 * cs-parser.jay (statement_expression): Set the return value to
13874 null, to avoid a crash when we catch an error.
13876 2003-06-24 Miguel de Icaza <miguel@ximian.com>
13878 * cs-parser.jay: Applied patch from Jackson that adds support for
13879 extern and unsafe modifiers to destructor declarations.
13881 * expression.cs: Report error 21 if the user is trying to index a
13884 * driver.cs: Add an error message, suggested by the bug report.
13886 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13887 if we do not have a ": this ()" constructor initializer. Fixes 45149
13889 2003-06-14 Miguel de Icaza <miguel@ximian.com>
13891 * namespace.cs: Add some information to reduce FAQs.
13893 2003-06-13 Miguel de Icaza <miguel@ximian.com>
13895 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13896 underlying enumeration types. Fixes #43915.
13898 * expression.cs: Treat ushort/short as legal values to be used in
13899 bitwise operations.
13901 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13903 * delegate.cs: transfer custom attributes for paramenters from
13904 the delegate declaration to Invoke and BeginInvoke.
13906 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13908 * attribute.cs: handle custom marshalers and emit marshal info
13911 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
13913 * makefile.gnu: Added anonymous.cs to the compiler sources.
13915 2003-05-28 Miguel de Icaza <miguel@ximian.com>
13917 * iterators.cs: Change the name of the proxy class to include two
13920 * cs-parser.jay: Update grammar to include anonymous methods.
13922 * anonymous.cs: new file.
13924 2003-05-27 Miguel de Icaza <miguel@ximian.com>
13926 * class.cs (Field.Define): Add missing test for pointers and
13929 2003-05-27 Ravi Pratap <ravi@ximian.com>
13931 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13932 we use the stobj opcode.
13934 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13935 since it wasn't the correct fix.
13937 It still is puzzling that we are required to use stobj for IntPtr
13938 which seems to be a ValueType.
13940 2003-05-26 Miguel de Icaza <miguel@ximian.com>
13942 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13943 during regular simple name resolution. Now, the trick is that
13944 instead of returning for processing the simplename, we do a
13945 TypeManager.LookupType (ie, a rooted lookup as opposed to a
13946 contextual lookup type). If a match is found, return that, if
13947 not, return for further composition.
13949 This fixes long-standing 30485.
13951 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13952 using the address to initialize an object, do an Stobj instead of
13953 using the regular Stelem.
13955 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13956 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13957 Because if we are a BaseIndexerAccess that value will be true.
13960 * statement.cs (GotoCase.Resolve): Return after reporting an
13961 error, do not attempt to continue.
13963 * expression.cs (PointerArithmetic.Emit): If our operand is a
13964 long, convert our constants to match the operand before
13965 multiplying. Convert to I type before adding. Fixes 43670.
13967 2003-05-14 Ravi Pratap <ravi@ximian.com>
13969 * enum.cs (ImplicitConversionExists) : Rename to
13970 ImplicitEnumConversionExists to remove ambiguity.
13972 * ecore.cs (NullCast): New type of cast expression class which
13973 basically is very similar to EmptyCast with the difference being
13974 it still is a constant since it is used only to cast a null to
13976 (eg. (string) null)
13978 * convert.cs (ImplicitReferenceConversion): When casting a null
13979 literal, we return a NullCast.
13981 * literal.cs (NullLiteralTyped): Remove - I don't see why this
13982 should be around anymore.
13984 The renaming (reported was slightly wrong). Corrections:
13986 ConvertImplicitStandard -> ImplicitConversionStandard
13987 ConvertExplicitStandard -> ExplicitConversionStandard
13989 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13990 before passing them in !
13992 * convert.cs (ImplicitConversionStandard): When comparing for
13993 equal expr and target types, ensure that expr is not a
13996 In general, we must not be checking (expr_type ==
13997 target_type) in the top level conversion methods
13998 (ImplicitConversion, ExplicitConversion etc). This checking is
13999 done in the methods that they delegate to.
14001 2003-05-20 Miguel de Icaza <miguel@ximian.com>
14003 * convert.cs: Move Error_CannotConvertType,
14004 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
14005 ImplicitNumericConversion, ImplicitConversionExists,
14006 ImplicitUserConversionExists, StandardConversionExists,
14007 FindMostEncompassedType, FindMostSpecificSource,
14008 FindMostSpecificTarget, ImplicitUserConversion,
14009 ExplicitUserConversion, GetConversionOperators,
14010 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
14011 TryImplicitIntConversion, Error_CannotConvertImplicit,
14012 ConvertImplicitRequired, ConvertNumericExplicit,
14013 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
14014 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
14017 Perform the following renames:
14019 StandardConversionExists -> ImplicitStandardConversionExists
14020 ConvertImplicit -> ImplicitConversion
14021 ConvertImplicitStandard -> ImplicitStandardConversion
14022 TryImplicitIntConversion -> ImplicitIntConversion
14023 ConvertImplicitRequired -> ImplicitConversionRequired
14024 ConvertNumericExplicit -> ExplicitNumericConversion
14025 ConvertReferenceExplicit -> ExplicitReferenceConversion
14026 ConvertExplicit -> ExplicitConversion
14027 ConvertExplicitStandard -> ExplicitStandardConversion
14029 2003-05-19 Martin Baulig <martin@ximian.com>
14031 * statement.cs (TypeInfo.StructInfo): Made this type protected.
14032 (TypeInfo): Added support for structs having structs as fields.
14034 * ecore.cs (FieldExpr): Implement IVariable.
14035 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
14036 VariableInfo for the field.
14038 2003-05-18 Martin Baulig <martin@ximian.com>
14040 * expression.cs (This.DoResolve): Report a CS0027 if we're
14041 emitting a field initializer.
14043 2003-05-18 Martin Baulig <martin@ximian.com>
14045 * expression.cs (This.ResolveBase): New public function.
14046 (This.DoResolve): Check for CS0188.
14048 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
14051 * ecore.cs (MethodGroupExpr.DoResolve): Set the
14052 `instance_expression' to null if we don't have any non-static
14055 2003-05-18 Martin Baulig <martin@ximian.com>
14057 Reworked the way how local variables and parameters are handled by
14058 the flow analysis code.
14060 * statement.cs (TypeInfo, VariableMap): New public classes.
14061 (VariableInfo): New public class. This is now responsible for
14062 checking whether a variable has been assigned. It is used for
14063 parameters and local variables.
14064 (Block.EmitMeta): Take the InternalParameters as argument; compute
14065 the layout of the flow vectors here.
14066 (Block.LocalMap, Block.ParameterMap): New public properties.
14067 (FlowBranching): The .ctor doesn't get the InternalParameters
14068 anymore since Block.EmitMeta() now computes the layout of the flow
14070 (MyStructInfo): This class is now known as `StructInfo' and nested
14071 in `TypeInfo'; we don't access this directly anymore.
14073 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
14074 property and removed IsAssigned(), IsFieldAssigned(),
14075 SetAssigned() and SetFieldAssigned(); we now call them on the
14076 VariableInfo so we don't need to duplicate this code everywhere.
14078 * expression.cs (ParameterReference): Added `Block block' argument
14080 (LocalVariableReference, ParameterReference, This): The new
14081 VariableInfo class is now responsible for all the definite
14084 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
14085 IsParameterAssigned, SetParameterAssigned): Removed.
14087 2003-05-18 Martin Baulig <martin@ximian.com>
14089 * typemanager.cs (InitCoreTypes): Try calling
14090 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
14091 the 3-args-version. Corlib now also needs our `void_type'.
14092 (GetMethod): Added overloaded version which takes an optional
14093 `bool report_errors' to allow lookups of optional methods.
14095 2003-05-12 Martin Baulig <martin@ximian.com>
14097 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
14098 only used for locals and not for parameters.
14100 2003-05-12 Miguel de Icaza <miguel@ximian.com>
14102 * support.cs (InternalParameters.ParameterType): Return the
14103 ExternalType of the parameter.
14105 * parameter.cs (Parameter.ExternalType): drop the two arguments,
14108 2003-05-11 Miguel de Icaza <miguel@ximian.com>
14110 * class.cs (MethodData.Define): Do not set the `newslot' on
14111 interface members, if they are also flagged as "override".
14113 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
14114 better code for ++i and i++. This only works for static fields
14115 and local variables.
14117 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
14118 want to pull the DeclSpace out of the builder_to_declspace instead
14119 of the TypeBuilder (like in TypeContainer.FindMembers).
14121 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
14122 instead of LookupTypeContainer. Fixes the crash on .NET for
14123 looking up interface members.
14125 * const.cs: Create our own emit context during the Definition
14126 stage, so that constants are evaluated in the proper context, when
14127 a recursive definition happens.
14129 2003-05-11 Martin Baulig <martin@ximian.com>
14131 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
14132 new block for a switch section.
14133 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
14134 the adding/lookup in the switch block. Fixes #39828.
14136 2003-05-09 Miguel de Icaza <miguel@ximian.com>
14138 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
14139 functionality: I needed to convert the data after I had performed
14140 the add/sub operation into the operands type size.
14142 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
14143 pass the type for the box operation, otherwise the resulting
14144 object would have been of type object.
14146 (BoxedCast): Add constructor to specify the type to box as.
14148 2003-05-07 Miguel de Icaza <miguel@ximian.com>
14150 * iterators.cs: I was reusing the `count' variable inadvertently,
14151 take steps to not allow this to happen.
14153 2003-05-06 Miguel de Icaza <miguel@ximian.com>
14155 * attribute.cs (Attribute.Resolve): Params attributes are encoded
14156 by creating an array at the point where the params starts and
14157 putting all those arguments there, then adjusting the size of the
14160 2003-05-05 Miguel de Icaza <miguel@ximian.com>
14162 * expression.cs (New.AddressOf): Implement interface
14163 IMemoryLocation. This is used when the `new' operator is used in
14164 the context of an invocation to a method on a value type.
14166 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
14169 * namespace.cs: Also check the using aliases here.
14171 * driver.cs: Move the test for using validity after the types have
14172 been entered, so we do a single pass that also includes the using
14175 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
14176 in the regular case. CreateSiblingForFinally is doing extra
14179 * attribute.cs (GetAttributeArgumentExpression): Store the result
14180 on an out value, and use the return value to indicate failure
14181 instead of using null (which is a valid return for Constant.GetValue).
14183 * statement.cs: Perform the analysis flow for the increment
14184 portion after the statement, because this will be the real flow of
14185 execution. Fixes #42385
14187 * codegen.cs (EmitContext.EmitArgument,
14188 EmitContext.EmitStoreArgument): New helper functions when the
14189 RemapToProxy flag is set.
14191 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
14194 Add support for remapping parameters.
14196 * iterators.cs: Propagate parameter values; Store parameter
14197 values in the proxy classes.
14199 2003-05-04 Miguel de Icaza <miguel@ximian.com>
14201 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
14202 need a proxy reference; I do not know what I was thinking
14204 * cs-parser.jay (constructor_initializer): catch another error,
14205 and display nice message.
14207 (field_declaration): catch void field declaration
14208 to flag a better error.
14210 * class.cs (MemberBase.CheckBase): Report an error instead of a
14211 warning if a new protected member is declared in a struct.
14212 (Field.Define): catch the error of readonly/volatile.
14214 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
14216 (FieldExpr.AddressOf): ditto. Catch error where the address of a
14217 volatile variable is taken
14219 2003-05-02 Miguel de Icaza <miguel@ximian.com>
14221 * statement.cs (Fixed.Resolve): Report an error if we are not in
14224 2003-05-01 Miguel de Icaza <miguel@ximian.com>
14226 * typemanager.cs: reuse the code that handles type clashes for
14227 delegates and enumerations.
14229 * class.cs (Report28): Always report.
14231 * expression.cs (EncodeAsAttribute): Allow nulls here.
14233 2003-04-28 Miguel de Icaza <miguel@ximian.com>
14235 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
14236 the functionality for testing whether an expression is valid for
14237 an attribute here. Also handle the case of arrays of elements
14240 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
14241 encoding a linear array into an array of objects that are suitable
14242 to be passed to an CustomAttributeBuilder.
14244 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
14246 * ecore.cs: (FieldExpr): Handle field remapping here.
14248 * iteratators.cs: Pass the instance variable (if the method is an
14249 instance method) to the constructors, so we can access the field
14250 variables on the class.
14252 TODO: Test this with structs. I think the THIS variable on
14253 structs might have to be a pointer, and not a refenrece
14255 2003-04-27 Miguel de Icaza <miguel@ximian.com>
14257 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
14258 local variables to fields in a proxy class.
14260 * iterators.cs (PopulateProxy): Rename our internal fields to
14262 Create a <THIS> field if we are an instance method, so we can
14263 reference our parent container variables.
14264 (MapVariable): Called back from the EmitContext code to enter a
14265 new variable to field mapping into the proxy class (we just create
14269 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
14270 for using the remapped locals to fields.
14272 I placed the code here, because that gives the same semantics to
14273 local variables, and only changes the Emit code.
14275 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
14276 statements inside iterators.
14277 (VariableInfo): Add a FieldBuilder for the cases when we are
14278 remapping local variables to fields in a proxy class
14280 * ecore.cs (SimpleNameResolve): Avoid testing two times for
14281 current_block != null.
14283 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
14284 not cope with strings, as it has been moved to the
14285 TableSwitchEmit. Fixed bug in switch generation.
14287 * expression.cs (New.DoResolve): Provide more context for the user
14288 when reporting an error.
14290 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
14293 * expression.cs (MemberAccess.DoResolve): When we get a type back,
14294 check the permissions for it. Note than in a type-resolution
14295 context the check was already present in DeclSpace.ResolveType,
14296 but was missing from the MemberAccess.
14298 (ArrayCreation.CheckIndices): warn if the user has
14299 more nested levels of expressions, but there are no more
14300 dimensions specified. Avoids crash on bug 41906.
14302 2003-04-26 Miguel de Icaza <miguel@ximian.com>
14304 * statement.cs (Block): replace Implicit bool, for a generic
14306 New flag: `Unchecked'. This is used during the EmitMeta phase
14307 (which is out-of-line with the regular Resolve/Emit process for a
14308 statement, as this is done ahead of time, but still gets a chance
14309 to call constant resolve).
14311 (Block.Flags): new enum for adding a new flag.
14313 (Block.EmitMeta): track the state of unchecked.
14315 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
14316 to enable constant resolution to work there as well.
14318 2003-04-22 Miguel de Icaza <miguel@ximian.com>
14320 * typemanager.cs (ienumerable_type): Also look up
14321 System.Collections.IEnumerable.
14323 2003-04-21 Miguel de Icaza <miguel@ximian.com>
14325 TODO: Test more than one conditional per method.
14327 * class.cs (Indexer.Define): Report the location where the user is
14328 referencing the unsupported feature.
14330 (MethodData): Overload the use of `conditionals' to
14331 minimize the creation of needless ArrayLists. This saves roughly
14332 212kb on my machine.
14334 (Method): Implement the new IIteratorContainer interface.
14335 (Method.SetYields): Implement the method by setting the ModFlags
14336 to contain METHOD_YIELDS.
14338 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
14339 which just got set to null.
14341 * iterators.cs: New file.
14343 (Yield, YieldBreak): New statements.
14345 * statement.cs (Return.Resolve): Flag an error if we are used in
14346 an iterator method.
14348 * codegen.cs (InIterator): New flag set if the code is being
14349 compiled in an iterator method.
14351 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
14352 internal modifier, and we just use it to avoid adding extra
14353 fields, as this is seldom used.
14355 * cs-parser.jay: Add yield_statement (yield and yield break).
14357 * driver.cs: New flag -v2 to turn on version 2 features.
14359 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
14360 hashtable when v2 is enabled.
14362 2003-04-20 Miguel de Icaza <miguel@ximian.com>
14364 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
14365 there is already a namespace defined with this name.
14367 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
14368 people upgraded their corlibs.
14370 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
14371 always use fully qualified types, no need to use the compiler
14374 (TypeManager.IsNamespace): Use binarysearch.
14376 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
14377 AddDelegate): I did not quite use the new IsValid API properly: I
14378 have to pass the short-name and the fullname. I was passing only
14379 the basename instead of the fullname sometimes.
14381 (TypeContainer.DefineType): call NamespaceClash.
14383 * interface.cs (Interface.DefineType): use NamespaceClash before
14386 * delegate.cs (Delegate.DefineType): use NamespaceClash before
14389 * enum.cs: (Enum.DefineType): use NamespaceClash before
14392 * typemanager.cs (: 3-line patch that gives us some tasty 11%
14393 speed increase. First, use the negative_hits cache when we get a
14394 negative. Second, add the type with its full original name
14395 instead of the new . and + encoded name (reflection uses + to
14396 separate type from a nested type). Use LookupTypeReflection
14397 directly which bypasses the type->name hashtable (that we already
14398 know does not contain the type.
14400 * decl.cs (DeclSpace.ResolveTypeExpr): track the
14401 location/container type.
14403 * driver.cs: When passing utf8, use directly the UTF8Encoding.
14405 2003-04-19 Miguel de Icaza <miguel@ximian.com>
14407 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
14409 * delegate.cs (NewDelegate.Resolve): Test whether an instance
14410 method is being referenced in the method group from a static
14411 context, and report error 120 if so.
14413 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
14416 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
14417 is created, we create the A namespace).
14419 * cs-parser.jay: A namespace also introduces a DeclarationFound.
14422 2003-04-18 Miguel de Icaza <miguel@ximian.com>
14424 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
14425 invocation to ModuleBuilder.GetType with the same values will
14426 return a new type instance, so we need to cache its return
14429 * expression.cs (Binary.ResolveOperator): Only allow the compare
14430 operators on enums if they are of the same type.
14432 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
14433 types of ValueType on their own case. Before we were giving them
14434 the same treatment as objects.
14436 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
14437 fullname. Short name is used to compare against container name.
14438 Fullname is used to check against defined namespace names.
14440 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
14441 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
14443 (Method.CheckBase): Call parent.
14444 (MemberBase.CheckBase): Check for protected members on sealed
14446 (PropertyBase.CheckBase): Call parent.
14447 (Field.Define): Call parent.
14449 * report.cs: Negative error codes are now mapped to 8000 - code,
14450 so that the display is render more nicely.
14452 * typemanager.cs: Do not use try/catch, instead report a regular
14455 (GetPointerType, GetReferenceType): These methods provide
14456 mechanisms to obtain the T* and T& from a T. We had the code
14457 previously scattered around the code base, and it also used
14458 TypeManager.LookupType that would go through plenty of caches.
14459 This one goes directly to the type source.
14461 In some places we did the Type.GetType followed by
14462 ModuleBuilder.GetType, but not in others, so this unifies the
14463 processing as well.
14465 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14466 statements now that we have namespace information.
14468 * typemanager.cs (IsNamespace): New method, returns whether the
14469 string presented is a namespace or not.
14471 (ComputeNamespaces): New public entry point, computes the list of
14472 available namespaces, using the GetNamespaces API call in Mono, or
14473 the slower version in MS.NET.
14475 Now before we start the semantic analysis phase, we have a
14476 complete list of namespaces including everything that the user has
14479 Deleted old code to cache namespaces in .nsc files.
14481 2003-04-17 Miguel de Icaza <miguel@ximian.com>
14483 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14484 class/struct location definition Location for the implicit
14485 constructor location.
14487 (Operator.Define): Use the location of the operator for the
14488 implicit Method definition.
14490 (Constructor.Emit): use the constructor location for the implicit
14491 base initializer constructor.
14493 * ecore.cs: Remove ITypeExpression. This interface is now gone,
14494 and the Expression class now contains two new methods:
14496 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
14497 isolate type lookup from the rest of the resolution process.
14499 Since we use Expressions to hold type definitions due to the way
14500 we parse the input we have historically overloaded Resolve to
14501 perform the Type lookups if a special flag is passed. Now this is
14502 eliminated and two methods take their place.
14504 The differences in the two methods between xStep and xTerminal is
14505 that xStep is involved in our current lookup system that uses
14506 SimpleNames to compose a name, while xTerminal is used just to
14507 catch the case where the simplename lookup failed.
14509 2003-04-16 Miguel de Icaza <miguel@ximian.com>
14511 * expression.cs (ResolveMemberAccess): Remove redundant code.
14512 TypeExpr expressions are always born fully resolved.
14514 * interface.cs (PopulateMethod): Do not lookup the types twice.
14515 We were doing it once during SemanticAnalysis and once during
14518 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
14519 in local variable type definitions, were being returned as a
14520 SimpleName (we decomposed everything into a string), that is
14521 because primary_expression was being used instead of a type in the
14522 grammar (reduce/reduce conflicts).
14524 The part that was wrong is that we converted the expression into a
14525 string (an oversimplification in one hand, compounded with primary
14526 expressions doing string concatenation).
14532 Would return "A.B.C[]" as a SimpleName. This stopped things like
14533 using clauses from working on this particular context. And a type
14534 was being matched directly against "A.B.C[]".
14536 We now use the correct approach, and allow for ComposedCast to be
14537 part of the unary expression. So the "A.B.C []" become a composed
14538 cast of "A.B.C" (as a nested group of MemberAccess with a
14539 SimpleName at the end) plus the rank composition "[]".
14543 2003-04-10 Miguel de Icaza <miguel@ximian.com>
14545 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
14546 for the access level checking.
14548 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
14549 `TypeContainer container', because I kept getting confused when I
14550 was debugging this code.
14552 * expression.cs (Indexers): Instead of tracking getters/setters,
14553 we now track them in parallel. We create one arraylist less, but
14554 most importantly it is possible now for the LValue code to find a
14555 matching get for a set.
14557 (IndexerAccess.DoResolveLValue): Update the code.
14558 GetIndexersForType has been modified already to extract all the
14559 indexers from a type. The code assumed it did not.
14561 Also make the code set the correct return type for the indexer.
14562 This was fixed a long time ago for properties, but was missing for
14563 indexers. It used to be void_type.
14565 (Binary.Emit): Test first for doubles instead of
14566 floats, as they are more common.
14568 (Binary.EmitBranchable): Use the .un version of the branch opcodes
14569 when dealing with floats and the <=, >= operators. This fixes bug
14572 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14573 to load the array value by emitting a load on the foreach variable
14574 type. This was incorrect.
14576 We now emit the code to load an element using the the array
14577 variable type, and then we emit the conversion operator.
14581 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
14583 * attribute.cs: Avoid allocation of ArrayLists in the common case.
14585 2003-04-09 Miguel de Icaza <miguel@ximian.com>
14587 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14588 test for protection before we test for signatures.
14590 (MethodSignature.ToString): implement.
14592 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14593 to the case where we reduced into a LongConstant.
14595 * decl.cs (CheckAccessLevel): If the type is an array, we can not
14596 depend on whether the information is acurrate, because the
14597 Microsoft runtime will always claim that the array type is public,
14598 regardless of the real state.
14600 If the type is a pointer, another problem happens: the type is
14601 reported as non-public in Microsoft.
14603 In both cases we have to call CheckAccessLevel recursively with
14604 the underlying type as the argument to be tested.
14606 2003-04-08 Miguel de Icaza <miguel@ximian.com>
14608 * assign.cs (Assign.Emit): If we are dealing with a compound
14609 assignment expression, we should use the code path that stores the
14610 intermediate result in a temporary value. This fixes #40903.
14612 *expression.cs (Indirection.ToString): Provide ToString method for
14615 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
14617 * class.cs: Null out fields holding references to Block objects so
14618 they can be garbage collected.
14620 * expression.cs (OverloadResolve): Remove unused local.
14622 2003-04-07 Martin Baulig <martin@ximian.com>
14624 * codegen.cs (EmitContext.CurrentFile): New public field.
14625 (EmitContext.Mark): Use the CurrentFile to check whether the
14626 location is in the correct file.
14627 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14629 2003-04-07 Martin Baulig <martin@ximian.com>
14631 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14633 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14634 location. [FIXME: The location argument which gets passed to this
14635 method is sometimes wrong!]
14637 2003-04-07 Nick Drochak <ndrochak@gol.com>
14639 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14641 2003-04-07 Miguel de Icaza <miguel@ximian.com>
14643 * expression.cs (Indirection.EmitAssign): We were using the
14644 temporary, but returning immediately instead of continuing the
14647 2003-04-06 Martin Baulig <martin@ximian.com>
14649 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14650 if it's a nested child, but also deriving from the outer class.
14653 * typemanager.cs (IsNestedChildOf): Make this work if it's a
14654 nested child, but also deriving from the outer class. See
14656 (FilterWithClosure): We may access private members of the outer
14657 class if we're a nested child and deriving from the outer class.
14658 (RealMemberLookup): Only set `closure_private_ok' if the
14659 `original_bf' contained BindingFlags.NonPublic.
14661 2003-04-05 Martin Baulig <martin@ximian.com>
14663 * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
14664 probe if its a type parameter, and if so, flag an error.
14666 * decl.cs: Move here the SetParameterInfo code from class.cs.
14667 Handle IsGeneric here.
14669 Handle a variety of errors in the parameter info definition.
14671 * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
14672 type parameters here.
14674 * cs-parser.jay (class_declaration): report errors for parameters
14677 2003-01-21 Miguel de Icaza <miguel@ximian.com>
14679 * generic.cs: New file, contains support code for generics.
14681 * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
14682 OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
14684 Update parser for the above removals.
14686 * cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
14687 now taken care of in the parser.
14689 2003-04-02 Miguel de Icaza <miguel@ximian.com>
14691 * class.cs (Event.Define): Do not allow abstract events to have
14694 2003-04-01 Miguel de Icaza <miguel@ximian.com>
14696 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14697 block in event declarations.
14699 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14700 value type, get its address.
14702 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14703 leaving a class on the stack instead of a boolean value (int
14704 0/1). Change the code so we compare against null, and then the
14705 result against zero.
14707 * class.cs (TypeContainer.GetClassBases): We were checking for the
14708 parent class being sealed too late.
14710 * expression.cs (Binary.Emit): For <= and >= when dealing with
14711 floating point values, use cgt.un and clt.un instead of cgt and
14714 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
14716 * statement.cs: Apply the same optimization as MS: skip the
14717 GetEnumerator returning an IEnumerator, and use the one returning a
14718 CharEnumerator instead. This allows us to avoid the try-finally block
14721 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
14723 * cs-parser.jay: Attributes cannot be applied to
14724 namespaces. Fixes #40473
14726 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14729 (Add*): check if the name is valid using the full name for constants,
14730 fields, properties and events.
14732 2003-03-28 Miguel de Icaza <miguel@ximian.com>
14734 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
14735 char constants to be part of the enumeration.
14737 * expression.cs (Conditional.DoResolve): Add support for operator
14738 true. Implements the missing functionality from 14.12
14740 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
14741 operator true/false as required by the spec.
14743 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
14744 implicit conversion to boolean.
14746 * statement.cs (Statement.ResolveBoolean): A boolean expression is
14747 also one where the type implements `operator true'.
14749 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
14750 get an expression that will invoke operator true based on an
14753 (GetConversionOperators): Removed the hack that called op_True
14756 (Expression.ResolveBoolean): Move this from Statement.
14758 2003-03-17 Miguel de Icaza <miguel@ximian.com>
14760 * ecore.cs (FieldExpr): do not allow initialization of initonly
14761 fields on derived classes
14763 2003-03-13 Martin Baulig <martin@ximian.com>
14765 * statement.cs (Block.Emit): Call ig.BeginScope() and
14766 ig.EndScope() when compiling with debugging info; call
14767 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14769 2003-03-08 Miguel de Icaza <miguel@ximian.com>
14771 * expression.cs (Indexers): Do not construct immediately, allow
14772 for new members to be appended as we go. Fixes 38143
14774 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14776 * expression.cs: save/restore context when resolving an unchecked
14779 2003-03-05 Miguel de Icaza <miguel@ximian.com>
14781 * cfold.cs: Catch division by zero in modulus operator during
14784 2003-03-03 Miguel de Icaza <miguel@ximian.com>
14786 * interface.cs (Interface.DefineMembers): Avoid defining members
14789 2003-02-27 Miguel de Icaza <miguel@ximian.com>
14791 * driver.cs: handle the +/- options for -noconfig
14793 * statement.cs (Unckeched.Resolve): Also track the state of
14794 unchecked in the Resolve phase.
14796 2003-02-27 Martin Baulig <martin@ximian.com>
14798 * ecore.cs (Expression.MemberLookup): Don't create a
14799 MethodGroupExpr for something which is not a method. Fixes #38291.
14801 2003-02-25 Miguel de Icaza <miguel@ximian.com>
14803 * class.cs (MemberBase.CheckParameters): Also check that the type
14804 is unmanaged if it is a pointer.
14806 * expression.cs (SizeOf.Resolve): Add location information.
14808 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14809 a managed type is declared.
14811 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14812 parameter modifiers as well. Fixes bug 38606
14814 * class.cs: Very sad. Am backing out the speed up changes
14815 introduced by the ArrayList -> Array in the TypeContainer, as they
14816 were not actually that much faster, and introduced a bug (no error
14817 reports on duplicated methods).
14819 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14820 source first, this will guarantee that we have a valid expression
14821 before calling in lower levels functions that will require a
14822 resolved object. Then use this original_source in the
14823 target.ResolveLValue instead of the original source that was
14826 Another change. Use target.Resolve instead of LValueResolve.
14827 Although we are resolving for LValues, we will let the Assign code
14828 take care of that (it will be called again from Resolve). This
14829 basically allows code like this:
14831 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14832 class Y { void A (X x) { x [0] += o; }
14834 The problem was that the indexer was trying to resolve for
14835 set_Item (idx, object o) and never finding one. The real set_Item
14836 was set_Item (idx, X). By delaying the process we get the right
14841 2003-02-23 Martin Baulig <martin@ximian.com>
14843 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14844 while calling DoEmit ().
14846 * codegen.cs (EmitContext.Mark): Don't mark locations in other
14847 source files; if you use the #line directive inside a method, the
14848 compiler stops emitting line numbers for the debugger until it
14849 reaches the end of the method or another #line directive which
14850 restores the original file.
14852 2003-02-23 Martin Baulig <martin@ximian.com>
14854 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14856 2003-02-23 Martin Baulig <martin@ximian.com>
14858 * statement.cs (Block.AddChildVariableNames): We need to call this
14859 recursively, not just for our immediate children.
14861 2003-02-23 Martin Baulig <martin@ximian.com>
14863 * class.cs (Event.Define): Always make the field private, like csc does.
14865 * typemanager.cs (TypeManager.RealMemberLookup): Make events
14866 actually work, fixes bug #37521.
14868 2003-02-23 Miguel de Icaza <miguel@ximian.com>
14870 * delegate.cs: When creating the various temporary "Parameters"
14871 classes, make sure that we call the ComputeAndDefineParameterTypes
14872 on those new parameters (just like we do with the formal ones), to
14873 allow them to be resolved in the context of the DeclSpace.
14875 This fixes the bug that Dick observed in Bugzilla #38530.
14877 2003-02-22 Miguel de Icaza <miguel@ximian.com>
14879 * expression.cs (ResolveMemberAccess): When resolving a constant,
14880 do not attempt to pull a constant if the value was not able to
14881 generate a valid constant.
14883 * const.cs (LookupConstantValue): Do not report more errors than required.
14885 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14887 * expression.cs: fixes bug #38328.
14889 2003-02-18 Miguel de Icaza <miguel@ximian.com>
14891 * class.cs: Changed all the various members that can be part of a
14892 class from being an ArrayList to be an Array of the right type.
14893 During the DefineType type_list, interface_list, delegate_list and
14894 enum_list are turned into types, interfaces, delegates and enums
14897 And during the member population, indexer_list, event_list,
14898 constant_list, field_list, instance_constructor_list, method_list,
14899 operator_list and property_list are turned into their real arrays.
14901 Although we could probably perform this operation earlier, for
14902 good error reporting we need to keep the lists and remove the
14903 lists for longer than required.
14905 This optimization was triggered by Paolo profiling the compiler
14906 speed on the output of `gen-sample-program.pl' perl script.
14908 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14909 not crash in methods like MemberLookupFailed that use this field.
14911 This problem arises when the compiler fails to resolve a type
14912 during interface type definition for example.
14914 2003-02-18 Miguel de Icaza <miguel@ximian.com>
14916 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14917 inherit from System.Object, so we have to stop at null, not only
14918 when reaching System.Object.
14920 2003-02-17 Miguel de Icaza <miguel@ximian.com>
14922 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14923 DeclaredOnly because the parent indexer might have had a different
14924 name, but did not loop until the top of the hierarchy was reached.
14926 The problem this one fixes is 35492: when a class implemented an
14927 indexer from an interface, we were getting the interface method
14928 (which was abstract) and we were flagging an error (can not invoke
14931 This also keeps bug 33089 functioning, and test-148 functioning.
14933 * typemanager.cs (IsSpecialMethod): The correct way of figuring
14934 out if a method is special is to see if it is declared in a
14935 property or event, or whether it is one of the predefined operator
14936 names. This should fix correctly #36804.
14938 2003-02-15 Miguel de Icaza <miguel@ximian.com>
14940 The goal here is to remove the dependency on EmptyCast.Peel ().
14941 Killing it completely.
14943 The problem is that currently in a number of places where
14944 constants are expected, we have to "probe" for an EmptyCast, and
14945 Peel, which is not the correct thing to do, as this will be
14946 repetitive and will likely lead to errors.
14948 The idea is to remove any EmptyCasts that are used in casts that
14949 can be reduced to constants, so we only have to cope with
14952 This bug hunt was triggered by Bug 37363 and the desire to remove
14953 the duplicate pattern where we were "peeling" emptycasts to check
14954 whether they were constants. Now constants will always be
14957 * ecore.cs: Use an enumconstant here instead of wrapping with
14960 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14961 throwing me off. By handling this we can get rid of a few hacks.
14963 * statement.cs (Switch): Removed Peel() code.
14965 2003-02-14 Miguel de Icaza <miguel@ximian.com>
14967 * class.cs: Location information for error 508
14969 * expression.cs (New.DoResolve): Add a guard against double
14970 resolution of an expression.
14972 The New DoResolve might be called twice when initializing field
14973 expressions (see EmitFieldInitializers, the call to
14974 GetInitializerExpression will perform a resolve on the expression,
14975 and later the assign will trigger another resolution
14977 This leads to bugs (#37014)
14979 * delegate.cs: The signature for EndInvoke should contain any ref
14980 or out parameters as well. We were not doing this in the past.
14982 * class.cs (Field.Define): Do not overwrite the type definition
14983 inside the `volatile' group. Turns out that volatile enumerations
14984 were changing the type here to perform a validity test, which
14987 2003-02-12 Miguel de Icaza <miguel@ximian.com>
14989 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14990 and structs, we do not want to load the instance variable
14992 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14993 enum_type has to be handled like an object reference (implicit
14994 conversions exists from this to object), but the regular IsClass
14995 and IsValueType tests will never return true for this one.
14997 Also we use TypeManager.IsValueType instead of type.IsValueType,
14998 just for consistency with the rest of the code (this is only
14999 needed if we ever use the construct exposed by test-180.cs inside
15000 corlib, which we dont today).
15002 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
15004 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
15007 2003-02-09 Martin Baulig <martin@ximian.com>
15009 * namespace.cs (Namespace..ctor): Added SourceFile argument.
15010 (Namespace.DefineNamespaces): New static public method; this is
15011 called when we're compiling with debugging to add all namespaces
15012 to the symbol file.
15014 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
15015 pass it to the Namespace's .ctor.
15017 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
15018 and MethodBase arguments; pass the namespace ID to the symwriter;
15019 pass the MethodBase instead of the token to the symwriter.
15020 (SymbolWriter.DefineNamespace): New method to add a namespace to
15023 2003-02-09 Martin Baulig <martin@ximian.com>
15025 * symbolwriter.cs: New file. This is a wrapper around
15026 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
15027 methods here in near future.
15029 2003-02-09 Martin Baulig <martin@ximian.com>
15031 * codegen.cs (EmitContext.Mark): Just pass the arguments to
15032 ILGenerator.MarkSequencePoint() which are actually used by the
15035 2003-02-09 Martin Baulig <martin@ximian.com>
15037 * location.cs (SourceFile): New public sealed class. This
15038 contains the name and an index which is used in the location's token.
15039 (Location): Reserve an appropriate number of bits in the token for
15040 the source file instead of walking over that list, this gives us a
15041 really huge performance improvement when compiling with debugging.
15043 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
15044 `SourceFile' argument instead of a string.
15045 (Driver.ProcessFile): Add all the files via Location.AddFile(),
15046 but don't parse/tokenize here, we need to generate the list of all
15047 source files before we do that.
15048 (Driver.ProcessFiles): New static function. Parses/tokenizes all
15051 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
15052 instead of a string.
15054 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
15057 2003-02-09 Martin Baulig <martin@ximian.com>
15059 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
15060 filename on `#line default'.
15062 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
15064 * statement.cs: don't clear the pinned var when the fixed statement
15065 returns from the method (fixes bug#37752).
15067 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
15069 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
15072 2003-02-07 Martin Baulig <martin@ximian.com>
15074 * driver.cs: Removed the `--debug-args' command line argument.
15076 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
15077 automatically by the AsssemblyBuilder.
15078 (CodeGen.InitializeSymbolWriter): We don't need to call any
15079 initialization function on the symbol writer anymore. This method
15080 doesn't take any arguments.
15082 2003-02-03 Miguel de Icaza <miguel@ximian.com>
15084 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
15085 from referenced assemblies as well.
15087 2003-02-02 Martin Baulig <martin@ximian.com>
15089 * class.cs (MethodData.Emit): Generate debugging info for external methods.
15091 2003-02-02 Martin Baulig <martin@ximian.com>
15093 * class.cs (Constructor.Emit): Open the symbol writer before
15094 emitting the constructor initializer.
15095 (ConstructorInitializer.Emit): Call ec.Mark() to allow
15096 single-stepping through constructor initializers.
15098 2003-01-30 Miguel de Icaza <miguel@ximian.com>
15100 * class.cs: Handle error 549: do not allow virtual methods in
15103 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
15105 * decl.cs: Check access levels when resolving types
15107 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
15109 * statement.cs: Add parameters and locals set in catch blocks that might
15110 return to set vector
15112 2003-01-29 Miguel de Icaza <miguel@ximian.com>
15114 * class.cs (Operator): Set the SpecialName flags for operators.
15116 * expression.cs (Invocation.DoResolve): Only block calls to
15117 accessors and operators on SpecialName methods.
15119 (Cast.TryReduce): Handle conversions from char constants.
15122 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
15124 * statement.cs: small memory and time optimization in FlowBranching.
15126 2003-01-28 Pedro Mart <yoros@wanadoo.es>
15128 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
15129 problem that the last fix but in the other sid (Set).
15131 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
15132 access when there is no indexer in the hierarchy.
15134 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
15136 * class.cs: Combine some if statements.
15138 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15140 * driver.cs: fixed bug #37187.
15142 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
15144 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
15145 any indexer, it's needed to build a list with all the indexers in the
15146 hierarchy (AllGetters), else we have problems. Fixes #35653.
15148 2003-01-23 Miguel de Icaza <miguel@ximian.com>
15150 * class.cs (MethodData.Define): It is wrong for an interface
15151 implementation to be static in both cases: explicit and implicit.
15152 We were only handling this in one case.
15154 Improve the if situation there to not have negations.
15156 * class.cs (Field.Define): Turns out that we do not need to check
15157 the unsafe bit on field definition, only on usage. Remove the test.
15159 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15161 * driver.cs: use assembly.Location instead of Codebase (the latest
15162 patch made mcs fail when using MS assemblies).
15164 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
15166 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
15167 get the path to *corlib.dll.
15169 2003-01-21 Nick Drochak <ndrochak@gol.com>
15173 * typemanager.cs: Remove compiler warnings
15175 2003-01-20 Duncan Mak <duncan@ximian.com>
15177 * AssemblyInfo.cs: Bump the version number to 0.19.
15179 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15181 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
15183 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
15185 * class.cs (Constructor::Emit): Emit debugging info for constructors.
15187 2003-01-17 Miguel de Icaza <miguel@ximian.com>
15189 * cs-parser.jay: Small fix: we were not comparing the constructor
15190 name correctly. Thanks to Zoltan for the initial pointer.
15192 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
15194 * cs-tokenizer.cs: Set file name when specified with #line
15196 2003-01-15 Miguel de Icaza <miguel@ximian.com>
15198 * cs-parser.jay: Only perform the constructor checks here if we
15199 are named like the class; This will help provider a better
15200 error. The constructor path is taken when a type definition is
15201 not found, but most likely the user forgot to add the type, so
15202 report that rather than the constructor error.
15204 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
15206 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
15209 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15211 * cs-parser.jay: Add cleanup call.
15213 2003-01-13 Duncan Mak <duncan@ximian.com>
15215 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
15216 consistent with other methods.
15218 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15220 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
15222 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
15224 * attribute.cs: only set GuidAttr to true when we have a
15227 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15231 * typemanager.cs: fixes to allow mcs compile corlib with the new
15232 Type.IsSubclassOf fix.
15234 2003-01-08 Miguel de Icaza <miguel@ximian.com>
15236 * expression.cs (LocalVariableReference.DoResolve): Classify a
15237 constant as a value, not as a variable. Also, set the type for
15240 * cs-parser.jay (fixed_statement): take a type instead of a
15241 pointer_type, so we can produce a better error message later.
15243 * statement.cs (Fixed.Resolve): Flag types that are not pointers
15246 (For.DoEmit): Make inifinite loops have a
15247 non-conditional branch back.
15249 (Fixed.DoEmit): First populate the pinned variables, then emit the
15250 statement, then clear the variables. Before I was emitting the
15251 code once for each fixed piece.
15254 2003-01-08 Martin Baulig <martin@ximian.com>
15256 * statement.cs (FlowBranching.MergeChild): A break in a
15257 SWITCH_SECTION does not leave a loop. Fixes #36155.
15259 2003-01-08 Martin Baulig <martin@ximian.com>
15261 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
15262 lives in the same number space than `param_map'. Fixes #36154.
15264 2003-01-07 Miguel de Icaza <miguel@ximian.com>
15266 * cs-parser.jay (constructor_declaration): Set the
15267 Constructor.ModFlags before probing for it. This makes the
15268 compiler report 514, 515 and 132 (the code was there, but got
15271 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
15272 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
15273 (GotoCase.Resolve): Set `Returns' to ALWAYS.
15275 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
15277 * enum.cs: create the enum static fields using the enum type.
15279 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
15281 * class.cs: don't try to create the ParamBuilder for the return
15282 type if it's not needed (and handle it breaking for the ms runtime
15285 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
15287 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
15289 2002-12-29 Miguel de Icaza <miguel@ximian.com>
15291 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
15292 the command. This showed up while compiling the JANET source
15293 code, which used \r as its only newline separator.
15295 2002-12-28 Miguel de Icaza <miguel@ximian.com>
15297 * class.cs (Method.Define): If we are an operator (because it
15298 reuses our code), then set the SpecialName and HideBySig. #36128
15300 2002-12-22 Miguel de Icaza <miguel@ximian.com>
15302 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
15303 exception, report error 120 `object reference required'.
15305 * driver.cs: Add --pause option, used during to measure the size
15306 of the process as it goes with --timestamp.
15308 * expression.cs (Invocation.DoResolve): Do not allow methods with
15309 SpecialName to be invoked.
15311 2002-12-21 Miguel de Icaza <miguel@ximian.com>
15313 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
15314 number before adding it.
15316 2002-12-21 Ravi Pratap <ravi@ximian.com>
15318 * ecore.cs (StandardImplicitConversion): When in an unsafe
15319 context, we allow conversion between void * to any other pointer
15320 type. This fixes bug #35973.
15322 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
15324 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
15325 is not thrown when extensionless outputs are used
15327 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15329 * rootcontext.cs: fixed compilation of corlib.
15331 2002-12-19 Miguel de Icaza <miguel@ximian.com>
15333 * attribute.cs (Attributes.Contains): Add new method.
15335 * class.cs (MethodCore.LabelParameters): if the parameter is an
15336 `out' parameter, check that no attribute `[In]' has been passed.
15338 * enum.cs: Handle the `value__' name in an enumeration.
15340 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
15342 * decl.cs: Added special case to allow overrides on "protected
15345 2002-12-18 Ravi Pratap <ravi@ximian.com>
15347 * attribute.cs (Attributes.AddAttributeSection): Rename to this
15348 since it makes much more sense.
15350 (Attributes.ctor): Don't require a Location parameter.
15352 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
15354 * attribute.cs (ApplyAttributes): Remove extra Location parameters
15355 since we already have that information per attribute.
15357 * everywhere : make appropriate changes.
15359 * class.cs (LabelParameters): Write the code which actually
15360 applies attributes to the return type. We can't do this on the MS
15361 .NET runtime so we flag a warning in the case an exception is
15364 2002-12-18 Miguel de Icaza <miguel@ximian.com>
15366 * const.cs: Handle implicit null conversions here too.
15368 2002-12-17 Ravi Pratap <ravi@ximian.com>
15370 * class.cs (MethodCore.LabelParameters): Remove the extra
15371 Type [] parameter since it is completely unnecessary. Instead
15372 pass in the method's attributes so that we can extract
15373 the "return" attribute.
15375 2002-12-17 Miguel de Icaza <miguel@ximian.com>
15377 * cs-parser.jay (parse): Use Report.Error to flag errors instead
15378 of ignoring it and letting the compile continue.
15380 * typemanager.cs (ChangeType): use an extra argument to return an
15381 error condition instead of throwing an exception.
15383 2002-12-15 Miguel de Icaza <miguel@ximian.com>
15385 * expression.cs (Unary.TryReduce): mimic the code for the regular
15386 code path. Perform an implicit cast in the cases where we can
15387 implicitly convert to one of the integral types, and then reduce
15388 based on that constant. This fixes bug #35483.
15390 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15392 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
15394 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15396 * namespace.cs: fixed bug #35489.
15398 2002-12-12 Miguel de Icaza <miguel@ximian.com>
15400 * class.cs: Remove some dead code.
15402 * cs-parser.jay: Estimate the number of methods needed
15403 (RootContext.MethodCount);
15405 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
15406 numbers instead of StringBuilders.
15408 * support.cs (PtrHashtable): Add constructor with initial size;
15409 We can now reduce reallocations of the method table.
15411 2002-12-10 Ravi Pratap <ravi@ximian.com>
15413 * attribute.cs (ApplyAttributes): Keep track of the emitted
15414 attributes on a per-target basis. This fixes bug #35413.
15416 2002-12-10 Miguel de Icaza <miguel@ximian.com>
15418 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
15419 default to the Windows 1252 encoding.
15421 (UnixParseOption): Support version, thanks to Alp for the missing
15424 * AssemblyInfo.cs: Add nice assembly information.
15426 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
15429 * cs-parser.jay: Allow a trailing comma before the close bracked
15430 in the attribute_section production.
15432 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
15433 address of the instance was being taken, I will take this out,
15434 because we take the address of the object immediately here.
15436 2002-12-09 Ravi Pratap <ravi@ximian.com>
15438 * typemanager.cs (AreMultipleAllowed): Take care of the most
15439 obvious case where attribute type is not in the current assembly -
15442 2002-12-08 Miguel de Icaza <miguel@ximian.com>
15444 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
15445 definitions, instead of doing that afterwards.
15447 Also we use a nice little hack, depending on the constructor, we
15448 know if we are a "composed" name or a simple name. Hence, we
15449 avoid the IndexOf test, and we avoid
15451 * codegen.cs: Add code to assist in a bug reporter to track down
15452 the source of a compiler crash.
15454 2002-12-07 Ravi Pratap <ravi@ximian.com>
15456 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
15457 types have been emitted for a given element and flag an error
15458 if something which does not have AllowMultiple set is used more
15461 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15462 attribute types and their corresponding AllowMultiple properties
15464 (AreMultipleAllowed): Check the property for a given type.
15466 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15467 property in the case we have a TypeContainer.
15469 (Attributes.AddAttribute): Detect duplicates and just skip on
15470 adding them. This trivial fix catches a pretty gross error in our
15471 attribute emission - global attributes were being emitted twice!
15473 Bugzilla bug #33187 is now fixed.
15475 2002-12-06 Miguel de Icaza <miguel@ximian.com>
15477 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15478 instead of pp_and).
15480 * expression.cs (Binary.ResolveOperator): I can only use the
15481 Concat (string, string, string) and Concat (string, string,
15482 string, string) if the child is actually a concatenation of
15485 2002-12-04 Miguel de Icaza <miguel@ximian.com>
15487 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15488 context where we need a 2-character lookahead.
15490 * pending.cs (PendingImplementation): Rework so we can keep track
15491 of interface types all the time, and flag those which were
15492 implemented by parents as optional.
15494 2002-12-03 Miguel de Icaza <miguel@ximian.com>
15496 * expression.cs (Binary.ResolveOperator): Use
15497 String.Concat(string,string,string) or
15498 String.Concat(string,string,string,string) when possible.
15500 * typemanager: More helper methods.
15503 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15505 * pending.cs: remove the bogus return from GetMissingInterfaces()
15506 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15508 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15510 * namespace.cs: avoid duplicated 'using xxx' being added to
15511 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15512 when we get more than one 'using' statement for the same namespace.
15513 Report a CS0105 warning for it.
15515 2002-11-30 Miguel de Icaza <miguel@ximian.com>
15517 * cs-tokenizer.cs (consume_identifier): use read directly, instead
15518 of calling getChar/putback, uses internal knowledge of it.
15520 (xtoken): Reorder tokenizer so most common patterns are checked
15521 first. This reduces the compilation time in another 5% (from 8.11s
15522 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15524 The parsing time is 22% of the compilation in mcs, and from that
15525 64% is spent on the tokenization process.
15527 I tried using a binary search for keywords, but this is slower
15528 than the hashtable. Another option would be to do a couple of
15531 * Not use a StringBuilder, instead use an array of chars,
15532 with a set value. Notice that this way we could catch
15533 the 645 error without having to do it *afterwards*.
15535 * We could write a hand-parser to avoid the hashtable
15536 compares altogether.
15538 The identifier consumption process takes 37% of the tokenization
15539 time. Another 15% is spent on is_number. 56% of the time spent
15540 on is_number is spent on Int64.Parse:
15542 * We could probably choose based on the string length to
15543 use Int32.Parse or Int64.Parse and avoid all the 64-bit
15546 Another 3% is spend on wrapping `xtoken' in the `token' function.
15548 Handle 0xa0 as whitespace (#34752)
15550 2002-11-26 Miguel de Icaza <miguel@ximian.com>
15552 * typemanager.cs (IsCLRType): New routine to tell whether a type
15553 is one of the builtin types.
15555 Maybe it needs to use TypeCodes to be faster. Maybe we could use
15556 typecode in more places instead of doing pointer comparissions.
15557 We could leverage some knowledge about the way the typecodes are
15560 New code to cache namespaces in assemblies, it is currently not
15561 invoked, to be used soon.
15563 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
15565 * expression.cs (Binary.ResolveOperator): specially handle
15566 strings, and do not perform user-defined operator overloading for
15569 2002-11-24 Miguel de Icaza <miguel@ximian.com>
15571 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15572 internalcall as it is a pretty simple operation; Avoid whenever
15573 possible to call Char.IsLetter.
15575 (consume_identifier): Cut by half the number of
15576 hashtable calls by merging the is_keyword and GetKeyword behavior.
15578 Do not short-circuit, because if we do, we
15579 report errors (ie, #if false && true would produce an invalid
15583 2002-11-24 Martin Baulig <martin@ximian.com>
15585 * expression.cs (Cast.TryReduce): If we're in checked syntax,
15586 check constant ranges and report a CS0221. Fixes #33186.
15588 2002-11-24 Martin Baulig <martin@ximian.com>
15590 * cs-parser.jay: Make this work for uninitialized variable
15591 declarations in the `for' initializer. Fixes #32416.
15593 2002-11-24 Martin Baulig <martin@ximian.com>
15595 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15596 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
15598 2002-11-24 Martin Baulig <martin@ximian.com>
15600 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15601 argument; if true, we also check for user-defined conversions.
15602 This is only needed if both arguments are of a user-defined type.
15603 Fixes #30443, added test-175.cs.
15604 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15606 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15608 2002-11-24 Martin Baulig <martin@ximian.com>
15610 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15611 function to get the store opcode.
15612 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15613 only emit the Ldelema if the store opcode is Stobj. You must run
15614 both test-34 and test-167 to test this. Fixes #34529.
15616 2002-11-23 Martin Baulig <martin@ximian.com>
15618 * ecore.cs (Expression.MemberLookup): Added additional
15619 `qualifier_type' argument which is used when we're being called
15620 from MemberAccess.DoResolve() and null if we're called from a
15622 (Expression.MemberLookupFailed): New method to report errors; this
15623 does the CS1540 check and reports the correct error message.
15625 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15626 argument for the CS1540 check and redone the way how we're dealing
15627 with private members. See the comment in the source code for details.
15628 (FilterWithClosure): Reverted this back to revision 1.197; renamed
15629 `closure_start_type' to `closure_qualifier_type' and check whether
15630 it's not null. It was not this filter being broken, it was just
15631 being called with the wrong arguments.
15633 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15634 and pass it the correct `qualifier_type'; this also does the error
15637 2002-11-22 Miguel de Icaza <miguel@ximian.com>
15639 * expression.cs (Invocation.EmitParams): If the we are dealing
15640 with a non-built-in value type, load its address as well.
15642 (ArrayCreation): Use a a pretty constant instead
15643 of the hardcoded value 2. Use 6 instead of 2 for the number of
15644 static initializers.
15646 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15647 because they are not really value types, just glorified integers.
15649 * driver.cs: Do not append .exe, the CSC compiler does not do it.
15651 * ecore.cs: Remove redundant code for enumerations, make them use
15652 the same code path as everything else, fixes the casting issue
15653 with enumerations in Windows.Forms.
15655 * attribute.cs: Do only cast to string if it is a string, the
15656 validation happens later.
15658 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15659 people upgrade their corlibs.
15661 * ecore.cs: Oops, enumerations were not following the entire code path
15663 2002-11-21 Miguel de Icaza <miguel@ximian.com>
15665 * typemanager.cs (FilterWithClosure): Commented out the test for
15666 1540 in typemanager.cs, as it has problems when accessing
15667 protected methods from a parent class (see test-174.cs).
15669 * attribute.cs (Attribute.ValidateGuid): new method.
15670 (Attribute.Resolve): Use above.
15672 2002-11-19 Miguel de Icaza <miguel@ximian.com>
15674 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15676 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15677 handling for enumerations, as we only needed the TypeContainer
15678 functionality to begin with (this is required for the fix below to
15679 work for enums that reference constants in a container class for
15682 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15684 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15685 a valid TypeBuilder to perform lookups on.o
15687 * class.cs (InheritableMemberSignatureCompare): Use true in the
15688 call to GetGetMethod and GetSetMethod, because we are comparing
15689 the signature, and we need to get the methods *even* if they are
15692 (PropertyBase.CheckBase): ditto.
15694 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15695 GotoCase.Resolve): Use Peel on EmpytCasts.
15697 * ecore.cs (EmptyCast): drop child, add Peel method.
15699 2002-11-17 Martin Baulig <martin@ximian.com>
15701 * ecore.cs (EmptyCast.Child): New public property.
15703 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15704 label resolved to an EmptyCast. Fixes #34162.
15705 (GotoCase.Resolve): Likewise.
15706 (Block.EmitMeta): Likewise.
15708 2002-11-17 Martin Baulig <martin@ximian.com>
15710 * expression.cs (Invocation.BetterConversion): Prefer int over
15711 uint; short over ushort; long over ulong for integer literals.
15712 Use ImplicitConversionExists instead of StandardConversionExists
15713 since we also need to check for user-defined implicit conversions.
15714 Fixes #34165. Added test-173.cs.
15716 2002-11-16 Martin Baulig <martin@ximian.com>
15718 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15719 with the `true' and `false' literals. Fixes #33151.
15721 2002-11-16 Martin Baulig <martin@ximian.com>
15723 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
15724 October 22nd; don't do the cs1540 check for static members.
15726 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
15727 now using our own filter here and doing the cs1540 check again.
15729 2002-11-16 Martin Baulig <martin@ximian.com>
15731 * support.cs (InternalParameters): Don't crash if we don't have
15732 any fixed parameters. Fixes #33532.
15734 2002-11-16 Martin Baulig <martin@ximian.com>
15736 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
15737 when looking up static methods to make this work on Windows.
15740 2002-11-16 Martin Baulig <martin@ximian.com>
15742 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
15743 a setter rather than using PropertyInfo.CanWrite.
15745 2002-11-15 Nick Drochak <ndrochak@gol.com>
15747 * class.cs: Allow acces to block member by subclasses. Fixes build
15750 2002-11-14 Martin Baulig <martin@ximian.com>
15752 * class.cs (Constructor.Emit): Added the extern/block check.
15755 2002-11-14 Martin Baulig <martin@ximian.com>
15757 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15758 iteration while looking for indexers, this is needed because the
15759 indexer may have a different name in our base classes. Fixed the
15760 error reporting (no indexers at all, not get accessor, no
15761 overloaded match). Fixes bug #33089.
15762 (IndexerAccess.DoResolveLValue): Likewise.
15764 2002-11-14 Martin Baulig <martin@ximian.com>
15766 * class.cs (PropertyBase.CheckBase): Make this work for multiple
15767 indexers. Fixes the first part of bug #33089.
15768 (MethodSignature.InheritableMemberSignatureCompare): Added support
15771 2002-11-13 Ravi Pratap <ravi@ximian.com>
15773 * attribute.cs (Attribute.Resolve): Catch the
15774 NullReferenceException and report it since it isn't supposed to
15777 2002-11-12 Miguel de Icaza <miguel@ximian.com>
15779 * expression.cs (Binary.EmitBranchable): Also handle the cases for
15780 LogicalOr and LogicalAnd that can benefit from recursively
15781 handling EmitBranchable. The code now should be nice for Paolo.
15783 2002-11-08 Miguel de Icaza <miguel@ximian.com>
15785 * typemanager.cs (LookupType): Added a negative-hit hashtable for
15786 the Type lookups, as we perform quite a number of lookups on
15787 non-Types. This can be removed once we can deterministically tell
15788 whether we have a type or a namespace in advance.
15790 But this might require special hacks from our corlib.
15794 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15795 and double which avoids a conversion from an integer to a double.
15797 * expression.cs: tiny optimization, avoid calling IsConstant,
15798 because it effectively performs the lookup twice.
15800 2002-11-06 Miguel de Icaza <miguel@ximian.com>
15802 But a bogus return here to keep the semantics of the old code
15803 until the Mono runtime is fixed.
15805 * pending.cs (GetMissingInterfaces): New method used to remove all
15806 the interfaces that are already implemented by our parent
15807 classes from the list of pending methods.
15809 * interface.cs: Add checks for calls after ResolveTypeExpr.
15811 2002-11-05 Miguel de Icaza <miguel@ximian.com>
15813 * class.cs (Class.Emit): Report warning 67: event not used if the
15814 warning level is beyond 3.
15816 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15817 being a NullLiteral.
15819 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15822 * class.cs (TypeContainer.GetClassBases): Cover a missing code
15823 path that might fail if a type can not be resolved.
15825 * expression.cs (Binary.Emit): Emit unsigned versions of the
15828 * driver.cs: use error 5.
15830 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15832 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15834 2002-11-01 Miguel de Icaza <miguel@ximian.com>
15836 * cs-parser.jay (switch_section): A beautiful patch from Martin
15837 Baulig that fixed 33094.
15839 2002-10-31 Miguel de Icaza <miguel@ximian.com>
15841 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15842 Check whether the base is abstract and report an error if so.
15844 * expression.cs (IndexerAccess.DoResolveLValue,
15845 IndexerAccess.DoResolve): ditto.
15847 (Invocation.DoResolve): ditto.
15849 (Invocation.FullMethodDesc): Improve the report string.
15851 * statement.cs (Block): Eliminate IsVariableDefined as it is
15852 basically just a wrapper for GetVariableInfo.
15854 * ecore.cs (SimpleName): Use new
15856 * support.cs (ReflectionParamter.ParameterType): We unwrap the
15857 type, as we return the actual parameter ref/unref state on a
15860 2002-10-30 Miguel de Icaza <miguel@ximian.com>
15862 * support.cs: Return proper flags REF/OUT fixing the previous
15865 * expression.cs: Reverted last patch, that was wrong. Is_ref is
15866 not used to mean `ref' but `ref or out' in ParameterReference
15868 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15869 full type signature instead of calling TypeManger.CSharpName
15872 * support.cs (InternalParameters.ParameterDesc): Do not compare
15873 directly to the modflags, because REF/OUT will actually be bitsets
15876 * delegate.cs (VerifyMethod): Check also the modifiers.
15878 * cs-tokenizer.cs: Fix bug where floating point values with an
15879 exponent where a sign was missing was ignored.
15881 * driver.cs: Allow multiple assemblies to be specified in a single
15884 2002-10-28 Miguel de Icaza <miguel@ximian.com>
15886 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
15887 because identifiers after a parenthesis would end up in this kind
15888 of production, and we needed to desamiguate it for having casts
15891 (UserDefinedType *) xxx
15893 2002-10-24 Miguel de Icaza <miguel@ximian.com>
15895 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15896 we should set on the Bindingflags.NonPublic, but not turn on
15897 private_ok. private_ok controls whether a Private member is
15898 returned (this is chekced on the filter routine), while the
15899 BindingFlags.NonPublic just controls whether private/protected
15900 will be allowed. This fixes the problem part of the problem of
15901 private properties being allowed to be used in derived classes.
15903 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15904 so we can call the children DoResolveLValue method (this will
15905 properly signal errors on lvalue assignments to base properties)
15907 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15908 getter are null, and we have a property info, we know that this
15909 happened because the lookup failed, so we report an error 122 for
15910 protection level violation.
15912 We also silently return if setter and getter are null in the
15913 resolve functions, this condition only happens if we have flagged
15914 the error before. This is the other half of the problem.
15916 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15917 not have accessibility information, that is why we were returning
15918 true in the filter function in typemanager.cs.
15920 To properly report 122 (property is inaccessible because of its
15921 protection level) correctly, we report this error in ResolveAccess
15922 by failing if both the setter and the getter are lacking (ie, the
15925 DoResolve and DoLResolve have been modified to check for both
15926 setter/getter being null and returning silently, the reason being
15927 that I did not want to put the knowledge about this error in upper
15930 int old = Report.Errors;
15931 x = new PropertyExpr (...);
15932 if (old != Report.Errors)
15937 So the property expr is returned, but it is invalid, so the error
15938 will be flagged during the resolve process.
15940 * class.cs: Remove InheritablePropertySignatureCompare from the
15941 class, as we no longer depend on the property signature to compute
15942 whether it is possible to implement a method or not.
15944 The reason is that calling PropertyInfo.GetGetMethod will return
15945 null (in .NET, in Mono it works, and we should change this), in
15946 cases where the Get Method does not exist in that particular
15951 class X { public virtual int A { get { return 1; } } }
15953 class Z : Y { public override int A { get { return 2; } } }
15955 Would fail in Z because the parent (Y) would not have the property
15956 defined. So we avoid this completely now (because the alternative
15957 fix was ugly and slow), and we now depend exclusively on the
15960 (PropertyBase.CheckBase): Use a method-base mechanism to find our
15961 reference method, instead of using the property.
15963 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15964 routines are gone now.
15966 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15967 names, they were incorrectly named.
15969 * cs-tokenizer.cs: Return are more gentle token on failure.
15971 * pending.cs (PendingImplementation.InterfaceMethod): This routine
15972 had an out-of-sync index variable, which caused it to remove from
15973 the list of pending methods the wrong method sometimes.
15975 2002-10-22 Miguel de Icaza <miguel@ximian.com>
15977 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15978 CanWrite, because those refer to this particular instance of the
15979 property, and do not take into account the fact that we can
15980 override single members of a property.
15982 Constructor requires an EmitContext. The resolution process does
15983 not happen here, but we need to compute the accessors before,
15984 because the resolution does not always happen for properties.
15986 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15987 subclass, before we did not update this flag, but we did update
15990 (GetAccessors): Drop this routine, as it did not work in the
15991 presence of partially overwritten set/get methods.
15993 Notice that this broke the cs1540 detection, but that will require
15996 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16000 * driver.cs: issue a warning instead of an error if we don't support
16001 debugging for the platform. Also ignore a couple of errors that may
16002 arise when trying to write the symbols. Undo my previous patch.
16004 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16006 * driver.cs: ignore /debug switch except for Unix platforms.
16008 2002-10-23 Nick Drochak <ndrochak@gol.com>
16010 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
16012 2002-10-21 Miguel de Icaza <miguel@ximian.com>
16014 * driver.cs: Do not make mcs-debug conditional, so we do not break
16015 builds that use it.
16017 * statement.cs (UsageVector.MergeChildren): I would like Martin to
16018 review this patch. But basically after all the children variables
16019 have been merged, the value of "Breaks" was not being set to
16020 new_breaks for Switch blocks. I think that it should be set after
16021 it has executed. Currently I set this to the value of new_breaks,
16022 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
16023 conservative, but I do not understand this code very well.
16025 I did not break anything in the build, so that is good ;-)
16027 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
16029 2002-10-20 Mark Crichton <crichton@gimp.org>
16031 * cfold.cs: Fixed compile blocker. Really fixed it this time.
16033 2002-10-20 Nick Drochak <ndrochak@gol.com>
16035 * cfold.cs: Fixed compile blocker.
16037 2002-10-20 Miguel de Icaza <miguel@ximian.com>
16039 * driver.cs: I was chekcing the key, not the file.
16041 2002-10-19 Ravi Pratap <ravi@ximian.com>
16043 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
16044 message that we were generating - we just need to silently return
16047 2002-10-19 Miguel de Icaza <miguel@ximian.com>
16049 * class.cs (Event.Define): Change my previous commit, as this
16050 breaks the debugger. This is a temporary hack, as it seems like
16051 the compiler is generating events incorrectly to begin with.
16053 * expression.cs (Binary.ResolveOperator): Added support for
16054 "U operator - (E x, E y)"
16056 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
16059 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
16060 init-only variables, but this path did not take into account that
16061 there might be also instance readonly variables. Correct this
16064 This fixes bug 32253
16066 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
16069 * driver.cs: Change the extension for modules to `netmodule'
16071 * cs-parser.jay: Improved slightly the location tracking for
16072 the debugger symbols.
16074 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
16075 modifiers that were specified instead of the hardcoded value
16076 (FamAndAssem). This was basically ignoring the static modifier,
16077 and others. Fixes 32429.
16079 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
16080 fixed a bug in the process (32476)
16082 * expression.cs (ArrayAccess.EmitAssign): Patch from
16083 hwang_rob@yahoo.ca that fixes bug 31834.3
16085 2002-10-18 Miguel de Icaza <miguel@ximian.com>
16087 * driver.cs: Make the module extension .netmodule.
16089 2002-10-16 Miguel de Icaza <miguel@ximian.com>
16091 * driver.cs: Report an error if the resource file is not found
16092 instead of crashing.
16094 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
16095 false, like Emit does.
16097 2002-10-16 Nick Drochak <ndrochak@gol.com>
16099 * typemanager.cs: Remove unused private member. Also reported mcs
16100 bug to report this as a warning like csc.
16102 2002-10-15 Martin Baulig <martin@gnome.org>
16104 * statement.cs (Statement.Emit): Made this a virtual method; emits
16105 the line number info and calls DoEmit().
16106 (Statement.DoEmit): New protected abstract method, formerly knows
16107 as Statement.Emit().
16109 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
16111 2002-10-11 Miguel de Icaza <miguel@ximian.com>
16113 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
16114 have fixed a remaining problem: not every AddXXXX was adding a
16115 fully qualified name.
16117 Now everyone registers a fully qualified name in the DeclSpace as
16118 being defined instead of the partial name.
16120 Downsides: we are slower than we need to be due to the excess
16121 copies and the names being registered this way.
16123 The reason for this is that we currently depend (on the corlib
16124 bootstrap for instance) that types are fully qualified, because
16125 we dump all the types in the namespace, and we should really have
16126 types inserted into the proper namespace, so we can only store the
16127 basenames in the defined_names array.
16129 2002-10-10 Martin Baulig <martin@gnome.org>
16131 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
16132 from bug #31834, see the bug report for a testcase which is
16135 2002-10-10 Martin Baulig <martin@gnome.org>
16137 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
16138 flow analysis code for this.
16140 * statement.cs (Do, While, For): Tell the flow analysis code about
16142 (FlowBranching.UsageVector): Added support for infinite loops.
16143 (Block.Resolve): Moved the dead code elimination here and use flow
16146 2002-10-09 Miguel de Icaza <miguel@ximian.com>
16148 * class.cs (Field.Define): Catch cycles on struct type
16151 * typemanager.cs (IsUnmanagedtype): Do not recursively check
16152 fields if the fields are static. We only need to check instance
16155 * expression.cs (As.DoResolve): Test for reference type.
16157 * statement.cs (Using.ResolveExpression): Use
16158 ConvertImplicitRequired, not ConvertImplicit which reports an
16160 (Using.ResolveLocalVariableDecls): ditto.
16162 * expression.cs (Binary.ResolveOperator): Report errors in a few
16163 places where we had to.
16165 * typemanager.cs (IsUnmanagedtype): Finish implementation.
16167 2002-10-08 Miguel de Icaza <miguel@ximian.com>
16169 * expression.cs: Use StoreFromPtr instead of extracting the type
16170 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
16172 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
16173 an enumeration value to a System.Enum, but System.Enum is not a
16174 value type, but an class type, so we need to box.
16176 (Expression.ConvertExplicit): One codepath could return
16177 errors but not flag them. Fix this. Fixes #31853
16179 * parameter.cs (Resolve): Do not allow void as a parameter type.
16181 2002-10-06 Martin Baulig <martin@gnome.org>
16183 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
16184 if it's a class type and not a struct. Fixes #31815.
16186 2002-10-06 Martin Baulig <martin@gnome.org>
16188 * statement.cs: Reworked the flow analysis code a bit to make it
16189 usable for dead code elimination.
16191 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16193 * cs-parser.jay: allow empty source files. Fixes bug #31781.
16195 2002-10-04 Miguel de Icaza <miguel@ximian.com>
16197 * expression.cs (ComposedCast.DoResolveType): A quick workaround
16198 to fix the test 165, will investigate deeper.
16200 2002-10-04 Martin Baulig <martin@gnome.org>
16202 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
16203 finally blocks actually work.
16204 (Try.Resolve): We don't need to create a sibling for `finally' if
16205 there is no finally block.
16207 2002-10-04 Martin Baulig <martin@gnome.org>
16209 * class.cs (Constructor.Define): The default accessibility for a
16210 non-default constructor is private, not public.
16212 2002-10-04 Miguel de Icaza <miguel@ximian.com>
16214 * class.cs (Constructor): Make AllowedModifiers public, add
16217 * cs-parser.jay: Perform the modifiers test here, as the
16218 constructor for the Constructor class usually receives a zero
16219 because of the way we create it (first we create, later we
16220 customize, and we were never checking the modifiers).
16222 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
16223 is a version of LookupTypeReflection that includes the type-name
16224 cache. This can be used as a fast path for functions that know
16225 the fully qualified name and are only calling into *.GetType() to
16226 obtain a composed type.
16228 This is also used by TypeManager.LookupType during its type
16231 (LookupType): We now also track the real type name, as sometimes
16232 we can get a quey for the real type name from things like
16233 ComposedCast. This fixes bug 31422.
16235 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
16236 complete type fullname, it does not have to go through the type
16237 resolution system to obtain the composed version of the type (for
16238 obtaining arrays or pointers).
16240 (Conditional.Emit): Use the EmitBoolExpression to
16241 generate nicer code, as requested by Paolo.
16243 (ArrayCreation.CheckIndices): Use the patch from
16244 hwang_rob@yahoo.ca to validate the array initializers.
16246 2002-10-03 Miguel de Icaza <miguel@ximian.com>
16248 * class.cs (ConstructorInitializer.Emit): simplify code by using
16249 Invocation.EmitCall, and at the same time, fix the bugs in calling
16250 parent constructors that took variable arguments.
16252 * ecore.cs (Expression.ConvertNumericExplicit,
16253 Expression.ImplicitNumericConversion): Remove the code that
16254 manually wrapped decimal (InternalTypeConstructor call is now gone
16257 * expression.cs (Cast.TryReduce): Also handle decimal types when
16258 trying to perform a constant fold on the type.
16260 * typemanager.cs (IsUnmanagedtype): Partially implemented.
16262 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
16263 that only turned off an error report, and did nothing else.
16265 2002-10-02 Miguel de Icaza <miguel@ximian.com>
16267 * driver.cs: Handle and ignore /fullpaths
16269 2002-10-01 Miguel de Icaza <miguel@ximian.com>
16271 * expression.cs (Binary.ResolveOperator): Catch the case where
16272 DoNumericPromotions returns true,
16274 (Binary.DoNumericPromotions): Simplify the code, and the tests.
16276 2002-09-27 Miguel de Icaza <miguel@ximian.com>
16278 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
16281 2002-09-26 Miguel de Icaza <miguel@ximian.com>
16283 * ecore.cs (ConvertNumericExplicit): It is not enough that the
16284 conversion exists, but it is also required that the conversion be
16285 performed. This manifested in "(Type64Enum) 2".
16287 * class.cs (TypeManager.AddMethod): The fix is not to change
16288 AddEnum, because that one was using a fully qualified name (every
16289 DeclSpace derivative does), but to change the AddMethod routine
16290 that was using an un-namespaced name. This now correctly reports
16291 the duplicated name.
16293 Revert patch until I can properly fix it. The issue
16294 is that we have a shared Type space across all namespaces
16295 currently, which is wrong.
16297 Options include making the Namespace a DeclSpace, and merge
16298 current_namespace/current_container in the parser.
16300 2002-09-25 Miguel de Icaza <miguel@ximian.com>
16302 * cs-parser.jay: Improve error reporting when we get a different
16303 kind of expression in local_variable_type and
16304 local_variable_pointer_type.
16306 Propagate this to avoid missleading errors being reported.
16308 * ecore.cs (ImplicitReferenceConversion): treat
16309 TypeManager.value_type as a target just like object_type. As
16314 Is valid, and needs to result in the int 1 being boxed before it
16315 is assigned to the value type v.
16317 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
16318 to validate the enumeration name.
16320 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
16321 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
16322 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
16324 * ecore.cs (TryImplicitIntConversion): When doing an
16325 implicit-enumeration-conversion, check if the type is 64-bits and
16326 perform a conversion before passing to EnumConstant.
16328 2002-09-23 Miguel de Icaza <miguel@ximian.com>
16330 * decl.cs (Error_AmbiguousTypeReference); New routine used to
16331 report ambiguous type references. Unlike the MS version, we
16332 report what the ambiguity is. Innovation at work ;-)
16334 (DeclSpace.FindType): Require a location argument to
16335 display when we display an ambiguous error.
16337 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
16339 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
16341 * expression.cs (EmitDynamicInitializers): Apply patch from
16342 hwang_rob@yahoo.ca that fixes the order in which we emit our
16345 2002-09-21 Martin Baulig <martin@gnome.org>
16347 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
16348 delegate takes no arguments.
16350 2002-09-20 Miguel de Icaza <miguel@ximian.com>
16352 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
16355 * expression.cs: Extract the underlying type.
16357 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
16359 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
16361 2002-09-19 Miguel de Icaza <miguel@ximian.com>
16363 * class.cs (TypeContainer.DefineType): We can not use the nice
16364 PackingSize with the size set to 1 DefineType method, because it
16365 will not allow us to define the interfaces that the struct
16368 This completes the fixing of bug 27287
16370 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
16371 means also structs. This fixes part of the problem.
16372 (Expresion.ImplicitReferenceConversionExists): ditto.
16374 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
16375 error if there were no errors reported during the type lookup
16376 process, to avoid duplicates or redundant errors. Without this
16377 you would get an ambiguous errors plus a type not found. We have
16378 beaten the user enough with the first error.
16380 (DeclSparce.FindType): Emit a warning if we have an ambiguous
16383 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
16384 during the resolution process, stop the lookup, this avoids
16385 repeated error reports (same error twice).
16387 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
16389 * typemanager.cs (LookupType): Redo the type lookup code to match
16390 the needs of System.Reflection.
16392 The issue is that System.Reflection requires references to nested
16393 types to begin with a "+" sign instead of a dot. So toplevel
16394 types look like: "NameSpace.TopLevelClass", and nested ones look
16395 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
16398 2002-09-19 Martin Baulig <martin@gnome.org>
16400 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
16401 says that a method always returns or always throws an exception,
16402 don't report the CS0161.
16404 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
16405 set `Returns = new_returns'.
16407 2002-09-19 Martin Baulig <martin@gnome.org>
16409 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
16410 to an enum constant, check for a CS0176.
16412 2002-09-18 Miguel de Icaza <miguel@ximian.com>
16414 * class.cs (TypeContainer.CheckPairedOperators): Now we check
16415 for operators that must be in pairs and report errors.
16417 * ecore.cs (SimpleName.DoResolveType): During the initial type
16418 resolution process, when we define types recursively, we must
16419 check first for types in our current scope before we perform
16420 lookups in the enclosing scopes.
16422 * expression.cs (MakeByteBlob): Handle Decimal blobs.
16424 (Invocation.VerifyArgumentsCompat): Call
16425 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
16426 I thought we were supposed to always call this, but there are a
16427 few places in the code where we dont do it.
16429 2002-09-17 Miguel de Icaza <miguel@ximian.com>
16431 * driver.cs: Add support in -linkres and -resource to specify the
16432 name of the identifier.
16434 2002-09-16 Miguel de Icaza <miguel@ximian.com>
16436 * ecore.cs (StandardConversionExists): Sync with the conversion
16437 code: allow anything-* to void* conversions.
16439 (FindMostSpecificSource): Use an Expression argument
16440 instead of a Type, because we might be handed over a Literal which
16441 gets a few more implicit conversions that plain types do not. So
16442 this information was being lost.
16444 Also, we drop the temporary type-holder expression when not
16447 2002-09-17 Martin Baulig <martin@gnome.org>
16449 * class.cs (PropertyBase.CheckBase): Don't check the base class if
16450 this is an explicit interface implementation.
16452 2002-09-17 Martin Baulig <martin@gnome.org>
16454 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
16455 different `IndexerName' attributes.
16457 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
16458 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
16459 virtual CommonResolve().
16461 2002-09-16 Miguel de Icaza <miguel@ximian.com>
16463 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16464 and convert that to the UnderlyingType.
16466 * statement.cs (Foreach.Resolve): Indexers are just like variables
16467 or PropertyAccesses.
16469 * cs-tokenizer.cs (consume_string): Track line numbers and columns
16470 inside quoted strings, we were not doing this before.
16472 2002-09-16 Martin Baulig <martin@gnome.org>
16474 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16475 resolve it. This is needed for the definite assignment check of the
16476 instance expression, fixes bug #29846.
16477 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16479 2002-09-16 Nick Drochak <ndrochak@gol.com>
16481 * parameter.cs: Fix compile error. Cannot reference static member
16482 from an instance object. Is this an mcs bug?
16484 2002-09-14 Martin Baulig <martin@gnome.org>
16486 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16487 multiple times. Fixes bug #30295, added test-166.cs.
16489 2002-09-14 Martin Baulig <martin@gnome.org>
16491 * statement.cs (Block.Emit): Don't emit unreachable code.
16492 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16493 `break' statements.
16494 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16496 2002-09-14 Martin Baulig <martin@gnome.org>
16498 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16501 2002-09-14 Martin Baulig <martin@gnome.org>
16503 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16504 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16505 be false on the ms runtime.
16507 2002-09-13 Martin Baulig <martin@gnome.org>
16509 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16510 the CS0038 error message.
16512 2002-09-12 Miguel de Icaza <miguel@ximian.com>
16514 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16515 constant inside, return it.
16517 2002-09-12 Martin Baulig <martin@gnome.org>
16519 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16520 implicit conversion can be done between enum types.
16522 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16523 check whether an implicit conversion to the current enum's UnderlyingType
16524 exists and report an error if not.
16526 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16527 without debugging support.
16529 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16530 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
16532 2002-09-12 Martin Baulig <martin@gnome.org>
16534 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16536 * ecore.cs (IMemberExpr.DeclaringType): New property.
16537 (SimpleName.SimpleNameResolve): Check whether we're accessing a
16538 nonstatic member of an outer type (CS0038).
16540 2002-09-11 Miguel de Icaza <miguel@ximian.com>
16542 * driver.cs: Activate the using-error detector at warning level
16543 4 (at least for MS-compatible APIs).
16545 * namespace.cs (VerifyUsing): Small buglett fix.
16547 * pending.cs (PendingImplementation): pass the container pointer.
16549 * interface.cs (GetMethods): Allow for recursive definition. Long
16550 term, I would like to move every type to support recursive
16551 definitions, not the current ordering mechanism that we have right
16554 The situation is this: Attributes are handled before interfaces,
16555 so we can apply attributes to interfaces. But some attributes
16556 implement interfaces, we will now handle the simple cases
16557 (recursive definitions will just get an error).
16559 * parameter.cs: Only invalidate types at the end if we fail to
16562 2002-09-09 Martin Baulig <martin@gnome.org>
16564 * ecore.cs (PropertyExpr.Emit): Also check for
16565 TypeManager.system_int_array_get_length so this'll also work when
16566 compiling corlib. Fixes #30003.
16568 2002-09-09 Martin Baulig <martin@gnome.org>
16570 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16571 and throw an exception if we can't get the type's size. Fixed #30040,
16574 2002-09-09 Martin Baulig <martin@gnome.org>
16576 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16578 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16579 context. Fixes bug #30027.
16581 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16582 virtual functions. Fixes bug #30043, added test-164.cs.
16584 2002-09-08 Ravi Pratap <ravi@ximian.com>
16586 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16588 2002-09-08 Nick Drochak <ndrochak@gol.com>
16590 * driver.cs: Use an object to get the windows codepage since it's not a
16593 2002-09-08 Miguel de Icaza <miguel@ximian.com>
16595 * statement.cs (For.Emit): for infinite loops (test == null)
16596 return whether there is a break inside, not always "true".
16598 * namespace.cs (UsingEntry): New struct to hold the name of the
16599 using definition, the location where it is defined, and whether it
16600 has been used in a successful type lookup.
16602 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16607 2002-09-06 Ravi Pratap <ravi@ximian.com>
16609 * attribute.cs : Fix incorrect code which relied on catching
16610 a NullReferenceException to detect a null being passed in
16611 where an object was expected.
16613 2002-09-06 Miguel de Icaza <miguel@ximian.com>
16615 * statement.cs (Try): flag the catch variable as assigned
16617 * expression.cs (Cast): Simplified by using ResolveType instead of
16618 manually resolving.
16620 * statement.cs (Catch): Fix bug by using ResolveType.
16622 2002-09-06 Ravi Pratap <ravi@ximian.com>
16624 * expression.cs (BetterConversion): Special case for when we have
16625 a NullLiteral as the argument and we have to choose between string
16626 and object types - we choose string the way csc does.
16628 * attribute.cs (Attribute.Resolve): Catch the
16629 NullReferenceException and report error #182 since the Mono
16630 runtime no more has the bug and having this exception raised means
16631 we tried to select a constructor which takes an object and is
16634 2002-09-05 Ravi Pratap <ravi@ximian.com>
16636 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16637 message (1502, 1503) when we can't locate a method after overload
16638 resolution. This is much more informative and closes the bug
16641 * interface.cs (PopulateMethod): Return if there are no argument
16642 types. Fixes a NullReferenceException bug.
16644 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16645 expressions too. Previously we were checking only in one place for
16646 positional arguments leaving out named arguments.
16648 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16649 type to the enum type is not allowed. Remove code corresponding to
16652 (ConvertNumericExplicit): Allow explicit conversions from
16653 the underlying type to enum type. This precisely follows the spec
16654 and closes a bug filed by Gonzalo.
16656 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16659 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16661 2002-09-03 Miguel de Icaza <miguel@ximian.com>
16663 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16664 it was important that we stored the right value after the
16665 reduction in `converted'.
16667 2002-09-04 Martin Baulig <martin@gnome.org>
16669 * location.cs (Location.SymbolDocument): Use full pathnames for the
16672 2002-08-30 Miguel de Icaza <miguel@ximian.com>
16674 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16675 of the expression resolve mechanism, because that will catch the
16676 SimpleName error failures.
16678 (Conditional): If we can not resolve the
16679 expression, return, do not crash.
16681 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16684 (location): display token name instead of its number.
16686 2002-08-28 Martin Baulig <martin@gnome.org>
16688 * expression.cs (Binary.ResolveOperator): Don't silently return
16689 but return an error if an operator cannot be applied between two
16692 2002-08-28 Martin Baulig <martin@gnome.org>
16694 * class.cs (Constructor.Define): Set the permission attributes
16695 correctly instead of making all constructors public.
16697 2002-08-28 Martin Baulig <martin@gnome.org>
16699 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16700 for private members before reporting a CS0103; if we find anything,
16703 2002-08-28 Martin Baulig <martin@gnome.org>
16705 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16706 to check whether `closure_start_type == closure_invocation_type',
16707 we also need to check whether `m.DeclaringType == closure_invocation_type'
16708 before bypassing the permission checks. We might be accessing
16709 protected/private members from the base class.
16710 (TypeManager.RealMemberLookup): Only set private_ok if private
16711 members were requested via BindingFlags.NonPublic.
16713 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16715 * expression.cs (MemberAccess.ResolveMemberAccess): Set
16716 MethodGroupExpr.IsExplicitImpl if appropriate.
16717 (Invocation.DoResolve): Don't report the CS0120 for explicit
16718 interface implementations.
16720 2002-08-27 Martin Baulig <martin@gnome.org>
16722 * expression.cs (Invocation.DoResolve): If this is a static
16723 method and we don't have an InstanceExpression, we must report
16726 2002-08-25 Martin Baulig <martin@gnome.org>
16728 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
16729 `==' between a valuetype and an object.
16731 2002-08-25 Miguel de Icaza <miguel@ximian.com>
16733 * ecore.cs (TypeExpr): Provide a ToString method.
16735 2002-08-24 Martin Baulig <martin@gnome.org>
16737 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
16738 now called proggie.dbg and it's a binary file.
16740 2002-08-23 Martin Baulig <martin@gnome.org>
16742 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
16744 2002-08-23 Martin Baulig <martin@gnome.org>
16746 * struct.cs (MyStructInfo.ctor): Make this work with empty
16747 structs; it's not allowed to use foreach() on null.
16749 2002-08-23 Martin Baulig <martin@gnome.org>
16751 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
16752 writer the full pathname of the generated assembly.
16754 2002-08-23 Martin Baulig <martin@gnome.org>
16756 * statements.cs (FlowBranching.UsageVector.MergeChildren):
16757 A `finally' block never returns or breaks; improved handling of
16760 2002-08-23 Martin Baulig <martin@gnome.org>
16762 * statement.cs (Throw.Resolve): Allow `throw null'.
16764 2002-08-23 Martin Baulig <martin@gnome.org>
16766 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16767 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16768 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
16769 MemberLookup would return a wrong event if this is an explicit
16770 interface implementation and the class has an event with the same
16773 2002-08-23 Martin Baulig <martin@gnome.org>
16775 * statement.cs (Block.AddChildVariableNames): New public method.
16776 (Block.AddChildVariableName): Likewise.
16777 (Block.IsVariableNameUsedInChildBlock): Likewise.
16778 (Block.AddVariable): Check whether a variable name has already
16779 been used in a child block.
16781 * cs-parser.jay (declare_local_variables): Mark all variable names
16782 from the current block as being used in a child block in the
16785 2002-08-23 Martin Baulig <martin@gnome.org>
16787 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16788 find the symbol writer.
16790 * driver.cs: csc also allows the arguments to /define being
16791 separated by commas, not only by semicolons.
16793 2002-08-23 Martin Baulig <martin@gnome.org>
16795 * interface.cs (Interface.GetMembers): Added static check for events.
16797 2002-08-15 Martin Baulig <martin@gnome.org>
16799 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16800 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16802 * ecore.cs (Expression.MemberLookup): Added documentation and explained
16803 why the MethodData.EmitDestructor() change was necessary.
16805 2002-08-20 Martin Baulig <martin@gnome.org>
16807 * class.cs (TypeContainer.FindMembers): Added static check for events.
16809 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16811 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16812 use Type.GetEvents(), not Type.FindMembers().
16814 2002-08-20 Martin Baulig <martin@gnome.org>
16816 * decl.cs (MemberCache): Added a special method cache which will
16817 be used for method-only searched. This ensures that a method
16818 search will return a MethodInfo with the correct ReflectedType for
16821 2002-08-20 Martin Baulig <martin@gnome.org>
16823 * decl.cs (DeclSpace.FindMembers): Made this public.
16825 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16827 * delegate.cs: fixed build on windows.
16828 [FIXME: Filed as bug #29150: MCS must report these errors.]
16830 2002-08-19 Ravi Pratap <ravi@ximian.com>
16832 * ecore.cs (StandardConversionExists): Return a false
16833 if we are trying to convert the void type to anything else
16834 since that is not allowed.
16836 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16837 we flag error 70 in the event an event is trying to be accessed
16838 directly from outside the declaring type.
16840 2002-08-20 Martin Baulig <martin@gnome.org>
16842 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16843 MemberCache from typemanager.cs to decl.cs.
16845 2002-08-19 Martin Baulig <martin@gnome.org>
16847 * class.cs (TypeContainer): Implement IMemberContainer.
16848 (TypeContainer.DefineMembers): Create the MemberCache.
16849 (TypeContainer.FindMembers): Do better BindingFlags checking; only
16850 return public members if BindingFlags.Public was given, check
16851 whether members are static.
16853 2002-08-16 Martin Baulig <martin@gnome.org>
16855 * decl.cs (DeclSpace.Define): Splitted this in Define and
16856 DefineMembers. DefineMembers is called first and initializes the
16859 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
16860 DefineMembers() on all our DeclSpaces.
16862 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16863 but call DefineMembers() on all nested interfaces. We call their
16864 Define() in our new Define() function.
16866 * interface.cs (Interface): Implement IMemberContainer.
16867 (Interface.Define): Moved all code except the attribute stuf to
16869 (Interface.DefineMembers): Initialize the member cache.
16871 * typemanager.cs (IMemberFinder): Removed this interface, we don't
16872 need this anymore since we can use MemberCache.FindMembers directly.
16874 2002-08-19 Martin Baulig <martin@gnome.org>
16876 * typemanager.cs (MemberCache): When creating the cache for an
16877 interface type, add all inherited members.
16878 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16879 to `out bool used_cache' and documented it.
16880 (TypeManager.MemberLookup): If we already used the cache in the first
16881 iteration, we don't need to do the interfaces check.
16883 2002-08-19 Martin Baulig <martin@gnome.org>
16885 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
16886 here from IMemberFinder and don't implement this interface anymore.
16887 (DeclSpace.MemberCache): Moved here from IMemberFinder.
16889 * typemanager.cs (IMemberFinder): This interface is now only used by
16890 classes which actually support the member cache.
16891 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16892 since we only put DeclSpaces into this Hashtable.
16893 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16894 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16896 2002-08-16 Martin Baulig <martin@gnome.org>
16898 * typemanager.cs (ICachingMemberFinder): Removed.
16899 (IMemberFinder.MemberCache): New property.
16900 (TypeManager.FindMembers): Merged this with RealFindMembers().
16901 This function will never be called from TypeManager.MemberLookup()
16902 so we can't use the cache here, just the IMemberFinder.
16903 (TypeManager.MemberLookup_FindMembers): Check whether the
16904 IMemberFinder has a MemberCache and call the cache's FindMembers
16906 (MemberCache): Rewrote larger parts of this yet another time and
16907 cleaned it up a bit.
16909 2002-08-15 Miguel de Icaza <miguel@ximian.com>
16911 * driver.cs (LoadArgs): Support quoting.
16913 (Usage): Show the CSC-like command line arguments.
16915 Improved a few error messages.
16917 2002-08-15 Martin Baulig <martin@gnome.org>
16919 * typemanager.cs (IMemberContainer.Type): New property.
16920 (IMemberContainer.IsInterface): New property.
16922 The following changes are conditional to BROKEN_RUNTIME, which is
16923 defined at the top of the file.
16925 * typemanager.cs (MemberCache.MemberCache): Don't add the base
16926 class'es members, but add all members from TypeHandle.ObjectType
16927 if we're an interface.
16928 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16929 is the current type.
16930 (MemberCache.CacheEntry.Container): Removed this field.
16931 (TypeHandle.GetMembers): Include inherited members.
16933 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16935 * typemanager.cs: fixed compilation and added a comment on a field that
16938 2002-08-15 Martin Baulig <martin@gnome.org>
16940 * class.cs (ConstructorInitializer.Resolve): In the
16941 Expression.MemberLookup call, use the queried_type as
16944 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16945 declared' attribute, it's always true.
16946 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16947 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16948 temporary wrapper for FindMembers which tells MemberLookup whether
16949 members from the base classes are included in the return value.
16950 This will go away soon.
16951 (TypeManager.MemberLookup): Use this temporary hack here; once the
16952 new MemberCache is completed, we don't need to do the DeclaredOnly
16953 looping here anymore since the MemberCache will take care of this.
16954 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16955 (MemberCache): When creating the MemberCache for a class, get
16956 members from the current class and all its base classes.
16957 (MemberCache.CacheEntry.Container): New field. This is a
16958 temporary hack until the Mono runtime is fixed to distinguish
16959 between ReflectedType and DeclaringType. It allows us to use MCS
16960 with both the MS runtime and the unfixed Mono runtime without
16961 problems and without accecting performance.
16962 (MemberCache.SearchMembers): The DeclaredOnly looping from
16963 TypeManager.MemberLookup is now done here.
16965 2002-08-14 Martin Baulig <martin@gnome.org>
16967 * statement.cs (MyStructInfo.MyStructInfo): Don't call
16968 Type.GetFields on dynamic types but get the fields from the
16969 corresponding TypeContainer.
16970 (MyStructInfo.GetStructInfo): Added check for enum types.
16972 * typemanager.cs (MemberList.IsSynchronized): Implemented.
16973 (MemberList.SyncRoot): Implemented.
16974 (TypeManager.FilterWithClosure): No need to check permissions if
16975 closure_start_type == closure_invocation_type, don't crash if
16976 closure_invocation_type is null.
16978 2002-08-13 Martin Baulig <martin@gnome.org>
16980 Rewrote TypeContainer.FindMembers to use a member cache. This
16981 gives us a speed increase of about 35% for the self-hosting MCS
16982 build and of about 15-20% for the class libs (both on GNU/Linux).
16984 * report.cs (Timer): New class to get enhanced profiling. This
16985 whole class is "TIMER" conditional since it remarkably slows down
16988 * class.cs (MemberList): New class. This is an IList wrapper
16989 which we're now using instead of passing MemberInfo[]'s around to
16990 avoid copying this array unnecessarily.
16991 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16992 (ICachingMemberFinder, IMemberContainer): New interface.
16993 (TypeManager.FilterWithClosure): If `criteria' is null, the name
16994 has already been checked, otherwise use it for the name comparision.
16995 (TypeManager.FindMembers): Renamed to RealMemberFinder and
16996 provided wrapper which tries to use ICachingMemberFinder.FindMembers
16997 if possible. Returns a MemberList, not a MemberInfo [].
16998 (TypeHandle): New class, implements IMemberContainer. We create
16999 one instance of this class per type, it contains a MemberCache
17000 which is used to do the member lookups.
17001 (MemberCache): New class. Each instance of this class contains
17002 all members of a type and a name-based hash table.
17003 (MemberCache.FindMembers): This is our new member lookup
17004 function. First, it looks up all members of the requested name in
17005 the hash table. Then, it walks this list and sorts out all
17006 applicable members and returns them.
17008 2002-08-13 Martin Baulig <martin@gnome.org>
17010 In addition to a nice code cleanup, this gives us a performance
17011 increase of about 1.4% on GNU/Linux - not much, but it's already
17012 half a second for the self-hosting MCS compilation.
17014 * typemanager.cs (IMemberFinder): New interface. It is used by
17015 TypeManager.FindMembers to call FindMembers on a TypeContainer,
17016 Enum, Delegate or Interface.
17017 (TypeManager.finder_to_member_finder): New PtrHashtable.
17018 (TypeManager.finder_to_container): Removed.
17019 (TypeManager.finder_to_delegate): Removed.
17020 (TypeManager.finder_to_interface): Removed.
17021 (TypeManager.finder_to_enum): Removed.
17023 * interface.cs (Interface): Implement IMemberFinder.
17025 * delegate.cs (Delegate): Implement IMemberFinder.
17027 * enum.cs (Enum): Implement IMemberFinder.
17029 * class.cs (TypeContainer): Implement IMemberFinder.
17031 2002-08-12 Martin Baulig <martin@gnome.org>
17033 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
17035 2002-08-12 Martin Baulig <martin@gnome.org>
17037 * ecore.cs (ITypeExpression): New interface for expressions which
17039 (TypeExpression): Renamed to TypeLookupExpression.
17040 (Expression.DoResolve): If we're doing a types-only lookup, the
17041 expression must implement the ITypeExpression interface and we
17042 call DoResolveType() on it.
17043 (SimpleName): Implement the new ITypeExpression interface.
17044 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
17045 hack, the situation that we're only looking up types can't happen
17046 anymore when this method is called. Moved the type lookup code to
17047 DoResolveType() and call it.
17048 (SimpleName.DoResolveType): This ITypeExpression interface method
17049 is now doing the types-only lookup.
17050 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
17051 (ResolveFlags): Added MaskExprClass.
17053 * expression.cs (MemberAccess): Implement the ITypeExpression
17055 (MemberAccess.DoResolve): Added support for a types-only lookup
17056 when we're called via ITypeExpression.DoResolveType().
17057 (ComposedCast): Implement the ITypeExpression interface.
17059 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
17060 Expression.Resolve() with ResolveFlags.Type instead.
17062 2002-08-12 Martin Baulig <martin@gnome.org>
17064 * interface.cs (Interface.Define): Apply attributes.
17066 * attribute.cs (Attribute.ApplyAttributes): Added support for
17067 interface attributes.
17069 2002-08-11 Martin Baulig <martin@gnome.org>
17071 * statement.cs (Block.Emit): Only check the "this" variable if we
17072 do not always throw an exception.
17074 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
17075 whether the property has a set accessor.
17077 2002-08-11 Martin Baulig <martin@gnome.org>
17079 Added control flow analysis support for structs.
17081 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
17082 with control flow analysis turned off.
17083 (IVariable): New interface.
17084 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
17085 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
17086 (FieldExpr.DoResolve): Resolve the instance expression with flow
17087 analysis turned off and do the definite assignment check after the
17088 resolving when we know what the expression will resolve to.
17090 * expression.cs (LocalVariableReference, ParameterReference):
17091 Implement the new IVariable interface, only call the flow analysis
17092 code if ec.DoFlowAnalysis is true.
17093 (This): Added constructor which takes a Block argument. Implement
17094 the new IVariable interface.
17095 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
17096 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
17097 This does the definite assignment checks for struct members.
17099 * class.cs (Constructor.Emit): If this is a non-static `struct'
17100 constructor which doesn't have any initializer, call
17101 Block.AddThisVariable() to tell the flow analysis code that all
17102 struct elements must be initialized before control returns from
17105 * statement.cs (MyStructInfo): New public class.
17106 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
17107 argument to this indexer. If non-zero, check an individual struct
17108 member, not the whole struct.
17109 (FlowBranching.CheckOutParameters): Check struct members.
17110 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
17111 overloaded versions of these methods which take an additional
17112 `int field_idx' argument to check struct members.
17113 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
17114 overloaded versions of these methods which take an additional
17115 `string field_name' argument to check struct member.s
17116 (VariableInfo): Implement the IVariable interface.
17117 (VariableInfo.StructInfo): New public property. Returns the
17118 MyStructInfo instance of the variable if it's a struct or null.
17119 (Block.AddThisVariable): New public method. This is called from
17120 Constructor.Emit() for non-static `struct' constructor which do
17121 not have any initializer. It creates a special variable for the
17122 "this" instance variable which will be checked by the flow
17123 analysis code to ensure that all of the struct's fields are
17124 initialized before control returns from the constructor.
17125 (UsageVector): Added support for struct members. If a
17126 variable/parameter is a struct with N members, we reserve a slot
17127 in the usage vector for each member. A struct is considered fully
17128 initialized if either the struct itself (slot 0) or all its
17129 members are initialized.
17131 2002-08-08 Martin Baulig <martin@gnome.org>
17133 * driver.cs (Driver.MainDriver): Only report an error CS5001
17134 if there were no compilation errors.
17136 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
17137 `UnsafeContext' property to determine whether the parent is in
17138 unsafe context rather than checking the parent's ModFlags:
17139 classes nested in an unsafe class are unsafe as well.
17141 2002-08-08 Martin Baulig <martin@gnome.org>
17143 * statement.cs (UsageVector.MergeChildren): Distinguish between
17144 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
17145 we return. Added test17() and test18() to test-154.cs.
17147 2002-08-08 Martin Baulig <martin@gnome.org>
17149 * typemanager.cs (TypeManager.FilterWithClosure): If we have
17150 Family access, make sure the invoking type isn't a subclass of the
17151 queried type (that'd be a CS1540).
17153 * ecore.cs (Expression.MemberLookup): Added overloaded version of
17154 this method which takes an additional `Type invocation_type'.
17156 * expression.cs (BaseAccess.DoResolve): Use the base type as
17157 invocation and query type.
17158 (MemberAccess.DoResolve): If the lookup failed and we're about to
17159 report a CS0122, try a lookup with the ec.ContainerType - if this
17160 succeeds, we must report a CS1540.
17162 2002-08-08 Martin Baulig <martin@gnome.org>
17164 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
17165 (MethodGroupExpr): Implement the IMemberExpr interface.
17167 * expression (MemberAccess.ResolveMemberAccess): No need to have
17168 any special code for MethodGroupExprs anymore, they're now
17171 2002-08-08 Martin Baulig <martin@gnome.org>
17173 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
17174 Family, FamANDAssem and FamORAssem permissions.
17175 (TypeManager.IsSubclassOrNestedChildOf): New public method.
17177 2002-08-08 Martin Baulig <martin@gnome.org>
17179 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
17180 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
17183 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
17185 * driver.cs: implemented /resource option to embed managed resources.
17187 2002-08-07 Martin Baulig <martin@gnome.org>
17189 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
17190 (FieldBase.HasFieldInitializer): New public property.
17191 (FieldBase.GetInitializerExpression): New public method. Resolves and
17192 returns the field initializer and makes sure it is only resolved once.
17193 (TypeContainer.EmitFieldInitializers): Call
17194 FieldBase.GetInitializerExpression to get the initializer, this ensures
17195 that it isn't resolved multiple times.
17197 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
17198 the resolving process (SimpleName/MemberLookup) that we're currently
17199 emitting a field initializer (which must not access any instance members,
17200 this is an error CS0236).
17202 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
17203 argument, if the `IsFieldInitializer' flag is set, we must report and
17204 error CS0236 and not an error CS0120.
17206 2002-08-07 Martin Baulig <martin@gnome.org>
17208 * ecore.cs (IMemberExpr): New public interface.
17209 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
17210 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
17211 if the expression is an IMemberExpr.
17213 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
17214 to be null, implicitly default to `this' if we're non-static in
17215 this case. Simplified the code a lot by using the new IMemberExpr
17216 interface. Also fixed bug #28176 here.
17218 2002-08-06 Martin Baulig <martin@gnome.org>
17220 * cs-parser.jay (SimpleLookup): Removed. We need to create
17221 ParameterReferences during semantic analysis so that we can do a
17222 type-only search when resolving Cast, TypeOf and SizeOf.
17223 (block): Pass the `current_local_parameters' to the Block's
17226 * class.cs (ConstructorInitializer): Added `Parameters parameters'
17227 argument to the constructor.
17228 (ConstructorInitializer.Resolve): Create a temporary implicit
17229 block with the parameters.
17231 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
17232 references here if we aren't doing a type-only search.
17234 * statement.cs (Block): Added constructor which takes a
17235 `Parameters parameters' argument.
17236 (Block.Parameters): New public property.
17238 * support.cs (InternalParameters.Parameters): Renamed `parameters'
17239 to `Parameters' and made it public readonly.
17241 2002-08-06 Martin Baulig <martin@gnome.org>
17243 * ecore.cs (Expression.Warning): Made this public as well.
17245 * report.cs (Report.Debug): Print the contents of collections.
17247 2002-08-06 Martin Baulig <martin@gnome.org>
17249 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
17250 used to tell Resolve() which kinds of expressions it may return.
17251 (Expression.Resolve): Added overloaded version of this method which
17252 takes a `ResolveFlags flags' argument. This can be used to tell
17253 Resolve() which kinds of expressions it may return. Reports a
17255 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
17256 ResolveFlags.SimpleName.
17257 (Expression.Error118): Added overloaded version of this method which
17258 takes a `ResolveFlags flags' argument. It uses the flags to determine
17259 which kinds of expressions are allowed.
17261 * expression.cs (Argument.ResolveMethodGroup): New public method.
17262 Resolves an argument, but allows a MethodGroup to be returned.
17263 This is used when invoking a delegate.
17265 * TODO: Updated a bit.
17267 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17269 Fixed compilation with csc.
17271 * ecore.cs: Expression.Error made public. Is this correct? Should
17272 Warning be made public too?
17274 * expression.cs: use ea.Location instead of ea.loc.
17275 [FIXME: Filed as bug #28607: MCS must report these errors.]
17277 2002-08-06 Martin Baulig <martin@gnome.org>
17279 * ecore.cs (Expression.loc): Moved the location here instead of
17280 duplicating it in all derived classes.
17281 (Expression.Location): New public property.
17282 (Expression.Error, Expression.Warning): Made them non-static and
17283 removed the location argument.
17284 (Expression.Warning): Added overloaded version which takes an
17285 `int level' argument.
17286 (Expression.Error118): Make this non-static and removed the
17287 expression and location arguments.
17288 (TypeExpr): Added location argument to the constructor.
17290 * expression.cs (StaticCallExpr): Added location argument to
17292 (Indirection, PointerArithmetic): Likewise.
17293 (CheckedExpr, UnCheckedExpr): Likewise.
17294 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
17295 (StringPtr): Likewise.
17298 2002-08-05 Martin Baulig <martin@gnome.org>
17300 * expression.cs (BaseAccess.DoResolve): Actually report errors.
17302 * assign.cs (Assign.DoResolve): Check whether the source
17303 expression is a value or variable.
17305 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
17306 while resolving the corresponding blocks.
17308 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
17309 an error, don't silently return null.
17311 * statement.cs (Block.AddVariable): Do the error reporting here
17312 and distinguish between CS0128 and CS0136.
17313 (Block.DoResolve): Report all unused labels (warning CS0164).
17314 (LabeledStatement): Pass the location to the constructor.
17315 (LabeledStatement.HasBeenReferenced): New property.
17316 (LabeledStatement.Resolve): Set it to true here.
17318 * statement.cs (Return.Emit): Return success even after reporting
17319 a type mismatch error (CS0126 or CS0127), this is what csc does and
17320 it avoids confusing the users with any consecutive errors.
17322 2002-08-05 Martin Baulig <martin@gnome.org>
17324 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
17326 * const.cs (Const.LookupConstantValue): Catch circular definitions.
17328 * expression.cs (MemberAccess.DoResolve): Silently return if an
17329 error has already been reported.
17331 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
17332 error has already been reported.
17334 2002-08-05 Martin Baulig <martin@gnome.org>
17336 * statement.cs (UsageVector): Only initialize the `parameters'
17337 vector if we actually have any "out" parameters.
17339 2002-08-05 Martin Baulig <martin@gnome.org>
17341 * expression.cs (Binary.ResolveOperator): When combining delegates,
17342 they must have the same type.
17344 2002-08-05 Martin Baulig <martin@gnome.org>
17346 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
17347 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
17348 work with the ms runtime and we also don't need it: if we're a
17349 PropertyBuilder and not in the `indexer_arguments' hash, then we
17350 are a property and not an indexer.
17352 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
17353 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
17354 since the latter one doesn't work with the ms runtime.
17356 2002-08-03 Martin Baulig <martin@gnome.org>
17358 Fixed bugs #27998 and #22735.
17360 * class.cs (Method.IsOperator): New public field.
17361 (Method.CheckBase): Report CS0111 if there's already a method
17362 with the same parameters in the current class. Report CS0508 when
17363 attempting to change the return type of an inherited method.
17364 (MethodData.Emit): Report CS0179 if a method doesn't have a body
17365 and it's not marked abstract or extern.
17366 (PropertyBase): New abstract base class for Property and Indexer.
17367 (PropertyBase.CheckBase): Moved here from Property and made it work
17369 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
17370 the same so we can reuse it there.
17371 (Property, Indexer): Derive from PropertyBase.
17372 (MethodSignature.inheritable_property_signature_filter): New delegate
17373 to find properties and indexers.
17375 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
17376 argument and improved error reporting.
17378 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
17379 EmptyReadOnlyParameters and made it a property.
17381 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
17382 version of this method which takes a `PropertyInfo indexer'.
17383 (TypeManager.RegisterIndexer): New method.
17385 * class.cs: Added myself as author of this file :-)
17387 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17389 * class.cs: fixed compilation on windoze.
17391 2002-08-03 Martin Baulig <martin@gnome.org>
17393 * interface.cs (Interface.GetInterfaceBases): Check whether all
17394 base interfaces are at least as accessible than the current one.
17396 * class.cs (TypeContainer.GetClassBases): Check whether base types
17397 are at least as accessible than the current type.
17398 (TypeContainer.AsAccessible): Implemented and made non-static.
17399 (MemberBase.CheckParameters): Report errors if the accessibility
17402 * delegate.cs (Delegate.Delegate): The default visibility is
17403 internal for top-level types and private for nested types.
17404 (Delegate.Define): Report errors if the accessibility checks fail.
17406 * enum.cs (Enum.Enum): The default visibility is internal for
17407 top-level types and private for nested types.
17408 (Enum.DefineType): Compute the correct visibility.
17410 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
17411 function which takes a `bool is_toplevel' instead of a TypeContainer.
17413 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
17416 2002-08-02 Martin Baulig <martin@gnome.org>
17418 * expression.cs (LocalVariableReferenc): Added constructor which
17419 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
17420 (LocalVariableReference.IsReadOnly): New property.
17421 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
17422 variable is readonly, use our own readonly flag to do this; you can
17423 use the new constructor to get a writable reference to a read-only
17426 * cs-parser.jay (foreach_statement, using_statement): Get a writable
17427 reference to the local variable.
17429 2002-08-01 Miguel de Icaza <miguel@ximian.com>
17431 * rootcontext.cs (ResolveCore): Also include System.Exception
17433 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
17434 we reach an EmptyStatement.
17436 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
17439 * expression.cs (Binary.ResolveOperator): Check error result in
17442 use brtrue/brfalse directly and avoid compares to null.
17444 2002-08-02 Martin Baulig <martin@gnome.org>
17446 * class.cs (TypeContainer.Define): Define all nested interfaces here.
17447 Fixes bug #28407, added test-155.cs.
17449 2002-08-01 Martin Baulig <martin@gnome.org>
17451 * class.cs (Event.EmitDefaultMethod): Make this work with static
17452 events. Fixes #28311, added verify-3.cs.
17454 2002-08-01 Martin Baulig <martin@gnome.org>
17456 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
17457 `is_disposable' fields.
17458 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
17459 `hm.is_disposable' if we're using the collection pattern.
17460 (Foreach.EmitCollectionForeach): Use the correct type for the
17461 enumerator's local variable, only emit the try/finally block if
17462 necessary (fixes #27713).
17464 2002-08-01 Martin Baulig <martin@gnome.org>
17466 * ecore.cs (Expression.report118): Renamed to Error118 and made
17469 * statement.cs (Throw.Resolve): Check whether the expression is of
17470 the correct type (CS0118) and whether the type derives from
17471 System.Exception (CS0155).
17472 (Catch.Resolve): New method. Do the type lookup here and check
17473 whether it derives from System.Exception (CS0155).
17474 (Catch.CatchType, Catch.IsGeneral): New public properties.
17476 * typemanager.cs (TypeManager.exception_type): Added.
17478 2002-07-31 Miguel de Icaza <miguel@ximian.com>
17480 * driver.cs: Updated About function.
17482 2002-07-31 Martin Baulig <martin@gnome.org>
17484 Implemented Control Flow Analysis.
17486 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17487 (EmitContext.CurrentBranching): Added.
17488 (EmitContext.StartFlowBranching): Added.
17489 (EmitContext.EndFlowBranching): Added.
17490 (EmitContext.KillFlowBranching): Added.
17491 (EmitContext.IsVariableAssigned): Added.
17492 (EmitContext.SetVariableAssigned): Added.
17493 (EmitContext.IsParameterAssigned): Added.
17494 (EmitContext.SetParameterAssigned): Added.
17495 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17496 Added control flow analysis stuff here.
17498 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17499 resolve the expression as lvalue.
17500 (LocalVariableReference.DoResolve): Check whether the variable has
17501 already been assigned.
17502 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17503 the parameter as assigned here.
17504 (ParameterReference.DoResolve): Check whether the parameter has already
17506 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17507 expression as lvalue.
17509 * statement.cs (FlowBranching): New class for the flow analysis code.
17510 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17511 (LabeledStatement.IsDefined): New public property.
17512 (LabeledStatement.AddUsageVector): New public method to tell flow
17513 analyis that the label may be reached via a forward jump.
17514 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17516 (VariableInfo.Number): New public field. This is used by flow analysis
17517 to number all locals of a block.
17518 (Block.CountVariables): New public property. This is the number of
17519 local variables in this block (including the locals from all parent
17521 (Block.EmitMeta): Number all the variables.
17523 * statement.cs: Added flow analysis support to all classes.
17525 2002-07-31 Martin Baulig <martin@gnome.org>
17527 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
17528 To get debugging messages, compile mcs with /define:MCS_DEBUG and
17529 then use this argument.
17531 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17533 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17534 use this to specify /define options.
17536 2002-07-29 Martin Baulig <martin@gnome.org>
17538 * statement.cs (Fixed): Moved all code that does variable lookups
17539 and resolvings from Emit to Resolve.
17541 * statement.cs (For): Moved all code that does variable lookups
17542 and resolvings from Emit to Resolve.
17544 * statement.cs (Using): Moved all code that does variable lookups
17545 and resolvings from Emit to Resolve.
17547 2002-07-29 Martin Baulig <martin@gnome.org>
17549 * attribute.cs (Attribute.Resolve): Explicitly catch a
17550 System.NullReferenceException when creating the
17551 CustromAttributeBuilder and report a different warning message.
17553 2002-07-29 Martin Baulig <martin@gnome.org>
17555 * support.cs (ParameterData.ParameterName): Added method to
17556 get the name of a parameter.
17558 * typemanager.cs (TypeManager.IsValueType): New public method.
17560 2002-07-29 Martin Baulig <martin@gnome.org>
17562 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
17563 is a flag which specifies that it's either ref or out.
17564 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
17565 the out parameter to `out Parameter.Modifier mod', also set the
17566 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17568 * support.cs (InternalParameters.ParameterModifier): Distinguish
17569 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17570 Parameter.Modifier.ISBYREF flag if it's either ref or out.
17572 * expression.cs (Argument.GetParameterModifier): Distinguish
17573 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17574 Parameter.Modifier.ISBYREF flag if it's either ref or out.
17576 2002-07-29 Martin Baulig <martin@gnome.org>
17578 * expression.cs (ParameterReference.ParameterReference): Added
17579 `Location loc' argument to the constructor.
17581 * cs-parser.jay: Pass location to ParameterReference.
17583 2002-07-28 Miguel de Icaza <miguel@ximian.com>
17585 * statement.cs (Try): Initialize the location.
17587 * cs-parser.jay: pass location to Try.
17589 * expression.cs (Unary.Reduce): Change the prototype to return
17590 whether a constant fold could be performed or not. The result is
17591 returned in an out parameters. In the case of Indirection and
17592 AddressOf, we want to perform the full tests.
17594 2002-07-26 Miguel de Icaza <miguel@ximian.com>
17596 * statement.cs (Statement.Emit): Flag dead code.
17598 2002-07-27 Andrew Birkett <andy@nobugs.org>
17600 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17602 2002-07-27 Martin Baulig <martin@gnome.org>
17604 * class.cs (MethodData.Define): Put back call to
17605 TypeManager.AddMethod(), accidentally commented this out.
17607 * report.cs (Debug): New public method to print debugging information,
17608 this is `[Conditional ("DEBUG")]'.
17610 2002-07-26 Martin Baulig <martin@gnome.org>
17612 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17613 (switch_statement): Push the current_block to the switch_stack and
17614 pop it again when we're done with the switch.
17615 (switch_section): The new block is a child of the current_block.
17616 Fixes bug #24007, added test-152.cs.
17618 2002-07-27 Martin Baulig <martin@gnome.org>
17620 * expression.cs (Invocation.EmitArguments): When calling a varargs
17621 function with only its fixed arguments, we need to pass an empty
17624 2002-07-27 Martin Baulig <martin@gnome.org>
17626 Mono 0.13 has been released.
17628 2002-07-25 Miguel de Icaza <miguel@ximian.com>
17630 * driver.cs: Rename --resource to --linkres, because that is what
17631 we do currently, we dont support --resource yet.
17633 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17635 2002-07-25 Martin Baulig <martin@gnome.org>
17637 * class.cs (MethodData): New public class. This is a `method builder'
17638 class for a method or one accessor of a Property/Indexer/Event.
17639 (MethodData.GetMethodFlags): Moved here from MemberBase.
17640 (MethodData.ApplyAttributes): Likewise.
17641 (MethodData.ApplyObsoleteAttribute): Likewise.
17642 (MethodData.ApplyConditionalAttribute): Likewise.
17643 (MethodData.ApplyDllImportAttribute): Likewise.
17644 (MethodData.CheckAbstractAndExternal): Likewise.
17645 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17646 (MethodData.Emit): Formerly known as Method.Emit().
17647 (MemberBase): Moved everything which was specific to a single
17648 accessor/method to MethodData.
17649 (Method): Create a new MethodData and call Define() and Emit() on it.
17650 (Property, Indexer, Event): Create a new MethodData objects for each
17651 accessor and call Define() and Emit() on them.
17653 2002-07-25 Martin Baulig <martin@gnome.org>
17655 Made MethodCore derive from MemberBase to reuse the code from there.
17656 MemberBase now also checks for attributes.
17658 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17659 (MemberBase.GetMethodFlags): Moved here from class Method and marked
17661 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17662 `CallingConventions cc' and `Attributes opt_attrs' arguments.
17663 (MemberBase.ApplyAttributes): New virtual method; applies the
17664 attributes to a method or accessor.
17665 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17666 (MemberBase.ApplyConditionalAttribute): Likewise.
17667 (MemberBase.ApplyDllImportAttribute): Likewise.
17668 (MemberBase.CheckAbstractAndExternal): Likewise.
17669 (MethodCore.ParameterTypes): This is now a property instead of a
17670 method, it's initialized from DoDefineParameters().
17671 (MethodCore.ParameterInfo): Removed the set accessor.
17672 (MethodCore.DoDefineParameters): New protected virtual method to
17673 initialize ParameterTypes and ParameterInfo.
17674 (Method.GetReturnType): We can now simply return the MemberType.
17675 (Method.GetMethodFlags): Override the MemberBase version and add
17676 the conditional flags.
17677 (Method.CheckBase): Moved some code from Define() here, call
17678 DoDefineParameters() here.
17679 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17680 here to avoid some larger code duplication.
17681 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17682 ensure that abstract and external accessors don't declare a body.
17684 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17685 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17686 lookup in the attribute's parent classes, so we need to abort as soon
17687 as we found the first match.
17688 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17689 the attribute has no arguments.
17691 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17694 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17696 * cs-parser.jay: reverted previous patch.
17698 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17700 * cs-parser.jay: fixed bug #22119.
17702 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17704 * attribute.cs: fixed compilation. The error was:
17705 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
17706 be assigned to before control leaves the current method."
17707 [FIXME: Filed as bug #28186: MCS must report this error.]
17709 2002-07-25 Martin Baulig <martin@gnome.org>
17711 * attribute.cs (Attribute.Conditional_GetConditionName): New static
17712 method to pull the condition name ouf of a Conditional attribute.
17713 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17714 the obsolete message and error flag out of an Obsolete attribute.
17716 * class.cs (Method.GetMethodFlags): New public method to get the
17717 TypeManager.MethodFlags for this method.
17718 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17720 (Method.Define): Get and apply the Obsolete and Conditional attributes;
17721 if we're overriding a virtual function, set the new private variable
17722 `parent_method'; call the new TypeManager.AddMethod().
17724 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
17725 the MethodBuilder and the Method in a PtrHashtable.
17726 (TypeManager.builder_to_method): Added for this purpose.
17727 (TypeManager.MethodFlags): Added IsObsoleteError.
17728 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
17729 Obsolete and Conditional arguments in MethodBuilders. If we discover
17730 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
17731 the message from the attribute.
17733 2002-07-24 Martin Baulig <martin@gnome.org>
17735 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
17736 preprocessor directives, ensure that the argument to #define/#undef is
17737 exactly one identifier and that it's actually an identifier.
17739 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
17742 2002-07-24 Martin Baulig <martin@gnome.org>
17744 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
17745 initialize it to TypeManager.object_type in the constructor.
17746 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
17747 of the `hm.get_current' method if we're using the collection pattern.
17748 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
17749 for the explicit conversion to make it work when we're using the collection
17750 pattern and the `Current' property has a different return type than `object'.
17753 2002-07-24 Martin Baulig <martin@gnome.org>
17755 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17756 does not match, but don't report any errors. This method is called in
17757 order for all methods in a MethodGroupExpr until a matching method is
17758 found, so we don't want to bail out if the first method doesn't match.
17759 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17760 matches, report the 123. Fixes #28070.
17762 2002-07-24 Martin Baulig <martin@gnome.org>
17764 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17765 TypeManager.TypeToCoreType() to the top of the method so the
17766 following equality checks will work. Fixes #28107.
17768 2002-07-24 Martin Baulig <martin@gnome.org>
17770 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17771 operand is of type uint, and the other operand is of type sbyte,
17772 short or int, the operands are converted to type long." -
17773 Actually do what this comment already told us. Fixes bug #28106,
17776 2002-07-24 Martin Baulig <martin@gnome.org>
17778 * class.cs (MethodBase): New abstract class. This is now a base
17779 class for Property, Indexer and Event to avoid some code duplication
17780 in their Define() and DefineMethods() methods.
17781 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17782 generic methods for Define() and DefineMethods().
17783 (FieldBase): Derive from MemberBase, not MemberCore.
17784 (Property): Derive from MemberBase, not MemberCore.
17785 (Property.DefineMethod): Moved all the code from this method to the
17786 new MethodBase.DefineAccessor(), just call it with appropriate
17788 (Property.Define): Call the new Property.DoDefine(), this does some
17789 sanity checks and we don't need to duplicate the code everywhere.
17790 (Event): Derive from MemberBase, not MemberCore.
17791 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17792 accessors, this will also make them work with interface events.
17793 (Indexer): Derive from MemberBase, not MemberCore.
17794 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17795 (Indexer.Define): Use the new MethodBase functions.
17797 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17798 argument to the constructor.
17799 (Interface.FindMembers): Added support for interface events.
17800 (Interface.PopluateEvent): Implemented.
17802 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
17804 2002-07-22 Miguel de Icaza <miguel@ximian.com>
17806 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17807 but this is required to check for a method name being the same as
17808 the containing class.
17812 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17814 * interface.cs: initialize variable.
17816 2002-07-23 Martin Baulig <martin@gnome.org>
17818 Implemented the IndexerName attribute in interfaces.
17820 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17821 name if this is an explicit interface implementation.
17822 (Indexer.InterfaceIndexerName): New public variable. If we're
17823 implementing an interface indexer, this is the IndexerName in that
17824 interface. Otherwise, it's the IndexerName.
17825 (Indexer.DefineMethod): If we're implementing interface indexer,
17826 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
17827 and Pending.ImplementIndexer methods.
17828 (Indexer.Define): Also define the PropertyBuilder if we're
17829 implementing an interface indexer and this is neither an explicit
17830 interface implementation nor do the IndexerName match the one in
17833 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17834 If a method is defined here, then we always need to create a proxy
17835 for it. This is used when implementing interface indexers.
17836 (Pending.IsInterfaceIndexer): New public method.
17837 (Pending.ImplementIndexer): New public method.
17838 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17839 This is used when implementing interface indexers to define a proxy
17841 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17842 define a proxy if necessary.
17844 * interface.cs (Interface.IndexerName): New public variable.
17845 (Interface.PopulateIndexer): Set the IndexerName.
17846 (Interface.DefineIndexers): New private method. Populate all the
17847 indexers and make sure their IndexerNames match.
17849 * typemanager.cs (IndexerPropertyName): Added support for interface
17852 2002-07-22 Martin Baulig <martin@gnome.org>
17854 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17855 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17856 ret if HasReturnLabel.
17857 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17860 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17861 and set the ec.LoopBeginTryCatchLevel.
17862 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17863 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17864 the current ec.TryCatchLevel, the branch goes out of an exception
17865 block. In this case, we need to use Leave and not Br.
17867 2002-07-22 Martin Baulig <martin@gnome.org>
17869 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17870 block unless the block does not always return or it is contained in
17871 another try { ... } catch { ... } block. Fixes bug #26506.
17872 Added verify-1.cs to the test suite.
17874 2002-07-22 Martin Baulig <martin@gnome.org>
17876 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17877 then we do not always return. Fixes bug #24985.
17879 2002-07-22 Martin Baulig <martin@gnome.org>
17881 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17882 lookup on a per-class level; ie. walk up the class hierarchy until we
17883 found at least one applicable method, then choose the best among them.
17884 Fixes bug #24463 and test-29.cs.
17886 2002-07-22 Martin Baulig <martin@gnome.org>
17888 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17889 return types of the methods. The return type is not part of the
17890 signature and we must not check it to make the `new' modifier work.
17891 Fixes bug #27999, also added test-147.cs.
17892 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17894 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17895 on the method's return type.
17897 2002-07-21 Martin Baulig <martin@gnome.org>
17899 * assign.cs: Make this work if the rightmost source is a constant and
17900 we need to do an implicit type conversion. Also adding a few more tests
17901 to test-38.cs which should have caught this.
17903 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17904 target in the makefile for this. The makefile.gnu is primarily intended
17905 for end-users who don't want to debug the compiler.
17907 2002-07-21 Martin Baulig <martin@gnome.org>
17909 * assign.cs: Improved the Assign class so it can now handle embedded
17910 assignments (X = Y = Z = something). As a side-effect this'll now also
17911 consume less local variables. test-38.cs now passes with MCS, added
17912 a few new test cases to that test.
17914 2002-07-20 Martin Baulig <martin@gnome.org>
17916 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17917 instructions. Fixes bug #27977, also added test-146.cs.
17919 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17921 * cs-tokenizer.cs: fixed getHex ().
17923 2002-07-19 Martin Baulig <martin@gnome.org>
17925 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17926 not Type.GetType() to lookup the array type. This is needed when
17927 we're constructing an array of a user-defined type.
17928 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17929 single-dimensional arrays, but also for single-dimensial arrays of
17932 2002-07-19 Martin Baulig <martin@gnome.org>
17934 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17935 this function is called, it's not allowed to share LocalBuilders
17936 among ILGenerators.
17938 2002-07-19 Martin Baulig <martin@gnome.org>
17940 * expression.cs (Argument.Resolve): Report an error 118 when trying
17941 to pass a type as argument.
17943 2002-07-18 Martin Baulig <martin@gnome.org>
17945 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17946 Conv_R_Un for the signed `long' type.
17948 2002-07-15 Miguel de Icaza <miguel@ximian.com>
17950 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17951 `expr' for the temporary result, as that will fail if we do
17952 multiple resolves on the same expression.
17954 2002-07-05 Miguel de Icaza <miguel@ximian.com>
17956 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17957 ec.TypeContainer for looking up aliases.
17959 * class.cs (TypeContainer): Remove LookupAlias from here.
17961 * decl.cs (DeclSpace); Move here.
17963 2002-07-01 Miguel de Icaza <miguel@ximian.com>
17965 * class.cs (FindMembers): Only call filter if the constructor
17966 bulider is not null.
17968 Also handle delegates in `NestedTypes' now. Now we will perform
17969 type lookups using the standard resolution process. This also
17972 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17973 This uses Expressions (the limited kind that can be parsed by the
17974 tree) instead of strings.
17976 * expression.cs (ComposedCast.ToString): Implement, used to flag
17977 errors since now we have to render expressions.
17979 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
17982 * ecore.cs (SimpleName.ToString): ditto.
17984 * cs-parser.jay: Instead of using strings to assemble types, use
17985 Expressions to assemble the type (using SimpleName, ComposedCast,
17986 MemberAccess). This should fix the type lookups in declarations,
17987 because we were using a different code path for this.
17989 * statement.cs (Block.Resolve): Continue processing statements
17990 even when there is an error.
17992 2002-07-17 Miguel de Icaza <miguel@ximian.com>
17994 * class.cs (Event.Define): Also remove the `remove' method from
17995 the list of pending items.
17997 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17998 generate more compact code.
18000 2002-07-17 Martin Baulig <martin@gnome.org>
18002 * const.cs (Const.LookupConstantValue): Add support for constant
18003 `unchecked' and `checked' expressions.
18004 Also adding test case test-140.cs for this.
18006 2002-07-17 Martin Baulig <martin@gnome.org>
18008 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
18009 check whether mi.ReturnType implements the IEnumerator interface; the
18010 `==' and the IsAssignableFrom() will fail in this situation.
18012 2002-07-16 Ravi Pratap <ravi@ximian.com>
18014 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
18017 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18019 * expression.cs: fixed bug #27811.
18021 2002-07-14 Miguel de Icaza <miguel@ximian.com>
18023 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
18024 Molaro: when we are a ref, the value already contains a pointer
18025 value, do not take the address of it.
18027 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18028 * removed mb-parser.jay and mb-tokenizer.cs
18030 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18032 * expression.cs: check against the building corlib void type.
18034 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
18036 * ecore.cs: fix for valuetype static readonly fields: when
18037 initializing them, we need their address, not the address of a copy.
18039 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
18041 * typemanager.cs: register also enum_type in corlib.
18043 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18045 * class.cs: allow calling this (but not base) initializers in structs.
18047 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
18049 * ecore.cs: make sure we compare against the building base types
18052 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
18054 * typemanager.cs: fix TypeToCoreType() to handle void and object
18055 (corlib gets no more typerefs after this change).
18057 2002-07-12 Miguel de Icaza <miguel@ximian.com>
18059 * expression.cs (ArrayCreation.EmitArrayArguments): use
18060 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
18062 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
18063 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
18064 array indexes, the runtime actually forbids them.
18066 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
18067 for array arguments here.
18069 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
18070 instead of the default for ValueTypes.
18072 (New.DoEmit): Use IsValueType instead of
18073 IsSubclassOf (value_type)
18074 (New.DoResolve): ditto.
18075 (Invocation.EmitCall): ditto.
18077 * assign.cs (Assign): ditto.
18079 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
18080 Statements *are* currently doing part of their resolution during
18083 Expressions do always resolve during resolve, but statements are
18084 only required to propagate resolution to their children.
18086 2002-07-11 Miguel de Icaza <miguel@ximian.com>
18088 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
18090 (LoadAssembly): Do not add the dll if it is already specified
18092 (MainDriver): Add the System directory to the link path at the end,
18093 after all the other -L arguments.
18095 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
18096 wrong opcode for loading bytes and bools (ldelem.i1 instead of
18097 ldelem.u1) and using the opposite for sbytes.
18099 This fixes Digger, and we can finally run it.
18101 * driver.cs (UnixParseOption): Move the option parsing here.
18102 (CSCParseOption): Implement CSC-like parsing of options.
18104 We now support both modes of operation, the old Unix way, and the
18105 new CSC-like way. This should help those who wanted to make cross
18106 platform makefiles.
18108 The only thing broken is that /r:, /reference: and /lib: are not
18109 implemented, because I want to make those have the same semantics
18110 as the CSC compiler has, and kill once and for all the confussion
18111 around this. Will be doing this tomorrow.
18113 * statement.cs (Unsafe.Resolve): The state is checked during
18114 resolve, not emit, so we have to set the flags for IsUnsfe here.
18116 2002-07-10 Miguel de Icaza <miguel@ximian.com>
18118 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
18119 not catch the Error_ObjectRefRequired in SimpleName (as it is
18120 possible to have a class/instance variable name that later gets
18121 deambiguated), we have to check this here.
18123 2002-07-10 Ravi Pratap <ravi@ximian.com>
18125 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
18126 make static and put into Expression.
18128 (Event.Define): Register the private field of the event with the
18129 TypeManager so that GetFieldFromEvent can get at it.
18131 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
18132 keep track of the private field associated with an event which
18135 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
18138 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
18140 2002-07-10 Miguel de Icaza <miguel@ximian.com>
18142 * expression.cs (Binary.EmitBranchable): this routine emits the
18143 Binary expression in a branchable context. This basically means:
18144 we need to branch somewhere, not just get the value on the stack.
18146 This works together with Statement.EmitBoolExpression.
18148 * statement.cs (Statement.EmitBoolExpression): Use
18151 2002-07-09 Miguel de Icaza <miguel@ximian.com>
18153 * statement.cs (For): Reduce the number of jumps in loops.
18155 (For): Implement loop inversion for the For statement.
18157 (Break): We can be breaking out of a Try/Catch controlled section
18158 (foreach might have an implicit try/catch clause), so we need to
18159 use Leave instead of Br.
18161 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
18162 now). If the instace expression supports IMemoryLocation, we use
18163 the AddressOf method from the IMemoryLocation to extract the
18164 address instead of emitting the instance.
18166 This showed up with `This', as we were emitting the instance
18167 always (Emit) instead of the Address of This. Particularly
18168 interesting when This is a value type, as we dont want the Emit
18169 effect (which was to load the object).
18171 2002-07-08 Miguel de Icaza <miguel@ximian.com>
18173 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
18175 * statement.cs (Checked): Set the CheckedState during the resolve
18176 process too, as the ConvCast operations track the checked state on
18177 the resolve process, and not emit.
18179 * cs-parser.jay (namespace_member_declaration): Flag that we have
18180 found a declaration when we do. This is used to flag error 1529
18182 * driver.cs: Report ok when we display the help only.
18184 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
18186 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
18188 2002-07-04 Miguel de Icaza <miguel@ximian.com>
18190 * cs-tokenizer.cs (define): We also have to track locally the
18191 defines. AllDefines is just used for the Conditional Attribute,
18192 but we also need the local defines for the current source code.
18194 2002-07-03 Miguel de Icaza <miguel@ximian.com>
18196 * statement.cs (While, For, Do): These loops can exit through a
18197 Break statement, use this information to tell whether the
18198 statement is the last piece of code.
18200 (Break): Flag that we break.
18202 * codegen.cs (EmitContexts): New `Breaks' state variable.
18204 2002-07-03 Martin Baulig <martin@gnome.org>
18206 * class.cs (TypeContainer.MethodModifiersValid): Allow override
18207 modifiers in method declarations in structs. Otherwise, you won't
18208 be able to override things like Object.Equals().
18210 2002-07-02 Miguel de Icaza <miguel@ximian.com>
18212 * class.cs (Method, Property, Indexer): Do not allow the public
18213 modifier to be used in explicit interface implementations.
18215 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
18216 override modifiers in method declarations in structs
18218 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
18220 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
18221 integer or real overflow, report an error
18223 2002-07-02 Martin Baulig <martin@gnome.org>
18225 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
18226 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
18227 to tell the runtime about our newly created System.Object and
18228 System.ValueType types.
18230 2002-07-02 Miguel de Icaza <miguel@ximian.com>
18232 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
18233 struct instead of Ldarg/Starg.
18235 2002-07-02 Martin Baulig <martin@gnome.org>
18237 * expression.cs (Indirection.Indirection): Call
18238 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
18240 2002-07-02 Martin Baulig <martin@gnome.org>
18242 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
18243 ValueType, call TypeManager.TypeToCoreType() on it.
18244 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
18245 the OpCodes.Newarr argument.
18247 2002-07-02 Martin Baulig <martin@gnome.org>
18249 * expression.cs (Invocation.EmitCall): When compiling corlib,
18250 replace all calls to the system's System.Array type to calls to
18251 the newly created one.
18253 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
18254 System.Array methods.
18255 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
18256 from the system's System.Array type which must be replaced.
18258 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
18260 * typemanager.cs: load unverifiable_code_ctor so we can build
18261 corlib using the correct type. Avoid using GetTypeCode() with
18263 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
18264 TypeManager.object_type to allow building corlib.
18266 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
18268 * ecore.cs: handle System.Enum separately in LoadFromPtr().
18270 2002-07-01 Martin Baulig <martin@gnome.org>
18272 * class.cs: Make the last change actually work, we need to check
18273 whether `ifaces != null' to avoid a crash.
18275 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18277 * class.cs: when we build structs without fields that implement
18278 interfaces, we need to add the interfaces separately, since there is
18279 no API to both set the size and add the interfaces at type creation
18282 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18284 * expression.cs: the dimension arguments to the array constructors
18285 need to be converted if they are a long.
18287 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
18289 * class.cs: don't emit ldarg.0 if there is no parent constructor
18290 (fixes showstopper for corlib).
18292 2002-06-29 Martin Baulig <martin@gnome.org>
18294 MCS now compiles corlib on GNU/Linux :-)
18296 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
18297 ie. check for MethodImplOptions.InternalCall.
18299 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
18300 and TypeManager.attribute_type are null, so we must explicitly check
18301 whether parent is not null to find out whether it's an attribute type.
18302 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
18303 and SetBuilder, not only if the property is neither abstract nor external.
18304 This is necessary to set the MethodImplOptions on the accessor methods.
18305 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
18306 SetBuilder, see Property.Emit().
18308 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
18309 populate "System.Object", "System.ValueType" and "System.Attribute" since
18310 they've already been populated from BootCorlib_PopulateCoreTypes().
18312 2002-06-29 Martin Baulig <martin@gnome.org>
18314 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
18315 is the NullLiteral, we also need to make sure that target_type is not
18318 2002-06-29 Martin Baulig <martin@gnome.org>
18320 * rootcontext.cs (RootContext.ResolveCore): We must initialize
18321 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
18322 before calling BootstrapCorlib_ResolveDelegate ().
18324 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18326 * statement.cs: fixed build-breaker. All tests passed ok.
18328 2002-06-27 Martin Baulig <martin@gnome.org>
18330 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
18331 for System.Decimal when compiling corlib.
18333 2002-06-27 Martin Baulig <martin@gnome.org>
18335 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
18336 switch blocks which contain nothing but a default clause.
18338 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
18340 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
18342 2002-06-27 Martin Baulig <martin@gnome.org>
18344 * ecore.cs (PropertyExpr.PropertyExpr): Call
18345 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
18347 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
18348 is already a TypeBuilder.
18350 2002-06-27 Martin Baulig <martin@gnome.org>
18352 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
18353 `target_type == TypeManager.array_type', not IsAssignableFrom() in
18354 the "from an array-type to System.Array" case. This makes it work
18355 when compiling corlib.
18357 2002-06-27 Martin Baulig <martin@gnome.org>
18359 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
18360 non-static PropertyExpr, set its InstanceExpression. This makes
18361 the `ICollection.Count' property work in System/Array.cs.
18363 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
18365 * driver.cs: Made error handling more consistent. Errors now
18366 tracked by Report class, so many methods which used to return int
18367 now return void. Main() now prints success/failure and
18368 errors/warnings message.
18370 Renamed '--probe' compiler argument to '--expect-error'. Removed
18371 the magic number return values (123 and 124). Now, if the
18372 expected error occurs, the compiler exits with success (exit value
18373 0). If the compilation completes without seeing that particular
18374 error, the compiler exits with failure (exit value 1). The
18375 makefile in mcs/errors has been changed to handle the new behaviour.
18377 * report.cs: Made 'expected error' number a property and renamed
18378 it from 'Probe' to 'ExpectedError'.
18380 * genericparser.cs: Removed error handling support, since it is
18381 now all done by Report class.
18383 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
18384 class, so parse() no longer returns an int.
18386 * namespace.cs: Use Report.Error instead of GenericParser.error
18388 2002-06-22 Miguel de Icaza <miguel@ximian.com>
18390 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
18391 TypeContainer.AddOperator): At the front of the list put the
18392 explicit implementations, so they get resolved/defined first.
18394 2002-06-21 Miguel de Icaza <miguel@ximian.com>
18396 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
18397 interface type is implemented by this TypeContainer. Used during
18398 explicit interface implementation.
18400 (Property.Define, Indexer.Define, Method.Define): Validate that
18401 the given interface in the explicit implementation is one of the
18402 base classes for the containing type.
18404 Also if we are explicitly implementing an interface, but there is
18405 no match in the pending implementation table, report an error.
18407 (Property.Define): Only define the property if we are
18408 not explicitly implementing a property from an interface. Use the
18409 correct name also for those properties (the same CSC uses,
18410 although that is really not needed).
18412 (Property.Emit): Do not emit attributes for explicitly implemented
18413 properties, as there is no TypeBuilder.
18415 (Indexer.Emit): ditto.
18417 Hiding then means that we do not really *implement* a pending
18418 implementation, which makes code fail.
18420 2002-06-22 Martin Baulig <martin@gnome.org>
18422 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
18423 the return value of Object.GetType(). [FIXME: we need to do this whenever
18424 we get a type back from the reflection library].
18426 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
18428 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
18430 2002-06-20 Miguel de Icaza <miguel@ximian.com>
18432 * attribute.cs: Return null if we can not look up the type.
18434 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
18435 the interface types found.
18437 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
18438 interface types found.
18440 * typemanager.cs (GetInterfaces): Make this routine returns alll
18441 the interfaces and work around the lame differences between
18442 System.Type and System.Reflection.Emit.TypeBuilder in the results
18443 result for GetInterfaces.
18445 (ExpandInterfaces): Given an array of interface types, expand and
18446 eliminate repeated ocurrences of an interface. This expands in
18447 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
18450 2002-06-21 Martin Baulig <martin@gnome.org>
18452 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
18455 2002-06-21 Martin Baulig <martin@gnome.org>
18457 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
18458 and called with one of the core types, return the corresponding typebuilder for
18461 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18464 2002-06-21 Martin Baulig <martin@gnome.org>
18466 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18467 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18468 (Expression.ConvertReferenceExplicit): Likewise.
18470 * expression.cs (ElementAccess.DoResolve): Likewise.
18471 (ElementAccess.DoResolveLValue): Likewise.
18473 2002-06-10 Martin Baulig <martin@gnome.org>
18475 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18476 add the "value" parameter to the parameter list.
18478 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18481 2002-06-19 Miguel de Icaza <miguel@ximian.com>
18483 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18484 the argument to an int, uint, long or ulong, per the spec. Also
18485 catch negative constants in array creation.
18487 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18489 * class.cs: do not allow the same interface to appear twice in
18490 the definition list.
18492 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18494 * ecore.cs: don't use ldlen with System.Array.
18496 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18498 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18500 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18502 * modifiers.cs: produce correct field attributes for protected
18503 internal. Easy fix so miguel can work on ther harder stuff:-)
18505 2002-06-18 Miguel de Icaza <miguel@ximian.com>
18507 * pending.cs: New file. Move the code from class.cs here.
18508 Support clearning the pending flag for all methods (when not doing
18509 explicit interface implementation).
18511 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18513 * rootcontext.cs: added a couple more types needed to bootstrap.
18515 2002-06-17 Miguel de Icaza <miguel@ximian.com>
18517 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18518 constructor in the type, instead of any constructor in the type
18519 hierarchy. Thanks to Paolo for finding this bug (it showed up as
18520 a bug in the Mono runtime when applying the params attribute).
18522 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18523 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18525 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
18527 * expression.cs (Unary.ResolveOperator): Use TypeManager
18528 to resolve the type.
18530 2002-06-13 Ravi Pratap <ravi@ximian.com>
18532 * cs-parser.jay (enum_member_declaration): Pass in the attributes
18535 * enum.cs (AddEnumMember): Add support to store the attributes associated
18536 with each member too.
18538 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18539 field builders too - this takes care of the enum member case.
18541 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
18543 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
18544 address-of operator on both value types and pointers.
18546 2002-06-10 Martin Baulig <martin@gnome.org>
18548 * interface.cs (Interface.PopulateIndexer): Add the indexer's
18549 PropertyBuilder to the `property_builders' list.
18551 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
18552 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
18553 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
18554 find any indexers which are inherited from an interface.
18556 2002-06-09 Martin Baulig <martin@gnome.org>
18558 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
18559 the same type as the constant if necessary. There's also a test-130.cs
18562 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
18564 * typemanager.cs (TypeManager.ChangeType): Previously known as
18565 Enum.ChangeEnumType().
18567 2002-06-09 Martin Baulig <martin@gnome.org>
18569 * expression.cs (Cast.TryReduce): Added support for consts.
18571 2002-06-08 Ravi Pratap <ravi@ximian.com>
18573 * class.cs (Accessor): Hold attributes information so we can pass
18576 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18577 Modify to pass in attributes attached to the methods.
18579 (add_accessor_declaration, remove_accessor_declaration): Ditto.
18581 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18582 to handle the Accessor kind :-)
18584 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18586 2002-06-08 Martin Baulig <martin@gnome.org>
18588 * expression.cs (Unary.TryReduceNegative): Added support for
18591 2002-06-08 Martin Baulig <martin@gnome.org>
18593 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18594 name can't be found in the `defined_names' - the caller will do a
18595 MemberLookup in this case and thus find methods in System.Enum
18596 such as Enum.IsDefined().
18598 2002-06-08 Martin Baulig <martin@gnome.org>
18600 * enum.cs (Enum.ChangeEnumType): This is a custom version of
18601 Convert.ChangeType() which works with TypeBuilder created types.
18602 (Enum.LookupEnumValue, Enum.Define): Use it here.
18604 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18605 `TypeBuilder.BaseType != null' check.
18606 (TypeContainer.FindMembers): Only lookup parent members if we
18607 actually have a parent.
18608 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18609 (ConstructorInitializer.Resolve): Likewise.
18611 * interface.cs (Interface.FindMembers): Added
18612 `TypeBuilder.BaseType != null' check.
18614 * rootcontext.cs (RootContext.ResolveCore): Added
18615 "System.Runtime.CompilerServices.IndexerNameAttribute" to
18616 classes_second_stage.
18618 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18619 debug_type and trace_type when compiling with --nostdlib.
18621 2002-06-07 Martin Baulig <martin@gnome.org>
18623 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18624 (AddField): Set it to true when adding a non-static field.
18625 (DefineType): Use `have_nonstatic_fields' to find out whether we
18626 have non-static fields, not `Fields != null'.
18628 2002-06-02 Miguel de Icaza <miguel@ximian.com>
18630 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18631 dereferencing a null on the static-field code path)
18633 2002-05-30 Martin Baulig <martin@gnome.org>
18635 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18636 to take command line arguments. Use reflection to call the new
18637 custom `Initialize' function on the symbol writer and pass it the
18638 command line arguments.
18640 * driver.cs (--debug-args): New command line argument to pass command
18641 line arguments to the symbol writer.
18643 2002-05-28 Miguel de Icaza <miguel@ximian.com>
18645 * assign.cs (DoResolve): Forgot to do the implicit conversion to
18646 the target type for indexers and properties. Thanks to Joe for
18649 2002-05-27 Miguel de Icaza <miguel@ximian.com>
18651 * typemanager.cs (MethodFlags): returns the method flags
18652 (Obsolete/ShouldIgnore) that control warning emission and whether
18653 the invocation should be made, or ignored.
18655 * expression.cs (Invocation.Emit): Remove previous hack, we should
18656 not do this on matching a base type, we should do this based on an attribute
18658 Only emit calls to System.Diagnostics.Debug and
18659 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18660 on the command line.
18662 * rootcontext.cs: Global settings for tracing and debugging.
18664 * cs-tokenizer.cs (define): New utility function to track
18665 defines. Set the global settings for TRACE and DEBUG if found.
18667 2002-05-25 Ravi Pratap <ravi@ximian.com>
18669 * interface.cs (Populate*): Pass in the TypeContainer as well as
18670 the DeclSpace as parameters so that we can create EmitContexts and
18671 then use that to apply attributes etc.
18673 (PopulateMethod, PopulateEvent, PopulateProperty)
18674 (PopulateIndexer): Apply attributes everywhere.
18676 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18679 (ApplyAttributes): Update accordingly.
18681 We now apply interface attributes for all members too.
18683 2002-05-26 Miguel de Icaza <miguel@ximian.com>
18685 * class.cs (Indexer.Define); Correctly check if we are explicit
18686 implementation (instead of checking the Name for a ".", we
18687 directly look up if the InterfaceType was specified).
18689 Delay the creation of the PropertyBuilder.
18691 Only create the PropertyBuilder if we are not an explicit
18692 interface implementation. This means that explicit interface
18693 implementation members do not participate in regular function
18694 lookups, and hence fixes another major ambiguity problem in
18695 overload resolution (that was the visible effect).
18697 (DefineMethod): Return whether we are doing an interface
18700 * typemanager.cs: Temporary hack until we get attributes in
18701 interfaces (Ravi is working on that) and we get IndexerName
18702 support in interfaces.
18704 * interface.cs: Register the indexers as properties.
18706 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18707 warning, I have verified that this is a bug in the .NET runtime
18708 (JavaScript suffers of the same problem).
18710 * typemanager.cs (MemberLookup): When looking up members for
18711 interfaces, the parent of an interface is the implicit
18712 System.Object (so we succeed in searches of Object methods in an
18713 interface method invocation. Example: IEnumerable x; x.ToString
18716 2002-05-25 Miguel de Icaza <miguel@ximian.com>
18718 * class.cs (Event): Events should also register if they do
18719 implement the methods that an interface requires.
18721 * typemanager.cs (MemberLookup); use the new GetInterfaces
18724 (GetInterfaces): The code used to lookup interfaces for a type is
18725 used in more than one place, factor it here.
18727 * driver.cs: Track the errors at the bottom of the file, we kept
18730 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
18731 instance if the method we are calling is static!
18733 2002-05-24 Miguel de Icaza <miguel@ximian.com>
18735 * attribute.cs (ApplyAttributes): Make this function filter out
18736 the IndexerName attribute (as that attribute in reality is never
18737 applied) and return the string constant for the IndexerName
18740 * class.cs (TypeContainer.Emit): Validate that all the indexers
18741 have the same IndexerName attribute, and if so, set the
18742 DefaultName attribute on the class.
18744 * typemanager.cs: The return value might contain other stuff (not
18745 only methods). For instance, consider a method with an "Item"
18746 property and an Item method.
18748 * class.cs: If there is a problem with the parameter types,
18751 2002-05-24 Ravi Pratap <ravi@ximian.com>
18753 * ecore.cs (ImplicitConversionExists): Wrapper function which also
18754 looks at user defined conversion after making a call to
18755 StandardConversionExists - we need this for overload resolution.
18757 * expression.cs : Update accordingly the various method calls.
18759 This fixes 2 bugs filed against implicit user defined conversions
18761 2002-05-22 Miguel de Icaza <miguel@ximian.com>
18763 * statement.cs: Track the result of the assignment.
18765 2002-05-21 Miguel de Icaza <miguel@ximian.com>
18767 * expression.cs (MemberAccess): Improved error reporting for
18768 inaccessible members.
18770 2002-05-22 Martin Baulig <martin@gnome.org>
18772 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
18773 itself with debugging support.
18775 2002-05-22 Martin Baulig <martin@gnome.org>
18777 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18778 Removed, this isn't needed anymore.
18780 2002-05-20 Martin Baulig <martin@gnome.org>
18782 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18783 be underlying type for an enum.
18785 2002-05-20 Miguel de Icaza <miguel@ximian.com>
18787 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18788 that splits out the loading of just the core types.
18790 * rootcontext.cs (ResolveCore): Split the struct resolution in
18791 two, so we can load the enumeration underlying types before any
18794 * expression.cs (Is): Bandaid until we fix properly Switch (see
18795 bug #24985 for details).
18797 * typemanager.cs (ImplementsInterface): The hashtable will contain
18798 a null if there are no interfaces implemented.
18800 2002-05-18 Miguel de Icaza <miguel@ximian.com>
18802 * cs-parser.jay (indexer_declarator): It is fine to have array
18805 2002-05-17 Miguel de Icaza <miguel@ximian.com>
18807 * typemanager.cs: (RegisterBuilder): New function used to register
18808 TypeBuilders that implement interfaces. Since
18809 TypeBuilder.GetInterfaces (as usual) does not work with lame
18811 (AddUserType): register interfaces.
18813 (ImplementsInterface): Use the builder_to_ifaces hash if we are
18814 dealing with TypeBuilder. Also, arrays are showing up as
18815 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18816 methods can not be invoked on them!
18818 * ecore.cs (ExplicitReferenceConversionExists): Made public.
18819 (ImplicitReferenceConversionExists): Split out from
18820 StandardConversionExists.
18822 * expression.cs (As): We were only implementing one of the three
18823 cases for the as operator. We now implement them all.
18824 (Is): Implement the various other cases for Is as well.
18826 * typemanager.cs (CACHE): New define used to control if we want or
18827 not the FindMembers cache. Seems to have a negative impact on
18828 performance currently
18830 (MemberLookup): Nested types have full acess to
18831 enclosing type members
18833 Remove code that coped with instance/static returns for events, we
18834 now catch this in RealFindMembers.
18836 (RealFindMembers): only perform static lookup if the instance
18837 lookup did not return a type or an event.
18839 2002-05-17 Miguel de Icaza <miguel@ximian.com>
18841 * assign.cs (CompoundAssign): We pass more semantic information
18842 now to Compound Assignments than we did before: now we have all
18843 the information at hand, and now we resolve the target *before* we
18844 do the expression expansion, which allows the "CacheValue" method
18845 to have the effect we intended (before, a [x] += 1 would generate
18846 two differen ArrayAccess expressions from the ElementAccess,
18847 during the resolution process).
18849 (CompoundAssign.DoResolve): Resolve target and original_source here.
18851 2002-05-16 Miguel de Icaza <miguel@ximian.com>
18853 * expression.cs (ArrayAccess): dropped debugging information.
18855 * typemanager.cs: Small bug fix: I was always returning i_members,
18856 instead of one of i_members or s_members (depending on which had
18859 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
18860 method is invoked before any code generation takes place, and it
18861 is a mechanism to inform that the expression will be invoked more
18862 than once, and that the method should use temporary values to
18863 avoid having side effects
18865 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18867 * ecore.cs (Expression.CacheTemporaries): Provide empty default
18870 * expression.cs (Indirection, ArrayAccess): Add support for
18871 CacheTemporaries in these two bad boys.
18873 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18874 ldobj or ldind_ref.
18875 (StoreFromPtr): Handle stobj as well.
18877 * expression.cs (UnaryMutator): Share more code.
18879 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18880 down: I was not tracking the Filter function as well, which
18881 was affecting the results of the cache.
18883 2002-05-15 Miguel de Icaza <miguel@ximian.com>
18885 * attribute.cs: Remove the hack to handle the CharSet property on
18888 2002-05-14 Miguel de Icaza <miguel@ximian.com>
18890 * attribute.cs (DoResolve): More uglyness, we now only try to
18891 resolve the attribute partially, to extract the CharSet
18892 information (only if we are a StructLayout attribute). Otherwise
18894 (GetExtraTypeInfo): Add some code to conditionally kill in the
18895 future this. I am more and more convinced that the .NET
18896 framework has special code to handle the attribute setting on
18899 * expression.cs (IsParamsMethodApplicable): Revert my previous
18900 foreach change here, it was wrong.
18902 2002-05-13 Miguel de Icaza <miguel@ximian.com>
18904 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18905 (pp_expr): do not abort on unknown input, just return.
18906 (eval): abort if there are pending chars.
18908 * attribute.cs (Attribute.Resolve): Positional parameters are
18909 optional. Deal with that case.
18911 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18912 the Ansi/Unicode/Auto information for the type.
18914 (TypeContainer.DefineType): instantiate the EmitContext here, as
18915 we will be using it during the type definition (to resolve
18916 attributes) and during the emit phase.
18918 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18919 to pull type information out of the attributes
18921 (Attribute.Resolve): track the constructor builder, and allow for
18922 multiple invocations (structs and classes will use this).
18924 * ecore.cs (MemberLookupFinal): new version with all the
18925 parameters customizable.
18927 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18928 constructors. Return if the result value is null (as the error
18929 would have been flagged already by MemberLookupFinal)
18931 Do not allow instances of abstract classes or interfaces to be
18934 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18935 We have to compare the assembly property here when dealing with
18936 FamANDAssem and Assembly access modifiers, because we might be
18937 creating an assembly from *modules* (that means that we are not
18938 getting TypeBuilders for types defined in other modules that are
18939 part of this assembly).
18941 (Method.Emit): If the method is marked abstract and has a body,
18944 (TypeContainer.DefineMembers): If both the defined member and the
18945 parent name match are methods, then do not emit any warnings: let
18946 the Method.Define routine take care of flagging warnings. But if
18947 there is a mismatch (method overrides something else, or method is
18948 overriwritten by something, then emit warning).
18950 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18951 set to null, this means `do not check for the return type on the
18954 (Method.Define): set the return type for the method signature to
18955 null, so that we get methods with the same name and parameters and
18956 different return types. This is used to flag warning 114 (you are
18957 hiding a method, and you probably want to use the new/override
18960 * typemanager.cs (MemberLookup): Implemented proper access
18961 control, closing a long standing set of bug reports. The problem
18962 was that the Framework only has two bits: Public and NonPublic,
18963 and NonPublic includes private and protected methods, but we need
18964 to enforce the FamANDAssem, FamOrAssem and Family.
18966 2002-05-11 Miguel de Icaza <miguel@ximian.com>
18968 * statement.cs (GotoCase): Return true: Ammounts to giving up
18969 knowledge on whether we return or not, and letting the other case
18970 be responsible for it.
18972 2002-05-10 Miguel de Icaza <miguel@ximian.com>
18974 * driver.cs: Do not load directories for each file processed, only
18975 do it if there is a pattern.
18977 * ecore.cs: Report readonly assigns here as well, as we might have
18978 been resolved only by MemberAccess.
18980 (SimpleName.SimpleNameResolve): Also be useful for LValue
18981 resolution. We need this to propagate assign to local readonly variables
18983 * typemanager.cs: Use a ptrhashtable for the criteria, because we
18984 do not want to reuse potential criteria memory.
18986 * class.cs (MyEventBuilder): Set reflected_type;
18988 * ecore.cs (Constantify): Added support for constifying bools.
18990 (RootContext.LookupType): Added a cache for values looked up in
18991 the declaration space.
18993 * typemanager.cs (FindMembers): Now is a front-end to
18994 RealFindMembers, and provides a two-level hashtable-based cache to
18997 15% performance improvement: from 22.5 to 19.2 seconds.
18999 * expression.cs (IsParamsMethodApplicable): use foreach.
19000 (Invocation.DoResolve): ditto.
19001 (New.DoResolve): ditto.
19002 (ArrayCreation.DoResolve): ditto.
19004 * ecore.cs (FindMostEncompassingType): use foreach.
19006 * delegate.cs (NewDelegate.DoResolve): Use foreach
19008 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
19009 (RemoveMethods): use foreach.
19011 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
19012 nested foreach statements instead of for, and also break out of
19013 the inner loop once a match is found.
19015 (Invocation.OverloadResolve): Use foreach, simplify the code.
19017 2002-05-08 Miguel de Icaza <miguel@ximian.com>
19019 * cfold.cs (BinaryFold): During an enumeration evaluation context,
19020 we actually unwrap the expression to allow for extra information
19023 * expression.cs: Use Shr_Un on unsigned operations.
19025 2002-05-08 Ravi Pratap <ravi@ximian.com>
19027 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
19028 applicable operators was not being considered correctly. This closes
19029 the bug Miguel reported.
19031 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
19033 * attribute.cs: check that the type derives from System.Attribute
19034 and report the correct error in that case (moved the duplicate code to
19035 its own method, too).
19037 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
19039 * attribute.cs: lookup attribute type name as the spec says: first the
19040 bare attribute name and then name + "Attribute" (nant compiles with
19041 mcs after this fix).
19043 2002-05-07 Miguel de Icaza <miguel@ximian.com>
19045 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
19046 Because of the way we parse things, we should try to see if a
19047 UIntConstant can fit in an integer.
19049 2002-05-07 Ravi Pratap <ravi@ximian.com>
19051 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
19052 when we are in an explicit context.
19054 (ConvertReferenceExplicit): When converting from Iface type S to Class
19055 T make sure the rules are implemented as an OR.
19057 * parameter.cs (ParameterType): Make it a property for now although the
19058 purpose really isn't anything immediate.
19060 * expression.cs (Is*Applicable): Do better checking on the parameter type
19061 of a ref/out parameter. The ones from the system assemblies are already
19062 marked with the correct type so we don't need to do any correction.
19064 * ecore.cs (StandardConversionExists): Conversion from Interface types to
19065 the object type is standard too so include that.
19067 2002-05-06 Miguel de Icaza <miguel@ximian.com>
19069 * ecore.cs (StandardConversionExists): Augment with missing code:
19070 deal with IntConstant, LongConstants and Enumerations.
19072 * assign.cs: Report the error, instead of failing silently
19074 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
19075 typecontainer that they are declared, because the
19076 typecontainer/namespace will have the list of using clauses that
19077 need to be applied.
19079 Assembly Attributes were escaping the normal registration
19082 (EmitCode): Apply attributes within an EmitContext that represents
19083 the container they were declared on.
19085 * cs-parser.jay: Track bases for structs. How did I get this wrong?
19087 2002-05-06 Ravi Pratap <ravi@ximian.com>
19089 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
19090 Revamp completely - make much cleaner as we now operate only
19093 (FindMostSpecificSource, FindMostSpecificTarget): New methods
19094 to implement the logic detailed in the spec more correctly.
19096 (UserDefinedConversion): Update accordingly.
19098 2002-05-06 Miguel de Icaza <miguel@ximian.com>
19100 * statement.cs: Return flow analysis information up.
19102 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
19105 (token): Do not consume an extra character before calling
19108 2002-05-06 Piers Haken <piersh@friskit.com>
19110 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
19112 2002-05-06 Miguel de Icaza <miguel@ximian.com>
19114 * class.cs (Constructor.Emit): Set the IsStatic flag in the
19115 EmitContext during the instance constructor initializer
19116 resolution, to stop access to instance variables.
19118 This is mandated by the spec, last paragraph of the `constructor
19119 initializers' section.
19121 2002-05-05 Miguel de Icaza <miguel@ximian.com>
19123 * cs-parser.jay, class.cs (Accessor): new class used to represent
19124 an accessor (get or set). In the past we used `null' to represent
19125 a missing accessor. But this is ambiguous because there was no
19126 way to tell in abstract indexers/properties if one of them was
19129 Now there is a way of addressing that.
19131 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
19132 instead of FindMembers.
19134 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
19135 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
19137 * attribute.cs: Treat indexers and properties as the same in terms
19138 of applying attributes
19140 * ecore.cs (FindMostEncompassedType): Use statically initialized
19141 EmptyExpressions()s like we do elsewhere to avoid creating useless
19142 objects (and we take this out of the tight loop).
19144 (GetConversionOperators): Move the code to extract the actual
19145 operators to a separate routine to clean things up.
19147 2002-05-04 Miguel de Icaza <miguel@ximian.com>
19149 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
19150 events are always registered FieldBuilders.
19152 * class.cs (FieldBase): New class shared by Fields
19154 * delegate.cs: If we are a toplevel delegate, use our full name.
19155 If we are a nested delegate, then only use our tail name.
19157 2002-05-02 Ravi Pratap <ravi@ximian.com>
19159 * expression.cs (IsApplicable): Ensure that we add the "&" to
19160 ref/out types before comparing it with the type of the argument.
19162 (IsParamsMethodApplicable): Ditto.
19164 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
19167 * delegate.cs : Handle the case when we have more than one applicable
19168 method. Flag an error only when we finish checking all.
19170 2002-05-02 Miguel de Icaza <miguel@ximian.com>
19172 * expression.cs: Add support for boolean static initializers.
19174 2002-05-01 Miguel de Icaza <miguel@ximian.com>
19176 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
19178 * parameter.cs (ComputeParameterTypes,
19179 ComputeAndDefineParameterTypes): Better error handling: now we
19180 clear the `types' cache if we fail during any of the type lookups.
19181 We also return the status code correctly to our caller
19183 * delegate.cs: If we fail to define a delegate, abort the extra
19186 * expression.cs (Binary.ResolveOperator): for
19187 operator==(object,object) and operator !=(object, object) we also
19188 have to verify that there is an implicit conversion from one to
19191 (ArrayAccess.DoResolve): Array Access can operate on
19194 2002-04-30 Miguel de Icaza <miguel@ximian.com>
19196 * assign.cs (CompoundAssign): A new class used as a "flag" that
19197 the assignment actually is happening as part of a compound
19198 assignment operator.
19200 During compound assignment, a few new rules exist to enable things
19207 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
19208 to the type of x) if y is implicitly convertible to the type of x,
19209 and the operator is a builtin operator and the return type of the
19210 operator is explicitly convertible to the type of x.
19212 * rootcontext.cs: Reset warning level to 2. 4 catches various
19213 "interesting" features in mcs, we must clean this up at some
19214 point, but currently am trying to kill other bugs ;-)
19216 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
19217 in container classes as well.
19219 * expression.cs (Binary.ResolveOperator): Handle string case
19220 before anything else (as operator overloading does emit an error
19221 before doing anything else).
19223 This code could go away when we move to a table driven model, but
19224 i could not come up with a good plan last night.
19226 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
19228 * typemanager.cs (CSharpName): reimplementation using regex.
19229 * class.cs: added null check for fields in Emit
19230 * rootcontext.cs: set warninglevel to 4
19232 2002-04-29 Miguel de Icaza <miguel@ximian.com>
19234 * typemanager.cs (CSharpName): reimplemented with Lupus
19237 2002-04-28 Miguel de Icaza <miguel@ximian.com>
19239 * statement.cs (If): correclty implement Resolve, because we were
19240 not catching sem errors in there. The same process is needed
19242 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
19245 (Statement.Warning_DeadCodeFound): Factorize code.
19246 (While): Report dead code here too.
19248 (Statement): Added Resolve virtual method to allow
19249 for resolution split from the emit code.
19251 2002-04-26 Miguel de Icaza <miguel@ximian.com>
19253 * statement.cs (EmitBoolExpression): No longer try to resolve the
19255 (MakeBoolean): New utility function that resolve, implicitly
19256 converts to boolean and tags the expression.
19259 (If, Do): Implement dead code elimination.
19260 (While): Implement loop inversion
19262 (Do, While, For, If): Resolve the expression prior to calling our
19265 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
19268 - added method Report28 (warning: program has more than one entry point)
19269 - added method IsEntryPoint, implements paragraph 10.1 of the spec
19270 - modified method Method.Define, the part at the end of the method
19272 * rootcontext.cs: added static public Location EntryPointLocation;
19274 * ../errors/cs0028.cs : Add test case for the above warning.
19277 - modified method CSharpName to allow arrays of primitive type to
19278 be printed nicely (e.g. instead of System.Int32[][] it now prints
19280 - added method CSharpSignature: returns the signature of a method
19281 in string format to be used in reporting errors, warnings, etc.
19283 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
19286 2002-04-26 Ravi Pratap <ravi@ximian.com>
19288 * delegate.cs (Define): Fix extremely silly bug where I was
19289 setting the type of the 'object' parameter of the BeginInvoke
19290 method to System.IAsyncResult instead of System.Object ;-)
19292 2002-04-26 Miguel de Icaza <miguel@ximian.com>
19294 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
19297 (Constructor.Emit): return if we fail to initialize the
19298 constructor. Another door closed!
19300 * expression.cs (New.DoResolve): Improve error message (from -6 to
19301 1501). Use DeclaredOnly lookup to find the exact constructor.
19303 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
19304 loop. This is useful.
19306 * cs-parser.jay: Adjust the default parameters so that destructors
19307 have the proper signature.
19309 2002-04-26 Martin Baulig <martin@gnome.org>
19311 * driver.cs (LoadAssembly): If `assembly' contains any characters
19312 which are only valid in path names and not in assembly names
19313 (currently slash, backslash and point), use Assembly.LoadFrom ()
19314 instead of Assembly.Load () on the `assembly' (before iteration
19315 over the link_paths).
19317 2002-04-26 Martin Baulig <martin@gnome.org>
19319 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
19321 2002-04-25 Miguel de Icaza <miguel@ximian.com>
19323 * class.cs (Property): use the new typemanager.MemberLookup
19325 (TypeContainer.MemberLookup): Implement using the
19326 TypeManager.MemberLookup now.
19328 * typemanager.cs: Make MemberLookup a function of the TypeManager,
19329 and return MemberInfos, so that these can be used without an
19330 EmitContext (what we had before).
19332 2002-04-24 Miguel de Icaza <miguel@ximian.com>
19334 * expression.cs: Fix the case where the argument to params if the
19335 type of the params. I omitted handling this before. Fixed
19337 2002-04-22 Miguel de Icaza <miguel@ximian.com>
19339 * driver.cs: Call BootCorlib_PopulateCoreType
19341 * class.cs (Property.CheckBase): Check for properties only, not
19344 * interface.cs: Temporary hack: try/catch around the
19345 CustomAttributeBuilder, because I am getting an exception that I
19348 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
19349 types whose definitions are required to be there (attributes are
19350 defined before standard types).
19352 Compute definitions as we boot the various types, as they are used
19353 immediately (value_type class will need object_type, but if we do
19354 not initialize object_type, we will pass a null, which will let
19355 the runtime pick the System.Object from the existing corlib, which
19356 is not what we want).
19358 2002-04-22 Patrik Torstensson <totte@labs2.com>
19360 * cs-tokenizer.cs: fixed a number of trim() issues.
19362 2002-04-22 Ravi Pratap <ravi@ximian.com>
19364 * expression.cs (Argument.Type): Ensure that we return the correct
19365 type when we have out or ref parameters [in which case we
19368 2002-04-22 Miguel de Icaza <miguel@ximian.com>
19370 * class.cs (Property, Indexer): Allow extern modifier in there.
19372 * typemanager.cs (InitBaseTypes): Initializes object_type and
19373 value_type, since those will be used early on during the bootstrap
19374 process to compile corlib.
19376 (InitCoreTypes): Move code from here to InitBaseTypes.
19378 2002-04-21 Miguel de Icaza <miguel@ximian.com>
19380 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
19381 single-dimension arrays as using the ldlen opcode.
19383 Daniel Lewis discovered this optimization.
19385 * typemanager.cs: Add signature for System.Array::get_Length
19387 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19389 * statement.cs: report the error when the foreach does not apply to an
19390 array nor a collection.
19392 2002-04-19 Miguel de Icaza <miguel@ximian.com>
19394 * expression.cs: Add implicit conversions to the operator ~.
19396 * constant.cs (DecimalConstant.Emit): Emit decimal value.
19398 * typemanager.cs: Locate the decimal constructor.
19400 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19402 * attribute.cs: use the new property of TypeOf.
19403 * expression.cs: added 'get' property around typearg.
19405 These changes fix a build breaker reported by NickD. Is this the
19406 correct way to fix? If not, please, revert my changes and make it
19409 2002-04-17 Miguel de Icaza <miguel@ximian.com>
19411 * attribute.cs: Add support for typeof in attribute invocations.
19412 I am not sure that this is right though.
19414 2002-04-14 Duncan Mak <duncan@ximian.com>
19416 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
19417 Binary.Operator.Division case.
19419 2002-04-13 Ravi Pratap <ravi@ximian.com>
19421 * class.cs (DefineType): Ensure that we do a proper check on
19422 attribute types and also register it with the TypeManager.
19424 (TypeContainer.Targets): The default for attribute types is
19425 AttributeTargets.All.
19427 * attribute.cs (ApplyAttributes): Registering the attribute type
19428 is done elsewhere, not when we discover we have a Usage attribute.
19430 2002-04-12 Ravi Pratap <ravi@ximian.com>
19432 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
19433 and get rid of is_delegate parameter.
19435 * everywhere : update.
19437 2002-04-12 Ravi Pratap <ravi@ximian.com>
19439 * cs-parser.jay (compilation_unit): Revamp completely to use
19440 some new ideas that I got from Rhys' grammar to solve the problems
19441 with assembly level attributes.
19443 (outer_declaration): New grammar production.
19445 (attribute_sections): Add.
19447 (opt_attributes): Base on attribute_sections
19449 (namespace_declaration): Allow opt_attributes to tackle the case
19450 when we have assembly level attributes - we are clever in this
19453 * attribute.cs (ApplyAttributes): Do not worry about assembly
19454 attributes in the non-global context.
19456 * rootcontext.cs (AddGlobalAttributes): Go back to using this
19457 instead of SetGlobalAttributes.
19459 * class.cs, rootcontext.cs : Ensure we define and generate
19460 attribute types before anything else.
19462 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19463 and flag the new error -20 for the case when the attribute type
19464 does not have valid targets specified. csc does not catch this.
19466 * ../errors/errors.txt : update for error # -20
19468 2002-04-11 Ravi Pratap <ravi@ximian.com>
19470 * support.cs (InternalParameters.ParameterModifier): Do some null
19471 checking and return sane values.
19473 * class.cs (Method.Define): If we are a PInvoke method, ensure
19474 that we are static and extern. Report error # 601
19476 * ../errors/cs0601.cs : Add test case for the above error.
19478 2002-04-07 Ravi Pratap <ravi@ximian.com>
19480 * rootcontext.cs (attribute_types): We need to keep type of
19481 all attribute types separately and emit code for them first.
19483 (RegisterAttribute) : Implement.
19485 * class.cs (DefineType): Check if the current Type is a custom
19486 attribute type and register it accordingly.
19488 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19489 adding the first attribute twice and rename to
19491 (SetGlobalAttributes): this.
19493 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19496 * attribute.cs (ApplyAttributes): Take an additional argument telling us
19497 if we are processing global arguments. Hmm, I am unsure of this.
19499 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19501 * expression.cs: added static array of strings to avoid calling
19502 Enum.ToString () for Operator in Binary. Significant recover of
19505 2002-04-10 Miguel de Icaza <miguel@ximian.com>
19507 * class.cs (FindMembers): Allow the Builders of the various
19508 members to be null. If they are skip them. This only happens
19509 during the PInvoke declaration.
19511 2002-04-09 Miguel de Icaza <miguel@ximian.com>
19513 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19514 failure, so we do not keep going afterwards.
19516 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19517 wanted to pass `false' as the `is_delegate' argument. If this is
19518 the case, why not use delegate_type == null to mean `is_delegate =
19519 false' and anything else as is_delegate = true.
19521 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
19523 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19524 code for the section, not the beginning of the tests.
19526 2002-04-08 Miguel de Icaza <miguel@ximian.com>
19528 * cfold.cs: Handle operator + (Enum x, Underlying x)
19530 * expression.cs (Binary): same. Warn about errors where we have
19531 Enum/Enum in operator + as well.
19533 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
19536 - added support for switch(bool)
19537 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19538 - add TableSwitchEmit() to handle table-based switch statements
19540 2002-04-05 Ravi Pratap <ravi@ximian.com>
19542 * expression.cs (Invocation.OverloadResolve): Factor out code which
19543 does parameter compatibility checking with arguments so that we can
19544 re-use the code even from Delegate.VerifyApplicability
19546 (VerifyArgumentsCompat): Move above code here.
19548 * delegate.cs (VerifyApplicability): Get rid of duplicate code
19549 and instead make a call to the above method.
19551 2002-03-31 Ravi Pratap <ravi@ximian.com>
19553 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
19554 We use it to keep track of classes which are attribute types.
19556 2002-04-02 Miguel de Icaza <miguel@ximian.com>
19558 * delegate.cs (Delegate.Define): Correctly define the types in the
19559 presence of fixed and array parameters.
19561 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
19564 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
19565 include NonPublic after the first iteration.
19567 * class.cs (Indexer.CheckBase): Only check if both parents are
19570 * cs-parser.jay (accessor_body): If empty, set to null.
19572 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19573 same code path here to resolve constants names that we did have in
19574 MemberAccess.DoResolve. There is too much code duplicated here.
19576 2002-04-01 Miguel de Icaza <miguel@ximian.com>
19578 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19580 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19583 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19584 tokens, numbers and strings.
19586 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19589 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19590 asyncronous parameters and the regular parameters.
19592 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19593 specify the target directory.
19595 * expression.cs: (This.DoResolve): Simplify
19596 (As.Emit): Optimize, do not generate IsInst if the expression is
19597 always of the given type.
19599 (Is.DoResolve): Bug fix, we were reporting both always/never for
19602 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19603 creating too many unnecessary arrays.
19605 2002-03-31 Miguel de Icaza <miguel@ximian.com>
19607 * class.cs (EmitFieldInitializer): Use Assign expression to assign
19608 fields instead of rolling our own initializer. Takes care of all
19609 implicit conversions, and drops unnecessary static checks/argument.
19611 2002-03-31 Dick Porter <dick@ximian.com>
19613 * driver.cs: use the GetDirectories() return values properly, and
19614 use "/" as path separator.
19616 2002-03-30 Miguel de Icaza <miguel@ximian.com>
19618 * expression.cs (Unary): Optimize - - expr into expr.
19619 (Binary): Optimize a + (-b) into a -b.
19621 * codegen.cs (CodeGen): Made all methods static.
19623 2002-03-29 Miguel de Icaza <miguel@ximian.com>
19627 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19628 TypeBuilder property.
19630 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19633 * tree.cs: Removed the various RecordXXXX, and replaced with a
19634 single RecordDecl. Removed all the accessor methods, and just
19635 left a single access point Type
19637 * enum.cs: Rename DefineEnum to DefineType.
19639 * decl.cs: New abstract method `DefineType' used to unify the
19640 Defines for Enumerations, Interfaces, TypeContainers and
19643 (FindType): Moved LookupInterfaceOrClass here. Moved the
19644 LookupBaseClasses method that used to live in class.cs and
19645 interface.cs here, and renamed to FindType.
19647 * delegate.cs: Implement DefineType. Take advantage of the
19648 refactored pattern for locating the parent builder without taking
19649 the parent_builder argument (which we know does not work if we are
19650 nested, and triggering a toplevel definition).
19652 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19654 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19655 accessibility of a member has changed during override and report
19658 * class.cs (Method.Define, Property.Define): Only complain on
19659 overrides if the method is private, any other accessibility is
19660 fine (and since we just checked the permission is the same, we are
19663 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19664 and elif are processed always. The other pre-processing
19665 directives are only processed if we are "taking" the path
19667 2002-03-29 Martin Baulig <martin@gnome.org>
19669 * class.cs (Method.Emit): Only emit symbolic debugging info if the
19670 current location is not Null.
19672 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19673 a separate method so we can profile it.
19675 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19676 `span.Seconds' are just seconds, but no minutes or hours.
19677 (MainDriver): Profile the CodeGen.SaveSymbols calls.
19679 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19681 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19682 Remove the gratuitous set of Final:
19684 // If an interface implementation, then we can set Final.
19685 if (((flags & MethodAttributes.Abstract) == 0) &&
19686 implementing.DeclaringType.IsInterface)
19687 flags |= MethodAttributes.Final;
19689 I do not know what I was smoking when I used that.
19692 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19693 step into fixing the name resolution issues for delegates and
19694 unifying the toplevel name resolution.
19696 2002-03-28 Martin Baulig <martin@gnome.org>
19698 * class.cs (Method.Emit): If we have a symbol writer, call its
19699 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19700 tell it about the current method.
19702 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19703 writer that we're going to emit the first byte of IL code for a new
19704 statement (a new source line).
19705 (EmitContext.EmitTopBlock): If we have a symbol writer, call
19706 EmitContext.Mark() before emitting any code.
19708 * location.cs (SymbolDocument): Return null when we're Null.
19710 * statement.cs (Statement): Moved the `Location loc' variable here.
19711 (Statement.EmitBoolExpression): If we have a symbol writer, call
19712 ec.Mark() before emitting any code to tell it that we're at the
19713 beginning of a new statement.
19714 (StatementExpression): Added `Location' argument to the constructor.
19715 (Block): Added public readonly variable `StartLocation' and public
19716 variable `EndLocation'. The latter is to be set using SetEndLocation().
19717 (Block): Added constructor which takes a start and end location.
19718 (Block.SetEndLocation): New method. This sets the end location.
19719 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19720 local variables we create.
19721 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
19722 each statement and do also mark the begin and end of the block.
19724 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
19725 tell it the current lexer.Location, use Location.Null for the end of the
19727 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
19728 current block, set its end location using SetEndLocation().
19729 (statement_expression): StatementExpression constructor now takes the
19730 lexer.Location as additional argument.
19731 (for_statement, declare_local_variables): Likewise.
19732 (declare_local_variables): When creating a new implicit block, use the
19733 new Block constructor and pass it the lexer.Location.
19735 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19737 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
19738 members also on the parent interfaces recursively.
19740 2002-03-27 Miguel de Icaza <miguel@ximian.com>
19742 * report.cs: Use new formats, since Gonzalo finished the missing
19745 * expression.cs (Binary.ResolveOperator): added missing operator|
19746 operator& and operator^ for bool/bool.
19748 * cs-parser.jay: CheckDef now takes a Location argument that is
19749 used to report errors more precisly (instead of reporting the end
19750 of a definition, we try to track something which is a lot closer
19751 to the source of the problem).
19753 * cs-tokenizer.cs: Track global token use, so we can properly flag
19754 the use of #define/#undef after the first token has been seen.
19756 Also, rename the reportXXXX to Error_DescriptiveName
19758 * decl.cs (DeclSpace.IsTopLevel): Move property here from
19759 TypeContainer, so that Enum and Interface can use this too.
19761 * class.cs (TypeContainer.LookupInterfaceOrClass,
19762 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19763 `builder' argument. Typically this was used to pass the parent
19764 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19767 The problem is that a nested class could trigger the definition of
19768 a toplevel class, and the builder would be obviously wrong in that
19771 So we drop this argument, and we compute dynamically the
19772 TypeBuilder/ModuleBuilder (the correct information was available
19773 to us anyways from DeclSpace.Parent)
19775 * interface.cs (Interface.DefineInterface): Drop builder
19776 parameter cleanup like class.cs
19778 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
19781 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19784 (Try.Emit): Propagate the returns value from the statement.
19786 (Return.Emit): Even if we are leavning
19788 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19790 * modifiers.cs: Fix the computation of MethodAttributes flags.
19792 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19794 * driver.cs: allow compilation of files that start with '/'.
19795 Add a default case when checking the argument of --target.
19797 2002-03-25 Miguel de Icaza <miguel@ximian.com>
19799 * interface.cs: Implement the same search algorithm for types in
19800 the interface code.
19802 * delegate.cs: Do not allow multiple definition.
19804 * Recovered ChangeLog that got accidentally amputated
19806 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19808 * rootcontext.cs: Load manually enum to allow core classes to
19809 contain enumerations.
19811 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19812 Update to new static methods in TypeManager.
19814 * typemanager.cs (GetMethod, GetConstructor): Use our
19815 implementation of FindMembers to find the members, since during
19816 corlib compilation, the types are TypeBuilders and GetMethod and
19817 GetConstructor do not work.
19819 Make all methods in TypeManager static.
19821 (InitCodeHelpers): Split the functionality from
19822 the InitCodeTypes function.
19824 * driver.cs: Call InitCodeHelpers after we have populated the
19827 * cs-parser.jay (delegate_declaration): we did not used to compute
19828 the delegate name correctly for void delegates.
19830 2002-03-24 Miguel de Icaza <miguel@ximian.com>
19832 * rootcontext.cs (RootContext): Init the interface_resolve_order
19833 and type_container_resolve_order always.
19835 (ResolveCore, BootstrapCorlib_ResolveClass,
19836 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19837 compiler when compiling with --nostdlib
19839 * class.cs (TypeContainer.DefineType): Check that our parent is
19840 not null. This test is most important when we are bootstraping
19843 * codegen.cs: Split out the symbol writing code.
19845 2002-03-25 Martin Baulig <martin@gnome.org>
19847 * driver.cs (-g): Made -g an alias for --debug.
19849 2002-03-24 Martin Baulig <martin@gnome.org>
19851 * codegen.cs (SymbolWriter): New public variable. Returns the
19852 current symbol writer.
19853 (CodeGen): Added `bool want_debugging_support' argument to the
19854 constructor. If true, tell the ModuleBuild that we want debugging
19855 support and ask it for the ISymbolWriter.
19856 (Save): If we have a symbol writer, call it's Close() method after
19857 saving the assembly.
19859 * driver.c (--debug): New command line argument to create a
19860 debugger information file.
19862 * location.cs (SymbolDocument): New public property. Returns an
19863 ISymbolDocumentWriter object for the current source file or null
19864 if we don't have a symbol writer.
19866 2002-03-21 Miguel de Icaza <miguel@ximian.com>
19868 * driver.cs (LoadAssembly): Correctly return when all the paths
19869 have been tried and not before.
19871 * statement.cs (Switch.Emit): return the actual coverage for this
19872 statement (returns/not-returns)
19874 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19875 switch of the statement if we are the last switch section. That
19876 kills two problems: try/catch problems (we used to emit an empty
19877 nop at the end) and switch statements where all branches would
19880 2002-03-19 Miguel de Icaza <miguel@ximian.com>
19882 * driver.cs: Add default assemblies (the equivalent to the
19883 Microsoft CSC.RSP file)
19885 * cs-tokenizer.cs: When updating `cols and setting it to zero,
19886 also update tokens_seen and set it to false.
19888 * driver.cs: Implement --recurse for Mike.
19890 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19891 correctly splitting out the paths.
19893 2002-03-18 Miguel de Icaza <miguel@ximian.com>
19895 * interface.cs (Interface.PopulateProperty): Instead of using
19896 `parent' as the declaration space for the set parameters, use
19899 * support.cs (InternalParameters): InternalParameters constructor
19900 takes a DeclSpace instead of a TypeContainer.
19902 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19903 types are being initialized, load the address of it before calling
19906 (New): Provide a mechanism to disable the generation of local
19907 value type temporaries when the caller will be providing us with
19908 an address to store it.
19910 (ArrayCreation.EmitDynamicInitializers): Use it.
19912 2002-03-17 Miguel de Icaza <miguel@ximian.com>
19914 * expression.cs (Invocation.EmitArguments): Only probe for array
19915 property if there is more than one argument. Sorry about that.
19917 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19918 empty param arrays.
19920 * class.cs (Method.LabelParameters): Fix incorrect code path that
19921 prevented the `ParamArrayAttribute' from being applied to the
19924 2002-03-16 Miguel de Icaza <miguel@ximian.com>
19926 * support.cs (ReflectionParameters): Correctly compute whether the
19927 last argument is a params array. Fixes the problem with
19930 * typemanager.cs: Make the assemblies array always be non-null
19931 (empty, but non-null)
19933 * tree.cs (RecordDecl): New function that abstracts the recording
19934 of names. This reports error 101, and provides a pointer to the
19935 previous declaration. Fixes a crash in the compiler.
19937 * cs-parser.jay (constructor_declaration): Update to new grammar,
19938 and provide a constructor_body that can be empty.
19940 2002-03-15 Miguel de Icaza <miguel@ximian.com>
19942 * driver.cs: Add support for --resources.
19944 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19945 Make all types for the various array helper methods be integer.
19947 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19948 CheckState to ConvCast.
19950 (ConvCast): Now it takes a `checked' state argument, to avoid
19951 depending on the emit context for the conversion, and just using
19952 the resolve time setting.
19954 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19955 instead of Invocation.EmitArguments. We do not emit the original
19956 arguments, instead we emit those which have been converted to
19957 unsigned int expressions.
19959 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19961 * codegen.cs: ditto.
19963 * expression.cs (LocalVariableReference): Drop the use of the
19964 Store function that depended on the variable index.
19966 * statement.cs (VariableInfo): Drop the `Idx' property from this
19967 class, as this is not taking into account the indexes for
19968 temporaries tat we generate during the execution, getting the
19971 * class.cs: First emit class initializers, then call the parent
19974 * expression.cs (Binary): Fix opcode emision.
19975 (UnaryMutator.EmitCode): Support checked code generation
19977 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19978 matches for events for both the Static and Instance scans,
19979 pointing to the same element. Fix that.
19981 2002-03-14 Miguel de Icaza <miguel@ximian.com>
19983 * rootcontext.cs (ResolveTree): Always set the
19984 interface_resolve_order, because nested interfaces will be calling
19987 * class.cs (GetInterfaceOrClass): Track the same resolution
19988 process used by TypeManager.LookupType. This fixes the nested
19989 type lookups in class declarations (separate path from
19992 (TypeContainer.DefineType): Also define nested interfaces.
19993 (TypeContainer.RegisterOrder): New public function used to
19994 register the order in which child interfaces need to be closed.
19996 Nested interfaces need to be closed after their parents have been
19999 * interface.cs (InterfaceAttr): Put all the logic for computing
20000 the interface attribute here.
20002 (DefineInterface): Register our interface order with the
20003 RootContext or with the TypeContainer depending on the case.
20005 2002-03-12 Miguel de Icaza <miguel@ximian.com>
20007 * cs-parser.jay: rework foreach statement to work with the new
20008 changes to the policy on SimpleNames.
20010 * report.cs: support Stacktrace on warnings as well.
20012 * makefile: drop --unsafe and /unsafe from the compile.
20014 2002-03-13 Ravi Pratap <ravi@ximian.com>
20016 * ecore.cs (StandardConversionExists): Modify to take an Expression
20017 as the first parameter. Ensure we do null -> reference type conversion
20020 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
20021 temporary Expression objects.
20023 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
20025 * interface.cs: workaround bug in method overloading resolution
20026 (there is already a bugzilla bug for it).
20028 2002-03-12 Miguel de Icaza <miguel@ximian.com>
20030 We could also solve this problem by having a separate path for
20031 performing type lookups, instead of DoResolve, we could have a
20032 ResolveType entry point, and only participating pieces of the
20033 production (simplename, deref, array) would implement this.
20035 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
20036 signal SimpleName to only resolve type names and not attempt to
20037 resolve anything else.
20039 * expression.cs (Cast): Set the flag.
20041 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
20043 * class.cs: Only report 108 if there is no `new' modifier.
20045 * cs-parser.jay: rework foreach statement to work with the new
20046 changes to the policy on SimpleNames.
20048 * report.cs: support Stacktrace on warnings as well.
20050 * makefile: drop --unsafe and /unsafe from the compile.
20052 2002-03-11 Miguel de Icaza <miguel@ximian.com>
20054 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20055 lookups here, instead of doing that at parse time. This means
20056 that our grammar will not introduce `LocalVariableReferences' as
20057 expressions at this point. That solves the problem of code like
20061 static void Main ()
20065 This is only half the fix. The full fix requires parameters to
20066 also be handled in this way.
20068 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
20069 makes the use more obvious of the DeclSpace. The
20070 ec.TypeContainer.TypeBuilder is now only used to pull the
20071 TypeBuilder for it.
20073 My theory is that I can get rid of the TypeBuilder completely from
20074 the EmitContext, and have typecasts where it is used (from
20075 DeclSpace to where it matters).
20077 The only pending problem is that the code that implements Aliases
20078 is on TypeContainer, and probably should go in DeclSpace.
20080 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20081 lookups here, instead of doing that at parse time. This means
20082 that our grammar will not introduce `LocalVariableReferences' as
20083 expressions at this point. That solves the problem of code like
20087 static void Main ()
20091 This is only half the fix. The full fix requires parameters to
20092 also be handled in this way.
20094 * class.cs (Property.DefineMethod): When implementing an interface
20095 method, set newslot, when implementing an abstract method, do not
20096 set the flag (before we tried never setting it, or always setting
20097 it, which is the difference).
20098 (Indexer.DefineMethod): same.
20099 (Method.DefineMethod): same.
20101 * ecore.cs: Only set the status used flag if we get back a Field.
20103 * attribute.cs: Temporary hack, so Paolo can keep working.
20105 2002-03-08 Ravi Pratap <ravi@ximian.com>
20107 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
20108 the unmanaged type in the case we have a MarshalAs attribute.
20110 (Resolve): Handle the case when we are parsing the special MarshalAs
20111 attribute [we need to store the unmanaged type to use later]
20113 * typemanager.cs (marshal_as_attr_type): Built in type for the
20114 MarshalAs Attribute.
20116 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
20117 on parameters and accordingly set the marshalling info.
20119 2002-03-09 Miguel de Icaza <miguel@ximian.com>
20121 * class.cs: Optimizing slightly by removing redundant code after
20122 we switched to the `NoTypes' return value.
20123 (Property.DefineMethod): use NoTypes here too.
20125 This fixes the bug I introduced in my last batch of changes.
20127 2002-03-05 Ravi Pratap <ravi@ximian.com>
20129 * tree.cs (RecordEnum): Add. We now keep track of enums too.
20131 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
20132 Enums since those are types too.
20134 * cs-parser.jay (enum_declaration): Record enums as we parse them.
20136 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
20137 thanks to a call during the lookup process.
20139 2002-03-07 Miguel de Icaza <miguel@ximian.com>
20141 * statement.cs (Foreach): Lots of work to accomodate a particular
20142 kind of foreach statement that I had not kept in mind. It is
20143 possible to have foreachs on classes that provide a GetEnumerator
20144 method that return objects that implement the "pattern" for using
20145 a foreach, there is no need to support GetEnumerator
20148 This is needed to compile nant.
20150 * decl.cs: Only report 114 if the member is not `Finalize' and if
20151 the warning level is at least 2.
20153 * class.cs: Moved the compare function from Method to
20156 (MethodSignature.InheritableMemberSignatureCompare): Add new
20157 filter function that is used to extract inheritable methods from a
20160 (Method.Define): Use the new `inheritable_method_signature_filter'
20163 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
20166 2002-03-06 Miguel de Icaza <miguel@ximian.com>
20168 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
20170 * cs-parser.jay: Add opt_semicolon to the interface declaration.
20172 * expression.cs: Pass location information to
20173 ConvertImplicitStandard.
20175 * class.cs: Added debugging code to track return values from
20178 2002-03-05 Miguel de Icaza <miguel@ximian.com>
20180 * expression.cs (Is.DoResolve): If either side of the `is' is an
20181 interface, do not flag the warning.
20183 * ecore.cs (ImplicitReferenceConversion): We need a separate test
20186 * report.cs: Allow for --fatal to be used with --probe.
20188 * typemanager.cs (NoTypes): Move the definition for the empty Type
20191 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
20193 (TypeContainer.DefineProxy): New function used to proxy to parent
20194 implementations when implementing interfaces.
20195 (TypeContainer.ParentImplements): used to lookup if our parent
20196 implements a public function that is required by an interface.
20197 (TypeContainer.VerifyPendingMethods): Hook this up.
20199 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
20200 `modules' and `assemblies' arraylists into arrays. We only grow
20201 these are the very early start up of the program, so this improves
20202 the speedof LookupType (nicely measured).
20204 * expression.cs (MakeByteBlob): Replaced unsafe code with
20205 BitConverter, as suggested by Paolo.
20207 * cfold.cs (ConstantFold.Binary): Special case: perform constant
20208 folding of string concatenation, but if either side is a string,
20209 and the other is not, then return null, and let the runtime use
20210 the concatenation on the string plus the object (using
20211 `Object.ToString').
20213 2002-03-04 Miguel de Icaza <miguel@ximian.com>
20215 Constant Folding has been implemented now.
20217 * expression.cs (Unary.Reduce): Do not throw an exception, catch
20218 the error instead on types that are not supported in one's
20221 * constant.cs (Constant and all children): New set of functions to
20222 perform implict and explicit conversions.
20224 * ecore.cs (EnumConstant): Implement the new functions to perform
20225 conversion by proxying to the child expression.
20227 * codegen.cs: (ConstantCheckState): Constant evaluation has its
20228 own separate setting that can not be turned off from the command
20229 line using --unchecked or --checked and is only controlled using
20230 the checked/unchecked statements and expressions. This setting is
20231 used by the constant folder to flag errors.
20233 * expression.cs (CheckedExpr, UncheckedExpr): Set the
20234 ConstantCheckState as well.
20236 During Resolve, they also have to flag the state, because the
20237 constant folder runs completely in the Resolve phase.
20239 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
20242 2002-03-01 Miguel de Icaza <miguel@ximian.com>
20244 * cfold.cs: New file, this file contains the constant folder.
20246 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
20247 argument to track whether we are using the resulting address to
20248 load or store a value and provide better error messages.
20250 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
20251 new AddressOf arguments.
20253 * statement.cs (Foreach.EmitCollectionForeach): Update
20255 * expression.cs (Argument.Emit): Call AddressOf with proper
20256 arguments to track usage.
20258 (New.DoEmit): Call AddressOf with new arguments.
20260 (Unary.Emit): Adjust AddressOf call.
20262 2002-03-01 Ravi Pratap <ravi@ximian.com>
20264 * cs-parser.jay (member_access): Change the case for pre-defined types
20265 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
20268 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
20271 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
20272 essentially like methods and apply attributes like MethodImplOptions to them too.
20274 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
20277 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
20278 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
20281 * Update code everywhere accordingly.
20283 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
20285 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
20287 2002-02-28 Ravi Pratap <ravi@ximian.com>
20289 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
20290 try performing lookups against those instead of jumping straight into using
20291 the 'using' clauses.
20293 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
20295 (LookupType): Perform lookups in implicit parents too.
20297 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
20298 sequence as RootContext.LookupType.
20300 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
20301 the various cases of namespace lookups into this method.
20303 2002-03-01 Miguel de Icaza <miguel@ximian.com>
20305 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
20306 in positional arguments)
20308 * class.cs (Operator): Update the AllowedModifiers to contain
20311 * cs-parser.jay: Update operator declaration to allow for the
20312 operator body to be empty.
20314 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
20317 2002-02-27 Miguel de Icaza <miguel@ximian.com>
20319 * class.cs (Method.Emit): Label parameters.
20321 * driver.cs: Return 1 or 0 as the program exit code.
20323 2002-02-26 Miguel de Icaza <miguel@ximian.com>
20325 * expression.cs: Special case the `null' object when trying to
20326 auto-compute the type, as anything can be explicitly converted to
20329 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
20330 spotting this Paolo.
20332 (Expression.ImplicitNumericConversion): Perform comparissions of
20333 the type using the underlying type in the case of an enumeration
20334 rather than using the enumeration type for the compare.
20336 Cope with the underlying == type case, which is not possible to
20339 (Expression.ConvertNumericExplicit): Perform comparissions of
20340 the type using the underlying type in the case of an enumeration
20341 rather than using the enumeration type for the compare.
20343 * driver.cs: If the user does not supply an extension, assume .exe
20345 * cs-parser.jay (if_statement): Rewrote so that we can track the
20346 location for the if statement.
20348 * expression.cs (Binary.ConstantFold): Only concat strings when
20349 the operation is "+", not everything ;-)
20351 * statement.cs (Statement.EmitBoolExpression): Take a location
20353 (If, While, Do): Track location.
20355 * expression.cs (Binary.ResolveOperator): In the object + string
20356 case, I was missing a call to ConvertImplicit
20358 2002-02-25 Ravi Pratap <ravi@ximian.com>
20360 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
20361 Location arguments. Ensure we use RootContext.LookupType to do our work
20362 and not try to do a direct Type.GetType and ModuleBuilder.GetType
20364 * interface.cs (PopulateMethod): Handle the type of the parameter being
20367 * expression.cs (Invocation.BetterFunction): Handle the case when we
20368 have a params method with no fixed arguments and a call is made with no
20371 2002-02-25 Miguel de Icaza <miguel@ximian.com>
20373 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
20374 the verbatim-string-literal
20376 * support.cs (InternalParameters.ParameterModifier): handle null
20378 (InternalParameters.ParameterType): ditto.
20380 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
20381 duplicating the name of the variable parameter.
20382 (GetParameterByName): Fix bug where we were not looking up array
20383 paramters if they were the only present (thanks Paolo!).
20384 (GetParameterInfo): We only have an empty set of types if both
20385 fixed and array are set to null.
20386 (GetParameterInfo-idx): Handle FixedParameter == null
20388 * cs-parser.jay: Handle the case where there is no catch
20389 statements (missing null test).
20391 2002-02-22 Miguel de Icaza <miguel@ximian.com>
20393 * driver.cs (MainDriver): Be conservative on our command line
20396 Catch DirectoryNotFoundException when calling GetFiles.
20398 (SplitPathAndPattern): Used to split the input specification into
20399 a path and a pattern that we can feed to Directory.GetFiles.
20401 2002-02-21 Miguel de Icaza <miguel@ximian.com>
20403 * statement.cs (Fixed): Implement the last case of the Fixed
20404 statement (string handling).
20406 * expression.cs (StringPtr): New class used to return a char * to
20407 a string; Used by the Fixed statement.
20409 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
20411 * expression.cs (Binary.ResolveOperator): Remove redundant
20412 MemberLookup pn parent type.
20413 Optimize union call, we do not need a union if the types are the same.
20414 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
20417 Specialize the use of MemberLookup everywhere, instead of using
20418 the default settings.
20420 (StackAlloc): Implement stackalloc keyword.
20422 * cs-parser.jay: Add rule to parse stackalloc.
20424 * driver.cs: Handle /h, /help, /?
20426 * expression.cs (MakeByteBlob): Removed the hacks we had in place
20427 before we supported unsafe code.
20429 * makefile: add --unsafe to the self compilation of mcs.
20431 2002-02-20 Miguel de Icaza <miguel@ximian.com>
20433 * expression.cs (PointerArithmetic): New class that is used to
20434 perform pointer arithmetic.
20435 (Binary.Resolve): Handle pointer arithmetic
20436 Handle pointer comparission.
20437 (ArrayPtr): Utility expression class that is used to take the
20438 address of an array.
20440 (ElementAccess): Implement array access for pointers
20442 * statement.cs (Fixed): Implement fixed statement for arrays, we
20443 are missing one more case before we are done.
20445 * expression.cs (Indirection): Implement EmitAssign and set the
20446 ExprClass to Variable. This allows pointer dereferences to be
20447 treated as variables, and to have values assigned to them.
20449 * ecore.cs (Expression.StoreFromPtr): New utility function to
20450 store values dereferencing.
20452 2002-02-20 Ravi Pratap <ravi@ximian.com>
20454 * expression.cs (Binary.ResolveOperator): Ensure that we are
20455 not trying to operate on a void type - this fixes the reported
20458 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
20459 the parent implementation is sealed.
20461 * ../errors/cs0239.cs : Add.
20463 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20465 * typemanager.cs (unverifiable_code_type): Corresponds to
20466 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20467 which have unsafe code in them.
20469 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
20472 2002-02-19 Miguel de Icaza <miguel@ximian.com>
20474 * cs-tokenizer.cs: Add support for @"litreal strings"
20476 Make tokenizer accept pre-processor directives
20477 on any column (remove the old C-like limitation).
20479 * rootcontext.cs (EmitCode): Emit any global attributes.
20480 (AddGlobalAttributes): Used to keep track of assembly attributes.
20482 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20484 * cs-parser.jay: Add support for global attributes.
20486 2002-02-17 Miguel de Icaza <miguel@ximian.com>
20488 * expression.cs (Indirection): New helper class. Unary will
20489 create Indirection classes to be able to implement the
20490 IMemoryLocation interface on it.
20492 2002-02-16 Miguel de Icaza <miguel@ximian.com>
20494 * cs-parser.jay (fixed_statement): reference the right statement.
20496 * statement.cs (Fixed.Emit): Finish implementing the fixed
20497 statement for the &x case.
20499 2002-02-14 Miguel de Icaza <miguel@ximian.com>
20501 * class.cs (Property.Define, Method.Define): Remove newslot when
20504 * modifiers.cs: My use of NewSlot when `Abstract' was set was
20505 wrong. NewSlot should only be used if the `new' keyword is present.
20507 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20508 locating our system dir. Sorry about this.
20510 2002-02-13 Miguel de Icaza <miguel@ximian.com>
20512 * driver.cs (GetSystemDir): Compute correctly the location of our
20513 system assemblies. I was using the compiler directory instead of
20514 the library directory.
20516 2002-02-13 Ravi Pratap <ravi@ximian.com>
20518 * expression.cs (BetterFunction): Put back in what Miguel commented out
20519 since it is the correct fix. The problem is elsewhere ;-)
20521 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20522 parameters of the parms method are themselves compatible or not !
20524 (StandardConversionExists): Fix very dangerous bug where we were forgetting
20525 to check that a class implements an interface before saying that an implicit
20526 conversion was allowed. Use ImplementsInterface to do the checking.
20528 2002-02-13 Miguel de Icaza <miguel@ximian.com>
20530 * class.cs (Method.Define): Track whether we are an explicit
20531 implementation or not. And only call DefineMethodOverride if we
20532 are an explicit implementation.
20534 (Property.DefineMethod): Ditto.
20536 2002-02-11 Ravi Pratap <ravi@ximian.com>
20538 * expression.cs (BetterFunction): Catch hideous bug which was
20539 preventing us from detecting ambiguous calls due to implicit casts i.e
20542 2002-01-29 Miguel de Icaza <miguel@ximian.com>
20544 * support.cs (Pair): Remove un-needed method. I figured why I was
20545 getting the error in cs-parser.jay, the variable in a foreach loop
20546 is readonly, and the compiler does not really treat this as a variable.
20548 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
20549 instead of EQUALS in grammar.
20551 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
20553 * expression.cs (Unary.DoResolve): Check whether the argument is
20556 2002-01-28 Miguel de Icaza <miguel@ximian.com>
20558 * support.cs: Api for Pair to set a value. Despite the fact that
20559 the variables are public the MS C# compiler refuses to compile
20560 code that accesses the field if the variable is part of a foreach
20563 * statement.cs (Fixed): Begin implementation of the fixed
20566 (Block.AddVariable): Return the VariableInfo on success and null
20567 on failure instead of true/false.
20569 * cs-parser.jay (foreach): Catch errors on variables already
20570 defined (we were ignoring this value before) and properly unwind
20571 the block hierarchy
20573 (fixed_statement): grammar for the fixed statement.
20575 2002-01-25 Miguel de Icaza <miguel@ximian.com>
20577 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20578 pointer types to be incretemented.
20580 (SizeOf): Implement.
20582 * cs-parser.jay (pointer_member_access): Implement
20583 expr->IDENTIFIER production.
20585 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20586 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20589 (Unary): Implement indirection.
20591 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20592 use in non-unsafe context).
20594 (SimpleName.DoResolve): Check for pointers in field access on safe
20597 (Expression.LoadFromPtr): Factor the load-indirect code in this
20598 function. This was duplicated in UnboxCast and ParameterReference
20600 2002-01-24 Miguel de Icaza <miguel@ximian.com>
20602 * expression.cs (ComposedCast): report an error if a pointer cast
20603 is used in a safe region.
20605 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20606 pointer type casts in unsafe context.
20608 * codegen.cs (EmitContext): Set up IsUnsafe.
20610 * cs-parser.jay (non_expression_type): Add productions for pointer
20613 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20614 code. We should not use force into static mode if the method is
20615 not virtual. Fixes bug in MIS
20617 * statement.cs (Do.Emit, While.Emit, For.Emit,
20618 Statement.EmitBoolExpression): Add support to Do and While to
20619 propagate infinite loop as `I do return' semantics.
20621 Improve the For case to also test for boolean constants.
20623 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20624 to the list of attributes we can add.
20626 Remove `EmitContext' argument.
20628 * class.cs (Method.Define): Apply parameter attributes.
20629 (Constructor.Define): Apply parameter attributes.
20630 (MethodCore.LabelParameters): Move here the core of labeling
20633 * support.cs (ReflectionParameters.ParameterModifier,
20634 InternalParameters.ParameterModifier): Use IsByRef on the type and
20635 only return the OUT bit for these parameters instead of in/out/ref
20638 This is because I miss-understood things. The ParameterInfo.IsIn
20639 and IsOut represent whether the parameter has the [In] and [Out]
20642 2002-01-22 Miguel de Icaza <miguel@ximian.com>
20644 * ecore.cs (FieldExpr.Emit): Release temporaries.
20646 * assign.cs (LocalTemporary.Release): new function.
20648 * codegen.cs (EmitContext.GetTemporaryStorage,
20649 EmitContext.FreeTemporaryStorage): Rework the way we deal with
20650 temporary storage. Now we can "put back" localbuilders when we
20653 2002-01-21 Miguel de Icaza <miguel@ximian.com>
20655 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20656 need to make a copy of the variable to generate verifiable code.
20658 2002-01-19 Miguel de Icaza <miguel@ximian.com>
20660 * driver.cs: Compute dynamically the system directory.
20662 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20663 Slower, but more generally useful. Used by the abstract
20664 registering implementation.
20666 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20667 the rules for the special rule on Type/instances. First check if
20668 we have the same name, and if so, try that special static path
20669 rather than the instance path.
20671 2002-01-18 Miguel de Icaza <miguel@ximian.com>
20673 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20676 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20677 Enum, ValueType, Delegate or Array for non-corlib compiles.
20679 * cs-tokenizer.cs: Catch long identifiers (645)
20681 * typemanager.cs (IndexerPropetyName): Ravi never tested this
20684 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20685 fix, we were returning too early, so we were not registering
20686 pending methods from abstract classes.
20688 Do not register pending methods if the class is abstract.
20690 * expression.cs (Conditional.DoResolve): Report circular implicit
20691 conversions when we neecd to compute it for conditional
20694 (Is.DoResolve): If the expression is always of the provided type,
20695 flag warning 183. If the expression can not ever be of the
20696 provided type flag warning 184.
20698 * class.cs: Catch 169 as well.
20700 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20703 2002-01-18 Nick Drochak <ndrochak@gol.com>
20705 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
20707 2002-01-17 Miguel de Icaza <miguel@ximian.com>
20709 * interface.cs: (PopulateMethod): Check for pointers being defined
20710 only if the unsafe context is active.
20711 (PopulateProperty): ditto.
20712 (PopulateIndexer): ditto.
20714 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20715 specified. If pointers are present, make sure that they are
20716 present in an unsafe context.
20717 (Constructor, Constructor.Define): ditto.
20718 (Field, Field.Define): ditto.
20719 (Property, Property.Define): ditto.
20720 (Event, Event.Define): ditto.
20722 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
20723 hashtable if there are classes or structs defined.
20725 * expression.cs (LocalVariableReference.DoResolve): Simplify this
20726 code, as the constant resolution moved.
20728 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
20729 the metadata, so we can flag error 133.
20731 * decl.cs (MemberCore.UnsafeOK): New function to test that a
20732 pointer is being declared in an unsafe context.
20734 2002-01-16 Miguel de Icaza <miguel@ximian.com>
20736 * modifiers.cs (Modifiers.Check): Require a Location argument.
20737 Report error 227 for Unsafe use.
20739 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
20741 * statement.cs (For.Emit): If the test is null, then report that
20742 we do `return', as we wont reach anything afterwards.
20744 (Switch.SwitchGoverningType): Track the expression that matched
20747 * driver.cs: Allow negative numbers as an error code to flag.
20749 * cs-parser.jay: Handle 1551.
20751 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
20753 2002-01-15 Miguel de Icaza <miguel@ximian.com>
20755 * cs-parser.jay: Report 1518 (type declaration can only contain
20756 class, struct, interface, enum or delegate)
20758 (switch_label): Report 1523 (keywords `case' or `default' must
20761 (opt_switch_sections): Report 1522 (empty switch)
20763 * driver.cs: Report 1515 (response file specified multiple times)
20764 Report 1516 (Source file specified multiple times).
20766 * expression.cs (Argument.Resolve): Signal 1510
20768 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20769 access not allowed in static code)
20771 2002-01-11 Ravi Pratap <ravi@ximian.com>
20773 * typemanager.cs (IsPointerType): Utility method which we are going
20776 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20777 the object type, so we take care of that.
20779 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20781 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20782 added to non-params parameters :-)
20784 * typemanager.cs (CSharpName): Include 'void' type too.
20786 (void_ptr_type): Include in the set of core types.
20788 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
20791 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
20794 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
20795 completely forgotten about it.
20797 2002-01-10 Ravi Pratap <ravi@ximian.com>
20799 * cs-parser.jay (pointer_type): Add. This begins our implementation
20800 of parsing rules for unsafe code.
20802 (unsafe_statement): Implement.
20804 (embedded_statement): Modify to include the above.
20806 * statement.cs (Unsafe): Implement new class for unsafe blocks.
20808 * codegen.cs (EmitContext.InUnsafe): Add. This determines
20809 if the current context is an unsafe one.
20811 * cs-parser.jay (local_variable_pointer_type): Since local variable types
20812 are handled differently, we need separate rules for them.
20814 (local_variable_declaration): Update to use local_variable_pointer_type
20815 to allow variable declarations of unmanaged pointer types.
20817 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20818 in unsafe contexts.
20820 * ../errors/cs0214.cs : Add.
20822 2002-01-16 Nick Drochak <ndrochak@gol.com>
20824 * makefile: remove 'response' file when cleaning.
20826 2002-01-15 Miguel de Icaza <miguel@ximian.com>
20828 * cs-parser.jay: Report 1524.
20830 2002-01-14 Miguel de Icaza <miguel@ximian.com>
20832 * typemanager.cs (RegisterMethod): drop checking if we have
20833 registered this from here
20835 2002-01-12 Miguel de Icaza <miguel@ximian.com>
20837 * class.cs (Method.EmitDestructor): Implement calling our base
20840 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20841 value of InFinally.
20843 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20844 this routine and will wrap the call in a try/catch block. Deal
20847 2002-01-11 Miguel de Icaza <miguel@ximian.com>
20849 * ecore.cs (Expression.MemberLookup): instead of taking a
20850 parameter `same_type' that was used to tell whether we could
20851 access private members we compute our containing type from the
20854 (FieldExpr): Added partial support for volatile fields. This does
20855 not work for volatile fields exposed from assemblies, as I can not
20856 figure out how to extract the modreq from it.
20858 Updated all the source files to use this.
20860 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20861 because it is referenced by MemberLookup very often.
20863 2002-01-09 Ravi Pratap <ravi@ximian.com>
20865 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20866 TypeBuilder.GetCustomAttributes to retrieve what we need.
20868 Get rid of redundant default_member_attr_type as this is the same as
20869 default_member_type which already exists.
20871 * interface.cs, attribute.cs : Update accordingly.
20873 2002-01-08 Miguel de Icaza <miguel@ximian.com>
20875 * typemanager.cs: Enable IndexerPropertyName again. It does not
20876 work for TYpeBuilders though. Ravi, can you please fix this?
20878 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20880 * expression.cs (Argument.Emit): Handle the case of ref objects
20881 being passed to ref functions;
20883 (ParameterReference.EmitLoad): Loads the content of the pointer
20884 without dereferencing.
20886 2002-01-07 Miguel de Icaza <miguel@ximian.com>
20888 * cs-tokenizer.cs: Implemented the pre-processing expressions.
20890 2002-01-08 Ravi Pratap <ravi@ximian.com>
20892 * class.cs (Indexer.DefineMethod): Incorporate the interface
20893 type in the name of the method if we are doing explicit interface
20896 * expression.cs (ConversionExists): Remove as it is completely obsolete.
20898 (BetterConversion): Fix extremely trivial bug where we were referring to
20899 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20902 * ../errors/bug16.cs : Add although we have fixed it.
20904 2002-01-07 Miguel de Icaza <miguel@ximian.com>
20906 * expression.cs (BaseIndexer): Begin implementation.
20908 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20910 * cs-parser.jay (indexer_declarator): Use qualified_identifier
20911 production directly to remove a shift/reduce, and implement
20912 explicit interface implementation.
20914 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20915 after a floating point suffix.
20917 * expression.cs (DoNumericPromotions): Improved the conversion for
20918 uint/uint. If we have a constant, we avoid doing a typecast to a
20921 * class.cs (Indexer): Implement explicit interface implementation
20924 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20926 * class.cs: make the default instance constructor public and hidebysig.
20928 2001-01-03 Ravi Pratap <ravi@ximian.com>
20930 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20931 so we can call it from elsewhere.
20933 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20934 we emit it internally if the class has a defined indexer; otherwise the user
20935 emits it by decorating the class definition with the DefaultMemberAttribute.
20937 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20938 attribute is not used on a type which defines an indexer.
20940 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20941 character when we skip whitespace.
20943 * ../errors/cs0646.cs : Add.
20945 2002-01-03 Miguel de Icaza <miguel@ximian.com>
20947 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20950 * makefile: Add practical target `mcs3.exe' which builds the third
20951 generation compiler.
20953 * expression.cs (New): Fix structures constructor calling.
20955 * class.cs (Property, Method, Indexer): Emit Final flag on the
20956 method if we are an interface implementation and we are not
20959 * ecore.cs (PropertyExpr): New public field `IsBase', tells
20960 whether this property is referencing a `base' method.
20962 * expression.cs (Invocation.EmitCall): take an extra argument:
20963 is_base, this is used to determine whether the `call' or
20964 `callvirt' opcode should be used.
20967 * delegate.cs: update EmitCall.
20969 * class.cs (Method.Define): Set NewSlot for the cases where we are
20970 not implementing an interface method.
20972 (Property.Define): ditto.
20974 2002-01-02 Miguel de Icaza <miguel@ximian.com>
20976 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20977 'r'. Allows mcs to parse itself fully.
20979 2002-01-02 Ravi Pratap <ravi@ximian.com>
20981 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20982 of the number of initializers that require the InitializeArray method.
20984 (CheckIndices): Store the Expression in all cases - not the plain value. Also
20985 update the above field where necessary.
20987 (MakeByteBlob): Update accordingly.
20989 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
20992 (EmitDynamicInitializers): Update in accordance with the new optimization.
20994 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20995 same OpCode applies.
20997 * cs-parser.jay : Fix some glaring errors I introduced.
20999 2002-01-01 Ravi Pratap <ravi@ximian.com>
21001 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
21002 so that we can check for name clashes there too.
21004 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
21005 for interface indexers.
21007 * interfaces.cs (Define): Emit the default member attribute.
21009 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
21010 variable was being referred to while setting the value ;-)
21012 2002-01-01 Miguel de Icaza <miguel@ximian.com>
21014 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
21015 byte-by-byte information when we know the data is zero.
21017 Make the block always a multiple of 4, because
21018 DefineInitializedData has a bug.
21020 * assign.cs: Fix, we should assign from the temporary, not from
21023 * expression.cs (MakeByteBlob): Fix my incorrect code.
21025 2001-12-31 Miguel de Icaza <miguel@ximian.com>
21027 * typemanager.cs (EnumToUnderlying): This function is used to get
21028 the underlying type from an enumeration, because it does not
21031 * constant.cs: Use the I4_S form for values between -128 and 127.
21033 * statement.cs (Block.LookupLabel): Looks up a label.
21034 (Block): Drop support for labeled blocks.
21036 (LabeledStatement): New kind of statement that represents a label
21039 (Goto): Finally implement this bad boy.
21041 * cs-parser.jay: Update to reflect new mechanism to implement
21044 2001-12-30 Miguel de Icaza <miguel@ximian.com>
21046 * codegen.cs (EmitContext.This): a codegen property that keeps the
21047 a single instance of this instead of creating many different this
21050 * delegate.cs (Delegate.DoResolve): Update to use the property;
21052 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
21054 * expression.cs (BaseAccess.DoResolve): Ditto.
21056 2001-12-29 Ravi Pratap <ravi@ximian.com>
21058 * typemanager.cs (methodimpl_attr_type): Add to hold the type
21059 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
21061 (InitCoreTypes): Update accordingly.
21063 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
21064 so we can quickly store the state.
21066 (ApplyAttributes): Set the correct implementation flags
21067 for InternalCall methods.
21069 2001-12-29 Miguel de Icaza <miguel@ximian.com>
21071 * expression.cs (EmitCall): if a method is not virtual, then do
21072 not use callvirt on it.
21074 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
21075 user defined stuff) requires the use of stobj, which takes an
21076 address on the stack instead of an array and an index. So emit
21077 the Ldelema operation for it.
21079 (EmitStoreOpcode): Use stobj for valuetypes.
21081 (UnaryMutator.EmitCode): Use the right 1 value depending on
21082 whether we are dealing with int64/uint64, float or doubles.
21084 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
21085 constructors that I implemented last night.
21087 (Constructor.IsDefault): Fix to work properly for static
21090 * cs-parser.jay (CheckDef): report method signature errors.
21091 Update error number 103 to be 132.
21093 * decl.cs: New AdditionResult enumeration value: MethodExists.
21094 Although we do this check for methods later on in the semantic
21095 analysis, catching repeated default constructors is so easy that
21096 we catch these here.
21098 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
21101 (ParameterReference.EmitAssign, Emit): handle
21104 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
21105 (ArrayAccess.EmitStoreOpcode): ditto.
21107 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
21109 * expression.cs (MakeByteBlob): Complete all the missing types
21110 (uint, short, ushort, byte, sbyte)
21112 * class.cs: Only init instance field initializers on instance
21115 Rename `constructors' to instance_constructors.
21117 (TypeContainer.AddConstructor): Only add constructors to the list
21118 if it is not static.
21120 Make sure that we handle default_static_constructor independently
21121 everywhere where we handle instance_constructors
21123 2001-12-28 Miguel de Icaza <miguel@ximian.com>
21125 * class.cs: Do not lookup or create a base initializer for a
21126 static constructor.
21128 (ConstructorInitializer.Resolve): use the proper type to lookup
21131 * cs-parser.jay: Report error 1585 (modifiers between type and name).
21133 * enum.cs, interface.cs: Remove CloseType, this is taken care by
21136 * decl.cs: CloseType is now an virtual method, the default
21137 implementation just closes this type.
21139 2001-12-28 Ravi Pratap <ravi@ximian.com>
21141 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
21142 to PreserveSig by default. Also emit HideBySig on such methods.
21144 Basically, set the defaults to standard values.
21146 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
21147 argument, if candidate is better, it can't be worse than the best !
21149 (Invocation): Re-write bits to differentiate between methods being
21150 applicable in their expanded form and their normal form - for params
21153 Get rid of use_standard everywhere as only standard conversions are allowed
21154 in overload resolution.
21156 More spec conformance.
21158 2001-12-27 Miguel de Icaza <miguel@ximian.com>
21160 * driver.cs: Add --timestamp, to see where the compiler spends
21163 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
21164 `this' in static code.
21166 (SimpleName.DoResolve): Implement in terms of a helper function
21167 that allows static-references to be passed upstream to
21170 (Expression.ResolveWithSimpleName): Resolve specially simple
21171 names when called by MemberAccess to implement the special
21174 (Expression.ImplicitReferenceConversion): Handle conversions from
21175 Null to reference types before others, as Null's type is
21178 * expression.cs (Invocation.EmitCall): Handle the special case of
21179 calling methods declared on a reference type from a ValueType
21180 (Base classes System.Object and System.Enum)
21182 (MemberAccess.Resolve): Only perform lookups on Enumerations if
21183 the left hand side is a TypeExpr, not on every enumeration.
21185 (Binary.Resolve): If types are reference types, then do a cast to
21186 object on operators != and == of both arguments.
21188 * typemanager.cs (FindMembers): Extract instance and static
21189 members if requested.
21191 * interface.cs (PopulateProperty): Use void_type instead of null
21192 as the return type for the setter method.
21194 (PopulateIndexer): ditto.
21196 2001-12-27 Ravi Pratap <ravi@ximian.com>
21198 * support.cs (ReflectionParameters): Fix minor bug where we
21199 were examining the wrong parameter for the ParamArray attribute.
21201 Cope with requests for the type of the parameter at position
21202 greater than the params parameter's. We now return the element
21203 type of the params array as that makes more sense.
21205 * expression.cs (Invocation.IsParamsMethodApplicable): Update
21206 accordingly as we no longer have to extract the element type
21209 (Invocation.OverloadResolve): Update.
21211 2001-12-27 Miguel de Icaza <miguel@ximian.com>
21213 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
21214 against IEnumerator, test whether the return value is a descendant
21215 of the IEnumerator interface.
21217 * class.cs (Indexer.Define): Use an auxiliary method to implement
21218 the other bits of the method definition. Begin support for
21219 explicit interface implementation.
21221 (Property.DefineMethod): Use TypeManager.void_type instead of null
21222 for an empty return value.
21224 2001-12-26 Miguel de Icaza <miguel@ximian.com>
21226 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
21227 dealing with a FieldExpr which is composed of a FieldBuilder, in
21228 the code path we did extract the constant, but we should have
21229 obtained the underlying value to be able to cast it (otherwise we
21230 end up in an infinite loop, this is what Ravi was running into).
21232 (ArrayCreation.UpdateIndices): Arrays might be empty.
21234 (MemberAccess.ResolveMemberAccess): Add support for section
21235 14.5.4.1 that deals with the special case of E.I when E is a type
21236 and something else, that I can be a reference to a static member.
21238 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
21239 handle a particular array type to create byte blobs, it is just
21240 something we dont generate byteblobs for.
21242 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
21245 * location.cs (Push): remove the key from the hashtable that we
21246 are about to add. This happens for empty files.
21248 * driver.cs: Dispose files after we have parsed them.
21250 (tokenize): new function that only runs the tokenizer on its
21251 input, for speed testing.
21253 2001-12-26 Ravi Pratap <ravi@ximian.com>
21255 * class.cs (Event.Define): Define the private field only if there
21256 are no accessors defined.
21258 * expression.cs (ResolveMemberAccess): If there is no associated
21259 field with the event, that means we have an event defined with its
21260 own accessors and we should flag error cs0070 since transforming
21261 ourselves into a field is not valid in that case.
21263 * ecore.cs (SimpleName.DoResolve): Same as above.
21265 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
21266 and charset to sane values.
21268 2001-12-25 Ravi Pratap <ravi@ximian.com>
21270 * assign.cs (DoResolve): Perform check on events only if they
21271 are being accessed outside the declaring type.
21273 * cs-parser.jay (event_declarations): Update rules to correctly
21274 set the type of the implicit parameter etc.
21276 (add_accessor, remove_accessor): Set current local parameters.
21278 * expression.cs (Binary): For delegate addition and subtraction,
21279 cast the return value from the method into the appropriate delegate
21282 2001-12-24 Ravi Pratap <ravi@ximian.com>
21284 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
21285 of these as the workaround is unnecessary.
21287 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
21288 delegate data - none of that is needed at all.
21290 Re-write bits to extract the instance expression and the delegate method
21293 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
21296 * attribute.cs (ApplyAttributes): New method to take care of common tasks
21297 of attaching attributes instead of duplicating code everywhere.
21299 * everywhere : Update code to do attribute emission using the above method.
21301 2001-12-23 Miguel de Icaza <miguel@ximian.com>
21303 * expression.cs (IsParamsMethodApplicable): if there are not
21304 parameters, return immediately.
21306 * ecore.cs: The 0 literal can be implicity converted to an enum
21309 (SimpleName.DoResolve): First lookup the type, then lookup the
21312 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
21313 want to get its address. If the InstanceExpression is not
21314 addressable, store the result in a temporary variable, then get
21317 * codegen.cs: Only display 219 errors on warning level or above.
21319 * expression.cs (ArrayAccess): Make it implement the
21320 IMemoryLocation interface.
21322 (Binary.DoResolve): handle the operator == (object a, object b)
21323 and operator != (object a, object b) without incurring into a
21324 BoxedCast (because 5 != o should never be performed).
21326 Handle binary enumerator operators.
21328 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
21329 value type, otherwise use Ldelem_ref.
21331 Use precomputed names;
21333 (AddressOf): Implement address of
21335 * cs-parser.jay (labeled_statement): Fix recursive block
21336 addition by reworking the production.
21338 * expression.cs (New.DoEmit): New has a special case:
21340 If we are dealing with a ValueType, we have a few
21341 situations to deal with:
21343 * The target of New is a ValueType variable, that is
21344 easy, we just pass this as the variable reference
21346 * The target of New is being passed as an argument,
21347 to a boxing operation or a function that takes a
21350 In this case, we need to create a temporary variable
21351 that is the argument of New.
21354 2001-12-23 Ravi Pratap <ravi@ximian.com>
21356 * rootcontext.cs (LookupType): Check that current_type is not null before
21357 going about looking at nested types.
21359 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
21360 not implement the IAssignMethod interface any more.
21362 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
21363 where we tranform them into FieldExprs if they are being resolved from within
21364 the declaring type.
21366 * ecore.cs (SimpleName.DoResolve): Do the same here.
21368 * assign.cs (DoResolve, Emit): Clean up code considerably.
21370 * ../errors/bug10.cs : Add.
21372 * ../errors/cs0070.cs : Add.
21374 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
21376 * assign.cs : Get rid of EventIsLocal everywhere.
21378 2001-12-23 Miguel de Icaza <miguel@ximian.com>
21380 * ecore.cs (ConvertIntLiteral): finished the implementation.
21382 * statement.cs (SwitchLabel): Convert the value we are using as a
21383 key before looking up the table.
21385 2001-12-22 Miguel de Icaza <miguel@ximian.com>
21387 * codegen.cs (EmitTopBlock): Require a Location argument now.
21389 * cs-parser.jay (constructor_declarator): We need to setup
21390 current_local_parameters before we parse the
21391 opt_constructor_initializer, to allow the variables to be bound
21392 to the constructor arguments.
21394 * rootcontext.cs (LookupType): First lookup nested classes in our
21395 class and our parents before we go looking outside our class.
21397 * expression.cs (ConstantFold): Extract/debox the values at the
21400 * rootcontext.cs (EmitCode): Resolve the constants first before we
21401 resolve the types. This is not really needed, but it helps debugging.
21403 * statement.cs: report location.
21405 * cs-parser.jay: pass location to throw statement.
21407 * driver.cs: Small bug fix.
21409 * report.cs: Updated format to be 4-zero filled digits.
21411 2001-12-22 Ravi Pratap <ravi@ximian.com>
21413 * expression.cs (CheckIndices): Fix minor bug where the wrong
21414 variable was being referred to ;-)
21416 (DoEmit): Do not call EmitStaticInitializers when the
21417 underlying type is System.Object.
21419 2001-12-21 Ravi Pratap <ravi@ximian.com>
21421 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
21422 and do the usual workaround for SRE.
21424 * class.cs (MyEventBuilder.EventType): New member to get at the type
21425 of the event, quickly.
21427 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
21429 * assign.cs (Assign.DoResolve): Handle the case when the target
21430 is an EventExpr and perform the necessary checks.
21432 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
21435 (SimpleName.MemberStaticCheck): Include check for EventExpr.
21437 (EventExpr): Set the type in the constructor itself since we
21438 are meant to be born fully resolved.
21440 (EventExpr.Define): Revert code I wrote earlier.
21442 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
21443 instance expression is null. The instance expression is a This in that case
21444 or a null, depending on whether it is a static method or not.
21446 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
21447 refers to more than one method.
21449 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
21450 and accordingly flag errors.
21452 2001-12-21 Miguel de Icaza <miguel@ximian.com>
21454 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
21456 2001-12-22 Miguel de Icaza <miguel@ximian.com>
21458 * location.cs (ToString): Provide useful rutine.
21460 2001-12-21 Miguel de Icaza <miguel@ximian.com>
21462 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21463 objects, return the actual integral boxed.
21465 * statement.cs (SwitchLabel): define an ILLabel for each
21468 (Switch.CheckSwitch): If the value is a Literal, extract
21469 the underlying literal.
21471 Also in the unused hashtable we had, add the SwitchLabel so we can
21472 quickly look this value up.
21474 * constant.cs: Implement a bunch of new constants. Rewrite
21475 Literal based on this. Made changes everywhere to adapt to this.
21477 * expression.cs (Expression.MakeByteBlob): Optimize routine by
21478 dereferencing array only once, and also copes with enumrations.
21480 bytes are two bytes wide, not one.
21482 (Cast): Perform constant conversions.
21484 * ecore.cs (TryImplicitIntConversion): Return literals instead of
21485 wrappers to the literals here.
21487 * expression.cs (DoNumericPromotions): long literals can converted
21488 to ulong implicity (this is taken care of elsewhere, but I was
21489 missing this spot).
21491 * ecore.cs (Expression.Literalize): Make the return type Literal,
21492 to improve type checking.
21494 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21496 2001-12-20 Miguel de Icaza <miguel@ximian.com>
21498 * literal.cs: Revert code from ravi that checked the bounds. The
21499 bounds are sane by the definition of the type itself.
21501 * typemanager.cs: Fix implementation of ImplementsInterface. We
21502 need to actually look up in our parent hierarchy for interfaces
21505 * const.cs: Use the underlying type for enumerations
21507 * delegate.cs: Compute the basename for the delegate creation,
21508 that should fix the delegate test case, and restore the correct
21509 Type Lookup semantics in rootcontext
21511 * rootcontext.cs: Revert Ravi's last patch. The correct way of
21512 referencing a nested type with the Reflection API is using the "+"
21515 * cs-parser.jay: Do not require EOF token at the end.
21517 2001-12-20 Ravi Pratap <ravi@ximian.com>
21519 * rootcontext.cs (LookupType): Concatenate type names with
21520 a '.' instead of a '+' The test suite passes again.
21522 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21523 field of the enumeration.
21525 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21526 the case when the member is an EventExpr.
21528 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21529 static has an associated instance expression.
21531 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21533 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21535 * class.cs (Event.Define): Register event and perform appropriate checks
21538 We define the Add and Remove methods even if the use provides none because
21539 in that case, we provide default implementations ourselves.
21541 Define a private field of the type of the event. This is done by the CSC compiler
21542 and we should be doing it too ;-)
21544 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
21545 More methods we use in code we generate.
21547 (multicast_delegate_type, delegate_type): Two separate types since the distinction
21550 (InitCoreTypes): Update accordingly for the above.
21552 * class.cs (Event.Emit): Generate code for default accessors that we provide
21554 (EmitDefaultMethod): Do the job in the above.
21556 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
21559 2001-12-20 Miguel de Icaza <miguel@ximian.com>
21561 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
21562 builders even if we were missing one.
21564 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
21565 pass the Basename as our class name instead of the Name. The
21566 basename will be correctly composed for us.
21568 * parameter.cs (Paramters): Now takes a Location argument.
21570 * decl.cs (DeclSpace.LookupType): Removed convenience function and
21571 make all the code call directly LookupType in RootContext and take
21572 this chance to pass the Location information everywhere.
21574 * Everywhere: pass Location information.
21576 2001-12-19 Miguel de Icaza <miguel@ximian.com>
21578 * class.cs (Constructor.Define): Updated way of detecting the
21579 length of the parameters.
21581 (TypeContainer.DefineType): Use basename as the type name for
21584 (TypeContainer.Define): Do not recursively define types here, as
21585 definition is taken care in order by the RootContext.
21587 * tree.cs: Keep track of namespaces in a per-file basis.
21589 * parameter.cs (Parameter.ComputeSignature): Update to use
21592 (Parameters.GetSignature): ditto.
21594 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21595 instead of a TypeContainer.
21597 (Interface.SemanticAnalysis): Use `this' instead of our parent to
21598 resolve names. Because we need to be resolve in our context, not
21601 * driver.cs: Implement response files.
21603 * class.cs (TypeContainer.DefineType): If we are defined, do not
21604 redefine ourselves.
21606 (Event.Emit): Emit the code for add/remove handlers.
21607 (Event.Define): Save the MethodBuilders for add/remove.
21609 * typemanager.cs: Use pair here too.
21611 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21612 DictionaryEntry requires the first argument to be non-null.
21614 (enum_declaration): Compute full name for registering the
21617 (delegate_declaration): Instead of using
21618 formal_parameter_list, use opt_formal_parameter_list as the list
21621 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21622 (EventParsing): New property that controls whether `add' and
21623 `remove' are returned as tokens or identifiers (for events);
21625 2001-12-19 Ravi Pratap <ravi@ximian.com>
21627 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21628 use MyEventBuilder only and let it wrap the real builder for us.
21630 (MyEventBuilder): Revamp constructor etc.
21632 Implement all operations that we perform on EventBuilder in precisely the same
21635 (FindMembers): Update to use the EventBuilder member.
21637 (Event.Emit): Update accordingly.
21639 2001-12-18 Ravi Pratap <ravi@ximian.com>
21641 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21642 by calling the appropriate methods.
21644 (GetCustomAttributes): Make stubs as they cannot possibly do anything
21647 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21649 2001-12-17 Ravi Pratap <ravi@ximian.com>
21651 * delegate.cs (Delegate.Populate): Check that the return type
21652 and various parameters types are indeed accessible.
21654 * class.cs (Constructor.Define): Same here.
21656 (Field.Define): Ditto.
21658 (Event.Define): Ditto.
21660 (Operator.Define): Check that the underlying Method defined itself
21661 correctly - so it's MethodBuilder should not be null.
21663 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21664 expression happens to be null.
21666 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21667 members but as of now we don't seem to be able to do anything really useful with it.
21669 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21670 not the EventBuilder.
21672 2001-12-18 Miguel de Icaza <miguel@ximian.com>
21674 * cs-tokenizer.cs: Add support for defines.
21675 Add support for #if, #elif, #else, #endif
21677 (eval_var): evaluates a variable.
21678 (eval): stubbed for evaluating functions.
21680 * cs-parser.jay: Pass the defines information
21682 * driver.cs: Add --define command line option.
21684 * decl.cs: Move MemberCore here.
21686 Make it the base class for DeclSpace. This allows us to catch and
21687 report 108 and 109 for everything now.
21689 * class.cs (TypeContainer.Define): Extract all the members
21690 before populating and emit the warning 108 (new keyword required
21691 to override) instead of having each member implement this.
21693 (MemberCore.Define): New abstract method, we will be using this in
21694 the warning reporting engine in Populate.
21696 (Operator.Define): Adjust to new MemberCore protocol.
21698 * const.cs (Const): This does not derive from Expression, it is a
21699 temporary object we use to create fields, it is a MemberCore.
21701 * class.cs (Method.Define): Allow the entry point to be in a
21704 * driver.cs: Rewrite the argument handler to clean it up a bit.
21706 * rootcontext.cs: Made it just an auxiliary namespace feature by
21707 making everything static.
21709 * driver.cs: Adapt code to use RootContext type name instead of
21712 * delegate.cs: Remove RootContext argument.
21714 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21717 * class.cs (Event.Define): The lookup can fail.
21719 * cs-tokenizer.cs: Begin implementation of pre-procesor.
21721 * expression.cs: Resolve the this instance before invoking the code.
21723 2001-12-17 Miguel de Icaza <miguel@ximian.com>
21725 * cs-parser.jay: Add a production in element_access that allows
21726 the thing to become a "type" reference. This way we can parse
21727 things like "(string [])" as a type.
21729 Note that this still does not handle the more complex rules of
21733 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
21735 * ecore.cs: (CopyNewMethods): new utility function used to
21736 assemble the list of methods from running FindMembers.
21738 (MemberLookup): Rework FindMembers so that
21740 2001-12-16 Miguel de Icaza <miguel@ximian.com>
21742 * class.cs (TypeContainer): Remove Delegates who fail to be
21745 * delegate.cs (Populate): Verify that we dont get null return
21746 values. TODO: Check for AsAccessible.
21748 * cs-parser.jay: Use basename to emit error 574 (destructor should
21749 have the same name as container class), not the full name.
21751 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
21752 possible representation.
21754 Also implements integer type suffixes U and L.
21756 2001-12-15 Miguel de Icaza <miguel@ximian.com>
21758 * expression.cs (ArrayCreation.DoResolve): We need to do the
21759 argument resolution *always*.
21761 * decl.cs: Make this hold the namespace. Hold the root context as
21763 (LookupType): Move here.
21765 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21767 * location.cs (Row, Name): Fixed the code, it was always returning
21768 references to the first file.
21770 * interface.cs: Register properties defined through interfaces.
21772 * driver.cs: Add support for globbing on the command line
21774 * class.cs (Field): Make it derive from MemberCore as well.
21777 2001-12-15 Ravi Pratap <ravi@ximian.com>
21779 * class.cs (Event::Define): Check that the type of the event is a delegate
21780 type else flag error #66.
21782 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21785 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21786 values of EntryPoint, CharSet etc etc.
21788 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21790 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21791 be null and we should ignore this. I am not sure if this is really clean. Apparently,
21792 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21793 which needs this to do its work.
21795 * ../errors/cs0066.cs : Add.
21797 2001-12-14 Miguel de Icaza <miguel@ximian.com>
21799 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21802 * class.cs: (MethodSignature.MethodSignature): Removed hack that
21803 clears out the parameters field.
21804 (MemberSignatureCompare): Cleanup
21806 (MemberCore): New base class used to share code between MethodCore
21809 (RegisterRequiredImplementations) BindingFlags.Public requires
21810 either BindingFlags.Instace or Static. Use instance here.
21812 (Property): Refactored code to cope better with the full spec.
21814 * parameter.cs (GetParameterInfo): Return an empty array instead
21817 * class.cs (Property): Abstract or extern properties have no bodies.
21819 * parameter.cs (GetParameterInfo): return a zero-sized array.
21821 * class.cs (TypeContainer.MethodModifiersValid): Move all the
21822 method modifier validation to the typecontainer so we can reuse
21823 this on properties.
21825 (MethodCore.ParameterTypes): return an empty sized array of types.
21827 (Property.Define): Test property modifier validity.
21829 Add tests for sealed/override too.
21831 (Method.Emit): abstract or extern methods have no bodies.
21833 2001-12-14 Ravi Pratap <ravi@ximian.com>
21835 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21838 (Method::Define, ::Emit): Modify accordingly.
21840 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21842 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21844 * makefile: Pass in /unsafe.
21846 2001-12-13 Miguel de Icaza <miguel@ximian.com>
21848 * class.cs (MakeKey): Kill routine.
21850 * class.cs (TypeContainer.Define): Correctly define explicit
21851 method implementations (they require the full interface name plus
21854 * typemanager.cs: Deply the PtrHashtable here and stop using the
21855 lame keys. Things work so much better.
21857 This of course broke everyone who depended on `RegisterMethod' to
21858 do the `test for existance' test. This has to be done elsewhere.
21860 * support.cs (PtrHashtable): A hashtable that avoid comparing with
21861 the object stupid Equals method (because, that like fails all over
21862 the place). We still do not use it.
21864 * class.cs (TypeContainer.SetRequiredInterface,
21865 TypeContainer.RequireMethods): Killed these two routines and moved
21866 all the functionality to RegisterRequiredImplementations.
21868 (TypeContainer.RegisterRequiredImplementations): This routine now
21869 registers all the implementations required in an array for the
21870 interfaces and abstract methods. We use an array of structures
21871 which can be computed ahead of time to reduce memory usage and we
21872 also assume that lookups are cheap as most classes will not
21873 implement too many interfaces.
21875 We also avoid creating too many MethodSignatures.
21877 (TypeContainer.IsInterfaceMethod): Update and optionally does not
21878 clear the "pending" bit if we find that there are problems with
21881 (TypeContainer.VerifyPendingMethods): Update to report errors of
21882 methods that look like implementations but are not.
21884 (TypeContainer.Define): Add support for explicit interface method
21887 2001-12-12 Miguel de Icaza <miguel@ximian.com>
21889 * typemanager.cs: Keep track of the parameters here instead of
21890 being a feature of the TypeContainer.
21892 * class.cs: Drop the registration of parameters here, as
21893 InterfaceMethods are also interface declarations.
21895 * delegate.cs: Register methods with the TypeManager not only with
21896 the TypeContainer. This code was buggy.
21898 * interface.cs: Full registation here.
21900 2001-12-11 Miguel de Icaza <miguel@ximian.com>
21902 * expression.cs: Remove reducer for binary expressions, it can not
21905 * const.cs: Put here the code that used to go into constant.cs
21907 * constant.cs: Put here the code for constants, this is a new base
21908 class for Literals.
21910 * literal.cs: Make Literal derive from Constant.
21912 2001-12-09 Miguel de Icaza <miguel@ximian.com>
21914 * statement.cs (Return.Emit): Report error 157 if the user
21915 attempts to return from a finally block.
21917 (Return.Emit): Instead of emitting a return, jump to the end of
21920 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21921 LocalBuilder to store the result of the function. ReturnLabel is
21922 the target where we jump.
21925 2001-12-09 Radek Doulik <rodo@ximian.com>
21927 * cs-parser.jay: remember alias in current namespace
21929 * ecore.cs (SimpleName::DoResolve): use aliases for types or
21932 * class.cs (LookupAlias): lookup alias in my_namespace
21934 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21936 (LookupAlias): lookup alias in this and if needed in parent
21939 2001-12-08 Miguel de Icaza <miguel@ximian.com>
21943 * rootcontext.cs: (ModuleBuilder) Made static, first step into
21944 making things static. I need this to avoid passing the
21945 TypeContainer when calling ParameterType.
21947 * support.cs (InternalParameters.ParameterType): Remove ugly hack
21948 that did string manipulation to compute the type and then call
21949 GetType. Use Parameter.ParameterType instead.
21951 * cs-tokenizer.cs: Consume the suffix for floating values.
21953 * expression.cs (ParameterReference): figure out whether this is a
21954 reference parameter or not. Kill an extra variable by computing
21955 the arg_idx during emission.
21957 * parameter.cs (Parameters.GetParameterInfo): New overloaded
21958 function that returns whether a parameter is an out/ref value or not.
21960 (Parameter.ParameterType): The type of the parameter (base,
21961 without ref/out applied).
21963 (Parameter.Resolve): Perform resolution here.
21964 (Parameter.ExternalType): The full type (with ref/out applied).
21966 * statement.cs (Using.Emit, Using.EmitExpression): Implement
21967 support for expressions on the using statement.
21969 2001-12-07 Miguel de Icaza <miguel@ximian.com>
21971 * statement.cs (Using.EmitLocalVariableDecls): Split the
21972 localvariable handling of the using statement.
21974 (Block.EmitMeta): Keep track of variable count across blocks. We
21975 were reusing slots on separate branches of blocks.
21977 (Try.Emit): Emit the general code block, we were not emitting it.
21979 Check the type of the declaration to be an IDisposable or
21980 something that can be implicity converted to it.
21982 Emit conversions if required.
21984 * ecore.cs (EmptyExpression): New utility class.
21985 (Expression.ImplicitConversionExists): New utility function.
21987 2001-12-06 Miguel de Icaza <miguel@ximian.com>
21989 * statement.cs (Using): Implement.
21991 * expression.cs (LocalVariableReference): Support read only variables.
21993 * statement.cs: Remove the explicit emit for the Leave opcode.
21994 (VariableInfo): Add a readonly field.
21996 2001-12-05 Miguel de Icaza <miguel@ximian.com>
21998 * ecore.cs (ConvCast): new class used to encapsulate the various
21999 explicit integer conversions that works in both checked and
22000 unchecked contexts.
22002 (Expression.ConvertNumericExplicit): Use new ConvCast class to
22003 properly generate the overflow opcodes.
22005 2001-12-04 Miguel de Icaza <miguel@ximian.com>
22007 * statement.cs: The correct type for the EmptyExpression is the
22008 element_type, not the variable type. Ravi pointed this out.
22010 2001-12-04 Ravi Pratap <ravi@ximian.com>
22012 * class.cs (Method::Define): Handle PInvoke methods specially
22013 by using DefinePInvokeMethod instead of the usual one.
22015 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
22016 above to do the task of extracting information and defining the method.
22018 2001-12-04 Ravi Pratap <ravi@ximian.com>
22020 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
22021 of the condition for string type.
22023 (Emit): Move that here.
22025 (ArrayCreation::CheckIndices): Keep string literals in their expression
22028 (EmitDynamicInitializers): Handle strings appropriately.
22030 2001-12-04 Miguel de Icaza <miguel@ximian.com>
22032 * codegen.cs (EmitContext): Replace multiple variables with a
22033 single pointer to the current Switch statement.
22035 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
22038 2001-12-03 Miguel de Icaza <miguel@ximian.com>
22042 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
22045 (Foreach.Emit): Foreach on arrays was not setting
22046 up the loop variables (for break/continue).
22048 (GotoCase): Semi-implented.
22050 2001-12-03 Ravi Pratap <ravi@ximian.com>
22052 * attribute.cs (CheckAttribute): Handle system attributes by using
22053 Attribute.GetAttributes to examine information we need.
22055 (GetValidPlaces): Same here.
22057 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
22059 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
22061 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
22063 (Method::Define): Set appropriate flags if we have a DllImport attribute.
22065 (Method::Emit): Handle the case when we are a PInvoke method.
22067 2001-12-03 Miguel de Icaza <miguel@ximian.com>
22069 * expression.cs: Use ResolveWithSimpleName on compound names.
22071 2001-12-02 Ravi Pratap <ravi@ximian.com>
22073 * constant.cs (EmitConstant): Make sure we resolve the associated expression
22074 before trying to reduce it.
22076 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
22078 * constant.cs (LookupConstantValue): Implement.
22080 (EmitConstant): Use the above in emitting the constant.
22082 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
22083 that are user-defined by doing a LookupConstantValue on them.
22085 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
22088 2001-11-29 Miguel de Icaza <miguel@ximian.com>
22090 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
22092 (BaseAccess.DoResolve): Implement.
22094 (MemberAccess.DoResolve): Split this routine into a
22095 ResolveMemberAccess routine that can be used independently
22097 2001-11-28 Miguel de Icaza <miguel@ximian.com>
22099 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
22100 As that share bits of the implementation. Is returns a boolean,
22101 while As returns the Type that is being probed.
22103 2001-12-01 Ravi Pratap <ravi@ximian.com>
22105 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
22106 instead of a Literal - much easier.
22108 (EnumInTransit): Remove - utterly useless :-)
22110 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
22112 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
22114 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
22115 chain when we have no associated expression.
22117 2001-11-30 Ravi Pratap <ravi@ximian.com>
22119 * constant.cs (Define): Use Location while reporting the errror.
22121 Also emit a warning when 'new' is used and there is no inherited
22124 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
22127 (LookupEnumValue): Implement to lookup an enum member's value and define it
22130 (Populate): Re-write accordingly to use the above routine.
22132 2001-11-27 Miguel de Icaza <miguel@ximian.com>
22134 * expression.cs (This): Fix prototype for DoResolveLValue to
22135 override the base class DoResolveLValue.
22137 * cs-parser.cs: Report errors cs574 and cs575 (destructor
22140 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
22141 (we need to load the address of the field here). This fixes
22144 (FieldExpr.DoResolveLValue): Call the DoResolve
22145 function to initialize the Instance expression.
22147 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
22148 correctly the GetEnumerator operation on a value type.
22150 * cs-parser.jay: Add more simple parsing error catches.
22152 * statement.cs (Switch): Add support for string switches.
22153 Handle null specially.
22155 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
22157 2001-11-28 Ravi Pratap <ravi@ximian.com>
22159 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
22161 (declare_local_constant): New helper function.
22163 * statement.cs (AddConstant): Keep a separate record of constants
22165 (IsConstant): Implement to determine if a variable is a constant.
22167 (GetConstantExpression): Implement.
22169 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
22171 * statement.cs (IsVariableDefined): Re-write.
22173 2001-11-27 Ravi Pratap <ravi@ximian.com>
22175 * class.cs (TypeContainer::FindMembers): Look for constants
22176 in the case when we are looking for MemberTypes.Field
22178 * expression.cs (MemberAccess::DoResolve): Check that in the
22179 case we are a FieldExpr and a Literal, we are not being accessed
22180 by an instance reference.
22182 * cs-parser.jay (local_constant_declaration): Implement.
22184 (declaration_statement): Implement for constant declarations.
22186 2001-11-26 Miguel de Icaza <miguel@ximian.com>
22188 * statement.cs (Switch): Catch double defaults.
22190 (Switch): More work on the switch() statement
22191 implementation. It works for integral values now, need to finish
22195 2001-11-24 Miguel de Icaza <miguel@ximian.com>
22197 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
22198 integer literals into other integer literals. To be used by
22201 2001-11-24 Ravi Pratap <ravi@ximian.com>
22203 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
22206 (EmitDynamicInitializers): Cope with the above since we extract data
22207 directly from ArrayData now.
22209 (ExpectInitializers): Keep track of whether initializers are mandatory
22212 (Bounds): Make it a hashtable to prevent the same dimension being
22213 recorded for every element in that dimension.
22215 (EmitDynamicInitializers): Fix bug which prevented the Set array method
22218 Also fix bug which was causing the indices to be emitted in the reverse
22221 2001-11-24 Miguel de Icaza <miguel@ximian.com>
22223 * expression.cs (ArrayCreation): Implement the bits that Ravi left
22224 unfinished. They do not work, because the underlying code is
22227 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22229 * cs-parser.jay: Remove bogus fixme.
22231 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
22232 on Switch statement.
22234 2001-11-23 Ravi Pratap <ravi@ximian.com>
22236 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
22239 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
22240 parameter. Apparently, any expression is allowed.
22242 (ValidateInitializers): Update accordingly.
22244 (CheckIndices): Fix some tricky bugs thanks to recursion.
22246 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
22247 I was being completely brain-dead.
22249 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
22250 and re-write acordingly.
22252 (DelegateInvocation): Re-write accordingly.
22254 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
22256 (MakeByteBlob): Handle types more correctly.
22258 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
22259 initialization from expressions but it is incomplete because I am a complete
22262 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22264 * statement.cs (If.Emit): Fix a bug that generated incorrect code
22265 on If. Basically, we have to return `true' (ie, we do return to
22266 our caller) only if both branches of the if return.
22268 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
22269 short-circuit operators, handle them as short circuit operators.
22271 (Cast.DoResolve): Resolve type.
22272 (Cast.Cast): Take an expression as the target type.
22274 * cs-parser.jay (cast_expression): Remove old hack that only
22275 allowed a limited set of types to be handled. Now we take a
22276 unary_expression and we resolve to a type during semantic
22279 Use the grammar productions from Rhys to handle casts (this is
22280 not complete like Rhys syntax yet, we fail to handle that corner
22281 case that C# has regarding (-x), but we will get there.
22283 2001-11-22 Ravi Pratap <ravi@ximian.com>
22285 * class.cs (EmitFieldInitializer): Take care of the case when we have a
22286 field which is an array type.
22288 * cs-parser.jay (declare_local_variables): Support array initialization too.
22290 * typemanager.cs (MakeKey): Implement.
22292 (everywhere): Use the above appropriately.
22294 * cs-parser.jay (for_statement): Update for array initialization while
22295 declaring variables.
22297 * ecore.cs : The error message was correct, it's the variable's names that
22298 were misleading ;-) Make the code more readable.
22300 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
22301 the correct type etc.
22303 (ConvertExplicit): Handle Enum types by examining the underlying type.
22305 2001-11-21 Ravi Pratap <ravi@ximian.com>
22307 * parameter.cs (GetCallingConvention): Always return
22308 CallingConventions.Standard for now.
22310 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22312 * expression.cs (Binary.ResolveOperator): Update the values of `l'
22313 and `r' after calling DoNumericPromotions.
22315 * ecore.cs: Fix error message (the types were in the wrong order).
22317 * statement.cs (Foreach.ProbeCollectionType): Need to pass
22318 BindingFlags.Instance as well
22320 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
22321 implicit int literal conversion in an empty cast so that we
22322 propagate the right type upstream.
22324 (UnboxCast): new class used to unbox value types.
22325 (Expression.ConvertExplicit): Add explicit type conversions done
22328 (Expression.ImplicitNumericConversion): Oops, forgot to test for
22329 the target type before applying the implicit LongLiterals to ULong
22332 2001-11-21 Miguel de Icaza <miguel@ximian.com>
22334 * cs-parser.jay (for_statement): Reworked the way For works: now
22335 we declare manually any variables that are introduced in
22336 for_initializer to solve the problem of having out-of-band code
22337 emition (that is what got for broken).
22339 (declaration_statement): Perform the actual variable declaration
22340 that used to be done in local_variable_declaration here.
22342 (local_variable_declaration): Do not declare anything, just pass
22343 the information on a DictionaryEntry
22345 2001-11-20 Ravi Pratap <ravi@ximian.com>
22347 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
22348 re-write of the logic to now make it recursive.
22350 (UpdateIndices): Re-write accordingly.
22352 Store element data in a separate ArrayData list in the above methods.
22354 (MakeByteBlob): Implement to dump the array data into a byte array.
22356 2001-11-19 Ravi Pratap <ravi@ximian.com>
22358 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
22361 * constant.cs (Define): Implement.
22363 (EmitConstant): Re-write fully.
22365 Pass in location info.
22367 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
22370 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
22371 DictionaryEntry since we need location info too.
22373 (constant_declaration): Update accordingly.
22375 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
22376 code into another method : UpdateIndices.
22378 2001-11-18 Ravi Pratap <ravi@ximian.com>
22380 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
22381 some type checking etc.
22383 2001-11-17 Ravi Pratap <ravi@ximian.com>
22385 * expression.cs (ArrayCreation::ValidateInitializers): Implement
22386 bits to provide dimension info if the user skips doing that.
22388 Update second constructor to store the rank correctly.
22390 2001-11-16 Ravi Pratap <ravi@ximian.com>
22392 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
22393 and try to implement.
22395 * ../errors/cs0150.cs : Add.
22397 * ../errors/cs0178.cs : Add.
22399 2001-11-16 Miguel de Icaza <miguel@ximian.com>
22401 * statement.cs: Implement foreach on multi-dimensional arrays.
22403 * parameter.cs (Parameters.GetParameterByName): Also lookup the
22404 name of the params argument.
22406 * expression.cs: Use EmitStoreOpcode to get the right opcode while
22407 initializing the array.
22409 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
22410 we can use this elsewhere.
22412 * statement.cs: Finish implementation of foreach for single
22415 * cs-parser.jay: Use an out-of-band stack to pass information
22416 around, I wonder why I need this.
22418 foreach_block: Make the new foreach_block the current_block.
22420 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
22421 function used to return a static Parameters structure. Used for
22422 empty parameters, as those are created very frequently.
22424 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
22426 2001-11-15 Ravi Pratap <ravi@ximian.com>
22428 * interface.cs : Default modifier is private, not public. The
22429 make verify test passes again.
22431 2001-11-15 Ravi Pratap <ravi@ximian.com>
22433 * support.cs (ReflectionParameters): Fix logic to determine
22434 whether the last parameter is a params one. Test 9 passes again.
22436 * delegate.cs (Populate): Register the builders we define with
22437 RegisterParameterForBuilder. Test 19 passes again.
22439 * cs-parser.jay (property_declaration): Reference $6 instead
22440 of $$ to get at the location.
22442 (indexer_declaration): Similar stuff.
22444 (attribute): Ditto.
22446 * class.cs (Property): Register parameters for the Get and Set methods
22447 if they exist. Test 23 passes again.
22449 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
22450 call to EmitArguments as we are sure there aren't any params arguments.
22451 Test 32 passes again.
22453 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
22454 IndexOutOfRangeException.
22456 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
22457 Test 33 now passes again.
22459 2001-11-15 Miguel de Icaza <miguel@ximian.com>
22461 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22462 broke a bunch of things. Will have to come up with a better way
22463 of tracking locations.
22465 * statement.cs: Implemented foreach for single dimension arrays.
22467 2001-11-09 Miguel de Icaza <miguel@ximian.com>
22469 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22470 an error. This removes the lookup from the critical path.
22472 * cs-parser.jay: Removed use of temporary_loc, which is completely
22475 2001-11-14 Miguel de Icaza <miguel@ximian.com>
22477 * support.cs (ReflectionParameters.ParameterModifier): Report
22478 whether the argument is a PARAMS argument or not.
22480 * class.cs: Set the attribute `ParamArrayAttribute' on the
22481 parameter argument.
22483 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22484 and cons_param_array_attribute (ConstructorInfo for
22485 ParamArrayAttribute).,
22487 * codegen.cs: Emit the return using the `Return' statement, that
22488 way we can report the error correctly for missing return values.
22490 * class.cs (Method.Emit): Clean up.
22492 * expression.cs (Argument.Resolve): Take another argument: the
22493 location where this argument is used. Notice that this is not
22494 part of the "Argument" class as to reduce the size of the
22495 structure (we know the approximate location anyways).
22497 Test if the argument is a variable-reference, if not, then
22498 complain with a 206.
22500 (Argument.Emit): Emit addresses of variables.
22502 (Argument.FullDesc): Simplify.
22504 (Invocation.DoResolve): Update for Argument.Resolve.
22506 (ElementAccess.DoResolve): ditto.
22508 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22509 method should be virtual, as this method is always virtual.
22511 (NewDelegate.DoResolve): Update for Argument.Resolve.
22513 * class.cs (ConstructorInitializer.DoResolve): ditto.
22515 * attribute.cs (Attribute.Resolve): ditto.
22517 2001-11-13 Miguel de Icaza <miguel@ximian.com>
22519 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22521 * expression.cs (ParameterReference): Drop IStackStorage and implement
22522 IAssignMethod instead.
22524 (LocalVariableReference): ditto.
22526 * ecore.cs (FieldExpr): Drop IStackStorage and implement
22527 IAssignMethod instead.
22529 2001-11-13 Miguel de Icaza <miguel@ximian.com>
22531 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22532 enumerations that are used in heavily used structures derive from
22533 byte in a laughable and pathetic attempt to reduce memory usage.
22534 This is the kind of pre-optimzations that you should not do at
22535 home without adult supervision.
22537 * expression.cs (UnaryMutator): New class, used to handle ++ and
22538 -- separatedly from the other unary operators. Cleans up the
22539 code, and kills the ExpressionStatement dependency in Unary.
22541 (Unary): Removed `method' and `Arguments' from this class, making
22542 it smaller, and moving it all to SimpleCall, so I can reuse this
22543 code in other locations and avoid creating a lot of transient data
22544 strucutres when not required.
22546 * cs-parser.jay: Adjust for new changes.
22548 2001-11-11 Miguel de Icaza <miguel@ximian.com>
22550 * enum.cs (Enum.Populate): If there is a failure during
22553 * cs-parser.jay (opt_enum_base): we used to catch type errors
22554 here, but this is really incorrect. The type error should be
22555 catched during semantic analysis.
22557 2001-12-11 Ravi Pratap <ravi@ximian.com>
22559 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
22560 current_local_parameters as expected since I, in my stupidity, had forgotten
22563 * attribute.cs (GetValidPlaces): Fix stupid bug.
22565 * class.cs (Method::Emit): Perform check on applicability of attributes.
22567 (Constructor::Emit): Ditto.
22569 (Field::Emit): Ditto.
22571 (Field.Location): Store location information.
22573 (Property, Event, Indexer, Operator): Ditto.
22575 * cs-parser.jay (field_declaration): Pass in location for each field.
22577 * ../errors/cs0592.cs : Add.
22579 2001-11-12 Ravi Pratap <ravi@ximian.com>
22581 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22583 (InitCoreTypes): Update accordingly.
22585 (RegisterAttrType, LookupAttr): Implement.
22587 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22588 info about the same.
22590 (Resolve): Update to populate the above as necessary.
22592 (Error592): Helper.
22594 (GetValidPlaces): Helper to the above.
22596 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22598 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22600 2001-11-12 Ravi Pratap <ravi@ximian.com>
22602 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22604 * ../errors/cs0617.cs : Add.
22606 2001-11-11 Ravi Pratap <ravi@ximian.com>
22608 * enum.cs (Emit): Rename to Populate to be more consistent with what
22609 we expect it to do and when exactly it is called.
22611 * class.cs, rootcontext.cs : Update accordingly.
22613 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22614 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22616 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22618 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22619 of a fieldinfo using the above, when dealing with a FieldBuilder.
22621 2001-11-10 Ravi Pratap <ravi@ximian.com>
22623 * ../errors/cs0031.cs : Add.
22625 * ../errors/cs1008.cs : Add.
22627 * ../errrors/cs0543.cs : Add.
22629 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22632 (FindMembers): Implement.
22634 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22635 enums and delegates too.
22637 (enum_types): Rename to builder_to_enum.
22639 (delegate_types): Rename to builder_to_delegate.
22641 * delegate.cs (FindMembers): Implement.
22643 2001-11-09 Ravi Pratap <ravi@ximian.com>
22645 * typemanager.cs (IsEnumType): Implement.
22647 * enum.cs (Emit): Re-write parts to account for the underlying type
22648 better and perform checking etc.
22650 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22651 of the underlying type.
22653 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22656 * enum.cs (error31): Helper to report error #31.
22658 * cs-parser.jay (enum_declaration): Store location of each member too.
22660 * enum.cs (member_to_location): New hashtable.
22662 (AddEnumMember): Update location hashtable.
22664 (Emit): Use the location of each member while reporting errors.
22666 2001-11-09 Miguel de Icaza <miguel@ximian.com>
22668 * cs-parser.jay: A for_initializer if is a
22669 local_variable_declaration really ammount to have an implicit
22670 block with the variable declaration and no initializer for for.
22672 * statement.cs (For.Emit): Cope with null initializers.
22674 This fixes the infinite loop on for initializers.
22676 2001-11-08 Miguel de Icaza <miguel@ximian.com>
22678 * enum.cs: More cleanup.
22680 * ecore.cs: Remove dead code.
22682 * class.cs (Property.Emit): More simplification.
22683 (Event.Emit): ditto.
22685 Reworked to have less levels of indentation.
22687 2001-11-08 Ravi Pratap <ravi@ximian.com>
22689 * class.cs (Property): Emit attributes.
22699 * enum.cs (Emit): Ditto.
22701 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22704 * class.cs (Field, Event, etc.): Move attribute generation into the
22705 Emit method everywhere.
22707 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22708 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22709 as we had no way of defining nested enums !
22711 * rootcontext.cs : Adjust code accordingly.
22713 * typemanager.cs (AddEnumType): To keep track of enum types separately.
22715 2001-11-07 Ravi Pratap <ravi@ximian.com>
22717 * expression.cs (EvalConstantExpression): Move into ecore.cs
22719 * enum.cs (Enum): Rename some members and make them public and readonly
22720 according to our convention.
22722 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
22725 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
22727 (Enum::Emit): Write a simple version for now which doesn't try to compute
22728 expressions. I shall modify this to be more robust in just a while.
22730 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
22732 (TypeContainer::CloseType): Create the Enum types too.
22734 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
22736 * expression.cs (EvalConstantExpression): Get rid of completely.
22738 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
22739 user-defined values and other cases.
22741 (IsValidEnumLiteral): Helper function.
22743 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
22744 out there in the case we had a literal FieldExpr.
22746 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
22748 (Literalize): Revamp a bit to take two arguments.
22750 (EnumLiteral): New class which derives from Literal to wrap enum literals.
22752 2001-11-06 Ravi Pratap <ravi@ximian.com>
22754 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22756 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22758 (Resolve): Use the above to ensure we have proper initializers.
22760 2001-11-05 Ravi Pratap <ravi@ximian.com>
22762 * expression.cs (Expression::EvalConstantExpression): New method to
22763 evaluate constant expressions.
22765 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22767 2001-11-07 Miguel de Icaza <miguel@ximian.com>
22769 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22772 (Binary.ResolveOperator): Handle operator != (object a, object b)
22773 and operator == (object a, object b);
22775 (Binary.DoNumericPromotions): Indicate whether the numeric
22776 promotion was possible.
22778 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22781 Made the ArrayAccess implement interface IAssignMethod instead of
22782 IStackStore as the order in which arguments are passed reflects
22785 * assign.cs: Instead of using expr.ExprClass to select the way of
22786 assinging, probe for the IStackStore/IAssignMethod interfaces.
22788 * typemanager.cs: Load InitializeArray definition.
22790 * rootcontext.cs (RootContext.MakeStaticData): Used to define
22791 static data that can be used to initialize arrays.
22793 2001-11-05 Miguel de Icaza <miguel@ximian.com>
22795 * expression.cs: Handle operator== and operator!= for booleans.
22797 (Conditioal.Reduce): Implement reducer for the ?: operator.
22799 (Conditional.Resolve): Implement dead code elimination.
22801 (Binary.Resolve): Catch string literals and return a new
22802 concatenated string.
22804 (Unary.Reduce): Implement reduction of unary expressions.
22806 * ecore.cs: Split out the expression core handling here.
22808 (Expression.Reduce): New method used to perform constant folding
22809 and CSE. This is needed to support constant-expressions.
22811 * statement.cs (Statement.EmitBoolExpression): Pass true and false
22812 targets, and optimize for !x.
22814 2001-11-04 Ravi Pratap <ravi@ximian.com>
22816 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22817 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22818 set custom atttributes.
22820 * literal.cs (Literal::GetValue): New abstract method to return the actual
22821 value of the literal, cast as an object.
22823 (*Literal): Implement GetValue method.
22825 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22826 expressions to the arraylist but objects of type Argument.
22828 * class.cs (TypeContainer::Emit): Emit our attributes too.
22830 (Method::Emit, Constructor::Emit): Ditto.
22832 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22833 to be ignoring earlier.
22835 2001-11-03 Ravi Pratap <ravi@ximian.com>
22837 * attribute.cs (AttributeSection::Define): Implement to do the business
22838 of constructing a CustomAttributeBuilder.
22840 (Attribute): New trivial class. Increases readability of code.
22842 * cs-parser.jay : Update accordingly.
22844 (positional_argument_list, named_argument_list, named_argument): New rules
22846 (attribute_arguments): Use the above so that we are more correct.
22848 2001-11-02 Ravi Pratap <ravi@ximian.com>
22850 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22851 to perform all checks for a method with a params parameter.
22853 (Invocation::OverloadResolve): Update to use the above method and therefore
22854 cope correctly with params method invocations.
22856 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
22859 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22860 constructors in our parent too because we can't afford to miss out on
22863 * attribute.cs (AttributeSection): New name for the class Attribute
22865 Other trivial changes to improve readability.
22867 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22868 use the new class names.
22870 2001-11-01 Ravi Pratap <ravi@ximian.com>
22872 * class.cs (Method::Define): Complete definition for params types too
22874 (Indexer::Define): Ditto.
22876 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22877 Cope everywhere with a request for info about the array parameter.
22879 2001-11-01 Ravi Pratap <ravi@ximian.com>
22881 * tree.cs (RecordNamespace): Fix up to check for the correct key.
22883 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
22884 local_variable_type to extract the string corresponding to the type.
22886 (local_variable_type): Fixup the action to use the new helper method.
22888 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
22891 * expression.cs : Clean out code which uses the above.
22893 2001-10-31 Ravi Pratap <ravi@ximian.com>
22895 * typemanager.cs (RegisterMethod): Check if we already have an existing key
22896 and bale out if necessary by returning a false.
22898 (RegisterProperty): Ditto.
22900 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22901 and print out appropriate error messages.
22903 * interface.cs (everywhere): Ditto.
22905 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22906 location to constructor.
22908 * class.cs (Property, Event, Indexer): Update accordingly.
22910 * ../errors/cs111.cs : Added.
22912 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22913 of a method, as laid down by the spec.
22915 (Invocation::OverloadResolve): Use the above method.
22917 2001-10-31 Ravi Pratap <ravi@ximian.com>
22919 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22920 now take a TypeContainer and a Parameters object.
22922 (ParameterData): Modify return type of ParameterModifier method to be
22923 Parameter.Modifier and not a string.
22925 (ReflectionParameters, InternalParameters): Update accordingly.
22927 * expression.cs (Argument::GetParameterModifier): Same here.
22929 * support.cs (InternalParameters::ParameterType): Find a better way of determining
22930 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22931 symbol in it at all so maybe this is only for now.
22933 2001-10-30 Ravi Pratap <ravi@ximian.com>
22935 * support.cs (InternalParameters): Constructor now takes an extra argument
22936 which is the actual Parameters class.
22938 (ParameterDesc): Update to provide info on ref/out modifiers.
22940 * class.cs (everywhere): Update call to InternalParameters to pass in
22941 the second argument too.
22943 * support.cs (ParameterData): Add ParameterModifier, which is a method
22944 to return the modifier info [ref/out etc]
22946 (InternalParameters, ReflectionParameters): Implement the above.
22948 * expression.cs (Argument::ParameterModifier): Similar function to return
22949 info about the argument's modifiers.
22951 (Invocation::OverloadResolve): Update to take into account matching modifiers
22954 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22955 a new SetFormalParameters object which we pass to InternalParameters.
22957 2001-10-30 Ravi Pratap <ravi@ximian.com>
22959 * expression.cs (NewArray): Merge into the ArrayCreation class.
22961 2001-10-29 Ravi Pratap <ravi@ximian.com>
22963 * expression.cs (NewArray): Merge classes NewBuiltinArray and
22964 NewUserdefinedArray into one as there wasn't much of a use in having
22967 * expression.cs (Argument): Change field's name to ArgType from Type.
22969 (Type): New readonly property which returns the proper type, taking into
22970 account ref/out modifiers.
22972 (everywhere): Adjust code accordingly for the above.
22974 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22975 whether we are emitting for a ref or out parameter.
22977 * expression.cs (Argument::Emit): Use the above field to set the state.
22979 (LocalVariableReference::Emit): Update to honour the flag and emit the
22982 * parameter.cs (Attributes): Set the correct flags for ref parameters.
22984 * expression.cs (Argument::FullDesc): New function to provide a full desc.
22986 * support.cs (ParameterData): Add method ParameterDesc to the interface.
22988 (ReflectionParameters, InternalParameters): Implement the above method.
22990 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22993 (Invocation::FullMethodDesc): Ditto.
22995 2001-10-29 Miguel de Icaza <miguel@ximian.com>
22997 * cs-parser.jay: Add extra production for the second form of array
23000 * expression.cs (ArrayCreation): Update to reflect the above
23003 * Small changes to prepare for Array initialization.
23005 2001-10-28 Miguel de Icaza <miguel@ximian.com>
23007 * typemanager.cs (ImplementsInterface): interface might be null;
23008 Deal with this problem;
23010 Also, we do store negative hits on the cache (null values), so use
23011 this instead of calling t.GetInterfaces on the type everytime.
23013 2001-10-28 Ravi Pratap <ravi@ximian.com>
23015 * typemanager.cs (IsBuiltinType): New method to help determine the same.
23017 * expression.cs (New::DoResolve): Get rid of array creation code and instead
23018 split functionality out into different classes.
23020 (New::FormArrayType): Move into NewBuiltinArray.
23022 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
23025 (NewBuiltinArray): New class to handle creation of built-in arrays.
23027 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
23028 account creation of one-dimensional arrays.
23030 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
23032 (NewUserdefinedArray::DoResolve): Implement.
23034 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
23036 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
23037 we maintain inside the TypeManager. This is necessary to perform lookups on the
23040 (LookupType): Update to perform GetType on the module builders too.
23042 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
23044 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
23046 2001-10-23 Ravi Pratap <ravi@ximian.com>
23048 * expression.cs (New::DoResolve): Implement guts of array creation.
23050 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
23052 2001-10-27 Miguel de Icaza <miguel@ximian.com>
23054 * expression.cs: Fix bug I introduced lsat night that broke
23057 (Expression.Resolve): Report a 246 error (can not resolve name)
23058 if we find a SimpleName in the stream.
23060 (Expression.ResolveLValue): Ditto.
23062 (Expression.ResolveWithSimpleName): This function is a variant of
23063 ResolveName, this one allows SimpleNames to be returned without a
23064 warning. The only consumer of SimpleNames is MemberAccess
23066 2001-10-26 Miguel de Icaza <miguel@ximian.com>
23068 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
23069 might arrive here. I have my doubts that this is correct.
23071 * statement.cs (Lock): Implement lock statement.
23073 * cs-parser.jay: Small fixes to support `lock' and `using'
23075 * cs-tokenizer.cs: Remove extra space
23077 * driver.cs: New flag --checked, allows to turn on integer math
23080 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
23081 Threading.Monitor.Exit
23083 2001-10-23 Miguel de Icaza <miguel@ximian.com>
23085 * expression.cs (IndexerAccess::DoResolveLValue): Set the
23086 Expression Class to be IndexerAccess.
23088 Notice that Indexer::DoResolve sets the eclass to Value.
23090 2001-10-22 Miguel de Icaza <miguel@ximian.com>
23092 * class.cs (TypeContainer::Emit): Emit code for indexers.
23094 * assign.cs (IAssignMethod): New interface implemented by Indexers
23095 and Properties for handling assignment.
23097 (Assign::Emit): Simplify and reuse code.
23099 * expression.cs (IndexerAccess, PropertyExpr): Implement
23100 IAssignMethod, clean up old code.
23102 2001-10-22 Ravi Pratap <ravi@ximian.com>
23104 * typemanager.cs (ImplementsInterface): New method to determine if a type
23105 implements a given interface. Provides a nice cache too.
23107 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
23110 (ConvertReferenceExplicit): Ditto.
23112 * delegate.cs (Delegate::Populate): Update to define the parameters on the
23113 various methods, with correct names etc.
23115 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
23116 Operator.UnaryNegation.
23118 * cs-parser.jay (operator_declarator): Be a little clever in the case where
23119 we have a unary plus or minus operator.
23121 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
23124 * everywhere : update accordingly.
23126 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
23129 * class.cs (Method::Define): For the case where we are implementing a method
23130 inherited from an interface, we need to set the MethodAttributes.Final flag too.
23131 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
23133 2001-10-21 Ravi Pratap <ravi@ximian.com>
23135 * interface.cs (FindMembers): Implement to work around S.R.E
23138 * typemanager.cs (IsInterfaceType): Implement.
23140 (FindMembers): Update to handle interface types too.
23142 * expression.cs (ImplicitReferenceConversion): Re-write bits which
23143 use IsAssignableFrom as that is not correct - it doesn't work.
23145 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
23146 and accordingly override EmitStatement.
23148 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
23149 using the correct logic :-)
23151 2001-10-19 Ravi Pratap <ravi@ximian.com>
23153 * ../errors/cs-11.cs : Add to demonstrate error -11
23155 2001-10-17 Miguel de Icaza <miguel@ximian.com>
23157 * assign.cs (Assign::Resolve): Resolve right hand side first, and
23158 then pass this as a hint to ResolveLValue.
23160 * expression.cs (FieldExpr): Add Location information
23162 (FieldExpr::LValueResolve): Report assignment to readonly
23165 (Expression::ExprClassFromMemberInfo): Pass location information.
23167 (Expression::ResolveLValue): Add new method that resolves an
23170 (Expression::DoResolveLValue): Default invocation calls
23173 (Indexers): New class used to keep track of indexers in a given
23176 (IStackStore): Renamed from LValue, as it did not really describe
23177 what this did. Also ResolveLValue is gone from this interface and
23178 now is part of Expression.
23180 (ElementAccess): Depending on the element access type
23182 * typemanager.cs: Add `indexer_name_type' as a Core type
23183 (System.Runtime.CompilerServices.IndexerNameAttribute)
23185 * statement.cs (Goto): Take a location.
23187 2001-10-18 Ravi Pratap <ravi@ximian.com>
23189 * delegate.cs (Delegate::VerifyDelegate): New method to verify
23190 if two delegates are compatible.
23192 (NewDelegate::DoResolve): Update to take care of the case when
23193 we instantiate a delegate from another delegate.
23195 * typemanager.cs (FindMembers): Don't even try to look up members
23196 of Delegate types for now.
23198 2001-10-18 Ravi Pratap <ravi@ximian.com>
23200 * delegate.cs (NewDelegate): New class to take care of delegate
23203 * expression.cs (New): Split the delegate related code out into
23204 the NewDelegate class.
23206 * delegate.cs (DelegateInvocation): New class to handle delegate
23209 * expression.cs (Invocation): Split out delegate related code into
23210 the DelegateInvocation class.
23212 2001-10-17 Ravi Pratap <ravi@ximian.com>
23214 * expression.cs (New::DoResolve): Implement delegate creation fully
23215 and according to the spec.
23217 (New::DoEmit): Update to handle delegates differently.
23219 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
23220 because of which we were printing out arguments in reverse order !
23222 * delegate.cs (VerifyMethod): Implement to check if the given method
23223 matches the delegate.
23225 (FullDelegateDesc): Implement.
23227 (VerifyApplicability): Implement.
23229 * expression.cs (Invocation::DoResolve): Update to accordingly handle
23230 delegate invocations too.
23232 (Invocation::Emit): Ditto.
23234 * ../errors/cs1593.cs : Added.
23236 * ../errors/cs1594.cs : Added.
23238 * delegate.cs (InstanceExpression, TargetMethod): New properties.
23240 2001-10-16 Ravi Pratap <ravi@ximian.com>
23242 * typemanager.cs (intptr_type): Core type for System.IntPtr
23244 (InitCoreTypes): Update for the same.
23246 (iasyncresult_type, asynccallback_type): Ditto.
23248 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
23251 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
23254 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
23255 the builders for the 4 members of a delegate type :-)
23257 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
23260 * expression.cs (New::DoResolve): Implement guts for delegate creation.
23262 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
23264 2001-10-15 Miguel de Icaza <miguel@ximian.com>
23266 * statement.cs (Break::Emit): Implement.
23267 (Continue::Emit): Implement.
23269 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
23270 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
23271 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
23272 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
23275 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
23276 properties that track the label for the current loop (begin of the
23277 loop and end of the loop).
23279 2001-10-15 Ravi Pratap <ravi@ximian.com>
23281 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
23282 use of emitting anything at all.
23284 * class.cs, rootcontext.cs : Get rid of calls to the same.
23286 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
23288 (Populate): Define the constructor correctly and set the implementation
23291 * typemanager.cs (delegate_types): New hashtable to hold delegates that
23294 (AddDelegateType): Implement.
23296 (IsDelegateType): Implement helper method.
23298 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
23300 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
23301 and accordingly handle it.
23303 * delegate.cs (Populate): Take TypeContainer argument.
23304 Implement bits to define the Invoke method. However, I still haven't figured out
23305 how to take care of the native int bit :-(
23307 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
23308 Qualify the name of the delegate, not its return type !
23310 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
23313 (StandardConversionExists): Checking for array types turns out to be recursive.
23315 (ConvertReferenceExplicit): Implement array conversion.
23317 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
23319 2001-10-12 Ravi Pratap <ravi@ximian.com>
23321 * cs-parser.jay (delegate_declaration): Store the fully qualified
23322 name as it is a type declaration.
23324 * delegate.cs (ReturnType, Name): Rename members to these. Make them
23327 (DefineDelegate): Renamed from Define. Does the same thing essentially,
23328 as TypeContainer::DefineType.
23330 (Populate): Method in which all the definition of the various methods (Invoke)
23333 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
23336 (CloseDelegate): Finally creates the delegate.
23338 * class.cs (TypeContainer::DefineType): Update to define delegates.
23339 (Populate, Emit and CloseType): Do the same thing here too.
23341 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
23342 delegates in all these operations.
23344 2001-10-14 Miguel de Icaza <miguel@ximian.com>
23346 * expression.cs: LocalTemporary: a new expression used to
23347 reference a temporary that has been created.
23349 * assign.cs: Handle PropertyAccess back here, so that we can
23350 provide the proper semantic access to properties.
23352 * expression.cs (Expression::ConvertReferenceExplicit): Implement
23353 a few more explicit conversions.
23355 * modifiers.cs: `NEW' modifier maps to HideBySig.
23357 * expression.cs (PropertyExpr): Make this into an
23358 ExpressionStatement, and support the EmitStatement code path.
23360 Perform get/set error checking, clean up the interface.
23362 * assign.cs: recognize PropertyExprs as targets, and if so, turn
23363 them into toplevel access objects.
23365 2001-10-12 Miguel de Icaza <miguel@ximian.com>
23367 * expression.cs: PropertyExpr::PropertyExpr: use work around the
23370 * typemanager.cs: Keep track here of our PropertyBuilders again to
23371 work around lameness in SRE.
23373 2001-10-11 Miguel de Icaza <miguel@ximian.com>
23375 * expression.cs (LValue::LValueResolve): New method in the
23376 interface, used to perform a second resolution pass for LValues.
23378 (This::DoResolve): Catch the use of this in static methods.
23380 (This::LValueResolve): Implement.
23382 (This::Store): Remove warning, assigning to `this' in structures
23385 (Invocation::Emit): Deal with invocation of
23386 methods on value types. We need to pass the address to structure
23387 methods rather than the object itself. (The equivalent code to
23388 emit "this" for structures leaves the entire structure on the
23389 stack instead of a pointer to it).
23391 (ParameterReference::DoResolve): Compute the real index for the
23392 argument based on whether the method takes or not a `this' pointer
23393 (ie, the method is static).
23395 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
23396 value types returned from functions when we need to invoke a
23397 method on the sturcture.
23400 2001-10-11 Ravi Pratap <ravi@ximian.com>
23402 * class.cs (TypeContainer::DefineType): Method to actually do the business of
23403 defining the type in the Modulebuilder or Typebuilder. This is to take
23404 care of nested types which need to be defined on the TypeBuilder using
23405 DefineNestedMethod.
23407 (TypeContainer::GetClassBases): Implement. Essentially the code from the
23408 methods in RootContext, only ported to be part of TypeContainer.
23410 (TypeContainer::GetInterfaceOrClass): Ditto.
23412 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
23414 * interface.cs (Interface::DefineInterface): New method. Does exactly
23415 what RootContext.CreateInterface did earlier, only it takes care of nested types
23418 (Interface::GetInterfaces): Move from RootContext here and port.
23420 (Interface::GetInterfaceByName): Same here.
23422 * rootcontext.cs (ResolveTree): Re-write.
23424 (PopulateTypes): Re-write.
23426 * class.cs (TypeContainer::Populate): Populate nested types too.
23427 (TypeContainer::Emit): Emit nested members too.
23429 * typemanager.cs (AddUserType): Do not make use of the FullName property,
23430 instead just use the name argument passed in as it is already fully
23433 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
23434 to TypeContainer mapping to see if a type is user-defined.
23436 * class.cs (TypeContainer::CloseType): Implement.
23438 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
23439 the default constructor.
23441 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
23444 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
23446 * interface.cs (CloseType): Create the type here.
23448 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
23451 Remove all the methods which are now in TypeContainer.
23453 2001-10-10 Ravi Pratap <ravi@ximian.com>
23455 * delegate.cs (Define): Re-write bits to define the delegate
23458 2001-10-10 Miguel de Icaza <miguel@ximian.com>
23460 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23462 * expression.cs (ImplicitReferenceConversion): handle null as well
23463 as a source to convert to any reference type.
23465 * statement.cs (Return): Perform any implicit conversions to
23466 expected return type.
23468 Validate use of return statement.
23470 * codegen.cs (EmitContext): Pass the expected return type here.
23472 * class.cs (Method, Constructor, Property): Pass expected return
23473 type to EmitContext.
23475 2001-10-09 Miguel de Icaza <miguel@ximian.com>
23477 * expression.cs: Make DoResolve take an EmitContext instead of a
23480 Replaced `l' and `location' for `loc', for consistency.
23482 (Error, Warning): Remove unneeded Tc argument.
23484 * assign.cs, literal.cs, constant.cs: Update to new calling
23487 * codegen.cs: EmitContext now contains a flag indicating whether
23488 code is being generated in a static method or not.
23490 * cs-parser.jay: DecomposeQI, new function that replaces the old
23491 QualifiedIdentifier. Now we always decompose the assembled
23492 strings from qualified_identifier productions into a group of
23495 2001-10-08 Miguel de Icaza <miguel@ximian.com>
23497 * rootcontext.cs: Deal with field-less struct types correctly now
23498 by passing the size option to Define Type.
23500 * class.cs: Removed hack that created one static field.
23502 2001-10-07 Miguel de Icaza <miguel@ximian.com>
23504 * statement.cs: Moved most of the code generation here.
23506 2001-10-09 Ravi Pratap <ravi@ximian.com>
23508 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23511 (ElementAccess): Remove useless bits for now - keep checks as the spec
23514 2001-10-08 Ravi Pratap <ravi@ximian.com>
23516 * expression.cs (ElementAccess::DoResolve): Remove my crap code
23517 and start performing checks according to the spec.
23519 2001-10-07 Ravi Pratap <ravi@ximian.com>
23521 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23522 rank_specifiers instead.
23524 (rank_specifiers): Change the order in which the rank specifiers are stored
23526 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23528 * expression.cs (ElementAccess): Implement the LValue interface too.
23530 2001-10-06 Ravi Pratap <ravi@ximian.com>
23532 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23533 except that user defined conversions are not included.
23535 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
23536 perform the conversion of the return type, if necessary.
23538 (New::DoResolve): Check whether we are creating an array or an object
23539 and accordingly do the needful.
23541 (New::Emit): Same here.
23543 (New::DoResolve): Implement guts of array creation.
23545 (New::FormLookupType): Helper function.
23547 2001-10-07 Miguel de Icaza <miguel@ximian.com>
23549 * codegen.cs: Removed most of the code generation here, and move the
23550 corresponding code generation bits to the statement classes.
23552 Added support for try/catch/finalize and throw.
23554 * cs-parser.jay: Added support for try/catch/finalize.
23556 * class.cs: Catch static methods having the flags override,
23557 virtual or abstract.
23559 * expression.cs (UserCast): This user cast was not really doing
23560 what it was supposed to do. Which is to be born in fully resolved
23561 state. Parts of the resolution were being performed at Emit time!
23565 2001-10-05 Miguel de Icaza <miguel@ximian.com>
23567 * expression.cs: Implicity convert the result from UserCast.
23569 2001-10-05 Ravi Pratap <ravi@ximian.com>
23571 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23572 prevented it from working correctly.
23574 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23575 merely ConvertImplicit.
23577 2001-10-05 Miguel de Icaza <miguel@ximian.com>
23579 * typemanager.cs: Make the LookupTypeContainer function static,
23580 and not per-instance.
23582 * class.cs: Make static FindMembers (the one that takes a Type
23585 * codegen.cs: Add EmitForeach here.
23587 * cs-parser.jay: Make foreach a toplevel object instead of the
23588 inline expansion, as we need to perform semantic analysis on it.
23590 2001-10-05 Ravi Pratap <ravi@ximian.com>
23592 * expression.cs (Expression::ImplicitUserConversion): Rename to
23593 UserDefinedConversion.
23595 (Expression::UserDefinedConversion): Take an extra argument specifying
23596 whether we look for explicit user conversions too.
23598 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23600 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23602 (ExplicitUserConversion): Make it a call to UserDefinedConversion
23603 with the appropriate arguments.
23605 * cs-parser.jay (cast_expression): Record location too.
23607 * expression.cs (Cast): Record location info.
23609 (Expression::ConvertExplicit): Take location argument.
23611 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23612 to determine if we are doing explicit conversions.
23614 (UserCast::Emit): Update accordingly.
23616 (Expression::ConvertExplicit): Report an error if everything fails.
23618 * ../errors/cs0030.cs : Add.
23620 2001-10-04 Miguel de Icaza <miguel@ximian.com>
23622 * modifiers.cs: If the ABSTRACT keyword is present, also set the
23623 virtual and newslot bits.
23625 * class.cs (TypeContainer::RegisterRequiredImplementations):
23626 Record methods we need.
23628 (TypeContainer::MakeKey): Helper function to make keys for
23629 MethodBases, since the Methodbase key is useless.
23631 (TypeContainer::Populate): Call RegisterRequiredImplementations
23632 before defining the methods.
23634 Create a mapping for method_builders_to_methods ahead of time
23635 instead of inside a tight loop.
23637 (::RequireMethods): Accept an object as the data to set into the
23638 hashtable so we can report interface vs abstract method mismatch.
23640 2001-10-03 Miguel de Icaza <miguel@ximian.com>
23642 * report.cs: Make all of it static.
23644 * rootcontext.cs: Drop object_type and value_type computations, as
23645 we have those in the TypeManager anyways.
23647 Drop report instance variable too, now it is a global.
23649 * driver.cs: Use try/catch on command line handling.
23651 Add --probe option to debug the error reporting system with a test
23654 * report.cs: Add support for exiting program when a probe
23655 condition is reached.
23657 2001-10-03 Ravi Pratap <ravi@ximian.com>
23659 * expression.cs (Binary::DoNumericPromotions): Fix the case when
23660 we do a forcible conversion regardless of type, to check if
23661 ForceConversion returns a null.
23663 (Binary::error19): Use location to report error.
23665 (Unary::error23): Use location here too.
23667 * ../errors/cs0019.cs : Check in.
23669 * ../errors/cs0023.cs : Check in.
23671 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23672 case of a non-null MethodInfo object with a length of 0 !
23674 (Binary::ResolveOperator): Flag error if overload resolution fails to find
23675 an applicable member - according to the spec :-)
23676 Also fix logic to find members in base types.
23678 (Unary::ResolveOperator): Same here.
23680 (Unary::report23): Change name to error23 and make first argument a TypeContainer
23681 as I was getting thoroughly confused between this and error19 :-)
23683 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23684 (::FindMostEncompassedType): Implement.
23685 (::FindMostEncompassingType): Implement.
23686 (::StandardConversionExists): Implement.
23688 (UserImplicitCast): Re-vamp. We now need info about most specific
23689 source and target types so that we can do the necessary conversions.
23691 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23692 mathematical union with no duplicates.
23694 2001-10-03 Miguel de Icaza <miguel@ximian.com>
23696 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23697 in order from base classes to child classes, so that we can in
23698 child classes look up in our parent for method names and
23699 attributes (required for handling abstract, virtual, new, override
23700 constructs: we need to instrospect our base class, and if we dont
23701 populate the classes in order, the introspection might be
23702 incorrect. For example, a method could query its parent before
23703 the parent has any methods and would determine that the parent has
23704 no abstract methods (while it could have had them)).
23706 (RootContext::CreateType): Record the order in which we define the
23709 2001-10-02 Miguel de Icaza <miguel@ximian.com>
23711 * class.cs (TypeContainer::Populate): Also method definitions can
23712 fail now, keep track of this.
23714 (TypeContainer::FindMembers): Implement support for
23715 DeclaredOnly/noDeclaredOnly flag.
23717 (Constructor::Emit) Return the ConstructorBuilder.
23719 (Method::Emit) Return the MethodBuilder.
23720 Check for abstract or virtual methods to be public.
23722 * rootcontext.cs (RootContext::CreateType): Register all the
23723 abstract methods required for the class to be complete and the
23724 interface methods that must be implemented.
23726 * cs-parser.jay: Report error 501 (method requires body if it is
23727 not marked abstract or extern).
23729 * expression.cs (TypeOf::Emit): Implement.
23731 * typemanager.cs: runtime_handle_type, new global type.
23733 * class.cs (Property::Emit): Generate code for properties.
23735 2001-10-02 Ravi Pratap <ravi@ximian.com>
23737 * expression.cs (Unary::ResolveOperator): Find operators on base type
23738 too - we now conform exactly to the spec.
23740 (Binary::ResolveOperator): Same here.
23742 * class.cs (Operator::Define): Fix minor quirk in the tests.
23744 * ../errors/cs0215.cs : Added.
23746 * ../errors/cs0556.cs : Added.
23748 * ../errors/cs0555.cs : Added.
23750 2001-10-01 Miguel de Icaza <miguel@ximian.com>
23752 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
23753 single integer which is really efficient
23755 2001-10-01 Ravi Pratap <ravi@ximian.com>
23757 * expression.cs (Expression::ImplicitUserConversion): Use location
23758 even in the case when we are examining True operators.
23760 * class.cs (Operator::Define): Perform extensive checks to conform
23761 with the rules for operator overloading in the spec.
23763 * expression.cs (Expression::ImplicitReferenceConversion): Implement
23764 some of the other conversions mentioned in the spec.
23766 * typemanager.cs (array_type): New static member for the System.Array built-in
23769 (cloneable_interface): For System.ICloneable interface.
23771 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23772 we start resolving the tree and populating types.
23774 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23776 2001-10-01 Miguel de Icaza <miguel@ximian.com>
23778 * expression.cs (Expression::ExprClassFromMemberInfo,
23779 Expression::Literalize): Create literal expressions from
23780 FieldInfos which are literals.
23782 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23783 type casts, because they were wrong. The test suite in tests
23786 (ImplicitNumericConversion): ushort to ulong requires a widening
23789 Int32 constant to long requires widening cast as well.
23791 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23792 for integers because the type on the stack is not i4.
23794 2001-09-30 Miguel de Icaza <miguel@ximian.com>
23796 * expression.cs (report118): require location argument.
23798 * parameter.cs: Do not dereference potential null value.
23800 * class.cs: Catch methods that lack the `new' keyword when
23801 overriding a name. Report warnings when `new' is used without
23802 anything being there to override.
23804 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23806 * class.cs: Only add constructor to hashtable if it is non-null
23807 (as now constructors can fail on define).
23809 (TypeManager, Class, Struct): Take location arguments.
23811 Catch field instance initialization in structs as errors.
23813 accepting_filter: a new filter for FindMembers that is static so
23814 that we dont create an instance per invocation.
23816 (Constructor::Define): Catch errors where a struct constructor is
23819 * cs-parser.jay: Pass location information for various new
23822 * delegate.cs (Delegate): take a location argument.
23824 * driver.cs: Do not call EmitCode if there were problesm in the
23825 Definition of the types, as many Builders wont be there.
23827 * decl.cs (Decl::Decl): Require a location argument.
23829 * cs-tokenizer.cs: Handle properly hex constants that can not fit
23830 into integers, and find the most appropiate integer for it.
23832 * literal.cs: Implement ULongLiteral.
23834 * rootcontext.cs: Provide better information about the location of
23835 failure when CreateType fails.
23837 2001-09-29 Miguel de Icaza <miguel@ximian.com>
23839 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23842 * expression.cs (Binary::CheckShiftArguments): Add missing type
23844 (Binary::ResolveOperator): Add type to the logical and and logical
23845 or, Bitwise And/Or and Exclusive Or code paths, it was missing
23848 (Binary::DoNumericPromotions): In the case where either argument
23849 is ulong (and most signed types combined with ulong cause an
23850 error) perform implicit integer constant conversions as well.
23852 2001-09-28 Miguel de Icaza <miguel@ximian.com>
23854 * expression.cs (UserImplicitCast): Method should always be
23856 (Invocation::BetterConversion): Simplified test for IntLiteral.
23858 (Expression::ImplicitNumericConversion): Split this routine out.
23859 Put the code that performs implicit constant integer conversions
23862 (Expression::Resolve): Become a wrapper around DoResolve so we can
23863 check eclass and type being set after resolve.
23865 (Invocation::Badness): Remove this dead function
23867 (Binary::ResolveOperator): Do not compute the expensive argumnets
23868 unless we have a union for it.
23870 (Probe::Emit): Is needs to do an isinst and then
23871 compare against null.
23873 (::CanConvert): Added Location argument. If the Location argument
23874 is null (Location.Null), then we do not report errors. This is
23875 used by the `probe' mechanism of the Explicit conversion. We do
23876 not want to generate an error for something that the user
23877 explicitly requested to be casted. But the pipeline for an
23878 explicit cast first tests for potential implicit casts.
23880 So for now, if the Location is null, it means `Probe only' to
23881 avoid adding another argument. Might have to revise this
23884 (ClassCast): New class used to type cast objects into arbitrary
23885 classes (used in Explicit Reference Conversions).
23887 Implement `as' as well.
23889 Reverted all the patches from Ravi below: they were broken:
23891 * The use of `level' as a mechanism to stop recursive
23892 invocations is wrong. That was there just to catch the
23893 bug with a strack trace but not as a way of addressing
23896 To fix the problem we have to *understand* what is going
23897 on and the interactions and come up with a plan, not
23898 just get things going.
23900 * The use of the type conversion cache that I proposed
23901 last night had an open topic: How does this work across
23902 protection domains. A user defined conversion might not
23903 be public in the location where we are applying the
23904 conversion, a different conversion might be selected
23905 (ie, private A->B (better) but public B->A (worse),
23906 inside A, A->B applies, but outside it, B->A will
23909 * On top of that (ie, even if the above is solved),
23910 conversions in a cache need to be abstract. Ie, `To
23911 convert from an Int to a Short use an OpcodeCast', not
23912 `To convert from an Int to a Short use the OpcodeCast on
23913 the variable 5' (which is what this patch was doing).
23915 2001-09-28 Ravi Pratap <ravi@ximian.com>
23917 * expression.cs (Invocation::ConversionExists): Re-write to use
23918 the conversion cache
23920 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23921 cache all conversions done, not just user-defined ones.
23923 (Invocation::BetterConversion): The real culprit. Use ConversionExists
23924 to determine if a conversion exists instead of acutually trying to
23925 perform the conversion. It's faster too.
23927 (Expression::ConvertExplicit): Modify to use ConversionExists to check
23928 and only then attempt the implicit conversion.
23930 2001-09-28 Ravi Pratap <ravi@ximian.com>
23932 * expression.cs (ConvertImplicit): Use a cache for conversions
23933 already found. Check level of recursion and bail out if necessary.
23935 2001-09-28 Miguel de Icaza <miguel@ximian.com>
23937 * typemanager.cs (string_concat_string_string, string_concat_object_object):
23938 Export standard methods that we expect for string operations.
23940 * statement.cs (Block::UsageWarning): Track usage of variables and
23941 report the errors for not used variables.
23943 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23946 2001-09-27 Miguel de Icaza <miguel@ximian.com>
23948 * codegen.cs: remove unnneded code
23950 * expression.cs: Removed BuiltinTypeAccess class
23952 Fix the order in which implicit conversions are
23955 The previous fixed dropped support for boxed conversions (adding a
23956 test to the test suite now)
23958 (UserImplicitCast::CanConvert): Remove test for source being null,
23959 that code is broken. We should not feed a null to begin with, if
23960 we do, then we should track the bug where the problem originates
23961 and not try to cover it up here.
23963 Return a resolved expression of type UserImplicitCast on success
23964 rather than true/false. Ravi: this is what I was talking about,
23965 the pattern is to use a static method as a "constructor" for
23968 Also, do not create arguments until the very last minute,
23969 otherwise we always create the arguments even for lookups that
23970 will never be performed.
23972 (UserImplicitCast::Resolve): Eliminate, objects of type
23973 UserImplicitCast are born in a fully resolved state.
23975 * typemanager.cs (InitCoreTypes): Init also value_type
23976 (System.ValueType).
23978 * expression.cs (Cast::Resolve): First resolve the child expression.
23980 (LValue): Add new method AddressOf to be used by
23983 Change the argument of Store to take an EmitContext instead of an
23984 ILGenerator, because things like FieldExpr need to be able to call
23985 their children expression to generate the instance code.
23987 (Expression::Error, Expression::Warning): Sugar functions for
23990 (Expression::MemberLookup): Accept a TypeContainer instead of a
23991 Report as the first argument.
23993 (Expression::ResolvePrimary): Killed. I still want to improve
23994 this as currently the code is just not right.
23996 (Expression::ResolveMemberAccess): Simplify, but it is still
23999 (Unary::Resolve): Catch errors in AddressOf operators.
24001 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
24002 index to a byte for the short-version, or the compiler will choose
24003 the wrong Emit call, which generates the wrong data.
24005 (ParameterReference::Emit, ::Store): same.
24007 (FieldExpr::AddressOf): Implement.
24009 * typemanager.cs: TypeManager: made public variable instead of
24012 * driver.cs: document --fatal.
24014 * report.cs (ErrorMessage, WarningMessage): new names for the old
24015 Error and Warning classes.
24017 * cs-parser.jay (member_access): Turn built-in access to types
24018 into a normal simplename
24020 2001-09-27 Ravi Pratap <ravi@ximian.com>
24022 * expression.cs (Invocation::BetterConversion): Fix to cope
24023 with q being null, since this was introducing a bug.
24025 * expression.cs (ConvertImplicit): Do built-in conversions first.
24027 2001-09-27 Ravi Pratap <ravi@ximian.com>
24029 * expression.cs (UserImplicitCast::Resolve): Fix bug.
24031 2001-09-27 Ravi Pratap <ravi@ximian.com>
24033 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
24034 I had introduced long ago (what's new ?).
24036 * expression.cs (UserImplicitCast::CanConvert): Static method to do
24037 the work of all the checking.
24038 (ConvertImplicit): Call CanConvert and only then create object if necessary.
24039 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
24041 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
24042 that is the right way.
24044 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
24045 overloading resolution. Use everywhere instead of cutting and pasting code.
24047 (Binary::ResolveOperator): Use MakeUnionSet.
24049 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
24050 we have to convert to bool types. Not complete yet.
24052 2001-09-27 Miguel de Icaza <miguel@ximian.com>
24054 * typemanager.cs (TypeManager::CSharpName): support ushort.
24056 * expression.cs (Expression::TryImplicitIntConversion): Attempts
24057 to provide an expression that performsn an implicit constant int
24058 conversion (section 6.1.6).
24059 (Expression::ConvertImplicitRequired): Reworked to include
24060 implicit constant expression conversions.
24062 (Expression::ConvertNumericExplicit): Finished.
24064 (Invocation::Emit): If InstanceExpression is null, then it means
24065 that we perform a call on this.
24067 2001-09-26 Miguel de Icaza <miguel@ximian.com>
24069 * expression.cs (Unary::Emit): Remove some dead code.
24070 (Probe): Implement Resolve and Emit for `is'.
24071 (Expression::ConvertImplicitRequired): Attempt to do constant
24072 expression conversions here. Maybe should be moved to
24073 ConvertImplicit, but I am not sure.
24074 (Expression::ImplicitLongConstantConversionPossible,
24075 Expression::ImplicitIntConstantConversionPossible): New functions
24076 that tell whether is it possible to apply an implicit constant
24077 expression conversion.
24079 (ConvertNumericExplicit): Started work on explicit numeric
24082 * cs-parser.jay: Update operator constants.
24084 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
24085 (Parameters::GetSignature): Hook up VerifyArgs here.
24086 (Parameters::VerifyArgs): Verifies that no two arguments have the
24089 * class.cs (Operator): Update the operator names to reflect the
24090 ones that the spec expects (as we are just stringizing the
24093 * expression.cs (Unary::ResolveOperator): Fix bug: Use
24094 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
24095 previous usage did only work for our methods.
24096 (Expression::ConvertImplicit): Handle decimal implicit numeric
24097 conversions as well.
24098 (Expression::InternalTypeConstructor): Used to invoke constructors
24099 on internal types for default promotions.
24101 (Unary::Emit): Implement special handling for the pre/post
24102 increment/decrement for overloaded operators, as they need to have
24103 the same semantics as the other operators.
24105 (Binary::ResolveOperator): ditto.
24106 (Invocation::ConversionExists): ditto.
24107 (UserImplicitCast::Resolve): ditto.
24109 2001-09-26 Ravi Pratap <ravi@ximian.com>
24111 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
24112 operator, return after emitting body. Regression tests pass again !
24114 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
24115 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
24116 (Invocation::OverloadResolve): Ditto.
24117 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
24119 * everywhere : update calls to the above methods accordingly.
24121 2001-09-26 Miguel de Icaza <miguel@ximian.com>
24123 * assign.cs (Assign): Make it inherit from ExpressionStatement.
24125 * expression.cs (ExpressionStatement): New base class used for
24126 expressions that can appear in statements, so that we can provide
24127 an alternate path to generate expression that do not leave a value
24130 (Expression::Emit, and all the derivatives): We no longer return
24131 whether a value is left on the stack or not. Every expression
24132 after being emitted leaves a single value on the stack.
24134 * codegen.cs (EmitContext::EmitStatementExpression): Use the
24135 facilties of ExpressionStatement if possible.
24137 * cs-parser.jay: Update statement_expression.
24139 2001-09-25 Miguel de Icaza <miguel@ximian.com>
24141 * driver.cs: Change the wording of message
24143 2001-09-25 Ravi Pratap <ravi@ximian.com>
24145 * expression.cs (Binary::ResolveOperator): Had forgottten to set
24146 the type of the expression to the return type of the method if
24147 we have an overloaded operator match ! The regression tests pass again !
24148 (Unary::ResolveOperator): Ditto.
24150 * expression.cs (Invocation::ConversionExists): Correct the member lookup
24151 to find "op_Implicit", not "implicit" ;-)
24152 (UserImplicitCast): New class to take care of user-defined implicit conversions.
24153 (ConvertImplicit, ForceConversion): Take TypeContainer argument
24155 * everywhere : Correct calls to the above accordingly.
24157 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
24158 (ConvertImplicit): Do user-defined conversion if it exists.
24160 2001-09-24 Miguel de Icaza <miguel@ximian.com>
24162 * assign.cs: track location.
24163 (Resolve): Use implicit conversions on assignment.
24165 * literal.cs: Oops. Not good, Emit of short access values should
24166 pass (Bytes) or the wrong argument will be selected.
24168 * expression.cs (Unary::Emit): Emit code for -expr.
24170 (Unary::ResolveOperator): Handle `Substract' for non-constants
24171 (substract from zero from the non-constants).
24172 Deal with Doubles as well.
24174 (Expression::ConvertImplicitRequired): New routine that reports an
24175 error if no implicit conversion exists.
24177 (Invocation::OverloadResolve): Store the converted implicit
24178 expressions if we make them
24180 2001-09-24 Ravi Pratap <ravi@ximian.com>
24182 * class.cs (ConstructorInitializer): Take a Location argument.
24183 (ConstructorBaseInitializer): Same here.
24184 (ConstructorThisInitializer): Same here.
24186 * cs-parser.jay : Update all calls accordingly.
24188 * expression.cs (Unary, Binary, New): Take location argument.
24189 Update accordingly everywhere.
24191 * cs-parser.jay : Update all calls to the above to take a location
24194 * class.cs : Ditto.
24196 2001-09-24 Ravi Pratap <ravi@ximian.com>
24198 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
24199 (Invocation::BetterConversion): Same here
24200 (Invocation::ConversionExists): Ditto.
24202 (Invocation::ConversionExists): Implement.
24204 2001-09-22 Ravi Pratap <ravi@ximian.com>
24206 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
24207 Also take an additional TypeContainer argument.
24209 * All over : Pass in TypeContainer as argument to OverloadResolve.
24211 * typemanager.cs (CSharpName): Update to check for the string type and return
24214 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
24217 2001-09-21 Ravi Pratap <ravi@ximian.com>
24219 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
24220 (Invocation::BetterFunction): Implement.
24221 (Invocation::BetterConversion): Implement.
24222 (Invocation::ConversionExists): Skeleton, no implementation yet.
24224 Okay, things work fine !
24226 2001-09-21 Miguel de Icaza <miguel@ximian.com>
24228 * typemanager.cs: declare and load enum_type, delegate_type and
24231 * expression.cs (Expression::Emit): Now emit returns a value that
24232 tells whether a value is left on the stack or not. This strategy
24233 might be reveted tomorrow with a mechanism that would address
24234 multiple assignments.
24235 (Expression::report118): Utility routine to report mismatches on
24238 (Unary::Report23): Report impossible type/operator combination
24241 (Unary::IsIncrementableNumber): Whether the type can be
24242 incremented or decremented with add.
24243 (Unary::ResolveOperator): Also allow enumerations to be bitwise
24245 (Unary::ResolveOperator): Implement ++, !, ~,
24247 (Invocation::Emit): Deal with new Emit convetion.
24249 * All Expression derivatives: Updated their Emit method to return
24250 whether they leave values on the stack or not.
24252 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
24253 stack for expressions that are statements.
24255 2001-09-20 Miguel de Icaza <miguel@ximian.com>
24257 * expression.cs (LValue): New interface. Must be implemented by
24259 (LocalVariableReference, ParameterReference, FieldExpr): Implement
24262 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
24263 interface for generating code, simplifies the code.
24265 2001-09-20 Ravi Pratap <ravi@ximian.com>
24267 * expression.cs (everywhere): Comment out return statements in ::Resolve
24268 methods to avoid the warnings.
24270 2001-09-20 Miguel de Icaza <miguel@ximian.com>
24272 * driver.cs (parse): Report error 2001 if we can not open the
24275 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
24278 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
24281 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
24282 otherwise nested blocks end up with the same index.
24284 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
24286 * expression.cs: Instead of having FIXMEs in the Resolve
24287 functions, throw exceptions so it is obvious that we are facing a
24290 * cs-parser.jay (invocation_expression): Pass Location information.
24292 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
24293 Use a basename for those routines because .NET does not like paths
24296 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
24299 2001-09-19 Miguel de Icaza <miguel@ximian.com>
24301 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
24302 are loading the correct data types (throws an exception if not).
24303 (TypeManager::InitCoreTypes): Use CoreLookupType
24305 * expression.cs (Unary::ResolveOperator): return the child
24306 expression for expressions which are just +expr.
24307 (Unary::ResolveOperator): Return negative literals for -LITERAL
24308 expressions (otherwise they are Unary {Literal}).
24309 (Invocation::Badness): Take into account `Implicit constant
24310 expression conversions'.
24312 * literal.cs (LongLiteral): Implement long literal class.
24313 (IntLiteral): export the `Value' of the intliteral.
24315 2001-09-19 Ravi Pratap <ravi@ximian.com>
24317 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
24319 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
24320 instead of 'Operator'
24322 * expression.cs (Binary::ResolveOperator): Update accordingly.
24323 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
24326 * cs-parser.jay (unary_expression): Update to use the new names.
24328 * gen-treedump.cs (GetUnary): Same here.
24330 * expression.cs (Unary::Resolve): Implement.
24331 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
24332 operators are found instead of making noise ;-)
24333 (Unary::ResolveOperator): New method to do precisely the same thing which
24334 Binary::ResolveOperator does for Binary expressions.
24335 (Unary.method, .Arguments): Add.
24336 (Unary::OperName): Implement.
24337 (Unary::ForceConversion): Copy and Paste !
24339 * class.cs (Operator::Define): Fix a small bug for the case when we have
24342 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
24343 for the inbuilt operators. Only overloading works for now ;-)
24345 2001-09-18 Miguel de Icaza <miguel@ximian.com>
24347 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
24348 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
24350 * expression.cs (This::Emit): Implement.
24351 (This::Resolve): Implement.
24352 (TypeOf:Resolve): Implement.
24353 (Expression::ResolveSimpleName): Add an implicit this to instance
24355 (MemberAccess::Resolve): Deal with Parameters and Fields.
24356 Bind instance variable to Field expressions.
24357 (FieldExpr::Instance): New field used to track the expression that
24358 represents the object instance.
24359 (FieldExpr::Resolve): Track potential errors from MemberLookup not
24361 (FieldExpr::Emit): Implement.
24363 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
24364 the last instruction contains a return opcode to avoid generating
24365 the last `ret' instruction (this generates correct code, and it is
24366 nice to pass the peverify output).
24368 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
24369 initializer for static and instance variables.
24370 (Constructor::Emit): Allow initializer to be null in the case of
24371 static constructors. Only emit initializer for instance
24374 (TypeContainer::FindMembers): Return a null array if there are no
24377 Also fix the code for the MemberTypes.Method branch, as it was not
24378 scanning that for operators (or tried to access null variables before).
24380 * assign.cs (Assign::Emit): Handle instance and static fields.
24384 * driver.cs: Stop compilation if there are parse errors.
24386 * cs-parser.jay (constructor_declaration): Provide default base
24387 initializer for non-static constructors.
24388 (constructor_declarator): Do not provide a default base
24389 initializers if none was specified.
24390 Catch the fact that constructors should not have parameters.
24392 * class.cs: Do not emit parent class initializers for static
24393 constructors, that should be flagged as an error.
24395 2001-09-18 Ravi Pratap <ravi@ximian.com>
24397 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
24398 Move back code into TypeContainer::Populate.
24400 2001-09-18 Ravi Pratap <ravi@ximian.com>
24402 * class.cs (TypeContainer::AddConstructor): Fix the check to
24403 compare against Name, not Basename.
24404 (Operator::OpType): Change Plus and Minus to Add and Subtract.
24406 * cs-parser.jay : Update accordingly.
24408 * class.cs (TypeContainer::FindMembers): For the case where we are searching
24409 for methods, don't forget to look into the operators too.
24410 (RegisterMethodBuilder): Helper method to take care of this for
24411 methods, constructors and operators.
24412 (Operator::Define): Completely revamp.
24413 (Operator.OperatorMethod, MethodName): New fields.
24414 (TypeContainer::Populate): Move the registering of builders into
24415 RegisterMethodBuilder.
24416 (Operator::Emit): Re-write.
24418 * expression.cs (Binary::Emit): Comment out code path to emit method
24419 invocation stuff for the case when we have a user defined operator. I am
24420 just not able to get it right !
24422 2001-09-17 Miguel de Icaza <miguel@ximian.com>
24424 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
24427 (Expression::MemberLookup): Provide a version that allows to
24428 specify the MemberTypes and BindingFlags.
24430 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
24431 so it was not fetching variable information from outer blocks.
24433 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
24434 Beforefieldinit as it was buggy.
24436 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
24437 that Ravi put here.
24439 * class.cs (Constructor::Emit): Only emit if block is not null.
24440 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
24441 deal with this by semantically definining it as if the user had
24444 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
24445 constructors as we now "emit" them at a higher level.
24447 (TypeContainer::DefineDefaultConstructor): Used to define the
24448 default constructors if none was provided.
24450 (ConstructorInitializer): Add methods Resolve and Emit.
24452 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
24454 2001-09-17 Ravi Pratap <ravi@ximian.com>
24456 * class.cs (TypeContainer::EmitDefaultConstructor): Register
24457 the default constructor builder with our hashtable for methodbuilders
24460 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24461 and argument_count is 0 in which case we have a match.
24462 (Binary::ResolveOperator): More null checking and miscellaneous coding
24465 2001-09-17 Ravi Pratap <ravi@ximian.com>
24467 * rootcontext.cs (IsNameSpace): Compare against null.
24469 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24471 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24472 and Unary::Operator.
24474 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24477 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24478 we have overloaded operators.
24479 (Binary::ResolveOperator): Implement the part which does the operator overload
24482 * class.cs (Operator::Emit): Implement.
24483 (TypeContainer::Emit): Emit the operators we have too.
24485 * expression.cs (Binary::Emit): Update to emit the appropriate code for
24486 the case when we have a user-defined operator.
24488 2001-09-17 Miguel de Icaza <miguel@ximian.com>
24490 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24492 2001-09-16 Ravi Pratap <ravi@ximian.com>
24494 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24495 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24496 (Constructor::Emit): Implement.
24497 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24498 if we have no work to do.
24499 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
24502 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24503 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24505 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24508 2001-09-15 Ravi Pratap <ravi@ximian.com>
24510 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24512 (Tree::RecordNamespace): Method to do what the name says ;-)
24513 (Tree::Namespaces): Property to get at the namespaces hashtable.
24515 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
24518 * rootcontext.cs (IsNamespace): Fixed it :-)
24520 2001-09-14 Miguel de Icaza <miguel@ximian.com>
24522 * class.cs (TypeContainer::FindMembers): Add support for
24524 (MethodCore): New class that encapsulates both the shared aspects
24525 of a Constructor and a Method.
24526 (Method, Constructor): Factored pieces into MethodCore.
24528 * driver.cs: Added --fatal which makes errors throw exceptions.
24529 Load System assembly as well as part of the standard library.
24531 * report.cs: Allow throwing exceptions on errors for debugging.
24533 * modifiers.cs: Do not use `parent', instead use the real type
24534 container to evaluate permission settings.
24536 * class.cs: Put Ravi's patch back in. He is right, and we will
24537 have to cope with the
24539 2001-09-14 Ravi Pratap <ravi@ximian.com>
24541 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
24542 FamORAssem, not FamANDAssem.
24544 2001-09-14 Miguel de Icaza <miguel@ximian.com>
24546 * driver.cs: Added --parse option that only parses its input files
24549 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
24550 incorrect. IsTopLevel is not used to tell whether an object is
24551 root_types or not (that can be achieved by testing this ==
24552 root_types). But to see if this is a top-level *class* (not
24553 necessarly our "toplevel" container).
24555 2001-09-14 Ravi Pratap <ravi@ximian.com>
24557 * enum.cs (Enum::Define): Modify to call the Lookup method on the
24558 parent instead of a direct call to GetType.
24560 2001-09-14 Ravi Pratap <ravi@ximian.com>
24562 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
24563 Modifiers.TypeAttr. This should just be a call to that method.
24565 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
24566 object so that we can determine if we are top-level or not.
24568 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
24571 * enum.cs (Enum::Define): Ditto.
24573 * modifiers.cs (FieldAttr): Re-write.
24575 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24576 (TypeContainer::HaveStaticConstructor): New property to provide access
24577 to precisely that info.
24579 * modifiers.cs (MethodAttr): Re-write.
24580 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24582 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24583 of top-level types as claimed.
24585 2001-09-13 Miguel de Icaza <miguel@ximian.com>
24587 * expression.cs (MemberLookup): Fruitless attempt to lookup
24588 constructors. Maybe I need to emit default constructors? That
24589 might be it (currently .NET emits this for me automatically).
24590 (Invocation::OverloadResolve): Cope with Arguments == null.
24591 (Invocation::EmitArguments): new function, shared by the new
24592 constructor and us.
24593 (Invocation::Emit): Handle static and instance methods. Emit
24594 proper call instruction for virtual or non-virtual invocations.
24595 (New::Emit): Implement.
24596 (New::Resolve): Implement.
24597 (MemberAccess:Resolve): Implement.
24598 (MethodGroupExpr::InstanceExpression): used conforming to the spec
24599 to track instances.
24600 (FieldExpr::Resolve): Set type.
24602 * support.cs: Handle empty arguments.
24604 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24605 SimpleLookup): Auxiliary routines to help parse a qualifier
24608 Update qualifier_identifier rule.
24610 * codegen.cs: Removed debugging messages.
24612 * class.cs: Make this a global thing, this acts just as a "key" to
24613 objects that we might have around.
24615 (Populate): Only initialize method_builders_to_methods once.
24617 * expression.cs (PropertyExpr): Initialize type from the
24620 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24621 Resolve pattern. Attempt to implicitly convert value to boolean.
24624 * expression.cs: Set the type for the int32/int32 argument case.
24625 (Binary::ResolveOperator): Set the return type to boolean for
24626 comparission operators
24628 * typemanager.cs: Remove debugging print code.
24630 (Invocation::Resolve): resolve type.
24632 * class.cs: Allocate a MemberInfo of the correct size, as the code
24633 elsewhere depends on the test to reflect the correct contents.
24635 (Method::) Keep track of parameters, due to System.Reflection holes
24637 (TypeContainer::Populate): Keep track of MethodBuilders to Method
24640 (TypeContainer::FindMembers): Use ArrayList and then copy an array
24641 of the exact size and return that.
24643 (Class::LookupMethodByBuilder): New function that maps
24644 MethodBuilders to its methods. Required to locate the information
24645 on methods because System.Reflection bit us again.
24647 * support.cs: New file, contains an interface ParameterData and
24648 two implementations: ReflectionParameters and InternalParameters
24649 used to access Parameter information. We will need to grow this
24652 * expression.cs (Invocation::GetParameterData): implement a cache
24653 and a wrapper around the ParameterData creation for methods.
24654 (Invocation::OverloadResolve): Use new code.
24656 2001-09-13 Ravi Pratap <ravi@ximian.com>
24658 * class.cs (TypeContainer::EmitField): Remove and move into
24659 (Field::Define): here and modify accordingly.
24660 (Field.FieldBuilder): New member.
24661 (TypeContainer::Populate): Update accordingly.
24662 (TypeContainer::FindMembers): Implement.
24664 2001-09-13 Miguel de Icaza <miguel@ximian.com>
24666 * statement.cs: (VariableInfo::VariableType): New field to be
24667 initialized with the full type once it is resolved.
24669 2001-09-12 Miguel de Icaza <miguel@ximian.com>
24671 * parameter.cs (GetParameterInfo): Use a type cache to compute
24672 things only once, and to reuse this information
24674 * expression.cs (LocalVariableReference::Emit): Implement.
24675 (OpcodeCast::Emit): fix.
24677 (ParameterReference::Resolve): Implement.
24678 (ParameterReference::Emit): Implement.
24680 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24681 that are expressions need to stay as Expressions.
24683 * typemanager.cs (CSharpName): Returns the C# name of a type if
24686 * expression.cs (Expression::ConvertImplicit): New function that
24687 implements implicit type conversions.
24689 (Expression::ImplicitReferenceConversion): Implements implicit
24690 reference conversions.
24692 (EmptyCast): New type for transparent casts.
24694 (OpcodeCast): New type for casts of types that are performed with
24695 a sequence of bytecodes.
24697 (BoxedCast): New type used for casting value types into reference
24698 types. Emits a box opcode.
24700 (Binary::DoNumericPromotions): Implements numeric promotions of
24701 and computation of the Binary::Type.
24703 (Binary::EmitBranchable): Optimization.
24705 (Binary::Emit): Implement code emission for expressions.
24707 * typemanager.cs (TypeManager): Added two new core types: sbyte
24710 2001-09-12 Ravi Pratap <ravi@ximian.com>
24712 * class.cs (TypeContainer::FindMembers): Method which does exactly
24713 what Type.FindMembers does, only we don't have to use reflection. No
24714 implementation yet.
24716 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24717 typecontainer objects as we need to get at them.
24718 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24720 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24721 typecontainer object.
24723 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
24724 of just a Report object.
24726 2001-09-11 Ravi Pratap <ravi@ximian.com>
24728 * class.cs (Event::Define): Go back to using the prefixes "add_" and
24730 (TypeContainer::Populate): Now define the delegates of the type too.
24731 (TypeContainer.Delegates): Property to access the list of delegates defined
24734 * delegates.cs (Delegate::Define): Implement partially.
24736 * modifiers.cs (TypeAttr): Handle more flags.
24738 2001-09-11 Ravi Pratap <ravi@ximian.com>
24740 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
24742 (Operator::Define): Re-write logic to get types by using the LookupType method
24743 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
24744 (Indexer::Define): Ditto.
24745 (Event::Define): Ditto.
24746 (Property::Define): Ditto.
24748 2001-09-10 Ravi Pratap <ravi@ximian.com>
24750 * class.cs (TypeContainer::Populate): Now define operators too.
24751 (TypeContainer.Operators): New property to access the list of operators
24753 (Operator.OperatorMethodBuilder): New member to hold the method builder
24754 for the operator we are defining.
24755 (Operator::Define): Implement.
24757 2001-09-10 Ravi Pratap <ravi@ximian.com>
24759 * class.cs (Event::Define): Make the prefixes of the accessor methods
24760 addOn_ and removeOn_
24762 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24763 of the location being passed in too. Ideally, this should go later since all
24764 error reporting should be done through the Report object.
24766 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24767 (Populate): Iterate thru the indexers we have and define them too.
24768 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24769 for the get and set accessors.
24770 (Indexer::Define): Implement.
24772 2001-09-09 Miguel de Icaza <miguel@ximian.com>
24774 * expression.cs (Binary::Resolve): Beginning of it. I scratched
24775 my previous implementation, did not work.
24777 * typemanager.cs: Add a couple of missing types (the longs).
24779 * literal.cs: Use TypeManager.bool_type instead of getting it.
24781 * expression.cs (EventExpr): New kind of expressions.
24782 (Expressio::ExprClassFromMemberInfo): finish
24784 2001-09-08 Miguel de Icaza <miguel@ximian.com>
24786 * assign.cs: Emit stores to static fields differently.
24788 2001-09-08 Ravi Pratap <ravi@ximian.com>
24790 * Merge in changes and adjust code to tackle conflicts. Backed out my
24791 code in Assign::Resolve ;-)
24793 2001-09-08 Ravi Pratap <ravi@ximian.com>
24795 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24796 instead Report.Error and also pass in the location.
24797 (CSharpParser::Lexer): New readonly property to return the reference
24798 to the Tokenizer object.
24799 (declare_local_variables): Use Report.Error with location instead of plain
24803 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24804 (Operator.CheckBinaryOperator): Ditto.
24806 * cs-parser.jay (operator_declarator): Update accordingly.
24808 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24809 (CheckBinaryOperator): Same here.
24811 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24812 on the name without any prefixes of namespace names etc. This is because we
24813 already might have something already fully qualified like
24814 'System.Console.WriteLine'
24816 * assign.cs (Resolve): Begin implementation. Stuck ;-)
24818 2001-09-07 Ravi Pratap <ravi@ximian.com>
24820 * cs-tokenizer.cs (location): Return a string which also contains
24823 * expression.cs (ElementAccess): New class for expressions of the
24824 type 'element access.'
24825 (BaseAccess): New class for expressions of the type 'base access.'
24826 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24829 * cs-parser.jay (element_access): Implement action.
24830 (base_access): Implement actions.
24831 (checked_expression, unchecked_expression): Implement.
24833 * cs-parser.jay (local_variable_type): Correct and implement.
24834 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24836 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24838 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24839 name and the specifiers.
24841 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24843 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
24844 making them all public ;-)
24846 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24849 2001-09-07 Miguel de Icaza <miguel@ximian.com>
24851 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24853 (FieldExpr, PropertyExprs): New resolved expressions.
24854 (SimpleName::MemberStaticCheck): Perform static checks for access
24855 to non-static fields on static methods. Maybe this should be
24856 generalized for MemberAccesses.
24857 (SimpleName::ResolveSimpleName): More work on simple name
24860 * cs-parser.jay (primary_expression/qualified_identifier): track
24861 the parameter index.
24863 * codegen.cs (CodeGen::Save): Catch save exception, report error.
24864 (EmitContext::EmitBoolExpression): Chain to expression generation
24865 instead of temporary hack.
24866 (::EmitStatementExpression): Put generic expression code generation.
24868 * assign.cs (Assign::Emit): Implement variable assignments to
24869 local variables, parameters and fields.
24871 2001-09-06 Miguel de Icaza <miguel@ximian.com>
24873 * statement.cs (Block::GetVariableInfo): New method, returns the
24874 VariableInfo for a variable name in a block.
24875 (Block::GetVariableType): Implement in terms of GetVariableInfo
24877 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24878 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24880 2001-09-06 Ravi Pratap <ravi@ximian.com>
24882 * cs-parser.jay (operator_declaration): Continue on my quest : update
24883 to take attributes argument.
24884 (event_declaration): Ditto.
24885 (enum_declaration): Ditto.
24886 (indexer_declaration): Ditto.
24888 * class.cs (Operator::Operator): Update constructor accordingly.
24889 (Event::Event): Ditto.
24891 * delegate.cs (Delegate::Delegate): Same here.
24893 * enum.cs (Enum::Enum): Same here.
24895 2001-09-05 Ravi Pratap <ravi@ximian.com>
24897 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24899 * ../tests/cs0658.cs : New file to demonstrate error 0658.
24901 * attribute.cs (Attributes): New class to encapsulate all attributes which were
24902 being passed around as an arraylist.
24903 (Attributes::AddAttribute): Method to add attribute sections.
24905 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24906 (struct_declaration): Update accordingly.
24907 (constant_declaration): Update.
24908 (field_declaration): Update.
24909 (method_header): Update.
24910 (fixed_parameter): Update.
24911 (parameter_array): Ditto.
24912 (property_declaration): Ditto.
24913 (destructor_declaration): Ditto.
24915 * class.cs (Struct::Struct): Update constructors accordingly.
24916 (Class::Class): Ditto.
24917 (Field::Field): Ditto.
24918 (Method::Method): Ditto.
24919 (Property::Property): Ditto.
24920 (TypeContainer::OptAttribute): update property's return type.
24922 * interface.cs (Interface.opt_attributes): New member.
24923 (Interface::Interface): Update to take the extra Attributes argument.
24925 * parameter.cs (Parameter::Parameter): Ditto.
24927 * constant.cs (Constant::Constant): Ditto.
24929 * interface.cs (InterfaceMemberBase): New OptAttributes field.
24930 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
24931 the attributes as a parameter.
24932 (InterfaceProperty): Update constructor call.
24933 (InterfaceEvent): Ditto.
24934 (InterfaceMethod): Ditto.
24935 (InterfaceIndexer): Ditto.
24937 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
24938 pass the attributes too.
24939 (interface_event_declaration): Ditto.
24940 (interface_property_declaration): Ditto.
24941 (interface_method_declaration): Ditto.
24942 (interface_declaration): Ditto.
24944 2001-09-05 Miguel de Icaza <miguel@ximian.com>
24946 * class.cs (Method::Define): Track the "static Main" definition to
24947 create an entry point.
24949 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24950 EntryPoint if we find it.
24952 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24953 (EmitContext::ig): Make this variable public.
24955 * driver.cs: Make the default output file be the first file name
24956 with the .exe extension.
24958 Detect empty compilations
24960 Handle various kinds of output targets. Handle --target and
24961 rename -t to --dumper.
24963 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24964 methods inherited from Expression return now an Expression. This
24965 will is used during the tree rewriting as we resolve them during
24968 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24969 the spec. Missing entirely is the information about
24970 accessability of elements of it.
24972 (Expression::ExprClassFromMemberInfo): New constructor for
24973 Expressions that creates a fully initialized Expression based on
24974 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24977 (Invocation::Resolve): Begin implementing resolution of invocations.
24979 * literal.cs (StringLiteral): Implement Emit.
24981 2001-09-05 Ravi Pratap <ravi@ximian.com>
24983 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24986 2001-09-04 Ravi Pratap <ravi@ximian.com>
24988 * cs-parser.jay (attribute_arguments): Implement actions.
24989 (attribute): Fix bug in production. Implement action.
24990 (attribute_list): Implement.
24991 (attribute_target): Implement.
24992 (attribute_target_specifier, opt_target_specifier): Implement
24993 (CheckAttributeTarget): New method to check if the attribute target
24995 (attribute_section): Implement.
24996 (opt_attributes): Implement.
24998 * attribute.cs : New file to handle attributes.
24999 (Attribute): Class to hold attribute info.
25001 * cs-parser.jay (opt_attribute_target_specifier): Remove production
25002 (attribute_section): Modify production to use 2 different rules to
25003 achieve the same thing. 1 s/r conflict down !
25004 Clean out commented, useless, non-reducing dimension_separator rules.
25006 * class.cs (TypeContainer.attributes): New member to hold list
25007 of attributes for a type.
25008 (Struct::Struct): Modify to take one more argument, the attribute list.
25009 (Class::Class): Ditto.
25010 (Field::Field): Ditto.
25011 (Method::Method): Ditto.
25012 (Property::Property): Ditto.
25014 * cs-parser.jay (struct_declaration): Update constructor call to
25015 pass in the attributes too.
25016 (class_declaration): Ditto.
25017 (constant_declaration): Ditto.
25018 (field_declaration): Ditto.
25019 (method_header): Ditto.
25020 (fixed_parameter): Ditto.
25021 (parameter_array): Ditto.
25022 (property_declaration): Ditto.
25024 * constant.cs (Constant::Constant): Update constructor similarly.
25025 Use System.Collections.
25027 * parameter.cs (Parameter::Parameter): Update as above.
25029 2001-09-02 Ravi Pratap <ravi@ximian.com>
25031 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
25032 (TypeContainer.delegates): New member to hold list of delegates.
25034 * cs-parser.jay (delegate_declaration): Implement the action correctly
25035 this time as I seem to be on crack ;-)
25037 2001-09-02 Miguel de Icaza <miguel@ximian.com>
25039 * rootcontext.cs (RootContext::IsNamespace): new function, used to
25040 tell whether an identifier represents a namespace.
25042 * expression.cs (NamespaceExpr): A namespace expression, used only
25043 temporarly during expression resolution.
25044 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
25045 utility functions to resolve names on expressions.
25047 2001-09-01 Miguel de Icaza <miguel@ximian.com>
25049 * codegen.cs: Add hook for StatementExpressions.
25051 * class.cs: Fix inverted test for static flag in methods.
25053 2001-09-02 Ravi Pratap <ravi@ximian.com>
25055 * class.cs (Operator::CheckUnaryOperator): Correct error number used
25056 to make it coincide with MS' number.
25057 (Operator::CheckBinaryOperator): Ditto.
25059 * ../errors/errors.txt : Remove error numbers added earlier.
25061 * ../errors/cs1019.cs : Test case for error # 1019
25063 * ../errros/cs1020.cs : Test case for error # 1020
25065 * cs-parser.jay : Clean out commented cruft.
25066 (dimension_separators, dimension_separator): Comment out. Ostensibly not
25067 used anywhere - non-reducing rule.
25068 (namespace_declarations): Non-reducing rule - comment out.
25070 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
25071 with TypeContainer::AddEnum.
25073 * delegate.cs : New file for delegate handling classes.
25074 (Delegate): Class for declaring delegates.
25076 * makefile : Update.
25078 * cs-parser.jay (delegate_declaration): Implement.
25080 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
25082 * class.cs (Event::Define): Implement.
25083 (Event.EventBuilder): New member.
25085 * class.cs (TypeContainer::Populate): Update to define all enums and events
25087 (Events): New property for the events arraylist we hold. Shouldn't we move to using
25088 readonly fields for all these cases ?
25090 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
25092 * class.cs (Property): Revamp to use the convention of making fields readonly.
25093 Accordingly modify code elsewhere.
25095 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
25096 the Define method of the Property class.
25098 * class.cs : Clean up applied patch and update references to variables etc. Fix
25100 (TypeContainer::Populate): Update to define all the properties we have. Also
25101 define all enumerations.
25103 * enum.cs (Define): Implement.
25105 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
25107 * cs-parser.jay (overloadable_operator): The semantic value is an
25108 enum of the Operator class.
25109 (operator_declarator): Implement actions.
25110 (operator_declaration): Implement.
25112 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
25113 validity of definitions.
25114 (Operator::CheckBinaryOperator): Static method to check for binary operators
25115 (TypeContainer::AddOperator): New method to add an operator to a type.
25117 * cs-parser.jay (indexer_declaration): Added line to actually call the
25118 AddIndexer method so it gets added ;-)
25120 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
25121 already taken care of by the MS compiler ?
25123 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
25125 * class.cs (Operator): New class for operator declarations.
25126 (Operator::OpType): Enum for the various operators.
25128 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
25130 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
25131 ostensibly handle this in semantic analysis.
25133 * cs-parser.jay (general_catch_clause): Comment out
25134 (specific_catch_clauses, specific_catch_clause): Ditto.
25135 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
25136 (catch_args, opt_catch_args): New productions.
25137 (catch_clause): Rewrite to use the new productions above
25138 (catch_clauses): Modify accordingly.
25139 (opt_catch_clauses): New production to use in try_statement
25140 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
25141 and re-write the code in the actions to extract the specific and
25142 general catch clauses by being a little smart ;-)
25144 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
25145 Hooray, try and catch statements parse fine !
25147 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
25149 * statement.cs (Block::GetVariableType): Fix logic to extract the type
25150 string from the hashtable of variables.
25152 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
25153 I end up making that mistake ;-)
25154 (catch_clauses): Fixed gross error which made Key and Value of the
25155 DictionaryEntry the same : $1 !!
25157 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
25159 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
25161 * cs-parser.jay (event_declaration): Correct to remove the semicolon
25162 when the add and remove accessors are specified.
25164 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
25166 * cs-parser.jay (IndexerDeclaration): New helper class to hold
25167 information about indexer_declarator.
25168 (indexer_declarator): Implement actions.
25169 (parsing_indexer): New local boolean used to keep track of whether
25170 we are parsing indexers or properties. This is necessary because
25171 implicit_parameters come into picture even for the get accessor in the
25172 case of an indexer.
25173 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
25175 * class.cs (Indexer): New class for indexer declarations.
25176 (TypeContainer::AddIndexer): New method to add an indexer to a type.
25177 (TypeContainer::indexers): New member to hold list of indexers for the
25180 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
25182 * cs-parser.jay (add_accessor_declaration): Implement action.
25183 (remove_accessor_declaration): Implement action.
25184 (event_accessors_declaration): Implement
25185 (variable_declarators): swap statements for first rule - trivial.
25187 * class.cs (Event): New class to hold information about event
25189 (TypeContainer::AddEvent): New method to add an event to a type
25190 (TypeContainer::events): New member to hold list of events.
25192 * cs-parser.jay (event_declaration): Implement actions.
25194 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
25196 * cs-parser.jay (dim_separators): Implement. Make it a string
25197 concatenating all the commas together, just as they appear.
25198 (opt_dim_separators): Modify accordingly
25199 (rank_specifiers): Update accordingly. Basically do the same
25200 thing - instead, collect the brackets here.
25201 (opt_rank_sepcifiers): Modify accordingly.
25202 (array_type): Modify to actually return the complete type string
25203 instead of ignoring the rank_specifiers.
25204 (expression_list): Implement to collect the expressions
25205 (variable_initializer): Implement. We make it a list of expressions
25206 essentially so that we can handle the array_initializer case neatly too.
25207 (variable_initializer_list): Implement.
25208 (array_initializer): Make it a list of variable_initializers
25209 (opt_array_initializer): Modify accordingly.
25211 * expression.cs (New::NType): Add enumeration to help us
25212 keep track of whether we have an object/delegate creation
25213 or an array creation.
25214 (New:NewType, New::Rank, New::Indices, New::Initializers): New
25215 members to hold data about array creation.
25216 (New:New): Modify to update NewType
25217 (New:New): New Overloaded contructor for the array creation
25220 * cs-parser.jay (array_creation_expression): Implement to call
25221 the overloaded New constructor.
25223 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
25225 * class.cs (TypeContainer::Constructors): Return member
25226 constructors instead of returning null.
25228 2001-08-26 Miguel de Icaza <miguel@ximian.com>
25230 * typemanager.cs (InitCoreTypes): Initialize the various core
25231 types after we have populated the type manager with the user
25232 defined types (this distinction will be important later while
25233 compiling corlib.dll)
25235 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
25236 on Expression Classification. Now all expressions have a method
25237 `Resolve' and a method `Emit'.
25239 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
25240 generation from working. Also add some temporary debugging
25243 2001-08-24 Miguel de Icaza <miguel@ximian.com>
25245 * codegen.cs: Lots of code generation pieces. This is only the
25246 beginning, will continue tomorrow with more touches of polish. We
25247 handle the fundamentals of if, while, do, for, return. Others are
25248 trickier and I need to start working on invocations soon.
25250 * gen-treedump.cs: Bug fix, use s.Increment here instead of
25253 * codegen.cs (EmitContext): New struct, used during code
25254 emission to keep a context. Most of the code generation will be
25257 * cs-parser.jay: Add embedded blocks to the list of statements of
25258 this block. So code generation proceeds in a top down fashion.
25260 2001-08-23 Miguel de Icaza <miguel@ximian.com>
25262 * statement.cs: Add support for multiple child blocks.
25264 2001-08-22 Miguel de Icaza <miguel@ximian.com>
25266 * codegen.cs (EmitCode): New function, will emit the code for a
25267 Block of code given a TypeContainer and its ILGenerator.
25269 * statement.cs (Block): Standard public readonly optimization.
25270 (Block::Block constructors): Link children.
25271 (Block::Child): Child Linker.
25272 (Block::EmitVariables): Emits IL variable declarations.
25274 * class.cs: Drop support for MethodGroups here, delay until
25276 (Method::): Applied the same simplification that I did before, and
25277 move from Properties to public readonly fields.
25278 (Method::ParameterTypes): Returns the parameter types for the
25279 function, and implements a cache that will be useful later when I
25280 do error checking and the semantic analysis on the methods is
25282 (Constructor::GetCallingConvention): Renamed from CallingConvetion
25283 and made a method, optional argument tells whether this is a class
25284 or a structure to apply the `has-this' bit.
25285 (Method::GetCallingConvention): Implement, returns the calling
25287 (Method::Define): Defines the type, a second pass is performed
25288 later to populate the methods.
25290 (Constructor::ParameterTypes): implement a cache similar to the
25291 one on Method::ParameterTypes, useful later when we do semantic
25294 (TypeContainer::EmitMethod): New method. Emits methods.
25296 * expression.cs: Removed MethodGroup class from here.
25298 * parameter.cs (Parameters::GetCallingConvention): new method.
25300 2001-08-21 Miguel de Icaza <miguel@ximian.com>
25302 * class.cs (TypeContainer::Populate): Drop RootContext from the
25305 (Constructor::CallingConvention): Returns the calling convention.
25306 (Constructor::ParameterTypes): Returns the constructor parameter
25309 (TypeContainer::AddConstructor): Keep track of default constructor
25310 and the default static constructor.
25312 (Constructor::) Another class that starts using `public readonly'
25313 instead of properties.
25315 (Constructor::IsDefault): Whether this is a default constructor.
25317 (Field::) use readonly public fields instead of properties also.
25319 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
25320 track of static constructors; If none is used, turn on
25321 BeforeFieldInit in the TypeAttributes.
25323 * cs-parser.jay (opt_argument_list): now the return can be null
25324 for the cases where there are no arguments.
25326 (constructor_declarator): If there is no implicit `base' or
25327 `this', then invoke the default parent constructor.
25329 * modifiers.cs (MethodAttr): New static function maps a set of
25330 modifiers flags into a MethodAttributes enum
25331 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
25332 MethodAttr, TypeAttr to represent the various mappings where the
25333 modifiers are used.
25334 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
25336 2001-08-19 Miguel de Icaza <miguel@ximian.com>
25338 * parameter.cs (GetParameterInfo): Fix bug where there would be no
25341 * interface.cs (PopulateIndexer): Implemented the code generator
25342 for interface indexers.
25344 2001-08-17 Miguel de Icaza <miguel@ximian.com>
25346 * interface.cs (InterfaceMemberBase): Now we track the new status
25349 (PopulateProperty): Implement property population. Woohoo! Got
25350 Methods and Properties going today.
25352 Removed all the properties for interfaces, and replaced them with
25353 `public readonly' fields.
25355 2001-08-16 Miguel de Icaza <miguel@ximian.com>
25357 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
25358 initialize their hashtables/arraylists only when they are needed
25359 instead of doing this always.
25361 * parameter.cs: Handle refs and out parameters.
25363 * cs-parser.jay: Use an ArrayList to construct the arguments
25364 instead of the ParameterCollection, and then cast that to a
25367 * parameter.cs: Drop the use of ParameterCollection and use
25368 instead arrays of Parameters.
25370 (GetParameterInfo): Use the Type, not the Name when resolving
25373 2001-08-13 Miguel de Icaza <miguel@ximian.com>
25375 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
25376 and instead use public readonly fields.
25378 * class.cs: Put back walking code for type containers.
25380 2001-08-11 Miguel de Icaza <miguel@ximian.com>
25382 * class.cs (MakeConstant): Code to define constants.
25384 * rootcontext.cs (LookupType): New function. Used to locate types
25387 2001-08-08 Miguel de Icaza <miguel@ximian.com>
25389 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
25390 this System.Reflection code is. Kudos to Microsoft
25392 * typemanager.cs: Implement a type cache and avoid loading all
25393 types at boot time. Wrap in LookupType the internals. This made
25394 the compiler so much faster. Wow. I rule!
25396 * driver.cs: Make sure we always load mscorlib first (for
25397 debugging purposes, nothing really important).
25399 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
25400 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
25402 * rootcontext.cs: Lookup types on their namespace; Lookup types
25403 on namespaces that have been imported using the `using' keyword.
25405 * class.cs (TypeContainer::TypeAttr): Virtualize.
25406 (Class::TypeAttr): Return attributes suitable for this bad boy.
25407 (Struct::TypeAttr): ditto.
25408 Handle nested classes.
25409 (TypeContainer::) Remove all the type visiting code, it is now
25410 replaced with the rootcontext.cs code
25412 * rootcontext.cs (GetClassBases): Added support for structs.
25414 2001-08-06 Miguel de Icaza <miguel@ximian.com>
25416 * interface.cs, statement.cs, class.cs, parameter.cs,
25417 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
25418 Drop use of TypeRefs, and use strings instead.
25420 2001-08-04 Miguel de Icaza <miguel@ximian.com>
25424 * class.cs (Struct::Struct): set the SEALED flags after
25425 checking the modifiers.
25426 (TypeContainer::TypeAttr): new property, returns the
25427 TypeAttributes for a class.
25429 * cs-parser.jay (type_list): Oops, list production was creating a
25430 new list of base types.
25432 * rootcontext.cs (StdLib): New property.
25433 (GetInterfaceTypeByName): returns an interface by type name, and
25434 encapsulates error handling here.
25435 (GetInterfaces): simplified.
25436 (ResolveTree): Encapsulated all the tree resolution here.
25437 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
25440 * driver.cs: Add support for --nostdlib, to avoid loading the
25441 default assemblies.
25442 (Main): Do not put tree resolution here.
25444 * rootcontext.cs: Beginning of the class resolution.
25446 2001-08-03 Miguel de Icaza <miguel@ximian.com>
25448 * rootcontext.cs: Provide better error reporting.
25450 * cs-parser.jay (interface_base): set our $$ to be interfaces.
25452 * rootcontext.cs (CreateInterface): Handle the case where there
25453 are no parent interfaces.
25455 (CloseTypes): Routine to flush types at the end.
25456 (CreateInterface): Track types.
25457 (GetInterfaces): Returns an array of Types from the list of
25458 defined interfaces.
25460 * typemanager.c (AddUserType): Mechanism to track user types (puts
25461 the type on the global type hash, and allows us to close it at the
25464 2001-08-02 Miguel de Icaza <miguel@ximian.com>
25466 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25467 RecordInterface instead.
25469 * cs-parser.jay: Updated to reflect changes above.
25471 * decl.cs (Definition): Keep track of the TypeBuilder type that
25472 represents this type here. Not sure we will use it in the long
25473 run, but wont hurt for now.
25475 * driver.cs: Smaller changes to accomodate the new code.
25477 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25480 * rootcontext.cs (CreateInterface): New method, used to create
25481 the System.TypeBuilder type for interfaces.
25482 (ResolveInterfaces): new entry point to resolve the interface
25484 (CodeGen): Property, used to keep track of the code generator.
25486 2001-07-26 Miguel de Icaza <miguel@ximian.com>
25488 * cs-parser.jay: Add a second production for delegate_declaration
25491 (enum_body): Put an opt_comma here instead of putting it on
25492 enum_body or enum_member_declarations so we can handle trailing
25493 commas on enumeration members. Gets rid of a shift/reduce.
25495 (type_list): Need a COMMA in the middle.
25497 (indexer_declaration): Tell tokenizer to recognize get/set
25499 * Remove old targets.
25501 * Re-add the parser target.
25503 2001-07-13 Simon Cozens <simon@simon-cozens.org>
25505 * cs-parser.jay: Add precendence rules for a number of operators
25506 ot reduce the number of shift/reduce conflicts in the grammar.
25508 2001-07-17 Miguel de Icaza <miguel@ximian.com>
25510 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25513 Get rid of old crufty code.
25515 * rootcontext.cs: Use this to keep track of the parsed
25516 representation and the defined types available to the program.
25518 * gen-treedump.cs: adjust for new convention.
25520 * type.cs: Split out the type manager, and the assembly builder
25523 * typemanager.cs: the type manager will live here now.
25525 * cil-codegen.cs: And the code generator here.
25527 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
25529 * makefile: Fixed up for easy making.
25531 2001-07-13 Simon Cozens <simon@simon-cozens.org>
25533 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25536 (unary_expression): Expand pre_increment_expression and
25537 post_decrement_expression to reduce a shift/reduce.
25539 2001-07-11 Simon Cozens
25541 * cs-tokenizer.cs: Hex numbers should begin with a 0.
25543 Improve allow_keyword_as_indent name.
25545 2001-06-19 Miguel de Icaza <miguel@ximian.com>
25547 * Adjustments for Beta2.
25549 2001-06-13 Miguel de Icaza <miguel@ximian.com>
25551 * decl.cs: Added `Define' abstract method.
25552 (InTransit): new property, used to catch recursive definitions.
25554 * interface.cs: Implement `Define'.
25556 * modifiers.cs: Map Modifiers.constants to
25557 System.Reflection.TypeAttribute flags.
25559 * class.cs: Keep track of types and user-defined types.
25560 (BuilderInit): New method for creating an assembly
25561 (ResolveType): New function to launch the resolution process, only
25562 used by interfaces for now.
25564 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
25565 that are inserted into the name space.
25567 2001-06-08 Miguel de Icaza <miguel@ximian.com>
25569 * ARGH. I have screwed up my tree so many times due to the use of
25570 rsync rather than using CVS. Going to fix this at once.
25572 * driver.cs: Objetify driver. Load assemblies, use assemblies to
25575 2001-06-07 Miguel de Icaza <miguel@ximian.com>
25577 * Experiment successful: Use System.Type rather that our own
25580 2001-05-25 Miguel de Icaza <miguel@ximian.com>
25582 * cs-parser.jay: Removed nsAliases from here.
25584 Use new namespaces, handle `using XXX;'
25586 * namespace.cs: Reimplemented namespace handling, use a recursive
25587 definition of the class. Now we can keep track of using clauses
25588 and catch invalid using clauses.
25590 2001-05-24 Miguel de Icaza <miguel@ximian.com>
25592 * gen-treedump.cs: Adapted for all the renaming.
25594 * expression.cs (Expression): this class now has a Type property
25595 which returns an expression Type.
25597 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25598 `Type', as this has a different meaning now in the base
25600 2001-05-22 Miguel de Icaza <miguel@ximian.com>
25602 * interface.cs, class.cs: Removed from all the sources the
25603 references to signature computation, as we can not do method
25604 signature computation during the parsing time, as we are not
25605 trying to solve at that point distinguishing:
25609 void a (NS.Blah x) {}
25612 Which depending on the context might be valid or not, as we do not
25613 know if Blah is the same thing as NS.Blah at that point.
25615 * Redid everything so the code uses TypeRefs now instead of
25616 Types. TypeRefs are just temporary type placeholders, that need
25617 to be resolved. They initially have a pointer to a string and the
25618 current scope in which they are used. This is used later by the
25619 compiler to resolve the reference to an actual Type.
25621 * DeclSpace is no longer a CIR.Type, and neither are
25622 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
25623 are all DeclSpaces, but no Types.
25625 * type.cs (TypeRefManager): This implements the TypeRef manager,
25626 which keeps track of all the types that need to be resolved after
25627 the parsing has finished.
25629 2001-05-13 Miguel de Icaza <miguel@ximian.com>
25631 * ARGH. We are going to have to store `foreach' as a class rather
25632 than resolving it, as we need to verify error 1579 after name
25633 resolution. *OR* we could keep a flag that says `This request to
25634 IEnumerator comes from a foreach statement' which we can then use
25635 to generate the error.
25637 2001-05-10 Miguel de Icaza <miguel@ximian.com>
25639 * class.cs (TypeContainer.AddMethod): we now add methods to the
25640 MethodGroup instead of the method hashtable.
25642 * expression.cs: Add MethodGroup abstraction, which gets us one
25643 step closer to the specification in the way we handle method
25646 * cs-parser.jay (primary_expression): qualified_identifier now
25647 tried to match up an identifier to a local variable reference or
25648 to a parameter reference.
25650 current_local_parameters is now a parser global variable that
25651 points to the current parameters for the block, used during name
25654 (property_declaration): Now creates an implicit `value' argument to
25657 2001-05-09 Miguel de Icaza <miguel@ximian.com>
25659 * parameter.cs: Do not use `param' arguments as part of the
25660 signature, per the spec.
25662 2001-05-08 Miguel de Icaza <miguel@ximian.com>
25664 * decl.cs: Base class for classes, structs and interfaces. This
25665 is the "Declaration Space"
25667 * cs-parser.jay: Use CheckDef for checking declaration errors
25668 instead of having one on each function.
25670 * class.cs: Factor out some code for handling error handling in
25671 accordance to the "Declarations" section in the "Basic Concepts"
25672 chapter in the ECMA C# spec.
25674 * interface.cs: Make all interface member classes derive from
25675 InterfaceMemberBase.
25677 2001-05-07 Miguel de Icaza <miguel@ximian.com>
25679 * Many things: all interfaces are parsed and generated in
25680 gen-treedump. Support for member variables, constructors,
25681 destructors, properties, constants is there.
25683 Beginning of the IL backend, but very little done, just there for
25686 2001-04-29 Miguel de Icaza <miguel@ximian.com>
25688 * cs-parser.jay: Fix labeled statement.
25690 * cs-tokenizer.cs (escape): Escape " and ' always.
25691 ref_line, ref_name: keep track of the line/filename as instructed
25692 by #line by the compiler.
25695 2001-04-27 Miguel de Icaza <miguel@ximian.com>
25697 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25698 to match the values in System.CodeDOM.
25700 Divid renamed to Divide.
25702 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25704 (Statements.set): remove.
25706 * System.CodeDOM/CodeCatchClause.cs: always have a valid
25709 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25710 falseStatements always have valid values.
25712 * cs-parser.jay: Use System.CodeDOM now.