1 2006-05-05 Raja R Harinath <rharinath@novell.com>
3 * flowanalysis.cs (BranchingType.Labeled): New.
4 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
5 (FlowBranchingLabeled): New. Does nothing for now, but will
6 eventually handle 'goto' flows.
7 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
8 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
10 (Block.Resolve): ... here.
12 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
13 (UsageVector.MergeFinallyOrigins): Likewise.
14 (FlowBranching.InTryOrCatch): Likewise.
15 (FlowBranching.AddFinallyVector): Likewise.
16 (FlowBranchingException): Update to changes.
19 * statement.cs (Return.Resolve): Move error checking to ...
20 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
21 (FlowBranchingException): Handle return origins like break and
23 (FlowBranching.UsageVector.CheckOutParameters): Remove.
25 2006-05-04 Marek Safar <marek.safar@seznam.cz>
28 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
31 2006-05-04 Marek Safar <marek.safar@seznam.cz>
34 * class.cs (MethodData.Define): Do public accessor check only when method
35 implements an interface.
37 2006-05-04 Raja R Harinath <rharinath@novell.com>
39 Remove special handling of 'break'
40 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
41 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
42 (UsageVector.Break): Remove.
43 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
45 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
47 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
48 UsageVector.Breaks (). Don't set NeedsReturnLabel.
50 2006-05-03 Marek Safar <marek.safar@seznam.cz>
53 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
54 be the interface member.
56 2006-05-03 Marek Safar <marek.safar@seznam.cz>
59 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
60 for emitting small (int) values.
62 2006-05-03 Raja R Harinath <rharinath@novell.com>
65 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
66 control-flow passes through the 'finally' after merging-in all the
67 control-flows from 'try' and the 'catch' clauses.
69 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
70 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
71 always true at the only non-recursive entry point.
72 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
73 FlowBranchingBreakable.
74 (FlowBranchingLoop): Remove.
75 * statement.cs (Return.DoResolve): Update to changes.
78 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
79 (FlowBranching.CreateBranching): Handle it: create a
80 FlowBranchingContinuable.
81 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
82 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
83 except that it handles the 'continue' command.
84 (FlowBranching.UsageVector.MergeOrigins): Rename from
86 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
87 except that it overrides AddContinueOrigin.
88 (FlowBranchingException): Override AddContinueOrigin, similar to
90 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
91 Create a new branching around the embedded statement.
92 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
93 control flow after the embedded statement.
94 (Continue.Resolve): Move all error checking to AddContinueOrigin.
96 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
97 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
98 FlowBranchingBreakable.
99 (FlowBranchingSwitch): Remove.
102 * statement.cs (Break.Resolve): Simplify. Move responsibility for
103 error reporting to ...
104 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
105 Rename from 'AddBreakVector'. Add new location argument. Return
106 a bool indicating whether the 'break' crosses an unwind-protect.
107 (FlowBranchingException.AddBreakOrigin): Add.
108 (FlowBranchingException.Merge): Propagate 'break's to surrounding
109 flowbranching after updating with the effects of the 'finally'
111 (FlowBranchingBreakable): New common base class for
112 FlowBranchingLoop and FlowBranchingSwitch.
114 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
116 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
118 2006-05-02 Raja R Harinath <rharinath@novell.com>
120 * statement.cs (Do.Resolve): If the loop is infinite, set the
122 (While.Resolve, For.Resolve): Set a barrier after the embedded
123 statement. There's no direct control flow that goes from the end
124 of the embedded statement to the end of the loop.
125 * flowanalysis.cs (FlowBranching.Infinite): Remove.
126 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
127 above ensure that the reachability is correctly computed.
129 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
130 (UsageVector.MergeBreakOrigins): If the current path is
131 unreachable, treat it as if all parameters/locals are initialized.
132 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
133 infinite loops before merging-in break origins.
135 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
136 (Reachability.Reachable): Split part into ...
137 (Reachability.Unreachable): ... this. Simplify.
138 (Reachability.IsUnreachable): Use 'Unreachable' instead.
140 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
141 (Reachability.SetThrowsSometimes): Likewise.
142 (FlowBranchingBlock.MergeTopBlock): Don't compare against
143 TriState.Always, use corresponding property.
144 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
145 (Block.Resolve): Likewise. Remove some redundant checks.
147 2006-05-02 Raja R Harinath <harinath@gmail.com>
149 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
150 (Reachability.Meet): Don't bother checking AlwaysThrows --
151 barrier is always set.
152 (FlowBranchingBlock.Merge): Likewise.
154 2006-05-01 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
156 * attribute.cs: fixed_buffer_cache is declared only if NET_2_0 is
157 defined, so it's references should also compile only for NET_2_0
158 (as occurs in mcs version)
160 2006-05-01 Raja R Harinath <harinath@gmail.com>
162 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
163 checks for unreachable.
165 2006-05-01 Marek Safar <marek.safar@seznam.cz>
168 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
170 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
171 whether field is really assigned.
173 2006-04-30 Raja R Harinath <harinath@gmail.com>
175 * flowanalysis.cs (Reachability): Make 4-argument constructor
177 (Reachability.Meet): Rename from 'And'. Remove static variant.
178 (Reachability.Always): Rename from the highly misleading
179 'Reachability.Never'.
180 (FlowBranching.Merge): Update to changes. Mark an impossible
181 situation with a 'throw'.
182 (*): Update to changes.
184 2006-04-29 Raja R Harinath <harinath@gmail.com>
186 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
188 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
189 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
190 (*): Update to changes.
191 * statement.cs: Update to changes.
193 2006-04-28 Marek Safar <marek.safar@seznam.cz>
196 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
198 2006-04-28 Raja R Harinath <harinath@gmail.com>
200 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
203 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
204 argument to two arguments: an usage-vector and a bool. Move call
205 to FlowBranching.Merge () ...
206 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
208 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
209 handling of loop and switch reachability to ...
210 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
212 2006-04-27 Raja R Harinath <harinath@gmail.com>
214 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
215 handling to FlowBranchingLoop.InLoop.
216 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
218 2006-04-26 Marek Safar <marek.safar@seznam.cz>
221 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
222 anonymous method is allowed from AnonymousContainer here.
224 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
226 2006-04-24 Raja R Harinath <rharinath@novell.com>
229 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
231 2006-04-23 Marek Safar <marek.safar@seznam.cz>
234 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
235 (DoubleConstant.Reduce): Ditto.
237 2006-04-23 Raja R Harinath <rharinath@novell.com>
239 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
240 Remove 'lvalue_right_side' argument. Move parts to ...
241 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
242 (LocalVariable.DoResolveLValue): ... these.
244 2006-04-21 Raja R Harinath <rharinath@novell.com>
247 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
248 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
249 (LocalVariableReference.DoResolveBase): Use it to implement new
251 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
252 (Argument.Resolve): Simplify. Move CS1510 check ...
253 * ecore.cs (Expression.ResolveLValue): ... here.
254 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
255 (PropertyExpr.DoResolveLValue): Likewise.
256 (FieldExpr.Report_AssignToReadonly): Likewise.
257 (FieldExpr.DoResolve): Add 'out_access' argument. Use
258 LValueMemberAccess or LValueMemberOutAccess on instance depending
260 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
261 DoResolve as appropriate.
263 2006-04-20 Raja R Harinath <rharinath@novell.com>
266 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
267 implicit conversions on 'out' and 'ref' arguments.
269 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
270 improve clarity. Remove dead code.
273 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
274 (Catch.Resolve): Resolve VarBlock if it exists.
276 2006-04-19 Miguel de Icaza <miguel@novell.com>
278 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
279 twice, this was some residual code, the enumerator was emitted
280 properly in the two branche of if later.
284 Thanks to Martin for finding the source of the problem
286 2006-04-19 Raja R Harinath <rharinath@novell.com>
288 * expression.cs (Cast.ResolveLValue): Remove. The result of a
289 cast is never an lvalue.
290 (Cast.DoResolve, Cast.ResolveRest): Combine.
291 (Argument.Emit): Simplify slightly. Move 'Expr is
292 IMemoryLocation' check ...
293 (Argument.Resolve): ... here.
294 (Argument.Error_LValueRequired): Remove. Inline into only user.
296 Simplifications. Fix cs0191-2.cs
297 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
298 CS1649 and CS1651 to ...
299 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
300 the actual selection of the error code and message to a lookup
301 table. Add a dummy return value to simplify callsites.
302 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
303 readonly fields of other instances of the same type. Move CS0197
305 * expression.cs (Argument.Resolve): ... here. Simplify code.
306 Ensure that ec.InRefOutArgumentResolving is only set during LValue
307 resolution of an out or ref argument. The code simplification
308 above uses this invariant.
310 2006-04-18 Raja R Harinath <rharinath@novell.com>
312 Possibly fix #77752. Fix cs1690-[4-7].cs.
313 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
314 CheckMarshallByRefAccess. Drop parameter.
315 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
317 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
319 * report.cs (AllWarnings): Add CS1690.
320 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
322 (LocalVariableReference.DoResolveBase): Update.
324 2006-04-09 Marek Safar <marek.safar@seznam.cz>
326 * class.cs (MethodOrOperator): Moved common parts from method class.
327 detect obsolete attributes.
328 (Method.Define): Simplified as it reuses code from base.
329 (Constructor.ValidAttributeTargets): Fixed issue found during
331 (Destructor.ValidAttributeTargets): Fixed issue found during
333 (Operator): Finished refactoring set off by #78020. Operator class is now
334 ordinary method class.
336 * anonymous.cs: Updated.
338 2006-04-09 Marek Safar <marek.safar@seznam.cz>
340 * class.cs (Constructor.Emit): Don't emit the attributes twice.
342 2006-04-09 Marek Safar <marek.safar@seznam.cz>
344 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
345 detect obsolete attributes.
346 (Method.CreateEmitContext): Moved to MethodOrOperator.
348 2006-04-09 Marek Safar <marek.safar@seznam.cz>
351 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
352 customized exception to make crash detection easier.
353 (MethodOrOperator): Started to work on new base class for methods and
355 (Method): Derives from MethodOrOperator.
356 (Constructor.Emit): Emits its own attributes.
357 (AbstractPropertyEventMethod.Emit): Ditto.
358 (Operator): Derives from MethodOrOperator, will refactor fully in extra
360 (Operator.Emit): It's temporary more tricky than should be.
362 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
364 * report.cs (InternalErrorException): Add ctor with inner exception.
366 2006-04-08 Marek Safar <marek.safar@seznam.cz>
369 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
372 2006-04-07 Marek Safar <marek.safar@seznam.cz>
375 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
378 2006-04-06 Marek Safar <marek.safar@seznam.cz>
380 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
381 attribute is present and Guid not.
382 (Interface.ApplyAttributeBuilder): Ditto.
384 * attribute.cs: Add error message.
386 2006-04-06 Marek Safar <marek.safar@seznam.cz>
390 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
391 sources (it's composite) so hold them in extra array as they are used in
392 Emit phase only. It worked in the previous versions by mistake.
393 (Attribute.Emit): Emit attribute for more owners when exist.
395 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
396 it has now different behaviour.
398 2006-04-04 Marek Safar <marek.safar@seznam.cz>
400 * constant.cs (Constant.IsDefaultInitializer): New method.
404 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
405 re-initialize default values. It saves KBs almost for every assembly.
406 Thanks Zoltan for the idea.
407 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
408 (ArrayCreation.DoResolve): Resolve only once.
409 (ArrayCreation.Emit): Emit static initializer only when it is faster.
410 (ArrayCreation.GetAttributableValue): Cope with optimized values.
412 2006-04-03 Zoltan Varga <vargaz@gmail.com>
414 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
417 2006-04-01 Marek Safar <marek.safar@seznam.cz>
419 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
420 in an embedded statement too.
422 2006-04-01 Raja R Harinath <rharinath@novell.com>
425 * typemanager.cs (IsNestedChildOf): Drop generic arguments before
429 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
432 * report.cs (SymbolRelatedToPreviousError): Drop generic type
433 arguments before checking whether a type is reflected or not.
436 * expression.cs (Invocation.IsApplicable): Ensure a generic method
437 definition doesn't take part in overload resolution.
438 (Invocation.IsParamsMethodApplicable): Likewise.
439 (Invocation.OverloadResolve): When replacing a reflected override
440 method with its base definition, ensure that type arguments are
443 2006-04-01 Marek Safar <marek.safar@seznam.cz>
447 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
450 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
452 2006-03-31 Marek Safar <marek.safar@seznam.cz>
454 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
457 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
458 LocalTemporary change.
460 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
462 (ClassOrStruct.DefineFieldInitializers): Implemented static field
463 initializers optimization.
464 (ClassOrStruct.TypeAttr): Moved from modifiers.
465 (Constructor.CheckBase): Don't crash when static ctor has parameters.
466 (FieldBase.ResolveInitializer): Resolves initializer.
467 (FieldBase.HasDefaultInitializer): New property.
469 * cs-parser.jay: Removed message.
471 * expression.cs (CompilerGeneratedThis): New specialization.
473 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
475 2006-03-28 Marek Safar <marek.safar@seznam.cz>
477 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
479 2006-03-27 Marek Safar <marek.safar@seznam.cz>
481 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
482 be now EnumConstants only.
484 2006-03-27 Marek Safar <marek.safar@seznam.cz>
486 * attribute.cs, driver.cs: Reset more caches.
488 2006-03-26 Marek Safar <marek.safar@seznam.cz>
490 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
492 2006-03-26 Marek Safar <marek.safar@seznam.cz>
494 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
495 for easier reuse. Updated all overrides.
496 (IntegralConstant): New base class for all integral constants.
497 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
498 of the constant range, report custom error.
499 (UIntConstant.Reduce): Fixed uint conversion.
501 * ecore.cs, literal.cs: Reduce updates.
503 2006-03-26 Marek Safar <marek.safar@seznam.cz>
507 * class.cs (Constructor.Define): Removed extra if for default ctors.
508 A patch from Atsushi Enomoto.
510 2006-03-26 Marek Safar <marek.safar@seznam.cz>
512 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
513 GetAttributableValue.
515 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
518 * convert.cs (ImplicitConversionRequired): Error message moved to
521 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
522 automatic implicit conversion of an output value.
523 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
525 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
527 (TypeOf.GetAttributableValue): Add extra handling for object type.
529 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
530 special error message.
532 2006-03-25 Marek Safar <marek.safar@seznam.cz>
534 * class.cs (Constructor.Emit): Don't crash when struct ctor is
536 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
537 compatible with MS runtime.
539 2006-03-23 Marek Safar <marek.safar@seznam.cz>
541 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
542 attribute arguments here.
544 * class.cs (Indexer.Define): The check was moved to attribute class.
546 2006-03-21 Marek Safar <marek.safar@seznam.cz>
548 * expression.cs (StringConcat.Append): Reverted back to no warning state.
550 2006-03-21 Marek Safar <marek.safar@seznam.cz>
552 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
554 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
557 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
559 * doc-bootstrap.cs : fix build.
561 2006-03-20 Marek Safar <marek.safar@seznam.cz>
563 * expression.cs (StringConcat.Append): Issue a warning when empty string
566 2006-03-20 Marek Safar <marek.safar@seznam.cz>
568 * assign.cs (CompoundAssign.ResolveSource): Removed.
570 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
573 * class.cs (TypeContainer.FindMethods): Removed.
574 (TypeContainer.CheckMemberUsage): Made static.
576 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
578 * constant.cs (CheckRange): Removed unused type argument.
579 (CheckUnsigned): Removed unused type argument.
581 * cs-parser.jay: Updated after MemberAccess clean up.
582 Uses Length for empty string test.
584 * cs-tokenizer.cs: Uses Length for empty string test.
585 (IsCastToken): Made static.
586 (is_hex): Made static.
587 (real_type_suffix): Made static.
589 * decl.cs (SetupCache): Made static.
590 (OnGenerateDocComment): Removed unused ds argument.
592 * delegate.cs (VerifyDelegate): Removed unused argument.
594 * doc.cs: Uses Length for empty string test.
596 * driver.cs: Uses Length for empty string test.
598 * enum.cs (IsValidEnumType): Made static
600 * expression.cs (EnumLiftUp): Removed unused argument.
601 (ResolveMethodGroup): Ditto.
602 (BetterConversion): Ditto.
603 (GetVarargsTypes): Ditto.
604 (UpdateIndices): Ditto.
605 (ValidateInitializers): Ditto.
606 (MemberAccess.ctor): Ditto.
607 (GetIndexersForType): Ditto.
609 * flowanalysis.cs: (MergeFinally): Removed unused argument.
611 * iterators.cs: Updated after MemberAccess clean up.
613 * location.cs: Uses Length for empty string test.
615 * namespace.cs: Uses Length for empty string test.
617 * report.cs (CheckWarningCode): Made static.
619 * statement.cs (LabeledStatement): Removed unused argument.
621 * typemanager.cs (FilterNone): Removed.
623 2006-03-18 Marek Safar <marek.safar@seznam.cz>
625 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
630 2006-03-18 Marek Safar <marek.safar@seznam.cz>
632 * cs-parser.jay.cs: __arglist is not allowed for delegates.
634 2006-03-18 Marek Safar <marek.safar@seznam.cz>
638 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
640 (AnonymousMethod.ImplicitStandardConversionExists): New method.
641 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
642 Add more error reporting; Fixed issue with params.
644 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
646 * cs-parser.jay: AnonymousMethod requires host container.
648 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
650 2006-03-18 Raja R Harinath <harinath@gmail.com>
652 * class.cs: Change 'TypeContainer ds' constructor argument to
653 'DeclSpace parent'. Some classes were missed below due to
654 different naming convention.
656 * class.cs (MemberCore.Parent): Delete. This makes the
657 ParentContainer changes below enforceable by the compiler.
659 Treat pointers to enclosing declaration space as 'DeclSpace', not
661 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
662 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
664 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
666 (Block.AddThisVariable): Likewise.
667 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
668 (AbstractPropertyEventMethod.Emit): Likewise.
669 (AbstractPropertyEventMethod.EmitMethod): Likewise.
670 (GetMethod.Define, SetMethod.Define): Likewise.
671 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
672 (DelegateMethod.EmitMethod): Likewise.
674 Fix regression test-partial-13.cs.
675 Rationalize use of PartialContainer. Ensure that the partial
676 class semantics can be tied to type-correctness, i.e., any
677 violation will cause a compile error.
678 * class.cs, const.cs: Access all fields that belong to class
679 TypeContainer via ParentContainer. Arguments of EmitContexts and
680 Resolve()-like functions still use 'Parent'.
682 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
683 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
684 (PropertyMethod.CheckModifiers): Remove unused argument.
685 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
688 2006-03-28 Raja R Harinath <rharinath@novell.com>
690 * decl.cs (DeclSpace.LookupGeneric): Update to changes.
692 2006-03-17 Raja R Harinath <harinath@gmail.com>
694 Make semantics of PartialContainer simpler.
695 * decl.cs (DeclSpace.IsPartial): Remove.
696 * class.cs (TypeContainer.IsPartial): Likewise.
697 (TypeContainer..ctor): Set PartialContainer to point to self.
698 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
699 (TypeContainer.FindNestedType): Likewise.
700 (MemberCore.ParentContainer): Simplify. Remove deprecation.
702 2006-03-17 Marek Safar <marek.safar@seznam.cz>
704 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
706 2006-03-15 Marek Safar <marek.safar@seznam.cz>
708 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
711 2006-03-15 Marek Safar <marek.safar@seznam.cz>
713 * class.cs (Operator.Define): An error for base conversion was not
716 2006-03-13 Marek Safar <marek.safar@seznam.cz>
718 A fix for #77593, #77574.
720 * class.cs (MethodCore.CheckBase): Another if for operator.
722 2006-03-18 Marek Safar <marek.safar@seznam.cz>
726 * expression.cs (VerifyArgumentsCompat): Reverted to double error
727 reporting, it's more tricky than I thought.
729 2006-03-09 Marek Safar <marek.safar@seznam.cz>
731 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
734 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
735 (DelegateCreation.ImplicitStandardConversionExists): New method for just
738 * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
741 2006-03-04 Marek Safar <marek.safar@seznam.cz>
745 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
746 (Event.Define): ditto
747 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
749 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
750 Removed redundant code and set NewSlot for Invoke method too.
752 * parameter.cs (Parameters.ctor): Add custom, type ctor.
753 (Parameters.MergeGenerated): New method. Use this method when you merge
754 compiler generated argument with user arguments.
756 2006-03-03 Marek Safar <marek.safar@seznam.cz>
758 * attribute.cs (ResolveAsTypeTerminal): Removed.
760 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
761 specialization for predefined types; 30% speed up.
762 Finally placed obsolete check to right place.
763 (Expression.ResolveType): Removed.
765 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
766 Updated after ResolveType was removed.
768 * expression.cs (Cast.ctor): Check void cast.
769 (Binary.ResolveAsTypeTerminal): Is never type.
770 (Conditional.ResolveAsTypeTerminal): Is never type.
772 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
774 2006-03-26 Marek Safar <marek.safar@seznam.cz>
776 * rootcontext.cs (ResolveCore): Removed System.INullableValue.
778 2006-03-23 Martin Baulig <martin@ximian.com>
780 * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
781 type check if either of the types is an open generic type.
783 2006-03-23 Martin Baulig <martin@ximian.com>
786 (Convert.ExplicitTypeParameterConversion): New method; implement
787 explicit type parameter conversions.
789 2006-03-23 Martin Baulig <martin@ximian.com>
791 * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
792 blindly allow all conversions if we do not have any constraints.
794 2006-02-27 Marek Safar <marek.safar@seznam.cz>
796 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
797 these two separated members to simplify the code.
798 (Attribute.Resolve): Refactored to use new fields and methods.
799 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
800 implemented obsolete attribute checking.
801 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
802 implemented obsolete checking again. It look line never ending quest ;-)
803 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
805 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
807 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
809 *class.cs (Property.Define): Add RegisterProperty call.
811 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
812 argument groups (only 2).
814 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
815 encoding expression to arguments.
816 (Expression.ExprClassToResolveFlags): Just turned to property.
818 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
819 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
820 optimized as well as implemented support for zero-length attributes.
822 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
823 Add caching of PropertyInfo's.
825 2006-02-25 Marek Safar <marek.safar@seznam.cz>
827 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
828 error multiple times.
830 2006-02-25 Marek Safar <marek.safar@seznam.cz>
832 New partial class implementation.
833 A fix for #77027, #77029, #77403
835 * attribute.cs (Attributable): Made attributes protected.
837 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
838 the replacements of ClassPart and PartialContainer.
839 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
840 (TypeContainer.AddInterface): Ditto.
841 (TypeContainer.AddPartial): The main method for partial classes. It checks
842 for errors and merges ModFlags and attributes. At the end class is added to
844 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
846 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
847 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
848 from the rest of partial classes.
849 (TypeContainer.GetClassBases): Simplified.
850 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
852 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
853 (TypeContainer.HasExplicitLayout): Uses Flags now.
854 (PartialContainer): Removed.
855 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
856 (StaticClass): Was merged with Class.
857 (Class.GetClassBases): class and static class bases are verified here.
858 (Class.TypeAttr): Added static attributes when class is static.
859 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
860 (MemberBase): In some cases we need to call parent container for partial
861 class. It should be eliminated but it's not easy now.
863 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
865 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
866 partial classed to accumulate class comments.
867 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
869 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
871 * driver.cs (MainDriver): Tree.GetDecl was removed.
873 * modifiers.cs (Modifiers): Add partial modifier.
875 * tree.cs (Tree.decl): Removed.
876 (RootTypes): Started to use this class more often for root types
879 2006-03-23 Raja R Harinath <rharinath@novell.com>
881 * generic.cs (TypeParameter.UpdateConstraints): Update
882 'constraints' if null.
884 2006-02-22 Marek Safar <marek.safar@seznam.cz>
888 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
889 external interface does not have an attribute.
891 2006-02-22 Marek Safar <marek.safar@seznam.cz>
893 Another prerequisites for new partial classs implementation.
895 * attribute.cs (Attribute.Equal): Implemented.
896 (Attribute.Emit): Changed as attributes can be applied more than twice.
897 (Attributes.Emit): Check for duplicate attributes here.
899 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
900 as a parameter, clean-up.
902 2006-02-11 Marek Safar <marek.safar@seznam.cz>
906 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
907 contains obsolete attribute check which can in some cases look for base
908 type of current class which is not initialized yet.
909 (TypeContainer.BaseType): Replacement of ptype.
911 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
913 2006-02-11 Marek Safar <marek.safar@seznam.cz>
915 First of prerequisites for new partial classs implemention.
917 * attribute.cs (Attributable): Extended by ResolveContext;
918 Attributes finally have correct context for resolving in all cases.
919 (AttachTo): Attribute owner is assigned here.
921 * codegen.cs (IResolveContext): Introduce new interface to hold
922 all information needed in resolving phase.
923 (EmitContext): Implements IResolveContext; more clean-up needed here.
925 * decl.cs (MemberCore): Implemented IResolveContext.
927 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
928 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
929 parameter.cs, statement.cs, tree.cs, typemanager.cs:
930 Refactored to use new IResolveContext instead of EmitContext; cleanup
932 2006-03-22 Raja R Harinath <rharinath@novell.com>
934 Support ParameterDefaultValueAttribute in gmcs. Also applied to
935 mcs to keep code differences small.
936 * attribute.cs (Attribute.GetParameterDefaultValue): New.
937 * typemanager.cs (parameter_default_value_attribute_type): New.
938 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
941 2006-03-22 Martin Baulig <martin@ximian.com>
944 (Nullable.NullableLiteral): Derive from `NullLiteral'.
947 (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
948 instead of the normal `NullLiteral'.
950 2006-03-21 Martin Baulig <martin@ximian.com>
953 * generic.cs (TypeManager.InferType): If `pt' is a generic
954 parameter, don't check whether `pt == at'.
956 2006-03-20 Raja R Harinath <rharinath@novell.com>
959 * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
960 (TypeParameter.Resolve): Update to change.
961 (ConstraintChecker.CheckConstraints): Resolve type-argument
962 constraints before use.
964 2006-03-16 Martin Baulig <martin@ximian.com>
967 (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
968 and don't have any instance constructors, also lookup in the base class.
969 (TypeManager.IsNullableValueType): New public method.
971 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
972 `BindingFlags.DeclaredOnly' flag and set `used_cache'.
973 (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
975 * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
976 instead of just TypeManager.IsNullableType() to determine whether
977 a lifted operator exists.
978 (UnaryMutator.DoResolve): Likewise.
979 (Conditional.DoResolve): Likewise.
980 (Binary.DoResolve): A lifted operator only exists if both operands
981 are valuetypes and at least one of them is a nullable type.
983 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
985 * iterator.cs : yield break is allowed in try statement which has
986 catch clauses. Fixed bug #77767.
988 2006-03-12 Martin Baulig <martin@ximian.com>
990 * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
991 private IsSignatureEqual() to compare types; see the comment in
992 that method; fixes #77674.
994 2006-03-10 Raja R Harinath <rharinath@novell.com>
996 * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
997 (Expression.ResolveAsTypeTerminal): Likewise.
998 * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
999 * expression.cs, generic.cs, iterators.cs: Likewise.
1000 * parameter.cs, statement.cs, typemanager.cs: Likewise.
1002 2006-03-09 Martin Baulig <martin@ximian.com>
1004 * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
1005 TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
1007 2006-03-09 Martin Baulig <martin@ximian.com>
1009 * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
1010 `prepared' flag is set.
1012 * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
1013 (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
1014 issues; see gtest-254.cs.
1016 2006-03-07 Martin Baulig <martin@ximian.com>
1018 * generic.cs (TypeManager.InferType): Allow infering
1019 `IEnumerable<T>' with an array of T; see gtest-251.cs.
1021 2006-03-06 Martin Baulig <martin@ximian.com>
1024 (TypeManager.InferType): Fix gtest-250.cs.
1027 (TypeManager.IsSubclassOf): Also check the base class.
1030 (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
1033 2006-03-01 Raja R Harinath <rharinath@novell.com>
1036 * expression.cs (ParameterReference.DoResolveBase): Change return
1038 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
1042 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
1045 * typemanager.cs (GetFullNameSignature): Don't nullref on
1046 protected accessors.
1048 2006-02-16 Martin Baulig <martin@ximian.com>
1051 (TypeManager.GetGenericFieldDefinition): New public method; use it
1052 instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
1054 2006-02-14 Martin Baulig <martin@ximian.com>
1056 * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
1058 2006-02-14 Martin Baulig <martin@ximian.com>
1061 (TypeManager.DropGenericMethodArguments): New public method; don't
1062 use GetGenericMethodDefinition() on something which is not a
1065 2006-02-14 Martin Baulig <martin@ximian.com>
1068 (ConstraintChecker.CheckConstraints): If a type parameter has the
1069 `struct' constraint, the type must be a non-nullable valuetype.
1071 2006-02-10 Martin Baulig <martin@ximian.com>
1074 (TypeManager.IsOverride): Make this work for instantiated methods
1075 in a generic class; fixes #77509.
1076 (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
1077 rather than calling it directly; fixes #77488.
1079 2006-02-08 Martin Baulig <martin@ximian.com>
1081 * generic.cs (ConstraintChecker.CheckConstraints): Move the error
1082 reporting into CheckConstraint() so we can use the correctly
1085 2006-02-08 Martin Baulig <martin@ximian.com>
1087 * expression.cs (BaseAccess): Add support for generic methods.
1089 * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
1090 the new MethodGroupExpr.
1092 2006-02-07 Martin Baulig <martin@ximian.com>
1094 * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
1095 also reference types; fixes #77483.
1097 2006-02-07 Martin Baulig <martin@ximian.com>
1100 (TypeManager.IsGenericMethod): We now return whether something is
1101 an instantiated generic method (and not a generic method def).
1102 (TypeManager.IsGenericMethodDefinition): New public method.
1105 (TypeManager.CSharpSignature): Only include type arguments for
1106 "real" generic methods, not for any instantiated method.
1107 (TypeManager.GetMethodName): Likewise, but also allow generic
1108 method definitions here.
1110 2006-02-06 Miguel de Icaza <miguel@novell.com>
1112 * codegen.cs (EmitScopeInitFromBlock): check here the
1113 capture_context, there is no need to make two calls to the
1116 * anonymous.cs: Add some debugging messages that might help me
1117 track other instances of this problem in the future (the
1118 regression of test 467).
1120 * cs-parser.jay: track the variable block, as we need to initalize
1121 any captured variables declared in this block for the "catch"
1122 portion of the "Try" statement.
1124 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
1125 scope initialization for captured variables.
1127 Also, move the emit for the variables after the block location has
1130 2006-02-06 Marek Safar <marek.safar@seznam.cz>
1132 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
1134 2006-02-06 Martin Baulig <martin@ximian.com>
1136 * class.cs (TypeContainer.DefineType): If we're a struct, pass
1137 `TypeManager.value_type' as parent type to
1138 ModuleBuilder.DefineType(). Fixes #77358.
1140 2006-02-02 Miguel de Icaza <miguel@novell.com>
1142 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
1143 commit yesterday, the initialization for the roots is necessary.
1144 What is not necessary is the scope activation.
1146 2006-02-02 Raja R Harinath <rharinath@novell.com>
1148 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
1149 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
1151 (Argument.Resolve): Remove CS0206 checks.
1153 2006-02-01 Miguel de Icaza <miguel@novell.com>
1155 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
1156 scopes for all the roots, the scopes will now be emitted when the
1157 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
1159 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
1160 code. This reduces a lot of existing cruft.
1162 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
1163 that the ScopeInfo is generated as we enter the scope, not at the
1164 time of use, which is what we used to do before.
1166 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
1167 every time a Block is about to be emitted if we have a
1170 2006-02-01 Raja R Harinath <rharinath@novell.com>
1172 * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
1173 attribute for mscorlib too.
1175 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
1177 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
1179 * typemanager.cs (cons_param_array_attribute): Make private.
1180 (Reset): Set it to null.
1181 (InitCoreHelpers): Don't initialize it.
1182 (ConsParamArrayAttribute): New. Initialize it as needed.
1183 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
1185 2006-01-31 Miguel de Icaza <miguel@novell.com>
1187 * expression.cs: There might be errors reported during the
1188 selection of applicable methods. If there are errors, do not
1189 continue execution as it will lead the compiler to crash.
1191 2006-01-30 Miguel de Icaza <miguel@novell.com>
1193 * expression.cs: Member access is not allowed on anonymous
1194 methods. Fixes #77402.
1196 2006-01-30 Raja R Harinath <rharinath@novell.com>
1199 * cs-parser.jay (VariableDeclaration): Don't set
1200 current_array_type to null.
1201 (field_declaration, event_declaration, declaration_statement):
1202 Set it to null here.
1204 2006-01-29 Raja R Harinath <harinath@gmail.com>
1207 * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
1209 2006-01-28 Raja R Harinath <harinath@gmail.com>
1211 * typemanager.cs (GenericParameterPosition): New.
1214 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
1216 * doc.cs : To process "include" elements, first we should create
1217 another list than XmlNodeList, because it could result in node
1218 removal, which could result in that the XmlNodeList gives up
1221 2006-01-25 Miguel de Icaza <miguel@novell.com>
1223 * expression.cs: Introduce an error report that we were not
1224 catching before. Gonzalo ran into it.
1226 2006-01-23 Miguel de Icaza <miguel@novell.com>
1228 A fix for bug: #76957
1230 * iterators.cs (MoveNextMethod.CreateMethodHost): call
1231 ComputeMethodHost before creating the method, this is a new
1234 * anonymous.cs (AnonymousContainer): Now we track all the scopes
1235 that this method references (RegisterScope). The actual scope
1236 where the method is hosted is computed with the ComputeMethodHost
1237 before we create the method.
1239 Moved the Deepest routine here.
1241 (AnonymousContainer.ComputeMethodHost): New routine used to
1242 compute the proper ScopeInfo that will host the anonymous method.
1244 (ScopeInfo): Deal with multiple roots. The problem was that we
1245 did not have a unique root where all ScopeInfos could be hanged
1246 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
1249 Remove AdjustMethodScope which is now computed at the end. Remove
1250 LinkScope which did a partial link, instead link all ScopeInfos
1251 before code generation from the new "LinkScopes" routine.
1253 Simplify all the Add* routines as they no longer need to maintain
1254 the tree, they just need to record that they are using variables
1257 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1258 routines to produce the forest of ScopeInfo trees.
1260 * class.cs (TypeContainer.AppendMethod): This is just like
1261 AddMethod, but ensures that an interface implementation method
1262 (IEnumerable.XXX) is not inserted at the beginning of the queue of
1263 methods, but at the end.
1265 We use this functionality to ensure that the generated MoveNext
1266 method in the iterator class is resolved/emitted before the
1267 enumerator methods created.
1269 This is required because the MoveNext method computes the right
1270 ScopeInfo for the method. And the other methods will eventually
1271 need to resolve and fetch information computed from the anonymous
1275 2006-01-23 Raja R Harinath <rharinath@novell.com>
1277 Improve implementation of section 14.4.2.2 (Better function member).
1278 * expression.cs (Invocation.MoreSpecific): Compare all type
1279 arguments before deciding if one type is more specific than
1280 another. Handle array types too. Return the more specific type.
1281 (Invocation.BetterFunction): Add more tie-breaking rules from
1282 section 14.4.2.2. Perform "more specific" check after
1283 other tie-breaking rules. Compare all parameter types before
1284 choosing the "more specific" method.
1286 2006-01-21 Raja R Harinath <harinath@gmail.com>
1287 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1290 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
1292 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
1293 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
1295 2006-01-18 Martin Baulig <martin@ximian.com>
1297 * class.cs (TypeContainer.AddToMemberContainer): Use
1298 `symbol.MemberName.MethodName' instead of just `symbol.Name';
1301 2006-01-18 Martin Baulig <martin@ximian.com>
1303 Fix #76417: a generic class may now have methods which may unify
1304 for some type parameter substitutions.
1306 * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
1307 for methods which may unify anymore.
1309 * expression.cs (Invocation.MoreSpecific): New private static
1310 method; checks whether one method is more specific than another
1311 according to 14.4.2.2 of the spec.
1312 (Invocation.BetterFunction): Implement the tie-breaking rules from
1313 14.4.2.2 of the spec: if two methods unify for some type parameter
1314 substitution, we need to pick the more specific one.
1316 2006-01-18 Raja R Harinath <rharinath@novell.com>
1318 Fix #76656, cs0231-2.cs.
1319 * cs-parser.jay (formal_parameter_list): Make error case catch
1321 (parenthesized_expression_0): Add CS1026 check.
1322 (invocation_expression): Remove unused { $$ = lexer.Location }.
1324 2006-01-17 Raja R Harinath <rharinath@novell.com>
1327 * cs-parser.jay (statement_expression): Don't list out the
1328 individual statement-expressions. Convert syntax error into
1331 2006-01-16 Raja R Harinath <rharinath@novell.com>
1334 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
1335 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
1336 CheckIntermediateModification.
1337 (FieldExpr.DoResolve): Add new two-argument version that
1338 allows us to resolve the InstanceExpression as an lvalue.
1339 The one-argument variant is now just a wrapper.
1340 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
1341 Resolve the lhs as an lvalue if the it has a value type.
1342 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
1343 from Assign.DoResolve.
1344 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
1345 resolved as an lvalue.
1346 (PropertyExpr.DoResolve): Update.
1347 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
1348 has a value type. Move CS1612 check here from
1349 CheckIntermediateModification.
1350 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
1351 * expression.cs (EmptyExpression.OutAccess): New. Used as the
1352 'right_side' of a ResolveLValue on an 'out' argument.
1353 (EmptyExpression.LValueMemberAccess): New. Used as the
1354 'right_side' of a propagated ResolveLValue on a value type.
1355 (LocalVariableReference.DoResolveBase): Recognize
1356 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
1358 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
1359 EmptyExpression.Null.
1361 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
1363 * typemanager.cs : added IsGenericParameter(). In gmcs it returns
1364 Type.IsGenericParameter(). Fixed bug #77183.
1365 * doc.cs : it is now identical to doc.cs in mcs.
1367 2006-01-16 Martin Baulig <martin@ximian.com>
1369 * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
1371 2006-01-16 Martin Baulig <martin@ximian.com>
1373 * typemanager.cs (TypeManager.CSharpSignature): Make this work for
1374 ctors; fixes #77250.
1376 2006-01-12 Miguel de Icaza <miguel@novell.com>
1378 This fixes the problem where we used ldfld instead of ldflda to
1379 load the "THIS" pointer on captured parameters, when THIS is a
1380 value type. See bug #77205.
1382 * iterators.cs (CapturedThisReference.Emit): Pass false to
1383 EmitThis (we do not need the address).
1385 * codegen.cs (EmitThis): it needs to know whether we need the
1386 address of `this' or not. This is used by value types.
1388 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
1389 every other call passes false.
1391 2006-01-12 Raja R Harinath <rharinath@novell.com>
1394 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
1396 * expression.cs (Invocation.OverloadResolve): Update.
1397 (Invocation.DoResolve): Avoid double resolution of invocation.
1399 2006-01-11 Raja R Harinath <rharinath@novell.com>
1402 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
1403 unary negation of floating point types as 0-expr; negation cannot
1404 overflow in floating point types.
1407 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
1408 on operands of 'void' type.
1411 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
1412 and ExclusiveOr for boolean constants too.
1414 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
1416 * expression.cs: Fix Console.WriteLine ((this = x).foo);
1418 2006-01-12 Miguel de Icaza <miguel@novell.com>
1420 * cs-tokenizer.cs (Position): New class used to save and restore
1421 the position state in the tokenizer. Before this patch the save
1422 and restore was not complete enough so the line and columns would
1423 start to drift and the debugger and stack traces will get the
1426 2006-01-10 Martin Baulig <martin@ximian.com>
1429 (TypeParameter.InflateConstraints): New public method.
1431 * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
1432 constraints; fixes #77042.
1434 2006-01-10 Martin Baulig <martin@ximian.com>
1436 * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
1437 instead of the `TypeBuilder' for this "<>THIS" variable; fixes
1440 2006-01-09 Raja R Harinath <rharinath@novell.com>
1443 * expression.cs (Invocation.OverloadResolve): Replace reflected
1444 override methods with their base virtual methods, rather than
1446 * typemanager.cs (TypeManager.GetOverride): New.
1448 2005-12-21 Miguel de Icaza <miguel@novell.com>
1450 * driver.cs: Report the case of no source files and no -out:
1453 2005-12-20 Raja R Harinath <rharinath@novell.com>
1456 * expression.cs (ComposedCast.GetSignatureForError): Define.
1458 2006-01-05 Jb Evain <jbevain@gmail.com>
1460 * class.cs (Property.Define, Indexer.Define): do not tag the
1461 properties as SpecialName | RTSpecialName.
1463 2006-01-04 Miguel de Icaza <miguel@novell.com>
1465 * class.cs (MethodCore.IsDuplicateImplementation): This method was
1466 doing a low-level comparission of parameter types. It was lacking
1467 a check for __argslist.
1469 2005-12-30 Miguel de Icaza <miguel@novell.com>
1471 * expression.cs (ParameterReference.DoResolveBase): Allow
1472 reference parameters if they are local to this block.
1474 This allows the ref and out parameters of a delegate to be used in
1475 an anonymous method, for example:
1477 delegate void set (out int x);
1479 set s = delegate (out int x){
1483 This is used by functionality introduced late in the C# language.
1485 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1486 method that take ref and out parameters.
1488 Fixes #77119 which was a late change in the spec.
1490 2005-12-23 Miguel de Icaza <miguel@novell.com>
1492 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1493 parent if its the same scope. Fixes #77060.
1495 2005-12-22 Marek Safar <marek.safar@seznam.cz>
1497 * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
1499 2005-12-21 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1501 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
1502 errors 1726 for strong named assemblies with InternalsVisibleToAttribute
1503 that doesn't contain the full public key. This is a update of the
1504 friend assemblies in .Net 2.0 release.
1506 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1510 * namespace.cs (NamespaceEntry): Add extern_aliases as a
1511 ListDictionary, to contain the ExternAliasEntry entries (in
1512 addition to the NamespaceEntry.aliases hashtable). This field is
1513 shared between the original entry and its doppelganger (bodyless
1515 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1516 extern_aliases field.
1517 (NamespaceEntry.Lookup): Move the IsImplicit check after the
1518 lookup in extern_aliases.
1520 2005-12-16 Raja R Harinath <rharinath@novell.com>
1523 * class.cs (TypeContainer.Mark_HasEquals): New.
1524 (TypeContainer.Mark_HasGetHashCode): New.
1525 (ClassPart): Override them.
1526 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1528 * generic.cs (GenericMethod.DefineMembers): Update to changes.
1529 (TypeParameter.TypeParameter): Change type of 'parent' argument to
1533 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1534 'parent' argument to the base constructor.
1536 Remove all mention of TypeContainer from decl.cs.
1537 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1538 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1539 (DeclSpace.DeclSpace): Likewise.
1540 (DeclSpace.DefineMembers): Remove unused argument.
1541 * cs-parser.jay (pop_current_class): Update to changes. Simplify
1542 debugging check -- we don't care if the debug code throws an
1543 InvalidCastException instead of an InternalErrorException.
1544 * class.cs (TypeContainer.DefineMembers): Update to changes.
1545 (TypeContainer.DoDefineMembers): Likewise.
1546 (TypeContainer.GetMethods): Likewise.
1547 (PropertyMember.Define): Likewise.
1548 (MemberBase.Parent): New property that forwards to
1549 MemberCore.Parent, but ensures that we get a TypeContainer.
1550 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1551 (RootContext.PopulateTypes): Likewise. Remove special case code
1552 for !RootContext.StdLib: DefineMembers is idempotent.
1554 2005-12-13 Marek Safar <marek.safar@seznam.cz>
1556 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1558 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
1560 * doc.cs : The search for referenced namespace was insufficient to
1561 get global one as it used to do. Fixed bug #76965.
1563 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
1565 * doc.cs : check name in cref in the last phase that whether it is
1568 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1570 * cs-tokenizer.cs : reverted the latest change: it somehow broke
1573 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1575 * doc.cs : so it turned out that we cannot skip override check for
1576 interface members. Fixed bug #76954.
1578 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1580 * cs-tokenizer.cs : fixed bug #75984:
1581 - #warning and #error should not be handled when the source line
1583 - #line is not checked strictly when the source line is disabled.
1584 - #define and #undef is on the other hand checked strictly at any
1587 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
1589 * cs-tokenizer.cs : missing Location (actually, filename) in one of
1592 2005-12-15 Raja R Harinath <rharinath@novell.com>
1594 * generic.cs (TypeManager.IsGeneric): Remove unused method.
1596 * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
1599 2005-12-14 Martin Baulig <martin@ximian.com>
1601 * typemanager.cs (TypeManager.GetFullName): Make this public;
1602 `Type.Fullname' now never returns null.
1604 * class.cs (Method.Define): Use TypeManager.GetFullName() for
1605 explicit interface implementations; we're now using the same
1606 naming convention than csc does.
1608 2005-12-14 Miguel de Icaza <miguel@novell.com>
1610 * convert.cs (ExplicitConversionCore): Check the return value from
1611 ExplicitConversionCore which can return null on failure. Fixes #76914
1613 2005-12-09 Raja R Harinath <rharinath@novell.com>
1615 * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
1616 instead of IsGenericInstance.
1617 * generic.cs (TypeManager.IsEqual): Likewise. Delete redundant
1618 code that's now covered by the more general test.
1619 * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
1621 * generic.cs (DropGenericTypeArguments): New. Captures the common
1622 pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
1623 * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
1624 * generic.cs, report.cs, typemanager.cs: Likewise.
1626 2005-12-08 Martin Baulig <martin@ximian.com>
1628 * generic.cs (TypeArguments.Resolve): Added CS1547 check.
1630 * typemanager.cs (TypeManager.CSharpSignature): Include type
1631 arguments in the signature of a generic method.
1633 2005-12-07 Martin Baulig <martin@ximian.com>
1635 Add support for custom attributes on type parameters.
1637 * cs-parser.jay (type_arguments): Added `opt_attributes'.
1639 * generic.cs (TypeParameterName): New public class; we use this
1640 instead of a `string' to store the name of a type parameter, so we
1641 can also have `Attributes'.
1642 (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
1643 array instead of a `string[]' array.
1644 (TypeParameter.ctor): We now also take an `Attributes' argument.
1645 (TypeParameter.EmitAttributes): New public method; emit our
1646 `OptAttributes' here.
1647 (GenericMethod.EmitAttributes): New public method; emit the custom
1648 attributes on all our type parameters.
1650 * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
1651 our type parameters.
1652 (MethodData.Define): If we're a generic method, call
1653 EmitAttributes() on it.
1655 2005-12-07 Martin Baulig <martin@ximian.com>
1658 (ConstraintChecker): New public abstract class; move the
1659 constraint checking here from `ConstructedType' and also do
1660 constraint checking for generic methods here.
1662 * expression.cs (Invocation.OverloadResolve): Use
1663 ConstraintChecker.CheckConstraints() if we resolved to a generic
1666 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1668 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1670 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1672 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1673 (FieldBase.Initializer): Initializer is now optional.
1674 (EventField.Define): Only event field can have initializer.
1676 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1678 * const.cs (Const): Reuse initializer.
1680 * cs-parser.jay: Updated after FieldBase changes.
1681 Added current_array_type to simplify array initializers.
1683 * ecore.cs (NullCast.IsDefaultValue): Implemented.
1685 * expression.cs, iterators.cs: Updated.
1687 * namespace.cs (NamespaceEntry): Made UsingFound private.
1689 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1691 * parameterCollection.cs: Obsolete, removed.
1692 * parser.cs: Obsolete, removed.
1694 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1697 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1699 * enum.cs (Enum.Define): Set obsolete context here.
1701 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
1704 - FindDocumentedMember() now expects 1) paramList as null
1705 when "we don't have to check the number of parameters" and
1706 2) Type.EmptyTypes when "there is no arguments".
1707 - Introduced FoundMember struct to hold the exact type which was
1708 used to find the documented member (the above change broke
1709 test-xml-044; it might be better just to use DeclaringType than
1710 what MS does, like this change does, but it depends on usage.)
1712 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
1714 * doc.cs : documented member might be from DeclaringType for nested
1715 types. Fixed bug #76782.
1717 2005-12-03 Ben Maurer <bmaurer@ximian.com>
1719 * anonymous.cs: Have the param code handle leaving copies on the
1720 stack etc. Allows anonymous params to take part in the assignment
1721 code (++, +=, etc). Fixes bug #76550
1723 * expression.cs: Handle the prepare_for_load/leave_copy by passing
1724 it down to the anon code.
1726 * iterators.cs: Use dummy var here
1728 * codegen.cs: Handle new vars
1730 2005-12-01 Marek Safar <marek.safar@seznam.cz>
1733 * class.cs (MethodData.Define): Set proper Obsolete context.
1735 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1737 (FieldExpr.DoResolve): Ditto.
1739 2005-12-01 Marek Safar <marek.safar@seznam.cz>
1742 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1743 parent is not obsolete.
1745 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
1747 * doc.cs : (FindDocumentedMember) find parameterless members first
1748 and get CS0419 in the early stage. Fixed first case of bug #76727.
1750 2005-11-30 Marek Safar <marek.safar@seznam.cz>
1753 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1754 no error was reported.
1756 *expression.cs (Binary.DoResolve): left can be null.
1758 2005-12-06 Raja R Harinath <rharinath@novell.com>
1760 * class.cs (MethodCore.CheckGenericOverride): Delete unused
1761 abstract method and all overrides.
1762 * support.cs (ParameterData.GenericConstraints): Delete.
1763 (ReflectionParameters.type_params): Delete.
1764 (ReflectionParameters.ReflectionParameters): Make private.
1765 (ReflectionParameters.GetConstaints): New factory method.
1766 * generic.cs (TypeParameterDefineType): Use it.
1767 (TypeManager.GetTypeParameterConstraints): Likewise.
1769 2005-11-22 Marek Safar <marek.safar@seznam.cz>
1772 * class.cs (MethodData.Emit): Parameters should be labeled first.
1774 2005-11-21 Marek Safar <marek.safar@seznam.cz>
1777 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1779 2005-11-18 Marek Safar <marek.safar@seznam.cz>
1781 * attribute.cs (AreParametersCompliant): Moved to Parameter.
1783 * class.cs (MethodCore): Parameter clean up.
1784 (IMethodData): Added ParameterInfo.
1785 (MethodData): Parameter clean up.
1786 (Indexer.Define): Parameter clean up.
1798 * typemanager.cs: Parameter clean up.
1800 * delegate.cs (Define): Get rid of duplicated code.
1802 * expression.cs (ParameterReference): Removed useless parameters
1804 (Invocation): Ditto.
1806 * parameter.cs (ParamsParameter): New class, params specialization.
1807 (ArglistParameter): Attemp to separate arglist.
1808 (Parameter): Refactored to be reusable and faster.
1809 (Parameter.Modifier): Made understandable.
1810 (Parameters): Changed to be used as a class for `this' assembly
1811 parameters. Refactored to use new specialized classes.
1813 * support.cs (ParameterData): Added Types property.
1814 (InternalParameters): Deleted.
1816 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1818 * doc.cs : the previous patch does not actually fix the bug.
1819 PropertyInfo override check is now implemented and really fixed it.
1820 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
1822 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1824 * doc.cs : apply "override filter" also to properties.
1827 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1829 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
1830 no need to check overrides. For classes, omit those results from
1831 interfaces since they must exist in the class. Fixed bug #76726.
1833 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1835 * typemanager.cs : (GetFullNameSignature) differentiate indexers
1836 with different parameters. Fixed the second problem in #76685.
1838 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1840 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
1841 get expected 'protected' access in CheckValidFamilyAccess()).
1844 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1846 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
1847 Fixed bug #76705. CS1569 was incorrectly commented out.
1849 2005-11-23 Martin Baulig <martin@ximian.com>
1851 * generic.cs (Constraints.Define): Removed.
1852 (TypeParameter.DefineConstraints): Removed.
1853 (TypeParameter.DefineType): Call SetGenericParameterAttributes()
1854 on the GenericTypeParameterBuilder here.
1856 2005-11-23 Martin Baulig <martin@ximian.com>
1858 * typemanager.cs (TypeManager.GetProperty): Make this public.
1860 * generic.cs (Nullable.NullableInfo.ctor): Use
1861 TypeManager.GetProperty() rather than using reflection directly.
1863 2005-11-17 Martin Baulig <martin@ximian.com>
1865 * expression.cs (Indexers.GetIndexersForType): Added support for
1866 generic parameters; fixes #76587.
1868 2005-11-17 Martin Baulig <martin@ximian.com>
1871 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
1872 inherit the scope from our parent. Fixes #76653.
1874 2005-11-15 Martin Baulig <martin@ximian.com>
1876 * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
1877 instead of `ScopeTypeBuilder' to refer to the "current" type.
1878 (AnonymousMethod.CreateScopeType): Correctly create the helper
1879 class if we're inside a generic type definition.
1881 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
1883 * doc.cs : use Invocation.IsOverride() to do real override check.
1884 * expression.cs : made Invocation.IsOverride() internal.
1886 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
1888 * doc.cs : use TypeManager.FindMembers() instead of (possible)
1889 TypeBuilder.FindMembers() and filter overriden base members out.
1892 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1894 * doc.cs : ref/out parameters are represented as '@' (instead of
1895 '&' in type FullName). Fixed bug #76630 (additionally crefs).
1897 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1899 * doc.cs : when there was no '.' in cref to methods in doc comment,
1900 then parameters were missing in the output. Fixed bug #76691.
1902 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1904 * driver.cs : don't output docs when there is an error.
1907 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1910 Now it should detect indexers. Fixed primary concern in bug #76685.
1911 Fixed CS0419 message to not show the identical member signature in
1914 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1916 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
1917 instead of Type.FindMembers() since it does not handle events.
1920 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
1922 * codegen.cs: Fixed typo (speficied -> specified).
1924 2005-11-11 Marek Safar <marek.safar@seznam.cz>
1927 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
1929 2005-11-11 Marek Safar <marek.safar@seznam.cz>
1931 * attribute.cs: Changed error message.
1933 * cs-tokenizer.cs: One more check.
1935 2005-11-10 Marek Safar <marek.safar@seznam.cz>
1937 * statement.cs (Block.Resolve): Ignore empty statement.
1939 2005-11-10 Marek Safar <marek.safar@seznam.cz>
1941 * report.cs: Made error/warning methods more strict to avoid
1944 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
1945 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
1946 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
1947 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
1949 2005-11-11 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1951 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute):
1952 Use the more explicit AssemblyName.FullName instead of
1953 AssemblyName.Name to report errors.
1955 2005-11-11 Marek Safar <marek.safar@seznam.cz>
1957 * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
1960 2005-11-10 Marek Safar <marek.safar@seznam.cz>
1970 * report.cs: Fixed error reporting and typos.
1972 * generic.cs (TypeParameter.GetSignatureForError): New method.
1973 (ConstructedType.GetSignatureForError): Instead of DeclarationName.
1975 * typemanager.cs (GetFullName): Refactored.
1977 2005-11-08 Marek Safar <marek.safar@seznam.cz>
1979 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
1980 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
1982 * class.cs (TypeContainer.IsComImport): New property.
1983 (Constructor.Define): Create proper ctor for ComImport types.
1985 * expression.cs (New.CheckComImport): Fixed.
1987 2005-11-07 Miguel de Icaza <miguel@novell.com>
1989 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
1990 that a parameter has been captured does not mean that we do not
1991 have to do the rest of the processing. This fixes the second part
1992 of #76592. If there was another anonymous method capturing
1993 values in the past, the Scope would never be set for the second
1994 method that captured the same parameter.
1996 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
1997 properly manipulate the stack. Second part of fix for #76592.
1999 * expression.cs (New): Add support for invoking "new" on
2000 interfaces that have been flagged with the ComImport attribute and
2001 the CoClass. Fixes #76637
2003 * statement.cs (Try.DoEmit): When a variable is captured, do not
2004 try to emit the vi.LocalBuilder variable as it has been captured.
2005 Create a temporary variable and store the results on the
2006 FieldBuilder. Fixes #76642
2008 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2010 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
2012 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
2014 * expression.cs (Binary.DoResolve): Added && optimalization.
2016 * typemanager.cs (AddUserType): Removed useless argument.
2018 2005-11-04 Marek Safar <marek.safar@seznam.cz>
2020 * statement.cs (Block.variables): Uses ListDictionary.
2022 2005-11-03 Marek Safar <marek.safar@seznam.cz>
2025 * class.cs (PartialContainer.EmitType): Customized to emit
2026 security attributes.
2027 (ClassPart.ApplyAttributeBuilder): Transform security attribute
2028 for partial classes.
2030 2005-11-03 Marek Safar <marek.safar@seznam.cz>
2033 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
2034 access has to be fixed.
2036 * typemanager.cs (IsUnmanagedType): Wrong common field type.
2038 2005-11-01 Marek Safar <marek.safar@seznam.cz>
2041 * ecore.cs (NullCast.Reduce): Implemented.
2043 * expression.cs (ArrayCreation.CheckIndices): Correcly check
2046 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
2048 (Foreach.Resolve): Catch null properly.
2050 2005-10-29 Marek Safar <marek.safar@seznam.cz>
2052 * cs-tokenizer.cs: Warning text fix.
2054 * driver.cs: AllWarningNumbers exposed on public interface.
2056 * report.cs (): Reviewed warning numbers.
2057 (IsValidWarning): Use binary search.
2059 2005-10-29 Marek Safar <marek.safar@seznam.cz>
2061 * driver.cs: Implemeted resource visibility.
2062 (Resources): New class for code sharing between /res: and
2065 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2067 decl.cs (CurrentTypeParameters): Fixed to be public.
2069 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2071 generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
2073 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2075 gmcs.exe.sources: Use CryptoConvert.cs from corlib.
2077 2005-11-05 Kornél Pál <kornelpal@hotmail.com>
2079 * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
2081 2005-11-04 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2083 Add friend assembly access support.
2084 * typemanager.cs: assembly_internals_vis_attrs
2085 cache for friend assembly access.
2086 (TypeManager.IsFriendAssembly): New method for
2087 checking friend assembly access.
2088 (TypeManager.Error_FriendAccessNameNotMatching): New
2090 (TypeManager.CompareKeyTokens): Likewise.
2091 (TypeManager.Filter): Handle friend accessible
2094 * namespace.cs (RootNamespace.GetTypeInAssembly): Return
2095 friend accessible types.
2097 * ecore.cs (Expression.IsAccessorAccessible): Handle
2098 friend accessible properties.
2100 * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
2103 2005-10-28 Marek Safar <marek.safar@seznam.cz>
2106 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
2109 * convert (Convert.ImplicitReferenceConversion): NullCast holds
2112 * ecore.cs (NullCast): Child is contant only.
2114 * literal.cs (NullLiteral.Reduce): null can be converted to any
2117 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
2119 * driver.cs: Use Encoding.Default as default code page instead
2122 2005-10-27 Raja R Harinath <rharinath@novell.com>
2125 * expression.cs (Invocation.Error_InvalidArguments): Handle
2126 __arglist parameters.
2127 (Invocation.VerifyArgumentsCompat): Likewise.
2128 * support.cs (ReflectionParameters.GetSignatureForError): Print
2129 __arglist parameters.
2130 (InternalParamters.GetSignatureForError): Likewise.
2131 * parameter.cs (Parameters.GetSignatureForError): Likewise.
2133 2005-10-26 Marek Safar <marek.safar@seznam.cz>
2135 * attribute.cs (GetPropertyValue): Made public.
2137 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
2139 Add new property WrapNonExceptionThrows to handle 2.0 assembly
2141 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
2144 * driver.cs: Reflect method name change.
2146 * statement.cs (Try.Resolve): Warn when try has both general
2149 * typemanager.cs: runtime_compatibility_attr_type new predefined
2152 2005-10-26 Raja R Harinath <harinath@gmail.com>
2155 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
2156 treat it as an empty parameter list.
2158 2005-10-26 Raja R Harinath <rharinath@novell.com>
2161 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
2162 ResolveAsTypeStep silent.
2163 * statement.cs (Block.AddConstant): Mark block as used.
2164 (Block.ResolveMeta): Avoid piling on error messages
2165 if a constant initializer resolution fails.
2167 2005-10-25 Raja R Harinath <rharinath@novell.com>
2169 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
2171 (NamespaceEntry.VerifyAllUsing): New.
2172 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
2173 behaviour. Delegates actual resolution of alias to ...
2174 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
2175 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
2177 * driver.cs (Driver.MainDriver): Update.
2179 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
2180 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
2182 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
2184 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
2185 RootNamespace.DefineNamespacesForAll.
2187 2005-10-24 Raja R Harinath <harinath@gmail.com>
2189 * typemanager.cs (assemblies, external_aliases, modules)
2190 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
2191 (ComputeNamespaces, GetRootNamespace): Remove extra staging
2192 overhead. Move resposibility ...
2193 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
2194 * driver.cs, attribute.cs, codegen.cs: Update to changes.
2196 2005-10-23 Raja R Harinath <harinath@gmail.com>
2198 * namespace.cs (RootNamespace.all_namespaces): Renamed from
2199 cached_namespaces. Improve usage.
2200 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
2201 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
2202 Move from GlobalRootNamespace and simplify.
2203 (RootNamespace.Global): Make instance variable.
2204 (RootNamespace.RootNamespace): Add "alias name" parameter.
2205 (GlobalRootNamespace): Simplify drastically.
2206 (Namespace.Lookup): Don't use GetNamespace.
2207 * typemanager.cs (GetRootNamespace): Rename from
2208 ComputeNamespaceForAlias.
2209 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2211 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2213 * anonymous.cs (AnonymousContainer): Don't crash when container
2216 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2218 * expression.cs (Binary.DoResolve): Warn when comparing same
2221 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2224 * expression.cs (Binary.DoResolve): It looks like there are no
2225 convetsion rules in enum context.
2227 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2229 Add support for extern alias qualifiers.
2230 * typemanager.cs: Move some LookupTypeReflection code
2231 to namespace.cs, to have cleaner code. Added some methods
2232 to help us keep track of the extern aliased references.
2233 * driver.cs: Add suport for extern alias assemblies on command
2234 line and check for their warnings/errors. Also keep track of the
2235 extern aliased assemblies.
2236 * namespace.cs: Move the global functionality of Namespace
2237 to GlobalRootNamespace/RootNamespace. Now the global namespace
2238 is GlobalRootNamespace.Globa. Also the code moved from
2239 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
2240 Finally added LocalAliasEntry (AliasEntry before) and
2241 ExternAliasEntry, to handle alias statements.
2242 * cs-parser.jay: Add support in the grammar for extern alias
2244 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
2245 Update callings to Namespace (now in GlobalRootNamespace).
2247 2005-10-25 Martin Baulig <martin@ximian.com>
2249 * convert.cs (ImplicitTypeParameterConversion): Make base
2250 interfaces actually work; fixes #76557.
2252 2005-10-25 Martin Baulig <martin@ximian.com>
2255 (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
2256 all the type parameters; fixes #76551.
2258 2005-10-25 Martin Baulig <martin@ximian.com>
2263 (GenericMethod.ctor): Added `Expression return_type' and
2264 `Parameters parameters' arguments.
2265 (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
2266 parameter and return types to check their constraints if they're
2269 * codegen.cs (EmitContext.ResolvingGenericMethod): New public
2272 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
2273 constraints of a generic type if `ec.ResolvingGenericMethod'.
2275 * class.cs (MethodCore.DoDefineParameters): Set
2276 `ec.ResolvingGenericMethod' if we're a generic method.
2277 (MemberBase.MemberType): Likewise.
2279 2005-10-25 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2281 * typemanager.cs (TypeManager): Added
2282 TypeManager.internals_visible_attr_type to cache
2283 S.R.CompilerServices.InternalsVisibleToAttribute.
2285 * codegen.cs (AssemblyClass): Added checks for
2286 InternalsVisibleToAttribute in new method
2287 CheckInternalsVisibleAttribute () and also cache the
2288 AssemblyName in AssemblyClass.Name.
2290 2005-10-24 Martin Baulig <martin@ximian.com>
2293 (TypeManager.ExpandInterfaces): Added overloaded version which
2294 just takes a `Type[]' array.
2297 (Constraints.Resolve): Don't expand the interfaces here; ie. we
2298 just use the interfaces which were explicitly specified and not
2299 the interfaces they inherit. Fixes #76482.
2300 (TypeParameter.FindMembers): Expand the interfaces here.
2302 2005-10-21 Martin Baulig <martin@ximian.com>
2305 (Constraints.Resolve): Also resolve the actual types here.
2306 (Constraints.ResolveTypes): Just check the constraints here.
2307 Fixes #76363; see gtest-218.cs.
2309 2005-10-21 Martin Baulig <martin@ximian.com>
2312 (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
2313 instead of a `BoxedCast'; fixes gtest-217.cs.
2315 2005-10-20 Atsushi Enomoto <atsushi@ximian.com>
2317 * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
2318 1) "new()" is specified as generic parameter constraint and 2) the
2319 type is TypeBuilder and 3) the type is abstract even if it has a
2320 default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
2322 2005-10-20 Martin Baulig <martin@ximian.com>
2325 (GenericConstraints.TypeParameter): New public property.
2326 (TypeParameter.ctor): Also take a `DeclSpace' argument.
2327 (TypeParameter.DeclSpace): New public property.
2328 (TypeParameter.DefineType): Inflate the constraints if our
2329 `DeclSpace' is an `Iterator'.
2331 2005-10-19 Atsushi Enomoto <atsushi@ximian.com>
2333 * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added
2334 GenericMethod argument to compare methods' generic type arguments.
2337 2005-10-19 Martin Baulig <martin@ximian.com>
2339 * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
2340 not ResolveType() when resolving the base type, so we're not
2341 checking the constraints here.
2342 (TypeContainer.ResolveType): Call ResolveType() on our base_type
2345 2005-10-19 Martin Baulig <martin@ximian.com>
2347 * generic.cs (ConstructedType.CheckConstraints): Committing
2348 untested fix for #76441.
2350 2005-10-18 Raja R Harinath <rharinath@novell.com>
2353 * class.cs (TypeContainer.DefineType): Move updating of
2354 topological sort earlier in the code.
2355 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2357 2005-10-18 Marek Safar <marek.safar@seznam.cz>
2360 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
2362 * constant.cs (Constant.TryReduce): Moved from Cast class.
2363 (Reduce): Made little bit more OO and fixed missing conversions.
2365 * ecore.cs (Reduce): Implemented.
2366 (Binary.EnumLiftUp): New method to upgrade values to enum values.
2368 * literal.cs (Reduce): Implemented.
2370 * class.cs: Reverted Miguel's wrong commit.
2372 2005-10-14 Miguel de Icaza <miguel@novell.com>
2374 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2376 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
2378 * cs-parser.jay, expression.cs : CS0214 was missing error location
2379 for constants. Fixed bug #76404.
2381 2005-10-10 Raja R Harinath <rharinath@novell.com>
2383 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2385 (PropertyExpr.EmitCall): Likewise.
2386 * expression.cs (Invocation.EmitArguments): Handle case where
2388 (Invocation.EmitCall): Avoid allocating temporary variable if
2389 there are no arguments.
2391 2005-10-11 Marek Safar <marek.safar@seznam.cz>
2394 * convert.cs (ExplicitConversionCore): Fixed object->enum
2397 2005-10-07 Raja R Harinath <rharinath@novell.com>
2400 * convert.cs (ImplicitConversionStandard): Move conversion of
2401 void* to arbitrary pointer types ...
2402 (ExplicitConversionStandard): .. here.
2403 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2404 error to always print typenames.
2406 2005-10-07 Raja R Harinath <rharinath@novell.com>
2408 * convert.cs (GetConversionOperator): Rename from
2409 GetConversionOperators. Move operator selection code from ...
2410 (UserDefinedConversion): ... here.
2412 2005-10-06 Marek Safar <marek.safar@seznam.cz>
2414 * convert.cs (ExplicitConversionCore): Removed duplicate enum
2417 2005-10-05 Marek Safar <marek.safar@seznam.cz>
2419 * assign.cs (Assign.DoResolve): Error method changed.
2421 * cfold.cs (DoConstantNumericPromotions): Error method changed.
2423 * const.cs (ResolveValue): Reset in_transit immediately.
2425 * constant.cs: Error method changed.
2427 * convert.cs: Removed useless location parameter.
2428 (ExplicitNumericConversion): Don't do double enum check.
2429 (ExplicitConversionCore): Renamed from ExplicitConversion.
2430 (ExplicitUnsafe): Extracted from ExplicitConversion.
2431 (ExplicitConversion): Uses for error reporting.
2433 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2435 (ResolveBoolean): Uses common error method.
2436 (CastToDecimal): Get rid of ec.
2437 (CastFromDecimal): Optimized.
2438 (ConvCast): Get rid of ec.
2440 * enum.cs (ResolveValue): Reset in_transit immediately.
2441 (Emit): Return after first error.
2443 * expression.cs: Convert changes.
2445 * literal.cs: Error method changed.
2447 * statement.cs: Error method changed.
2449 2005-10-06 Raja R Harinath <rharinath@novell.com>
2451 Fix gtest-131.cs and gtest-211.cs.
2452 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
2453 Only emit code for a label if it is used. Unreachable code can
2454 violate ECMA evaluation stack invariants.
2456 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2458 * anonymous.cs: Implemented ExprClassName.
2460 * assign.cs (Assign.DoResolve): Don't chrash when type is not
2463 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2466 * class.cs (StaticClass.DefineContainerMembers): Report protected
2469 * codegen.cs: if(ed) PRODUCTION.
2471 * convert.cs (Error_CannotImplicitConversion): Better error
2474 * cs-parser.jay: More error checks.
2476 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2478 * driver.cs (CSCParseOption): Enabled wrong option check.
2480 * ecore.cs (Expression.ExprClassName): Turned to property.
2481 (MemberExpr.CheckIntermediateModification): For checking boxed
2482 value types modification.
2484 * statement.cs (Fixed.Resolve): Expression type must be
2485 convertible to fixed type.
2486 (CollectionForeach.GetEnumeratorFilter,TryType):
2487 Small refactoring for easier error checking.
2489 2005-09-26 Marek Safar <marek.safar@seznam.cz>
2491 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2494 * class.cs (GeneratedBaseInitializer): New class for customization
2495 compiler generated initializers.
2496 (MemberBase.DoDefine): Check Obsolete attribute here.
2497 (FieldMember.DoDefine): Ditto.
2499 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2502 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2503 (MemberCore.GetObsoleteAttribute): Removed argument.
2504 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2505 (MemberCore.CheckObsoleteType): New helper.
2509 * statement.cs: Updates after MemberCore changes.
2511 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2512 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2514 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2515 obsolete attribute for compiler construct.
2516 (As.DoResolve): Cache result.
2518 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2520 2005-10-01 Miguel de Icaza <miguel@novell.com>
2522 * expression.cs (Probe): instead of having a "Type probe_type"
2523 keep the extra information as a TypeExpr probe_type_expr since the
2524 "As" operator needs to perform some type checks.
2526 * (As.DoResolve): If the type is a type parameter, ensure that it
2527 is constrained by a class.
2529 2005-09-22 Miguel de Icaza <miguel@novell.com>
2531 * statement.cs (Lock): Use the TemporaryVariable class instead of
2532 manually using local variables as those do not work when variables
2535 * ecore.cs: Moved the TemporaryVariable class from being a nested
2536 class inside Foreach to be a public class that can be employed in
2539 2005-09-19 Marek Safar <marek.safar@seznam.cz>
2541 * cs-parser.jay: interface_accessors replaced by
2542 accessor_declarations.
2544 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2547 * statement.cs (GotoCase.Resolve): Convert null constant to
2549 (SwitchLabel.ResolveAndReduce): Ditto.
2550 (SwitchLabel.NullStringCase): Custom null stamp.
2551 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2553 typemanager.cs (CSharpSignature): Don't skip first argument
2556 2005-09-16 Marek Safar <marek.safar@seznam.cz>
2558 * cfold.cs, constant.cs, convert.cs, ecore.cs,
2559 expression.cs, iterators.cs, literal.cs: Store constants and
2562 * class.cs (MemberBase.ShortName): Pass location.
2564 * cs-parser.jay: Some location fixes.
2566 * ecore.cs (Expression.Location): Made virtual.
2568 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2571 * const.cs (Const.ResolveValue): Check for assigning non-null
2572 value to reference type.
2574 2005-09-26 Raja R Harinath <rharinath@novell.com>
2577 * expression.cs (This.VerifyFixed): In a value type T, the type of
2578 'this' is T&, iow, 'this' is either an out or ref parameter. In a
2579 value type R, 'this' is treated as a value parameter.
2581 2005-09-05 Miguel de Icaza <miguel@novell.com>
2583 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2584 if the underlying types are the same, otherwise we need to produce
2585 code that will do the proper cast.
2587 This was exposed by Marek's constant rewrite which produced
2588 invalid code for the call site:
2591 void Method (X v) {}
2595 This fixes test-49.cs
2597 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2599 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2600 Type/Object should be allowed as well. Fixed bug #75968.
2602 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2604 * expression.cs : (Binary.DoResolve): when one is enum constant and
2605 another is constant 0, then return enum one *as enum type*.
2608 2005-10-04 Martin Baulig <martin@ximian.com>
2610 * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
2611 `SetMemberIsUsed()' work for generics, too.
2613 2005-10-04 Martin Baulig <martin@ximian.com>
2615 * expression.cs (DelegateInvocation.EmitStatement): Make this work
2616 for corlib. Fixes #75691.
2618 2005-09-28 Marek Safar <marek.safar@seznam.cz>
2621 * driver.cs: Fix compilation files with full root path.
2623 2005-09-25 Miguel de Icaza <miguel@novell.com>
2625 * report.cs (SymbolRelatedToPreviousError): Format the output so
2626 it does not use an open parenthesis that is never closed.
2628 * driver.cs: Follow coding guidelines
2630 2005-09-18 Miguel de Icaza <miguel@novell.com>
2632 * driver.cs: Set InEmacs based on the environment variable EMACS.
2634 * location.cs (InEmacs): in this mode, do not report column
2635 location as it confuses Emacs.
2637 2005-10-03 Raja R Harinath <rharinath@novell.com>
2639 * support.cs (SeekableStreamReader.Position): Don't error out when
2640 the requested position is just beyond the end of the current
2643 2005-09-28 Raja R Harinath <rharinath@novell.com>
2645 * support.cs (SeekableStreamReader): Simplify drastically. Don't
2646 try to keep in sync with the byte count of the underlying Stream.
2647 However, this limits us to a window size of 2048 characters: i.e.,
2648 the maximum lookahead of our lexer/parser can be 2048 characters.
2650 2005-09-22 Martin Baulig <martin@ximian.com>
2652 * driver.cs: Removed a debugging FIXME.
2654 2005-09-21 Raja R Harinath <rharinath@novell.com>
2656 * cs-parser.jay (type_arguments): Add CS1644 check.
2657 * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
2659 2005-09-15 Raja R Harinath <rharinath@novell.com>
2661 * Makefile (PROGRAM): Make profile specific.
2662 (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
2663 the current directory.
2666 * expression.cs (Invocation.EmitCall): Remove optimization on
2667 this_call since it doesn't handle 'this' being a value type.
2669 2005-09-05 Geoff Norton <gnorton@customerdna.com>
2671 * driver.cs: Ensure file handles are closed after parsing
2673 2005-09-05 Miguel de Icaza <miguel@novell.com>
2675 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2676 if the underlying types are the same, otherwise we need to produce
2677 code that will do the proper cast.
2679 This was exposed by Marek's constant rewrite which produced
2680 invalid code for the call site:
2683 void Method (X v) {}
2687 This fixes test-49.cs
2689 2005-09-05 Martin Baulig <martin@ximian.com>
2691 * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
2692 instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
2694 * cs-parser.jay (delegate_declaration): Small fix for #75852.
2696 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2698 * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
2699 to be a pointer type due to the spec 25.2, so check if declaring
2700 type is generic type definition. Fixed bug #75772.
2702 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2705 * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
2706 both types are not defined by methods.
2707 * expression.cs : (Invocation.IsApplicable): it should work when
2708 the argument type is equal to the parameter type, not only when
2709 ImplicitConversionExists() returns true.
2711 2005-09-02 Raja R Harinath <rharinath@novell.com>
2713 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2717 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2718 flow-branching for LocalVariableReferences in case we were invoked
2719 from a MemberAccess.
2720 * expression.cs (LocalVariableReference.VerifyAssigned): New.
2722 (LocalVariableReference.DoResolveBase): ... this.
2723 (MemberAccess.Resolve): Do the check that was disabled during
2726 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
2729 (PartialContainer.Create): check abstract/sealed/static strictly
2730 but abstract/sealed can exist only at one side. Fixed bug #75883.
2732 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
2735 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2736 specified, don't default to UnmanagedType.I4.
2738 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
2740 * expression.cs : conditional operator should check possibly
2741 incorrect assign expression. Fixed bug #75946.
2743 2005-08-30 Raja R Harinath <rharinath@novell.com>
2746 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2747 (ScopeInfo.EmitScopeType): Use it to construct field names from
2748 names of captured locals.
2751 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2752 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2753 Pass 'target_type' to BoxedCast. Don't default to 'object'.
2754 (ExplicitConversion): Remove enum cases already handled by
2755 implicit conversion. Move implicit conversion check to the beginning.
2756 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2757 * expression.cs (ArrayCreation.EmitDynamicInitializers):
2758 Don't treat System.Enum as a struct.
2760 2005-08-30 Jb Evain <jbevain@gmail.com>
2762 * attribute.cs: handles as expression in parameters.
2764 2005-08-30 Raja R Harinath <rharinath@novell.com>
2767 * class.cs (TypeContainer.VerifyClsName): Don't use a
2768 PartialContainer when verifying CLS compliance.
2769 (AbstractPropertyEventMethod): Set Parent here, ...
2770 (PropertyMethod): ... not here.
2772 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
2774 * attribute.cs : escaped attribute name should not be allowed to be
2775 resolved (e.g. @class as classAttribute). Fixed bug #75930.
2777 2005-08-29 Raja R Harinath <rharinath@novell.com>
2780 * convert.cs (ImplicitStandardConversionExists): Allow zero also
2781 when converting a long constant to unsigned long.
2782 * expression.cs (Invocation.OverloadResolve): Add sanity check to
2783 detect where IsApplicable and VerifyArgumentsCompat disagree.
2785 2005-08-29 Raja R Harinath <rharinath@novell.com>
2786 and Carlos Alberto Cortez <carlos@unixmexico.org>
2789 * class.cs (TypeContainer.CanElideInitializer): New helper.
2790 (TypeContainer.EmitFieldInitializers): Use it to determine if we
2791 can safely emitting the initializer of a field.
2793 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2795 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2796 allowed inside a switch (without loop). Fixed bug #75433.
2798 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
2800 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2801 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2803 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2805 * driver.cs : kinda reverting the default encoding changes (not exact
2806 revert since I noticed that "codepage:reset" might not work fine).
2808 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2810 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2811 Location. Now getter and setter store location correctly.
2812 (errors/cs0111-12.cs now reports the expected location.)
2814 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2816 * driver.cs : Use default encoding on the environment.
2817 Removed (now that) extra parameter for SeekableStreamReader.
2818 * support.cs : (SeekableStreamReader) third .ctor() argument for
2819 StreamReader is not required (always true). preamble size could
2820 be acquired in simpler and safe way.
2822 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
2824 * cs-parser.jay: report CS0642 at warning level 3
2825 and report CS0642 for an if else statement also
2826 fixes bug #74745. Patch by John Luke (and a bit
2828 Removed extra CS0642 warning check for "while",
2830 * statement.cs: In Block.Resolve(), CS0642 check
2831 is reimplemented to check a sequence of an empty
2832 statement and a block.
2834 Both fix bug #66777.
2836 2005-08-24 Marek Safar <marek.safar@seznam.cz>
2838 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2839 detection until I fix it.
2841 * cs-tokenizer.cs: Changed error message.
2843 * cs-parser.jay: Fixed 2 error locations.
2845 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2846 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2849 * enum.cs (GetSignatureForError): Fixed.
2851 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2855 * typemanager.cs (RegisterProperty): Removed.
2857 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2859 2005-08-24 Raja R Harinath <rharinath@novell.com>
2862 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2863 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2865 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2867 * expression.cs : tiny fix is required for not warning positive ulong.
2870 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2872 * expression.cs : add CS0652 check for constant and integral
2873 expression. Fixed bug #53974.
2875 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2877 * expression.cs : in DoNumericPromotions(), check if there is implicit
2878 conversion overload for string (to check CS0034). Fixed bug #52492.
2880 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2882 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2884 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2886 * ecore.cs : report location when it is *not* Null.
2888 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2894 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2895 correctly. Fixed bug #75721.
2897 2005-08-23 Raja R Harinath <rharinath@novell.com>
2899 * support.cs (SeekableStreamReader.Position): Avoid an expensive
2900 loop that performs 'min (pos, char_count)'.
2903 * expression.cs (Unary.ResolveOperator): Don't discard implicit
2904 converted value in Operator.OnesComplement.
2906 2005-08-22 Ben Maurer <bmaurer@ximian.com>
2908 * anonymous.cs: If the anon method is pulled into a helper class,
2909 it needs to be `internal' not `private'. Fixes runtime behavior on
2912 2005-08-17 Marek Safar <marek.safar@seznam.cz>
2915 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2918 2005-08-16 Marek Safar <marek.safar@seznam.cz>
2920 The big constants rewrite
2921 Fix #75746, #75685 and more
2922 As a side effect saved 1MB for MWF ;-)
2924 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2925 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2926 enum based for corlib compilation.
2928 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2931 * class.cs (FixedField.Define): Use ResolveAsConstant.
2933 * const.cs (IConstant): Interface constants and enums.
2934 (Const.ResolveValue): New method for constant resolvning.
2935 (ExternalConstant): Constants from imported assemblies.
2937 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2938 conversion; like enums.
2939 (Constant.ToType): Converts this constant to different type.
2940 (Constant.Increment): Adds 1.
2942 * convert.cs (ImplicitConversionRequired): Simplified.
2944 * cs-parser.jay: Create EnumMember directly.
2946 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
2948 * doc.cs (GenerateEnumDocComment): Removed.
2950 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
2951 (ConvertIntLiteral): Removed.
2952 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
2954 * enum.cs (EnumMember): Implement IConstant.
2955 (Enum.IsValidEnumConstant): Removed.
2956 (Enum.GetNextDefaultValue): Removed.
2957 (Enum.FindMembers): Updated.
2958 (Enum.GenerateDocComment): Iterate enum members.
2960 * expression.cs (Cast.TryReduce): Handle enums correctly.
2961 (New.Constantify): Made public.
2962 (MemberAccess.DoResolve): Removed contant specific if(s).
2964 * literal.cs (NullLiteral): Implement new abstract methods.
2966 * statement.cs (GotoCase.Resolve): Use new constant methods.
2967 (SwitchLabel.ResolveAndReduce): Use new constant methods.
2969 * typemanager.cs (LookupEnum): Removed.
2970 (IsEnumType): Fixed to work with corlib.
2971 (RegisterConstant): Removed.
2972 (LookupConstant): Removed.
2973 (GetConstant): Changed to work with IConstant.
2975 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
2977 * location.cs : Fixed overflown (>255) column number.
2979 2005-08-03 Raja R Harinath <rharinath@novell.com>
2981 First cut of the qualified-alias-member feature.
2982 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
2984 * cs-parser.jay (DOUBLE_COLON): New token.
2985 (namespace_or_type_name): Add rule for recognizing
2986 qualified-alias-members.
2987 (primary_expression): Likewise.
2988 (element_access): Allow QualifiedAliasMember as a possible
2989 type-bearing expression.
2990 (local_variable_type, local_variable_pointer_type): Likewise.
2991 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
2992 aliases in the current and enclosing namespace declarations.
2993 (NamespaceEntry.UsingAlias): Add CS0440 warning.
2994 * decl.cs (MemberName.is_double_colon): New.
2995 (MemberName.MemberName): Add new constructor for alias-member.
2996 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2997 * expression.cs (QualifiedAliasMember): New expression type.
2999 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3001 * location.cs : it borked when no argument was specified.
3003 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3005 * location.cs : tiny ToString() format fix.
3007 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3009 * statement.cs : oops, it was missing.
3011 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3013 A set of fixes for precise line/column location.
3016 "token" field now holds a file/line "delta", a line number offset
3017 from the segment, and a column number. See also:
3018 http://lists.ximian.com/pipermail/mono-devel-list/2004-
3019 December/009508.html
3020 Removed static IsNull. Use instance IsNull property instead.
3022 For some tokens it stores Location. For Identifier it stores
3023 LocatedToken which is a pair of string name and location.
3024 Column numbers are adjusted only at getChar().
3026 Use Location.ToString() for reporting (it now contains column).
3028 Largely modified to use LocatedToken instead of
3029 string (IDENTIFIER), and to acquire Location from some tokens.
3030 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
3031 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
3033 Now MemberName holds Location. DeclSpace.ctor() receives Location
3034 as a parameter. Removed extra parameters to all derived classes.
3035 Replaced Location.IsNull() with instance property.
3036 * assign.cs, expression.cs :
3037 Added .ctor() overload that omits Location.
3039 Added "nameEscaped" flag that indicates the identifier was escaped
3040 in the source file. This fixes bug #57047.
3042 2005-09-02 Martin Baulig <martin@ximian.com>
3044 * class.cs: Make CS3005 a warning, not an error.
3046 2005-08-02 Marek Safar <marek.safar@seznam.cz>
3048 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
3049 New method, looking for lo-case imported cls type.
3051 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
3054 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
3056 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
3058 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
3060 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
3062 Optimized to save 3.5 MB for SWF compilation.
3064 2005-08-01 Marek Safar <marek.safar@seznam.cz>
3066 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
3067 (PartialContainer.Create): Moved logic AddToContainer.
3068 (PartialContainer.MarkForDuplicationCheck): Shares name.
3070 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
3073 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3075 (Namespace.GetSignatureForError): New method.
3077 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3078 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3080 2005-08-01 Raja R Harinath <rharinath@novell.com>
3083 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3084 member lookup rather than qualifier_type, since qualifier_type can
3087 2005-08-01 Marek Safar <marek.safar@seznam.cz>
3089 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3092 2005-07-31 Miguel de Icaza <miguel@novell.com>
3094 * statement.cs: Copy the local exception into the exception
3095 captured local. Fixes 75674
3097 2005-07-31 Raja R Harinath <harinath@gmail.com>
3100 * expression.cs (Invocation.OverloadResolve): Don't report error
3101 CS1501 if error CS1502 has been reported.
3102 (New.DoResolve): Delegate CS1501 reporting to
3103 Invocation.OverloadResolve.
3106 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3107 invariant-meaning-in-block property in an enclosing block if
3110 2005-07-29 Marek Safar <marek.safar@seznam.cz>
3112 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3113 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3114 (Switch.CheckSwitch): Just save 50kb for SWF.
3116 2005-07-27 Martin Baulig <martin@ximian.com>
3118 * anonymous.cs (CaptureContext.AddField): Added
3119 `AnonymousContainer am' argument; compute its toplevel scope if
3120 it's not already computed. Fixes #75649.
3122 2005-07-26 Raja R Harinath <rharinath@novell.com>
3125 * class.cs (Constructor.Emit): Reset block to null if the block
3128 2005-07-25 Marek Safar <marek.safar@seznam.cz>
3130 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3132 2005-07-25 Marek Safar <marek.safar@seznam.cz>
3134 * class.cs (MethodData.Define): Check whether accessor implementing
3135 interface is public.
3137 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3139 2005-07-22 Marek Safar <marek.safar@seznam.cz>
3142 * namespace.cs (LookupType): Moved same type check to...
3144 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3147 2005-07-21 Raja R Harinath <rharinath@novell.com>
3149 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3150 already found a typebuilder.
3151 * class.cs (MethodCore.IsDuplicateImplementation): Compare
3152 MemberNames, not strings.
3154 * const.cs (Error_ExpressionMustBeConst):
3155 Rename from Error_EpressionMustBeConst.
3156 * const.cs, class.cs, statement.cd: Update.
3158 2005-07-21 Marek Safar <marek.safar@seznam.cz>
3162 * const.cs (Const.LookupConstantValue): Report missing contant expression
3164 (Error_EpressionMustBeConstant): Only one error method.
3166 * class.cs, statement.c: Updated.
3168 2005-07-20 Raja R Harinath <rharinath@novell.com>
3170 * statement.cs (Block.Flags): Add back HasVarargs.
3171 (Block.flags): Make protected.
3172 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3174 * typemanager.cs (types, typecontainers, user_types): Remove.
3175 (UserTypes, TypeContainers): Likewise.
3176 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3177 (CleanUp, Reset): Update.
3178 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
3179 (GetNestedType): Use Type.GetNestedType.
3180 (CoreLookupType): Take two arguments, the namespace and the
3181 basename of the type. Update to use the Namespace.Lookup
3183 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3184 (RealMemberLookup): Use IsNestedChildOf instead of playing with
3185 string concatenation and substring matches.
3186 * class.cs, enum.cs, delegate.cs: Update to changes.
3188 2005-07-20 Marek Safar <marek.safar@seznam.cz>
3190 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3191 Expression and made virtual.
3193 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3194 (ImplicitStandardConversionExists): Fixed `byte' typo ?
3196 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3198 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3201 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3204 2005-07-18 Marek Safar <marek.safar@seznam.cz>
3207 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3208 AssemblyCultureAttribute is not used on executable.
3211 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3213 2005-07-16 Raja R Harinath <rharinath@novell.com>
3216 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3217 New. Reports CS0252/CS0253.
3218 Mostly taken from preliminary patch by Duncak Mak.
3219 (Binary.DoResolveOperator): Store results of operator lookup.
3220 Use them to detect if we need to warn about unintended reference
3223 2005-07-15 Raja R Harinath <rharinath@novell.com>
3226 * namespace.cs (Namespace.Lookup): Add back location parameter.
3227 (Namespace.LookupType): Add CS0436 report. Add location parameter.
3228 * delegate.cs, ecore.cs, expression.cs: Update to changes.
3230 * codegen.cs (EmitContext.DeclSpace): Make readonly.
3231 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3232 (Namespace.LookupType): ... this.
3233 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3235 * typemanager.cs (LookupTypeReflection): Remove buggy code that
3236 purported to handle pointers.
3237 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3240 2005-07-15 Marek Safar <marek.safar@seznam.cz>
3242 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3245 2005-07-15 Raja R Harinath <rharinath@novell.com>
3247 * namespace.cs (Namespace.Lookup): Drop location parameter.
3248 (NamespaceEntry.LookupAlias): Remove. Merge into ...
3249 (NamespaceEntry.Lookup): ... this.
3250 (NamespaceEntry.Error_AmbiguousTypeReference):
3251 Move here from DeclSpace.
3252 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3254 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3255 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3256 Move to NamespaceEntry.
3257 * delegate.cs, expression.cs: Update to changes.
3259 2005-08-31 Martin Baulig <martin@ximian.com>
3261 Committing a patch from Atsushi Enomoto for #75850.
3263 * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
3264 Prefer a generic enumerator over a non-generic one.
3266 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
3268 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3269 * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3271 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3273 * driver.cs : reverting default encoding change as well as mcs.
3275 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3277 * driver.cs, support.cs : merged r48826.
3279 > could you integrate your mcs changes to gmcs otherwise
3280 > gmcs cannot compile some files.
3282 2005-08-20 Martin Baulig <martin@ximian.com>
3284 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3285 scope if we don't already have it.
3287 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
3288 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
3291 2005-07-31 Miguel de Icaza <miguel@novell.com>
3293 * statement.cs: Copy the local exception into the exception
3294 captured local. Fixes 75674
3296 2005-07-15 Marek Safar <marek.safar@seznam.cz>
3298 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3301 2005-08-12 Martin Baulig <martin@ximian.com>
3303 * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
3304 for nested types here to avoid hitting the cache too early.
3306 2005-08-09 Miguel de Icaza <miguel@novell.com>
3308 * enum.cs: On the new compiler CLS error 3005 is now a warning not
3311 2005-08-03 Martin Baulig <martin@ximian.com>
3313 Make iterators in generic methods work; see gtest-191.cs.
3316 (Constraints.Resolve): Protect against being called twice.
3319 (TypeContainer.GetClassBases): Make this `protected virtual'.
3321 * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
3322 (Iterator.GetClassBases): Override this and compute the base
3324 (Iterator.DefineNestedTypes): If we're a generic method, all our
3325 method type parameters become class type parameters on the proxy
3329 (ToplevelBlock.Parameters): Make this a property, not a field.
3330 (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
3332 2005-08-03 Martin Baulig <martin@ximian.com>
3334 * typemanager.cs (TypeManager.IsSubclassOf): Use
3335 `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
3336 (TypeManager.GetFullName_recursed): Improved.
3338 2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3341 * ecore.cs (Expression.IsAccessorAccessible): Change the check for
3342 Private accessor case, using TypeManager.IsPrivateAccessible instead of
3343 invocation_type == mi.DeclaringType, since the first one also checks
3344 other condition used by generic instances.
3346 2005-07-27 Martin Baulig <martin@ximian.com>
3348 * anonymous.cs (CaptureContext.AddField): Added
3349 `AnonymousContainer am' argument; compute its toplevel scope if
3350 it's not already computed. Fixes #75649.
3352 2005-07-14 Marek Safar <marek.safar@seznam.cz>
3354 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3355 CheckAttributeType and refactored.
3356 (Attribute.ResolvePossibleAttributeType): Changed to reuse
3357 ResolveAsTypeTerminal error handling.
3358 (ResolveAsTypeTerminal): Introduced because of global attributes extra
3360 (GetSignatureForError): Print errors in same way.
3363 * codegen.cs: Reflect attribute GetSignatureForError change.
3366 * expression.cs: Add silent parameter to ResolveAsTypeStep.
3368 * namespace.cs (UsingEntry): Refactored to make fields private.
3371 statement.cs: Error_UnexpectedKind has extra parameter.
3373 2005-07-14 Raja R Harinath <rharinath@novell.com>
3375 * ecore.cs (IAlias): Remove.
3376 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
3377 that implement the interface.
3378 * namespace.cs (Namespace): Likewise.
3379 (Namespace.declspaces): Renamed from 'defined_names'.
3380 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
3381 DeclSpace instead of an IAlias.
3382 * tree.cs (Tree.AddDecl): Update.
3384 2005-07-12 Raja R Harinath <rharinath@novell.com>
3386 * statement.cs (Block.Flags); Remove HasVarargs.
3387 (Block.HasVarargs): Move to ToplevelBlock.
3388 (Block.ThisVariable, Block.AddThisVariable): Likewise.
3389 (Block.Variables): Make protected. Initialize variable hashtable
3391 (Block.AddVariable): Update.
3392 (Block.Resolve): Update to changes.
3393 (ToplevelBlock.HasVarargs): New boolean.
3394 (ToplevelBlock.ThisVariable): Move here from Block.
3395 (ToplevelBlock.AddThisVariable): Likewise.
3396 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
3397 * expression.cs (This.ResolveBase): Update to changes.
3398 (ArglistAccess.DoResolve): Likewise.
3400 2005-07-11 Marek Safar <marek.safar@seznam.cz>
3403 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3405 * class.cs (TypeContainer.VerifyMembers): Distinguish between
3406 not used and not used & assigned.
3407 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3409 2005-07-11 Marek Safar <marek.safar@seznam.cz>
3412 * expression.cs (Is.DoResolve): null is never provided type.
3414 2005-07-08 Marek Safar <marek.safar@seznam.cz>
3417 * cs-parser.jay: Less strict event error rule to catch more errors.
3419 2005-07-11 Martin Baulig <martin@ximian.com>
3421 * generic.cs (ConstructedType.CheckConstraints): Improve the check
3422 for the constructor constraint: we do not only have to check
3423 whether the class has a public constructor, but also ensure that
3424 it's parameterless. Fixes #75492.
3426 2005-07-11 Martin Baulig <martin@ximian.com>
3428 * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
3429 between type parameters if they either have the reference type
3430 constraint or the class constraint.
3432 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
3434 * generic.cs: Use MakeGenericType instead of BindGenericParameters.
3436 2005-07-07 Marek Safar <marek.safar@seznam.cz>
3439 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3440 (ExtractSecurityPermissionSet): Cope with self referencing security
3441 attributes properly.
3443 * driver.cs (SetOutputFile): Made public property OutputFile.
3445 2005-07-07 Raja R Harinath <rharinath@novell.com>
3448 * class.cs (TypeContainer.first_nonstatic_field): Rename from
3449 has_nonstatic_fields. Make into a FieldBase pointer.
3450 (TypeContainer.AddField): Add CS0282 check.
3451 (TypeContainer.EmitType): Update.
3453 2005-07-06 Miguel de Icaza <miguel@novell.com>
3455 * cs-tokenizer.cs (consume_identifier): Do not create strings to
3456 compare if they start with __.
3458 2005-07-06 Raja R Harinath <rharinath@novell.com>
3460 * statement.cs (Switch.SwitchGoverningType): Only look at
3461 UserCasts that don't need implicit standard conversions to one of
3462 the allowed switch types (Fixes test-322.cs).
3463 (LocalInfo.Resolve): Re-enable sanity-test.
3465 2005-07-06 Marek Safar <marek.safar@seznam.cz>
3467 * cs-tokenizer.cs (consume_identifier): Detect double undescores
3469 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3471 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3473 2005-07-06 Raja R Harinath <rharinath@novell.com>
3476 * ecore.cs (SimpleName.GetSignatureForError): Add.
3477 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3478 (MemberAccess.GetSignatureForError): Add.
3480 2005-07-05 Marek Safar <marek.safar@seznam.cz>
3482 The big error and warning messages review.
3512 * typemanager.cs: Updated.
3514 * class.cs: (MethodCore.SetYields): Moved here to share.
3515 (PropertyMethod.Define): Moved iterator setup here.
3517 * iterators.cs: Add orig_method to have full access to parent
3520 2005-07-05 Raja R Harinath <rharinath@novell.com>
3522 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3523 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3524 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3525 variable of struct type.
3526 * expression.cs (Unary.ResolveOperator): Update to change.
3527 (Indirection.VerifyFixed): Likewise.
3528 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3529 (ParameterReference.VerifyFixed): Value parameters are fixed.
3530 (This.VerifyFixed): Treat 'this' as a value parameter.
3531 * statement.cs (LocalInfo.IsFixed): Remove.
3533 2005-07-01 Martin Baulig <martin@ximian.com>
3535 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3536 `ec.EmitThis ()' to get the correct scope.
3538 2005-07-01 Martin Baulig <martin@ximian.com>
3540 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3541 instance is a ParameterReference; fixes #75299.
3543 2005-06-30 Raja R Harinath <rharinath@novell.com>
3546 * expression.cs (Indexers.map): Remove.
3547 (Indexers.Append): Filter out inaccessible setters and getters.
3548 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3551 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
3553 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3554 (FieldExpr.Emit, PropertyExpr.Emit): Update.
3555 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3556 * expression.cs (Invocation.EmitCall): Add CS0120 check.
3558 2005-06-30 Marek Safar <marek.safar@seznam.cz>
3561 * class.cs (FieldBase.GetInitializerExpression): One more field
3564 2005-06-28 Miguel de Icaza <miguel@novell.com>
3566 * pending.cs: Do not define a proxy if the base method is virtual,
3567 it will be picked up by the runtime (bug 75270).
3569 2005-07-08 Martin Baulig <martin@ximian.com>
3571 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3572 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3574 2005-07-07 Martin Baulig <martin@ximian.com>
3576 * generic.cs (ConstructedType.CheckConstraint): Use
3577 ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
3578 called recursively; fixes #75329.
3580 2005-07-06 Martin Baulig <martin@ximian.com>
3582 * generic.cs (TypeManager.InferTypeArguments): Added support for
3583 anonymous methods; fixes #75461.
3585 2005-07-01 Martin Baulig <martin@ximian.com>
3587 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3588 `ec.EmitThis ()' to get the correct scope.
3590 2005-07-01 Martin Baulig <martin@ximian.com>
3592 * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
3593 instance is `This'; fixes #75299.
3595 2005-06-30 Martin Baulig <martin@ximian.com>
3597 * class.cs (Indexer): Implement IIteratorContainer; added support
3598 for iterators in indexers.
3601 (EmitContext.CurrentIterator): Make this a property, not a field.
3603 * anonymous.cs (AnonymousContainer.Iterator): New public property.
3605 2005-06-28 Miguel de Icaza <miguel@novell.com>
3607 * pending.cs: Do not define a proxy if the base method is virtual,
3608 it will be picked up by the runtime (bug 75270).
3610 2005-06-28 Martin Baulig <martin@ximian.com>
3612 * cs-parser.jay (interface_method_declaration): Avoid a
3613 reduce/reduce conflict by moving some of the code into a separate
3614 `interface_method_declaration_body' rule; fixes #75368.
3616 2005-06-28 Martin Baulig <martin@ximian.com>
3618 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
3619 array check after the check for TypeBuilder's.
3621 2005-06-21 Raja R Harinath <rharinath@novell.com>
3623 * convert.cs (FindMostEncompassedType): Add two trivial special
3624 cases (number_of_types == 0 || number_of_types == 1).
3625 (FindMostEncompasingType): Likewise.
3627 2005-06-17 Raja R Harinath <rharinath@novell.com>
3629 Some cleanups preparing for the fix of #75283.
3630 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3632 (EventExpr.InstanceResolve): Likewise.
3633 (EventExpr.DoResolve): Remove redundant checks.
3635 2005-06-08 Miguel de Icaza <miguel@novell.com>
3637 * class.cs: Small fix.
3639 2005-06-08 Raja R Harinath <rharinath@novell.com>
3642 * class.cs (GetPartialBases): Fix return value check of
3645 2005-06-07 Raja R Harinath <rharinath@novell.com>
3647 Ensure that partial classes are registered in their enclosing
3648 namespace. Initial part of fix of #75160.
3649 * tree.cs (Tree.RecordDecl): Add new namespace argument.
3650 Register declspace with namespace here, not in
3651 DeclSpace.RecordDecl.
3652 * cs-parser.jay: Pass namespace to RecordDecl.
3653 * class.cs (PartialContainer.Create): Likewise.
3654 (ClassPart.DefineType): New sanity-check. Throws an exception if
3656 * decl.cs (Declspace.RecordDecl): Remove.
3657 * namespace.cs (NamespaceEntry.DefineName): Remove.
3659 2005-06-06 Marek Safar <marek.safar@seznam.cz>
3661 * rootcontext.cs: Reset TargetExt as well.
3663 2005-06-03 Raja R Harinath <rharinath@novell.com>
3665 * ecore.cs (Expression.Resolve): Emit CS0654 error when
3668 2005-06-02 Raja R Harinath <rharinath@novell.com>
3670 Fix #75080, cs0119.cs.
3671 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
3673 (Expression.Resolve): ... this. Use it. Remove bogus code
3674 allowing ExprClass.Type and ExprClass.Namespace for
3675 ResolveFlags.VariableOrValue.
3676 (Expression.Resolve) [1-argument variant]: Change default resolve
3677 flags based on language version.
3678 (Expression.Error_UnexpectedKind): Use a simple string array
3679 rather than an ArrayList.
3680 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3682 (TypeOfVoid.DoResolve): Likewise.
3683 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
3684 flags argument -- it always has the same value.
3686 2005-05-31 Raja R Harinath <rharinath@novell.com>
3689 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3690 Use it in the error message.
3691 * assign.cs, expression.cs, statement.cs: Update.
3693 2005-05-30 Raja R Harinath <rharinath@novell.com>
3696 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3697 the "almostMatchedMember" case too.
3698 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3699 that failed the accessibility checks to 'almost_match'.
3701 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
3703 * attribute.cs: Use internal MethodBuilder methods to set
3704 ExactSpelling and SetLastError on PInvoke methods, instead
3705 of passing them via charset. Fixes #75060.
3707 2005-05-27 Raja R Harinath <rharinath@novell.com>
3709 * parameter.cs (Parameter): Remove TODO comment.
3710 (Parameter.DefineParameter): Remove Location parameter.
3711 (Parameters.LabelParameters): Likewise.
3712 * class.cs (Constructor.Emit): Update to change.
3713 (MethodData.Emit): Likewise.
3714 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
3715 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3717 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
3720 Removed Parameters.Location and added Parameter.Location instead.
3721 Removed Location parameter from Emit() and GetSignature().
3728 Modified all related calls.
3730 2005-06-21 Martin Baulig <martin@ximian.com>
3732 * generic.cs (NullCoalescingOperator.Emit): Make this work if the
3733 left-hand side is not a nullable type; fixes #75328.
3735 2005-06-21 Martin Baulig <martin@ximian.com>
3738 (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
3739 (TypeManager.GetFullNameSignature): Likewise.
3741 * convert.cs (Convert.Error_CannotImplicitConversion): Compare
3742 `source.FullName' and `target.FullName' to check whether there are
3743 two conflicting definitions.
3745 2005-06-21 Martin Baulig <martin@ximian.com>
3747 * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
3748 a BoxedCast - also for reference types - to be compatible with csc.
3750 2005-06-21 Martin Baulig <martin@ximian.com>
3752 * expression.cs (MemberAccess.DoResolve): Add support for nested
3753 types in a generic instance; fixes #75320.
3755 2005-06-20 Martin Baulig <martin@ximian.com>
3757 * generic.cs (TypeManager.InferType): Also walk the class
3758 hierarchy for generic instances; fixes #75261.
3760 2005-06-17 Martin Baulig <martin@ximian.com>
3762 * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
3763 to make things work for corlib.
3765 2005-06-15 Martin Baulig <martin@ximian.com>
3767 * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
3768 obsolete `SecurityAction' values.
3770 2005-06-06 Marek Safar <marek.safar@seznam.cz>
3772 * rootcontext.cs: Reset TargetExt as well.
3774 2005-06-09 Martin Baulig <martin@ximian.com>
3776 * delegate.cs (Delegate.VerifyMethod): Added
3777 `MethodGroupExpr old_mg' argument; inherit its
3778 `HasTypeParameters'; fix #75085.
3780 2005-06-09 Martin Baulig <martin@ximian.com>
3782 * expression.cs (Invocation.OverloadResolve): Correctly handle
3783 generic methods for the SetMemberIsUsed(); fix #75064.
3785 2005-06-09 Martin Baulig <martin@ximian.com>
3787 * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
3790 2005-06-08 Martin Baulig <martin@ximian.com>
3792 * cs-parser.jay (nullable_type_or_conditional): If we put the
3793 nullable back and our `type' is a `ComposedCast', remove the
3794 nullable from it. Fixes #75156.
3796 * expression.cs (ComposedCast.RemoveNullable): New public method.
3798 2005-06-08 Martin Baulig <martin@ximian.com>
3800 The big Iterators rewrite :-)
3802 * iterators.cs: Rewrite this to use the anonymous methods framework.
3804 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3805 before the TypeContainers; see 2test-21.cs.
3808 (TypeContainer.DefineType): Don't create a new EmitContext if we
3809 already have one (this only happens if we're an Iterator).
3810 (TypeContainer.Define): Also call Define() on all our iterators.
3811 (Method.CreateEmitContext): Added support for iterators.
3814 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3815 (AnonymousContainer.CreateMethodHost): Moved here from
3816 AnonymousMethod and made abstract.
3817 (AnonymousContainer.CreateScopeType): New abstract method.
3818 (AnonymousContainer.IsIterator): New public property.
3819 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3820 get the ScopeTypeBuilder rather than manually defining it here.
3821 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3824 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3825 before RootContext.DefineTypes().
3827 * codegen.cs (EmitContext.RemapToProxy): Removed.
3828 (EmitContext.CurrentAnonymousMethod): Changed type from
3829 AnonymousMethod -> AnonymousContainer.
3830 (EmitContext.ResolveTopBlock): Protect from being called twice.
3831 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3832 (EmitContext.EmitThis): Removed the iterators hacks; use the
3833 anonymous methods framework for that.
3836 (ToplevelBlock.Container): Make this a property, not a field.
3837 (ToplevelBlock.ReParent): New public method; move the
3838 ToplevelBlock into a new container.
3839 (Foreach.TemporaryVariable): Simplify.
3841 2005-06-05 Martin Baulig <martin@ximian.com>
3843 * statement.cs (LocalInfo.CompilerGenerated): New flag.
3844 (Block.AddTemporaryVariable): New public method; creates a new
3845 `LocalInfo' for a temporary variable.
3846 (Block.EmitMeta): Create the LocalBuilders for all the temporary
3848 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3849 non-iterator variables.
3851 2005-06-05 Martin Baulig <martin@ximian.com>
3853 * statement.cs (Foreach.TemporaryVariable): Create the
3854 LocalBuilder in the Emit phase and not in Resolve since in some
3855 situations, we don't have an ILGenerator during Resolve; see
3856 2test-19.cs for an example.
3858 2005-06-04 Martin Baulig <martin@ximian.com>
3860 The big Foreach rewrite - Part II.
3862 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3863 with `PropertyInfo ienumerator_getcurrent'.
3865 * codegen.cs (VariableStorage): Removed.
3868 (Foreach): Derive from Statement, not ExceptionStatement.
3869 (Foreach.CollectionForeach): New nested class. Moved all the code
3870 dealing with collection foreach here.
3871 (Foreach.ForeachHelperMethods): Removed.
3872 (Foreach.TemporaryVariable): Implement IMemoryLocation.
3874 2005-05-23 Martin Baulig <martin@ximian.com>
3876 * statement.cs (Try.DoResolve): Don't create a `finally' if we
3877 don't need to. Fix #75014.
3879 2005-05-26 Raja R Harinath <rharinath@novell.com>
3881 Improve user-defined conversion handling.
3882 * convert.cs (GetConversionOperators): Rewrite. Return only the
3883 applicable operators.
3884 (AddConversionOperators): New. Helper for GetConversionOperators.
3885 (FindMostEncompassedType, FindMostEncompassingType): Verify that
3886 there is only one most encompassed/encompassing type.
3887 (FindMostSpecificSource, FindMostSpecificTarget): Remove
3888 "applicable operator" handling.
3889 (UserConversion): Move cache here from GetConversionOperators.
3890 Directly cache the chosen operator, rather than the whole
3892 (ExplicitNumericConversion): Fix buggy implementation of Decimal
3893 case. Allow conversion of decimal to sbyte and byte too.
3894 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3895 New static methods. Used to avoid allocating EmptyExpressions in
3898 2005-05-24 Duncan Mak <duncan@novell.com>
3900 * ecore.cs (CastFromDecimal): New class for casting a decimal to
3901 another class, used in Convert.ExplicitNumericConversion.
3902 (CastToDecimal): New class, similar to above, but casts to
3903 System.Decimal, used in Convert.ImplicitNumericConversion and also
3904 in explicit convesion from double/float to decimal.
3906 * convert.cs (ImplicitNumericConversion): Handle implicit
3907 conversions to System.Decimal.
3908 (ExplicitNumericConversion): handle explicit conversions to
3913 2005-05-20 Miguel de Icaza <miguel@novell.com>
3915 * typemanager.cs: Do not throw an exception in the TypeBuilder
3916 case, we take care of it on the TypeCode.
3918 2005-05-17 Marek Safar <marek.safar@seznam.cz>
3920 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3923 * cs-parser.jay: Catch more lexical errors.
3925 * report.cs: Add one more Error method.
3928 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3930 2005-05-20 Martin Baulig <martin@ximian.com>
3932 * class.cs (TypeContainer.CircularDepException): Removed.
3933 (TypeContainer.DefineType): Removed the `InTransit' stuff.
3934 (TypeContainer.CheckRecursiveDefinition): Check for circular class
3935 (CS0146) and interface (CS0529) dependencies here.
3937 2005-05-20 Martin Baulig <martin@ximian.com>
3939 * expression.cs (New.DoResolve): Move the CS0712 check above the
3940 CS0144 check; otherwise it can never be reached.
3942 2005-05-20 Martin Baulig <martin@ximian.com>
3944 * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
3946 2005-05-20 Martin Baulig <martin@ximian.com>
3948 * class.cs (TypeContainer.DefineType): Fix CS0698 check.
3950 * typemanager.cs (TypeManager.IsAttributeType): New public method.
3952 2005-05-19 Martin Baulig <martin@ximian.com>
3955 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3956 to disable error reporting.
3958 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3959 here since we don't want to report an error; see the new test-336.cs.
3961 2005-05-19 Raja R Harinath <rharinath@novell.com>
3963 * statement.cs (ToplevelBlock.GetParameterReference)
3964 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3965 Move here from class Block.
3966 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3967 * expression.cs (ParameterReference.DoResolveBase): Likewise.
3969 2005-05-18 Martin Baulig <martin@ximian.com>
3974 (FlowBranching.Reachability): Add non-static public And() and Or()
3976 (FlowBranchingSwitch): New class; do the `break_origins' thing
3977 like in FlowBranchingLoop.
3978 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3979 reachability, not just locals and parameters.
3980 (FlowBranching.MergeChild): Remove some of the hacks for loop and
3981 switch; MergeBreakOrigins() now takes care of that.
3983 2005-05-18 Martin Baulig <martin@ximian.com>
3985 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3986 a loop and may leave it, reset the barrier; fixes #74974.
3988 2005-05-16 Raja R Harinath <rharinath@novell.com>
3990 Fix test-382.cs. Emit values of decimal constants.
3991 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3993 (TypeContainer.AddField): ... this.
3994 (TypeContainer.EmitFieldInitializers): Allow the list of fields
3995 with initializers to include 'Const's.
3996 (ClassPart.RegisterFieldForInitialization): Forward to
3998 * const.cs (Const.Const): Pass initializer to base class.
3999 (Const.Define): In case of decimal constants, register them for
4000 initialization in a static constructor.
4002 2005-05-14 Martin Baulig <martin@ximian.com>
4004 * statement.cs (Block.Resolve): Correctly handle unreachable code;
4005 do not call ResolveUnreachable() on unreachable statements in
4006 here, see the comment in the source code.
4008 2005-05-13 Raja R Harinath <rharinath@novell.com>
4011 * expression.cs (BinaryResolveOperator): If one of the operands of
4012 an equality comparison is 'null' and the other is a pointer type,
4013 convert the null to a NullPointer.
4014 * convert.cs (ImplicitReferenceConversion): If the expression is a
4015 NullLiteral and the target type is a pointer type, return a
4016 NullPointer instead.
4017 (ImplicitConversionStandard): Likewise.
4019 2005-05-13 Marek Safar <marek.safar@seznam.cz>
4021 * cs-parser.jay: Set readonly context based on special constructs.
4023 * expression.cs (LocalVariableReference.DoResolveBase): Improved
4024 readonly variable error handling.
4026 * rootcontext.cs (EmitCode): Don't verify members when error
4029 * statement.cs (LocalInfo): Add reaodnly context information.
4030 (SetReadOnlyContext, GetReadOnlyContext): New methods.
4032 2005-05-17 Martin Baulig <martin@ximian.com>
4034 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
4037 2005-05-13 Martin Baulig <martin@ximian.com>
4039 * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
4040 handle unreachable blocks.
4042 2005-05-13 Martin Baulig <martin@ximian.com>
4045 (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
4046 (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
4049 2005-05-13 Martin Baulig <martin@ximian.com>
4051 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
4052 instance variable, not a local. Fix #74873.
4053 (Block.ResolveUnreachable): Set it to true here.
4055 2005-05-12 Martin Baulig <martin@ximian.com>
4057 * cs-parser.jay (property_declaration): Pass the `current_class',
4058 not the `current_container' to Property's .ctor. Fixes #74912.
4060 2005-05-11 Martin Baulig <martin@ximian.com>
4062 * typemanager.cs (Closure): Copy this from MCS and merge all the
4063 GMCS-specific changes into it.
4065 2005-05-12 Raja R Harinath <harinath@gmail.com>
4068 * typemanager.cs (unmanaged_enclosing_types): New.
4069 (IsUnmanagedType): Avoid infloops by using
4070 'unmanaged_enclosing_types' to talk with recursive invocations.
4072 2005-05-11 Duncan Mak <duncan@novell.com>
4074 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
4075 continuing to process for 'arg'.
4076 (handle_preprocessing_directive): Check the argument of the #endif
4077 directive and report error CS1025 if there are any trailing
4080 According to the C# spec, having even whitespace after the #endif
4081 directive is illegal; however, because we call arg.TrimEnd ()
4082 beforehand, we have the same behavior as csc, allowing whitespace
4083 after the directive.
4087 2005-05-11 Marek Safar <marek.safar@seznam.cz>
4091 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
4092 (Constructor.GetObsoleteAttribute): Implemented correctly.
4094 2005-05-10 Martin Baulig <martin@ximian.com>
4096 * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
4097 resolve the type; fixes #74864.
4098 (DefaultValueExpression): Create the LocalTemporary in Emit(), not
4099 in DoResolve(); fixes #74862.
4101 2005-05-10 Martin Baulig <martin@ximian.com>
4103 * support.cs (ReflectionParameters.ParameterModifier): Use
4104 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
4105 and `ParameterAttributes.In'. Fixes #74884.
4107 2005-05-10 Martin Baulig <martin@ximian.com>
4109 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
4110 the cache if we're just looking for `MemberTypes.NestedType' in a
4113 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
4114 constraints if we're still resolving the type tree.
4115 (Expression.MemberLookup): If we're resolving the type tree, only
4116 look for `MemberTypes.NestedType' since we're only interested in
4119 * class.cs (TypeContainer.DefineType): Don't resolve the type
4120 parameters here; do this later in ResolveType() after the type
4121 tree has been resolved.
4122 (TypeContainer.ResolveType): New public method; this is called
4123 after the type tree is resolved and before the types are being
4124 populated. We resolve the generic constraints here.
4125 (TypeContainer.DoDefineMember): Check the constraints on our base
4126 class and interfaces.
4128 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
4129 set the `ResolvingTypeTree' flag on the EmitContext.
4131 * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
4133 2005-05-10 Marek Safar <marek.safar@seznam.cz>
4135 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
4137 * expression.cs (Argument.GetParameterModifier): Turned to property.
4138 (Invocation.Error_InvalidArguments): Add more descriptive errors.
4140 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
4143 2005-05-09 Raja R Harinath <rharinath@novell.com>
4146 * decl.cs (MemberCache.AddMethods): Register override methods,
4147 rather than non-override methods.
4148 * typemanager.cs (RegisterOverride): New.
4149 (IsOverride): Update.
4151 2005-05-09 Marek Safar <marek.safar@seznam.cz>
4153 * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
4155 2005-05-06 Martin Baulig <martin@ximian.com>
4158 (Attributable.IsClsComplianceRequired): Fix typo in the method name.
4159 (AttributeTester.AnalyzeTypeCompliance): Add generics support.
4161 2005-05-09 Marek Safar <marek.safar@seznam.cz>
4165 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
4166 recursive declaration.
4168 * statement.cs (Block.ResolveMeta): Report any error in resolving.
4170 2005-05-06 Marek Safar <marek.safar@seznam.cz>
4172 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
4174 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
4176 2005-05-05 Raja R Harinath <rharinath@novell.com>
4179 * decl.cs (DeclSpace.FamilyAccessible):
4180 Use TypeManager.IsNestedFamilyAccessible.
4182 Fix reopened #64812.
4183 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
4186 2005-05-04 Raja R Harinath <rharinath@novell.com>
4187 Abin Thomas <projectmonokochi@rediffmail.com>
4188 Anoob V E <projectmonokochi@rediffmail.com>
4189 Harilal P R <projectmonokochi@rediffmail.com>
4192 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
4193 allow access to all static members.
4195 2005-05-04 Martin Baulig <martin@ximian.com>
4197 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
4199 2005-05-04 Martin Baulig <martin@ximian.com>
4203 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
4204 section at the end; make things work if `default' is not the last
4207 2005-05-04 Martin Baulig <martin@ximian.com>
4211 * statement.cs (Switch): Replaced the `got_default' field with a
4212 `default_section' one.
4213 (Switch.CheckSwitch): Set `default_section' here.
4214 (Switch.Resolve): If we're a constant switch and the constant is
4215 not found, use the default section.
4217 2005-05-03 Martin Baulig <martin@ximian.com>
4219 * expression.cs (ArrayAccess.EmitGetLength): New public method.
4221 * statement.cs (Foreach.ArrayForeach): New nested class.
4222 (Foreach.TemporaryVariable): New nested class.
4223 (Foreach.EmitArrayForeach): Removed; this is now in the new
4226 2005-05-03 Raja R Harinath <rharinath@novell.com>
4228 * pending.cs (BaseImplements): Move the #74773 fix here. This is
4230 (VerifyPendingMethods): Revert change below.
4232 * typemanager.cs (IsOverride, RegisterNonOverride): New.
4233 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
4234 that used to trigger warning -28. Remove warning -28.
4235 * expression.cs (Invocation.OverloadResolve): Use
4236 TypeManager.IsOverride to distinguish override methods.
4239 * pending.cs (VerifyPendingMethods): If a base type implements the
4240 requested interface, don't bother checking individual methods of
4241 the base type. As a side-effect, this prevents the creation of
4242 unnecessary proxies.
4244 2005-05-02 Martin Baulig <martin@ximian.com>
4248 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4249 Also `And' the locals if the old vector is null.
4250 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
4251 null; in this case we basically reset all the variables.
4253 2005-05-02 Martin Baulig <martin@ximian.com>
4257 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
4258 Added `FlowBranching branching' argument; always `and' the
4259 variables instead of `or'ing them unless we're an infinite loop.
4261 * statement.cs (While.Resolve): Create a new sibling unless we're
4264 2005-05-02 Martin Baulig <martin@ximian.com>
4268 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
4269 arguments; use it instead of creating a new TopLevelBlock.
4270 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
4271 our ConstructorInitializer.
4274 (TopLevelBlock.TopLevelBranching): New public property.
4275 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
4276 and create our `TopLevelBranching'.
4278 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
4279 anonymous method host, use `block.TopLevelBranching' rather than
4280 creating a new branching.
4282 2005-04-20 Miguel de Icaza <miguel@novell.com>
4284 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
4285 a ScopeInfo, if any of the current children is a child of the new
4286 entry, move those children there.
4288 2005-04-30 Martin Baulig <martin@ximian.com>
4290 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
4291 at the beginning of a SwitchSection. Fix #73335.
4293 2005-04-27 Marek Safar <marek.safar@seznam.cz>
4296 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
4298 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
4299 (FieldExpr.DoResolve): Obsolete members are ignored for field
4302 2005-04-26 Marek Safar <marek.safar@seznam.cz>
4304 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
4305 of arrays detection.
4307 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
4309 (Field.VerifyClsCompliance): Volatile fields are not compliant.
4311 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
4314 2005-04-25 Ben Maurer <bmaurer@ximian.com>
4316 * cs-parser.jay: Use the prefered version of -unsafe in error
4319 2005-04-22 Marek Safar <marek.safar@seznam.cz>
4321 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4324 2005-04-20 John Luke <john.luke@gmail.com>
4326 * driver.cs: fix typo in error message, --outout to --output
4328 2005-04-30 Martin Baulig <martin@ximian.com>
4330 * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
4331 handle the .NET 2.x security attributes.
4333 2005-04-30 Martin Baulig <martin@ximian.com>
4336 (TypeManager.ExpandInterfaces): Don't add things twice.
4339 (TypeContainer.VerifyClsCompliance): Allow generic instances.
4341 2005-04-29 Martin Baulig <martin@ximian.com>
4343 * generic.cs (Constraints.ResolveTypes): Expand interfaces.
4345 * anonymous.cs: Added support for anonymous generic methods.
4347 2005-04-29 Martin Baulig <martin@ximian.com>
4349 * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
4352 2005-04-29 Martin Baulig <martin@ximian.com>
4354 * generic.cs (TypeManager.HasConstructorConstraint): Removed.
4356 * expression.cs (New.DoResolve): Fix the CS0304 check.
4358 2005-04-29 Martin Baulig <martin@ximian.com>
4360 * typemanager.cs (TypeManager.GetFullName): Updated to the new
4363 * class.cs (MethodCore.IsDuplicateImplementation): If we're an
4364 explicit interface implementation, compare the interface types.
4365 (MethodData.Define): Use the new naming scheme from the latest
4367 (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
4369 * decl.cs (MemberName.GetMemberName): Removed.
4370 (MemberName.MethodName, FullName): New properties.
4372 2005-04-25 Raja R Harinath <rharinath@novell.com>
4374 * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
4376 2005-04-22 Martin Baulig <martin@ximian.com>
4378 * generic.cs (GenericMethod): Create the EmitContext in the
4379 `Define()'; in `Define(MethodBuilder)', create the type parameters
4380 before calling `Define()'. Fixes #73933.
4382 2005-04-22 Martin Baulig <martin@ximian.com>
4385 (Constraints.Resolve): Make things work wrt. the new type lookup system.
4386 (ConstructedType.ResolveAsTypeTerminal): Don't override this.
4388 * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
4389 ConstructedType, check its constraints.
4391 2005-04-20 Marek Safar <marek.safar@seznam.cz>
4393 * codegen.cs (InRefOutArgumentResolving): New field.
4395 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4396 fields outside contructor.
4398 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4400 2005-04-19 Miguel de Icaza <miguel@novell.com>
4402 * anonymous.cs (CaptureContext.EmitParameterInstance): The
4403 parameter code was not completed ever, so it was not as up-to-date
4404 as local variables. Must finish it.
4406 The bug fix was to compare the Toplevel of the block, not the
4407 current block. Thanks for Ben for pointing this out.
4409 2005-04-19 Raja R Harinath <rharinath@novell.com>
4411 * decl.cs (AddMethods): Use the declaring type of the problem
4412 method to determine if we want to squash a warning.
4414 2005-04-19 Marek Safar <marek.safar@seznam.cz>
4416 * attribute.cs: Removed debug output.
4418 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4420 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4423 2005-04-18 Raja R Harinath <rharinath@novell.com>
4426 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4427 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4428 all null comparisons against reference types.
4430 2005-04-18 Marek Safar <marek.safar@seznam.cz>
4433 * class.cs (TypeContainer.CircularDepException) New nested
4435 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4436 (TypeContainer.DefineType): Removed error, reset InTransit before
4438 (Class.DefineType): Throw exception when is in Transit.
4439 Catch exception and report error.
4440 (Struct.DefineType): Throw exception when is in Transit.
4441 Catch exception and report error.
4442 (Interface.DefineType): Throw exception when is in Transit.
4443 Catch exception and report error.
4445 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4446 handle nested exception handlers.
4448 * flowanalysis.cs (InTryWithCatch): New method, search for try with
4451 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4452 InFinally and InCatch storage.
4454 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4455 (Catch.Resolve): Set and Restore ec.InCatch.
4456 (Try.Resolve): Set and Restore ec.InFinally.
4457 (Try.HasCatch): True when try has catch.
4459 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
4461 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4462 for the same event member, so exclude such cases from warning 419.
4465 2005-04-16 Miguel de Icaza <miguel@novell.com>
4467 * expression.cs (Binary.ResolveOperator): Apply patch from John
4468 Luke to fix bug 59864: operators &, | and ^ on enumerations
4469 require that the same enum type on both sides.
4471 * driver.cs: Add warnings to old flag usage, this is to assist
4472 people who produce Makefiles and hope that the Makefiles will be
4475 * class.cs (TypeContainer.EmitType): Moved the definition of the
4476 special $PRIVATE$ field from the resolve phase to the Emit phase.
4477 During resolve we do not know if we are a struct with
4478 HasExplicitLayout, we know this only after the attributes for the
4481 Set the FieldOffset to zero on the dummy field that we create for
4482 the class. Fixes 74590.
4484 2005-04-16 Raja R Harinath <rharinath@novell.com>
4487 * ecore.cs (PropertyExpr.resolved): New.
4488 (DoResolve): Use it to handle a case of double resolution here.
4489 Handle a case of identical-name-and-type-name.
4490 * expression.cs (ArrayCreation.CheckIndices): Avoid double
4491 resolution by storing the results of expression resolution back
4492 into the "probes" array.
4494 2005-04-15 Raja R Harinath <rharinath@novell.com>
4496 Fix cs0208-7.cs and cs0208-8.cs.
4497 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4498 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
4499 error reporting to point out the reason a struct is not unmanaged.
4501 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4503 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
4504 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4506 2005-04-13 Raja R Harinath <rharinath@novell.com>
4509 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4510 IdenticalNameAndTypeName here.
4511 (EventExpr.InstanceResolve): Likewise.
4513 2005-04-13 Marek Safar <marek.safar@seznam.cz>
4515 C# 2.0 DefaultCharSetAttribute implementation
4517 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4518 which allows us to set GlobalNamespace for every resolve.
4519 (Attribute.ResolveArguments): Cut from Resolve.
4520 (Attribute.GetCharSetValue): Returns CharSet named argument.
4521 (Attribute.DefinePInvokeMethod): Gets default charset from
4523 (GlobalAttribute.ResolveAsTypeStep): Override.
4524 (GlobalAttribute.ResolveArguments): Override.
4526 * class.cs (TypeAttr): Is protected.
4528 * codegen.cs (ModuleClass.DefaultCharSet): New member.
4529 (ModuleClass.DefaultCharSetType): New memeber.
4530 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4532 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4533 charset from module.
4535 * delegate.cs (TypeAttr): Override.
4536 (Delegate.DefineType): Use this TypeAttr.
4538 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4539 at very early stage (before types are defined) to resolve model
4540 module attributes. It will probably not work with corlib but it
4543 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4544 charset from module.
4546 * typemanager.cs (default_charset_type): New type.
4548 2005-04-13 Raja R Harinath <rharinath@novell.com>
4550 * decl.cs (MemberCache.AddMethods): Don't warn if
4551 System.Object.Finalize has buggy MethodAttributes.
4553 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4556 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4558 * doc.cs : detect ambiguous reference to overloaded members.
4559 Fixed bug #71603. MS 1.1 csc does not detect it.
4561 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4563 * doc.cs : delegates must not be referenced with parameters.
4566 2005-04-12 Miguel de Icaza <miguel@novell.com>
4568 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4570 2005-04-10 Miguel de Icaza <miguel@novell.com>
4572 * driver.cs (MainDriver): Stop processing if the CLS stage found
4575 (CompilerCallableEntryPoint.InvokeCompiler): Always
4576 reset after execution; Take a TextWriter argument for the
4579 * report.cs: Use the error stream instead of hardcoding stderr.
4581 2005-04-09 Miguel de Icaza <miguel@novell.com>
4583 * class.cs: Reduce code paths to test, too small of an
4584 optimization to make it worth the extra testing. Always perform
4587 2005-04-08 Raja R Harinath <rharinath@novell.com>
4590 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4591 operators that had errors reported on them.
4593 2005-04-08 Marek Safar <marek.safar@seznam.cz>
4595 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4597 (Attribute.Resolve): Add named argument type checking.
4599 * class.cs (FixedField.Define): Use IsPrimitiveType
4601 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4603 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4604 unsafe parameter types.
4606 * statement.cs (Using.ResolveExpression): Add better error description.
4608 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4610 2005-04-08 Raja R Harinath <rharinath@novell.com>
4613 * attribute.cs (Attribute.GetAttributeUsage): Resolve
4614 AttributeUsageAttribute in the emitcontext of the attribute class,
4615 not in the emitcontext of the attributable entity it was attached to.
4616 * cs-parser.jay: Use 'current_class', not 'current_container',
4617 when creating a GlobalAttribute.
4619 2005-04-08 Alp Toker <alp@atoker.com>
4621 * pending.cs: The fix to #58413 failed to compile methods implementing
4622 interfaces with/without params modifiers and vice versa, even though
4623 params modifiers aren't part of the signature. Make the modifier check
4624 less strict as in csc.
4626 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
4627 Anoob V E <projectmonokochi@rediffmail.com>
4628 Harilal P R <projectmonokochi@rediffmail.com>
4631 * pending.cs (TypeAndMethods.mods): New. Store the parameter
4632 modifiers of pending methods.
4633 (PendingImplementation.PendingImplementation): Initialize it.
4634 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4635 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4636 with ParameterData. Add check for modifiers.
4637 * class.cs (MethodData.Define): Update to changes.
4639 2005-04-07 Raja R Harinath <rharinath@novell.com>
4641 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4643 2005-04-07 Marek Safar <marek.safar@seznam.cz>
4645 * class.cs (PropertyMethod.Define): Check private accessor in abstract
4648 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4651 * typemanager.cs: Registered RequiredAttributeAttribute.
4653 2005-04-06 Marek Safar <marek.safar@seznam.cz>
4655 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4656 Warning CS0169 is back at level 3.
4657 (IMethodData.SetMemberIsUsed): New method.
4659 * decl.cs (IsUsed): New value; moved from FieldBase.Status
4660 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4662 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4664 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4666 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4669 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4672 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4673 to avoid the problems with nested types.
4675 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
4676 Anoob V.E <projectmonokochi@rediffmail.com>
4677 Harilal P.R <projectmonokochi@rediffmail.com>
4678 Raja R Harinath <rharinath@novell.com>
4681 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4683 * typemanager (GetConstructor): Make public.
4685 2005-04-05 John Luke <john.luke@gmail.com>
4686 Raja R Harinath <rharinath@novell.com>
4689 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4690 struct too. Return false quicker in a few cases.
4691 (VerifyUnManaged): Use it.
4693 2005-04-05 Raja R Harinath <rharinath@novell.com>
4696 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4697 not 'unreachable_seen'.
4699 2005-04-04 Marek Safar <marek.safar@seznam.cz>
4701 * attribute.cs (Attribute.GetValue): Removed unused.
4703 * codegen.cs (CodeGen.TrimExt): Removed unused.
4705 * cs-parser.jay (output): Removed unused.
4707 * cs-tokenizer.cs (hex_digits): Removed unused.
4709 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4711 * expression.cs (Indirection.LoadExprValue): Removed unused.
4712 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4714 * iterators.cs (Iterator.param_types): Removed unused.
4716 * statement.cs (Goto.block): Removed unused.
4717 (ToplevelBlock.did): Removed unused.
4718 (Switch.ResolveConstantSwitch): Removed unused.
4720 2005-04-01 Ben Maurer <bmaurer@ximian.com>
4722 * rootcontext.cs: Allow mcs to bootstrap with the compilation
4725 2005-04-19 Martin Baulig <martin@ximian.com>
4727 Merged r42462 from MCS and made it work for GMCS.
4729 * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
4731 * generic.cs (GenericMethod.Define): Removed `return_type' argument.
4733 2005-04-01 Raja R Harinath <rharinath@novell.com>
4735 Fix #74232 and cs0208-3.cs.
4736 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4737 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4738 unmanaged type. Don't use FieldBuilders when 't' is a
4739 TypeBuilder. Use ModFlags and MemberType fields.
4740 * class.cs (MemberBase.member_type): Rename from MemberType.
4741 (MemberBase.MemberType): New property. Determines member_type on
4743 (MemberBase.DoDefine): Don't initialize MemberType here.
4744 (FieldMember.Define): Likewise.
4746 2005-04-01 Marek Safar <marek.safar@seznam.cz>
4749 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4750 Attributes are emitted there.
4752 2005-04-01 Raja R Harinath <rharinath@novell.com>
4754 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4755 keyword in 'partial enum' too.
4756 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4758 Report from Kamil Skalski <nazgul@omega.pl>.
4761 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4762 have partial containers too.
4764 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4765 in block' checks to Block.CheckInvariantMeaningInBlock.
4766 * statement.cs (Block.GetKnownVariableInfo): Make private.
4767 (Block.IsVariableUsedInChildBlock): Remove.
4768 (Block.IsVariableUsedInBlock): Likewise.
4769 (Block.CheckInvariantMeaningInBlock): New. Show location of
4770 conflicting declaration.
4771 (Block.AddVariable): Make error messages less long-winded and more
4772 specific. Show location of conflicting declaration.
4773 * parameter.cs (Parameters.Location): New readonly property.
4775 2005-03-31 Raja R Harinath <rharinath@novell.com>
4777 Clean up semantics of invoking ResolveMemberAccess.
4778 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4779 can have an instance, ensure that we pass in a non-TypeExpression
4780 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
4781 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4782 argument. Update to changes and simplify.
4783 (FieldExpr.Emitinstance): Remove CS0120 check.
4784 (PropertyExpr.EmitInstance): Likewise.
4785 * expression.cs (Argument.Resolve): Likewise.
4786 (Invocation.DoResolve): Update to changes in semantics of
4789 2005-03-31 Marek Safar <marek.safar@seznam.cz>
4792 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4795 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4797 2005-03-31 Raja R Harinath <rharinath@novell.com>
4799 Fix difference in behaviour with commandline invocation.
4800 * driver.cs (Driver.Reset): New.
4801 (CompilerCallableEntryPoint): Call it.
4803 * statement.cs (If.Resolve): Avoid spurious "uninitialized
4804 variable" warnings if the boolean expression failed to resolve.
4806 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
4808 * attribute.cs: Fix the union of several permissions when some of them
4809 are unrestricted (so the result isn't an unrestricted permission set).
4812 2005-03-30 Raja R Harinath <rharinath@novell.com>
4814 * ecore.cs (MemberExpr): New class. Convert from interface
4816 (MemberExpr.ResolveMemberAccess): Refactor and move here from
4817 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
4819 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4820 (MethodGroupExpr.IsExplicitImpl): Remove.
4821 (Expression.GetFieldFromEvent): Remove.
4822 (SimpleName.MemberStaticCheck): Remove.
4823 (SimpleName.DoSimpleNameResolve): Update to changes.
4824 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4825 (MemberAccess.IdenticalNameAndTypeName): Remove.
4826 (MemberAccess.error176): Move to MemberExpr.
4827 (MemberAccess.DoResolve): Update to changes.
4828 (BaseAccess.DoResolve): Likewise.
4830 2005-03-30 Marek Safar <marek.safar@seznam.cz>
4832 C# 2.0 Conditional attribute class implementation
4834 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4835 Analyzes class whether it has attribute which has ConditionalAttribute
4836 and its condition is not defined.
4838 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4839 (Class.IsExcluded): New method. Search for at least one defined
4840 condition in ConditionalAttribute of attribute class.
4842 2005-03-30 Raja R Harinath <rharinath@novell.com>
4844 * ecore.cs (PropertyExpr): Derive from Expression, not
4845 ExpressionStatement.
4846 (PropertyExpr.EmitStatement): Remove.
4848 2005-03-29 Raja R Harinath <rharinath@novell.com>
4851 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4852 internal field "value__" of an enum be private. The examples for
4853 "value__" that I found on MSDN all used FieldAttributes.Private.
4855 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4856 Don't mention IL method attribute names.
4858 Fix #47991. Remove a TODO.
4859 * statement.cs (Block.Toplevel): Make into a field.
4860 (Block.Parameters): Move into ToplevelBlock.
4861 (Block.known_variables): Rename from child_variable_names.
4862 (Block.Block): Remove variants that take Parameters. Initialize
4863 'Toplevel' with the immediately surrounding toplevel block.
4864 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
4865 LocalInfo parameter.
4866 (Block.GetKnownVariableInfo): New.
4867 (Block.IsVariableNameUsedInChildBlock): Update.
4868 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
4869 the block, even though it may not be in scope.
4870 (Block.AddVariable): Remove Parameters parameter. Use
4871 Toplevel.Parameters instead.
4872 (Block.AddConstant): Remove Parameters parameter.
4873 (Block.GetParameterReference): Update to use Toplevel.Parameters.
4874 (Block.IsParamaterReference): Likewise.
4875 (Block.IsLocalParameter): Likewise. Simplify a lot.
4876 (ToplevelBlock.Parameters): New. Moved from Block.
4877 (ToplevelBlock.ToplevelBlock): Update to changes. Always
4878 initialize Parameters to a non-null value.
4879 * cs-parser.jay: Update to changes.
4880 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4881 simple names that mean different things in the same block. Use
4882 Block.IsVariableNameUsedInBlock.
4884 2005-03-28 Raja R Harinath <rharinath@novell.com>
4886 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4888 2005-03-26 Raja R Harinath <harinath@acm.org>
4891 * assign.cs (Assign.DoResolve): When the RHS of an assignment
4892 fails to resolve, ensure that the LHS is still resolved as an
4895 2005-03-25 Raja R Harinath <harinath@acm.org>
4897 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4899 (Enum.current_ec): Remove.
4900 (Enum.LookupEnumValue): Remove EmitContext argument.
4901 Just uses the one created during DefineType.
4902 (Enum.FindMembers): Update.
4903 * expression.cs (MemberAccess.DoResolve): Update.
4905 2005-03-22 Marek Safar <marek.safar@seznam.cz>
4907 * assign.cs (Assign.DoResolve): Check for CS1717 when
4908 source and target are same (uses Equals).
4910 * expression.cs (LocalVariableReference, ParameterReference,
4911 This): Implemented Equals, GetHashCode.
4913 * statement.cs (Block.GetParameterReference): Removed useless
4916 2005-03-22 Raja R Harinath <rharinath@novell.com>
4919 * statement.cs (Block.AddVariable): Ensure that we skip implicit
4920 blocks before deciding whether the error is cs0136 or cs0128.
4922 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4923 (using_alias_directive, using_namespace_directive): Pass
4924 MemberName, not an expression to Namespace.UsingAlias and
4926 (MakeName): Use the MemberName of the namespace.
4927 * namespace.cs (Namespace.MemberName): New.
4928 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4929 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4931 * decl.cs (MemberName.Name): Make readonly.
4932 (MemberName.FromDotted): New "constructor".
4933 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4934 (MemberCore.Name): Compute from MemberName on demand.
4935 (MemberCore.SetMemberName): Provide a way to change the
4937 (MemberCore.AddToContainer): Don't take a fullname parameter.
4938 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4939 fully qualified name of the container to the member name.
4940 (TypeContainer.AddToTypeContainer): Use a fully qualified name
4941 only if the type is a member of the root container.
4942 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4943 MemberName.Left rather than searching for an embedded ".".
4944 (PartialContainer.CreatePart): Update to changes in RootContext.
4945 (MemberBase.ShortName): Turn into a property. Use
4946 MemberCore.SetMemberName.
4947 (MemberBase.ExplicitInterfaceName): Remove.
4948 (MemberBase.UpdateMemberName): Remove.
4949 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4950 (PropertyBase.SetMemberName): New override.
4951 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4952 (Tree.GetDecl): New.
4953 (Tree.AllDecls): Rename from Decls.
4954 * attribute.cs, enum.cs, report.cs: Update to changes.
4955 * driver.cs (MainDriver): Use MemberName.FromDotted on
4956 RootContext.MainClass.
4958 2005-03-21 Marek Safar <marek.safar@seznam.cz>
4960 * class.cs (FixedField.Define): Check for CS1664 and more sanity
4963 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4965 2005-03-18 Marek Safar <marek.safar@seznam.cz>
4967 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4968 property accessor modifiers.
4970 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4971 fixed buffer attribute (CS1716).
4972 (PropertyMethod.HasCustomAccessModifier): When property accessor
4973 has custom modifier.
4975 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4977 (PropertyExpr.DoResolveLValue): Add CS0272.
4979 2005-03-17 Miguel de Icaza <miguel@novell.com>
4981 * convert.cs: When converting to a pointer, use the proper Conv.U
4982 or Conv.I depending on the source data type.
4984 * cs-tokenizer.cs: Make the size for large decimal constants,
4987 2005-03-17 Martin Baulig <martin@ximian.com>
4989 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4990 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
4992 2005-03-17 Martin Baulig <martin@ximian.com>
4994 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4995 to bool so we can return an error condition.
4996 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4999 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
5001 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
5004 2005-03-16 Raja R Harinath <rharinath@novell.com>
5006 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
5007 Refactor to avoid traversing the list of assemblies, and to avoid
5008 string concatenation.
5009 * typemanager.cs (guid_attr_type): Remove.
5010 (negative_hits, pointers, references): Remove hashes.
5012 (GetConstructedType): New. Uses type_hash to handle constructed
5013 types (arrays, references, pointers).
5014 (GetReferenceType, GetPointerType): Use it.
5015 (GetNestedType): New. Uses type_hash to handle nested types of
5017 (LookupType, LookupTypeDirect): Remove.
5018 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
5019 'types' hash and LookupTypeReflection directly.
5020 (params_string, params_object): Use GetConstructedType.
5021 * namespace.cs (Namespace.cached_types): New. Cache of reflected
5023 (Namespace.Lookup): Use cached_types.
5024 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
5025 provided by old TypeManager.LookupType.
5026 * rootcontext.cs (MakeFQN): Remove.
5027 * decl.cs (DeclSpace.MakeFQN): Likewise.
5028 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
5029 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
5030 TypeManager.GetConstructedType.
5031 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
5033 2005-04-16 Zoltan Varga <vargaz@freemail.hu>
5035 * cs-parser.jay: Fix build.
5037 2005-03-15 Marek Safar <marek.safar@seznam.cz>
5039 * class.cs (TypeContainer.CircularDepException) New nested
5040 (MethodCore.CheckBase): Report CS1715 for properties and indexers.
5042 * cs-parser.jay: Reports CS1527 for any namespace element.
5044 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
5047 * expression.cs (ParameterReference.IsAssigned): Changed error to
5049 (Error_WrongNumArguments): Moved CS0245 detection here.
5051 * statement.cs (Return.Resolve): Add CS1622 report.
5053 2005-03-11 Marek Safar <marek.safar@seznam.cz>
5055 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
5057 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
5059 * attribute.cs expression.cs: Get rid of some allocations.
5061 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
5063 * doc.cs : just eliminate the latest change.
5065 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5067 * doc.cs : commented out the latest change. It breaks xml-030.cs
5069 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5071 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
5072 fail. So invoke CreateType() in FindDocumentedType().
5074 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5076 * cs-tokenizer.cs : added IsKeyword().
5077 * doc.cs : Detect keyword incorrectly used as identifier.
5078 Allow identifiers prefixed by @.
5080 2005-03-10 Marek Safar <marek.safar@seznam.cz>
5082 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
5083 It caused exception in namespace resolving (again!).
5085 * class.cs (Class.ctor): Removed exit.
5086 (PropertyMethod.ctor): ditto.
5088 * codegen.cs (Codegen.Reset): Reset static data.
5089 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
5091 * cs-tokenizer.cs (Cleanup): Removed.
5093 * driver.cs (GetSystemDir): Rewrote to one line command.
5094 It caused problem with unloaded dynamic modules.
5095 (UnixParseOption): Removed Exit.
5096 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
5097 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
5098 Now can be mcs used as library.
5100 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
5103 * location.cs (Reset): Reset static data.
5105 * namespace.cs (Reset): Reset static data.
5107 * report.cs (Report.Reset): Reset static data.
5109 * rootcontext.cs (RootContext.Reset): Reset static data.
5111 * tree.cs (RootTypes.ctor): Use Location.Null
5113 * typemanager.cs (TypeManager.Reset): Reset static data.
5114 (CoreLookupType): Removed Exit.
5115 (TypeHandle.Reset): Reset static data.
5117 2005-03-10 Raja R Harinath <rharinath@novell.com>
5120 * typemanager.cs (ComputeNamespaces): Import namespaces from
5121 referenced modules too.
5123 2005-03-09 Raja R Harinath <rharinath@novell.com>
5125 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
5128 2005-03-09 Raja R Harinath <rharinath@novell.com>
5130 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
5131 enclosing DeclSpace. This ensures that a name-lookup populates
5132 more caches and there are fewer 'TypeExpression's. Carve out
5133 nested type lookup into ...
5134 (LookupNestedTypeInHierarchy): ... this.
5136 2005-04-15 Martin Baulig <martin@ximian.com>
5138 Merged r41590 from MCS and make it work in the generics land.
5140 * generic.cs (TypeParameter.UpdateConstraints): Removed the
5143 * class.cs (PartialContainer.UpdateConstraints): Removed.
5144 (PartialContainer.CheckConstraints): Removed.
5145 (PartialContainer.SetParameterInfo): Store the constraints here.
5146 (PartialContainer.DefineTypeParameters): New public method;
5147 resolve the type parameter's constraints here. Note that the
5148 PartialContainer doesn't have an EmitContext anymore, so we must
5149 do this in the ClassPart.
5151 2005-03-09 Raja R Harinath <rharinath@novell.com>
5153 Clean up a few partial-class semantics.
5154 Fixes test-357.cs and cs1618-2.cs.
5155 * cs-parser.jay (struct_declaration): Use 'current_class' as
5156 parent of newly-created struct. Remove call to Register ().
5157 Use 'pop_current_class' to complete handing the current struct.
5158 (interface_declaration): Likewise.
5159 (class_declaration): Likewise.
5160 (enum_declaration): Use 'current_class' as parent of newly created
5162 (delegate_declaration): Likewise.
5163 (pop_current_class): New function. This is used to handle closing
5164 up the 'current_class' and 'current_container', and pointing them
5165 to the enclosing class/container.
5166 (CSharpParser): Initialize 'current_class' too.
5167 * decl.cs (MemberCore): Add check for invariant: a partial
5168 container is not a parsed entity, and thus does not enclose any
5170 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
5171 (DeclSpace.BaseTypeExpr): Use it.
5172 (DeclSpace.LookupType): Add check for invariant.
5173 * class.cs (TypeContainer): Add check for invariant: a nested
5174 class should have the same NamespaceEntry as its enclosing class.
5175 (TypeContainer.EmitFieldInitializers): Make virtual.
5176 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
5178 (TypeContainer.Register): Remove.
5179 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
5180 null. Use TypeResolveEmitContext for resolving base types and
5181 interfaces. Move initialization of Parts.TypeBuilder here from
5183 (TypeContainer.DefineNestedTypes): ... here.
5184 (PartialContainer): Take a Namespace not a NamespaceEntry.
5185 (PartialContainer.Create): Don't use Register. Call the
5186 appropriate Add... function directly.
5187 (ClassPart): Take both the PartialContainer and the enclosing
5188 class as constructor arguments.
5189 (ClassPart.EmitFieldInitializers): Override.
5190 (ClassPart.PartFindNestedTypes): Remove.
5191 (FieldBase.GetInitializerExpression): Resolve the initializer
5192 expression in the emit context of the enclosing class.
5193 * tree.cs (RootTypes): Remove Register ().
5195 2005-03-08 Marek Safar <marek.safar@seznam.cz>
5197 * cs-parser.jay: Removed CS0134.
5199 * driver.cs: Removed CS1901.
5201 * expression.cs (SizeOf.DoResolve): Don't report CS0233
5202 for predefined types.
5204 2005-03-07 Duncan Mak <duncan@novell.com>
5206 * codegen.cs (Save): Catch UnauthorizedAccessException as
5207 well. Fixes bug #73454.
5209 2005-03-07 Marek Safar <marek.safar@seznam.cz>
5211 * cs-tokenizer.cs (xtoken): Add CS1035.
5213 * class.cs (MethodData.Define): Add CS0683.
5214 (FieldMember.ctor): Add CS0681.
5216 2005-03-07 Raja R Harinath <rharinath@novell.com>
5218 * ecore.cs (SimpleName.DoResolve): Rename from
5219 SimpleName.DoResolveAllowStatic.
5220 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
5221 Pass 'intermediate' flag to MemberStaticCheck.
5222 (SimpleName.MemberStaticCheck): Skip "static check" only in case
5223 of "intermediate" lookups via MemberAccess.
5224 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
5225 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
5227 2005-03-07 Raja R Harinath <rharinath@novell.com>
5230 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
5231 slipped in because of variable names that are identical to a
5232 builtin type's BCL equivalent ('string String;', 'int Int32;').
5233 (PropertyExpr.EmitInstance): Likewise.
5235 2005-03-04 Marek Safar <marek.safar@seznam.cz>
5237 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
5239 * report.cs (warning_ignore_table): Made public.
5241 2005-03-04 Raja R Harinath <rharinath@novell.com>
5244 * class.cs (MethodData.Emit): Pass 'container' to
5245 container.GetObsoleteAttribute instead of 'container.Parent'.
5247 2005-03-03 Marek Safar <marek.safar@seznam.cz>
5249 * cs-parser.jay: Add 1534 error test.
5251 * iterators.cs (Yield.CheckContext): Add error 1629.
5252 (Iterator.ctor): Save unsafe modifier.
5253 (MoveNextMethod.DoEmit): Restore unsafe context.
5255 * namespace.cs (UsingAlias): Better error message.
5257 2005-03-03 Dan Winship <danw@novell.com>
5259 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
5260 the warning message [#73219]
5262 2005-03-03 Raja R Harinath <rharinath@novell.com>
5264 Fix compile with MCS 1.0.0.0.
5265 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
5266 w_restore to not depend on string constant folding.
5268 2005-03-03 Raja R Harinath <rharinath@novell.com>
5270 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
5271 CS0246 check to users who passed 'silent = false'.
5272 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
5274 (SimpleName.SimpleNameResolve): Update.
5275 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
5276 (MemberAccess.IdenticalNameAndTypeName): Update.
5277 * doc.cs (FindDocumentedTypeNonArray): Update.
5279 2005-03-03 Raja R Harinath <rharinath@novell.com>
5281 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
5282 * parameters.cs (ComputeAndDefineParameters): Remove.
5283 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
5284 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
5285 Use GetParameterInfo.
5287 2005-03-02 Marek Safar <marek.safar@seznam.cz>
5289 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
5291 2005-03-02 Raja R Harinath <rharinath@novell.com>
5293 Unify DeclSpace.LookupType and DeclSpace.FindType.
5294 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
5295 is in charge of defining nested types on demand.
5296 (DeclSpace.LookupType): Use it when the current_type is a
5297 TypeBuilder. Use LookupTypeDirect for reflected types.
5298 (DeclSpace.FindType): Remove.
5299 (DeclSpace.LookupInterfaceOrClass): Likewise.
5300 (DeclSpace.DefineTypeAndParents): Likewise.
5301 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
5302 DeclSpace.LookupType.
5303 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
5304 * typemanager.cs (LookupType): Simplify.
5305 (AddUserType): Remove type from negative_hits.
5306 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
5307 * class.cs (TypeContainer.FindMembers): Move handling of nested
5309 (TypeContainer.FindMembers_NestedTypes): ... here.
5310 (TypeContainer.FindNestedType): Implement override.
5311 (ClassPart.FindNestedType): Delegate to PartialContainer.
5312 (ClassPart.PartFindNestedType): Looks up the nested types of the
5315 2005-04-14 Martin Baulig <martin@ximian.com>
5317 * generic.cs (ConstructedType): Moved all the type lookup and
5318 nested class logic into SimpleName.
5319 (ConstructedType.ResolveConstructedType): Our underlying type is
5320 already fully resolved; all the type lookup stuff is in
5323 * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
5324 constructed types here instead of in ConstructedType.
5326 * decl.cs (MemberName.GetTypeExpression): Always create a
5327 SimpleName, not a ConstructedType.
5328 (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
5330 2005-03-02 Martin Baulig <martin@ximian.com>
5332 * class.cs (TypeContainer.DoDefineMembers): We also need a default
5333 static constructor in static classes.
5335 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
5337 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
5338 sizeParamIndex is not specified.
5340 2005-03-01 Marek Safar <marek.safar@seznam.cz>
5343 * report.cs (WarningMessage.IsEnabled): Missing null check.
5345 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5347 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
5348 in the fields and not in the properties.
5350 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
5352 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
5355 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5357 * attribute.cs: Small refactoring (improved robustness).
5358 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
5359 (ValidateGuid): Removed.
5360 (Resolve): Removed referenced to above mentioned.
5361 (GetAttributeUsage): Made private and changed to work without
5363 (GetIndexerAttributeValue): Don't crash.
5364 (GetConditionalAttributeValue): Ditto.
5365 (GetClsCompliantAttributeValue): Ditto.
5366 (ExtractSecurityPermissionSet): All attributes exceptions are
5368 (GetPropertyValue): New helper.
5369 (GetMethodImplOptions): New method.
5370 (DefinePInvokeMethod): Reuse common code. Implemented handling of
5371 some missing properties.
5373 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5374 (Method.ApplyAttributeBuilder): Updated.
5376 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5379 2005-02-28 Raja R Harinath <rharinath@novell.com>
5382 * report.cs (Report.SymbolRelatedToPreviousError): Handle
5383 non-simple types (array, pointer, reference).
5385 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5387 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5389 * class.cs (MethodCore.IsDuplicateImplementation): Special error
5391 (Method.CheckBase): Catch wrong destructor here.
5392 (MethodData.Define): Add errors 550, 668.
5394 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5396 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5398 * pending.cs (VerifyPendingMethods): Add error 551.
5400 * typemanager.cs (CSharpName): Next error report helper.
5402 2005-02-25 Marek Safar <marek.safar@seznam.cz>
5404 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5405 attributes. Removed useless attribute double check.
5406 It saves almost 2MBs for corlib.
5408 2005-02-25 Raja R Harinath <rharinath@novell.com>
5411 * statement.cs (ExpressionStatement.Resolve): Make robust to being
5412 called twice in case of error.
5414 2005-02-23 Chris Toshok <toshok@ximian.com>
5416 Fix compiler portions of #72827.
5417 * statement.cs (Block.Emit): call Begin/EndScope on the
5418 EmitContext instead of the ILGenerator.
5420 * codegen.cs (EmitContext.BeginScope): new method, call
5421 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5423 (EmitContext.BeginScope): same, but EndScope and CloseScope
5425 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5426 offset and call the superclass's OpenScope(int) with it.
5427 (SymbolWriter.CloseScope): get the current il
5428 offset and call superclass's CloseScope(int) with it.
5430 2005-02-23 Marek Safar <marek.safar@seznam.cz>
5432 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5433 CS1677 for out and ref as well.
5435 * class.cs (Method.Define): Add error CS1599 detection.
5437 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5439 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5441 * delegate.cs (Delegate.Define): Add error CS1599 detection.
5443 * support.cs.cs (ModifierDesc): New helper method.
5445 2005-02-23 Raja R Harinath <rharinath@novell.com>
5446 Abin Thomas <projectmonokochi@rediffmail.com>
5447 Anoob V E <projectmonokochi@rediffmail.com>
5448 Harilal P R <projectmonokochi@rediffmail.com>
5451 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5452 MemberLookup (used for error reporting) actually returns a result.
5453 Fix error report number (122, not 112).
5455 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
5456 Anoob V E <projectmonokochi@rediffmail.com>
5457 Harilal P R <projectmonokochi@rediffmail.com>
5460 * pending.cs (PendingImplementation.GetAbstractMethods):
5461 Find NonPublic members too.
5463 2005-02-22 Marek Safar <marek.safar@seznam.cz>
5465 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5468 * class.cs (MethodCore.CheckMethodAgainstBase):
5469 Add error 239 report.
5471 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5473 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5475 * class.cs (Operator.Define): Add error 217 report.
5477 2005-02-21 Raja R Harinath <rharinath@novell.com>
5480 * expression.cs (Invocation.IsApplicable): Make public.
5481 (Invocation.IsParamsMethodApplicable): Likewise.
5482 * delegate.cs (Delegate.VerifyApplicability): Don't use
5483 Invocation.VerifyArgumentCompat for parameter applicability
5484 testing. Use Invocation.IsApplicable and
5485 Invocation.IsParamsMethodApplicable.
5487 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5489 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5491 * class.cs (Operator.Define): Add error 217 report.
5493 2005-02-21 Raja R Harinath <rharinath@novell.com>
5495 * namespace.cs (UsingEntry.Resolve): Undo change below.
5497 2005-02-21 Raja R Harinath <rharinath@novell.com>
5500 * ecore.cs (Expression.MemberLookupFailed): Add argument to
5501 disable the error message when the extended MemberLookup also
5503 (Expression.MemberLookupFinal): Update.
5504 (SimpleName.DoSimpleNameResolve): Update.
5505 * expression.cs (MemberAccess.ResolveNamespaceOrType):
5506 Don't use MemberLookupFinal.
5507 (New.DoResolve): Update.
5508 (BaseAccess.CommonResolve): Update.
5510 2005-02-21 Raja R Harinath <rharinath@novell.com>
5513 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5514 occured previously, don't resolve again.
5516 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5519 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5520 argument. Call ResolveAttributeUsage for unresolved.
5521 when types doesn't match ctor arguments.
5523 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5524 for nested attribute classes.
5525 (Class.attribute_usage): Removed.
5526 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5527 for attribute class.
5529 * ecore.cs (IsAttribute): Removed.
5531 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5533 * rootcontext.cs (RegisterAttribute): Removed, attributes are
5535 (attribute_types): Removed.
5536 (EmitCode): Global attributes are emited as the latest.
5538 2005-02-18 Marek Safar <marek.safar@seznam.cz>
5540 * class.cs (EmitFieldInitializers): Don't emit field initializer
5541 for default values when optimilization is on.
5543 * constant.cs (Constant.IsDefaultValue): New property.
5545 * driver.cs: Add /optimize handling.
5549 * literal.cs: Implement new IsDefaultValue property.
5551 * rootcontext.cs (Optimize): New field, holds /optimize option.
5553 2005-02-18 Raja R Harinath <rharinath@novell.com>
5555 Fix crasher in re-opened #72347.
5556 * namespace.cs (Namespace.Lookup): Return null if
5557 DeclSpace.DefineType returns null.
5560 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5562 2005-02-18 Raja R Harinath <rharinath@novell.com>
5564 Fix remainder of #63202. Change semantics of DoResolveLValue: it
5565 now returns null if it cannot resolve to an lvalue.
5566 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5567 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5568 returned null. Remove check for SimpleName.
5569 (EventExpr.DoResolveLValue): New.
5570 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5571 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
5573 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
5575 (Unary.ResolveOperator): Move CS0211 check ...
5576 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
5578 (Unary.DoResolveLValue): Simplify.
5579 (AddressOf.DoResolveLValue): New.
5580 (ArrayAccess.DoResolveLValue): New.
5582 2005-02-16 Marek Safar <marek.safar@seznam.cz>
5584 * attribute.cs (Attribute.Resolve): Add arguments casting for
5585 when types doesn't match ctor arguments.
5587 2005-02-16 Raja R Harinath <rharinath@novell.com>
5589 Fix parts of #63202.
5590 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5591 lookup of operator in base type. Ensure that all checks happen
5592 when the operator resolves to an "op_..." method.
5594 2005-02-15 Raja R Harinath <rharinath@novell.com>
5597 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5598 'ignore_cs0104' parameter. Pass it to ...
5599 (NamespaceEntry.Lookup): ... this.
5600 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5601 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5602 (TypeLookupExpression.DoResolveAsTypeStep): Update.
5603 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5604 Update. Request that cs0104 errors be ignored.
5605 (ComposedCast.ResolveAsTypeStep): Update.
5607 2005-02-14 Raja R Harinath <rharinath@novell.com>
5610 * expression.cs (Invocation.BetterFunction): Remove support for
5611 comparing virtual functions and their overrides.
5612 (Invocation.IsOverride): New.
5613 (Invocation.OverloadResolve): Don't consider 'override' functions
5614 during candidate selection. Store them in a lookaside list.
5615 If the selected method is a 'virtual' function, use the list to
5616 find any overrides that are closer to the LHS type.
5618 2005-02-14 Marek Safar <marek.safar@seznam.cz>
5620 * expression.cs (New.DoResolve): Add complex core type reduction.
5621 (New.Constantify): Converts complex core type syntax like 'new int ()'
5624 2005-02-14 Raja R Harinath <rharinath@novell.com>
5626 * decl.cs (EntryType.EntryType): New constructor to create an
5627 updated copy of a cache entry.
5628 (MemberCache.AddMethods): Use it.
5629 (MemberCache.ClearDeclaredOnly): Remove.
5630 (MemberCache.MemberCache): Update.
5632 2005-02-11 Miguel de Icaza <miguel@novell.com>
5634 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5635 variable. This one is represents the actual low-level declaration
5636 of the method, as opposed to the semantic level `IsStatic'.
5638 An anonymous method which is hosted into a static method might be
5639 actually an instance method. IsStatic would reflect the
5640 container, while MethodIsStatic represents the actual code
5643 * expression.cs (ParameterReference): Use the new MethodIsStatic
5644 instead of IsStatic.
5646 * anonymous.cs (AnonymousMethod.Compatible): Pass the
5647 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5648 set on the current EmitContext.
5650 * expression.cs (Cast): Overload DoResolveLValue so we can pass
5651 resolve our casted expression as an LValue. This triggers the
5652 proper LValue processing that is later required by Assign.
5656 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5658 2005-02-11 Marek Safar <marek.safar@seznam.cz>
5660 C# 2.0 Fixed buffer implementation
5662 * anonymous.cs: Update after RegisterHelperClass renaming.
5664 * attribute.cs (AttributeTester.fixed_buffer_cache):
5665 Cache of external fixed buffers.
5666 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5667 implementation if field is fixed buffer else null.
5670 (TypeContainer.AddField): Accept FieldMember instead of Field.
5671 (FieldBase.IsFieldClsCompliant): Extracted code from
5672 VerifyClsCompliance descendant customization.
5673 (FixedField): New class handles fixed buffer fields.
5674 (FixedFieldExternal): Keeps information about imported fixed
5676 (IFixedField): Make access to internal or external fixed buffer
5679 * cs-parser.jay: Add fixed buffer parsing.
5681 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5684 * expression.cs (Indirection): Extended implementation to accept
5686 (PointerArithmetic.Emit): Get element from fixed buffer as well.
5687 (ElementAccess.MakePointerAccess): Get type as parameter.
5688 (DoResolve): Add fixed buffer field expression conversion.
5689 (DoResolveLValue): Ditto.
5690 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5691 (ArrayPtr): Derives from FixedBufferPtr.
5692 (ArrayPtr.Emit): Add extra emit for array elements.
5694 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5696 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5697 for compiler generated types.
5698 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5700 * statement.cs (Fixed): Refactored to be easier add fixed buffer
5701 and consume less memory.
5702 (Fixed.Resolve): Add fixed buffer case.
5704 * typemanager.cs (compiler_generated_attr_ctor,
5705 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5706 (HasElementType): Add our own implementation to work on every
5709 2005-02-11 Miguel de Icaza <miguel@novell.com>
5711 * anonymous.cs (CaptureContext): Track whether `this' has been
5714 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
5715 only captured `this' if it was implicitly done (instance
5716 methods/variables were used).
5718 * codegen.cs (EmitContext.CaptureThis): New method to flag that
5719 `this' must be captured.
5721 2005-01-30 Miguel de Icaza <miguel@novell.com>
5723 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5724 is null it means that there has been no need to capture anything,
5725 so we just create a sibling.
5727 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5729 Just a partial fix. The other half is fairly elusive.
5731 2005-02-10 Raja R Harinath <rharinath@novell.com>
5733 Fix #52586, cs0121-4.cs.
5734 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
5735 and return a hashtable.
5736 (MemberCache.ClearDeclaredOnly): New.
5737 (MemberCache.MemberCache): Update to change. Make a deep copy of
5738 the method_hash of a base type too.
5739 (MemberCache.AddMethods): Adapt to having a deep copy of the base
5740 type methods. Overwrite entries with the same MethodHandle so
5741 that the ReflectedType is correct. The process leaves in base
5742 virtual functions and their overrides as distinct entries.
5743 (CacheEntry): Now a class instead of a struct. It shouldn't alter
5744 matters since it was boxed in a ArrayList before.
5745 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5747 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
5748 case of a virtual function and its override (choose the overload
5750 (Invocation.OverloadResolve): Avoid 'override' members during
5751 'applicable_type' calculation.
5753 2005-03-28 Raja R Harinath <rharinath@novell.com>
5755 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5756 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5757 GetTypeHandle. It is possible for a reflected type to derive from
5758 a TypeBuilder (e.g., int[] derives from the TypeBuilder
5759 System.Array during mscorlib compilation).
5760 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5761 contain a method_hash, don't create one either. Don't create a
5762 deep copy of the base cache's method_hash.
5763 (MemberCache.SetupCache): Rename back from DeepCopy.
5764 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5765 already initialized. If we see an override function, add its
5766 underlying base virtual function to the member_hash too.
5768 2005-02-09 Raja R Harinath <rharinath@novell.com>
5770 Combine two near-redundant caches.
5771 * typemanager.cs (method_params): Rename from method_internal_params.
5772 (TypeManager.GetParameterData): New. Replace
5773 Invocation.GetParameterData.
5774 (TypeManager.LookupParametersByBuilder): Remove.
5775 * expression.cs (Invocation.method_parameter_cache): Remove.
5776 (Invocation.GetParameterData): Remove.
5778 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5781 2005-02-08 Raja R Harinath <rharinath@novell.com>
5784 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5785 TypeManager.multicast_delegate_type is null, resolve it by looking
5786 up "System.MulticastDelegate".
5787 * rootcontext.cs (RootContext.ResolveCore): Simplify.
5789 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
5790 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
5791 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
5794 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5795 (LabeledStatement.AddReference): New. Set 'referenced'.
5796 (Goto.Resolve): Use it.
5798 2005-02-05 John Luke <john.luke@gmail.com>
5800 * driver.cs: remove duplicate -doc line in Usage ()
5802 2005-02-04 Raja R Harinath <rharinath@novell.com>
5804 * location.cs (Location.AddFile): Fix CS2002 error report.
5806 2005-02-02 Martin Baulig <martin@ximian.com>
5808 * delegate.cs (Delegate.DefineType): Report an internal error if
5809 TypeManager.multicast_delegate_type is null. See bug #72015 for
5812 2005-02-02 Raja R Harinath <rharinath@novell.com>
5814 Fix a crasher in a variant of #31984.
5815 * const.cs (Constant.CheckBase): New override that defers the
5816 new-or-override check in case the base type hasn't been populated
5818 (Constant.Define): Ensure the new-or-override check is performed.
5820 2005-02-01 Duncan Mak <duncan@ximian.com>
5822 * const.cs (LookupConstantValue): Check that `ce' is not null
5823 before calling GetValue ().
5825 2005-02-01 Raja R Harinath <rharinath@novell.com>
5827 Fix test-334.cs (#69519).
5828 * cs-parser.jay (using_alias_directive): Pass in an expression to
5829 NamespaceEntry.UsingAlias.
5830 (using_namespace_directive): Pass in an expression to
5831 NamespaceEntry.Using.
5832 (namespace_name): Don't flatten to a string.
5833 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5834 (NamespaceEntry.AliasEntry.Resolve): Lookup using
5836 (NamespaceEntry.UsingEntry): Likewise.
5837 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5839 (NamespaceEntry.LookupForUsing): Remove.
5840 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5842 (NamespaceEntry.Lookup): Remove support for dotted names.
5844 2005-02-01 Raja R Harinath <rharinath@novell.com>
5846 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5848 (NamespaceEntry.ImplicitParent): Compute on demand.
5849 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5850 parallels the current.
5851 (NamespaceEntry.LookupForUsing): Use it.
5852 (NamespaceEntry.Lookup): If the current namespace-entry is
5853 implicit, don't search aliases and using tables.
5855 2005-02-01 Raja R Harinath <rharinath@novell.com>
5858 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5860 (TypeContainer.BaseCache): Compute on demand.
5861 (TypeContainer.FindMembers): Define constants and types if they're
5862 not already created.
5863 (FieldMember.Define): Move resetting of ec.InUnsafe before error
5865 * const.cs (Constant.Define): Make idempotent.
5867 2005-01-29 Miguel de Icaza <miguel@novell.com>
5869 * pending.cs: Produce better code (no nops produced by using Ldarg
5872 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5873 i - 1' it should be arg + 1.
5877 2005-01-28 Raja R Harinath <rharinath@novell.com>
5879 * attribute.cs (Attribute.CheckAttributeType): Make private
5881 (Attribute.ResolveType): Make virtual.
5882 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5883 handling of RootContext.Tree.Types.
5885 2005-01-27 Raja R Harinath <rharinath@novell.com>
5887 Update attribute-handling to use the SimpleName/MemberAccess
5889 * cs-parser.jay (attribute): Pass in an expression to the
5890 constructors of Attribute and GlobalAttribute.
5891 * attribute.cs (Attribute): Take an expression for the name.
5892 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
5893 passed in attribute name expression.
5894 (Attribute.CheckAttributeType): Use it.
5895 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5896 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5897 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
5898 argument to prevent error messages if the lookup fails.
5900 2005-01-27 Marek Safar <marek.safar@seznam.cz>
5902 * expression.cs (Indirection): Implemented IVariable interface
5903 to support indirection in AddressOf operator.
5904 (PointerArithmetic.Emit): Add optimalization for case where
5905 result can be precomputed.
5907 2005-01-26 Martin Baulig <martin@ximian.com>
5909 * class.cs (TypeContainer.AttributeTargets): Return the correct
5910 AttributeTargets depending on our `Kind' instead of throwing an
5911 exception; fixes #71632.
5913 2005-01-26 Marek Safar <marek.safar@seznam.cz>
5916 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5919 2005-03-17 Martin Baulig <martin@ximian.com>
5921 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5922 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
5924 2005-03-17 Martin Baulig <martin@ximian.com>
5926 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5927 to bool so we can return an error condition.
5928 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5931 2005-03-17 Martin Baulig <martin@ximian.com>
5933 * generic.cs (TypeMananager.IsIEnumerable): New public method.
5935 * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
5936 converting from an array-type of T to `IEnumerable<T>'.
5938 2005-03-16 Martin Baulig <martin@ximian.com>
5940 * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
5941 (Nullable.LiftedUnaryMutator): New public class.
5943 * expression.cs (UnaryMutator.DoResolve): Added support for
5946 2005-03-14 Martin Baulig <martin@ximian.com>
5948 * generic.cs (Nullable.NullCoalescingOperator): Implemented.
5950 2005-03-14 Martin Baulig <martin@ximian.com>
5952 * generic.cs (Nullable.LiftedBinaryOperator): Added support for
5953 the comparision operators `<', `>', `<=' and `>='.
5955 2005-03-13 Martin Baulig <martin@ximian.com>
5958 (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
5959 avoid confusion with the `NullLiteral'.
5960 (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
5962 2005-03-13 Martin Baulig <martin@ximian.com>
5964 * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
5965 comparing arbitrary types with the null literal.
5967 2005-03-13 Martin Baulig <martin@ximian.com>
5969 * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
5970 boolean operators '&&', '||', '&' and '|'.
5971 (Nullable.OperatorTrueOrFalse): New public class.
5973 * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
5974 instead of a `StaticCallExpr'; added support for nullables.
5976 2005-03-10 Martin Baulig <martin@ximian.com>
5979 (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
5980 rather than `etype.IsSubclassOf (TypeManager.value_type)'.
5982 2005-03-07 Martin Baulig <martin@ximian.com>
5984 * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
5985 it work if `expr' is not an IMemoryLocation.
5986 (Nullable.Lifted): Implement IMemoryLocation.
5987 (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
5990 2005-03-05 Martin Baulig <martin@ximian.com>
5992 * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
5993 (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
5994 (Nullable): Added support for lifted unary and binary operators.
5996 * expression.cs (Unary.DoResolve): Added support for nullable types.
5997 (Binary.DoResolve): Likewise.
5998 (Conditional.DoResolve): Likewise.
6000 2005-03-02 Martin Baulig <martin@ximian.com>
6002 * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
6004 * class.cs (ClassPart.SetParameterInfo): Override this.
6005 (PartialContainer.SetParameterInfo): Override this.
6006 (TypeContainer.CheckConstraints): New protected method.
6007 (PartialContainer.CheckConstraints): Override this and check
6008 whether the same contraints were specified in all parts of a
6009 partial generic type definition.
6010 (PartialContainer.UpdateConstraints): New public method.
6012 * generic.cs (TypeParameter.UpdateConstraints): New public method.
6014 2005-03-02 Martin Baulig <martin@ximian.com>
6016 Committing a patch from Carlos Alberto Cortez to fix #72887.
6018 * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
6019 casts from `T []' to `int []'.
6021 2005-03-02 Martin Baulig <martin@ximian.com>
6023 * generic.cs (TypeManager.IsEqual): Make this symmetric.
6025 * expression.cs (Binary.ResolveOperator): When resolving a
6026 BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
6027 `=='. Fixes #71866. See gen-127.cs.
6029 2005-03-02 Martin Baulig <martin@ximian.com>
6031 * class.cs (TypeContainer.DoDefineMembers): We also need a default
6032 static constructor in static classes.
6034 2005-03-02 Martin Baulig <martin@ximian.com>
6037 (NullableType.Name, NullableType.FullName): Add a "?" to the name.
6038 (Nullable.LiftedConversion): Added support for user-defined
6041 * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
6043 * cs-parser.jay: Use ComposedCast everywhere instead of
6044 NullableType, so we don't need to check for NullableType
6046 (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
6047 case where we'll be resolved into a `parenthesized_expression_0'
6051 (Convert.UserDefinedConversion): Added nullable conversions.
6053 2005-02-28 Martin Baulig <martin@ximian.com>
6055 * generic.cs (TypeManager.IsNullableType): New static method.
6056 (Nullable): New abstract class.
6057 (Nullable.NullLiteral): New public class.
6058 (Nullable.LiftedConversion): New public class.
6060 * cs-parser.jay (non_expression_type): Changed `builtin_types' to
6061 `builtin_types opt_nullable'.
6064 (Convert.ImplicitConversionStandard): Added nullable conversions.
6065 (Convert.ExplicitConversionStandard): Likewise.
6066 (Convert.ExplicitConversion): Likewise.
6068 2005-02-26 Martin Baulig <martin@ximian.com>
6070 * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
6071 begin with a "?", for instance "?[]". Don't do a type lookup if
6074 2005-02-25 Martin Baulig <martin@ximian.com>
6076 The first part of Nullable Types :-)
6078 * generic.cs (NullableType): New public class.
6079 (NullCoalescingOperator): New public class.
6080 (TypeArguments.Resolve): Add a CS0306 check.
6082 * cs-parser.jay (opt_error_modifier): Removed, this was unused.
6083 (opt_nullable): New rule.
6084 (type): Added `opt_nullable' to `namespace_or_type_name',
6085 `builtin_types' and `pointer_type'.
6086 (array_type): Added `opt_nullable'.
6087 (opt_rank_specifier_or_nullable): New rule; this is the
6088 combination of `opt_rank_specifier' and `opt_nullable'.
6089 (opt_error): New rule; catch errors here.
6090 (nullable_type_or_conditional): New rule; we use this to check for
6091 nullable and still detect the conditional operator.
6092 (local_variable_type): Use `opt_rank_specifier_or_nullable'
6093 instead `opt_rank_specifier'.
6095 * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
6098 2005-02-24 Martin Baulig <martin@ximian.com>
6100 * README, README.Changes: Removed; they're old and obsolete.
6102 2005-02-22 Martin Baulig <martin@ximian.com>
6104 * generic.cs (TypeParameter.Resolve): If resolving the constraints
6105 returned an error, set `constraints' to null to avoid a crash
6107 (TypeParameter.ResolveType): Likewise.
6109 2005-02-22 Martin Baulig <martin@ximian.com>
6112 (Constraints.ResolveTypes): Protect against being called twice.
6113 (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
6114 (TypeParameter.ResolveType): New public method; calls
6115 constraints.ResolveTypes().
6116 (TypeParameter.DefineType): Moved constraints.ResolveType() out
6117 into the new ResolveType().
6118 (GenericMethod.Define): Call ResolveType() on all our
6121 2005-02-21 Martin Baulig <martin@ximian.com>
6124 (TypeManager.generic_nullable_type): New static public field.
6125 (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
6128 (RootContext.ResolveCore): Resolve "System.Nullable`1".
6130 2005-02-15 Martin Baulig <martin@ximian.com>
6132 * generic.cs (ConstructedType.Constraints): Correctly check
6133 constraints if the argument type is a type parameter; fixes
6136 2005-02-02 Martin Baulig <martin@ximian.com>
6138 * delegate.cs (Delegate.DefineType): Report an internal error if
6139 TypeManager.multicast_delegate_type is null. See bug #72015 for
6142 2005-01-29 Miguel de Icaza <miguel@novell.com>
6144 * pending.cs: Produce better code (no nops produced by using Ldarg
6147 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6148 i - 1' it should be arg + 1.
6152 2005-01-26 Martin Baulig <martin@ximian.com>
6154 * cs-parser.jay (indexer_declarator): Don't report an error if we
6155 have type parameters since we can be an explicit interface
6156 implementation; fixes #71449.
6158 2005-01-26 Martin Baulig <martin@ximian.com>
6160 * class.cs (TypeContainer.AttributeTargets): Return the correct
6161 AttributeTargets depending on our `Kind' instead of throwing an
6162 exception; fixes #71632.
6164 2005-01-26 Martin Baulig <martin@ximian.com>
6166 * delegate.cs (Delegate.DefineType): Correctly define our type
6167 parameters. Fixes #71483.
6169 2005-01-25 Raja R Harinath <rharinath@novell.com>
6172 * expression.cs (MemberAccess.DoResolve): Don't complain with
6173 cs0572 when the LHS of a member access has identical name and type
6176 2005-01-25 Marek Safar <marek.safar@seznam.cz>
6179 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
6181 Create custom PermissionSet only for PermissionSetAttribute.
6183 2005-01-24 Marek Safar <marek.safar@seznam.cz>
6186 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
6187 delegates in static class.
6189 2005-01-24 Martin Baulig <martin@ximian.com>
6191 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6192 merging an implicit block, just use its reachability.
6194 * statement.cs (Block.Resolve): Make the unreachable code check
6195 work wrt. implicit blocks; see test-337 from #63842.
6197 2005-01-21 Alp Toker <alp@atoker.com>
6199 * cs-parser.jay: destructor_declaration's container is PartialContainer
6200 not Class when partial types are used, so use Kind prop instead of
6203 2005-01-22 Miguel de Icaza <miguel@ximian.com>
6205 * cs-parser.jay: Improve error reporting when an interface
6208 2005-01-20 Dick Porter <dick@ximian.com>
6210 * support.cs: SeekableStreamReader fix from Sandor Dobos
6211 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
6212 chars are read. Fixes bug 70369.
6214 2005-01-20 Raja R Harinath <rharinath@novell.com>
6216 * cs-parser.jay (catch_clause): Simplify current_block handling
6219 2005-01-17 Miguel de Icaza <miguel@ximian.com>
6221 * convert.cs (ImplicitStandardConversionExists): Synchronize the
6222 code with ImplicitStandardConversion to handle the implicit
6223 conversion of method groups into valid delegate invocations.
6225 The problem is that in parameter handling we were using this code
6226 path. Fixes bug #64698
6228 2005-01-19 Raja R Harinath <rharinath@novell.com>
6230 * cs-parser.jay: Fix several infelicities.
6231 - Avoid assigning to the parser value stack. Code like
6232 '$3 = null' is unclean. Synthesize a value for the code block
6234 - Avoid using oob_stack for storing location information. Use ...
6235 (_mark_): ... this. New (empty) rule. Saves the current location
6237 (foreach_statement): Avoid using oob_stack for current_block
6238 handling. Use technique used in for_statement and
6239 using_statement. Synthesize a value for the code block to store
6240 additional intermediate information.
6242 2005-01-13 Miguel de Icaza <miguel@ximian.com>
6244 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
6245 of a different type is only allowed to private fields of a
6246 containing type, not on fields of a base class.
6248 See test-174.cs and error cs0122-9.cs
6250 2005-01-13 Raja R Harinath <rharinath@novell.com>
6252 Fix test-335.cs (bug #58126).
6253 * cs-parser.jay (argument): Split out non-expression parts of the
6254 rule into 'non_simple_argument'.
6255 (invocation_expression): Support parenthesized invocations with
6256 multiple arguments, and with single non-simple arguments.
6258 2005-01-13 Raja R Harinath <rharinath@novell.com>
6260 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
6263 2005-01-12 Raja R Harinath <rharinath@novell.com>
6265 Fix cs0038-1.cs, cs1640-6.cs.
6266 * ecore.cs (Expression.Resolve): Remove special-case for
6267 SimpleName in error-handling.
6268 (Expression.almostMatchedMembers): Relax access permission to
6270 (Expression.MemberLookupFailed): Handle duplicates in
6271 almostMatchedMembers list.
6272 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
6273 * expression.cs (New.DoResolve): Report CS1540 for more cases.
6274 * typemanager.cs (GetFullNameSignature): Use the MethodBase
6275 overload if the passed in MemberInfo is a MethodBase.
6277 2005-01-25 Martin Baulig <martin@ximian.com>
6280 (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
6282 2005-01-12 Marek Safar <marek.safar@seznam.cz>
6285 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
6286 for non-CAS & merge permission sets properly.
6288 2005-01-11 Raja R Harinath <rharinath@novell.com>
6290 Improve standard-compliance of simple name and member access
6291 resolution. Fixes bugs #52697, #57200, #67520, #69519.
6292 * ecore.cs (FullNamedExpression): New abstract base class
6293 for Namespaces and TypeExpressions.
6294 (ResolveFlags.SimpleName): Remove.
6295 (SimpleName): Remove support for dotted names.
6296 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
6297 DeclSpace.FindType and DeclSpace.LookupType.
6298 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
6299 (Expression.ExprClassName): Make member function.
6300 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
6301 a namespace. Remove creation of dotted "SimpleName"s.
6302 (MemberAccess.DoResolve): Likewise.
6303 * decl.cs (DeclSpace.Cache): Make private.
6304 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
6305 (DeclSpace.FindType): Update.
6306 (DeclSpace.LookupType): Move here from RootContext. Return a
6307 FullNamedExpression.
6308 * namespace.cs (Namespace): Derive from FullNamedExpression
6309 so that it can be part of expression resolution.
6310 (Namespace.Lookup): Return an FullNamedExpression.
6311 (NamespaceEntry.LookupAlias): Lookup aliases only in current
6313 * rootcontext.cs (NamespaceLookup): Remove.
6314 (LookupType): Move to DeclSpace.
6315 * attribute.cs (CheckAttributeType): Update.
6316 * doc.cs (FindDocumentedType): Remove allowAlias argument.
6317 (FindDocumentedTypeNonArray): Likewise.
6319 2005-01-11 Raja R Harinath <rharinath@novell.com>
6321 Fix cs0509.cs, cs1632.cs.
6322 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
6323 is the same as IsInterface.
6324 (TypeContainer.GetClassBases): Likewise.
6325 * statement.cs (LabeledStatement.ig): New field.
6326 (LabeledStatement.LabelTarget): Save ILGenerator which created the
6328 (LabeledStatement.DoEmit): Check that the label was created with
6329 the same ILGenerator.
6331 2005-01-10 Marek Safar <marek.safar@seznam.cz>
6334 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
6335 accessors to its properties.
6337 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
6338 from accessors to property.
6340 2005-01-10 Marek Safar <marek.safar@seznam.cz>
6343 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
6346 2005-01-08 Miguel de Icaza <miguel@ximian.com>
6348 * attribute.cs: Check for null and empty strings.
6350 I have lost another battle to Paolo.
6352 2005-01-07 Marek Safar <marek.safar@seznam.cz>
6355 * class.cs (PropertyMethod): Set Parent field in ctors.
6356 (SetMethod.InternalParameters): Add unsafe switch hack.
6357 Override MarkForDuplicationCheck where it is appropriate.
6359 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
6360 It says whether container allows members with the same name.
6362 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
6363 Removed is_method parameter.
6365 2005-01-06 Duncan Mak <duncan@ximian.com>
6367 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6368 because the previous change led to incorrect reporting of CS1032
6369 ("Cannot define/undefine preprocessor symbols after first token in
6370 file"). Instead of using `tokens_seen' as the only flag that
6371 triggers CS1040, introduce `comments_seen'. This new flag is used
6372 to signify having seen comments on the current line, so it is
6373 unset after a newline.
6375 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
6377 * doc.cs : When searching for a type, find nested type too.
6378 This fixes bug #71040.
6380 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
6383 - Warn missing member comment on those classes which also does not
6384 have doc comments. Fixed bug #71041.
6385 - Don't warn missing doc comment on default constructor.
6388 2005-01-06 Duncan Mak <duncan@ximian.com>
6390 * cs-tokenizer.cs (xtoken): After handling traditional C-style
6391 comments, set `tokens_seen' to true. This allows us to detect
6392 misplaced preprocessor directives (i.e. not at the beginning of
6393 the a line, nor after whitespaces). In that case, report error
6394 CS1040. This fixes bug #56460.
6396 * cs-parser.jay (interface_member_declaration): Add checks for
6397 IsExplicitImpl, and report CS0541 error if an interface member is
6398 defined as an explicit interface declaration.
6400 2005-01-06 Marek Safar <marek.safar@seznam.cz>
6403 * class.cs (PropertyMethod): Set Parent field in ctors.
6404 (SetMethod.InternalParameters): Add unsafe switch hack.
6406 * decl.cs (MemberCore.Parent): Cannot be readonly.
6408 2005-01-06 Raja R Harinath <rharinath@novell.com>
6410 * decl.cs (DeclSpace.ResolveType): Remove.
6411 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
6412 Merge in code from ...
6413 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
6414 * class.cs, enum.cs: Update to changes.
6416 2005-01-06 Miguel de Icaza <miguel@ximian.com>
6418 * anonymous.cs: Ensure that we init the scope of our parent if it
6419 has not been initialized yet.
6421 2004-12-30 Duncan Mak <duncan@ximian.com>
6423 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6424 if field.FieldBuilder is null. Fixes #70758.
6426 * convert.cs: Fixed some typos and updated some of the comments.
6427 (ImplicitStandardConversionExists):
6428 (TryImplicitIntConversion): If `target_type' is an interface and
6429 the type of `ic' implements this interface, return true or a new
6430 BoxedCast instead of null. This fixes #70468.
6432 2004-12-29 Duncan Mak <duncan@ximian.com>
6434 * expression.cs (Argument.Emit): Check that Expr is
6435 IMemoryLocation before casting to it, and report CS1510 otherwise.
6439 2004-12-21 Ben Maurer <bmaurer@ximian.com>
6441 * statement.cs (Block.ThisVariable): remove the recursion here, to
6442 make the --profile more sane.
6444 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
6446 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6447 assembly, by JB Evain.
6449 2004-12-17 Raja R Harinath <rharinath@novell.com>
6451 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
6452 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6453 "parent" refers to enclosing type/class. "base" refers to superclass.
6455 2004-12-17 Raja R Harinath <rharinath@novell.com>
6457 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6458 Ensure that we only have GlobalAttributes.
6459 * attribute.cs (Attribute.Emit): Make non-virtual.
6460 (GlobalAttribute.Emit): Remove.
6461 (Attribute.Resolve): Make virtual.
6462 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
6463 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6464 the argument. Don't create one.
6465 (Attribute.GetObsoleteAttribute): Likewise.
6466 (Attribute.GetClsCompliantAttributeValue): Likewise.
6467 * class.cs, decl.cs: Update to changes.
6469 2004-12-17 Marek Safar <marek.safar@seznam.cz>
6471 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6473 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6475 * statement.cs (Foreach.Resolve): Add error 186 report.
6477 2004-12-16 Marek Safar <marek.safar@seznam.cz>
6479 * expression.cs (Conditional.DoResolve): Add warning 429.
6481 * statement.cs (If.Resolve): Add warning 665.
6483 2004-12-16 Raja R Harinath <rharinath@novell.com>
6485 New invariant: RootContext.Tree.Types.NamespaceEntry == null
6486 except when in the parser, and in GlobalAttribute.
6487 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6488 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6489 RootContext.Tree.Types.NamespaceEntry once work is done.
6490 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
6491 and resets RootContext.Tree.Types.NamespaceEntry.
6493 2004-12-15 Marek Safar <marek.safar@seznam.cz>
6495 * cs-parser.jay: Don't create a block for every variable.
6497 2004-12-14 Miguel de Icaza <miguel@ximian.com>
6499 * location.cs: Provide extra information.
6501 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6502 variables from the captured environment, it is the ldarg_0.
6504 2004-12-14 Marek Safar <marek.safar@seznam.cz>
6506 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6509 * class.cs: Changed warning level for 169 to avoid developer
6510 displeasure from warning flooding. It will be changed back when they
6511 fix most of current BCL warnings.
6513 * RootContext.cs: Pushed default WarningLevel to 3.
6515 * statement.cs: Removed unused variable.
6517 2004-12-14 Marek Safar <marek.safar@seznam.cz>
6519 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6520 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6521 Add error 502 report.
6522 (StaticClass.DefineType): Add error 441 report.
6523 (Class.AllowedModifiersProp): New virtual property as temporary
6524 extension to AllowedModifiers.
6525 (Class.DefineType): Add error 418 report. Moved ModFlags check here
6526 to share implementation with StaticClass and don't call virtual
6529 * driver.cs (MainDriver): Add error 1558 test.
6531 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6532 report. Moved error 36 test here.
6534 * statement.cs (Throw.Resolve): Add error 724 report.
6536 * typemanager.cs: Add out_attribute_type core type.
6538 2004-12-13 Marek Safar <marek.safar@seznam.cz>
6540 * class.cs (TypeContainer.VerifyClsCompliance): Add error
6542 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6544 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6547 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6549 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
6550 Add error 3023 report.
6551 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6553 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6556 2004-12-12 John Luke <john.luke@gmail.com>
6558 * driver.cs (AddArgs): take -- into account when
6559 adding arguments, fixes bug 65710
6561 2004-12-12 Martin Baulig <martin@ximian.com>
6563 * expression.cs (Unary.TryReduceNegative): Added support for
6564 SByteConstant and ByteConstant.
6565 (Unary.Reduce): Check error values from TryReduceNegative().
6567 2004-12-10 Marek Safar <marek.safar@seznam.cz>
6569 * attributes.cs (Attribute.Resolve): Avoid multiple error report
6570 and report exception as error 182.
6572 2004-12-10 Raja R Harinath <rharinath@novell.com>
6574 * driver.cs (Main): Fix message when there are warnings.
6576 2004-12-09 Miguel de Icaza <miguel@ximian.com>
6578 * delegate.cs: Fixed my fix from yesterday, sorry about that.
6580 2004-12-09 Marek Safar <marek.safar@seznam.cz>
6582 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
6583 Reduced number of warnings.
6585 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6587 2004-12-08 Miguel de Icaza <miguel@ximian.com>
6589 * driver.cs: Removed message.
6591 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6593 2004-12-08 <vargaz@freemail.hu>
6595 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6597 2004-12-08 Martin Baulig <martin@ximian.com>
6599 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6600 instead of a CS3002 for properties and indexer.
6602 2004-12-08 Martin Baulig <martin@ximian.com>
6604 * decl.cs (MemberName.ToString): Make this work again.
6606 2004-12-08 Marek Safar <marek.safar@seznam.cz>
6608 * attribute.cs (Resolve): Add error 591 detection.
6610 * class.cs (FieldMember.Define): Add error 1547 detection.
6611 (Indexer.Define): Add error 620 detection.
6612 (Operator.Define): Add error 590 detection.
6614 * ecore.cs: Missing argument for error 79.
6616 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6619 2004-12-07 Marek Safar <marek.safar@seznam.cz>
6622 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6625 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
6627 * cs-parser.jay : handle doc comments on implicit/explicit operators.
6628 Some operator comments were suppressed.
6629 * doc.cs : Implicit/explicit operator name in doc comments are like
6630 "op_Explicit(type)~returnType", so added suffix handling.
6632 2005-01-21 Alp Toker <alp@atoker.com>
6634 * cs-parser.jay: destructor_declaration's container is PartialContainer
6635 not Class when partial types are used, so use Kind prop instead of 'is'.
6637 2004-12-12 Martin Baulig <martin@ximian.com>
6639 * expression.cs (Unary.TryReduceNegative): Added support for
6640 SByteConstant and ByteConstant.
6641 (Unary.Reduce): Check error values from TryReduceNegative().
6643 2004-12-11 Martin Baulig <martin@ximian.com>
6645 * support.cs (ReflectionParameters.ParameterName): If we have a
6646 `gpd', call `ParameterName' on it.
6648 * parameter.cs (Parameter.GetParameterAttributes): New static method.
6650 * pending.cs (PendingImplementation.DefineProxy): Call
6651 DefineParameter() for all of the MethodBuilder's arguments.
6653 2004-12-09 Martin Baulig <martin@ximian.com>
6655 * doc.cs (DocUtil): Make this a static class.
6657 2004-12-09 Martin Baulig <martin@ximian.com>
6659 * expression.cs (Invocation.InferType): Moved the type inference
6660 implementation into TypeManager.
6662 * generics.cs (TypeManager): Moved the type inference
6663 implementation here.
6665 2004-12-09 Martin Baulig <martin@ximian.com>
6667 * typemanager.cs (TypeManager): Make this a partial class.
6670 (TypeManager): Move the generics part of `TypeManager' here.
6672 2004-12-08 Martin Baulig <martin@ximian.com>
6674 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6675 instead of a CS3002 for properties and indexer. Added CS3024
6676 check for generic interfaces.
6678 * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
6679 instances are not CLS-compliant.
6681 2004-12-08 Martin Baulig <martin@ximian.com>
6684 (void_pointer_expression): New rule for `void*', `void**' etc.
6685 (typeof_expression): Add `void_pointer_expression'; fixes #66846.
6687 2004-12-08 Martin Baulig <martin@ximian.com>
6689 * expression.cs (Invocation.InferType): Removed the hack for
6690 MethodCore.MayUnify().
6692 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
6695 * class.cs (MethodCore.MayUnify): Use
6696 TypeManager.MayBecomeEqualGenericTypes().
6698 2004-12-08 Martin Baulig <martin@ximian.com>
6700 * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
6701 parameter, box it. Fixes #69233.
6703 2004-12-08 Martin Baulig <martin@ximian.com>
6705 * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
6706 have the ctor constraint. Fixes #68326.
6708 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
6710 * cs-parser.jay : interface comment was not consumed because of
6711 extra opt_semicolon before doc handling.
6713 2004-12-03 Raja R Harinath <rharinath@novell.com>
6715 Fix test-327.cs, test-328.cs, and put in early infrastructure
6716 for eventually fixing #52697.
6717 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6718 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6720 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6721 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6722 (VerifyUsing, error246): Update.
6723 * rootcontext.cs (RootContext.NamespaceLookup): Just use
6724 'NamespaceEntry.LookupNamespaceOrType'.
6726 2004-12-07 Martin Baulig <martin@ximian.com>
6728 * driver.cs: Call it "BETA SOFTWARE" :-)
6730 2004-12-06 Raja R Harinath <rharinath@novell.com>
6732 Fix crash on cs0657-17.cs.
6733 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6734 Use RootContext.Tree.Types, not 'new RootTypes ()'.
6735 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6736 the case where the NamespaceEntry gets overwritten.
6738 2004-12-06 Marek Safar <marek.safar@seznam.cz>
6740 Fixed #69195, #56821
6741 * ecore.cs (ResolveBoolean): Tiny refactoring.
6743 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6744 of right expression resolving when left is false constant and
6745 operator is LogicalAnd OR true constant and operator is LogicalOr.
6747 * statement.cs (ResolveUnreachable): Always reports warning.
6749 2004-12-05 Miguel de Icaza <miguel@ximian.com>
6751 * class.cs: Distinguish between 1721 and 1722 (just a little help
6752 for the programmer).
6754 2004-12-03 Miguel de Icaza <miguel@ximian.com>
6756 * delegate.cs: Only allow this on new versions of the language.
6758 2004-12-02 Duncan Mak <duncan@ximian.com>
6760 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6762 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6763 here as a static method. Take an additional bool out parameter
6764 `must_do_cs1540_check' for signaling to InstanceResolve.
6765 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6766 member field from PropertyExpr class and made it an argument of
6768 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6769 check for MarshalByRefObject, and report CS0122 instead of CS1540.
6770 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6771 and `remove_accessor' as well as InstanceResolve: report CS0122
6776 2004-12-07 Martin Baulig <martin@ximian.com>
6778 * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
6779 and CS0692 where appropriate.
6781 2004-12-06 Martin Baulig <martin@ximian.com>
6783 * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
6784 IsDuplicateImplementation() and improved it.
6786 * expression.cs (Invocation.InferTypeArguments): Added
6787 `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
6788 and removed the "ref" modifier from `infered_types'.
6790 * decl.cs (MemberName.ToString): Removed the exception.
6792 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
6794 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6795 comments are allowed.
6797 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6799 * delegate.cs: Add checks for subtypes in paramaters and return values
6800 in VerifyMethod () to add support for Covariance/Contravariance
6803 2004-12-02 Miguel de Icaza <miguel@ximian.com>
6805 * report.cs: Remove extra closing parenthesis.
6807 * convert.cs (Error_CannotImplicitConversion): If the name of the
6808 types are the same, provide some extra information.
6810 2004-12-02 Marek Safar <marek.safar@seznam.cz>
6813 * attribute.cs (Resolve): Improved implementation of params
6814 attribute arguments.
6816 * support.cs (ParameterData): Add HasParams to be faster.
6818 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
6820 all things are for /doc support:
6822 * doc.cs: new file that supports XML documentation generation.
6823 * mcs.exe.sources: added doc.cs.
6825 Handle /doc command line option.
6826 Report error 2006 instead of 5 for missing file name for /doc.
6827 Generate XML documentation when required, after type resolution.
6829 Added support for picking up documentation (/// and /** ... */),
6830 including a new XmlCommentState enumeration.
6832 Added lines to fill Documentation element for field, constant,
6833 property, indexer, method, constructor, destructor, operator, event
6834 and class, struct, interface, delegate, enum.
6835 Added lines to warn incorrect comment.
6837 Added Documentation field (passed only when /doc was specified).
6839 Added DocComment, DocCommentHeader, GenerateDocComment() and
6840 OnGenerateDocComment() and some supporting private members for
6841 /doc feature to MemberCore.
6843 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6845 Added overriden DocCommentHeader.
6847 Added overriden DocCommentHeader and GenerateDocComment().
6849 2004-12-01 Miguel de Icaza <miguel@ximian.com>
6851 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6852 unwrapping the enumeration values, chain to
6853 DoConstantNumericPromotions again, so we can promote things to the
6854 fundamental types (takes care of enums that are bytes, sbytes).
6858 2004-12-01 Raja R Harinath <rharinath@novell.com>
6860 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6861 Fix long-standing bug in type-lookup. Use FindType instead of
6862 LookupType when ec.ResolvingTypeTree.
6863 (Attribute.ResolveType, Attribute.Resolve)
6864 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6866 (Attributes.Search): Remove internal version. Update.
6867 (Attributes.SearchMulti): Update.
6868 (Attributes.GetClsCompliantAttribute): Remove.
6869 (Attributes.GetIndexerNameAttribute): Remove.
6870 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6871 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6872 * class.cs (Indexer.Define): Likewise.
6874 2004-12-01 Marek Safar <marek.safar@seznam.cz>
6877 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6878 MarshallByReference members access.
6880 * expression.cs: Use CheckMarshallByRefAccess;
6881 Better error CS0197 message.
6883 * report.cs: Print whole related error message.
6885 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6887 * class (GetClassBases): Better error 60 report.
6888 (EventProperty): Disabled warning 67 detection.
6890 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6893 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6895 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6898 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6901 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6903 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6905 2004-11-26 Miguel de Icaza <miguel@ximian.com>
6907 * attribute.cs (Attribute.Resolve): Refine error reporting and
6908 report a cs0117 if the identifier does not exist, to distinguish
6909 from 0617 which is a miss-use of the actual identifier.
6911 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6912 between cs0070 and cs0079.
6914 * class.cs (MemberBase.DoDefine): When reporting a wrong
6915 accessibility level, we use MethodCore to compare instead of
6916 Method (this was a regression in some refactoring effort).
6918 So now we correctly report cs0056 again.
6920 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6921 testing the target_type (which was known to be object_type) and
6922 not the source type (which is anonymous_method).
6924 Fixed reporting of error cs1660.
6926 * expression.cs (UserCast.Source): Expose the underlying cast.
6928 * statement.cs (Switch.SwitchGoverningType): Sort the list of
6929 allowed types to find a match to int32 first (most common).
6931 In addition, it ignores any ImplicitUserConversions that did an
6932 internal implicit conversion (as the switch statement allows only
6933 one integral conversion to exist).
6935 * class.cs (PartialContainer.Create): rename `name' to
6936 `member_name' for clarity. Then replace the string calls with a
6937 call to MemberName.GetPartialName, as now using
6938 MemberName.ToString is an error (this is due to the side effects
6939 it had, that were fixed in the past).
6941 This will restore the error reporting on a number of partial class
6942 errors that were missusing this (and getting an exception as a
6943 results, which is now just a plain textual warning, because
6944 yyparse debug output would crash otherwise).
6946 2004-11-26 Raja R Harinath <rharinath@novell.com>
6948 * Makefile (PROGRAM_INSTALL_DIR): Remove.
6950 2004-11-25 Ben Maurer <bmaurer@ximian.com>
6952 * rootcontext.cs (LookupType): Make sure to cache lookups that
6953 don't give us a negative result. This saves about 5% of corlib
6956 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6958 * report.cs (AbstractMessage.Print): messages are sent to stderr
6960 * class.cs (TypeContainer.GetClassBases): It is an error to have a
6961 non-interface in the list of interfaces (at this point, either
6962 parent was properly set, or a base class is being listed in the
6963 interfaces section).
6965 This flags error 1722, and resolves the crash from bug 69259.
6967 2004-11-25 Ben Maurer <bmaurer@ximian.com>
6969 * statement.cs (Using.EmitExpressionFinally): make this work right
6970 for valuetypes. Fixes 69926.
6972 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6974 * const.cs (Const.ChangeType): Cope with the "0 literal can be
6975 converted to an enum" here, before we try to change the underlying
6976 type. This code exists, but it is a different code path than the
6977 one used while encoding constants.
6979 (ImplicitReferenceConversionExists): In addition, resynchronized
6980 the code here, so it matches the same code in
6981 ImplicitReferenceConversionExists for the `from any class-type S
6982 to any interface-type T'.
6984 2004-11-25 Marek Safar <marek.safar@seznam.cz>
6986 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6988 2004-11-24 Miguel de Icaza <miguel@ximian.com>
6990 * cs-parser.jay: Use verbosity accordingly.
6992 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6994 * expression.cs (Unary.ResolveOperator): Do not report warning;
6995 AddressOf reads from variable.
6997 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6999 2004-11-24 Marek Safar <marek.safar@seznam.cz>
7003 * attribute.cs (Attributable): Removed CheckTargets.
7004 (Attributes.Emit): Explicit attribute targets are tested here.
7006 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
7007 not enabled for interfaces.
7009 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
7010 (GetAssemblyName): Ouch next bug there.
7012 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7014 * expression.cs: Error 275 added.
7016 2004-11-23 Marek Safar <marek.safar@seznam.cz>
7018 Fix bug #69177 (Implemented decimal constant support)
7020 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
7021 (BinaryFold): Add DecimalConstant.
7023 * const.cs (Define): Decimal constant
7025 (ChangeType): Add decimal type handling.
7026 (LookupConstantValue): Don't set value for decimal type but
7027 emit DecimalConstantAttribute. Needed for constant optimization.
7029 * constant.cs (ToDecimal): New method.
7030 (ConvertToDecimal): New method.
7031 (IntConstant): Implemented ConvertToDecimal.
7032 (DecimalConstant.Emit): Emit optimized version for decimals in
7035 * expression.cs (ResolveOperator): Changed order of constant
7036 reduction to work correctly with native types which have
7037 overloaded operators.
7038 (ResolveMemberAccess): Extract constant value from attribute
7041 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
7043 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
7044 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
7045 (ChangeType): Decimal is special.
7046 (TypeToCoreType): Add decimal type.
7048 2004-11-22 Marek Safar <marek.safar@seznam.cz>
7050 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
7053 2004-11-22 Marek Safar <marek.safar@seznam.cz>
7055 * class.cs (EventField.ApplyAttributeBuilder): Fix error
7058 2004-11-19 Marek Safar <marek.safar@seznam.cz>
7060 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
7062 * pending.cs (PendingImplementation): Grab only interfaces.
7064 2004-11-19 Marek Safar <marek.safar@seznam.cz>
7066 * statement.cs (ForeachHelperMethods): Add location member and
7067 error 202 detection.
7069 2004-11-18 Marek Safar <marek.safar@seznam.cz>
7071 * expression.cs (DoResolveBase): Fixed wrong warning for out
7074 2004-12-04 Martin Baulig <martin@ximian.com>
7076 * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
7077 to check whether the conversion is ok.
7079 * typemanager.cs (TypeManager.GetTypeArguments): Just return
7080 `Type.EmptyTypes' if we're not a generic TypeContainer.
7082 2004-11-25 Miguel de Icaza <miguel@ximian.com>
7084 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
7085 old bug: when converting from the null literal to a pointer,
7086 return an EmptyCast, not the NullLiteral.
7088 This fixes #69921, the recent null_type changes probably made this
7091 2004-12-03 Martin Baulig <martin@ximian.com>
7093 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7094 method as our child, call AnonymousMethod.Compatible() on it.
7096 2004-12-02 Miguel de Icaza <miguel@ximian.com>
7098 * class.cs (FieldBase): Use an unused bit field from the field to
7099 encode the `has_offset' property from the FieldMember. This saves
7100 a couple of Ks on bootstrap compilation.
7102 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7103 method as our child, return the AnonymousMethod resolved
7106 * expression.cs (New.DoResolve): Allow return values from
7107 NewDelegate to also include AnonymousMethods.
7111 2004-11-29 Raja R Harinath <rharinath@novell.com>
7113 * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
7115 * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
7116 System.Runtime.InteropServices._Exception, since it's a base
7117 interface of the core type System.Exception in the net_2_0 profile.
7119 2004-11-27 Martin Baulig <martin@ximian.com>
7121 * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
7123 2004-11-26 Raja R Harinath <rharinath@novell.com>
7125 * Makefile: Convert to use executable.make.
7126 * gmcs.exe.sources: New.
7128 2004-11-25 Martin Baulig <martin@ximian.com>
7130 * expression.cs (Invocation.InferType): Added support for byref types.
7132 2004-11-25 Martin Baulig <martin@ximian.com>
7134 * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
7135 in TypeManager.TypeToCoreType().
7137 2004-11-25 Martin Baulig <martin@ximian.com>
7139 * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
7140 "Dispose" method from the `current_type'.
7141 (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
7142 DoDefineMembers() instead of using the MethodBuilder; this is
7143 required for generic iterators.
7145 * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
7147 2004-11-24 Martin Baulig <martin@ximian.com>
7149 * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
7151 2004-11-20 Martin Baulig <martin@ximian.com>
7153 * expression.cs (Invocation.InferType): Correctly infer generic
7154 instances; see gen-103.cs.
7155 (Invocation.InferTypeArguments): If a generic method doesn't have
7156 any unbound type parameters, we don't need to infer anything.
7158 2004-11-19 Raja R Harinath <rharinath@novell.com>
7160 * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
7162 2004-11-17 Raja R Harinath <rharinath@novell.com>
7164 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
7165 (TypeHandle.GetMemberCache): New.
7166 (TypeHandle.TypeHandle): Update.
7167 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
7168 (TypeManager.LookupParentInterfacesCache):
7169 Rename from LookupInterfaceCache. Optimize slightly.
7170 (TypeManager.MemberLookup_FindMembers): Update.
7171 * decl.cs (MemberCache.MemberCache): Set Container to null in the
7173 (AddCacheContents): Rename from AddHashtable.
7174 * class.cs (TypeContainer.parent_container): Remove.
7175 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
7176 (TypeContainer.DoDefineMembers): Don't initialize it.
7177 Update to name changes.
7179 2004-11-17 Miguel de Icaza <miguel@ximian.com>
7181 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
7182 that factors the code to check access modifiers on override.
7184 (PropertyBase): Use the code here.
7186 Patch from Lluis S'anchez, fixes bug #69361.
7188 2004-11-15 Miguel de Icaza <miguel@ximian.com>
7190 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
7191 routine that is used to report the use of a captured variable
7192 whose address has been taken.
7194 There are two checks: one when variables are being captured and
7195 the other check is when the address of a variable is taken.
7197 (because an anonymous methods might be resolved before *or* after
7198 the address has been taken) and
7200 * expression.cs (Conditional.DoResolve): Remove the special
7201 casing that Martin added to trueExpr and falseExpr being both
7202 NullLiteral. We get the right behavior now just by introducing
7203 the null_type into the compiler.
7205 * convert.cs (ExplicitConversion): Change the code to use
7206 null_type instead of testing `expr is NullLiteral'.
7207 (ImplicitConversionStandard): use null_type too.
7208 (ImplicitReferenceConversionExists): use null_type too.
7209 (ImplicitReferenceConversion): use null_type too.
7211 * literal.cs: The type of `NullLiteral' is now null_type instead
7213 (Resolve): Set the type here.
7215 * typemanager.cs: Introduce null_type.
7217 2004-11-18 Martin Baulig <martin@ximian.com>
7220 (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
7222 2004-11-18 Martin Baulig <martin@ximian.com>
7224 * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
7226 2004-11-18 Martin Baulig <martin@ximian.com>
7228 * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
7229 of a `DeclSpace'. If one of our constraints is a `ConstructedType',
7230 call ResolveConstructedType() on it to resolve it without checking
7232 (Constraints.ResolveTypes): Check them here.
7233 (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
7234 but don't check constraints.
7235 (ConstructedType.ResolveAsTypeTerminal): Override this and also
7236 check constraints here.
7237 (ConstructedType.ResolveConstructedType): New public method. This
7238 is called from DoResolveAsTypeStep() and Constraints.Resolve() to
7239 resolve ourselves without checking constraints.
7241 * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
7243 2004-11-18 Martin Baulig <martin@ximian.com>
7246 (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
7248 * delegate.cs (Delegate.DefineType): Always create the EmitContext.
7250 2004-11-18 Martin Baulig <martin@ximian.com>
7252 * ecore.cs (TypeExpr.ResolveType): Removed.
7253 (Expression.ResolveAsTypeTerminal): We always return a fully
7254 resolved `TypeExpr', so we can just access its `Type'.
7256 * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
7258 2004-11-17 Martin Baulig <martin@ximian.com>
7260 * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
7261 sure we don't return any unresolved TypeExpr's.
7262 (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
7264 (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
7266 * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
7267 unresolved `ConstructedType's.
7269 2004-11-17 Martin Baulig <martin@ximian.com>
7271 * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
7273 2004-11-17 Martin Baulig <martin@ximian.com>
7276 (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
7278 * decl.cs (DeclSpace.ResolveType): Removed.
7279 (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
7281 2004-11-17 Martin Baulig <martin@ximian.com>
7283 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
7284 direction, like FindMembers() does. Fixes #69546, testcase is in
7287 2004-11-16 Martin Baulig <martin@ximian.com>
7289 This is based on a patch from Marek Safar, see bug #69082.
7290 Fixes bugs #63705 and #67130.
7292 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
7293 method; create a MemberCache for an interface type and cache the
7296 * decl.cs (IMemberContainer.ParentContainer): Removed.
7297 (IMemberContainer.ParentCache): New property.
7298 (MemberCache.SetupCacheForInterface): Removed.
7299 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
7300 to create a cache for an interface's "parent".
7302 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
7305 2004-11-14 Ben Maurer <bmaurer@ximian.com>
7307 * statement.cs: Avoid adding bools to a hashtable.
7309 2004-11-15 Martin Baulig <martin@ximian.com>
7311 * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
7313 2004-11-11 Martin Baulig <martin@ximian.com>
7315 * typemanager.cs (TypeManager.GetMethodName): New method.
7317 * class.cs (MethodData.Define): Include the generic arity in the
7318 name of an explicit interface; also add it to the method name.
7320 * pending.cs (PendingImplementation.InterfaceMethod): The method
7321 name now includes the generic arity.
7323 2004-11-07 Miguel de Icaza <miguel@ximian.com>
7325 * expression.cs (Invocation.OverloadResolve): Flag error if we are
7326 calling an unsafe method from a safe location.
7328 2004-11-06 Marek Safar <marek.safar@seznam.cz>
7331 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
7333 2004-11-06 Miguel de Icaza <miguel@ximian.com>
7335 * namespace.cs (VerifyUsing): use GetPartialName instead of
7338 2004-11-05 Miguel de Icaza <miguel@ximian.com>
7340 * statement.cs (Return.Resolve): Fix regression in typo: if
7341 `in_exc', we have to request a NeedReturnLabel, this was a typo
7342 introduced in the anonymous method check-in. Fixes #69131.
7344 * Indexers were using the ShortName when defining themselves,
7345 causing a regression in the compiler bootstrap when applying the
7346 patch from 2004-11-02 (first part), now they use their full name
7347 and the bug is gone.
7349 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
7351 * driver.cs: Strip the path from the names of embedded resources. Fixes
7354 2004-11-04 Raja R Harinath <rharinath@novell.com>
7356 Fix error message regression: cs0104-2.cs.
7357 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
7358 (AliasEntry.Resolve): Update.
7359 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
7361 (RootContext.LookupType): Update.
7363 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
7365 * cs-parser.jay: Add support for handling accessor modifiers
7366 * class: Add support port accessor modifiers and error checking,
7367 define PropertyMethod.Define as virtual (not abstract anymore)
7368 * ecore.cs: Add checking for proeprties access with access modifiers
7369 * iterators.cs: Modify Accessor constructor call based in the modified
7371 2004-11-02 Ben Maurer <bmaurer@ximian.com>
7373 * expression.cs (StringConcat): Handle being called twice,
7374 as when we have a concat in a field init with more than two
7377 2004-11-02 Miguel de Icaza <miguel@ximian.com>
7379 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
7380 special case explicit implementations, we should always produce
7381 the .property or .event declaration.
7383 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
7384 since it will not return correct data if people use this
7385 unresolved in the presence of using statements (see test-313).
7387 * class.cs (MethodData.Define): If we are an explicit interface
7388 implementation, set the method name to the full name of the
7389 interface plus the name of the method.
7391 Notice that using the method.MethodName.GetFullName() does not
7392 work, as it will only contain the name as declared on the source
7393 file (it can be a shorthand in the presence of using statements)
7394 and not the fully qualifed type name, for example:
7398 class D : ICloneable {
7399 object ICloneable.Clone () {
7403 Would produce a method called `ICloneable.Clone' instead of
7404 `System.ICloneable.Clone'.
7406 * namespace.cs (Alias.Resolve): Use GetPartialName.
7408 2004-11-01 Marek Safar <marek.safar@seznam.cz>
7410 * cs-parser.jay: Add error 1055 report.
7412 2004-11-01 Miguel de Icaza <miguel@ximian.com>
7414 * assign.cs (Assign.DoResolve): Only do the transform of
7415 assignment into a New if the types are compatible, if not, fall
7416 through and let the implicit code deal with the errors and with
7417 the necessary conversions.
7419 2004-11-01 Marek Safar <marek.safar@seznam.cz>
7421 * cs-parser.jay: Add error 1031 report.
7423 * cs-tokenizer.cs: Add location for error 1038.
7425 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7427 * cs-parser.jay: Add error 1016 report.
7429 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7431 * cs-parser.jay: Add errors 1575,1611 report.
7433 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7435 * cs-parser.jay: Add error 1001 report.
7437 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7440 * attribute.cs (GetMarshal): Add method argument for
7441 caller identification.
7443 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7444 agument for GetMarshal and RuntimeMissingSupport.
7446 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7448 * attribute.cs (ExtractSecurityPermissionSet): Removed
7449 TypeManager.code_access_permission_type.
7451 * typemanager.cs: Removed TypeManager.code_access_permission_type.
7453 2004-10-27 Miguel de Icaza <miguel@ximian.com>
7455 * expression.cs (LocalVariableReference.DoResolveLValue): Check
7456 for obsolete use of a variable here. Fixes regression on errors
7457 cs0619-25 and cs0619-26.
7459 2004-10-27 Marek Safar <marek.safar@seznam.cz>
7461 Fix #62358, implemented security attribute encoding.
7463 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7464 Tests permitted SecurityAction for assembly or other types.
7465 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7466 data from SecurityPermissionAttribute to PermisionSet class.
7468 * class.cs (ApplyAttributeBuilder): Added special handling
7469 for System.Security.Permissions.SecurityAttribute based types.
7471 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7472 special handling for System.Security.Permissions.SecurityAttribute
7475 * enum.cs (ApplyAttributeBuilder): Added special handling
7476 for System.Security.Permissions.SecurityAttribute based types.
7478 * parameter.cs (ApplyAttributeBuilder): Added special handling
7479 for System.Security.Permissions.SecurityAttribute based types.
7481 * rootcontext.cs: Next 2 core types.
7483 * typemanager.cs (TypeManager.security_permission_attr_type):
7484 Built in type for the SecurityPermission Attribute.
7485 (code_access_permission_type): Build in type.
7487 2004-10-17 Miguel de Icaza <miguel@ximian.com>
7489 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7490 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7491 all of this information into
7492 EmitContext.EmitCapturedVariableInstance.
7494 * codegen.cs (EmitCapturedVariableInstance): move here the
7495 funcionality of emitting an ldarg.0 in the presence of a
7496 remapping. This centralizes the instance emit code.
7498 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7499 then emit a load of this: it means that we have reached the
7500 topmost ScopeInfo: the one that contains the pointer to the
7501 instance of the class hosting the anonymous method.
7503 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7504 captures to the topmost CaptureContext.
7506 2004-10-12 Miguel de Icaza <miguel@ximian.com>
7508 * expression.cs (LocalVariableReference): Move the knowledge about
7509 the iterators into codegen's EmitCapturedVariableInstance.
7511 2004-10-11 Miguel de Icaza <miguel@ximian.com>
7513 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7514 all code paths return a value from an anonymous method (it is the
7515 same as the 161 error, but for anonymous methods).
7517 2004-10-08 Miguel de Icaza <miguel@ximian.com>
7519 The introduction of anonymous methods in the compiler changed
7520 various ways of doing things in the compiler. The most
7521 significant one is the hard split between the resolution phase
7522 and the emission phases of the compiler.
7524 For instance, routines that referenced local variables no
7525 longer can safely create temporary variables during the
7526 resolution phase: they must do so from the emission phase,
7527 since the variable might have been "captured", hence access to
7528 it can not be done with the local-variable operations from the runtime.
7532 (Block.Flags): New flag `IsTopLevel' to indicate that this block
7533 is a toplevel block.
7535 (ToplevelBlock): A new kind of Block, these are the blocks that
7536 are created by the parser for all toplevel method bodies. These
7537 include methods, accessors and anonymous methods.
7539 These contain some extra information not found in regular blocks:
7540 A pointer to an optional CaptureContext (for tracking captured
7541 local variables and parameters). A pointer to the parent
7544 (Return.Resolve): Catch missmatches when returning a value from an
7545 anonymous method (error 1662).
7546 Invoke NeedReturnLabel from the Resolve phase instead of the emit
7549 (Break.Resolve): ditto.
7551 (SwitchLabel): instead of defining the labels during the
7552 resolution phase, we now turned the public ILLabel and ILLabelCode
7553 labels into methods called GetILLabelCode() and GetILLabel() that
7554 only define the label during the Emit phase.
7556 (GotoCase): Track the SwitchLabel instead of the computed label
7557 (its contained therein). Emit the code by using
7558 SwitchLabel.GetILLabelCode ().
7560 (LocalInfo.Flags.Captured): A new flag has been introduce to track
7561 whether the Local has been captured or not.
7563 (LocalInfo.IsCaptured): New property, used to tell whether the
7564 local has been captured.
7566 * anonymous.cs: Vastly updated to contain the anonymous method
7569 The main classes here are: CaptureContext which tracks any
7570 captured information for a toplevel block and ScopeInfo used to
7571 track the activation frames for various local variables.
7573 Each toplevel block has an optional capture context associated
7574 with it. When a method contains an anonymous method both the
7575 toplevel method and the anonymous method will create a capture
7576 context. When variables or parameters are captured, they are
7577 recorded on the CaptureContext that owns them, for example:
7581 MyDelegate d = delegate {
7586 Here `a' will be recorded as captured on the toplevel
7587 CapturedContext, the inner captured context will not have anything
7588 (it will only have data if local variables or parameters from it
7589 are captured in a nested anonymous method.
7591 The ScopeInfo is used to track the activation frames for local
7592 variables, for example:
7594 for (int i = 0; i < 10; i++)
7595 for (int j = 0; j < 10; j++){
7596 MyDelegate d = delegate {
7601 At runtime this captures a single captured variable `i', but it
7602 captures 10 different versions of the variable `j'. The variable
7603 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7604 recorded on a child.
7606 The toplevel ScopeInfo will also track information like the `this'
7607 pointer if instance variables were referenced (this is necessary
7608 as the anonymous method lives inside a nested class in the host
7609 type of the method).
7611 (AnonymousMethod): Expanded to track the Toplevel, implement
7612 `AnonymousMethod.Compatible' to tell whether an anonymous method
7613 can be converted to a target delegate type.
7615 The routine now also produces the anonymous method content
7617 (AnonymousDelegate): A helper class that derives from
7618 DelegateCreation, this is used to generate the code necessary to
7619 produce the delegate for the anonymous method that was created.
7621 * assign.cs: API adjustments for new changes in
7622 Convert.ImplicitStandardConversionExists.
7624 * class.cs: Adjustments to cope with the fact that now toplevel
7625 blocks are of type `ToplevelBlock'.
7627 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7628 insteda of standard blocks.
7630 Flag errors if params arguments are passed to anonymous methods.
7632 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7633 `CurrentAnonymousMethod' which points to the current Anonymous
7634 Method. The variable points to the AnonymousMethod class that
7635 holds the code being compiled. It is set in the new EmitContext
7636 created for the anonymous method.
7638 (EmitContext.Phase): Introduce a variable and an enumeration to
7639 assist in enforcing some rules about when and where we are allowed
7640 to invoke certain methods (EmitContext.NeedsReturnLabel is the
7641 only one that enfonces this right now).
7643 (EmitContext.HaveCaptureInfo): new helper method that returns
7644 whether we have a CapturedContext initialized.
7646 (EmitContext.CaptureVariable): New method used to register that a
7647 LocalInfo must be flagged for capturing.
7649 (EmitContext.CapturedParameter): New method used to register that a
7650 parameters must be flagged for capturing.
7652 (EmitContext.CapturedField): New method used to register that a
7653 field must be flagged for capturing.
7655 (EmitContext.HaveCapturedVariables,
7656 EmitContext.HaveCapturedFields): Return whether there are captured
7657 variables or fields.
7659 (EmitContext.EmitMethodHostInstance): This is used to emit the
7660 instance for the anonymous method. The instance might be null
7661 (static methods), this (for anonymous methods that capture nothing
7662 and happen to live side-by-side with the current method body) or a
7663 more complicated expression if the method has a CaptureContext.
7665 (EmitContext.EmitTopBlock): Routine that drives the emission of
7666 code: it will first resolve the top block, then emit any metadata
7667 and then emit the code. The split is done so that we can extract
7668 any anonymous methods and flag any captured variables/parameters.
7670 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7671 during this phase, the ILGenerator should not be used as labels
7672 and local variables declared here might not be accessible to any
7673 code that is part of an anonymous method.
7675 Exceptions to this include the temporary variables that are
7676 created by some statements internally for holding temporary
7679 (EmitContext.EmitMeta): New routine, in charge of emitting all the
7682 (EmitContext.TemporaryReturn): This method is typically called
7683 from the Emit phase, and its the only place where we allow the
7684 ReturnLabel to be defined other than the EmitMeta. The reason is
7685 that otherwise we would have to duplicate a lot of logic in the
7686 Resolve phases of various methods that today is on the Emit
7689 (EmitContext.NeedReturnLabel): This no longer creates the label,
7690 as the ILGenerator is not valid during the resolve phase.
7692 (EmitContext.EmitThis): Extended the knowledge in this class to
7693 work in anonymous methods in addition to iterators.
7695 (EmitContext.EmitCapturedVariableInstance): This emits whatever
7696 code is necessary on the stack to access the instance to a local
7697 variable (the variable will be accessed as a field).
7699 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7700 EmitContext.EmitAddressOfParameter): Routines to support
7701 parameters (not completed at this point).
7703 Removals: Removed RemapLocal and RemapLocalLValue. We probably
7704 will also remove the parameters.
7706 * convert.cs (Convert): Define a `ConstantEC' which points to a
7707 null. This is just to prefity some code that uses
7708 ImplicitStandardConversion code and do not have an EmitContext
7711 The idea is to flag explicitly that at that point in time, it is
7712 known that the conversion will not trigger the delegate checking
7713 code in implicit conversions (which requires a valid
7716 Everywhere: pass new EmitContext parameter since
7717 ImplicitStandardConversionExists now requires it to check for
7718 anonymous method conversions.
7720 (Convert.ImplicitStandardConversionExists): If the type of an
7721 expression is the anonymous_method_type, and the type is a
7722 delegate, we invoke the AnonymousMethod.Compatible method to check
7723 whether an implicit conversion is possible.
7725 (Convert.ImplicitConversionStandard): Only do implicit method
7726 group conversions if the language level is not ISO_1.
7728 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7729 MethodInfo for the Invoke method. used by Delegate and
7732 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7733 method conversions if the target type is a delegate.
7735 Removed extra debugging nops.
7737 (LocalVariableReference): Turn the `local_info' into a public
7740 Add `prepared' field, the same hack used for FieldExprs to cope
7741 with composed assignments, as Local variables do not necessarily
7742 operate purely on the stack as they used to: they can be captured
7745 Add `temp' for a temporary result, like fields.
7747 Refactor DoResolve and DoResolveLValue into DoResolveBase.
7749 It now copes with Local variables that are captured and emits the
7750 proper instance variable to load it from a field in the captured
7753 (ParameterReference.DoResolveBase): During the resolve phase,
7754 capture parameters if we are in an anonymous method.
7756 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7757 anonymous method, use the EmitContext helper routines to emit the
7758 parameter reference.
7760 * iterators.cs: Set RemapToProxy to true/false during the
7763 * parameters.cs (GetParameterByName): New helper method.
7765 * typemanager.cs (anonymous_method_type) a new type that
7766 represents an anonyous method. This is always an internal type,
7767 used as a fencepost to test against the anonymous-methodness of an
7770 2004-10-20 Marek Safar <marek.safar@seznam.cz>
7772 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7774 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7776 2004-11-10 Martin Baulig <martin@ximian.com>
7778 * expression.cs (Invocation.BetterFunction): If two methods have
7779 equal parameter types, but only one of them is generic, the
7780 non-generic one wins.
7781 (New.DoResolve): Don't set `is_struct' to false if we're a generic
7782 instance; just use `Type.IsValueType' to determine whether
7783 something is a struct or not.
7784 (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
7785 so we can be called multiple times.
7787 2004-11-10 Martin Baulig <martin@ximian.com>
7789 * generic.cs (TypeParameter.DefineConstraints): New public method.
7790 (TypeParameter.CheckAccessLevel): Override this and return true.
7791 (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
7792 override ResolveType() anymore.
7793 (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
7795 2004-11-10 Martin Baulig <martin@ximian.com>
7797 * rootcontext.cs (RootContext.LookupType): If we're a nested type,
7798 call DeclSpace.ResolveNestedType() on it.
7800 2004-11-10 Martin Baulig <martin@ximian.com>
7802 * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
7803 non-null, call ParameterModifier() on it.
7805 2004-11-10 Martin Baulig <martin@ximian.com>
7808 (Iterators): Added `current_type' and `this_type' fields.
7809 (Iterators.DefineIterator): Create a new EmitContext and store it
7810 in `ec'; compute `this_type'.
7812 2004-11-10 Martin Baulig <martin@ximian.com>
7815 (TypeManager.IsPrivateAccessible): New public method.
7816 (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
7818 2004-11-10 Martin Baulig <martin@ximian.com>
7820 * class.cs (TypeContainer.DefineType): Call
7821 TypeBuilder.DefineGenericParameters() before resolving the type
7823 (MethodData.parent_method): New protected field.
7824 (MethodData..ctor): Added `MethodInfo parent_method' argument.
7825 (MethodData.Define): Compute `parent_method'.
7828 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7829 (MemberCore.GetClsCompliantAttributeValue): Likewise.
7830 (DeclSpace.ec): New protected field; store the EmitContext here.
7831 (DeclSpace.EmitContext): New public property.
7832 (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
7833 (DeclSpace.ResolveNestedType): New public method.
7834 (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
7835 (DeclSpace.NestedAccessible): Added `Type tb' argument.
7836 (DeclSpace.FamilyAccessible): Likewise.
7837 (DeclSpace.FindType): Call ResolveNestedType() for nested types.
7838 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7841 * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
7844 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7845 (Enum.Emit): Don't create a new EmitContext.
7847 2004-10-18 Martin Baulig <martin@ximian.com>
7849 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7850 `Type' directly, but call ResolveType() on it.
7851 (Catch.Resolve): Likewise.
7852 (Foreach.Resolve): Likewise.
7854 2004-10-18 Martin Baulig <martin@ximian.com>
7856 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7857 `Type' directly, but call ResolveType() on it.
7858 (Probe.DoResolve): Likewise.
7859 (ArrayCreation.LookupType): Likewise.
7860 (TypeOf.DoResolve): Likewise.
7861 (SizeOf.DoResolve): Likewise.
7863 2004-10-18 Raja R Harinath <rharinath@novell.com>
7865 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7868 2004-10-17 John Luke <john.luke@gmail.com>
7870 * class.cs (Operator.GetSignatureForError): use CSharpName
7872 * parameter.cs (Parameter.GetSignatureForError): Returns
7873 correct name even if was not defined.
7875 2004-10-13 Raja R Harinath <rharinath@novell.com>
7878 * class.cs (TypeContainer.EmitContext): New property.
7879 (DefineNestedTypes): Create an emitcontext for each part.
7880 (MethodCore.DoDefineParameters): Use container's emitcontext.
7881 Pass type array to InternalParameters.
7882 (MemberBase.DoDefine): Use container's emitcontext.
7883 (FieldMember.Define): Likewise.
7884 (Event.Define): Likewise.
7885 (SetMethod.GetParameterInfo): Change argument to EmitContext.
7886 Pass type array to InternalParameters.
7887 (SetIndexerMethod.GetParameterInfo): Likewise.
7888 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7889 * delegate.cs (Define): Pass emitcontext to
7890 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
7891 array to InternalParameters.
7892 * expression.cs (ParameterReference.DoResolveBase): Pass
7893 emitcontext to GetParameterInfo.
7894 (ComposedCast.DoResolveAsTypeStep): Remove check on
7895 ec.ResolvingTypeTree.
7896 * parameter.cs (Parameter.Resolve): Change argument to
7897 EmitContext. Use ResolveAsTypeTerminal.
7898 (Parameter.GetSignature): Change argument to EmitContext.
7899 (Parameters.ComputeSignature): Likewise.
7900 (Parameters.ComputeParameterTypes): Likewise.
7901 (Parameters.GetParameterInfo): Likewise.
7902 (Parameters.ComputeAndDefineParameterTypes): Likewise.
7903 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
7904 * support.cs (InternalParameters..ctor): Remove variant that takes
7906 * typemanager.cs (system_intptr_expr): New.
7907 (InitExpressionTypes): Initialize it.
7909 2004-10-12 Chris Toshok <toshok@ximian.com>
7911 * cs-parser.jay: fix location for try_statement and catch_clause.
7913 2004-10-18 Martin Baulig <martin@ximian.com>
7915 * class.cs (FieldMember.Define): Don't access the TypeExpr's
7916 `Type' directly, but call ResolveType() on it.
7917 (MemberBase.DoDefine): Likewise.
7919 * expression.cs (New.DoResolve): Don't access the TypeExpr's
7920 `Type' directly, but call ResolveType() on it.
7921 (ComposedCast.DoResolveAsTypeStep): Likewise.
7923 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7924 `Type' directly, but call ResolveType() on it.
7926 2004-10-17 John Luke <john.luke@gmail.com>
7928 * class.cs (Operator.GetSignatureForError): use CSharpName
7930 * parameter.cs (Parameter.GetSignatureForError): Returns
7931 correct name even if was not defined.
7933 2004-10-13 Raja R Harinath <rharinath@novell.com>
7936 * class.cs (TypeContainer.EmitContext): New property.
7937 (DefineNestedTypes): Create an emitcontext for each part.
7938 (MethodCore.DoDefineParameters): Use container's emitcontext.
7939 Pass type array to InternalParameters.
7940 (MemberBase.DoDefine): Use container's emitcontext.
7941 (FieldMember.Define): Likewise.
7942 (Event.Define): Likewise.
7943 (SetMethod.GetParameterInfo): Change argument to EmitContext.
7944 Pass type array to InternalParameters.
7945 (SetIndexerMethod.GetParameterInfo): Likewise.
7946 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7947 * delegate.cs (Define): Pass emitcontext to
7948 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
7949 array to InternalParameters.
7950 * expression.cs (ParameterReference.DoResolveBase): Pass
7951 emitcontext to GetParameterInfo.
7952 (ComposedCast.DoResolveAsTypeStep): Remove check on
7953 ec.ResolvingTypeTree.
7954 * parameter.cs (Parameter.Resolve): Change argument to
7955 EmitContext. Use ResolveAsTypeTerminal.
7956 (Parameter.GetSignature): Change argument to EmitContext.
7957 (Parameters.ComputeSignature): Likewise.
7958 (Parameters.ComputeParameterTypes): Likewise.
7959 (Parameters.GetParameterInfo): Likewise.
7960 (Parameters.ComputeAndDefineParameterTypes): Likewise.
7961 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
7962 * support.cs (InternalParameters..ctor): Remove variant that takes
7964 * typemanager.cs (system_intptr_expr): New.
7965 (InitExpressionTypes): Initialize it.
7967 2004-10-12 Chris Toshok <toshok@ximian.com>
7969 * cs-parser.jay: fix location for try_statement and catch_clause.
7971 2004-10-07 Raja R Harinath <rharinath@novell.com>
7973 More DeclSpace.ResolveType avoidance.
7974 * decl.cs (MemberCore.InUnsafe): New property.
7975 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
7976 with newly created EmitContext.
7977 (FieldMember.Define): Likewise.
7978 * delegate.cs (Delegate.Define): Likewise.
7979 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7980 only if normal name-lookup fails.
7981 (TypeExpr.DoResolve): Enable error-checking.
7982 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7983 (SizeOf.DoResolve): Likewise.
7984 (ComposedCast.DoResolveAsTypeStep): Likewise.
7985 (StackAlloc.DoResolve): Likewise.
7986 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7987 (Block.Unsafe): New property.
7988 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7989 (Unsafe): Set 'unsafe' flag of contained block.
7990 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7991 (Fixed.Resolve): Likewise.
7992 (Catch.Resolve): Likewise.
7993 (Using.ResolveLocalVariableDecls): Likewise.
7994 (Foreach.Resolve): Likewise.
7996 2004-10-05 John Luke <john.luke@gmail.com>
7998 * cs-parser.jay: add location to error CS0175
8000 2004-10-04 Miguel de Icaza <miguel@ximian.com>
8002 * ecore.cs (Expression.Constantity): Add support for turning null
8005 * const.cs (Const.Define): Allow constants to be reference types
8006 as long as the value is Null.
8008 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
8010 * namespace.cs (NamespaceEntry.Using): No matter which warning
8011 level is set, check if this namespace name has already been added.
8013 2004-10-03 Ben Maurer <bmaurer@ximian.com>
8015 * expression.cs: reftype [!=]= null should always use br[true,false].
8018 2004-10-03 Marek Safar <marek.safar@seznam.cz>
8021 * attribute.cs: Enum conversion moved to
8022 GetAttributeArgumentExpression to be applied to the all
8025 2004-10-01 Raja R Harinath <rharinath@novell.com>
8027 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
8028 * class.c (TypeContainer.DefineType): Flag error if
8029 base types aren't accessible due to access permissions.
8030 * decl.cs (DeclSpace.ResolveType): Move logic to
8031 Expression.ResolveAsTypeTerminal.
8032 (DeclSpace.ResolveTypeExpr): Thin layer over
8033 Expression.ResolveAsTypeTerminal.
8034 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
8035 Refactor code into NestedAccess. Use it.
8036 (DeclSpace.NestedAccess): New.
8037 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
8038 argument to silence errors. Check access permissions.
8039 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
8040 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
8041 (Cast.DoResolve): Likewise.
8042 (New.DoResolve): Likewise.
8043 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
8044 (TypeOf.DoResolve): Likewise.
8046 * expression.cs (Invocation.BetterConversion): Return the Type of
8047 the better conversion. Implement section 14.4.2.3 more faithfully.
8048 (Invocation.BetterFunction): Make boolean. Make correspondence to
8049 section 14.4.2.2 explicit.
8050 (Invocation.OverloadResolve): Update.
8051 (Invocation): Remove is_base field.
8052 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
8053 (Invocation.Emit): Likewise.
8055 2004-09-24 Marek Safar <marek.safar@seznam.cz>
8057 * cs-parser.jay: Reverted 642 warning fix.
8059 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8062 * decl.cs (FindMemberWithSameName): Indexer can have more than
8065 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8067 * expression.cs (LocalVariableReference.DoResolveLValue):
8068 Do not report warning 219 for out values.
8069 (EmptyExpression.Null): New member to avoid extra allocations.
8071 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8073 * cs-parser.jay: Fix wrong warning 642 report.
8075 * cs-tokenizer.cs (CheckNextToken): New helper;
8076 Inspect next character if is same as expected.
8078 2004-09-23 Martin Baulig <martin@ximian.com>
8080 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8081 (Convert.ImplicitReferenceConversionExists): Likewise.
8083 2004-11-09 Raja R Harinath <rharinath@novell.com>
8085 * Makefile (DISTFILES): Comment out a few missing files.
8087 2004-10-29 Raja R Harinath <rharinath@novell.com>
8089 * Makefile (bootstrap_libs,bootstrap_libfiles): New.
8090 (bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
8091 (gmcs.exe): Invoke bootstrap-libs.
8092 (clean-local): Clean the net_2_0_bootstrap profile too.
8093 (PROGRAM_INSTALL_DIR): New.
8094 (install-local): Use it.
8096 2004-10-13 Martin Baulig <martin@ximian.com>
8098 * generic.cs (TypeManager.InflatedConstraints): New nested class.
8099 (TypeParameter.DefineType): If we're a method type parameter and
8100 that method is overriding something, "inflate" its constraints.
8102 2004-10-12 Martin Baulig <martin@ximian.com>
8104 * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
8105 and have type arguments, create and resolve a ConstructedType.
8107 2004-10-12 Martin Baulig <martin@ximian.com>
8109 * decl.cs (MemberCache.FindMemberToOverride): Use
8110 TypeManager.IsEqual() to compare the parameters and Type.Equals()
8111 to compare the invocationType.
8113 * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
8114 When comparing two type parameters, only do the signature-only
8115 comparision for method type parameters.
8117 2004-10-11 Martin Baulig <martin@ximian.com>
8119 * report.cs: Don't make --fatal abort on warnings, we have
8120 -warnaserror for that.
8122 2004-10-11 Martin Baulig <martin@ximian.com>
8125 (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
8126 (TypeManager.IsEqual): Call ourself recursively instead of using
8129 2004-10-11 Martin Baulig <martin@ximian.com>
8131 * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
8132 on our own type parameters, not on the ones we inherit from a containing
8135 * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
8138 * generic.cs (TypeParameter.Define): We may only be called once.
8140 * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
8141 instead of TypeManager.IsEqual().
8143 2004-09-28 Martin Baulig <martin@ximian.com>
8146 (GenericConstraints.EffectiveBaseClass): New public property.
8147 (TypeParameter.GenericConstraints): New public property.
8148 (ConstructedType.CheckConstraints): Improved.
8150 * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
8151 (Convert.TypeParameterConversion): New private method; use this in
8152 ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
8153 for all conversions related to type parameters.
8155 2004-09-24 Martin Baulig <martin@ximian.com>
8157 * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
8158 type parameter conversions for type parameters which are known to
8161 2004-09-24 Martin Baulig <martin@ximian.com>
8163 * generic.cs (GenericConstraints): Added `IsReferenceType' and
8164 `IsValueType' properties.
8166 * support.cs (ReflectionConstraints): Use
8167 Type.GetGenericParameterConstraints() instead of the old hack.
8169 2004-09-24 Martin Baulig <martin@ximian.com>
8171 * generic.cs (GenericConstraints): Moved here and made it an
8174 * support.cs (GenericConstraints): Moved to generic.cs.
8176 2004-09-24 Martin Baulig <martin@ximian.com>
8179 (ReflectionConstraints): Un-nested this class and made it public.
8182 (TypeManager.GetTypeParameterConstraints): New public method.
8183 (TypeManager.HasConstructorConstraint): Use the attributes.
8185 2004-09-24 Martin Baulig <martin@ximian.com>
8187 * support.cs (GenericConstraints): Replaced `HasConstructor',
8188 `IsReferenceType' and `IsValueType' with `Attributes'.
8189 (ReflectionParameters.ReflectionConstraints): Removed the Create()
8190 method and made the .ctor public.
8192 * generic.cs (Constraints.Attributes): New public property.
8193 (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
8194 `IsReferenceType' -> `HasReferenceTypeConstraint' and
8195 `IsValueType' -> `HasValueTypeConstraint'.
8197 2004-09-23 Martin Baulig <martin@ximian.com>
8199 * generic.cs (Constraints): Reflect latest runtime changes.
8201 2004-09-23 Martin Baulig <martin@ximian.com>
8203 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8204 (Convert.ImplicitReferenceConversionExists): Likewise.
8206 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8208 * class.cs (Operator.Define): Add error 448 and 559 report.
8210 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8212 * class.cs (MemberBase.IsTypePermitted): New protected
8213 method for checking error CS0610.
8215 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8217 * class.cs (TypeContainer.HasExplicitLayout): New property
8218 Returns whether container has StructLayout attribute set Explicit.
8219 (FieldMember): New abstract class for consts and fields.
8220 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
8221 (Field): Reuse FieldMember.
8223 * const.cs (Const): Reuse FieldMember.
8225 * rootcontext.cs: EmitConstants call moved to class.
8227 2004-09-22 Martin Baulig <martin@ximian.com>
8229 Marek and me just fixed one of our oldest bugs: #28562 :-)
8231 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
8233 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
8234 we're an EnumConstant, just return that.
8235 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
8236 an EnumConstant. In this case, we need to use GetValueAsEnumType()
8237 to get the value which'll actually be written into the attribute.
8238 However, we have to use GetValue() to access the attribute's value
8241 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8243 * constant.cs (Constant.IsNegative): New abstract property
8246 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
8247 (StackAlloc.DoResolve): Reused IsNegative.
8249 2004-09-22 Martin Baulig <martin@ximian.com>
8251 * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
8252 public method; like LookupTypeContainer, but also works for
8255 * report.cs (Report.SymbolRelatedToPreviousError): Use
8256 TypeManager.LookupGenericTypeContainer().
8258 2004-09-22 Martin Baulig <martin@ximian.com>
8260 Thanks to Peter Sestoft for this bug report.
8262 * expression.cs (Conditional): If both the `trueExpr' and the
8263 `falseExpr' is a NullLiteral, return a NullLiteral.
8265 2004-09-22 Martin Baulig <martin@ximian.com>
8267 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
8268 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
8269 for the "get_Current" call.
8271 2004-09-21 Martin Baulig <martin@ximian.com>
8273 * convert.cs (Convert.ImplicitReferenceConversion): When
8274 converting to an interface type, first check whether we're
8275 converting from a reference type.
8277 2004-09-14 Martin Baulig <martin@ximian.com>
8279 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
8281 2004-09-14 Marek Safar <marek.safar@seznam.cz>
8284 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
8285 called and is obsolete then this member suppress message
8286 when call is inside next [Obsolete] method or type.
8288 * expression.cs: Use TestObsoleteMethodUsage member.
8290 2004-09-14 Martin Baulig <martin@ximian.com>
8292 * genericparser.cs: Removed.
8294 2004-09-13 Marek Safar <marek.safar@seznam.cz>
8296 * class.cs (MethodCore.CheckBase): Fix bug #65757.
8298 2004-09-12 Marek Safar <marek.safar@seznam.cz>
8300 * attribute.cs (Attribute.Resolve): Add error 653 report.
8302 * class.cs (Class.ApplyAttributeBuilder): Add error 641
8304 (Method.ApplyAttributeBuilder): Add error 685 report.
8305 (Operator.Define): Add error 564 report.
8307 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
8309 * expression.cs (Invocation.DoResolve): Add error
8312 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
8315 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8317 * class.cs (ConstructorInitializer.Resolve):
8318 Wrong error number (515->516).
8320 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8322 * class.cs (Indexer.Define): Add error 631 report.
8324 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8326 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
8328 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8330 * expression.cs (Probe.DoResolve): Add error CS0241 report.
8332 2004-09-10 Marek Safar <marek.safar@seznam.cz>
8334 * cs-parser.jay: Added error CS0241 report.
8336 2004-09-10 Raja R Harinath <rharinath@novell.com>
8338 * cs-parser.jay (fixed_statement): Introduce a scope for the
8339 declaration in the 'fixed' statement.
8341 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8343 * cs-parser.jay: Added CS0230 error report.
8345 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8347 * cs-parser.jay: Added errors CS0231 and CS0257 report.
8349 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8351 * expression.cs (Argument.Resolve): Added error CS0192 and
8354 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8356 C# 2.0 #pragma warning feature
8358 * cs-tokenizer.cs (PreProcessPragma): New method;
8359 Handles #pragma directive.
8361 * report.cs (WarningRegions): New class; Support
8362 class for #pragma warning directive. It tests whether
8363 warning is enabled for a given line.
8365 2004-09-08 Miguel de Icaza <miguel@ximian.com>
8367 * const.cs: Add more descriptive error report, tahnks to
8370 2004-09-08 Marek Safar <marek.safar@seznam.cz>
8372 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
8374 2004-09-07 Miguel de Icaza <miguel@ximian.com>
8376 * expression.cs: Apply patch from Ben: Remove dead code from
8377 ArrayCreation, and remove the TurnintoConstant call in const.cs,
8378 as that code just threw an exception anwyays.
8380 * const.cs: Remove the call to the turnintoconstant, for details
8383 * literal.cs: The type of the null-literal is the null type; So
8384 we use a placeholder type (literal.cs:System.Null, defined here)
8387 * expression.cs (Conditional.DoResolve): Remove some old code that
8388 is no longer needed, conversions have been fixed.
8390 (ArrayCreationExpression.DoResolve): Return false if we fail to
8391 resolve the inner expression.
8393 2004-09-07 Raja R Harinath <rharinath@novell.com>
8396 * cs-parser.jay (delegate_declaration): Record a delegate
8397 declaration as a type declaration.
8398 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
8400 2004-09-06 Miguel de Icaza <miguel@ximian.com>
8402 * parameter.cs: Do not crash if the type can not be resolved.
8404 * expression.cs: Report errors with unsafe pointers, fixes #64896
8406 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
8408 * expression.cs: Pointer arith always needs to do a conv.i
8409 if the operand is a long. fix 65320
8411 2004-09-04 Marek Safar <marek.safar@seznam.cz>
8413 Fixed cs0619-37.cs, cs0619-38.cs
8415 * enum.cs (GetObsoleteAttribute): Removed.
8417 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
8418 on Enum member is double staged. The first is tested member
8421 2004-09-04 Marek Safar <marek.safar@seznam.cz>
8423 Fixed #56986, #63631, #65231
8425 * class.cs: (TypeContainer.AddToMemberContainer): New method,
8426 adds member to name container.
8427 (TypeContainer.AddToTypeContainer): New method, adds type to
8429 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8430 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8431 AddOperator): Simplified by reusing AddToMemberContainer.
8432 (TypeContainer.UserDefinedStaticConstructor): Changed to property
8434 (Method.CheckForDuplications): Fixed implementation to test all
8436 (MemberBase): Detection whether member is explicit interface
8437 implementation is now in constructor.
8438 (MemberBase.UpdateMemberName): Handles IndexerName.
8439 (Accessor): Changed to keep also location information.
8440 (AbstractPropertyEventMethod): Is derived from MemberCore.
8441 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8442 will be emited or not.
8443 (PropertyBase.AreAccessorsDuplicateImplementation):
8444 Tests whether accessors are not in collision with some method.
8445 (Operator): Is derived from MethodCore to simplify common
8448 * decl.cs (Flags.TestMethodDuplication): Test for duplication
8450 (DeclSpace.AddToContainer): Adds the member to defined_names
8451 table. It tests for duplications and enclosing name conflicts.
8453 * enum.cs (EnumMember): Clean up to reuse the base structures
8455 2004-09-03 Martin Baulig <martin@ximian.com>
8457 Merged latest changes into gmcs. Please keep this comment in
8458 here, it makes it easier for me to see what changed in MCS since
8459 the last time I merged.
8461 2004-09-03 Martin Baulig <martin@ximian.com>
8463 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8464 into TypeContainer, to make partial classes work again.
8466 2004-09-03 Martin Baulig <martin@ximian.com>
8468 * rootcontext.cs (RootContext.V2): Removed.
8470 2004-03-23 Martin Baulig <martin@ximian.com>
8472 * expression.cs (Invocation.OverloadResolve): Added `bool
8473 may_fail' argument and use it instead of the Location.IsNull() hack.
8475 2004-09-09 Martin Baulig <martin@ximian.com>
8477 * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
8479 2004-09-09 Martin Baulig <martin@ximian.com>
8481 * generic.cs (TypeParameter.DefineType): Added support for
8482 explicit interface methods.
8484 2004-09-09 Martin Baulig <martin@ximian.com>
8486 * README.Changes: New document. Started to list important changes
8487 between MCS and GMCS here.
8489 2004-09-08 Martin Baulig <martin@ximian.com>
8492 (TypeContainer.CheckRecursiveDefinition): New protected method.
8493 (TypeContainer.DefineType): Move the CS0146 check into
8494 CheckRecursiveDefinition().
8496 2004-09-06 Martin Baulig <martin@ximian.com>
8498 * generic.cs (ConstructedType.CheckConstraints): Allow builtin
8499 types for the constructor constraint.
8501 2004-09-03 Martin Baulig <martin@ximian.com>
8503 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8504 into TypeContainer, to make partial classes work again.
8506 2004-09-03 Martin Baulig <martin@ximian.com>
8508 * rootcontext.cs (RootContext.V2): Removed.
8510 2004-03-23 Martin Baulig <martin@ximian.com>
8512 * expression.cs (Invocation.OverloadResolve): Added `bool
8513 may_fail' argument and use it instead of the Location.IsNull() hack.
8515 2004-09-03 Martin Baulig <martin@ximian.com>
8517 Merged latest changes into gmcs. Please keep this comment in
8518 here, it makes it easier for me to see what changed in MCS since
8519 the last time I merged.
8521 2004-09-03 Raja R Harinath <rharinath@novell.com>
8524 * expression.cs (BetterConversion): Don't allow either conversion
8525 to be null. Remove redundant implicit conversion test when 'q ==
8526 null' -- when this function is invoked, we already know that the
8527 implicit conversion exists.
8528 (BetterFunction): Assume that 'best' is non-null. Remove
8529 redundant reimplementation of IsApplicable when 'best' is null.
8530 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
8531 number of arguments.
8532 (IsAncestralType): Extract from OverloadResolve.
8533 (OverloadResolve): Make robust to the MethodGroupExpr being
8534 unsorted. Implement all the logic of Section 14.5.5.1, and
8535 support overloading of methods from multiple applicable types.
8536 Clean up logic somewhat. Don't pass null methods to BetterFunction.
8538 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
8539 (RealError, Warning): Append type of report to related symbol.
8541 2004-09-03 Marek Safar <marek.safar@seznam.cz>
8543 * enum.cs: Fixed CLS-Compliance checks for enum members.
8544 Error tests cs3008-8.cs, cs3014-8.cs
8546 2004-09-02 Marek Safar <marek.safar@seznam.cz>
8548 Fixed bug #62342, #63102
8549 * class.cs: ImplementIndexer uses member.IsExplicitImpl
8550 like ImplementMethod.
8552 2004-09-02 Marek Safar <marek.safar@seznam.cz>
8554 * attribute.cs (Attribute.GetAttributeArgumentExpression):
8557 2004-09-02 Martin Baulig <martin@ximian.com>
8559 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8560 TypeManager.GetArgumentTypes() rather than calling GetParameters()
8563 2004-09-01 Marek Safar <marek.safar@seznam.cz>
8565 C# 2.0 Static classes implemented
8567 * class.cs (TypeContainer): instance_constructors,
8568 initialized_fields, initialized_static_fields,
8569 default_constructor, base_inteface_types are protected to be
8570 accessible from StaticClass.
8571 (TypeContainer.DefineDefaultConstructor): New virtual method
8572 for custom default constructor generating
8573 (StaticClass): New class to handle "Static classes" feature.
8575 * cs-parser.jay: Handle static keyword on class like instance
8578 * driver.cs: Added "/langversion" command line switch with two
8579 options (iso-1, default).
8581 2004-08-31 Marek Safar <marek.safar@seznam.cz>
8583 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8585 2004-08-31 Miguel de Icaza <miguel@ximian.com>
8587 * delegate.cs: Style.
8589 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
8591 * delegate.cs: Add seperate instance expr field for miguel.
8593 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
8595 * PointerArithmetic (Resolve): make sure we are not doing
8596 pointer arith on void*. Also, make sure we are resolved
8597 by not setting eclass until resolve.
8599 All callers: Make sure that PointerArithmetic gets resolved.
8601 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
8603 * ArrayCreation (LookupType): If the type does not resolve
8604 to an array, give an error.
8606 2004-08-27 Marek Safar <marek.safar@seznam.cz>
8608 * statement.cs (Try.Resolve): Fixed bug #64222
8610 2004-08-27 Martin Baulig <martin@ximian.com>
8613 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8616 2004-08-26 Marek Safar <marek.safar@seznam.cz>
8618 * ecore.cs (Constantify): Get underlying type via
8619 System.Enum.GetUnderlyingType to avoid StackOverflow on the
8620 Windows in special cases.
8622 2004-08-26 Marek Safar <marek.safar@seznam.cz>
8624 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8625 for obtaining also private methods.
8626 (GetRemoveMethod): Used GetRemoveMethod (true)
8627 for obtaining also private methods.
8629 2004-09-02 Martin Baulig <martin@ximian.com>
8631 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8632 TypeManager.GetArgumentTypes() rather than calling GetParameters()
8635 2004-08-27 Martin Baulig <martin@ximian.com>
8638 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8641 2004-08-25 Martin Baulig <martin@ximian.com>
8643 * support.cs (ReflectionParameters..ctor): If this is a generic
8644 method, retrieve and store its type parameters.
8645 (InternalParameters..ctor): Added `TypeParameter[]' argument.
8646 (ReflectionParameters.GenericConstraints): The argument specifies
8647 the type parameter, not the method parameter.
8648 (InternalParameters.GenericConstraints): Likewise.
8650 * generic.cs (TypeParameter.DefineType): Correctly handle
8651 constraints wrt. generic methods in interfaces and their
8654 2004-08-24 Martin Baulig <martin@ximian.com>
8656 * generic.cs (TypeParameter.IsSubclassOf): New public method.
8657 (Constraints.IsSubclassOf): New internal method.
8659 * typemanager.cs (TypeManager.FindMembers): Added special support
8660 for GenericTypeParameterBuilder's.
8661 (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
8664 2004-08-24 Martin Baulig <martin@ximian.com>
8667 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8668 this for accessibility checks.
8669 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8670 IsNestedFamilyAccessible.
8671 (TypeManager.IsSubclassOf): New method, do what the name actually
8674 2004-08-24 Martin Baulig <martin@ximian.com>
8676 * expression.cs (MemberAccess.DoResolve): When resolving ourselves
8677 as a SimpleName, include the generic arity.
8679 2004-08-24 Martin Baulig <martin@ximian.com>
8681 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8682 MethodAttributes.HideBySig for operators.
8684 2004-08-23 Martin Baulig <martin@ximian.com>
8686 Back to the old error reporting system :-)
8688 * report.cs (Message): Removed.
8689 (Report.MessageData, ErrorData, WarningData): Removed.
8690 (Report.Error, Warning): Back to the old system.
8692 2004-08-23 Martin Baulig <martin@ximian.com>
8694 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8696 * class.cs (TypeContainer.ParentContainer): New public virtual
8697 method; replaces the explicit interface implementation.
8698 (ClassPart.ParentContainer): Override.
8700 2004-08-23 Martin Baulig <martin@ximian.com>
8702 * statement.cs (Switch): Added support for constant switches; see
8703 #59428 or test-285.cs.
8705 2004-08-22 Marek Safar <marek.safar@seznam.cz>
8708 * statement.cs (GetEnumeratorFilter): Removed useless
8709 logic because C# specs is strict. GetEnumerator must be
8712 2004-08-22 Martin Baulig <martin@ximian.com>
8714 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8715 a switch and may break, reset the barrier. Fixes #59867.
8717 2004-08-22 Marek Safar <marek.safar@seznam.cz>
8719 CLS-Compliance speed up (~5% for corlib)
8721 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8722 New method. Tests container for CLS-Compliant names
8724 * class.cs (TypeContainer.VerifyClsName): New method.
8725 Checks whether container name is CLS Compliant.
8726 (Constructor): Implements IMethodData.
8728 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8729 low-case table for CLS Compliance test.
8730 (MemberCache.VerifyClsParameterConflict): New method.
8731 Checks method parameters for CS3006 error.
8733 * enum.cs (EnumMember): Is derived from MemberCore.
8734 (Enum.VerifyClsName): Optimized for better performance.
8736 2004-08-06 Marek Safar <marek.safar@seznam.cz>
8738 * report.cs: Renamed Error_T to Error and changed all
8741 2004-08-06 Marek Safar <marek.safar@seznam.cz>
8743 * class.cs (TypeContainer.IndexerArrayList): New inner class
8744 container for indexers.
8745 (TypeContainer.DefaultIndexerName): New constant for default
8746 indexer name. Replaced all "Item" with this constant.
8747 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8749 * typemanager.cs (TypeManager.default_member_ctor): Cache here
8750 DefaultMemberAttribute constructor.
8752 2004-08-05 Martin Baulig <martin@ximian.com>
8754 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8757 2004-08-05 Marek Safar <marek.safar@seznam.cz>
8759 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8760 multi platforms problem.
8762 * compiler.csproj: Included shared files.
8764 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8766 Fix bug 60333, 55971 in the more general way
8767 * attribute.cs (Attribute.GetAttributeArgumentExpression):
8768 Added arg_type argument for constant conversion.
8769 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8771 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8774 * class.cs (TypeContainer ): New inner classes MethodArrayList,
8775 OperatorArrayList, MethodCoreArrayList for typecontainer
8776 containers. Changed class member types to these new types.
8777 (MethodArrayList.DefineMembers): Added test for CS0659.
8779 2004-08-04 Miguel de Icaza <miguel@ximian.com>
8781 * cfold.cs: Synchronize the folding with the code in expression.cs
8782 Binary.DoNumericPromotions for uint operands.
8784 * attribute.cs: Revert patch from Raja, it introduced a regression
8785 while building Blam-1.2.1 (hard to isolate a test case).
8787 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8791 (TypeContainer.Define): Renamed to DefineContainerMembers because of
8793 (MethodCore.parent_method): New member. The method we're overriding
8794 if this is an override method.
8795 (MethodCore.CheckBase): Moved from Method class and made common.
8796 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8798 (MethodCore.CheckForDuplications): New abstract method. For custom
8799 member duplication search in a container
8800 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8801 method and its return type.
8802 (Event.conflict_symbol): New member. Symbol with same name in the
8806 (MemberCache.FindMemberWithSameName): New method. The method
8807 is looking for conflict with inherited symbols.
8809 2004-08-04 Martin Baulig <martin@ximian.com>
8811 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8813 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8815 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8817 * report.cs (Message): New enum for better error, warning reference in
8819 (MessageData): New inner abstract class. It generally handles printing of
8820 error and warning messages.
8821 Removed unused Error, Warning, Message methods.
8823 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8825 Fix for cs0592-8.cs test
8827 (Attributable.ValidAttributeTargets): Made public.
8828 (Attribute.ExplicitTarget): New member for explicit target value.
8829 (Attribute.CheckTargets): Now we translate explicit attribute
8830 target to Target here.
8832 2004-08-03 Ben Maurer <bmaurer@ximian.com>
8834 * ecore.cs (MethodGroupExpr): new IsBase property.
8836 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8838 * delegate.cs (DelegateCreation): store a MethodGroupExpr
8839 rather than an instance expr.
8841 (DelegateCreation.Emit): Use the method group rather than
8842 the instance expression. Also, if you have base.Foo as the
8843 method for a delegate, make sure to emit ldftn, not ldftnvirt.
8845 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
8847 (NewDelegate.DoResolve): Only check for the existance of Invoke
8848 if the method is going to be needed. Use MethodGroupExpr.
8850 (NewDelegate.Emit): Remove, DelegateCreation implements this.
8852 * expression.cs: For pointer arith., make sure to use
8853 the size of the type, not the size of the pointer to
8856 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8859 * class.cs (Class): Added error CS0502 test.
8861 2004-08-03 John Luke <jluke@cfl.rr.com>
8862 Raja R Harinath <rharinath@novell.com>
8865 * attribute.cs (Attribute.complained_before): New flag.
8866 (Attribute.ResolveType, Attribute.Resolve),
8867 (Attribute.DefinePInvokeMethod): Set it.
8868 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8870 2004-08-03 Martin Baulig <martin@ximian.com>
8872 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8873 use a user-defined operator; we still need to do numeric
8874 promotions in case one argument is a builtin type and the other
8875 one has an implicit conversion to that type. Fixes #62322.
8877 2004-08-18 Martin Baulig <martin@ximian.com>
8879 * class.cs (Method.Define): Use the correct method name when
8880 creating the MethodBuilder for a generic method.
8882 2004-08-17 Martin Baulig <martin@ximian.com>
8884 * generic.cs (Constraints): Support type parameter constraints.
8886 2004-08-16 Martin Baulig <martin@ximian.com>
8888 * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
8889 (Token.GENERIC_DIMENSION): New token; this is returned if we
8890 encounter an unbound generic type in a typeof() expression.
8892 * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
8893 this token is only generated while parsing a typeof() expression.
8894 (typeof_expression): Removed the old unbound_type hack.
8896 * generic.cs (TypeArguments.IsUnbound): New public property.
8898 * decl.cs (MemberName): Added support for unbound types.
8900 2004-08-14 Martin Baulig <martin@ximian.com>
8903 (TypeManager.IsEqualGenericInstance): New static method.
8904 (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
8905 just used to check accessibility, so follow the rules of 26.1.6.
8907 * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
8908 ConstructedType instead of a TypeExpression if we have type arguments.
8910 * cs-parser.jay (typeof_expression): Support unbound generic types.
8912 * ecore.cs (UnboundTypeExpression): New public class.
8914 2004-08-12 Martin Baulig <martin@ximian.com>
8916 * typemanager.cs (TypeManager.IsNestedChildOf): Use
8917 TypeManager.IsEqual() rather than `=='.
8919 * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
8920 generic instances as well.
8922 2004-08-12 Martin Baulig <martin@ximian.com>
8924 * expression.cs (Invocation.InferType): We can only infer method
8925 type parameters. Fixes #62647.
8927 2004-08-11 Martin Baulig <martin@ximian.com>
8929 * class.cs (TypeContainer.DefineType): Create the TypeBuilder
8930 before resolving the base classes.
8932 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8934 * Makefile: install .mdb file too.
8936 2004-08-05 Martin Baulig <martin@ximian.com>
8938 * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
8939 initializer, the current type is just the TypeBuilder, not the
8940 instantiated generic type.
8941 (FieldExpr.IsFieldInitializer): New public property.
8943 2004-08-04 Martin Baulig <martin@ximian.com>
8945 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8947 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8949 2004-08-03 Martin Baulig <martin@ximian.com>
8951 * class.cs (MethodData.Define): If we're an explicit
8952 implementation, remove the generic arity from the type name.
8954 2004-08-03 Martin Baulig <martin@ximian.com>
8956 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8957 use a user-defined operator; we still need to do numeric
8958 promotions in case one argument is a builtin type and the other
8959 one has an implicit conversion to that type. Fixes #62322.
8961 2004-08-02 Martin Baulig <martin@ximian.com>
8963 * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
8965 (TypeContainer.GetClassBases): Return the unexpanded list of
8966 interfaces; we expand them later.
8967 (TypeContainer.DefineType): After creating the TypeBuilder, call
8968 TypeManager.ExpandInterfaces() to get an expanded and resolved
8971 * ecore.cs (TypeExpr.GetInterfaces): Removed
8973 * generics.cs (Constraints.InterfaceConstraints): Remove.
8974 (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
8975 register the interface constraints.
8978 (TypeManager.AddUserType): Removed the `ifaces' argument.
8979 (TypeManager.AddTypeParameter): Likewise.
8980 (TypeManager.AddUserInterface): Removed, was unused.
8981 (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
8982 `TypeExpr[]' array for the interfaces.
8983 (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
8984 has been defined, returns a list of the resolved interfaces types.
8985 (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
8986 (TypeManager.GetExplicitInterfaces): Likewise.
8988 2004-08-02 Martin Baulig <martin@ximian.com>
8990 * expression.cs (Invocation.EmitCall): If we're invoking a method
8991 on a type parameter, use the new `Constrained' prefix opcode.
8993 2004-08-02 Martin Baulig <martin@ximian.com>
8995 * statement.cs (LocalInfo.Flags): Added `IsThis'.
8996 (LocalInfo.IsThis): New public property.
8997 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8999 2004-08-01 Martin Baulig <martin@ximian.com>
9001 * class.cs (TypeContainer.GetClassBases): Don't set the default
9002 here since we may get called from GetPartialBases().
9003 (TypeContainer.DefineType): If GetClassBases() didn't return a
9004 parent, use the default one.
9006 2004-07-30 Martin Baulig <martin@ximian.com>
9008 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
9010 * class.cs (SourceMethod): New public class, derive from the
9011 symbol writer's ISourceMethod.
9012 (Method): Use the new symbol writer API.
9014 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
9015 as argument and use the new symbol writer.
9018 (SourceFile): Implement the symbol writer's ISourceFile.
9019 (Location.SymbolDocument): Removed.
9020 (Location.SourceFile): New public property.
9022 * symbolwriter.cs: Use the new symbol writer API.
9024 2004-07-30 Raja R Harinath <rharinath@novell.com>
9026 * Makefile (install-local): Remove. Functionality moved to
9029 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
9031 * Makefile: Install mcs.exe.config file together with mcs.exe.
9032 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
9033 correct runtime version.
9035 2004-07-25 Martin Baulig <martin@ximian.com>
9038 (TypeContainer.RegisterOrder): Removed, this was unused.
9039 (TypeContainer, interface_order): Removed.
9040 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
9041 TypeContainer as argument since we can also be called with a
9042 `PartialContainer' for a partial class/struct/interface.
9043 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
9044 of checking whether we're an `Interface' - we could be a
9046 (PartialContainer.Register): Override; call
9047 AddClass()/AddStruct()/AddInterface() on our parent.
9049 * cs-parser.jay (interface_member_declaration): Add things to the
9050 `current_container', not the `current_class'.
9052 * rootcontext.cs (RegisterOrder): The overloaded version which
9053 takes an `Interface' was unused, removed.
9055 * typemanager.cs (TypeManager.LookupInterface): Return a
9056 `TypeContainer', not an `Interface'.
9057 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
9058 contain a `PartialContainer' for an interface, so check it's
9059 `Kind' to figure out what it is.
9061 2004-07-25 Martin Baulig <martin@ximian.com>
9063 * class.cs (Class.DefaultTypeAttributes): New public constant.
9064 (Struct.DefaultTypeAttributes): Likewise.
9065 (Interface.DefaultTypeAttributes): Likewise.
9066 (PartialContainer.TypeAttr): Override this and add the
9067 DefaultTypeAttributes.
9069 2004-07-25 Martin Baulig <martin@ximian.com>
9071 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
9072 we can just use the `Parent' field instead.
9074 2004-07-25 Martin Baulig <martin@ximian.com>
9076 * class.cs (TypeContainer.Emit): Renamed to EmitType().
9078 2004-07-25 Martin Baulig <martin@ximian.com>
9080 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
9081 our parts before defining any methods.
9082 (TypeContainer.VerifyImplements): Make this virtual.
9083 (ClassPart.VerifyImplements): Override and call VerifyImplements()
9084 on our PartialContainer.
9086 2004-07-25 Martin Baulig <martin@ximian.com>
9088 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
9090 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
9091 argument, we can just use the `Parent' field instead.
9094 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
9095 (MemberBase.DoDefine): Likewise.
9097 2004-07-24 Martin Baulig <martin@ximian.com>
9099 * decl.cs (MemberCore.Parent): New public field.
9100 (DeclSpace.Parent): Moved to MemberCore.
9102 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
9103 (MemberBase.ctor): Added TypeContainer argument, pass it to our
9105 (FieldBase, Field, Operator): Likewise.
9106 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
9107 (EventField, Event): Likewise.
9109 2004-07-23 Martin Baulig <martin@ximian.com>
9111 * class.cs (PartialContainer): New public class.
9112 (ClassPart): New public class.
9113 (TypeContainer): Added support for partial classes.
9114 (TypeContainer.GetClassBases): Splitted some of the functionality
9115 out into GetNormalBases() and GetPartialBases().
9117 * cs-tokenizer.cs (Token.PARTIAL): New token.
9118 (Tokenizer.consume_identifier): Added some hacks to recognize
9119 `partial', but only if it's immediately followed by `class',
9120 `struct' or `interface'.
9122 * cs-parser.jay: Added support for partial clases.
9124 2004-07-23 Martin Baulig <martin@ximian.com>
9126 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
9127 a `DeclSpace' and also made it readonly.
9128 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
9129 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
9130 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
9132 * cs-parser.jay: Pass the `current_class', not the
9133 `current_container' (at the moment, this is still the same thing)
9134 to a new Method, Property, Event, Indexer or Constructor.
9136 2004-07-23 Martin Baulig <martin@ximian.com>
9138 * cs-parser.jay (CSharpParser): Added a new `current_class' field
9139 and removed the `current_interface' one.
9140 (struct_declaration, class_declaration, interface_declaration):
9141 Set `current_class' to the newly created class/struct/interface;
9142 set their `Bases' and call Register() before parsing their body.
9144 2004-07-23 Martin Baulig <martin@ximian.com>
9146 * class.cs (Kind): New public enum.
9147 (TypeContainer): Made this class abstract.
9148 (TypeContainer.Kind): New public readonly field.
9149 (TypeContainer.CheckDef): New public method; moved here from
9151 (TypeContainer.Register): New public abstract method.
9152 (TypeContainer.GetPendingImplementations): New public abstract
9154 (TypeContainer.GetClassBases): Removed the `is_class' and
9155 `is_iface' parameters.
9156 (TypeContainer.DefineNestedTypes): Formerly known as
9158 (ClassOrStruct): Made this class abstract.
9160 * tree.cs (RootTypes): New public type.
9162 2004-07-20 Martin Baulig <martin@ximian.com>
9164 * tree.cs (Tree.RecordNamespace): Removed.
9165 (Tree.Namespaces): Removed.
9167 * rootcontext.cs (RootContext.IsNamespace): Removed.
9169 * cs-parser.jay (namespace_declaration): Just create a new
9170 NamespaceEntry here.
9172 2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
9174 * Makefile: Install gmcs.exe.config file together with gmcs.exe.
9175 * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
9176 entry to make sure it runs in the correct runtime version.
9178 2004-07-18 Martin Baulig <martin@ximian.com>
9180 * generic.cs (ConstructedType.CheckConstraints): Improved
9181 constraints checking.
9183 2004-07-18 Martin Baulig <martin@ximian.com>
9185 * expression.cs (Invocation.BetterMethod): Call
9186 TypeManager.TypeToCoreType() on all types and removed my previous
9187 hack; we're already doig the right thing here.
9189 2004-07-17 Martin Baulig <martin@ximian.com>
9191 * decl.cs (MemberName.MakeName): Create the "class`1" names here.
9193 2004-07-16 Martin Baulig <martin@ximian.com>
9195 * iterators.cs: Added generics support.
9197 2004-07-16 Martin Baulig <martin@ximian.com>
9199 * iterators.cs: Rewrote this. We're now using one single Proxy
9200 class for both the IEnumerable and the IEnumerator interface and
9201 `Iterator' derives from Class so we can use the high-level API.
9203 * class.cs (TypeContainer.AddIterator): New method.
9204 (TypeContainer.DoDefineType): New protected virtual method, which
9205 is called from DefineType().
9206 (TypeContainer.DoDefineMembers): Call DefineType() and
9207 DefineMembers() on all our iterators.
9208 (TypeContainer.Emit): Call Emit() on all our iterators.
9209 (TypeContainer.CloseType): Call CloseType() on all our iterators.
9211 * codegen.cs (EmitContext.CurrentIterator): New public field.
9213 2004-07-15 Martin Baulig <martin@ximian.com>
9216 (TypeManager.not_supported_exception_type): New type.
9218 2004-07-14 Martin Baulig <martin@ximian.com>
9221 (TypeManager.generic_ienumerable_type): New type.
9222 (TypeManager.generic_ienumerator_type): New type.
9225 (RootContext.interfaces_first_stage): Added
9226 "System.Collections.Generic.IEnumerator`1" and
9227 "System.Collections.Generic.IEnumerable`1".
9229 2004-07-14 Martin Baulig <martin@ximian.com>
9231 * iterators.cs: Use real error numbers.
9233 2004-07-14 Martin Baulig <martin@ximian.com>
9235 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
9236 requires this to be a System.Collection.IEnumerable and not a
9237 class implementing that interface.
9238 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
9240 2004-07-13 Marek Safar <marek.safar@seznam.cz>
9242 * class.cs: Fixed previous fix, it broke some error tests.
9244 2004-07-12 Martin Baulig <martin@ximian.com>
9246 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
9249 2004-07-14 Martin Baulig <martin@ximian.com>
9251 * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
9252 an exclamation mark (!) for the generic arity to reflect the
9253 latest spec changes; ie. use "System.Collections.Generic.IList`1".
9255 2004-07-13 Martin Baulig <martin@ximian.com>
9257 * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
9258 specifiers being part of a type argument.
9260 2004-07-13 Martin Baulig <martin@ximian.com>
9262 * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
9263 name for generic types.
9265 2004-07-13 Martin Baulig <martin@ximian.com>
9267 * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
9270 2004-07-09 Miguel de Icaza <miguel@ximian.com>
9272 * assign.cs (LocalTemporary): Add new argument: is_address,If
9273 `is_address' is true, then the value that we store is the address
9274 to the real value, and not the value itself.
9276 * ecore.cs (PropertyExpr): use the new local temporary
9277 stuff to allow us to handle X.Y += z (where X is a struct)
9279 2004-07-08 Martin Baulig <martin@ximian.com>
9281 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
9282 not always return, just like we're doing in Using.Resolve().
9284 2004-07-07 Miguel de Icaza <miguel@ximian.com>
9286 * cs-parser.jay (fixed_statement): flag this as Pinned.
9288 2004-07-06 Miguel de Icaza <miguel@ximian.com>
9290 * typemanager.cs (TypeManager): Removed MakePinned method, this
9291 mechanism is replaced with the .NET 2.x compatible mechanism of
9292 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
9294 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
9295 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
9296 `IsFixed' property which has a different meaning.
9298 2004-07-02 Raja R Harinath <rharinath@novell.com>
9300 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
9301 visible from inside a nested class, not just the names of the
9302 immediately enclosing class.
9305 2004-06-24 Raja R Harinath <rharinath@novell.com>
9307 * expression.cs (BetterConversion): Remove buggy special-case
9308 handling of "implicit constant expression conversions". At this
9309 point, we already know that the conversion is possible -- we're
9310 only checking to see which is better.
9312 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9314 * cs-parser.jay: Added error CS0210 test.
9316 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9318 * cs-parser.jay: Added error CS0134 test.
9320 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9323 * cs-parser.jay: Added error CS0145 test.
9325 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9327 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
9329 2004-06-23 Ben Maurer <bmaurer@ximian.com>
9331 * expression.cs (StackAlloc.Resolve): The argument may not
9332 be a constant; deal with this case.
9334 2004-06-23 Marek Safar <marek.safar@seznam.cz>
9336 * attribute.cs (IndexerName_GetIndexerName): Renamed to
9337 GetIndexerAttributeValue.
9338 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
9340 * class.cs (Indexer.Define): Added error tests for CS0415,
9343 2004-06-23 Miguel de Icaza <miguel@ximian.com>
9345 * attribute.cs (Attribute.Resolve): Keep field code in sync with
9348 2004-06-23 Martin Baulig <martin@ximian.com>
9350 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
9351 neither return nor throw, reset the barrier as well. Fixes #60457.
9353 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
9355 * class.cs : EventAttributes is now set to None by default.
9356 This fixes bug #60459.
9358 2004-06-18 Marek Safar <marek.safar@seznam.cz>
9361 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9362 Don't throw exception but return null (it's sufficient now).
9364 2004-06-18 Marek Safar <marek.safar@seznam.cz>
9366 * typemanager.cs (GetArgumentTypes): Faster implementation.
9368 2004-06-18 Martin Baulig <martin@ximian.com>
9370 * attribute.cs (Attribute.Resolve): Check whether we're an
9371 EmptyCast which a Constant child. Fixes #60333.
9373 2004-06-17 Ben Maurer <bmaurer@ximian.com>
9375 * statement.cs (EmitCollectionForeach): Account for the fact that
9376 not all valuetypes are in areas which we can take the address of.
9377 For these variables, we store to a temporary variable. Also, make
9378 sure that we dont emit a `callvirt' on a valuetype method.
9380 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9382 * expression.cs (StackAlloc.DoReSolve): Added test for
9383 negative parameter (CS0247).
9385 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9388 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
9390 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9393 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
9396 2004-06-14 Marek Safar <marek.safar@seznam.cz>
9398 Fix bug #58254 & cs1555.cs, cs1556.cs
9399 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
9401 2004-06-14 Marek Safar <marek.safar@seznam.cz>
9403 * cs-parser.jay: Added error CS1669 test for indexers.
9405 2004-06-18 Martin Baulig <martin@ximian.com>
9407 * generics.cs (GenericMethod.ctor): Don't take an Attributes
9408 argument. Fixes #60441.
9410 2004-06-16 Ben Maurer <bmaurer@ximian.com>
9411 * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
9412 The name needs to have the actual name of the method in order
9413 for other tests (such as the one in OverloadResolve for Invoke
9414 on a delegate) to work. As well, it does not really help
9415 error reporting because the method group had multiple methods.
9416 * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
9417 Make profiling work.
9419 2004-06-13 Martin Baulig <martin@ximian.com>
9421 * cs-parser.jay: Don't allow generic attributes.
9423 2004-06-13 Martin Baulig <martin@ximian.com>
9425 * class.cs (MemberBase.DoDefineBase): New protected method.
9426 (MemberBase.DoDefine): Compute the `flags' in the new
9427 DoDefineBase() which must be called first.
9428 (Method.Define): Call DoDefineBase() first so we have the flags
9429 when defining the generic method.
9431 * cs-parser.jay (interface_method_declaration): Support generic methods.
9433 2004-06-13 Martin Baulig <martin@ximian.com>
9435 * decl.cs (TypeName): Removed.
9436 (MemberName): Removed TypeName and MemberNow; now we just have
9439 * cs-parser.jay: Don't distinguish between type arguments and type
9440 parameters in the grammar and simplified the rules a bit. The
9441 reduce/reduce conflicts are now gone (except the one we inherited
9444 2004-06-11 Martin Baulig <martin@ximian.com>
9446 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9447 call this twice: for params and varargs methods.
9449 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9452 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9454 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9456 * attribute.cs (Attribute.GetValidTargets): Made public.
9459 (AbstractPropertyEventMethod): New class for better code sharing.
9460 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
9462 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
9464 2004-06-09 Martin Baulig <martin@ximian.com>
9466 * cs-parser.jay: Removed a reduce/reduce conflict.
9468 2004-06-03 Martin Baulig <martin@ximian.com>
9470 * generic.cs (ConstructedType.GetMemberAccess): Renamed to
9471 GetSimpleName() and return a SimpleName.
9473 * ecore.cs (SimpleName.Arguments): New public field.
9474 (SimpleName): Added overloaded ctor which takes an additional
9475 TypeArguments argument.
9476 (SimpleName.SimpleNameResolve): Added support for generic methods.
9477 (MethodGroupExpr.ResolveGeneric): New public method. The code was
9478 formerly in MemberAccess.DoResolve(), but we also need it in
9479 SimpleNameResolve().
9481 * expression.cs (MemberAccess.DoResolve): Use the new
9482 MethodGroupExpr.ResolveGeneric().
9484 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9486 * decl.cs: If possible, use lookuptypedirect here. We can only do
9487 this if there is no `.' after the namespace. Avoids using
9488 LookupType, which does lots of slow processing.
9489 (FindNestedType) New method, does what it says :-).
9490 * namespace.cs: use LookupTypeDirect.
9491 * rootcontext.cs: use membercache, if possible.
9492 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9494 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9497 According to the spec,
9499 In a member access of the form E.I, if E is a single identifier,
9500 and if the meaning of E as a simple-name (§7.5.2) is a constant,
9501 field, property, localvariable, or parameter with the same type as
9502 the meaning of E as a type-name (§3.8), then both possible
9503 meanings of E are permitted.
9505 We did not check that E as a simple-name had the same type as E as
9508 This trivial check gives us 5-7% on bootstrap time.
9510 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9512 * expression.cs (Invocation.OverloadResolve): Avoid the
9513 use of hashtables and boxing here by allocating on demand.
9515 2004-05-30 Martin Baulig <martin@ximian.com>
9517 * rootcontext.cs (RootContext.LookupType): Don't cache things if
9518 we're doing a silent lookup. Don't try to lookup nested types in
9519 TypeManager.object_type (thanks to Ben Maurer).
9521 2004-05-30 Martin Baulig <martin@ximian.com>
9523 Committing a patch from Ben Maurer.
9525 * rootcontext.cs (RootContext.LookupType): Cache negative results.
9527 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9529 * convert.cs: add a trivial cache for overload operator resolution.
9531 2004-05-31 Marek Safar <marek.safar@seznam.cz>
9534 (AttributeTester.GetObsoleteAttribute): Returns instance of
9535 ObsoleteAttribute when type is obsolete.
9538 (TypeContainer.VerifyObsoleteAttribute): Override.
9539 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
9540 (MethodCode.VerifyObsoleteAttribute): Override.
9541 (MemberBase.VerifyObsoleteAttribute): Override.
9544 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
9545 and report proper error.
9548 (Delegate.VerifyObsoleteAttribute): Override.
9551 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
9552 and report proper error.
9553 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
9556 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
9560 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
9561 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
9562 Added test for ObsoleteAttribute.
9565 (Catch): Derived from Statement.
9567 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9569 * decl.cs: If possible, use lookuptypedirect here. We can only do
9570 this if there is no `.' after the namespace. Avoids using
9571 LookupType, which does lots of slow processing.
9572 (FindNestedType) New method, does what it says :-).
9573 * namespace.cs: use LookupTypeDirect.
9574 * rootcontext.cs: use membercache, if possible.
9575 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9577 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9580 According to the spec,
9582 In a member access of the form E.I, if E is a single identifier,
9583 and if the meaning of E as a simple-name (§7.5.2) is a constant,
9584 field, property, localvariable, or parameter with the same type as
9585 the meaning of E as a type-name (§3.8), then both possible
9586 meanings of E are permitted.
9588 We did not check that E as a simple-name had the same type as E as
9591 This trivial check gives us 5-7% on bootstrap time.
9593 2004-05-30 Marek Safar <marek.safar@seznam.cz>
9595 Fixed bug #59071 & cs0160.cs
9596 * statement.cs (Try.Resolve): Check here whether order of catch
9597 clauses matches their dependencies.
9599 2004-05-30 Marek Safar <marek.safar@seznam.cz>
9602 * ecore.cs (SimpleName.SimpleNameResolve): Added test for
9605 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9607 * expression.cs (Invocation.OverloadResolve): Avoid the
9608 use of hashtables and boxing here by allocating on demand.
9610 2004-05-30 Martin Baulig <martin@ximian.com>
9612 * rootcontext.cs (RootContext.LookupType): Don't cache things if
9613 we're doing a silent lookup. Don't try to lookup nested types in
9614 TypeManager.object_type (thanks to Ben Maurer).
9616 2004-05-30 Martin Baulig <martin@ximian.com>
9618 Committing a patch from Ben Maurer.
9620 * rootcontext.cs (RootContext.LookupType): Cache negative results.
9622 2004-05-29 Martin Baulig <martin@ximian.com>
9624 * class.cs (IMethodData.ShouldIgnore): New method.
9626 * typemanager.cs (TypeManager.MethodFlags): Don't take a
9627 `Location' argument, we don't need it anywhere. Use
9628 `IMethodData.ShouldIgnore ()' instead of
9629 `MethodData.GetMethodFlags ()'.
9630 (TypeManager.AddMethod): Removed.
9631 (TypeManager.AddMethod2): Renamed to AddMethod.
9633 2004-05-29 Martin Baulig <martin@ximian.com>
9635 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9637 * convert.cs (Convert.ImplicitReferenceConversion): If we're
9638 converting from a class type S to an interface type and we already
9639 have an object on the stack, don't box it again. Fixes #52578.
9641 2004-05-29 Martin Baulig <martin@ximian.com>
9643 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9644 Added support for `params' parameters. Fixes #59267.
9646 2004-05-29 Martin Baulig <martin@ximian.com>
9648 * literal.cs (NullPointer): Provide a private .ctor which sets
9649 `type' to TypeManager.object_type. Fixes #59048.
9651 2004-05-29 Martin Baulig <martin@ximian.com>
9653 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9654 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
9656 * ecore.cs (EventExpr.instance_expr): Make the field private.
9658 2004-05-26 Marek Safar <marek.safar@seznam.cz>
9660 Fixed bug #50080 & cs0214-2.cs
9661 * expression.cs (Cast.DoResolve): Check unsafe context here.
9663 * statement.cs (Resolve.DoResolve): Likewise.
9665 2004-05-26 Martin Baulig <martin@ximian.com>
9667 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9669 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9670 (RootContext.LookupType): Pass down the `silent' flag.
9672 2004-05-25 Martin Baulig <martin@ximian.com>
9675 (MethodGroupExpr.IdenticalTypeName): New public property.
9676 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9677 expression actually refers to a type.
9679 2004-05-25 Martin Baulig <martin@ximian.com>
9681 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9682 for #56176 and made it actually work.
9684 2004-05-25 Martin Baulig <martin@ximian.com>
9686 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9687 (FieldExpr, PropertyExpr): Override and implement
9688 CacheTemporaries. Fixes #52279.
9690 2004-05-25 Miguel de Icaza <miguel@ximian.com>
9692 * location.cs: In the new compiler listing a file twice is a
9693 warning, not an error.
9695 2004-05-24 Martin Baulig <martin@ximian.com>
9697 * enum.cs (Enum.DefineType): For the `BaseType' to be a
9698 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
9700 2004-05-24 Martin Baulig <martin@ximian.com>
9702 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9703 walking the `using' list. Fixes #53921.
9705 2004-05-24 Martin Baulig <martin@ximian.com>
9707 * const.cs (Const.LookupConstantValue): Added support for
9708 EmptyCast's; fixes #55251.
9710 2004-05-24 Martin Baulig <martin@ximian.com>
9712 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9713 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9714 which does the CS0135 check. The reason is that we first need to
9715 check whether the variable actually exists.
9717 2004-05-24 Martin Baulig <martin@ximian.com>
9719 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9720 than RootContext.LookupType() to find the explicit interface
9723 2004-05-24 Raja R Harinath <rharinath@novell.com>
9725 * Makefile: Simplify. Use executable.make.
9726 * mcs.exe.sources: New file. List of sources of mcs.exe.
9728 2004-05-24 Anders Carlsson <andersca@gnome.org>
9732 Use the invariant culture when doing String.Compare for CLS case
9735 2004-05-23 Martin Baulig <martin@ximian.com>
9737 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9738 don't have any dots. Fixes #52622, added cs0246-8.cs.
9740 * namespace.cs (NamespaceEntry.Lookup): Likewise.
9742 2004-05-23 Marek Safar <marek.safar@seznam.cz>
9744 * class.cs (MemberBase.Define): Reuse MemberType member for
9745 resolved type. Other methods can use it too.
9747 2004-05-23 Martin Baulig <martin@ximian.com>
9749 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9750 the variable also exists in the current block (otherwise, we need
9751 to report a CS0103). Fixes #58670.
9753 2004-05-23 Martin Baulig <martin@ximian.com>
9755 * flowanalysis.cs (Reachability.Reachable): Compute this
9756 on-the-fly rather than storing it as a field.
9758 2004-05-23 Martin Baulig <martin@ximian.com>
9760 * flowanalysis.cs (Reachability.And): Manually compute the
9761 resulting `barrier' from the reachability.
9763 2004-05-23 Marek Safar <marek.safar@seznam.cz>
9766 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9767 instance of ObsoleteAttribute when symbol is obsolete.
9770 (IMethodData): Extended interface for ObsoleteAttribute support.
9772 2004-05-22 Marek Safar <marek.safar@seznam.cz>
9774 * attribute.cs: Fix bug #55970
9776 2004-05-22 Marek Safar <marek.safar@seznam.cz>
9780 (GetObsoleteAttribute): New method. Creates the instance of
9782 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9783 ObsoleteAttribute when member is obsolete.
9784 (AttributeTester.Report_ObsoleteMessage): Common method for
9785 Obsolete error/warning reporting.
9788 (TypeContainer.base_classs_type): New member for storing parent type.
9791 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9792 for this MemberCore.
9794 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9796 * attribute.cs, const.cs: Fix bug #58590
9798 2004-05-21 Martin Baulig <martin@ximian.com>
9800 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9801 out parameters if the end of the method is unreachable. Fixes
9804 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9806 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9807 Hari was right, why extra method.
9809 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9811 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9813 2004-05-20 Martin Baulig <martin@ximian.com>
9815 * delegate.cs: Convert this file to Unix mode - like the original
9818 2004-05-20 Martin Baulig <martin@ximian.com>
9820 * attribute.cs: Convert this file to Unix mode - like the original
9823 2004-05-19 Marek Safar <marek.safar@seznam.cz>
9825 Fix bug #58688 (MCS does not report error when the same attribute
9828 * attribute.cs (Attribute.Emit): Distinction between null and default.
9830 2004-05-19 Raja R Harinath <rharinath@novell.com>
9832 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9833 of a top-level attribute without an attribute target.
9834 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
9836 (Attribute.Conditional_GetConditionName),
9837 (Attribute.Obsolete_GetObsoleteMessage): Update.
9838 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
9839 part of ScanForIndexerName.
9840 (Attribute.CanIgnoreInvalidAttribute): New function.
9841 (Attribute.ScanForIndexerName): Move to ...
9842 (Attributes.ScanForIndexerName): ... here.
9843 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9844 (Attributes.Search): New internal variant that can choose not to
9845 complain if types aren't resolved. The original signature now
9847 (Attributes.GetClsCompliantAttribute): Use internal variant, with
9848 complaints suppressed.
9849 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9850 only if it not useful.
9851 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9852 top-level for attributes that are shared between the assembly
9853 and a top-level class.
9854 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9855 * class.cs: Update to reflect changes.
9856 (DefineIndexers): Fuse loops.
9857 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
9858 a couple more variants of attribute names.
9860 2004-05-18 Marek Safar <marek.safar@seznam.cz>
9862 Fix bug #52585 (Implemented explicit attribute declaration)
9865 (Attributable.ValidAttributeTargets): New abstract method. It gets
9866 list of valid attribute targets for explicit target declaration.
9867 (Attribute.Target): It holds target itself.
9868 (AttributeSection): Removed.
9869 (Attribute.CheckTargets): New method. It checks whether attribute
9870 target is valid for the current element.
9873 (EventProperty): New class. For events that are declared like
9874 property (with add and remove accessors).
9875 (EventField): New class. For events that are declared like field.
9878 * cs-parser.jay: Implemented explicit attribute target declaration.
9880 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
9881 Override ValidAttributeTargets.
9884 (ReturnParameter): Class for applying custom attributes on
9886 (ParameterAtribute): New class. Class for applying custom
9887 attributes on the parameter type.
9889 2004-05-17 Miguel de Icaza <miguel@ximian.com>
9891 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9894 (Method): Allow UNSAFE here.
9896 * modifiers.cs: Support unsafe reporting.
9898 2004-05-17 Marek Safar <marek.safar@seznam.cz>
9900 * decl.cs: Fix bug #58478.
9902 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9904 * statement.cs: When checking for unreachable code on an EmptyStatement,
9905 set the location. Fixes bug #58488.
9907 2004-05-13 Miguel de Icaza <miguel@ximian.com>
9909 * driver.cs: Add -pkg handling.
9911 From Gonzalo: UseShelLExecute=false
9913 2004-05-12 Marek Safar <marek.safar@seznam.cz>
9916 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9918 (Attribute.IsClsCompliaceRequired): Moved to base for better
9920 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9921 when attribute is AttributeUsageAttribute.
9922 (Attribute.GetValidTargets): Simplified.
9923 (Attribute.GetAttributeUsage): New method returns AttributeUsage
9924 attribute for this type.
9925 (Attribute.ApplyAttributes): Method renamed to Emit and make
9927 (GlobalAttributeSection): New class for special handling of global
9928 attributes (assembly, module).
9929 (AttributeSection.Emit): New method.
9931 * class.cs: Implemented Attributable abstract methods.
9932 (MethodCore.LabelParameters): Moved to Parameter class.
9933 (Accessor): Is back simple class.
9934 (PropertyMethod): Implemented Attributable abstract class.
9935 (DelegateMethod): Implemented Attributable abstract class.
9936 (Event): New constructor for disctintion between normal Event
9937 and Event with accessors.
9939 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9941 * codegen.cs, const.cs, decl.cs, delegate.cs:
9942 (CommonAssemblyModulClass): Implemented Attributable abstract class
9945 * enum.cs: Implement IAttributeSupport interface.
9946 (EnumMember): New class for emum members. Implemented Attributable
9950 (ParameterBase): Is abstract.
9951 (ReturnParameter): New class for easier [return:] attribute handling.
9953 * typemanager.cs: Removed builder_to_attr.
9955 2004-05-11 Raja R Harinath <rharinath@novell.com>
9958 * attribute.cs (Attribute.GetPositionalValue): New function.
9959 * class.cs (TypeContainer.VerifyMembers): New function.
9960 (TypeContainer.Emit): Use it.
9961 (ClassOrStruct): New base class for Class and Struct.
9962 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
9963 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9965 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9966 then each non-static field should have a FieldOffset attribute.
9967 Otherwise, none of the fields should have a FieldOffset attribute.
9968 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
9969 and FieldOffset attributes.
9970 * typemanager.cs (TypeManager.struct_layout_attribute_type)
9971 (TypeManager.field_offset_attribute_type): New core types.
9972 (TypeManager.InitCoreTypes): Initialize them.
9974 2004-05-11 Michal Moskal <malekith@pld-linux.org>
9976 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9977 Return correct type.
9980 2004-05-09 Miguel de Icaza <miguel@ximian.com>
9982 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9983 be implicitly converted to ulong.
9985 * expression.cs: The logic for allowing operator &, | and ^ worked
9986 was wrong, it worked before because we did not report an error in
9987 an else branch. Fixes 57895.
9989 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9990 allow volatile fields to be reference types.
9992 2004-05-07 Miguel de Icaza <miguel@ximian.com>
9994 * driver.cs: Add support for /debug-
9996 2004-05-07 Raja R Harinath <rharinath@novell.com>
9998 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
9999 Add a 'complain' parameter to silence errors.
10000 (Attribute.Resolve): Update to changes. Put in sanity check to catch
10001 silently overlooked type-resolutions.
10002 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
10003 to reflect changes.
10004 (Attributes.Search): New function.
10005 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
10006 (Attributes.GetAttributeFullName): Remove hack.
10007 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
10008 Update to reflect changes.
10009 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10010 Use Attributes.Search instead of nested loops.
10012 2004-05-07 Marek Safar <marek.safar@seznam.cz>
10015 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
10016 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
10017 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
10019 * report.cs: (Report.Warning): Renamed to Warning_T because of
10020 parameter collision.
10022 2004-05-05 Raja R Harinath <rharinath@novell.com>
10024 * expression.cs (MemberAccess.ResolveMemberAccess):
10025 Exit with non-zero status after Report.Error.
10026 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
10028 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
10030 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
10032 * support.cs: Don't hang when the file is empty.
10034 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
10036 * support.cs: In SeekableStreamReader, compute the preamble size of the
10037 underlying stream. Position changes should take into account that initial
10040 2004-05-03 Todd Berman <tberman@sevenl.net>
10042 * driver.cs: remove unused GetSysVersion function.
10044 2004-05-03 Todd Berman <tberman@sevenl.net>
10046 * driver.cs: Remove the hack from saturday, as well as the hack
10047 from jackson (LoadAssemblyFromGac), also adds the CWD to the
10048 link_paths to get that bit proper.
10050 2004-05-01 Todd Berman <tberman@sevenl.net>
10052 * driver.cs: Try a LoadFrom before a Load, this checks the current
10053 path. This is currently a bug in mono that is be fixed, however, this
10054 provides a workaround for now. This will be removed when the bug
10057 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
10059 * CryptoConvert.cs: Updated to latest version. Fix issue with
10060 incomplete key pairs (#57941).
10062 2004-05-01 Todd Berman <tberman@sevenl.net>
10064 * driver.cs: Remove '.' from path_chars, now System.* loads properly
10067 2004-04-30 Jackson Harper <jackson@ximian.com>
10069 * codegen.cs: Open keys readonly.
10071 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10073 * typemanager.cs: don't report cyclic struct layout when a struct
10074 contains 2 or more fields of the same type. Failed for Pango.AttrShape
10075 which has 2 Pango.Rectangle fields.
10077 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
10079 * expression.cs: Handle IntPtr comparisons with IL code
10080 rather than a method call.
10082 2004-04-29 Martin Baulig <martin@ximian.com>
10084 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
10085 the list of PropertyInfo's in class hierarchy and find the
10086 accessor. Fixes #56013.
10088 2004-04-29 Martin Baulig <martin@ximian.com>
10090 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
10092 2004-04-29 Martin Baulig <martin@ximian.com>
10094 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10096 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
10098 2004-04-29 Martin Baulig <martin@ximian.com>
10100 * class.cs (ConstructorInitializer.Resolve): Check whether the
10101 parent .ctor is accessible. Fixes #52146.
10103 2004-04-29 Martin Baulig <martin@ximian.com>
10105 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10107 * statement.cs (Using.EmitLocalVariableDecls): Use
10108 TypeManager.idisposable_type, not typeof (IDisposable).
10109 (Foreach.EmitCollectionForeach): Added support for valuetypes.
10111 2004-04-29 Martin Baulig <martin@ximian.com>
10113 * class.cs (Event.Define): Don't emit the field and don't set
10114 RTSpecialName and SpecialName for events on interfaces. Fixes
10117 2004-04-29 Raja R Harinath <rharinath@novell.com>
10119 Refactor Attribute.ApplyAttributes.
10120 * attribute.cs (Attributable): New base class for objects that can
10121 have Attributes applied on them.
10122 (Attribute): Make AttributeUsage fields public.
10123 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
10124 (Attribute.IsInternalCall): New property.
10125 (Attribute.UsageAttr): Convert to a public read-only property.
10126 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
10127 (Attribute.ResolveType, Attribute.Resolve)
10128 (Attribute.ScanForIndexerName): Update to reflect changes.
10129 (Attribute.CheckAttributeTarget): Re-format.
10130 (Attribute.ApplyAttributes): Refactor, to various
10131 Attributable.ApplyAttributeBuilder methods.
10132 * decl.cs (MemberCore): Make Attributable.
10133 * class.cs (Accessor): Make Attributable.
10134 (MethodData.ApplyAttributes): Use proper attribute types, not
10136 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
10137 (TypeContainer.ApplyAttributeBuilder)
10138 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
10139 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
10140 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
10141 (Operator.ApplyAttributeBuilder): New factored-out methods.
10142 * const.cs (Const.ApplyAttributeBuilder): Likewise.
10143 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
10144 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
10145 * parameter.cs (ParameterBase): New Attributable base class
10146 that can also represent Return types.
10147 (Parameter): Update to the changes.
10149 2004-04-29 Jackson Harper <jackson@ximian.com>
10151 * driver.cs: Prefer the corlib system version when looking for
10152 assemblies in the GAC. This is still a hack, but its a better hack
10155 2004-04-29 Marek Safar <marek.safar@seznam.cz>
10157 * decl.cs, enum.cs: Improved error 3005 reporting.
10159 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
10160 (related_symbols): New private member for list of symbols
10161 related to reported error/warning.
10163 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
10165 2004-04-29 Martin Baulig <martin@ximian.com>
10167 * ecore.cs (Expression.Constantify): If we're an enum and
10168 TypeManager.TypeToCoreType() doesn't give us another type, use
10169 t.UnderlyingSystemType. Fixes #56178.
10171 2004-04-29 Martin Baulig <martin@ximian.com>
10173 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
10174 interfaces and for each interface, only add members directly
10175 declared in that interface. Fixes #53255.
10177 2004-04-28 Martin Baulig <martin@ximian.com>
10179 * expression.cs (ConditionalLogicalOperator): Use a temporary
10180 variable for `left' to avoid that we evaluate it more than once;
10183 2004-04-28 Martin Baulig <martin@ximian.com>
10185 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
10188 2004-04-28 Martin Baulig <martin@ximian.com>
10190 * statement.cs (LocalInfo.Resolve): Check whether the type is not
10193 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
10194 whether the type is not void (CS1547).
10196 2004-04-28 Martin Baulig <martin@ximian.com>
10198 * expression.cs (Unary.DoResolveLValue): Override this and report
10199 CS0131 for anything but Operator.Indirection.
10201 2004-04-28 Martin Baulig <martin@ximian.com>
10203 Committing a patch from Ben Maurer; see bug #50820.
10205 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10208 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10211 2004-04-28 Martin Baulig <martin@ximian.com>
10213 Committing a patch from Ben Maurer; see bug #50820.
10215 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10218 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10221 2004-04-28 Martin Baulig <martin@ximian.com>
10223 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
10224 (Block.AddLabel): Call DoLookupLabel() to only search in the
10227 2004-04-28 Martin Baulig <martin@ximian.com>
10229 * cfold.cs (ConstantFold.BinaryFold): Added special support for
10230 comparing StringConstants and NullLiterals in Equality and Inequality.
10232 2004-04-28 Jackson Harper <jackson@ximian.com>
10234 * driver.cs: Attempt to load referenced assemblies from the
10235 GAC. This is the quick and dirty version of this method that
10236 doesnt take into account versions and just takes the first
10237 canidate found. Will be good enough for now as we will not have more
10238 then one version installed into the GAC until I update this method.
10240 2004-04-28 Martin Baulig <martin@ximian.com>
10242 * typemanager.cs (TypeManager.CheckStructCycles): New public
10243 static method to check for cycles in the struct layout.
10245 * rootcontext.cs (RootContext.PopulateTypes): Call
10246 TypeManager.CheckStructCycles() for each TypeContainer.
10247 [Note: We only need to visit each type once.]
10249 2004-04-28 Martin Baulig <martin@ximian.com>
10251 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
10253 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
10254 success and added `out object value'. Use a `bool resolved' field
10255 to check whether we've already been called rather than
10256 `ConstantValue != null' since this breaks for NullLiterals.
10258 2004-04-28 Raja R Harinath <rharinath@novell.com>
10260 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
10261 setting of this flag, since the 'set' method may be non-public.
10263 2004-04-28 Raja R Harinath <rharinath@novell.com>
10265 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
10266 check on current_vector.Block.
10268 2004-04-27 Martin Baulig <martin@ximian.com>
10270 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
10271 a field initializer. Fixes #56459.
10273 2004-04-27 Martin Baulig <martin@ximian.com>
10275 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
10276 we're not attempting to use an indexer. Fixes #52154.
10278 2004-04-27 Martin Baulig <martin@ximian.com>
10280 * statement.cs (Return): Don't create a return label if we don't
10281 need it; reverts my change from January 20th. Thanks to Ben
10284 2004-04-27 Martin Baulig <martin@ximian.com>
10286 According to the spec, `goto' can only leave a nested scope, but
10289 * statement.cs (Block.LookupLabel): Only lookup in the current
10290 block, don't recurse into parent or child blocks.
10291 (Block.AddLabel): Check in parent and child blocks, report
10292 CS0140/CS0158 if we find a duplicate.
10293 (Block): Removed this indexer for label lookups.
10294 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
10295 this already does the error reporting for us.
10298 (FlowBranching.UsageVector.Block): New public variable; may be null.
10299 (FlowBranching.CreateSibling): Added `Block' argument.
10300 (FlowBranching.LookupLabel): New public virtual method. Lookup a
10301 label for the target of a `goto' and check whether we're not
10302 leaving a `finally'.
10304 2004-04-27 Martin Baulig <martin@ximian.com>
10306 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10307 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
10310 2004-04-27 Martin Baulig <martin@ximian.com>
10312 * statement.cs (Block.AddLabel): Also check for implicit blocks
10313 and added a CS0158 check.
10315 2004-04-27 Martin Baulig <martin@ximian.com>
10317 * flowanalysis.cs (FlowBranchingLoop): New class.
10318 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
10319 UsageVector's instead of an ArrayList.
10320 (FlowBranching.Label): Likewise.
10321 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
10322 (FlowBranching.AddBreakVector): New method.
10324 2004-04-27 Miguel de Icaza <miguel@ximian.com>
10326 * attribute.cs: Small regression fix: only convert the type if we
10327 the type is different, fixes System.Drawing build.
10329 2004-04-27 Martin Baulig <martin@ximian.com>
10331 * attribute.cs (Attribute.Resolve): If we have a constant value
10332 for a named field or property, implicity convert it to the correct
10335 2004-04-27 Raja R Harinath <rharinath@novell.com>
10337 * statement.cs (Block.Block): Implicit blocks share
10338 'child_variable_names' fields with parent blocks.
10339 (Block.AddChildVariableNames): Remove.
10340 (Block.AddVariable): Mark variable as "used by a child block" in
10341 every surrounding block.
10342 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
10343 been used in a child block, complain about violation of "Invariant
10344 meaning in blocks" rule.
10345 * cs-parser.jay (declare_local_variables): Don't use
10346 AddChildVariableNames.
10347 (foreach_statement): Don't create an implicit block: 'foreach'
10348 introduces a scope.
10350 2004-04-23 Miguel de Icaza <miguel@ximian.com>
10352 * convert.cs (ImplicitNumericConversion): 0 is also positive when
10353 converting from 0L to ulong. Fixes 57522.
10355 2004-04-22 Marek Safar <marek.safar@seznam.cz>
10357 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
10358 derived class hides via 'new' keyword field from base class (test-242.cs).
10359 TODO: Handle this in the more general way.
10361 * class.cs (CheckBase): Ditto.
10363 2004-04-22 Marek Safar <marek.safar@seznam.cz>
10365 * decl.cs (caching_flags): New member for storing cached values
10367 (MemberCore.Flags): New enum where bit flags for caching_flags
10369 (MemberCore.cls_compliance): Moved to caching_flags.
10370 (DeclSpace.Created): Moved to caching_flags.
10372 * class.cs: Use caching_flags instead of DeclSpace.Created
10374 2004-04-21 Miguel de Icaza <miguel@ximian.com>
10376 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
10377 if we are only a derived class, not a nested class.
10379 * typemanager.cs: Same as above, but do this at the MemberLookup
10380 level (used by field and methods, properties are handled in
10381 PropertyExpr). Allow for the qualified access if we are a nested
10384 2004-04-21 Marek Safar <marek.safar@seznam.cz>
10386 * class.cs: Refactoring.
10387 (IMethodData): New inteface; Holds links to parent members
10388 to avoid member duplication (reduced memory allocation).
10389 (Method): Implemented IMethodData interface.
10390 (PropertyBase): New inner classes for get/set methods.
10391 (PropertyBase.PropertyMethod): Implemented IMethodData interface
10392 (Event): New inner classes for add/remove methods.
10393 (Event.DelegateMethod): Implemented IMethodData interface.
10395 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
10396 EmitContext (related to class.cs refactoring).
10398 2004-04-21 Raja R Harinath <rharinath@novell.com>
10400 * delegate.cs (Delegate.VerifyApplicability): If the number of
10401 arguments are the same as the number of parameters, first try to
10402 verify applicability ignoring any 'params' modifier on the last
10406 2004-04-08 Martin Baulig <martin@ximian.com>
10408 Merged latest changes into gmcs. Please keep this comment in
10409 here, it makes it easier for me to see what changed in MCS since
10410 the last time I merged.
10412 2004-04-16 Raja R Harinath <rharinath@novell.com>
10414 * class.cs (TypeContainer.AddIndexer): Use
10415 'ExplicitInterfaceName' to determine if interface name was
10416 explicitly specified. 'InterfaceType' is not initialized at this time.
10417 (TypeContainer.DefineIndexers): Remove use of temporary list. The
10418 Indexers array is already in the required order. Initialize
10419 'IndexerName' only if there are normal indexers.
10420 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10421 (TypeContainer.Emit): Emit DefaultMember attribute only if
10422 IndexerName is initialized.
10425 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
10427 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10430 2004-04-15 Raja R Harinath <rharinath@novell.com>
10432 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10436 * attribute.cs (Attribute.Resolve): Check for duplicate named
10440 2004-04-15 Miguel de Icaza <miguel@ximian.com>
10442 * iterators.cs (MarkYield): track whether we are in an exception,
10443 and generate code accordingly. Use a temporary value to store the
10444 result for our state.
10446 I had ignored a bit the interaction of try/catch with iterators
10447 since their behavior was not entirely obvious, but now it is
10448 possible to verify that our behavior is the same as MS .NET 2.0
10452 2004-04-14 Miguel de Icaza <miguel@ximian.com>
10454 * iterators.cs: Avoid creating temporaries if there is no work to
10457 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10458 Enumerations, use TypeManager.EnumToUnderlying and call
10461 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10464 (This.Emit): Use EmitContext.EmitThis to emit our
10467 (This.EmitAssign): Ditto.
10469 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
10470 codepaths, we will move all the functionality into
10473 (FieldExpr.EmitAssign): Ditto.
10475 This fixes several hidden bugs that I uncovered while doing a code
10476 review of this today.
10478 * codegen.cs (EmitThis): reworked so the semantics are more clear
10479 and also support value types "this" instances.
10481 * iterators.cs: Changed so that for iterators in value types, we
10482 do not pass the value type as a parameter.
10484 Initialization of the enumerator helpers is now done in the caller
10485 instead of passing the parameters to the constructors and having
10486 the constructor set the fields.
10488 The fields have now `assembly' visibility instead of private.
10490 2004-04-11 Miguel de Icaza <miguel@ximian.com>
10492 * expression.cs (Argument.Resolve): Check if fields passed as ref
10493 or out are contained in a MarshalByRefObject.
10495 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
10496 another compiler type.
10498 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
10500 * class.cs (Indexer.Define): use the new name checking method.
10501 Also, return false on an error.
10502 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
10503 (is_identifier_[start/part]_character): make static.
10505 2004-04-10 Miguel de Icaza <miguel@ximian.com>
10507 * expression.cs (Binary.ResolveOperator): Do no append strings
10508 twice: since we can be invoked more than once (array evaluation)
10509 on the same concatenation, take care of this here. Based on a fix
10510 from Ben (bug #56454)
10512 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
10514 * codegen.cs: Fix another case where CS1548 must be reported (when
10515 delay-sign isn't specified and no private is available #56564). Fix
10516 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
10517 error when MCS is used on the MS runtime and we need to delay-sign
10518 (which seems unsupported by AssemblyBuilder - see #56621).
10520 2004-04-08 Marek Safar <marek.safar@seznam.cz>
10522 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
10523 (TypeManager.ComputeNamespaces): Faster implementation for
10526 * compiler.csproj: Updated AssemblyName to mcs.
10528 2004-05-11 Jackson Harper <jackson@ximian.com>
10530 * Makefile: Preserve MONO_PATH
10532 2004-05-11 Jackson Harper <jackson@ximian.com>
10534 * Makefile: Use mono and mcs to build gmcs
10536 2004-05-03 Miguel de Icaza <miguel@ximian.com>
10538 * codegen.cs: Add patch from Robert Shade
10539 <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
10542 2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
10544 * CryptoConvert.cs: Updated to latest version. Fix issue with
10545 incomplete key pairs (#57941).
10547 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
10549 * codegen.cs: Fix another case where CS1548 must be reported (when
10550 delay-sign isn't specified and no private is available #56564). Fix
10551 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
10552 error when MCS is used on the MS runtime and we need to delay-sign
10553 (which seems unsupported by AssemblyBuilder - see #56621).
10555 2004-04-29 Jackson Harper <jackson@ximian.com>
10557 * Makefile: Set MONO_PATH to use the bootstrap corlib
10558 * driver.cs: Check the GAC for referenced assemblies.
10560 2004-04-29 Martin Baulig <martin@ximian.com>
10562 * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
10564 2004-04-07 Martin Baulig <martin@ximian.com>
10566 * expression.cs (Binary.ResolveOperator): Added special case for
10567 Equality/Inequality between a type parameter and a null literal.
10569 2004-04-07 Martin Baulig <martin@ximian.com>
10571 * convert.cs: Check null literal -> type parameter conversions.
10573 2004-04-07 Martin Baulig <martin@ximian.com>
10575 * generic.cs (ConstructedType.CheckConstraints): Enforce the
10576 `class' and `struct' constraints.
10578 2004-04-07 Martin Baulig <martin@ximian.com>
10580 * generic.cs (SpecialConstraint): New public enum.
10581 (Constraints.Resolve): Added support for the `class' and `struct'
10584 * cs-parser.jay (type_parameter_constraint): Added support for the
10585 `class' and `struct' constraints.
10587 2004-04-07 Martin Baulig <martin@ximian.com>
10589 * support.cs (GenericConstraints): Replaced `Types' by
10590 `ClassConstraint' and `InterfaceConstraints'; added
10591 `HasClassConstraint'.
10593 2004-04-07 Martin Baulig <martin@ximian.com>
10596 (Constraints.InterfaceConstraints): New public property.
10597 (Constraints.Types): Make this property public
10598 (TypeParameter): Implement IMemberContainer.
10599 (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
10600 instead of a TypeBuilder/MethodBuilder; pass the interface
10601 constraints to TypeManager.AddTypeParameter().
10602 (TypeParameter.DefineType): Just take an EmitContext and no
10603 TypeBuilder/MethodBuilder. Use the new public API.
10605 * typemanager.cs (TypeManager.AddTypeParameter): Added
10606 `TypeExpr[]' argument; add the interfaces to the
10607 `builder_to_ifaces' hash.
10608 (TypeManager.LookupMemberContainer): For
10609 GenericTypeParameterBuilders, get the TypeParameter from the
10610 `builder_to_type_param'.
10611 (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
10612 the TypeParameter and call FindMembers on it.
10614 2004-04-07 Martin Baulig <martin@ximian.com>
10617 (MethodCore.GenericMethod): Moved this field here from Method.
10618 (MethodCore.IsDuplicateImplementation): Take the number of type
10619 parameters into account if we're a generic method.
10621 * expression.cs (Invocation.InferTypeArguments): Don't return true
10622 if `arguments' is null; we still need to check whether we actually
10623 don't need to infer anything in this case.
10624 (MemberAccess): Merged the functionality from GenericMemberAccess
10627 * generic.cs (GenericMemberAccess): Removed.
10629 2004-04-05 Martin Baulig <martin@ximian.com>
10631 * decl.cs (MemberCore): For generic classes, interfaces and
10632 structs, `Name' now includes the number of type parameters
10633 ("Stack!1.Node!1").
10634 (DeclSpace.FindType): Removed the `num_type_args' argument; we now
10635 encode the number of type arguments in the type name.
10637 * expression.cs (Expression.MemberLookup): Removed the
10638 `num_type_args' argument; we now encode the number of type
10639 arguments in the type name.
10641 * ecore.cs (SimpleName): Encode the number of type arguments in
10642 the type name itself.
10644 * generic.cs (ConstructedType): Likewise.
10646 * tree.cs (Tree.RecordDecl): Take a `string' instead of a
10647 `MemberName'; we now include the number of type parameters in the
10650 * typemanager.cs (TypeManager.CheckGeneric): Removed.
10651 (TypeManager.MemberLookup): Removed the
10652 `num_type_args' argument; we now encode the number of type
10653 arguments in the type name.
10655 2004-04-03 Martin Baulig <martin@ximian.com>
10657 * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
10658 (MemberCore.MemberName): Moved here from MemberBase.
10659 (DeclSpace.SetParameterInfo): Just take the constraints as an
10660 ArrayList; we already have the type parameters in our
10661 `MemberName'; also do the CS0080 reporting here.
10663 * cs-parser.jay (struct_declaration): Use `member_name' instead of
10664 `IDENTIFIER opt_type_parameter_list'; when constructing our
10665 `MemberName', it'll already include our type parameters.
10666 (class_declaration, interface_declaration): Likewise.
10667 (delegate_declaration): Likewise.
10668 (MakeName): Take a MemberName and return a MemberName.
10669 The following two changes are required to avoid shift/reduce conflicts:
10670 (member_name): Don't include a TypeName anymore; ie. this is now
10671 just 'IDENTIFIER opt_type_parameter_list'.
10672 (property_declaration, event_declaration): Use a
10673 `namespace_or_type_name' instead of a `member_name'.
10675 2004-04-03 Martin Baulig <martin@ximian.com>
10677 * decl.cs (MemberName): Renamed to `TypeName' and created a new
10678 `MemberName' class.
10679 (TypeName): Formerly known as MemberName.
10681 * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
10682 instead of a `MemberName'.
10684 * cs-parser.jay (namespace_or_type_name): Create a TypeName.
10685 (member_name): New rule; create a MemberName.
10687 2004-04-02 Martin Baulig <martin@ximian.com>
10689 * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
10690 (CS0305 and CS0308).
10692 2004-04-02 Martin Baulig <martin@ximian.com>
10694 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
10695 support for nested types.
10697 2004-04-02 Martin Baulig <martin@ximian.com>
10699 * ecore.cs (IAlias): New public interface.
10700 (TypeExpr, TypeExpression): Implement IAlias.
10701 (TypeAliasExpression): New public class.
10703 * namespace.cs (Namespace): Implement IAlias.
10704 (Namespace.Lookup): Return an IAlias instead on an object.
10705 (Namespace.DefineName): Take an IAlias instead of an object.
10706 (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
10708 (NamespaceEntry.UsingAlias): Take a Membername instead of an
10710 (NamespaceEntry.LookupAlias): Return an IAlias instead on an
10712 (NamespaceEntry.Lookup): Likewise.
10714 * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
10717 * decl.cs (DeclSpace): Implement IAlias.
10718 (DeclSpace.LookupAlias): Return an IAlias instead of a string.
10720 * generic.cs (ConstructedType): Improved error checking.
10722 2004-04-02 Martin Baulig <martin@ximian.com>
10724 * convert.cs: Added type parameter conversions.
10727 (UnboxCast.Emit): Emit an `unbox.any' for type params.
10728 (ClassCast.Emit): If the source type is a type parameter, box it.
10729 If the target type is a type parameter, emit an `unbox.any'
10730 instead of a `classcast'.1
10732 2004-04-01 Martin Baulig <martin@ximian.com>
10734 * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
10736 2004-04-01 Martin Baulig <martin@ximian.com>
10738 * generic.cs (ConstructedType.CheckConstraints): Use
10739 Convert.ImplicitStandardConversionExists(); user-defined implicit
10740 conversions are not allowed according to the spec.
10742 2004-03-30 Martin Baulig <martin@ximian.com>
10744 * expression.cs (New): Added support for type parameters.
10747 (TypeManager.activator_type): New public static field.
10748 (TypeManager.activator_create_instance): Likewise.
10750 2004-03-30 Martin Baulig <martin@ximian.com>
10752 * typemanager.cs (TypeManager.HasConstructorConstraint): New
10755 2004-03-30 Martin Baulig <martin@ximian.com>
10757 * generic.cs (ConstructedType.CheckConstraints): Actually follow
10758 the spec here: the argument type must be convertible to the
10761 2004-03-30 Martin Baulig <martin@ximian.com>
10764 (TypeParameter.Define, TypeParameter.DefineMethod): Call
10765 TypeManager.AddTypeParameter().
10766 (ConstructedType.CheckConstraints): Re-enable this and actually
10767 check whether we have a constructor constraint.
10770 (TypeManager.builder_to_type_param): New static field.
10771 (TypeManager.AddTypeParameter): New static method.
10772 (TypeManager.LookupTypeParameter): New public method.
10774 2004-03-30 Martin Baulig <martin@ximian.com>
10776 * generic.cs (TypeParameter.DefineType): Return a boolean and use
10777 the new API to actually define the constructor constraint.
10780 (TypeManager.new_constraint_attr_type): New static field.
10781 (TypeManager.InitCoreTypes): Initialize it.
10783 2004-03-30 Martin Baulig <martin@ximian.com>
10785 * generic.cs (Constraints): Completed error checking, use correct
10788 2004-03-29 Martin Baulig <martin@ximian.com>
10790 * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
10792 * expression.cs (Invocation.InferTypeArguments): Added overloaded
10793 public version which takes a `ParameterData pd' instead of an
10796 2004-03-29 Martin Baulig <martin@ximian.com>
10798 * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
10801 2004-03-29 Martin Baulig <martin@ximian.com>
10803 * expression.cs (Argument.ResolveMethodGroup): If we're a
10804 ConstructedType, call GetMemberAccess() on it.
10806 2004-03-29 Martin Baulig <martin@ximian.com>
10808 * class.cs (MethodBase.CheckGenericOverride): New abstract method.
10809 (MethodCore.CheckGenericOverride): When overriding a generic
10810 method, check whether the constraints match.
10812 * support.cs (GenericConstraints): New public interface.
10813 (ParameterData.GenericConstraints): New public method.
10815 * parameter.cs (Parameter.Resolve): Check whether we're a generic
10816 method parameter and compute our constraints if appropriate.
10817 (Parameter.GenericConstraints): New public property.
10819 * generic.cs (Constraints): Implement GenericConstraints.
10821 2004-03-29 Martin Baulig <martin@ximian.com>
10823 * decl.cs (MemberCache.FindMemberToOverride): Use
10824 `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
10826 2004-03-29 Martin Baulig <martin@ximian.com>
10828 * generic.cs (GenericMethod.Define): Resolve our type parameters.
10830 2004-03-29 Martin Baulig <martin@ximian.com>
10832 * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
10833 not allowed on non-generic declarations").
10835 2004-03-29 Martin Baulig <martin@ximian.com>
10837 * expression.cs (Invocation.InferTypeArguments): Added overloaded
10838 public version of this method.
10840 * class.cs (MethodCore.IsDuplicateImplementation): Use
10841 Invocation.InferTypeArguments() to check this.
10843 2004-03-29 Martin Baulig <martin@ximian.com>
10845 * convert.cs: Use TypeManager.IsDelegateType() instead of
10846 comparing types correctly.
10848 2004-03-29 Martin Baulig <martin@ximian.com>
10850 * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
10851 types directly to make it work for generic instances.
10853 * typemanager.cs (TypeManager.IsSubclassOf): New static method.
10855 2004-03-29 Martin Baulig <martin@ximian.com>
10857 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
10858 support for arrays.
10860 2004-03-24 Martin Baulig <martin@ximian.com>
10862 * decl.cs (DeclSpace.FindType): Also use
10863 TypeManager.CheckGeneric() for types from the using clauses.
10865 2004-03-23 Martin Baulig <martin@ximian.com>
10867 * expression.cs (Invocation.OverloadResolve): Added `bool
10868 may_fail' argument and use it instead of the Location.IsNull() hack.
10870 2004-03-23 Martin Baulig <martin@ximian.com>
10872 * expression.cs (Invocation.InferType): Use correct type inference
10875 2004-03-23 Martin Baulig <martin@ximian.com>
10877 * ecore.cs (MethodGroupExpr.Name): Use
10878 TypeManager.CSharpSignature() instead of just the name.
10880 * expression.cs (Invocation.OverloadResolve): Provide better error
10882 (Invocation.DoResolve): OverloadResolve() never returns null
10883 without reporting an error, so removed the error -6 reporting here.
10885 2004-03-23 Martin Baulig <martin@ximian.com>
10887 * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
10890 * cs-parser.jay (delegate_declaration): Support generic delegates.
10892 * delegate.cs: Support generic delegates.
10894 2004-03-22 Martin Baulig <martin@ximian.com>
10896 * expression.cs (Invocation.InferParamsTypeArguments): New static
10897 method; does type inference for params arguments.
10899 2004-03-21 Martin Baulig <martin@ximian.com>
10901 * typemanager.cs (TypeManager.IsGenericMethod): New public static
10902 method; checks whether a method is a generic method.
10904 * expression.cs (Invocation.InferTypeArguments): New static method;
10905 infer type arguments for generic method invocation.
10907 * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
10908 property; we set this to true if we're resolving a generic method
10909 invocation and the user specified type arguments, ie. we're not
10910 doing type inference.
10912 2004-03-20 Martin Baulig <martin@ximian.com>
10914 * class.cs (MethodData.DeclaringType): New public property.
10915 (MethodData.Define): Set DeclaringType here.
10916 (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
10917 instead of OperatorMethodBuilder.DeclaringType.
10919 2004-03-20 Martin Baulig <martin@ximian.com>
10921 * cs-tokenizer.cs (xtoken): Return a special
10922 Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
10924 * cs-parser.jay (default_value_expression): Switch to the new
10927 2004-03-19 Martin Baulig <martin@ximian.com>
10929 * decl.cs (MemberName): New class. We use this to "construct"
10930 namespace_or_type_name's.
10932 * generics.cs (TypeArguments.GetDeclarations): New public method;
10933 returns the type arguments as a string[] and reports a CS0081 if
10934 one of them is not an identifier.
10936 * class.cs (MemberBase): The .ctor now takes the name as a
10937 MemberName instead of a string.
10938 (MemberBase.ExplicitInterfaceName): Changed type from string to
10940 (MemberBase.DoDefine): If we're an explicit implementation, the
10941 InterfaceType may be a generic instance.
10943 * cs-parser.jay (namespace_or_type_name): Return a MemberName.
10944 (namespace_name): Call MemberName.GetName () to transform the
10945 MemberName into a string and ensure we don't have any type
10947 (type_name): Call MemberName.GetTypeExpression() to transfrom the
10948 MemberName into an expression.
10949 (method_header): Use namespace_or_type_name instead of member_name.
10951 2004-04-07 Miguel de Icaza <miguel@ximian.com>
10953 * rootcontext.cs: Add new types to the boot resolution.
10955 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10956 MulticastDelegate is not allowed.
10958 * typemanager.cs: Add new types to lookup: System.TypedReference
10961 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10962 check for TypedReference or ArgIterator, they are not allowed.
10964 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10965 makes us properly catch 1510 in some conditions (see bug 56016 for
10968 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
10970 * CryptoConvert.cs: update from corlib version
10973 2004-04-05 Miguel de Icaza <miguel@ximian.com>
10975 * class.cs (Indexer.Define): Check indexername declaration
10977 2004-04-05 Marek Safar <marek.safar@seznam.cz>
10979 * attribute.cs (IsClsCompliant): Fixed problem with handling
10980 all three states (compliant, not-compliant, undetected).
10982 2004-03-30 Marek Safar <marek.safar@seznam.cz>
10984 * attribute.cs (Attribute): Location is now public.
10985 (Resolve): Store resolved arguments (pos_values) in attribute class.
10986 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10987 (GetClsCompliantAttributeValue): New method that gets
10988 CLSCompliantAttribute value.
10989 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10990 if exists else null.
10991 (AttributeTester): New class for CLS-Compliant verification routines.
10993 * class.cs (Emit): Add CLS-Compliant verification.
10994 (Method.GetSignatureForError): Implemented.
10995 (Constructor.GetSignatureForError): Implemented
10996 (Constructor.HasCompliantArgs): Returns if constructor has
10997 CLS-Compliant arguments.
10998 (Constructor.Emit): Override.
10999 (Construcor.IsIdentifierClsCompliant): New method; For constructors
11000 is needed to test only parameters.
11001 (FieldBase.GetSignatureForError): Implemented.
11002 (TypeContainer): New member for storing base interfaces.
11003 (TypeContainer.FindMembers): Search in base interfaces too.
11005 * codegen.cs (GetClsComplianceAttribute): New method that gets
11006 assembly or module CLSCompliantAttribute value.
11007 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
11009 (ModuleClass.Emit): Add error 3012 test.
11011 * const.cs (Emit): Override and call base for CLS-Compliant tests.
11013 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
11014 state for all decl types.
11015 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
11016 if CLS-Compliant tests are required.
11017 (IsClsCompliaceRequired): New method. Analyze whether code
11018 must be CLS-Compliant.
11019 (IsExposedFromAssembly): New method. Returns true when MemberCore
11020 is exposed from assembly.
11021 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
11022 value or gets cached value.
11023 (HasClsCompliantAttribute): New method. Returns true if MemberCore
11024 is explicitly marked with CLSCompliantAttribute.
11025 (IsIdentifierClsCompliant): New abstract method. This method is
11026 used to testing error 3005.
11027 (IsIdentifierAndParamClsCompliant): New method. Common helper method
11028 for identifier and parameters CLS-Compliant testing.
11029 (VerifyClsCompliance): New method. The main virtual method for
11030 CLS-Compliant verifications.
11031 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
11032 null. I don't know why is null (too many public members !).
11033 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
11034 and get value of first CLSCompliantAttribute that found.
11036 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
11037 (VerifyClsCompliance): Override and add extra tests.
11039 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
11040 clscheck- disable CLS-Compliant verification event if assembly is has
11041 CLSCompliantAttribute(true).
11043 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
11044 ApllyAttribute is now called in emit section as in the other cases.
11045 Possible future Emit integration.
11046 (IsIdentifierClsCompliant): New override.
11047 (VerifyClsCompliance): New override.
11048 (GetEnumeratorName): Returns full enum name.
11050 * parameter.cs (GetSignatureForError): Implemented.
11052 * report.cs (WarningData): New struct for Warning message information.
11053 (LocationOfPreviousError): New method.
11054 (Warning): New method. Reports warning based on the warning table.
11055 (Error_T): New method. Reports error based on the error table.
11057 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
11058 verifications are done here.
11060 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
11062 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
11063 CLSCompliantAttribute.
11064 (all_imported_types): New member holds all imported types from other
11066 (LoadAllImportedTypes): New method fills static table with exported types
11067 from all referenced assemblies.
11068 (Modules): New property returns all assembly modules.
11070 2004-03-30 Miguel de Icaza <miguel@ximian.com>
11072 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
11073 throwing a parser error.
11075 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
11076 which removes the hardcoded get_/set_ prefixes for properties, as
11077 IL allows for the properties to be named something else.
11081 * expression.cs: Do not override operand before we know if it is
11082 non-null. Fix 56207
11084 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
11086 * typemanager.cs: support for pinned variables.
11088 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
11090 * decl.cs, typemanager.cs: Avoid using an arraylist
11091 as a buffer if there is only one result set.
11093 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
11095 * expression.cs: Make sure you cant call a static method
11096 with an instance expression, bug #56174.
11098 2004-03-29 Miguel de Icaza <miguel@ximian.com>
11100 * class.cs (IsDuplicateImplementation): Improve error reporting to
11101 flag 663 (method only differs in parameter modifier).
11103 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
11104 in preprocessor directives.
11106 * location.cs (LookupFile): Allow for the empty path.
11108 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
11109 better approach for some of that patch, but its failing with the
11110 CharSet enumeration. For now try/catch will do.
11112 * typemanager.cs: Do not crash if a struct does not have fields.
11115 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
11117 * expression.cs: cs0213, cant fix a fixed expression.
11120 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
11122 * cs-parser.jay: detect invalid embeded statements gracefully.
11125 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
11127 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
11130 the invocation type may not be a subclass of the tye of the item/
11131 The type of the item must be a subclass of the invocation item.
11136 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
11138 * attribute.cs: Added methods to get a string and a bool from an
11139 attribute. Required to information from AssemblyKeyFileAttribute,
11140 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
11141 * codegen.cs: Modified AssemblyName creation to include support for
11142 strongnames. Catch additional exceptions to report them as CS1548.
11143 * compiler.csproj: Updated include CryptoConvert.cs.
11144 * compiler.csproj.user: Removed file - user specific configuration.
11145 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
11146 Mono.Security assembly. The original class is maintained and tested in
11147 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
11148 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
11149 like CSC 8.0 (C# v2) supports.
11150 * Makefile: Added CryptoConvert.cs to mcs sources.
11151 * rootcontext.cs: Added new options for strongnames.
11153 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
11155 * driver.cs: For --expect-error, report error code `2'
11156 if the program compiled with no errors, error code `1' if
11157 it compiled with an error other than the one expected.
11159 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
11161 * compiler.csproj: Updated for Visual Studio .NET 2003.
11162 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
11163 * compiler.sln: Updated for Visual Studio .NET 2003.
11165 2004-03-24 Ravi Pratap M <ravi@ximian.com>
11167 * expression.cs: Fix bug #47234. We basically need to apply the
11168 rule that we prefer the conversion of null to a reference type
11169 when faced with a conversion to 'object' (csc behaviour).
11171 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11173 * statement.cs: Shorter form for foreach, eliminates
11174 a local variable. r=Martin.
11176 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11178 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
11179 checks if we can use brtrue/brfalse to test for 0.
11180 * expression.cs: use the above in the test for using brtrue/brfalse.
11181 cleanup code a bit.
11183 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11185 * expression.cs: Rewrite string concat stuff. Benefits:
11187 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
11188 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
11189 rather than a concat chain.
11191 * typemanager.cs: Add lookups for more concat overloads.
11193 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11195 * expression.cs: Emit shorter il code for array init.
11212 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
11214 * statement.cs: Before, two switch blocks would be merged if the
11215 total size of the blocks (end_item - begin_item + 1) was less than
11216 two times the combined sizes of the blocks.
11218 Now, it will only merge if after the merge at least half of the
11223 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
11225 * class.cs : csc build fix for GetMethods(). See bug #52503.
11227 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
11229 * expression.cs: Make sure fp comparisons work with NaN.
11230 This fixes bug #54303. Mig approved this patch a long
11231 time ago, but we were not able to test b/c the runtime
11234 2004-03-19 Miguel de Icaza <miguel@ximian.com>
11236 * ecore.cs (TypExpr.GetHashCode): implement this overload.
11238 2004-03-19 Martin Baulig <martin@ximian.com>
11240 * class.cs (MemberCore.IsDuplicateImplementation): Check whether
11241 two overloads may unify for some type parameter substitutions and
11242 report a CS0408 if appropriate.
11244 2004-03-19 Martin Baulig <martin@ximian.com>
11246 * class.cs (MemberCore.IsDuplicateImplementation): Report the
11247 error here and not in our caller.
11249 2004-03-19 Martin Baulig <martin@ximian.com>
11251 * interface.cs: Completely killed this file.
11252 (Interface): We're now a TypeContainer and live in class.cs.
11254 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
11255 argument; we're now also called for interfaces.
11256 (TypeContainer.DefineMembers): Allow this method being called
11258 (TypeContainer.GetMethods): New public method; formerly known as
11259 Interface.GetMethod(). This is used by PendingImplementation.
11260 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
11261 it's now private and non-static.
11262 (Interface): Moved this here; it's now implemented similar to
11264 (Method, Property, Event, Indexer): Added `bool is_interface'
11265 argument to their .ctor's.
11266 (MemberBase.IsInterface): New public field.
11268 * cs-parser.jay: Create normal Method, Property, Event, Indexer
11269 instances instead of InterfaceMethod, InterfaceProperty, etc.
11270 (opt_interface_base): Removed; we now use `opt_class_base' instead.
11271 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
11273 2004-03-19 Martin Baulig <martin@ximian.com>
11275 * class.cs (MethodCore.IsDuplicateImplementation): New private
11276 method which does the CS0111 checking.
11277 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
11278 Use IsDuplicateImplementation().
11280 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
11282 * decl.cs (FindMemberToOverride): New method to find the correct
11283 method or property to override in the base class.
11285 - Make Method/Property use the above method to find the
11286 version in the base class.
11287 - Remove the InheritableMemberSignatureCompare as it is now
11290 This patch makes large code bases much faster to compile, as it is
11291 O(n) rather than O(n^2) to do this validation.
11293 Also, it fixes bug 52458 which is that nested classes are not
11294 taken into account when finding the base class member.
11296 Reviewed/Approved by Martin.
11298 2004-03-17 Martin Baulig <martin@ximian.com>
11300 * expression.cs (MemberAccess.DoResolve): Take the parent's number
11301 of type arguments into account; use the `real_num_type_args'
11302 approach like in DoResolveAsTypeStep().
11304 * generic.cs (GenericMemberAccess.DoResolve): Make this work for
11307 2004-03-17 Marek Safar <marek.safar@seznam.cz>
11309 * interface.cs: In all interface classes removed redundant
11310 member initialization.
11312 2004-03-16 Martin Baulig <martin@ximian.com>
11314 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11316 2004-03-15 Miguel de Icaza <miguel@ximian.com>
11318 * decl.cs (DefineTypeAndParents): New helper method to define a
11319 type's containers before the type itself is defined; This is a
11320 bug exposed by the recent changes to Windows.Forms when an
11321 implemented interface was defined inside a class that had not been
11324 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
11326 (Check): Loop correctly to report errors modifiers
11327 (UNSAFE was not in the loop, since it was the same as TOP).
11329 * interface.cs: Every interface member now takes a ModFlags,
11330 instead of a "is_new" bool, which we set on the base MemberCore.
11332 Every place where we called "UnsafeOk" in the interface, now we
11333 call the proper member (InterfaceMethod.UnsafeOK) instead to get
11334 the unsafe settings from the member declaration instead of the
11335 container interface.
11337 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
11339 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11340 `set_indexer_name' to the pending bits (one per type).
11342 We fixed a bug today that was picking the wrong method to
11343 override, since for properties the existing InterfaceMethod code
11344 basically ignored the method name. Now we make sure that the
11345 method name is one of the valid indexer names.
11347 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
11349 * support.cs (SeekableStreamReader): Keep track of stream byte
11350 positions and don't mix them with character offsets to the buffer.
11352 Patch from Gustavo Giráldez
11354 2004-03-15 Marek Safar <marek.safar@seznam.cz>
11356 * interface.cs (InterfaceSetGetBase): Removed double member
11357 initialization, base class does it as well.
11359 2004-03-13 Martin Baulig <martin@ximian.com>
11361 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
11362 when compiling corlib.
11364 2004-03-13 Miguel de Icaza <miguel@ximian.com>
11366 * convert.cs (ExplicitConversion): We were reporting an error on
11367 certain conversions (object_type source to a value type, when the
11368 expression was `null') before we had a chance to pass it through
11369 the user defined conversions.
11371 * driver.cs: Replace / and \ in resource specifications to dots.
11374 * class.cs: Add check for duplicate operators. Fixes 52477
11376 2004-03-11 Miguel de Icaza <miguel@ximian.com>
11378 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
11379 that are in the middle of the statements, not only at the end.
11382 * class.cs (TypeContainer.AddField): No longer set the
11383 `HaveStaticConstructor' flag, now we call it
11384 `UserDefineStaticConstructor' to diferentiate the slightly
11385 semantic difference.
11387 The situation is that we were not adding BeforeFieldInit (from
11388 Modifiers.TypeAttr) to classes that could have it.
11389 BeforeFieldInit should be set to classes that have no static
11394 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
11396 And most importantly Zoltan's comment:
11398 http://bugzilla.ximian.com/show_bug.cgi?id=44229
11400 "I think beforefieldinit means 'it's ok to initialize the type sometime
11401 before its static fields are used', i.e. initialization does not need
11402 to be triggered by the first access to the type. Setting this flag
11403 helps the JIT to compile better code, since it can run the static
11404 constructor at JIT time, and does not need to generate code to call it
11405 (possibly lots of times) at runtime. Unfortunately, mcs does not set
11406 this flag for lots of classes like String.
11408 csc sets this flag if the type does not have an explicit static
11409 constructor. The reasoning seems to be that if there are only static
11410 initalizers for a type, and no static constructor, then the programmer
11411 does not care when this initialization happens, so beforefieldinit
11414 This bug prevents the AOT compiler from being usable, since it
11415 generates so many calls to mono_runtime_class_init that the AOT code
11416 is much slower than the JITted code. The JITted code is faster,
11417 because it does not generate these calls if the vtable is type is
11418 already initialized, which is true in the majority of cases. But the
11419 AOT compiler can't do this."
11421 2004-03-10 Miguel de Icaza <miguel@ximian.com>
11423 * class.cs (MethodData.Emit): Refactor the code so symbolic
11424 information is generated for destructors; For some reasons we
11425 were taking a code path that did not generate symbolic information
11428 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
11430 * class.cs: Create a Constructor.CheckBase method that
11431 takes care of all validation type code. The method
11432 contains some code that was moved from Define.
11434 It also includes new code that checks for duplicate ctors.
11435 This fixes bug #55148.
11437 2004-03-09 Joshua Tauberer <tauberer@for.net>
11439 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
11440 a { ... }-style array creation invokes EmitStaticInitializers
11441 which is not good for reference-type arrays. String, decimal
11442 and now null constants (NullCast) are not counted toward
11443 static initializers.
11445 2004-03-05 Martin Baulig <martin@ximian.com>
11447 * location.cs (SourceFile.HasLineDirective): New public field;
11448 specifies whether the file contains or is referenced by a "#line"
11450 (Location.DefineSymbolDocuments): Ignore source files which
11451 either contain or are referenced by a "#line" directive.
11453 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
11455 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
11456 direct access to our parent, so check the method inline there.
11458 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
11460 * expression.cs (Invocation.EmitCall): Miguel's last commit
11461 caused a regression. If you had:
11466 In Foo the implict this would be null.
11468 2004-02-27 Miguel de Icaza <miguel@ximian.com>
11470 * expression.cs (Invocation.EmitCall): If the method is not
11471 virtual, do not emit a CallVirt to it, use Call.
11473 * typemanager.cs (GetFullNameSignature): Improve the method to
11474 cope with ".ctor" and replace it with the type name.
11476 * class.cs (ConstructorInitializer.Resolve): Now the method takes
11477 as an argument the ConstructorBuilder where it is being defined,
11478 to catch the recursive constructor invocations.
11480 2004-03-16 Martin Baulig <martin@ximian.com>
11482 * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
11483 ConstructedType, call ResolveType() on it to get the type rather
11484 than just using `expr.Type'.
11486 2004-03-16 Martin Baulig <martin@ximian.com>
11488 * generics.cs (ConstructedType.GetMemberAccess): Take the
11489 EmitContext instead on the TypeExpr and use
11490 ec.TypeContainer.CurrentType/ec.ContainerType.
11492 2004-03-16 Martin Baulig <martin@ximian.com>
11494 * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
11495 parameters before aliases.
11497 2004-03-16 Martin Baulig <martin@ximian.com>
11499 * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
11500 New oublic function; checks whether two generic instances may become
11501 equal under some instantiations (26.3.1).
11503 * class.cs (TypeContainer.Define): Call
11504 TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
11507 2004-03-16 Martin Baulig <martin@ximian.com>
11509 * class.cs (TypeContainer.GetClassBases): Moved
11510 Error_TypeParameterAsBase() here and also check whether the base
11511 class is not an attribute.
11513 2004-03-16 Martin Baulig <martin@ximian.com>
11515 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11517 2004-03-16 Martin Baulig <martin@ximian.com>
11519 * class.cs (Error_TypeParameterAsBase): Use correct error number
11522 2004-03-16 Martin Baulig <martin@ximian.com>
11524 * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
11527 * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
11530 2004-03-15 Martin Baulig <martin@ximian.com>
11532 * typemanager.cs (TypeManager.GetFullName): New public method.
11533 (TypeManager.MemberLookup): Added `int_num_type_arguments'
11534 argument; only return members with the correct number of type
11536 (TypeManager.CheckGeneric): Allow -1 to bypass the check.
11537 (TypeManager.FilterWithClosure): Call CheckGeneric() to check
11538 whether the number of type arguments matches.
11540 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
11541 not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
11543 * expression.cs (MemberAccess): Added public `NumTypeArguments'
11544 field; it's set by the protected .ctor when we're actually a
11545 GenericMemberAccess.
11546 (MemberAccess.ResolveAsTypeStep): Compute the total number of type
11547 arguments and pass it to MemberLookupFinal ().
11549 * ecore.cs (Expression.MemberLookup): Added `int
11550 num_type_arguments' argument; only return members with the correct
11551 number of type arguments.
11552 (Expression.MemberLookupFailed): Check whether the MemberLookup
11553 failed because we did not have the correct number of type
11554 arguments; report CS0305 in this case.
11556 * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
11557 `e.ResolveAsTypeTerminal()' already did so.
11559 2004-03-15 Martin Baulig <martin@ximian.com>
11561 * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
11562 we're a ConstructedType; in this case, the caller must report an
11563 error (for instance CS0131).
11565 * generic.cs (TypeArguments): Added Location argument to the .ctor.
11566 (TypeArguments.Resolve): Actually report errors here.
11568 2004-03-15 Miguel de Icaza <miguel@ximian.com>
11570 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11571 `set_indexer_name' to the pending bits (one per type).
11573 We fixed a bug today that was picking the wrong method to
11574 override, since for properties the existing InterfaceMethod code
11575 basically ignored the method name. Now we make sure that the
11576 method name is one of the valid indexer names.
11578 2004-03-15 Martin Baulig <martin@ximian.com>
11580 * typemanager.cs (TypeManager.IndexerPropertyName): Added support
11581 for generic instances.
11583 2004-03-13 Martin Baulig <martin@ximian.com>
11585 * class.cs (TypeContainer.DefineType): Call
11586 TypeManager.AddUserType() immediately after creating the
11587 TypeBuilder; pass all type parameters when creating the
11590 * decl.cs (DeclSpace.FindNestedType): New public method.
11591 (DeclSpace.FindType): Added `int num_type_args' argument; only
11592 return types with the correct number of type parameters.
11593 (DeclSpace.CountTypeParams): New public property.
11595 * ecore.cs (SimpleName.ctor): Added overloaded version which takes
11596 the number of type parameters; defaults to zero.
11598 * generic.cs (TypeArguments.Count): New public property.
11599 (ConstructedType.DoResolveAsTypeStep): First call
11600 ds.FindNestedType() to find out whether we're nested in the
11601 current generic type; in this case, we inherit all type parameters
11602 from the current class.
11604 * rootcontext.cs (RootContext.NamespaceLookup): Added `int
11605 num_type_args' argument.
11606 (RootContext.LookupType): Added overloaded version which takes the
11607 number of type arguments; only return types with the correct
11608 number of type arguments.
11610 * typemanager.cs (TypeManager.CheckGeneric): New public function;
11611 checks whether `Type t' has `int num_type_args'.
11613 2004-03-13 Martin Baulig <martin@ximian.com>
11615 * generic.cs (GenericMethod.DefineType): New method; calls
11616 DefineType() on all the type parameters.
11618 * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
11619 (MethodData.Define): If we're a generic method, call
11620 GenericMethod.DefineType() to define the type parameters.
11622 2004-03-10 Martin Baulig <martin@ximian.com>
11624 * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
11625 instead of IsAssignableFrom.
11627 2004-03-10 Martin Baulig <martin@ximian.com>
11629 * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
11631 * support.cs (ParameterData.HasArrayParameter): New property.
11632 (ReflectionParameters.ctor): Take a MethodBase instead of a
11633 ParameterInfo[]. If we have any type parameters, get the generic
11634 method definition and ask it whether we have variable arguments.
11636 2004-02-26 Miguel de Icaza <miguel@ximian.com>
11638 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11639 routines to check if a type is an enumerable/enumerator allow
11640 classes that implement the IEnumerable or IEnumerator interfaces.
11642 * class.cs (Property, Operator): Implement IIteratorContainer, and
11643 implement SetYields.
11645 (Property.Define): Do the block swapping for get_methods in the
11646 context of iterators. We need to check if Properties also
11647 include indexers or not.
11649 (Operator): Assign the Block before invoking the
11650 OperatorMethod.Define, so we can trigger the Iterator code
11653 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
11654 Property and Operator classes are not created when we parse the
11655 declarator but until we have the block completed, so we use a
11656 singleton SimpleIteratorContainer.Simple to flag whether the
11657 SetYields has been invoked.
11659 We propagate this setting then to the Property or the Operator to
11660 allow the `yield' to function.
11662 2004-02-25 Marek Safar <marek.safar@seznam.cz>
11664 * codegen.cs: Implemented attribute support for modules.
11665 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11666 Assembly/Module functionality.
11668 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11669 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11670 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11672 2004-02-16 Marek Safar <marek.safar@seznam.cz>
11674 * interface.cs (FindMembers): The operation is performed on all base
11675 interfaces and not only on the first. It is required for future CLS Compliance patch.
11677 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
11679 * statement.cs, codegen.cs:
11680 This patch deals with patterns such as:
11682 public class List : IEnumerable {
11684 public MyEnumerator GetEnumerator () {
11685 return new MyEnumerator(this);
11688 IEnumerator IEnumerable.GetEnumerator () {
11692 public struct MyEnumerator : IEnumerator {
11697 Before, there were a few things we did wrong:
11698 1) we would emit callvirt on a struct, which is illegal
11699 2) we emited ldarg when we needed to emit ldarga
11700 3) we would mistakenly call the interface methods on an enumerator
11701 type that derived from IEnumerator and was in another assembly. For example:
11703 public class MyEnumerator : IEnumerator
11705 Would have the interface methods called, even if there were public impls of the
11706 method. In a struct, this lead to invalid IL code.
11708 2004-02-11 Marek Safar <marek.safar@seznam.cz>
11710 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11713 * delegate.cs (Define): Fixed crash when delegate type is undefined.
11715 2004-02-11 Miguel de Icaza <miguel@ximian.com>
11717 * cs-parser.jay: Fix small regression: we were not testing V2
11718 compiler features correctly.
11720 * interface.cs: If the emit context is null, then create one
11722 2004-02-09 Marek Safar <marek.safar@seznam.cz>
11724 * decl.cs (GetSignatureForError): New virtual method to get full name
11725 for error messages.
11727 * attribute.cs (IAttributeSupport): New interface for attribute setting.
11728 Now it is possible to rewrite ApplyAttributes method to be less if/else.
11730 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11731 Duplicated members and code in these classes has been removed.
11732 Better encapsulation in these classes.
11734 2004-02-07 Miguel de Icaza <miguel@ximian.com>
11736 * assign.cs (Assign.DoResolve): When dealing with compound
11737 assignments, there is a new rule in ECMA C# 2.4 (might have been
11738 there before, but it is documented here) that states that in:
11742 If b is of type int, and the `op' is a shift-operator, then the
11743 above is evaluated as:
11747 * expression.cs (Binary.ResolveOperator): Instead of testing for
11748 int/uint/long/ulong, try to implicitly convert to any of those
11749 types and use that in pointer arithmetic.
11751 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11752 method to print information for from the type, not from the
11753 null-method we were given.
11755 2004-02-01 Duncan Mak <duncan@ximian.com>
11757 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11758 parsing for cmd, fixes bug #53694.
11760 2004-02-04 Marek Safar <marek.safar@seznam.cz>
11762 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11763 in the member name duplication tests. Property and operator name duplication
11764 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11766 2004-02-03 Marek Safar <marek.safar@seznam.cz>
11768 * interface.cs (PopulateMethod): Fixed crash when interface method
11769 returns not existing type (error test cs0246-3.cs).
11771 2004-02-02 Ravi Pratap M <ravi@ximian.com>
11773 * cs-parser.jay (interface_accessors): Re-write actions to also
11774 store attributes attached to get and set methods. Fix spelling
11777 (inteface_property_declaration): Modify accordingly.
11779 (InterfaceAccessorInfo): New helper class to store information to pass
11780 around between rules that use interface_accessors.
11782 * interface.cs (Emit): Apply attributes on the get and set
11783 accessors of properties and indexers too.
11785 * attribute.cs (ApplyAttributes): Modify accordingly to use the
11786 right MethodBuilder when applying attributes to the get and set accessors.
11788 2004-01-31 Miguel de Icaza <miguel@ximian.com>
11790 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11792 2004-01-26 Miguel de Icaza <miguel@ximian.com>
11794 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11796 2004-01-25 Miguel de Icaza <miguel@ximian.com>
11798 * cs-parser.jay: Remove YIELD token, instead use the new grammar
11799 changes that treat `yield' specially when present before `break'
11800 or `return' tokens.
11802 * cs-tokenizer.cs: yield is no longer a keyword.
11804 2004-01-23 Marek Safar <marek.safar@seznam.cz>
11806 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11807 setting for default constructors.
11808 For default constructors are almost every time set wrong Modifier. The
11809 generated IL code has been alright. But inside mcs this values was
11810 wrong and this was reason why several of my CLS Compliance tests
11813 2004-02-27 Martin Baulig <martin@ximian.com>
11815 * generics.cs (ConstructedType.ResolveType): Make the nested type
11816 stuff actually work.
11818 2004-02-25 Martin Baulig <martin@ximian.com>
11820 * decl.cs (DeclSpace.CurrentTypeParameters): New protected
11821 property; returns the type parameters just from the current type,
11822 ie. with the ones from outer classes.
11823 (DeclSpace.LookupGeneric): First search in the current class, then
11825 (DeclSpace.initialize_type_params): When hiding a type parameter
11826 from an outer class, put it into the `type_param_list' anyways.
11828 * expression.cs (MemberAccess.expr): Made this field protected.
11830 * class.cs (TypeContainer.Define): The `CurrentType' just contains
11831 the type parameters from the current class.
11833 * generic.cs (ConstructedType.ResolveType): Support nested generic
11834 types by taking the type parameters which we inherit from outer
11835 classes into account.
11836 (GenericMemberAccess.ResolveAsTypeStep): Override this and added
11837 support for nested generic types.
11839 2004-02-23 Martin Baulig <martin@ximian.com>
11841 * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
11842 field and check whether we're nested inside a generic type.
11843 (DeclSpace.ResolveType): If we're resolving to a generic type
11844 definition, create a ConstructedType and return its resolved type.
11845 (DeclSpace.initialize_type_params): New private method;
11846 initializes the `type_param_list' field from the type parameters
11847 from this and all enclosing classes.
11848 (DeclSpace.TypeParameters): Call initialize_type_params() unless
11849 we're already initialized.
11851 2004-02-23 Martin Baulig <martin@ximian.com>
11853 * class.cs (Method.Define): Create the generic method before
11854 calling DoDefine().
11855 (Memberbase.DoDefine): Added DeclSpace argument (in addition to
11856 the TypeContainer one); we use this for generic methods.
11858 * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
11859 parent's TypeBuilder.
11861 2004-02-18 Martin Baulig <martin@ximian.com>
11863 * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
11864 to check for equality.
11866 2004-02-05 Martin Baulig <martin@ximian.com>
11868 * ecore.cs (FieldExpr.DoResolveLValue): If we have an
11869 `ec.TypeContainer.CurrentType', use it instead of
11870 `ec.ContainerType' to check whether we're in the type's ctor.
11872 2004-01-29 Martin Baulig <martin@ximian.com>
11874 * expression.cs (Invocation.DoResolve): If we're a
11875 `ConstructedType', then we're actually a generic method, so
11876 rewrite the expr as a GenericMemberAccess.
11878 * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
11879 here; manually parse it into a string.
11881 2004-01-28 Martin Baulig <martin@ximian.com>
11883 * typemanager.cs (TypeManager.IsEqual): New static method.
11884 (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
11885 check for equality instead of using `=='.
11887 2004-01-26 Martin Baulig <martin@ximian.com>
11889 * decl.cs (DeclSpace.CurrentType): New public field.
11891 * expression.cs (This.ResolveBase): If we have an
11892 `ec.TypeContainer.CurrentType', use it instead of
11893 `ec.ContainerType'.
11895 * class.cs (TypeContainer.DefineType): If we're a generic type,
11896 create the `CurrentType' (unresolved).
11897 (TypeContainer.GenericType): New private field.
11898 (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
11899 it and store it in `GenericType' before creating the MemberCache.
11900 (TypeContainer.GetMembers): If we have a `GenericType', call
11901 TypeManager.FindMembers() on it.
11903 * interface.cs (Interface.GenericType): New private field.
11904 (Interface.DefineType): If we're a generic type, create the
11905 `CurrentType' (unresolved).
11906 (Interface.DefineMembers): If we have a `CurrentType', resolve it
11907 and store it in `GenericType' before creating the MemberCache.
11908 (Interface.GetMembers): If we have a `GenericType', call
11909 TypeManager.FindMembers() on it.
11911 2004-01-22 Martin Baulig <martin@ximian.com>
11913 * cs-parser.jay (namespace_or_type_name): Return an Expression,
11914 not a QualifiedIdentifier. This is what `type_name_expression'
11915 was previously doing.
11916 (type_name_expression): Removed; the code is now in
11917 `namespace_or_type_name'.
11918 (qualified_identifier): Removed, use `namespace_or_type_name'
11920 (QualifiedIdentifier): Removed this class.
11922 2004-01-22 Martin Baulig <martin@ximian.com>
11924 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11925 not a string as alias name.
11927 2004-01-21 Miguel de Icaza <miguel@ximian.com>
11929 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11930 #52730 bug, and instead compute correctly the need to use a
11931 temporary variable when requesting an address based on the
11932 static/instace modified of the field and the constructor.
11934 2004-01-21 Martin Baulig <martin@ximian.com>
11936 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11937 class and namespace before looking up aliases. Fixes #52517.
11939 2004-01-21 Martin Baulig <martin@ximian.com>
11941 * flowanalysis.cs (UsageVector.Merge): Allow variables being
11942 assinged in a 'try'; fixes exception4.cs.
11944 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11945 * class.cs : Implemented parameter-less constructor for TypeContainer
11947 * decl.cs: Attributes are now stored here. New property OptAttributes
11949 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11951 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11953 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11955 * typemanager.cs (CSharpSignature): Now reports also inner class name.
11956 (CSharpSignature): New method for indexer and property signature.
11958 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11960 * pending.cs (IsVirtualFilter): Faster implementation.
11962 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11964 * typemanager.cs: Avoid inclusion of same assembly more than once.
11966 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11968 * cs-parser.jay: Fixed problem where the last assembly attribute
11969 has been applied also to following declaration (class, struct, etc.)
11971 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11973 * class.cs: Added error CS0538, CS0539 reporting.
11974 Fixed crash on Microsoft runtime when field type is void.
11976 * cs-parser.jay: Added error CS0537 reporting.
11978 * pending.cs: Added error CS0535 reporting.
11979 Improved error report for errors CS0536, CS0534.
11981 2004-01-20 Miguel de Icaza <miguel@ximian.com>
11983 Merge a few bits from the Anonymous Method MCS tree.
11985 * statement.cs (ToplevelBlock): New class for toplevel methods,
11986 will hold anonymous methods, lifted variables.
11988 * cs-parser.jay: Create toplevel blocks for delegates and for
11989 regular blocks of code.
11991 2004-01-20 Martin Baulig <martin@ximian.com>
11993 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11994 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11995 and `NeedExplicitReturn'; added `IsLastStatement'.
11996 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11997 have a `ReturnLabel' or we're not unreachable.
11999 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
12000 child's reachability; don't just override ours with it. Fixes
12001 #58058 (lluis's example).
12002 (FlowBranching): Added public InTryOrCatch(), InCatch(),
12003 InFinally(), InLoop(), InSwitch() and
12004 BreakCrossesTryCatchBoundary() methods.
12006 * statement.cs (Return): Do all error checking in Resolve().
12007 Unless we are the last statement in a top-level block, always
12008 create a return label and jump to it.
12009 (Break, Continue): Do all error checking in Resolve(); also make
12010 sure we aren't leaving a `finally'.
12011 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
12012 statement in a top-level block.
12013 (Block.Flags): Added `IsDestructor'.
12014 (Block.IsDestructor): New public property.
12016 2004-01-20 Martin Baulig <martin@ximian.com>
12018 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
12020 2004-01-20 Martin Baulig <martin@ximian.com>
12022 * statement.cs (Statement.ResolveUnreachable): New public method.
12023 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
12024 (Block.Resolve): Resolve unreachable statements.
12026 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
12028 * expression.cs: We need to fix the case where we do
12029 not have a temp variable here.
12031 * assign.cs: Only expression compound assignments need
12032 temporary variables.
12034 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
12036 * flowanalysis.cs: Reduce memory allocation in a few ways:
12037 - A block with no variables should not allocate a bit
12039 - A method with no out parameters does not need any tracking
12040 for assignment of the parameters, so we need not allocate
12043 public readonly Type[] VariableTypes;
12044 public readonly string[] VariableNames;
12045 Are redundant. The data is already stored in the variable
12046 map, so we need not allocate another array for it.
12047 - We need to add alot of checks for if (params | locals) == null
12048 due to the first two changes.
12050 2004-01-18 Miguel de Icaza <miguel@ximian.com>
12052 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
12053 implement IMemoryLocation, we store a copy on a local variable and
12054 take the address of it. Patch from Benjamin Jemlich
12056 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
12057 to use a special "type_name_expression" rule which reduces the
12058 number of "QualifiedIdentifier" classes created, and instead
12059 directly creates MemberAccess expressions.
12061 2004-01-17 Miguel de Icaza <miguel@ximian.com>
12063 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
12064 that fixes #52853. Null literal assignment to ValueType
12066 * class.cs (MethodData.Emit): Instead of checking the name of the
12067 method to determine if its a destructor, create a new derived
12068 class from Method called Destructor, and test for that.
12070 * cs-parser.jay: Create a Destructor object instead of a Method.
12072 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
12076 2004-01-16 Miguel de Icaza <miguel@ximian.com>
12078 * expression.cs (Binary.ResolveOperator): Perform an implicit
12079 conversion from MethodGroups to their delegate types on the
12080 Addition operation.
12082 * delegate.cs: Introduce a new class DelegateCreation that is the
12083 base class for `NewDelegate' and `ImplicitDelegateCreation',
12084 factor some code in here.
12086 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
12087 conversion from MethodGroups to compatible delegate types.
12089 * ecore.cs (Expression.Resolve): Do not flag error 654
12090 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
12091 we allow conversions from MethodGroups to delegate types now.
12093 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
12094 assignments in v2 either.
12096 2004-01-10 Miguel de Icaza <miguel@ximian.com>
12098 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
12099 static read-only fields in ctors.
12101 Applied patch from Benjamin Jemlich
12103 * expression.cs (UnaryMutator): Avoid leaking local variables.
12105 2004-01-09 Miguel de Icaza <miguel@ximian.com>
12107 * cs-tokenizer.cs (IsCastToken): Allow the various native types
12108 here to return true, as they can be used like this:
12110 (XXX) int.MEMBER ()
12112 Fixed 49836 and all the other dups
12114 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
12116 * driver.cs: Implement /win32res and /win32icon.
12118 2004-01-08 Miguel de Icaza <miguel@ximian.com>
12120 * cs-parser.jay: Add a rule to improve error handling for the
12121 common mistake of placing modifiers after the type.
12123 2004-01-07 Miguel de Icaza <miguel@ximian.com>
12125 * cs-parser.jay (interface_event_declaration): Catch
12126 initialization of events on interfaces, and report cs0068
12128 * cs-parser.jay (interface_event_declaration): Catch
12129 initialization of events.
12131 * ecore.cs: Better report missing constructors.
12133 * expression.cs (Binary.ResolveOperator): My previous bug fix had
12134 the error reporting done in the wrong place. Fix.
12136 * expression.cs (Binary.ResolveOperator): Catch the
12137 operator + (E x, E y) error earlier, and later allow for implicit
12138 conversions in operator +/- (E e, U x) from U to the underlying
12141 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
12142 52596, if the container class is abstract, the default constructor
12143 is protected otherwise its public (before, we were always public).
12145 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
12148 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
12149 Jemlich that fixes bug #52597, MCS was generating invalid code for
12150 idisposable structs. Thanks to Ben for following up with this
12153 2004-01-06 Miguel de Icaza <miguel@ximian.com>
12155 * driver.cs: Allow assemblies without code to be generated, fixes
12158 2004-01-07 Nick Drochak <ndrochak@gol.com>
12160 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
12162 2004-01-05 Miguel de Icaza <miguel@ximian.com>
12164 * cs-parser.jay: Add rules to improve error reporting if fields or
12165 methods are declared at the namespace level (error 116)
12167 * Add rules to catch event add/remove
12169 2004-01-04 David Sheldon <dave-mono@earth.li>
12171 * expression.cs: Added matching ")" to error message for
12174 2004-01-03 Todd Berman <tberman@gentoo.org>
12176 * ecore.cs, attribute.cs:
12177 Applying fix from #52429.
12179 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12181 * ecore.cs, expression.cs, statement.cs:
12182 Total rewrite of how we handle branching. We
12183 now handle complex boolean expressions with fewer
12184 jumps. As well if (x == 0) no longer emits a ceq.
12186 if (x is Foo) is much faster now, because we generate
12189 Overall, we get a pretty big improvement on our benchmark
12190 tests. The code we generate is smaller and more readable.
12192 I did a full two-stage bootstrap. The patch was reviewed
12193 by Martin and Miguel.
12195 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12197 * cs-parser.jay: Make primary_expression not take a QI.
12198 we dont need this because the member_access rule covers
12199 us here. So we replace the rule with just IDENTIFIER.
12201 This has two good effects. First, we remove a s/r conflict.
12202 Second, we allocate many fewer QualifiedIdentifier objects.
12204 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12206 * attribute.cs: Handle MarshalAs attributes as pseudo, and
12207 set the correct information via SRE. This prevents
12208 hanging on the MS runtime. Fixes #29374.
12210 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12212 * convert.cs: correctly handle conversions to value types
12213 from Enum and ValueType as unboxing conversions.
12215 Fixes bug #52569. Patch by Benjamin Jemlich.
12217 2004-01-02 Ravi Pratap <ravi@ximian.com>
12219 * expression.cs (BetterConversion): Prefer int -> uint
12220 over int -> ulong (csc's behaviour). This fixed bug #52046.
12222 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
12224 * decl.cs (MemberCache.FindMembers): now returns a
12227 * typemanager.cs: In general, go with with ^^.
12228 (CopyNewMethods): take an IList.
12229 (RealMemberLookup): Only allocate an arraylist
12230 if we copy from two sets of methods.
12232 This change basically does two things:
12233 1) Fewer array lists allocated due to CopyNewMethods.
12234 2) the explicit cast in MemberList costed ALOT.
12236 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
12238 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
12239 a hashtable to avoid needless string allocations when an identifier is
12240 used more than once (the common case).
12242 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
12244 * pending.cs: MS's TypeBuilder.GetInterfaces ()
12245 is broken, it will not return anything. So, we
12246 have to use the information we have in mcs to
12249 * typemanager.cs: Add a cache for GetInterfaces,
12250 since this will now be used more often (due to ^^)
12252 (GetExplicitInterfaces) New method that gets the
12253 declared, not effective, interfaces on a type
12254 builder (eg, if you have interface IFoo, interface
12255 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
12258 This patch makes MCS able to bootstrap itself on
12261 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
12263 * expression.cs: Remove the Nop's that Miguel put
12266 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12268 * report.cs, codegen.cs: Give the real stack trace to
12269 the error when an exception is thrown.
12271 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12273 * decl.cs: only allocate hashtables for ifaces if
12276 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12278 * expression.cs: fix the error from cs0121-2.cs
12279 (a parent interface has two child interfaces that
12280 have a function with the same name and 0 params
12281 and the function is called through the parent).
12283 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
12285 * class.cs, rootcontext.cs, typmanager.cs: do not
12288 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
12290 * codegen.cs: remove stack for the ec flow branching.
12291 It is already a linked list, so no need.
12293 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
12295 * Makefile: Allow custom profiler here.
12297 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
12299 * typemanager.cs (LookupType):
12300 - Use a static char [], because split takes
12301 a param array for args, so it was allocating
12303 - Do not store true in a hashtable, it boxes.
12305 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
12307 * flowanalysis.cs: bytify common enums.
12309 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12311 * modifiers.cs: Add a new set of flags for the
12312 flags allowed on explicit interface impls.
12313 * cs-parser.jay: catch the use of modifiers in
12314 interfaces correctly.
12315 * class.cs: catch private void IFoo.Blah ().
12317 All related to bug #50572.
12319 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12321 * decl.cs: Rewrite the consistant accessability checking.
12322 Accessability is not linear, it must be implemented in
12323 a tableish way. Fixes #49704.
12325 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12327 * expression.cs: Handle negation in a checked context.
12328 We must use subtraction from zero. Fixes #38674.
12330 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
12332 * class.cs: Ignore static void main in DLLs.
12333 * rootcontext.cs: Handle the target type here,
12334 since we are have to access it from class.cs
12335 * driver.cs: account for the above.
12337 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
12339 * report.cs: Give line numbers and files if available.
12341 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
12343 * driver.cs: Implement /addmodule.
12345 * typemanager.cs: Change 'modules' field so it now contains Modules not
12348 2003-12-20 Martin Baulig <martin@ximian.com>
12350 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
12351 (FieldBase.IsAssigned): Removed this field.
12352 (FieldBase.SetAssigned): New public method.
12353 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
12355 2003-12-20 Martin Baulig <martin@ximian.com>
12357 * expression.cs (LocalVariableReference.DoResolve): Don't set
12358 `vi.Used' if we're called from DoResolveLValue().
12360 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
12361 returns the usage vector it just merged into the current one -
12362 pass this one to UsageWarning().
12363 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
12364 of the `EmitContext', don't call this recursively on our children.
12366 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
12368 * driver.cs: Implement /target:module.
12370 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
12372 * support.cs (CharArrayHashtable): New helper class.
12374 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
12375 char arrays, not strings, so we can avoid creating a string in
12376 consume_identifier if the identifier is a keyword.
12378 2003-12-16 Martin Baulig <martin@ximian.com>
12380 * statement.cs (LocalInfo.Assigned): Removed this property.
12381 (LocalInfo.Flags): Removed `Assigned'.
12382 (LocalInfo.IsAssigned): New public method; takes the EmitContext
12383 and uses flow analysis.
12384 (Block.UsageWarning): Made this method private.
12385 (Block.Resolve): Call UsageWarning() if appropriate.
12387 * expression.cs (LocalVariableReference.DoResolve): Always set
12388 LocalInfo.Used here.
12390 2003-12-13 Martin Baulig <martin@ximian.com>
12392 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
12393 any value here; we're now using flow analysis to figure out
12394 whether a statement/block returns a value.
12396 2003-12-13 Martin Baulig <martin@ximian.com>
12398 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
12400 (FlowBranching.MergeFinally): Don't call
12401 `branching.CheckOutParameters()' here, this is called in
12403 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
12404 when adding the `finally' vector.
12406 2003-12-13 Martin Baulig <martin@ximian.com>
12409 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
12410 actually work and also fix #48962.
12412 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
12414 * decl.cs: Do not check System.Object for nested types,
12415 since we know it does not have any. Big bang for buck:
12418 Run 1: 8.35 seconds
12419 Run 2: 8.32 seconds
12420 corlib: 17.99 seconds
12422 Run 1: 8.17 seconds
12423 Run 2: 8.17 seconds
12424 corlib: 17.39 seconds
12426 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
12428 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
12429 time we are returning 0 members, so we save alot here.
12431 2003-12-11 Martin Baulig <martin@ximian.com>
12433 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
12434 `MergeChild()', also just take the `FlowBranching' as argument;
12435 call Merge() on it and return the result.
12436 (FlowBranching.Merge): We don't need to do anything if we just
12439 2003-12-11 Martin Baulig <martin@ximian.com>
12441 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
12442 them in an `ArrayList' to reduce memory usage. Thanks to Ben
12443 Maurer for this idea.
12445 2003-12-11 Martin Baulig <martin@ximian.com>
12447 * flowanalysis.cs (MergeResult): This class is now gone; we now
12448 use the `UsageVector' for this. The reason for this is that if a
12449 branching just has one sibling, we don't need to "merge" them at
12450 all - that's the next step to do.
12451 (FlowBranching.Merge): We now return a `UsageVector' instead of a
12454 2003-12-11 Martin Baulig <martin@ximian.com>
12456 Reworked flow analyis and made it more precise and bug-free. The
12457 most important change is that we're now using a special `Reachability'
12458 class instead of having "magic" meanings of `FlowReturns'. I'll
12459 do some more cleanups and optimizations and also add some more
12460 documentation this week.
12462 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
12463 largely reworked this class.
12464 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
12465 the new `Reachability' class instead of having "magic" values here.
12466 (FlowBranching): We're now using an instance of `Reachability'
12467 instead of having separate `Returns', `Breaks' etc. fields.
12469 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
12470 based on flow analysis; ignore the return value of block.Emit ().
12472 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
12474 * driver.cs typemanager.cs: Find the mono extensions to corlib even
12475 if they are private.
12477 2003-12-09 Martin Baulig <martin@ximian.com>
12479 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
12480 call them directly on the UsageVector.
12482 2003-12-09 Martin Baulig <martin@ximian.com>
12484 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
12485 Changed return type from `FlowReturns' to `Reachability'.
12487 2003-12-09 Martin Baulig <martin@ximian.com>
12489 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
12490 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
12491 `Reachable' fields with a single `Reachability' one.
12493 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12495 * class.cs (FindMembers): Remove foreach's.
12500 Run 1: 8.74 seconds
12501 Run 2: 8.71 seconds
12504 Run 1: 8.64 seconds
12505 Run 2: 8.58 seconds
12508 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12513 This patch does a few things:
12514 1. EmptyStatement is now a singleton, so it is never reallocated.
12515 2. All blah is EmptyStatement constructs have been changed to
12516 blah == EmptyStatement.Value, which is much faster and valid
12517 now that EmptyStatement is a singleton.
12518 3. When resolving a block, rather than allocating a new array for
12519 the non-empty statements, empty statements are replaced with
12520 EmptyStatement.Value
12521 4. Some recursive functions have been made non-recursive.
12522 Mainly the performance impact is from (3), however (1) and (2) are needed for
12523 this to work. (4) does not make a big difference in normal situations, however
12524 it makes the profile look saner.
12529 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12530 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12531 Total memory allocated: 56397 KB
12534 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
12535 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
12536 Total memory allocated: 55666 KB
12538 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12540 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
12541 than the hashtable in a hashtable version
12543 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
12544 we always end up concating a string. This results in a huge perf
12545 loss, because many strings have to be tracked by the GC. In this
12546 patch, we first use a hashtable that works with two keys, so that
12547 the strings do not need to be concat'ed.
12551 Run 1: 8.74 seconds
12552 Run 2: 8.71 seconds
12555 Run 1: 8.65 seconds
12556 Run 2: 8.56 seconds
12558 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12560 * Makefile: Add a new target `do-time' that does a quick and simple
12561 profile, leaving easy to parse output.
12563 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
12565 * codegen.cs (Init): Create the dynamic assembly with
12566 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
12568 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
12570 * support.cs: Make the PtrHashtable use only one
12571 instance of its comparer.
12573 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
12575 * typemanager.cs: Fix lookup of GetNamespaces.
12577 2003-11-29 Miguel de Icaza <miguel@ximian.com>
12579 * expression.cs: Removed redundant line.
12581 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
12582 ArrayLists, use for loops with bounds.
12584 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
12587 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
12588 arraylists, use for loop with bounds.
12590 The above three changes give us a 0.071 second performance
12591 improvement out of 3.294 seconds down to 3.223. On my machine
12592 the above changes reduced the memory usage by 1,387 KB during
12593 compiler bootstrap.
12595 * cs-parser.jay (QualifiedIdentifier): New class used to represent
12596 QualifiedIdentifiers. Before we created a new string through
12597 concatenation, and mostly later on, the result would be
12598 manipulated by DecomposeQI through string manipulation.
12600 This reduced the compiler memory usage for bootstrapping from
12601 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
12602 compile times in 0.05 seconds.
12604 2003-11-28 Dick Porter <dick@ximian.com>
12606 * support.cs: Do string compares with the Invariant culture.
12614 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
12615 the comparison is done with the Invariant culture.
12617 2003-11-27 Miguel de Icaza <miguel@ximian.com>
12619 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
12620 GetEnumerator method.
12622 (ProbeCollectionType): Iterate starting at the most specific type
12623 upwards looking for a GetEnumerator
12625 * expression.cs: Shift count can be up to 31 for int/uint and 63
12628 2003-11-26 Miguel de Icaza <miguel@ximian.com>
12630 * statement.cs (Block.LookupLabel): Also look for the label on the
12631 children blocks. Use a hash table to keep track of visited
12634 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12635 we actually did transform the other operand, otherwise fall back
12636 to the common codepath that casts to long.
12638 * cs-tokenizer.cs: Use the same code pattern as the int case.
12639 Maybe I should do the parsing myself, and avoid depending on the
12640 Parse routines to get this done.
12642 2003-11-25 Miguel de Icaza <miguel@ximian.com>
12644 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
12645 which fixes bug 51347. This time test it.
12647 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12648 attributes for example can not tell the difference between these.
12649 The difference was only a syntax feature of the language.
12651 * attribute.cs: Apply attributes to delegates.
12653 * delegate.cs: Call the apply attributes method.
12655 2003-11-24 Miguel de Icaza <miguel@ximian.com>
12657 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12658 comparing 0 vs Byte.MinValue, not the value
12660 (ImplicitConversionRequired): When reporting a conversion error,
12661 use error 31 to print out the constant error instead of the
12664 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
12665 which fixes bug 51347.
12667 2003-11-22 Miguel de Icaza <miguel@ximian.com>
12669 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
12670 which fixes the -warnaserror command line option.
12672 2003-11-21 Miguel de Icaza <miguel@ximian.com>
12674 * cfold.cs (DoNumericPromotions): During constant folding of
12675 additions on UIntConstant, special case intconstants with
12676 IntConstants like we do on the expression binary operator.
12678 2003-11-12 Miguel de Icaza <miguel@ximian.com>
12680 * convert.cs (ImplicitReferenceConversion): We were missing a case
12681 (System.Enum are not value types or class types, so we need to
12682 classify them separatedly).
12684 * driver.cs: We do not support error 2007.
12686 2003-11-12 Jackson Harper <jackson@ximian.com>
12688 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
12689 system directory. Also use the full file name so users can
12690 libraries names mscorlib-o-tron.dll in a non system dir.
12692 2004-01-04 David Sheldon <dave-mono@earth.li>
12694 * expression.cs: Added matching ")" to error message for CS0077.
12696 2003-12-19 Martin Baulig <martin@ximian.com>
12698 * typemanager.cs (TypeManager.IsEqualGenericType): New public
12699 static method; see documentation in the method.
12700 (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
12702 * convert.cs (Convert.ImplicitReferenceConversion,
12703 Convert.ImplicitReferenceConversionExists): Add support for
12704 generic type declarations; see gen-36.cs.
12706 2003-12-19 Martin Baulig <martin@ximian.com>
12708 * pending.cs (Pending.InterfaceMethod): Use
12709 `Type.IsAssignableFrom()' instead of `=='.
12711 2003-12-18 Martin Baulig <martin@ximian.com>
12713 * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
12716 * convert.cs (Convert.ImplicitStandardConversionExists): Use
12717 `expr_type.Equals (target_type)' instead of `=='.
12719 2003-12-08 Martin Baulig <martin@ximian.com>
12721 * generics.cs (Constraints.Types): Removed.
12722 (Constraints.Resolve): Just resolve everything to TypeExpr's, not
12724 (Constraints.ResolveTypes): New public method; resolves the
12725 TypeExpr's to Type's.
12726 (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
12727 longer takes the constraints.
12728 (TypeParameter.DefineMethod): Likewise.
12729 (TypeParameter.DefineType): New public method. Calls
12730 `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
12733 2003-12-08 Martin Baulig <martin@ximian.com>
12735 * convert.cs (Convert.ImplicitConversionStandard): Use
12736 `expr_type.Equals (target_type)' instead of `=='.
12738 2003-12-08 Martin Baulig <martin@ximian.com>
12740 * typemanager.cs (TypeManager.GetReferenceType): Call
12741 `Type.MakeByRefType ()'.
12743 2003-12-08 Martin Baulig <martin@ximian.com>
12745 * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
12746 just has some special meaning in some situations. For instance,
12747 it is allowed to use `where' as the name of a variable etc.
12749 2003-12-04 Martin Baulig <martin@ximian.com>
12751 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12752 `Type.MakeArrayType()' for array types.
12754 2003-11-18 Miguel de Icaza <miguel@ximian.com>
12756 * expression.cs (Invocation.VerifyArgumentsCompat): Remove
12759 (SizeOf.DoResolve): assign the `type_queried' field. This gets
12762 2003-11-16 Martin Baulig <martin@ximian.com>
12764 * codegen.cs (EmitContext.IsGeneric): Removed.
12766 * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
12767 ResolveGeneric() on the DeclSpace.
12769 2003-11-16 Martin Baulig <martin@ximian.com>
12771 * generic.cs (TypeArguments.Resolve):
12772 `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
12773 `ResolveType()' on it to get the Type.
12775 2003-11-15 Martin Baulig <martin@ximian.com>
12777 * generic.cs (ConstructedType.GetInterfaces): Override this.
12779 2003-11-14 Martin Baulig <martin@ximian.com>
12781 * interface.cs (Interface.DefineType): Define all type parameters
12782 before adding the interfaces we inherit.
12784 2003-11-11 Martin Baulig <martin@ximian.com>
12786 * generic.cs (ConstructedType.ResolveType): Always call
12787 `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
12789 2003-11-10 Martin Baulig <martin@ximian.com>
12791 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12792 (TypeManager.InitCoreTypes): Initialize them here, but instead of
12793 calling `ResolveType()' on them, directly assign their `Type'.
12795 2003-11-08 Martin Baulig <martin@ximian.com>
12797 * generic.cs (ConstructedType): Override `IsClass' etc.
12799 2003-11-08 Martin Baulig <martin@ximian.com>
12801 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12802 return value and the `out parent' parameter.
12803 (TypeContainer.DefineType): Moved the CS0644 check into
12804 GetClassBases(). Don't pass the interface types to the
12805 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12806 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12808 * ecore.cs (TypeExpr.IsAttribute): New property.
12809 (TypeExpr.GetInterfaces): New method.
12811 * interface.cs (Interface.GetInterfaceTypeByName): Return a
12812 TypeExpr instead of a Type.
12813 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12814 (Interface.DefineType): Don't pass the interface types to the
12815 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12816 them later and then call `TypeBulider.AddInterfaceImplementation()'.
12818 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12819 instead of a `Type[]'.
12820 (TypeManager.RegisterBuilder): Likewise.
12821 (TypeManager.AddUserInterface): Likewise.
12822 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12823 `Type[]' and also return a `TypeExpr[]'.
12824 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12826 2003-11-08 Martin Baulig <martin@ximian.com>
12828 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12831 2003-11-08 Martin Baulig <martin@ximian.com>
12833 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12834 TypeManager.ResolveExpressionTypes().
12836 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12837 instead of an Expression.
12838 (TypeExpr): This is now an abstract base class for `TypeExpression'.
12839 (TypeExpression): New public class; formerly known as `TypeExpr'.
12841 * expression.cs (ComposedCast): Derive from TypeExpr.
12843 * typemanager.cs (TypeManager.system_*_expr): These are now
12844 TypExpr's instead of Expression's.
12845 (TypeManager.ResolveExpressionTypes): New public static function;
12846 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12849 2003-11-06 Miguel de Icaza <miguel@ximian.com>
12851 * expression.cs (New.DoResolve): Do not dereference value that
12852 might be a null return.
12854 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12855 sure that the constant value has the right type. Fixes an
12856 unreported bug, similar to 50425.
12858 * const.cs (Const.LookupConstantValue): Call
12859 ImplicitStandardConversionExists before doing a conversion to
12860 avoid havng the TypeManager.ChangeType do conversions.
12862 Reduced the number of casts used
12864 (Const.ChangeType): New routine to enable reuse of the constant
12865 type changing code from statement.
12867 * typemanager.cs (ChangeType): Move common initialization to
12868 static global variables.
12872 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12873 every value type to go through, even if it was void. Fix that.
12875 * cs-tokenizer.cs: Use is_identifier_start_character on the start
12876 character of the define, and the is_identifier_part_character for
12877 the rest of the string.
12879 2003-11-05 Miguel de Icaza <miguel@ximian.com>
12881 * expression.cs (UnaryMutator.EmitCode): When I updated
12882 LocalVariableReference.DoResolve, I overdid it, and dropped an
12883 optimization done on local variable references.
12885 2003-11-04 Miguel de Icaza <miguel@ximian.com>
12887 * ecore.cs: Convert the return from Ldlen into an int.
12889 2003-10-20 Miguel de Icaza <miguel@ximian.com>
12891 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12892 the accessibility, this is a special case for toplevel non-public
12893 classes (internal for instance).
12895 2003-10-20 Nick Drochak <ndrochak@gol.com>
12897 * ecore.cs: Fix typo and build. Needed another right paren.
12899 2003-10-19 Miguel de Icaza <miguel@ximian.com>
12901 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
12902 `internal' case regular and protected, but not allowing protected
12903 to be evaluated later. Bug 49840
12905 2003-10-15 Miguel de Icaza <miguel@ximian.com>
12907 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12908 to kb.Nlast, and not the kb.nFirst to isolate the switch
12911 Extract the underlying type, so enumerations of long/ulong are
12912 treated like long/ulong.
12914 2003-10-14 Miguel de Icaza <miguel@ximian.com>
12916 * expression.cs (New): Overload the meaning of RequestedType to
12917 track the possible creation of the NewDelegate type, since
12918 DoResolve is invoked more than once for new constructors on field
12921 See bugs: #48800 and #37014
12923 * cs-parser.jay (declare_local_constants): Take an arraylist
12924 instead of a single constant.
12926 (local_constant_declaration): It should take a
12927 constant_declarators, not a constant_declarator. Fixes 49487
12929 * convert.cs: Fix error report.
12931 2003-10-13 Jackson Harper <jackson@ximian.com>
12933 * typemanager.cs (TypeToCoreType): Add float and double this fixes
12936 2003-11-03 Martin Baulig <martin@ximian.com>
12938 * expression.cs (ArrayAccess.GetStoreOpcode): Added
12939 `out bool has_type_arg'; if set, we need to pass the type to
12941 (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
12942 Stelem_Any/Ldelem_Any for generic parameters.
12944 2003-11-02 Martin Baulig <martin@ximian.com>
12946 * expression.cs (Invocation.EmitCall): Use
12947 `TypeManager.IsValueType()' to check whether it's a value type.
12948 Don't set `struct_call' when calling a method on a type parameter.
12950 2003-11-02 Martin Baulig <martin@ximian.com>
12952 * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
12953 and removed the TypeBuilder argument.
12955 * typemanager.cs (TypeManager.IsValueType): Return
12956 `t.IsGenericParameter || t.IsValueType'.
12958 2003-10-25 Martin Baulig <martin@ximian.com>
12960 * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
12961 call ConstructedType.Resolve() on it.
12963 * generic.cs (ConstructedType.Resolve): Set `type' on success.
12965 2003-10-25 Martin Baulig <martin@ximian.com>
12967 * class.cs (TypeContainer.GetClassBases): Changed
12968 `out Type parent' into `out TypeExpr parent'. Moved CS0644 and
12969 CS8214 reporting here.
12970 (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
12971 instead of a `Type' for our parent. In case of a recursive
12972 declaration (see tests/gen-23.cs for an example), our parent is a
12973 ConstructedType and it doesn't have its type set. So, first
12974 create our own TypeBuilder, then call constructed.Resolve() to get
12975 the parent's type and finally TypeBuilder.SetParent() it.
12977 * ecore.cs (TypeExpr.Name): New public virtual property.
12980 (ConstructedType): We're now a TypeExpr and not just an Expression.
12981 (ConstructedType.ResolveAsTypeStep): Don't resolve our type
12982 arguments here; this is done later.
12983 (ConstructedType.Resolve): New public method to resolve the type
12984 arguments and bind them.
12986 2003-10-21 Martin Baulig <martin@ximian.com>
12988 * convert.cs: Use `TypeManager.IsValueType' instead of
12989 'type.IsValueType' everywhere.
12991 * typemanager.cs (TypeManager.IsValueType): Return true for type
12992 parameters. The reason for this is that we need to box a type
12993 parameter when converting it to a reference type.
12995 * cs-parser.jay: Added support for default value expressions.
12997 * generics.cs (DefaultValueExpression): New public class.
12999 2003-10-17 Martin Baulig <martin@ximian.com>
13001 * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
13002 TypeContainer so we can also use this for Interfaces.
13003 (TypeParameter.Resolve): Likewise.
13005 * interface.cs (Interface.DefineType): Added support for generic
13008 * cs-parser.jay: Added support for generic structs and interfaces.
13010 2003-10-17 Martin Baulig <martin@ximian.com>
13012 * generic.cs (GenericMemberAccess.DoResolve): We can now actually
13013 call generic methods :-)
13015 2003-10-16 Martin Baulig <martin@ximian.com>
13017 * cs-parser.jay (namespace_or_type_name): Only create a
13018 GenericMemberAccess if we actually have type arguments.
13020 2003-10-13 Martin Baulig <martin@ximian.com>
13022 * class.cs (Method.Define): If we're a generic method, call
13023 TypeBuilder.DefineGenericMethod () before resolving
13025 (MethodData): Added .ctor which takes an additional MethodBuilder
13026 argument; this is used for generic methods.
13027 (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
13028 we already have a MethodBuilder.
13030 2003-10-10 Martin Baulig <martin@ximian.com>
13032 * class.cs (Method): Added .ctor which takes a `GenericMethod'
13033 instead of a `DeclSpace'. This is used for generic methods.
13035 * cs-parser.jay (method_header): Added support for generic
13036 methods; create a `GenericMethod' instance and pass it to the
13037 `Method's .ctor; it'll be used as the `DeclSpace' to lookup
13038 parameters and locals.
13040 * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
13041 since we already have the location. Check whether we're a generic
13042 type declaration or a generic method and create the correct type
13045 * generic.cs (TypeParameter.DefineMethod): New public method.
13046 (GenericMethod): New public class; derives from DeclSpace and is
13047 used for generic methods.
13049 2003-10-09 Martin Baulig <martin@ximian.com>
13051 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
13053 (MethodCore.DoDefineParameters): Removed the TypeContainer
13054 argument; use the DeclSpace which was passed to the .ctor instead.
13055 (MethodCore.CheckParameter): Take a DeclSpace instead of a
13056 TypeContainer; we only need a DeclSpace here.
13058 2003-10-09 Martin Baulig <martin@ximian.com>
13060 * class.cs (MethodData): Added additional `DeclSpace ds' argument
13062 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
13063 EmitContext's .ctor.
13065 2003-10-09 Martin Baulig <martin@ximian.com>
13067 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
13068 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
13069 AsAccessible(), moved them as well.
13071 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
13073 2003-10-07 Miguel de Icaza <miguel@ximian.com>
13075 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
13076 generation for >=, as spotted by Paolo, bug 48679.
13077 Patch from David Waite.
13079 * cs-tokenizer.cs: Add handling for #pragma.
13081 * cs-parser.jay: Allow for both yield and yield return in the
13082 syntax. The anti-cobolization of C# fight will go on!
13084 * class.cs (TypeBuilder.DefineType): Catch error condition here
13085 (Parent.DefineType erroring out and returning null).
13087 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13088 coping with enumerations variables, we were mistakenly processing
13089 them as a regular value type instead of built-in types. Fixes the
13092 * typemanager.cs (IsBuiltinOrEnum): New method.
13094 2003-09-30 Miguel de Icaza <miguel@ximian.com>
13096 * cs-parser.jay: Upgrade: yield now needs the return clause.
13098 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
13100 * cs-parser.jay : Renamed yyName to yyNames related to jay.
13102 2003-09-29 Martin Baulig <martin@ximian.com>
13104 * typemanager.cs (TypeManager.GetMethodFlags): Added support for
13105 inflated generic methods.
13107 * generics.cs (ConstructedType): Distinguish between open and
13108 closed constructed types; correctly resolve the arguments.
13110 2003-09-22 Martin Baulig <martin@ximian.com>
13112 * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
13113 all type arguments meet their constraints.
13115 2003-09-19 Martin Baulig <martin@ximian.com>
13117 * decl.cs (MemberCache.SetupCacheForInterface): Take a
13118 `MemberCache parent' argument. Normally, an interface doesn't
13119 have a parent type except System.Object, but we use this in gmcs
13120 for generic type parameters.
13122 2003-09-18 Martin Baulig <martin@ximian.com>
13124 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
13125 on `type.IsInterface'; don't check whether the type has a parent
13126 to determine whether it's an interface.
13128 2003-09-17 Martin Baulig <martin@ximian.com>
13130 * generic.cs (ConstructedType.ToString): Always use `name' as the
13133 2003-09-15 Martin Baulig <martin@ximian.com>
13135 * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
13137 * generic.cs (Constraints.Resolve): New public method; this is
13138 called to resolve the constraint types and to check whether all
13139 the constraints are correct.
13140 (Constraints.Types): New public property.
13141 (TypeParameter.Resolve): New public method; resolves all the
13142 type's constraints.
13144 * class.cs (TypeContainer.DefineType): Call
13145 TypeParameter.Resolve() before actually defining the type.
13147 2003-09-15 Martin Baulig <martin@ximian.com>
13149 * class.cs (TypeContainer.DefineType): Added an error flag to
13150 avoid reporting duplicate CS0146's ("class definition is
13153 * driver.cs (Driver.MainDriver): Abort if
13154 RootContext.ResolveTree() reported any errors.
13156 2003-09-07 Martin Baulig <martin@ximian.com>
13158 * report.cs (Error, Warning): Added overloaded versions which take
13159 a `params object[] args' and call String.Format().
13161 2003-09-07 Martin Baulig <martin@ximian.com>
13163 * decl.cs (DeclSpace..ctor): Don't call
13164 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
13165 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
13166 (DeclSpace.RecordDecl): New method.
13168 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
13170 2003-09-02 Ravi Pratap <ravi@ximian.com>
13172 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
13173 value attributes to be applied to ParameterBuilders.
13175 * class.cs (MethodCore.LabelParameters): Make static and more
13176 generic so that it can be used from other places - like interface
13177 methods, for instance.
13179 * interface.cs (Interface.Emit): Call LabelParameters before
13180 emitting attributes on the InterfaceMethod.
13182 2003-09-07 Martin Baulig <martin@ximian.com>
13184 * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
13185 if the number of type parameters doesn't match.
13187 2003-09-04 Martin Baulig <martin@ximian.com>
13189 * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
13190 for arrays of generic type params (ie. `!0[]').
13192 2003-09-04 Martin Baulig <martin@ximian.com>
13194 * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
13197 2003-09-04 Martin Baulig <martin@ximian.com>
13199 * decl.cs (DeclSpace.LookupGeneric): New method.
13200 (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
13203 * generic.cs (TypeParameterExpr): Take a TypeParameter as
13204 argument, not just a string.
13205 (TypeParameter.Define): New public method; this is called to
13206 actually define the generic parameter; after this, you can use the
13207 new `Type' property to get the type.
13209 2003-09-04 Martin Baulig <martin@ximian.com>
13211 * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
13212 is now an ArrayList; initialize the result of the `TypeParameters'
13214 (DeclSpace.GetGenericData): Removed.
13215 (DeclSpace.LookupGeneric): Temporarily removed; we need to
13216 implement this in a different way.
13217 (DeclSpace.GetTypeParameters): Removed; there's now a
13218 `TypeParameters' property.
13219 (DeclSpace.TypeParameters): New public property.
13221 * generic.cs (Constraints): Make this class public.
13222 (TypeParameter): New public class.
13224 2003-09-04 Martin Baulig <martin@ximian.com>
13226 * decl.cs (DeclSpace.GetTypeParameters): New method to return the
13227 generic parameters.
13229 * class.cs (TypeContainer.DefineType): Call
13230 TypeBuilder.DefineGenericParameter () on all generic parameters if
13231 this is a generic type.
13233 2003-08-28 Martin Baulig <martin@ximian.com>
13235 * sample-stack.il: Compile this with ilasm: "ilasm /dll
13238 * sample-hello.cs: Compile this with gmcs: "gmcs
13239 /r:sample-stack.dll sample-hello.cs".
13241 2003-08-28 Martin Baulig <martin@ximian.com>
13243 * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
13244 the parameters to the generic type.
13246 2003-08-28 Martin Baulig <martin@ximian.com>
13248 * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
13250 2003-08-28 Martin Baulig <martin@ximian.com>
13252 * cs-parser.jay (opt_type_argument_list): Use
13253 `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
13254 (primary_expression): Replace `qualified_identifier' with `type_name'.
13255 (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
13257 * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
13258 parser to check whether it is syntactically a type parameter list;
13259 return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
13262 2003-08-26 Martin Baulig <martin@ximian.com>
13264 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
13265 resolving aliases; fixes #47927.
13267 2003-08-26 Martin Baulig <martin@ximian.com>
13269 * statement.cs (Using.DoResolve): This is internally emitting a
13270 try/finally clause, so we need to set ec.NeedExplicitReturn if we
13271 do not always return. Fixes #47681.
13273 2003-08-26 Martin Baulig <martin@ximian.com>
13275 * decl.cs (MemberCore): Moved WarningNotHiding(),
13276 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
13278 (AdditionResult): Make this nested in DeclSpace.
13279 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
13280 argument; call NamespaceEntry.Define() unless we're nested in a
13283 * namespace.cs (Namespace.DefineName): New public function. This
13284 is called from DeclSpace's .ctor to add
13285 (Namespace.Lookup): Include DeclSpaces in the lookup.
13287 * class.cs (Operator): Derive from MemberBase, not MemberCore.
13289 * const.cs (Const): Derive from MemberBase, not MemberCore.
13291 2003-08-25 Martin Baulig <martin@ximian.com>
13293 * convert.cs (Convert.ExplicitReferenceConversion): When
13294 converting from an interface type to a class, unbox if the target
13295 type is a struct type. Fixes #47822.
13297 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13299 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
13302 2003-08-22 Martin Baulig <martin@ximian.com>
13304 * class.cs (TypeManager.DefineType): When defining a nested type,
13305 call DefineType() on our parent; fixes #47801.
13307 2003-08-22 Martin Baulig <martin@ximian.com>
13309 * class.cs (MethodData.Define): While checking if a method is an
13310 interface implementation, improve the test a bit more to fix #47654.
13312 2003-08-22 Martin Baulig <martin@ximian.com>
13314 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
13315 correctly; fixes #47722.
13317 2003-08-22 Martin Baulig <martin@ximian.com>
13319 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
13320 LocalVariableReference, ensure it's not read-only. Fixes #47536.
13322 * statement.cs (Fixed.DoResolve): Make all variables read-only.
13324 2003-08-22 Martin Baulig <martin@ximian.com>
13326 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
13327 can only be assigned in static constructors. Fixes #47161.
13329 2003-08-22 Martin Baulig <martin@ximian.com>
13331 Rewrote and improved the flow analysis code.
13333 * flowbranching.cs (FlowBranching): Make this class abstract.
13334 (FlowBranching.CreateBranching): New static function to create a
13335 new flow branching.
13336 (FlowBranchingBlock, FlowBranchingException): New classes.
13337 (FlowBranching.UsageVector.Type): New public readonly field.
13338 (FlowBranching.UsageVector.Breaks): Removed the setter.
13339 (FlowBranching.UsageVector.Returns): Removed the setter.
13340 (FlowBranching.UsageVector): Added Break(), Return(),
13341 NeverReachable() and Throw() methods to modify the reachability.
13342 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
13343 done by FlowBranching.Merge().
13344 (FlowBranching.UsageVector.MergeChild): New method; merges the
13345 merge result into the current vector.
13346 (FlowBranching.Merge): New abstract method to merge a branching.
13348 2003-08-12 Martin Baulig <martin@ximian.com>
13350 * expression.cs (Indirection.CacheTemporaries): Create the
13351 LocalTemporary with the pointer type, not its element type.
13353 2003-08-10 Miguel de Icaza <miguel@ximian.com>
13355 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
13356 token was a keyword or not.
13358 Add `error' options where an IDENTIFIER was expected; Provide
13359 CheckToken and CheckIdentifierToken convenience error reporting
13362 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
13364 * decl.cs: Rename `NamespaceEntry Namespace' public field into
13365 NameSpaceEntry NameSpaceEntry.
13367 (LookupInterfaceOrClass): Avoid creating a full qualified name
13368 from namespace and name: avoid doing lookups when we know the
13369 namespace is non-existant. Use new Tree.LookupByNamespace which
13370 looks up DeclSpaces based on their namespace, name pair.
13372 * driver.cs: Provide a new `parser verbose' to display the
13373 exception thrown during parsing. This is turned off by default
13374 now, so the output of a failure from mcs is more graceful.
13376 * namespace.cs: Track all the namespaces defined in a hashtable
13379 (IsNamespace): New method
13381 2003-08-09 Miguel de Icaza <miguel@ximian.com>
13383 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
13384 we know that we need to concatenate (full typename can never be
13389 * statement.cs: Use a bitfield; Do not initialize to null things
13390 which are done by the constructor by default.
13392 * cs-parser.jay: bug fix, parameter was 4, not 3.
13394 * expression.cs: Just use the property;
13396 * statement.cs: No need for GetVariableInfo method.
13398 2003-08-08 Martin Baulig <martin@ximian.com>
13400 * flowanalysis.cs (FlowReturns): This is now nested in the
13401 `FlowBranching' class.
13402 (MyBitVector): Moved this here from statement.cs.
13403 (FlowBranching.SiblingType): New enum type.
13404 (FlowBranching.CreateSibling): Added `SiblingType' argument.
13406 2003-08-07 Martin Baulig <martin@ximian.com>
13408 * flowanalysis.cs (FlowBranchingType): This is now nested in the
13409 `FlowBranching' class and called `BranchingType'.
13411 2003-08-07 Martin Baulig <martin@ximian.com>
13413 * flowanalysis.cs: Moved all the control flow analysis code into
13416 2003-08-07 Martin Baulig <martin@ximian.com>
13418 * assign.cs (Assign.DoResolve): `target' must either be an
13419 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
13422 2003-08-07 Miguel de Icaza <miguel@ximian.com>
13424 * expression.cs (BinaryMethod): This kind of expression is created by the
13425 Binary class if it determines that the operator has to be handled
13428 (BinaryDelegate): This kind of expression is created if we are
13429 dealing with a + or - operator on delegates.
13431 (Binary): remove method, argumetns, and DelegateOperator: when
13432 dealing with methods,
13434 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
13436 * statement.cs (Block): use bitfields for the three extra booleans
13437 we had in use. Remove unused topblock parameter.
13439 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
13441 * assign.cs: Drop extra unneeded tests.
13443 2003-08-06 Miguel de Icaza <miguel@ximian.com>
13445 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
13447 * statement.cs (Foreach): Use VariableStorage instead of
13450 * codegen.cs (VariableStorage): New class used by clients that
13451 require a variable stored: locals or fields for variables that
13452 need to live across yield.
13454 Maybe provide a convenience api for EmitThis+EmitLoad?
13456 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
13459 2003-08-05 Miguel de Icaza <miguel@ximian.com>
13461 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
13462 RemapParameterLValue): New methods that are used to turn a
13463 precomputed FieldInfo into an expression like this:
13467 The idea is to use this instead of making LocalVariableReference
13468 have more than one meaning.
13470 * cs-parser.jay: Add error production to BASE.
13472 * ecore.cs: Deal with TypeManager.GetField returning null, which
13473 is now a valid return value.
13475 (FieldExprNoAddress): New expression for Fields whose address can
13478 * expression.cs (LocalVariableReference): During the resolve
13479 phases, create new expressions if we are in a remapping context.
13480 Remove code that dealt with remapping here.
13482 (ParameterReference): same.
13484 (ProxyInstance): New expression, like the `This' expression, but
13485 it is born fully resolved. We know what we are doing, so remove
13486 the errors that are targeted to user-provided uses of `this'.
13488 * statement.cs (Foreach): our variable is now stored as an
13489 Expression; During resolution, follow the protocol, dont just
13490 assume it will return this.
13492 2003-08-06 Martin Baulig <martin@ximian.com>
13494 * support.cs (SeekableStreamReader.cs): New public class.
13496 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
13497 SeekableStreamReader instead of the normal StreamReader.
13499 2003-08-04 Martin Baulig <martin@ximian.com>
13501 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
13502 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
13503 deambiguate casts and delegate invocations.
13504 (parenthesized_expression): Use the new tokens to ensure this is
13505 not a cast of method invocation.
13507 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
13508 when reading a `)' and Deambiguate_CloseParens () was previously
13511 * expression.cs (ParenthesizedExpression): New class. This is
13512 just used for the CS0075 test.
13513 (Binary.DoResolve): Check for CS0075.
13515 2003-07-29 Ravi Pratap <ravi@ximian.com>
13517 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
13518 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
13519 reference comparison.
13521 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
13522 examine the ReturnType for equality - this is necessary in the
13523 cases of implicit and explicit operators whose signature also
13524 includes the return type.
13526 2003-07-26 Miguel de Icaza <miguel@ximian.com>
13528 * namespace.cs: Cache the result of the namespace computation,
13529 instead of computing it every time.
13531 2003-07-24 Miguel de Icaza <miguel@ximian.com>
13533 * decl.cs: Use a global arraylist that we reuse over invocations
13534 to avoid excesive memory consumption. Reduces memory usage on an
13535 mcs compile by one meg (45 average).
13537 * typemanager.cs (LookupTypeReflection): In .NET pointers are
13538 private, work around that.
13540 2003-07-23 Miguel de Icaza <miguel@ximian.com>
13542 * literal.cs (IntLiteral): Define Zero and One static literals.
13544 * cs-parser.jay (integer_literal): use static literals to reduce
13545 memory usage for the most used literals (0, 1 and -1). 211kb
13546 reduced in memory usage.
13548 Replace all calls to `new ArrayList' with `new
13549 ArrayList(4)' which is a good average number for most allocations,
13550 and also requires only 16 bytes of memory for its buffer by
13553 This reduced MCS memory usage in seven megabytes for the RSS after
13556 2003-07-28 Ravi Pratap <ravi@ximian.com>
13558 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
13559 handle params methods the correct way by forming only one
13560 applicable set with params and normal methods in them. Earlier we
13561 were looking at params methods only if we found no normal methods
13562 which was not the correct thing to do.
13564 (Invocation.BetterFunction): Take separate arguments indicating
13565 when candidate and the best method are params methods in their
13568 This fixes bugs #43367 and #46199.
13570 * attribute.cs: Documentation updates.
13572 (CheckAttribute): Rename to CheckAttributeTarget.
13573 (GetValidPlaces): Rename to GetValidTargets.
13575 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
13576 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
13580 2003-07-28 Miguel de Icaza <miguel@ximian.com>
13582 * codegen.cs: Compute IsGeneric correctly.
13584 * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
13587 Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
13588 OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
13589 regressions, and I was chasing more bugs than I required.
13591 * interface.cs: Use expressions for base type names (like classes
13592 and structs have been doing for a while now), and resolve that.
13593 This patch should probably go into head as well.
13595 This makes it one less user of FindType.
13597 2003-07-24 Miguel de Icaza <miguel@ximian.com>
13599 This compiler can not self host currently. Need to fix that.
13601 * Makefile: compile to `gmcs.exe'
13603 * driver.cs: Turn on v2 by default on gmcs.
13605 * generic.cs (ConstructedType): Does no longer take a container
13606 type argument; That will be taken care of later.
13608 (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
13609 Use SimpleName to resolve for now, so we can continue the work on
13610 the parser, until we get Type.GetType that understands generics.
13612 (ConstructedType.ToString): Implement
13614 (TypeArguments.Resolve): Resolve the child expressions as types.
13616 * cs-parser.jay: Rename interface_constraints to
13617 type_parameter_constraints
13619 (namespace_or_type_name): Only use constructed types for the basic
13620 construction, we will deal with identifier<...> later.
13622 (type/type_name): No longer call DecomposeQI, as
13623 namespace_or_type_name is always decoded now.
13625 2003-07-22 Ravi Pratap <ravi@ximian.com>
13627 * expression.cs (Invocation.OverloadResolve): Follow the spec more
13628 closely: we eliminate methods in base types when we have an
13629 applicable method in a top-level type.
13631 Please see section 14.5.5.1 for an exact description of what goes
13634 This fixes bug #45127 and a host of other related to corlib compilation.
13636 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13637 array is the method corresponding to the top-level type (this is
13638 because of the changes made to icall.c) so we change this
13641 (MethodGroupExpr.Name): This too.
13643 * typemanager.cs (GetElementType): New method which does the right
13644 thing when compiling corlib.
13646 * everywhere: Make use of the above in the relevant places.
13648 2003-07-22 Martin Baulig <martin@ximian.com>
13650 * cs-parser.jay (invocation_expression): Moved
13651 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
13652 `cast_expression', but create a InvocationOrCast which later
13653 resolves to either an Invocation or a Cast.
13655 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
13656 method; call this before EmitStatement() to make sure that this
13657 expression can be used as a statement.
13659 * expression.cs (InvocationOrCast): New class; resolves to either
13660 an Invocation or a Cast.
13662 * statement.cs (StatementExpression): Call ResolveStatement() on
13663 the ExpressionStatement before emitting it.
13665 2003-07-21 Martin Baulig <martin@ximian.com>
13667 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
13668 `ref' and `out' attributes match; fixes #46220.
13669 (MemberAccess.ResolveMemberAccess): You can't reference a type
13670 through an expression; fixes #33180.
13671 (Indexers.GetIndexersForType): Don't return the indexers from
13672 interfaces the class implements; fixes #46502.
13674 2003-07-21 Martin Baulig <martin@ximian.com>
13676 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
13677 CS0661 checks; fixes bug #30442.
13679 2003-07-21 Martin Baulig <martin@ximian.com>
13681 * decl.cs (AdditionResult): Added `Error'.
13683 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
13685 * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
13686 cs0031.cs actually work.
13688 2003-07-20 Miguel de Icaza <miguel@ximian.com>
13690 * cs-parser.jay (namespace_name): do not use
13691 namespace_or_type_name, use qualified_identifier, because
13692 namespace_or_type_name will soon return a composed expression
13693 instead of a string.
13695 (namespace_or_type_name): Instead of returning a string, now this
13696 production returns an expression.
13698 * codegen.cs (EmitContext): Setup IsGeneric property based on
13699 whether our DeclSpace is generic, our the method is generic.
13701 * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
13702 the method is generic.
13704 * cs-parser.jay (type_arguments, opt_type_argument_list,
13705 type_parameters, type_parameter_list, opt_type_parameter_list,
13706 type_parameter,, opt_type_parameter_constraints_clauses,
13707 type_parameter_constraints_clauses,
13708 type_parameter_constraint_clause, type_parameter_constraint,
13709 interface_constraints): Add new production
13711 * decl.cs (DeclSpace): IsGeneric, flag to track whether this
13712 DeclSpace is generic or not.
13714 (DeclSpace.SetParameterInfo): New routine, used to set the
13715 parameter info for a type.
13717 (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
13718 returns a GenericTypeExpr
13720 * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
13721 generic, lookup the generic argument.
13723 * attribute.cs: Do not allow TypeParameterExpressions in
13726 * class.cs: Do not allow the Main method to be defined in a
13729 * expression.cs (SizeOf): Do not allow generic types to be used as
13730 arguments to sizeof.
13732 * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
13733 it: whether a type is generic or not. Only works for types we are
13734 currently building for now.
13736 2003-07-20 Martin Baulig <martin@ximian.com>
13738 * namespace.cs: Fixed that bug which caused a crash when compiling
13739 the debugger's GUI.
13741 2003-07-20 Miguel de Icaza <miguel@ximian.com>
13743 * typemanager.cs (LookupTypeReflection): Never expose types which
13744 are NotPublic, NestedPrivate, NestedAssembly, or
13745 NestedFamANDAssem. We used to return these, and later do a check
13746 that would report a meaningful error, but the problem is that we
13747 would not get the real match, if there was a name override.
13749 2003-07-18 Miguel de Icaza <miguel@ximian.com>
13751 * namespace.cs (Namespace, Name): Do not compute the namespace
13752 name dynamically, compute it in the constructor. This reduced
13753 memory usage by 1697 KB.
13755 * driver.cs: Use --pause to pause at the end.
13757 2003-07-17 Peter Williams <peter@newton.cx>
13759 * Makefile: Change the name of the test target so that it doesn't
13760 conflict with the recursive test target.
13762 2003-07-17 Miguel de Icaza <miguel@ximian.com>
13764 * expression.cs (LocalVariableReference.Emit, EmitAssign,
13765 AddressOf): Do not use EmitThis, that was wrong, use the actual
13768 2003-07-15 Miguel de Icaza <miguel@ximian.com>
13770 * class.cs (MethodData.Define): While checking if a method is an
13771 interface implementation, improve the test: If we are not public
13772 (use new test here: use the computed MethodAttributes directly,
13773 instead of the parsed modifier flags) check if the `implementing'
13774 method comes from an interface or not.
13776 * pending.cs (VerifyPendingMethods): Slightly better error
13779 * makefile: add test target that does the mcs bootstrap.
13781 2003-07-16 Ravi Pratap <ravi@ximian.com>
13783 * interface.cs (Define): Do nothing here since there are no
13784 members to populate etc. Move the attribute emission out of here
13785 since this was just totally the wrong place to put it. Attribute
13786 application happens during the 'Emit' phase, not in the 'Define'
13789 (Emit): Add this method and move the attribute emission here
13791 * rootcontext.cs (EmitCode): Call the Emit method on interface
13794 2003-07-14 Ravi Pratap M <ravi@ximian.com>
13796 * expression.cs (OverloadResolve): Report error only if Location
13797 is not 'Null' which means that there was a probe going on.
13799 2003-07-14 Martin Baulig <martin@ximian.com>
13801 * expression.cs (ConditionalLogicalOperator): New public class to
13802 implement user defined conditional logical operators.
13803 This is section 14.11.2 in the spec and bug #40505.
13805 2003-07-14 Martin Baulig <martin@ximian.com>
13807 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13809 2003-07-14 Martin Baulig <martin@ximian.com>
13811 * codegen.cs (EmitContext.InFixedInitializer): New public field.
13813 * ecore.cs (IVariable.VerifyFixed): New interface method.
13815 * expression.cs (Unary.ResolveOperator): When resolving the `&'
13816 operator, check whether the variable is actually fixed. Fixes bug
13817 #36055. Set a variable definitely assigned when taking its
13818 address as required by the spec.
13820 * statement.cs (LocalInfo.IsFixed): New field.
13821 (LocalInfo.MakePinned): Set `IsFixed' to true.
13823 2003-07-14 Ravi Pratap M <ravi@ximian.com>
13825 * attribute.cs (Attribute.Resolve): While doing a Member lookup
13826 for .ctors, ensure that we only ask for members declared in the
13827 attribute type (BindingFlags.DeclaredOnly).
13831 * expression.cs (Error_WrongNumArguments): Report error 1501
13832 correctly the way CSC does.
13834 2003-07-13 Martin Baulig <martin@ximian.com>
13836 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13837 lookup on the fully qualified name, to make things like "X.X" work
13838 where "X.X" is a fully qualified type name, but we also have a
13839 namespace "X" in the using list. Fixes #41975.
13841 2003-07-13 Martin Baulig <martin@ximian.com>
13843 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13844 function. If we're a CompoundAssign, we need to create an embedded
13845 CompoundAssign, not an embedded Assign.
13846 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13849 2003-07-13 Martin Baulig <martin@ximian.com>
13851 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13852 work to fix bug #46088.
13854 2003-07-13 Ravi Pratap <ravi@ximian.com>
13856 * class.cs (Operator.Emit): Do not emit attributes here - it is
13857 taken care of by the Method class that we delegate too. This takes
13858 care of bug #45876.
13860 2003-07-10 Martin Baulig <martin@ximian.com>
13862 * expression.cs (TypeOfVoid): New class.
13863 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
13865 2003-07-10 Martin Baulig <martin@ximian.com>
13867 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13870 2003-07-10 Martin Baulig <martin@ximian.com>
13872 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13873 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13875 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13877 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13879 2003-07-10 Martin Baulig <martin@ximian.com>
13881 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13882 of decimal. Fixes #42850.
13884 NOTE: I also fixed the created byte blob, but this doesn't work on
13885 the MS runtime and csc never produces any byte blobs for decimal
13888 2003-07-10 Martin Baulig <martin@ximian.com>
13890 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13891 structs; fixes #32068.
13892 (Block.AddChildVariableNames): Fixed #44302.
13894 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13896 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
13898 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13900 * attribute.cs: And this test is onger needed.
13902 2003-07-08 Martin Baulig <martin@ximian.com>
13904 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13905 inaccessible types. Fixes #36313.
13907 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13909 * namespace.cs (NamespaceEntry): Create implicit entries for all
13910 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13911 implicit entries for N1.N2 and N1.
13913 2003-07-08 Martin Baulig <martin@ximian.com>
13915 Rewrote the handling of namespaces to fix a lot of the issues
13916 wrt. `using' aliases etc.
13918 * namespace.cs (Namespace): Splitted this class into a
13919 per-assembly `Namespace' and a per-file `NamespaceEntry'.
13921 * typemanager.cs (TypeManager.IsNamespace): Removed.
13922 (TypeManager.ComputeNamespaces): Only compute namespaces from
13923 loaded assemblies here, not the namespaces from the assembly we're
13924 currently compiling.
13926 2003-07-08 Martin Baulig <martin@ximian.com>
13928 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13930 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13932 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13935 I thought about the memory savings here, but LookupTypeReflection
13936 is used under already very constrained scenarios. Compiling
13937 corlib or mcs only exposes one hit, so it would not really reduce
13938 any memory consumption.
13940 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13942 * typemanager.cs: fixes bug #45889 by only adding public types from
13943 other assemblies to the list of known types.
13945 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13947 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13948 on the type we resolved.
13950 2003-07-05 Martin Baulig <martin@ximian.com>
13952 * pending.cs (PendingImplementation.ParentImplements): Don't
13953 create the proxy if the parent is abstract.
13955 * class.cs (TypeContainer.DefineIndexers): Process explicit
13956 interface implementations first. Fixes #37714.
13958 2003-07-04 Miguel de Icaza <miguel@ximian.com>
13960 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13961 defined recursively; but since we modify the input parameters
13962 (left is set to `this' temporarily), we reset this value if the
13963 left_is_explicit is false, which gives the original semantics to
13966 * literal.cs (NullPointer): new class used to represent a null
13967 literal in a pointer context.
13969 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13970 type is a pointer, use a NullPointer object instead of a
13971 NullLiteral. Closes 43687
13973 (ExplicitConversion): Convert pointer values using
13974 the conv opcode to the proper type.
13976 * ecore.cs (New): change ValueTypeVariable property into a method,
13977 that returns whether the valuetype is suitable for being used.
13979 * expression.cs (Binary.DoNumericPromotions): Only return if we
13980 the int constant was a valid uint, and we can return both left and
13981 right as uints. If not, we continue processing, to trigger the
13982 type conversion. This fixes 39018.
13984 * statement.cs (Block.EmitMeta): During constant resolution, set
13985 the CurrentBlock property on the emitcontext, so that we resolve
13986 constants propertly.
13988 2003-07-02 Martin Baulig <martin@ximian.com>
13990 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13991 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13993 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13994 than emitting it here.
13996 * statement.cs: Fixed some more flow analysis bugs.
13998 2003-07-02 Martin Baulig <martin@ximian.com>
14000 * class.cs (MethodData.Define): When implementing interface
14001 methods, set Final unless we're Virtual.
14003 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
14004 check work for interface methods.
14006 2003-07-01 Martin Baulig <martin@ximian.com>
14008 * ecore.cs (EmitContext.This): Replaced this property with a
14009 GetThis() method which takes a Location argument. This ensures
14010 that we get the correct error location for a CS0188.
14012 2003-07-01 Miguel de Icaza <miguel@ximian.com>
14014 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
14015 ImplicitStandardConversion.
14017 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
14019 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
14021 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
14024 2003-06-30 Miguel de Icaza <miguel@ximian.com>
14026 * class.cs (Constructor.Define): Turn off initlocals for unsafe
14029 (MethodData.Define): Turn off initlocals for unsafe methods.
14031 2003-06-29 Miguel de Icaza <miguel@ximian.com>
14033 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
14034 complete; Fixes #37521.
14036 * delegate.cs: Use Modifiers.TypeAttr to compute the
14037 TypeAttributes, instead of rolling our own. This makes the flags
14038 correct for the delegates.
14040 2003-06-28 Miguel de Icaza <miguel@ximian.com>
14042 * class.cs (Constructor.Define): Set the private flag for static
14043 constructors as well.
14045 * cs-parser.jay (statement_expression): Set the return value to
14046 null, to avoid a crash when we catch an error.
14048 2003-06-24 Miguel de Icaza <miguel@ximian.com>
14050 * cs-parser.jay: Applied patch from Jackson that adds support for
14051 extern and unsafe modifiers to destructor declarations.
14053 * expression.cs: Report error 21 if the user is trying to index a
14056 * driver.cs: Add an error message, suggested by the bug report.
14058 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
14059 if we do not have a ": this ()" constructor initializer. Fixes 45149
14061 2003-06-14 Miguel de Icaza <miguel@ximian.com>
14063 * namespace.cs: Add some information to reduce FAQs.
14065 2003-06-13 Miguel de Icaza <miguel@ximian.com>
14067 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
14068 underlying enumeration types. Fixes #43915.
14070 * expression.cs: Treat ushort/short as legal values to be used in
14071 bitwise operations.
14073 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
14075 * delegate.cs: transfer custom attributes for paramenters from
14076 the delegate declaration to Invoke and BeginInvoke.
14078 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
14080 * attribute.cs: handle custom marshalers and emit marshal info
14083 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
14085 * makefile.gnu: Added anonymous.cs to the compiler sources.
14087 2003-05-28 Miguel de Icaza <miguel@ximian.com>
14089 * iterators.cs: Change the name of the proxy class to include two
14092 * cs-parser.jay: Update grammar to include anonymous methods.
14094 * anonymous.cs: new file.
14096 2003-05-27 Miguel de Icaza <miguel@ximian.com>
14098 * class.cs (Field.Define): Add missing test for pointers and
14101 2003-05-27 Ravi Pratap <ravi@ximian.com>
14103 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
14104 we use the stobj opcode.
14106 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
14107 since it wasn't the correct fix.
14109 It still is puzzling that we are required to use stobj for IntPtr
14110 which seems to be a ValueType.
14112 2003-05-26 Miguel de Icaza <miguel@ximian.com>
14114 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
14115 during regular simple name resolution. Now, the trick is that
14116 instead of returning for processing the simplename, we do a
14117 TypeManager.LookupType (ie, a rooted lookup as opposed to a
14118 contextual lookup type). If a match is found, return that, if
14119 not, return for further composition.
14121 This fixes long-standing 30485.
14123 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14124 using the address to initialize an object, do an Stobj instead of
14125 using the regular Stelem.
14127 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
14128 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
14129 Because if we are a BaseIndexerAccess that value will be true.
14132 * statement.cs (GotoCase.Resolve): Return after reporting an
14133 error, do not attempt to continue.
14135 * expression.cs (PointerArithmetic.Emit): If our operand is a
14136 long, convert our constants to match the operand before
14137 multiplying. Convert to I type before adding. Fixes 43670.
14139 2003-05-14 Ravi Pratap <ravi@ximian.com>
14141 * enum.cs (ImplicitConversionExists) : Rename to
14142 ImplicitEnumConversionExists to remove ambiguity.
14144 * ecore.cs (NullCast): New type of cast expression class which
14145 basically is very similar to EmptyCast with the difference being
14146 it still is a constant since it is used only to cast a null to
14148 (eg. (string) null)
14150 * convert.cs (ImplicitReferenceConversion): When casting a null
14151 literal, we return a NullCast.
14153 * literal.cs (NullLiteralTyped): Remove - I don't see why this
14154 should be around anymore.
14156 The renaming (reported was slightly wrong). Corrections:
14158 ConvertImplicitStandard -> ImplicitConversionStandard
14159 ConvertExplicitStandard -> ExplicitConversionStandard
14161 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
14162 before passing them in !
14164 * convert.cs (ImplicitConversionStandard): When comparing for
14165 equal expr and target types, ensure that expr is not a
14168 In general, we must not be checking (expr_type ==
14169 target_type) in the top level conversion methods
14170 (ImplicitConversion, ExplicitConversion etc). This checking is
14171 done in the methods that they delegate to.
14173 2003-05-20 Miguel de Icaza <miguel@ximian.com>
14175 * convert.cs: Move Error_CannotConvertType,
14176 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
14177 ImplicitNumericConversion, ImplicitConversionExists,
14178 ImplicitUserConversionExists, StandardConversionExists,
14179 FindMostEncompassedType, FindMostSpecificSource,
14180 FindMostSpecificTarget, ImplicitUserConversion,
14181 ExplicitUserConversion, GetConversionOperators,
14182 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
14183 TryImplicitIntConversion, Error_CannotConvertImplicit,
14184 ConvertImplicitRequired, ConvertNumericExplicit,
14185 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
14186 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
14189 Perform the following renames:
14191 StandardConversionExists -> ImplicitStandardConversionExists
14192 ConvertImplicit -> ImplicitConversion
14193 ConvertImplicitStandard -> ImplicitStandardConversion
14194 TryImplicitIntConversion -> ImplicitIntConversion
14195 ConvertImplicitRequired -> ImplicitConversionRequired
14196 ConvertNumericExplicit -> ExplicitNumericConversion
14197 ConvertReferenceExplicit -> ExplicitReferenceConversion
14198 ConvertExplicit -> ExplicitConversion
14199 ConvertExplicitStandard -> ExplicitStandardConversion
14201 2003-05-19 Martin Baulig <martin@ximian.com>
14203 * statement.cs (TypeInfo.StructInfo): Made this type protected.
14204 (TypeInfo): Added support for structs having structs as fields.
14206 * ecore.cs (FieldExpr): Implement IVariable.
14207 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
14208 VariableInfo for the field.
14210 2003-05-18 Martin Baulig <martin@ximian.com>
14212 * expression.cs (This.DoResolve): Report a CS0027 if we're
14213 emitting a field initializer.
14215 2003-05-18 Martin Baulig <martin@ximian.com>
14217 * expression.cs (This.ResolveBase): New public function.
14218 (This.DoResolve): Check for CS0188.
14220 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
14223 * ecore.cs (MethodGroupExpr.DoResolve): Set the
14224 `instance_expression' to null if we don't have any non-static
14227 2003-05-18 Martin Baulig <martin@ximian.com>
14229 Reworked the way how local variables and parameters are handled by
14230 the flow analysis code.
14232 * statement.cs (TypeInfo, VariableMap): New public classes.
14233 (VariableInfo): New public class. This is now responsible for
14234 checking whether a variable has been assigned. It is used for
14235 parameters and local variables.
14236 (Block.EmitMeta): Take the InternalParameters as argument; compute
14237 the layout of the flow vectors here.
14238 (Block.LocalMap, Block.ParameterMap): New public properties.
14239 (FlowBranching): The .ctor doesn't get the InternalParameters
14240 anymore since Block.EmitMeta() now computes the layout of the flow
14242 (MyStructInfo): This class is now known as `StructInfo' and nested
14243 in `TypeInfo'; we don't access this directly anymore.
14245 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
14246 property and removed IsAssigned(), IsFieldAssigned(),
14247 SetAssigned() and SetFieldAssigned(); we now call them on the
14248 VariableInfo so we don't need to duplicate this code everywhere.
14250 * expression.cs (ParameterReference): Added `Block block' argument
14252 (LocalVariableReference, ParameterReference, This): The new
14253 VariableInfo class is now responsible for all the definite
14256 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
14257 IsParameterAssigned, SetParameterAssigned): Removed.
14259 2003-05-18 Martin Baulig <martin@ximian.com>
14261 * typemanager.cs (InitCoreTypes): Try calling
14262 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
14263 the 3-args-version. Corlib now also needs our `void_type'.
14264 (GetMethod): Added overloaded version which takes an optional
14265 `bool report_errors' to allow lookups of optional methods.
14267 2003-05-12 Martin Baulig <martin@ximian.com>
14269 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
14270 only used for locals and not for parameters.
14272 2003-05-12 Miguel de Icaza <miguel@ximian.com>
14274 * support.cs (InternalParameters.ParameterType): Return the
14275 ExternalType of the parameter.
14277 * parameter.cs (Parameter.ExternalType): drop the two arguments,
14280 2003-05-11 Miguel de Icaza <miguel@ximian.com>
14282 * class.cs (MethodData.Define): Do not set the `newslot' on
14283 interface members, if they are also flagged as "override".
14285 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
14286 better code for ++i and i++. This only works for static fields
14287 and local variables.
14289 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
14290 want to pull the DeclSpace out of the builder_to_declspace instead
14291 of the TypeBuilder (like in TypeContainer.FindMembers).
14293 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
14294 instead of LookupTypeContainer. Fixes the crash on .NET for
14295 looking up interface members.
14297 * const.cs: Create our own emit context during the Definition
14298 stage, so that constants are evaluated in the proper context, when
14299 a recursive definition happens.
14301 2003-05-11 Martin Baulig <martin@ximian.com>
14303 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
14304 new block for a switch section.
14305 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
14306 the adding/lookup in the switch block. Fixes #39828.
14308 2003-05-09 Miguel de Icaza <miguel@ximian.com>
14310 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
14311 functionality: I needed to convert the data after I had performed
14312 the add/sub operation into the operands type size.
14314 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
14315 pass the type for the box operation, otherwise the resulting
14316 object would have been of type object.
14318 (BoxedCast): Add constructor to specify the type to box as.
14320 2003-05-07 Miguel de Icaza <miguel@ximian.com>
14322 * iterators.cs: I was reusing the `count' variable inadvertently,
14323 take steps to not allow this to happen.
14325 2003-05-06 Miguel de Icaza <miguel@ximian.com>
14327 * attribute.cs (Attribute.Resolve): Params attributes are encoded
14328 by creating an array at the point where the params starts and
14329 putting all those arguments there, then adjusting the size of the
14332 2003-05-05 Miguel de Icaza <miguel@ximian.com>
14334 * expression.cs (New.AddressOf): Implement interface
14335 IMemoryLocation. This is used when the `new' operator is used in
14336 the context of an invocation to a method on a value type.
14338 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
14341 * namespace.cs: Also check the using aliases here.
14343 * driver.cs: Move the test for using validity after the types have
14344 been entered, so we do a single pass that also includes the using
14347 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
14348 in the regular case. CreateSiblingForFinally is doing extra
14351 * attribute.cs (GetAttributeArgumentExpression): Store the result
14352 on an out value, and use the return value to indicate failure
14353 instead of using null (which is a valid return for Constant.GetValue).
14355 * statement.cs: Perform the analysis flow for the increment
14356 portion after the statement, because this will be the real flow of
14357 execution. Fixes #42385
14359 * codegen.cs (EmitContext.EmitArgument,
14360 EmitContext.EmitStoreArgument): New helper functions when the
14361 RemapToProxy flag is set.
14363 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
14366 Add support for remapping parameters.
14368 * iterators.cs: Propagate parameter values; Store parameter
14369 values in the proxy classes.
14371 2003-05-04 Miguel de Icaza <miguel@ximian.com>
14373 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
14374 need a proxy reference; I do not know what I was thinking
14376 * cs-parser.jay (constructor_initializer): catch another error,
14377 and display nice message.
14379 (field_declaration): catch void field declaration
14380 to flag a better error.
14382 * class.cs (MemberBase.CheckBase): Report an error instead of a
14383 warning if a new protected member is declared in a struct.
14384 (Field.Define): catch the error of readonly/volatile.
14386 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
14388 (FieldExpr.AddressOf): ditto. Catch error where the address of a
14389 volatile variable is taken
14391 2003-05-02 Miguel de Icaza <miguel@ximian.com>
14393 * statement.cs (Fixed.Resolve): Report an error if we are not in
14396 2003-05-01 Miguel de Icaza <miguel@ximian.com>
14398 * typemanager.cs: reuse the code that handles type clashes for
14399 delegates and enumerations.
14401 * class.cs (Report28): Always report.
14403 * expression.cs (EncodeAsAttribute): Allow nulls here.
14405 2003-04-28 Miguel de Icaza <miguel@ximian.com>
14407 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
14408 the functionality for testing whether an expression is valid for
14409 an attribute here. Also handle the case of arrays of elements
14412 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
14413 encoding a linear array into an array of objects that are suitable
14414 to be passed to an CustomAttributeBuilder.
14416 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
14418 * ecore.cs: (FieldExpr): Handle field remapping here.
14420 * iteratators.cs: Pass the instance variable (if the method is an
14421 instance method) to the constructors, so we can access the field
14422 variables on the class.
14424 TODO: Test this with structs. I think the THIS variable on
14425 structs might have to be a pointer, and not a refenrece
14427 2003-04-27 Miguel de Icaza <miguel@ximian.com>
14429 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
14430 local variables to fields in a proxy class.
14432 * iterators.cs (PopulateProxy): Rename our internal fields to
14434 Create a <THIS> field if we are an instance method, so we can
14435 reference our parent container variables.
14436 (MapVariable): Called back from the EmitContext code to enter a
14437 new variable to field mapping into the proxy class (we just create
14441 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
14442 for using the remapped locals to fields.
14444 I placed the code here, because that gives the same semantics to
14445 local variables, and only changes the Emit code.
14447 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
14448 statements inside iterators.
14449 (VariableInfo): Add a FieldBuilder for the cases when we are
14450 remapping local variables to fields in a proxy class
14452 * ecore.cs (SimpleNameResolve): Avoid testing two times for
14453 current_block != null.
14455 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
14456 not cope with strings, as it has been moved to the
14457 TableSwitchEmit. Fixed bug in switch generation.
14459 * expression.cs (New.DoResolve): Provide more context for the user
14460 when reporting an error.
14462 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
14465 * expression.cs (MemberAccess.DoResolve): When we get a type back,
14466 check the permissions for it. Note than in a type-resolution
14467 context the check was already present in DeclSpace.ResolveType,
14468 but was missing from the MemberAccess.
14470 (ArrayCreation.CheckIndices): warn if the user has
14471 more nested levels of expressions, but there are no more
14472 dimensions specified. Avoids crash on bug 41906.
14474 2003-04-26 Miguel de Icaza <miguel@ximian.com>
14476 * statement.cs (Block): replace Implicit bool, for a generic
14478 New flag: `Unchecked'. This is used during the EmitMeta phase
14479 (which is out-of-line with the regular Resolve/Emit process for a
14480 statement, as this is done ahead of time, but still gets a chance
14481 to call constant resolve).
14483 (Block.Flags): new enum for adding a new flag.
14485 (Block.EmitMeta): track the state of unchecked.
14487 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
14488 to enable constant resolution to work there as well.
14490 2003-04-22 Miguel de Icaza <miguel@ximian.com>
14492 * typemanager.cs (ienumerable_type): Also look up
14493 System.Collections.IEnumerable.
14495 2003-04-21 Miguel de Icaza <miguel@ximian.com>
14497 TODO: Test more than one conditional per method.
14499 * class.cs (Indexer.Define): Report the location where the user is
14500 referencing the unsupported feature.
14502 (MethodData): Overload the use of `conditionals' to
14503 minimize the creation of needless ArrayLists. This saves roughly
14504 212kb on my machine.
14506 (Method): Implement the new IIteratorContainer interface.
14507 (Method.SetYields): Implement the method by setting the ModFlags
14508 to contain METHOD_YIELDS.
14510 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
14511 which just got set to null.
14513 * iterators.cs: New file.
14515 (Yield, YieldBreak): New statements.
14517 * statement.cs (Return.Resolve): Flag an error if we are used in
14518 an iterator method.
14520 * codegen.cs (InIterator): New flag set if the code is being
14521 compiled in an iterator method.
14523 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
14524 internal modifier, and we just use it to avoid adding extra
14525 fields, as this is seldom used.
14527 * cs-parser.jay: Add yield_statement (yield and yield break).
14529 * driver.cs: New flag -v2 to turn on version 2 features.
14531 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
14532 hashtable when v2 is enabled.
14534 2003-04-20 Miguel de Icaza <miguel@ximian.com>
14536 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
14537 there is already a namespace defined with this name.
14539 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
14540 people upgraded their corlibs.
14542 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
14543 always use fully qualified types, no need to use the compiler
14546 (TypeManager.IsNamespace): Use binarysearch.
14548 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
14549 AddDelegate): I did not quite use the new IsValid API properly: I
14550 have to pass the short-name and the fullname. I was passing only
14551 the basename instead of the fullname sometimes.
14553 (TypeContainer.DefineType): call NamespaceClash.
14555 * interface.cs (Interface.DefineType): use NamespaceClash before
14558 * delegate.cs (Delegate.DefineType): use NamespaceClash before
14561 * enum.cs: (Enum.DefineType): use NamespaceClash before
14564 * typemanager.cs (: 3-line patch that gives us some tasty 11%
14565 speed increase. First, use the negative_hits cache when we get a
14566 negative. Second, add the type with its full original name
14567 instead of the new . and + encoded name (reflection uses + to
14568 separate type from a nested type). Use LookupTypeReflection
14569 directly which bypasses the type->name hashtable (that we already
14570 know does not contain the type.
14572 * decl.cs (DeclSpace.ResolveTypeExpr): track the
14573 location/container type.
14575 * driver.cs: When passing utf8, use directly the UTF8Encoding.
14577 2003-04-19 Miguel de Icaza <miguel@ximian.com>
14579 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
14581 * delegate.cs (NewDelegate.Resolve): Test whether an instance
14582 method is being referenced in the method group from a static
14583 context, and report error 120 if so.
14585 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
14588 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
14589 is created, we create the A namespace).
14591 * cs-parser.jay: A namespace also introduces a DeclarationFound.
14594 2003-04-18 Miguel de Icaza <miguel@ximian.com>
14596 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
14597 invocation to ModuleBuilder.GetType with the same values will
14598 return a new type instance, so we need to cache its return
14601 * expression.cs (Binary.ResolveOperator): Only allow the compare
14602 operators on enums if they are of the same type.
14604 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
14605 types of ValueType on their own case. Before we were giving them
14606 the same treatment as objects.
14608 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
14609 fullname. Short name is used to compare against container name.
14610 Fullname is used to check against defined namespace names.
14612 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
14613 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
14615 (Method.CheckBase): Call parent.
14616 (MemberBase.CheckBase): Check for protected members on sealed
14618 (PropertyBase.CheckBase): Call parent.
14619 (Field.Define): Call parent.
14621 * report.cs: Negative error codes are now mapped to 8000 - code,
14622 so that the display is render more nicely.
14624 * typemanager.cs: Do not use try/catch, instead report a regular
14627 (GetPointerType, GetReferenceType): These methods provide
14628 mechanisms to obtain the T* and T& from a T. We had the code
14629 previously scattered around the code base, and it also used
14630 TypeManager.LookupType that would go through plenty of caches.
14631 This one goes directly to the type source.
14633 In some places we did the Type.GetType followed by
14634 ModuleBuilder.GetType, but not in others, so this unifies the
14635 processing as well.
14637 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14638 statements now that we have namespace information.
14640 * typemanager.cs (IsNamespace): New method, returns whether the
14641 string presented is a namespace or not.
14643 (ComputeNamespaces): New public entry point, computes the list of
14644 available namespaces, using the GetNamespaces API call in Mono, or
14645 the slower version in MS.NET.
14647 Now before we start the semantic analysis phase, we have a
14648 complete list of namespaces including everything that the user has
14651 Deleted old code to cache namespaces in .nsc files.
14653 2003-04-17 Miguel de Icaza <miguel@ximian.com>
14655 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14656 class/struct location definition Location for the implicit
14657 constructor location.
14659 (Operator.Define): Use the location of the operator for the
14660 implicit Method definition.
14662 (Constructor.Emit): use the constructor location for the implicit
14663 base initializer constructor.
14665 * ecore.cs: Remove ITypeExpression. This interface is now gone,
14666 and the Expression class now contains two new methods:
14668 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
14669 isolate type lookup from the rest of the resolution process.
14671 Since we use Expressions to hold type definitions due to the way
14672 we parse the input we have historically overloaded Resolve to
14673 perform the Type lookups if a special flag is passed. Now this is
14674 eliminated and two methods take their place.
14676 The differences in the two methods between xStep and xTerminal is
14677 that xStep is involved in our current lookup system that uses
14678 SimpleNames to compose a name, while xTerminal is used just to
14679 catch the case where the simplename lookup failed.
14681 2003-04-16 Miguel de Icaza <miguel@ximian.com>
14683 * expression.cs (ResolveMemberAccess): Remove redundant code.
14684 TypeExpr expressions are always born fully resolved.
14686 * interface.cs (PopulateMethod): Do not lookup the types twice.
14687 We were doing it once during SemanticAnalysis and once during
14690 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
14691 in local variable type definitions, were being returned as a
14692 SimpleName (we decomposed everything into a string), that is
14693 because primary_expression was being used instead of a type in the
14694 grammar (reduce/reduce conflicts).
14696 The part that was wrong is that we converted the expression into a
14697 string (an oversimplification in one hand, compounded with primary
14698 expressions doing string concatenation).
14704 Would return "A.B.C[]" as a SimpleName. This stopped things like
14705 using clauses from working on this particular context. And a type
14706 was being matched directly against "A.B.C[]".
14708 We now use the correct approach, and allow for ComposedCast to be
14709 part of the unary expression. So the "A.B.C []" become a composed
14710 cast of "A.B.C" (as a nested group of MemberAccess with a
14711 SimpleName at the end) plus the rank composition "[]".
14715 2003-04-10 Miguel de Icaza <miguel@ximian.com>
14717 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
14718 for the access level checking.
14720 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
14721 `TypeContainer container', because I kept getting confused when I
14722 was debugging this code.
14724 * expression.cs (Indexers): Instead of tracking getters/setters,
14725 we now track them in parallel. We create one arraylist less, but
14726 most importantly it is possible now for the LValue code to find a
14727 matching get for a set.
14729 (IndexerAccess.DoResolveLValue): Update the code.
14730 GetIndexersForType has been modified already to extract all the
14731 indexers from a type. The code assumed it did not.
14733 Also make the code set the correct return type for the indexer.
14734 This was fixed a long time ago for properties, but was missing for
14735 indexers. It used to be void_type.
14737 (Binary.Emit): Test first for doubles instead of
14738 floats, as they are more common.
14740 (Binary.EmitBranchable): Use the .un version of the branch opcodes
14741 when dealing with floats and the <=, >= operators. This fixes bug
14744 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14745 to load the array value by emitting a load on the foreach variable
14746 type. This was incorrect.
14748 We now emit the code to load an element using the the array
14749 variable type, and then we emit the conversion operator.
14753 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
14755 * attribute.cs: Avoid allocation of ArrayLists in the common case.
14757 2003-04-09 Miguel de Icaza <miguel@ximian.com>
14759 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14760 test for protection before we test for signatures.
14762 (MethodSignature.ToString): implement.
14764 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14765 to the case where we reduced into a LongConstant.
14767 * decl.cs (CheckAccessLevel): If the type is an array, we can not
14768 depend on whether the information is acurrate, because the
14769 Microsoft runtime will always claim that the array type is public,
14770 regardless of the real state.
14772 If the type is a pointer, another problem happens: the type is
14773 reported as non-public in Microsoft.
14775 In both cases we have to call CheckAccessLevel recursively with
14776 the underlying type as the argument to be tested.
14778 2003-04-08 Miguel de Icaza <miguel@ximian.com>
14780 * assign.cs (Assign.Emit): If we are dealing with a compound
14781 assignment expression, we should use the code path that stores the
14782 intermediate result in a temporary value. This fixes #40903.
14784 *expression.cs (Indirection.ToString): Provide ToString method for
14787 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
14789 * class.cs: Null out fields holding references to Block objects so
14790 they can be garbage collected.
14792 * expression.cs (OverloadResolve): Remove unused local.
14794 2003-04-07 Martin Baulig <martin@ximian.com>
14796 * codegen.cs (EmitContext.CurrentFile): New public field.
14797 (EmitContext.Mark): Use the CurrentFile to check whether the
14798 location is in the correct file.
14799 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14801 2003-04-07 Martin Baulig <martin@ximian.com>
14803 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14805 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14806 location. [FIXME: The location argument which gets passed to this
14807 method is sometimes wrong!]
14809 2003-04-07 Nick Drochak <ndrochak@gol.com>
14811 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14813 2003-04-07 Miguel de Icaza <miguel@ximian.com>
14815 * expression.cs (Indirection.EmitAssign): We were using the
14816 temporary, but returning immediately instead of continuing the
14819 2003-04-06 Martin Baulig <martin@ximian.com>
14821 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14822 if it's a nested child, but also deriving from the outer class.
14825 * typemanager.cs (IsNestedChildOf): Make this work if it's a
14826 nested child, but also deriving from the outer class. See
14828 (FilterWithClosure): We may access private members of the outer
14829 class if we're a nested child and deriving from the outer class.
14830 (RealMemberLookup): Only set `closure_private_ok' if the
14831 `original_bf' contained BindingFlags.NonPublic.
14833 2003-04-05 Martin Baulig <martin@ximian.com>
14835 * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
14836 probe if its a type parameter, and if so, flag an error.
14838 * decl.cs: Move here the SetParameterInfo code from class.cs.
14839 Handle IsGeneric here.
14841 Handle a variety of errors in the parameter info definition.
14843 * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
14844 type parameters here.
14846 * cs-parser.jay (class_declaration): report errors for parameters
14849 2003-01-21 Miguel de Icaza <miguel@ximian.com>
14851 * generic.cs: New file, contains support code for generics.
14853 * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
14854 OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
14856 Update parser for the above removals.
14858 * cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
14859 now taken care of in the parser.
14861 2003-04-02 Miguel de Icaza <miguel@ximian.com>
14863 * class.cs (Event.Define): Do not allow abstract events to have
14866 2003-04-01 Miguel de Icaza <miguel@ximian.com>
14868 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14869 block in event declarations.
14871 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14872 value type, get its address.
14874 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14875 leaving a class on the stack instead of a boolean value (int
14876 0/1). Change the code so we compare against null, and then the
14877 result against zero.
14879 * class.cs (TypeContainer.GetClassBases): We were checking for the
14880 parent class being sealed too late.
14882 * expression.cs (Binary.Emit): For <= and >= when dealing with
14883 floating point values, use cgt.un and clt.un instead of cgt and
14886 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
14888 * statement.cs: Apply the same optimization as MS: skip the
14889 GetEnumerator returning an IEnumerator, and use the one returning a
14890 CharEnumerator instead. This allows us to avoid the try-finally block
14893 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
14895 * cs-parser.jay: Attributes cannot be applied to
14896 namespaces. Fixes #40473
14898 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14901 (Add*): check if the name is valid using the full name for constants,
14902 fields, properties and events.
14904 2003-03-28 Miguel de Icaza <miguel@ximian.com>
14906 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
14907 char constants to be part of the enumeration.
14909 * expression.cs (Conditional.DoResolve): Add support for operator
14910 true. Implements the missing functionality from 14.12
14912 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
14913 operator true/false as required by the spec.
14915 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
14916 implicit conversion to boolean.
14918 * statement.cs (Statement.ResolveBoolean): A boolean expression is
14919 also one where the type implements `operator true'.
14921 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
14922 get an expression that will invoke operator true based on an
14925 (GetConversionOperators): Removed the hack that called op_True
14928 (Expression.ResolveBoolean): Move this from Statement.
14930 2003-03-17 Miguel de Icaza <miguel@ximian.com>
14932 * ecore.cs (FieldExpr): do not allow initialization of initonly
14933 fields on derived classes
14935 2003-03-13 Martin Baulig <martin@ximian.com>
14937 * statement.cs (Block.Emit): Call ig.BeginScope() and
14938 ig.EndScope() when compiling with debugging info; call
14939 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14941 2003-03-08 Miguel de Icaza <miguel@ximian.com>
14943 * expression.cs (Indexers): Do not construct immediately, allow
14944 for new members to be appended as we go. Fixes 38143
14946 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14948 * expression.cs: save/restore context when resolving an unchecked
14951 2003-03-05 Miguel de Icaza <miguel@ximian.com>
14953 * cfold.cs: Catch division by zero in modulus operator during
14956 2003-03-03 Miguel de Icaza <miguel@ximian.com>
14958 * interface.cs (Interface.DefineMembers): Avoid defining members
14961 2003-02-27 Miguel de Icaza <miguel@ximian.com>
14963 * driver.cs: handle the +/- options for -noconfig
14965 * statement.cs (Unckeched.Resolve): Also track the state of
14966 unchecked in the Resolve phase.
14968 2003-02-27 Martin Baulig <martin@ximian.com>
14970 * ecore.cs (Expression.MemberLookup): Don't create a
14971 MethodGroupExpr for something which is not a method. Fixes #38291.
14973 2003-02-25 Miguel de Icaza <miguel@ximian.com>
14975 * class.cs (MemberBase.CheckParameters): Also check that the type
14976 is unmanaged if it is a pointer.
14978 * expression.cs (SizeOf.Resolve): Add location information.
14980 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14981 a managed type is declared.
14983 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14984 parameter modifiers as well. Fixes bug 38606
14986 * class.cs: Very sad. Am backing out the speed up changes
14987 introduced by the ArrayList -> Array in the TypeContainer, as they
14988 were not actually that much faster, and introduced a bug (no error
14989 reports on duplicated methods).
14991 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14992 source first, this will guarantee that we have a valid expression
14993 before calling in lower levels functions that will require a
14994 resolved object. Then use this original_source in the
14995 target.ResolveLValue instead of the original source that was
14998 Another change. Use target.Resolve instead of LValueResolve.
14999 Although we are resolving for LValues, we will let the Assign code
15000 take care of that (it will be called again from Resolve). This
15001 basically allows code like this:
15003 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
15004 class Y { void A (X x) { x [0] += o; }
15006 The problem was that the indexer was trying to resolve for
15007 set_Item (idx, object o) and never finding one. The real set_Item
15008 was set_Item (idx, X). By delaying the process we get the right
15013 2003-02-23 Martin Baulig <martin@ximian.com>
15015 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
15016 while calling DoEmit ().
15018 * codegen.cs (EmitContext.Mark): Don't mark locations in other
15019 source files; if you use the #line directive inside a method, the
15020 compiler stops emitting line numbers for the debugger until it
15021 reaches the end of the method or another #line directive which
15022 restores the original file.
15024 2003-02-23 Martin Baulig <martin@ximian.com>
15026 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
15028 2003-02-23 Martin Baulig <martin@ximian.com>
15030 * statement.cs (Block.AddChildVariableNames): We need to call this
15031 recursively, not just for our immediate children.
15033 2003-02-23 Martin Baulig <martin@ximian.com>
15035 * class.cs (Event.Define): Always make the field private, like csc does.
15037 * typemanager.cs (TypeManager.RealMemberLookup): Make events
15038 actually work, fixes bug #37521.
15040 2003-02-23 Miguel de Icaza <miguel@ximian.com>
15042 * delegate.cs: When creating the various temporary "Parameters"
15043 classes, make sure that we call the ComputeAndDefineParameterTypes
15044 on those new parameters (just like we do with the formal ones), to
15045 allow them to be resolved in the context of the DeclSpace.
15047 This fixes the bug that Dick observed in Bugzilla #38530.
15049 2003-02-22 Miguel de Icaza <miguel@ximian.com>
15051 * expression.cs (ResolveMemberAccess): When resolving a constant,
15052 do not attempt to pull a constant if the value was not able to
15053 generate a valid constant.
15055 * const.cs (LookupConstantValue): Do not report more errors than required.
15057 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15059 * expression.cs: fixes bug #38328.
15061 2003-02-18 Miguel de Icaza <miguel@ximian.com>
15063 * class.cs: Changed all the various members that can be part of a
15064 class from being an ArrayList to be an Array of the right type.
15065 During the DefineType type_list, interface_list, delegate_list and
15066 enum_list are turned into types, interfaces, delegates and enums
15069 And during the member population, indexer_list, event_list,
15070 constant_list, field_list, instance_constructor_list, method_list,
15071 operator_list and property_list are turned into their real arrays.
15073 Although we could probably perform this operation earlier, for
15074 good error reporting we need to keep the lists and remove the
15075 lists for longer than required.
15077 This optimization was triggered by Paolo profiling the compiler
15078 speed on the output of `gen-sample-program.pl' perl script.
15080 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
15081 not crash in methods like MemberLookupFailed that use this field.
15083 This problem arises when the compiler fails to resolve a type
15084 during interface type definition for example.
15086 2003-02-18 Miguel de Icaza <miguel@ximian.com>
15088 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
15089 inherit from System.Object, so we have to stop at null, not only
15090 when reaching System.Object.
15092 2003-02-17 Miguel de Icaza <miguel@ximian.com>
15094 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
15095 DeclaredOnly because the parent indexer might have had a different
15096 name, but did not loop until the top of the hierarchy was reached.
15098 The problem this one fixes is 35492: when a class implemented an
15099 indexer from an interface, we were getting the interface method
15100 (which was abstract) and we were flagging an error (can not invoke
15103 This also keeps bug 33089 functioning, and test-148 functioning.
15105 * typemanager.cs (IsSpecialMethod): The correct way of figuring
15106 out if a method is special is to see if it is declared in a
15107 property or event, or whether it is one of the predefined operator
15108 names. This should fix correctly #36804.
15110 2003-02-15 Miguel de Icaza <miguel@ximian.com>
15112 The goal here is to remove the dependency on EmptyCast.Peel ().
15113 Killing it completely.
15115 The problem is that currently in a number of places where
15116 constants are expected, we have to "probe" for an EmptyCast, and
15117 Peel, which is not the correct thing to do, as this will be
15118 repetitive and will likely lead to errors.
15120 The idea is to remove any EmptyCasts that are used in casts that
15121 can be reduced to constants, so we only have to cope with
15124 This bug hunt was triggered by Bug 37363 and the desire to remove
15125 the duplicate pattern where we were "peeling" emptycasts to check
15126 whether they were constants. Now constants will always be
15129 * ecore.cs: Use an enumconstant here instead of wrapping with
15132 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
15133 throwing me off. By handling this we can get rid of a few hacks.
15135 * statement.cs (Switch): Removed Peel() code.
15137 2003-02-14 Miguel de Icaza <miguel@ximian.com>
15139 * class.cs: Location information for error 508
15141 * expression.cs (New.DoResolve): Add a guard against double
15142 resolution of an expression.
15144 The New DoResolve might be called twice when initializing field
15145 expressions (see EmitFieldInitializers, the call to
15146 GetInitializerExpression will perform a resolve on the expression,
15147 and later the assign will trigger another resolution
15149 This leads to bugs (#37014)
15151 * delegate.cs: The signature for EndInvoke should contain any ref
15152 or out parameters as well. We were not doing this in the past.
15154 * class.cs (Field.Define): Do not overwrite the type definition
15155 inside the `volatile' group. Turns out that volatile enumerations
15156 were changing the type here to perform a validity test, which
15159 2003-02-12 Miguel de Icaza <miguel@ximian.com>
15161 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
15162 and structs, we do not want to load the instance variable
15164 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
15165 enum_type has to be handled like an object reference (implicit
15166 conversions exists from this to object), but the regular IsClass
15167 and IsValueType tests will never return true for this one.
15169 Also we use TypeManager.IsValueType instead of type.IsValueType,
15170 just for consistency with the rest of the code (this is only
15171 needed if we ever use the construct exposed by test-180.cs inside
15172 corlib, which we dont today).
15174 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
15176 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
15179 2003-02-09 Martin Baulig <martin@ximian.com>
15181 * namespace.cs (Namespace..ctor): Added SourceFile argument.
15182 (Namespace.DefineNamespaces): New static public method; this is
15183 called when we're compiling with debugging to add all namespaces
15184 to the symbol file.
15186 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
15187 pass it to the Namespace's .ctor.
15189 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
15190 and MethodBase arguments; pass the namespace ID to the symwriter;
15191 pass the MethodBase instead of the token to the symwriter.
15192 (SymbolWriter.DefineNamespace): New method to add a namespace to
15195 2003-02-09 Martin Baulig <martin@ximian.com>
15197 * symbolwriter.cs: New file. This is a wrapper around
15198 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
15199 methods here in near future.
15201 2003-02-09 Martin Baulig <martin@ximian.com>
15203 * codegen.cs (EmitContext.Mark): Just pass the arguments to
15204 ILGenerator.MarkSequencePoint() which are actually used by the
15207 2003-02-09 Martin Baulig <martin@ximian.com>
15209 * location.cs (SourceFile): New public sealed class. This
15210 contains the name and an index which is used in the location's token.
15211 (Location): Reserve an appropriate number of bits in the token for
15212 the source file instead of walking over that list, this gives us a
15213 really huge performance improvement when compiling with debugging.
15215 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
15216 `SourceFile' argument instead of a string.
15217 (Driver.ProcessFile): Add all the files via Location.AddFile(),
15218 but don't parse/tokenize here, we need to generate the list of all
15219 source files before we do that.
15220 (Driver.ProcessFiles): New static function. Parses/tokenizes all
15223 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
15224 instead of a string.
15226 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
15229 2003-02-09 Martin Baulig <martin@ximian.com>
15231 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
15232 filename on `#line default'.
15234 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
15236 * statement.cs: don't clear the pinned var when the fixed statement
15237 returns from the method (fixes bug#37752).
15239 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
15241 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
15244 2003-02-07 Martin Baulig <martin@ximian.com>
15246 * driver.cs: Removed the `--debug-args' command line argument.
15248 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
15249 automatically by the AsssemblyBuilder.
15250 (CodeGen.InitializeSymbolWriter): We don't need to call any
15251 initialization function on the symbol writer anymore. This method
15252 doesn't take any arguments.
15254 2003-02-03 Miguel de Icaza <miguel@ximian.com>
15256 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
15257 from referenced assemblies as well.
15259 2003-02-02 Martin Baulig <martin@ximian.com>
15261 * class.cs (MethodData.Emit): Generate debugging info for external methods.
15263 2003-02-02 Martin Baulig <martin@ximian.com>
15265 * class.cs (Constructor.Emit): Open the symbol writer before
15266 emitting the constructor initializer.
15267 (ConstructorInitializer.Emit): Call ec.Mark() to allow
15268 single-stepping through constructor initializers.
15270 2003-01-30 Miguel de Icaza <miguel@ximian.com>
15272 * class.cs: Handle error 549: do not allow virtual methods in
15275 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
15277 * decl.cs: Check access levels when resolving types
15279 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
15281 * statement.cs: Add parameters and locals set in catch blocks that might
15282 return to set vector
15284 2003-01-29 Miguel de Icaza <miguel@ximian.com>
15286 * class.cs (Operator): Set the SpecialName flags for operators.
15288 * expression.cs (Invocation.DoResolve): Only block calls to
15289 accessors and operators on SpecialName methods.
15291 (Cast.TryReduce): Handle conversions from char constants.
15294 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
15296 * statement.cs: small memory and time optimization in FlowBranching.
15298 2003-01-28 Pedro Mart <yoros@wanadoo.es>
15300 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
15301 problem that the last fix but in the other sid (Set).
15303 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
15304 access when there is no indexer in the hierarchy.
15306 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
15308 * class.cs: Combine some if statements.
15310 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15312 * driver.cs: fixed bug #37187.
15314 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
15316 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
15317 any indexer, it's needed to build a list with all the indexers in the
15318 hierarchy (AllGetters), else we have problems. Fixes #35653.
15320 2003-01-23 Miguel de Icaza <miguel@ximian.com>
15322 * class.cs (MethodData.Define): It is wrong for an interface
15323 implementation to be static in both cases: explicit and implicit.
15324 We were only handling this in one case.
15326 Improve the if situation there to not have negations.
15328 * class.cs (Field.Define): Turns out that we do not need to check
15329 the unsafe bit on field definition, only on usage. Remove the test.
15331 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15333 * driver.cs: use assembly.Location instead of Codebase (the latest
15334 patch made mcs fail when using MS assemblies).
15336 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
15338 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
15339 get the path to *corlib.dll.
15341 2003-01-21 Nick Drochak <ndrochak@gol.com>
15345 * typemanager.cs: Remove compiler warnings
15347 2003-01-20 Duncan Mak <duncan@ximian.com>
15349 * AssemblyInfo.cs: Bump the version number to 0.19.
15351 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15353 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
15355 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
15357 * class.cs (Constructor::Emit): Emit debugging info for constructors.
15359 2003-01-17 Miguel de Icaza <miguel@ximian.com>
15361 * cs-parser.jay: Small fix: we were not comparing the constructor
15362 name correctly. Thanks to Zoltan for the initial pointer.
15364 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
15366 * cs-tokenizer.cs: Set file name when specified with #line
15368 2003-01-15 Miguel de Icaza <miguel@ximian.com>
15370 * cs-parser.jay: Only perform the constructor checks here if we
15371 are named like the class; This will help provider a better
15372 error. The constructor path is taken when a type definition is
15373 not found, but most likely the user forgot to add the type, so
15374 report that rather than the constructor error.
15376 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
15378 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
15381 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15383 * cs-parser.jay: Add cleanup call.
15385 2003-01-13 Duncan Mak <duncan@ximian.com>
15387 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
15388 consistent with other methods.
15390 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15392 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
15394 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
15396 * attribute.cs: only set GuidAttr to true when we have a
15399 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15403 * typemanager.cs: fixes to allow mcs compile corlib with the new
15404 Type.IsSubclassOf fix.
15406 2003-01-08 Miguel de Icaza <miguel@ximian.com>
15408 * expression.cs (LocalVariableReference.DoResolve): Classify a
15409 constant as a value, not as a variable. Also, set the type for
15412 * cs-parser.jay (fixed_statement): take a type instead of a
15413 pointer_type, so we can produce a better error message later.
15415 * statement.cs (Fixed.Resolve): Flag types that are not pointers
15418 (For.DoEmit): Make inifinite loops have a
15419 non-conditional branch back.
15421 (Fixed.DoEmit): First populate the pinned variables, then emit the
15422 statement, then clear the variables. Before I was emitting the
15423 code once for each fixed piece.
15426 2003-01-08 Martin Baulig <martin@ximian.com>
15428 * statement.cs (FlowBranching.MergeChild): A break in a
15429 SWITCH_SECTION does not leave a loop. Fixes #36155.
15431 2003-01-08 Martin Baulig <martin@ximian.com>
15433 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
15434 lives in the same number space than `param_map'. Fixes #36154.
15436 2003-01-07 Miguel de Icaza <miguel@ximian.com>
15438 * cs-parser.jay (constructor_declaration): Set the
15439 Constructor.ModFlags before probing for it. This makes the
15440 compiler report 514, 515 and 132 (the code was there, but got
15443 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
15444 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
15445 (GotoCase.Resolve): Set `Returns' to ALWAYS.
15447 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
15449 * enum.cs: create the enum static fields using the enum type.
15451 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
15453 * class.cs: don't try to create the ParamBuilder for the return
15454 type if it's not needed (and handle it breaking for the ms runtime
15457 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
15459 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
15461 2002-12-29 Miguel de Icaza <miguel@ximian.com>
15463 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
15464 the command. This showed up while compiling the JANET source
15465 code, which used \r as its only newline separator.
15467 2002-12-28 Miguel de Icaza <miguel@ximian.com>
15469 * class.cs (Method.Define): If we are an operator (because it
15470 reuses our code), then set the SpecialName and HideBySig. #36128
15472 2002-12-22 Miguel de Icaza <miguel@ximian.com>
15474 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
15475 exception, report error 120 `object reference required'.
15477 * driver.cs: Add --pause option, used during to measure the size
15478 of the process as it goes with --timestamp.
15480 * expression.cs (Invocation.DoResolve): Do not allow methods with
15481 SpecialName to be invoked.
15483 2002-12-21 Miguel de Icaza <miguel@ximian.com>
15485 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
15486 number before adding it.
15488 2002-12-21 Ravi Pratap <ravi@ximian.com>
15490 * ecore.cs (StandardImplicitConversion): When in an unsafe
15491 context, we allow conversion between void * to any other pointer
15492 type. This fixes bug #35973.
15494 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
15496 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
15497 is not thrown when extensionless outputs are used
15499 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15501 * rootcontext.cs: fixed compilation of corlib.
15503 2002-12-19 Miguel de Icaza <miguel@ximian.com>
15505 * attribute.cs (Attributes.Contains): Add new method.
15507 * class.cs (MethodCore.LabelParameters): if the parameter is an
15508 `out' parameter, check that no attribute `[In]' has been passed.
15510 * enum.cs: Handle the `value__' name in an enumeration.
15512 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
15514 * decl.cs: Added special case to allow overrides on "protected
15517 2002-12-18 Ravi Pratap <ravi@ximian.com>
15519 * attribute.cs (Attributes.AddAttributeSection): Rename to this
15520 since it makes much more sense.
15522 (Attributes.ctor): Don't require a Location parameter.
15524 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
15526 * attribute.cs (ApplyAttributes): Remove extra Location parameters
15527 since we already have that information per attribute.
15529 * everywhere : make appropriate changes.
15531 * class.cs (LabelParameters): Write the code which actually
15532 applies attributes to the return type. We can't do this on the MS
15533 .NET runtime so we flag a warning in the case an exception is
15536 2002-12-18 Miguel de Icaza <miguel@ximian.com>
15538 * const.cs: Handle implicit null conversions here too.
15540 2002-12-17 Ravi Pratap <ravi@ximian.com>
15542 * class.cs (MethodCore.LabelParameters): Remove the extra
15543 Type [] parameter since it is completely unnecessary. Instead
15544 pass in the method's attributes so that we can extract
15545 the "return" attribute.
15547 2002-12-17 Miguel de Icaza <miguel@ximian.com>
15549 * cs-parser.jay (parse): Use Report.Error to flag errors instead
15550 of ignoring it and letting the compile continue.
15552 * typemanager.cs (ChangeType): use an extra argument to return an
15553 error condition instead of throwing an exception.
15555 2002-12-15 Miguel de Icaza <miguel@ximian.com>
15557 * expression.cs (Unary.TryReduce): mimic the code for the regular
15558 code path. Perform an implicit cast in the cases where we can
15559 implicitly convert to one of the integral types, and then reduce
15560 based on that constant. This fixes bug #35483.
15562 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15564 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
15566 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15568 * namespace.cs: fixed bug #35489.
15570 2002-12-12 Miguel de Icaza <miguel@ximian.com>
15572 * class.cs: Remove some dead code.
15574 * cs-parser.jay: Estimate the number of methods needed
15575 (RootContext.MethodCount);
15577 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
15578 numbers instead of StringBuilders.
15580 * support.cs (PtrHashtable): Add constructor with initial size;
15581 We can now reduce reallocations of the method table.
15583 2002-12-10 Ravi Pratap <ravi@ximian.com>
15585 * attribute.cs (ApplyAttributes): Keep track of the emitted
15586 attributes on a per-target basis. This fixes bug #35413.
15588 2002-12-10 Miguel de Icaza <miguel@ximian.com>
15590 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
15591 default to the Windows 1252 encoding.
15593 (UnixParseOption): Support version, thanks to Alp for the missing
15596 * AssemblyInfo.cs: Add nice assembly information.
15598 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
15601 * cs-parser.jay: Allow a trailing comma before the close bracked
15602 in the attribute_section production.
15604 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
15605 address of the instance was being taken, I will take this out,
15606 because we take the address of the object immediately here.
15608 2002-12-09 Ravi Pratap <ravi@ximian.com>
15610 * typemanager.cs (AreMultipleAllowed): Take care of the most
15611 obvious case where attribute type is not in the current assembly -
15614 2002-12-08 Miguel de Icaza <miguel@ximian.com>
15616 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
15617 definitions, instead of doing that afterwards.
15619 Also we use a nice little hack, depending on the constructor, we
15620 know if we are a "composed" name or a simple name. Hence, we
15621 avoid the IndexOf test, and we avoid
15623 * codegen.cs: Add code to assist in a bug reporter to track down
15624 the source of a compiler crash.
15626 2002-12-07 Ravi Pratap <ravi@ximian.com>
15628 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
15629 types have been emitted for a given element and flag an error
15630 if something which does not have AllowMultiple set is used more
15633 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15634 attribute types and their corresponding AllowMultiple properties
15636 (AreMultipleAllowed): Check the property for a given type.
15638 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15639 property in the case we have a TypeContainer.
15641 (Attributes.AddAttribute): Detect duplicates and just skip on
15642 adding them. This trivial fix catches a pretty gross error in our
15643 attribute emission - global attributes were being emitted twice!
15645 Bugzilla bug #33187 is now fixed.
15647 2002-12-06 Miguel de Icaza <miguel@ximian.com>
15649 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15650 instead of pp_and).
15652 * expression.cs (Binary.ResolveOperator): I can only use the
15653 Concat (string, string, string) and Concat (string, string,
15654 string, string) if the child is actually a concatenation of
15657 2002-12-04 Miguel de Icaza <miguel@ximian.com>
15659 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15660 context where we need a 2-character lookahead.
15662 * pending.cs (PendingImplementation): Rework so we can keep track
15663 of interface types all the time, and flag those which were
15664 implemented by parents as optional.
15666 2002-12-03 Miguel de Icaza <miguel@ximian.com>
15668 * expression.cs (Binary.ResolveOperator): Use
15669 String.Concat(string,string,string) or
15670 String.Concat(string,string,string,string) when possible.
15672 * typemanager: More helper methods.
15675 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15677 * pending.cs: remove the bogus return from GetMissingInterfaces()
15678 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15680 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15682 * namespace.cs: avoid duplicated 'using xxx' being added to
15683 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15684 when we get more than one 'using' statement for the same namespace.
15685 Report a CS0105 warning for it.
15687 2002-11-30 Miguel de Icaza <miguel@ximian.com>
15689 * cs-tokenizer.cs (consume_identifier): use read directly, instead
15690 of calling getChar/putback, uses internal knowledge of it.
15692 (xtoken): Reorder tokenizer so most common patterns are checked
15693 first. This reduces the compilation time in another 5% (from 8.11s
15694 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15696 The parsing time is 22% of the compilation in mcs, and from that
15697 64% is spent on the tokenization process.
15699 I tried using a binary search for keywords, but this is slower
15700 than the hashtable. Another option would be to do a couple of
15703 * Not use a StringBuilder, instead use an array of chars,
15704 with a set value. Notice that this way we could catch
15705 the 645 error without having to do it *afterwards*.
15707 * We could write a hand-parser to avoid the hashtable
15708 compares altogether.
15710 The identifier consumption process takes 37% of the tokenization
15711 time. Another 15% is spent on is_number. 56% of the time spent
15712 on is_number is spent on Int64.Parse:
15714 * We could probably choose based on the string length to
15715 use Int32.Parse or Int64.Parse and avoid all the 64-bit
15718 Another 3% is spend on wrapping `xtoken' in the `token' function.
15720 Handle 0xa0 as whitespace (#34752)
15722 2002-11-26 Miguel de Icaza <miguel@ximian.com>
15724 * typemanager.cs (IsCLRType): New routine to tell whether a type
15725 is one of the builtin types.
15727 Maybe it needs to use TypeCodes to be faster. Maybe we could use
15728 typecode in more places instead of doing pointer comparissions.
15729 We could leverage some knowledge about the way the typecodes are
15732 New code to cache namespaces in assemblies, it is currently not
15733 invoked, to be used soon.
15735 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
15737 * expression.cs (Binary.ResolveOperator): specially handle
15738 strings, and do not perform user-defined operator overloading for
15741 2002-11-24 Miguel de Icaza <miguel@ximian.com>
15743 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15744 internalcall as it is a pretty simple operation; Avoid whenever
15745 possible to call Char.IsLetter.
15747 (consume_identifier): Cut by half the number of
15748 hashtable calls by merging the is_keyword and GetKeyword behavior.
15750 Do not short-circuit, because if we do, we
15751 report errors (ie, #if false && true would produce an invalid
15755 2002-11-24 Martin Baulig <martin@ximian.com>
15757 * expression.cs (Cast.TryReduce): If we're in checked syntax,
15758 check constant ranges and report a CS0221. Fixes #33186.
15760 2002-11-24 Martin Baulig <martin@ximian.com>
15762 * cs-parser.jay: Make this work for uninitialized variable
15763 declarations in the `for' initializer. Fixes #32416.
15765 2002-11-24 Martin Baulig <martin@ximian.com>
15767 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15768 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
15770 2002-11-24 Martin Baulig <martin@ximian.com>
15772 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15773 argument; if true, we also check for user-defined conversions.
15774 This is only needed if both arguments are of a user-defined type.
15775 Fixes #30443, added test-175.cs.
15776 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15778 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15780 2002-11-24 Martin Baulig <martin@ximian.com>
15782 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15783 function to get the store opcode.
15784 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15785 only emit the Ldelema if the store opcode is Stobj. You must run
15786 both test-34 and test-167 to test this. Fixes #34529.
15788 2002-11-23 Martin Baulig <martin@ximian.com>
15790 * ecore.cs (Expression.MemberLookup): Added additional
15791 `qualifier_type' argument which is used when we're being called
15792 from MemberAccess.DoResolve() and null if we're called from a
15794 (Expression.MemberLookupFailed): New method to report errors; this
15795 does the CS1540 check and reports the correct error message.
15797 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15798 argument for the CS1540 check and redone the way how we're dealing
15799 with private members. See the comment in the source code for details.
15800 (FilterWithClosure): Reverted this back to revision 1.197; renamed
15801 `closure_start_type' to `closure_qualifier_type' and check whether
15802 it's not null. It was not this filter being broken, it was just
15803 being called with the wrong arguments.
15805 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15806 and pass it the correct `qualifier_type'; this also does the error
15809 2002-11-22 Miguel de Icaza <miguel@ximian.com>
15811 * expression.cs (Invocation.EmitParams): If the we are dealing
15812 with a non-built-in value type, load its address as well.
15814 (ArrayCreation): Use a a pretty constant instead
15815 of the hardcoded value 2. Use 6 instead of 2 for the number of
15816 static initializers.
15818 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15819 because they are not really value types, just glorified integers.
15821 * driver.cs: Do not append .exe, the CSC compiler does not do it.
15823 * ecore.cs: Remove redundant code for enumerations, make them use
15824 the same code path as everything else, fixes the casting issue
15825 with enumerations in Windows.Forms.
15827 * attribute.cs: Do only cast to string if it is a string, the
15828 validation happens later.
15830 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15831 people upgrade their corlibs.
15833 * ecore.cs: Oops, enumerations were not following the entire code path
15835 2002-11-21 Miguel de Icaza <miguel@ximian.com>
15837 * typemanager.cs (FilterWithClosure): Commented out the test for
15838 1540 in typemanager.cs, as it has problems when accessing
15839 protected methods from a parent class (see test-174.cs).
15841 * attribute.cs (Attribute.ValidateGuid): new method.
15842 (Attribute.Resolve): Use above.
15844 2002-11-19 Miguel de Icaza <miguel@ximian.com>
15846 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15848 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15849 handling for enumerations, as we only needed the TypeContainer
15850 functionality to begin with (this is required for the fix below to
15851 work for enums that reference constants in a container class for
15854 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15856 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15857 a valid TypeBuilder to perform lookups on.o
15859 * class.cs (InheritableMemberSignatureCompare): Use true in the
15860 call to GetGetMethod and GetSetMethod, because we are comparing
15861 the signature, and we need to get the methods *even* if they are
15864 (PropertyBase.CheckBase): ditto.
15866 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15867 GotoCase.Resolve): Use Peel on EmpytCasts.
15869 * ecore.cs (EmptyCast): drop child, add Peel method.
15871 2002-11-17 Martin Baulig <martin@ximian.com>
15873 * ecore.cs (EmptyCast.Child): New public property.
15875 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15876 label resolved to an EmptyCast. Fixes #34162.
15877 (GotoCase.Resolve): Likewise.
15878 (Block.EmitMeta): Likewise.
15880 2002-11-17 Martin Baulig <martin@ximian.com>
15882 * expression.cs (Invocation.BetterConversion): Prefer int over
15883 uint; short over ushort; long over ulong for integer literals.
15884 Use ImplicitConversionExists instead of StandardConversionExists
15885 since we also need to check for user-defined implicit conversions.
15886 Fixes #34165. Added test-173.cs.
15888 2002-11-16 Martin Baulig <martin@ximian.com>
15890 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15891 with the `true' and `false' literals. Fixes #33151.
15893 2002-11-16 Martin Baulig <martin@ximian.com>
15895 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
15896 October 22nd; don't do the cs1540 check for static members.
15898 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
15899 now using our own filter here and doing the cs1540 check again.
15901 2002-11-16 Martin Baulig <martin@ximian.com>
15903 * support.cs (InternalParameters): Don't crash if we don't have
15904 any fixed parameters. Fixes #33532.
15906 2002-11-16 Martin Baulig <martin@ximian.com>
15908 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
15909 when looking up static methods to make this work on Windows.
15912 2002-11-16 Martin Baulig <martin@ximian.com>
15914 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
15915 a setter rather than using PropertyInfo.CanWrite.
15917 2002-11-15 Nick Drochak <ndrochak@gol.com>
15919 * class.cs: Allow acces to block member by subclasses. Fixes build
15922 2002-11-14 Martin Baulig <martin@ximian.com>
15924 * class.cs (Constructor.Emit): Added the extern/block check.
15927 2002-11-14 Martin Baulig <martin@ximian.com>
15929 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15930 iteration while looking for indexers, this is needed because the
15931 indexer may have a different name in our base classes. Fixed the
15932 error reporting (no indexers at all, not get accessor, no
15933 overloaded match). Fixes bug #33089.
15934 (IndexerAccess.DoResolveLValue): Likewise.
15936 2002-11-14 Martin Baulig <martin@ximian.com>
15938 * class.cs (PropertyBase.CheckBase): Make this work for multiple
15939 indexers. Fixes the first part of bug #33089.
15940 (MethodSignature.InheritableMemberSignatureCompare): Added support
15943 2002-11-13 Ravi Pratap <ravi@ximian.com>
15945 * attribute.cs (Attribute.Resolve): Catch the
15946 NullReferenceException and report it since it isn't supposed to
15949 2002-11-12 Miguel de Icaza <miguel@ximian.com>
15951 * expression.cs (Binary.EmitBranchable): Also handle the cases for
15952 LogicalOr and LogicalAnd that can benefit from recursively
15953 handling EmitBranchable. The code now should be nice for Paolo.
15955 2002-11-08 Miguel de Icaza <miguel@ximian.com>
15957 * typemanager.cs (LookupType): Added a negative-hit hashtable for
15958 the Type lookups, as we perform quite a number of lookups on
15959 non-Types. This can be removed once we can deterministically tell
15960 whether we have a type or a namespace in advance.
15962 But this might require special hacks from our corlib.
15966 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15967 and double which avoids a conversion from an integer to a double.
15969 * expression.cs: tiny optimization, avoid calling IsConstant,
15970 because it effectively performs the lookup twice.
15972 2002-11-06 Miguel de Icaza <miguel@ximian.com>
15974 But a bogus return here to keep the semantics of the old code
15975 until the Mono runtime is fixed.
15977 * pending.cs (GetMissingInterfaces): New method used to remove all
15978 the interfaces that are already implemented by our parent
15979 classes from the list of pending methods.
15981 * interface.cs: Add checks for calls after ResolveTypeExpr.
15983 2002-11-05 Miguel de Icaza <miguel@ximian.com>
15985 * class.cs (Class.Emit): Report warning 67: event not used if the
15986 warning level is beyond 3.
15988 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15989 being a NullLiteral.
15991 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15994 * class.cs (TypeContainer.GetClassBases): Cover a missing code
15995 path that might fail if a type can not be resolved.
15997 * expression.cs (Binary.Emit): Emit unsigned versions of the
16000 * driver.cs: use error 5.
16002 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
16004 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
16006 2002-11-01 Miguel de Icaza <miguel@ximian.com>
16008 * cs-parser.jay (switch_section): A beautiful patch from Martin
16009 Baulig that fixed 33094.
16011 2002-10-31 Miguel de Icaza <miguel@ximian.com>
16013 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
16014 Check whether the base is abstract and report an error if so.
16016 * expression.cs (IndexerAccess.DoResolveLValue,
16017 IndexerAccess.DoResolve): ditto.
16019 (Invocation.DoResolve): ditto.
16021 (Invocation.FullMethodDesc): Improve the report string.
16023 * statement.cs (Block): Eliminate IsVariableDefined as it is
16024 basically just a wrapper for GetVariableInfo.
16026 * ecore.cs (SimpleName): Use new
16028 * support.cs (ReflectionParamter.ParameterType): We unwrap the
16029 type, as we return the actual parameter ref/unref state on a
16032 2002-10-30 Miguel de Icaza <miguel@ximian.com>
16034 * support.cs: Return proper flags REF/OUT fixing the previous
16037 * expression.cs: Reverted last patch, that was wrong. Is_ref is
16038 not used to mean `ref' but `ref or out' in ParameterReference
16040 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
16041 full type signature instead of calling TypeManger.CSharpName
16044 * support.cs (InternalParameters.ParameterDesc): Do not compare
16045 directly to the modflags, because REF/OUT will actually be bitsets
16048 * delegate.cs (VerifyMethod): Check also the modifiers.
16050 * cs-tokenizer.cs: Fix bug where floating point values with an
16051 exponent where a sign was missing was ignored.
16053 * driver.cs: Allow multiple assemblies to be specified in a single
16056 2002-10-28 Miguel de Icaza <miguel@ximian.com>
16058 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
16059 because identifiers after a parenthesis would end up in this kind
16060 of production, and we needed to desamiguate it for having casts
16063 (UserDefinedType *) xxx
16065 2002-10-24 Miguel de Icaza <miguel@ximian.com>
16067 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
16068 we should set on the Bindingflags.NonPublic, but not turn on
16069 private_ok. private_ok controls whether a Private member is
16070 returned (this is chekced on the filter routine), while the
16071 BindingFlags.NonPublic just controls whether private/protected
16072 will be allowed. This fixes the problem part of the problem of
16073 private properties being allowed to be used in derived classes.
16075 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
16076 so we can call the children DoResolveLValue method (this will
16077 properly signal errors on lvalue assignments to base properties)
16079 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
16080 getter are null, and we have a property info, we know that this
16081 happened because the lookup failed, so we report an error 122 for
16082 protection level violation.
16084 We also silently return if setter and getter are null in the
16085 resolve functions, this condition only happens if we have flagged
16086 the error before. This is the other half of the problem.
16088 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
16089 not have accessibility information, that is why we were returning
16090 true in the filter function in typemanager.cs.
16092 To properly report 122 (property is inaccessible because of its
16093 protection level) correctly, we report this error in ResolveAccess
16094 by failing if both the setter and the getter are lacking (ie, the
16097 DoResolve and DoLResolve have been modified to check for both
16098 setter/getter being null and returning silently, the reason being
16099 that I did not want to put the knowledge about this error in upper
16102 int old = Report.Errors;
16103 x = new PropertyExpr (...);
16104 if (old != Report.Errors)
16109 So the property expr is returned, but it is invalid, so the error
16110 will be flagged during the resolve process.
16112 * class.cs: Remove InheritablePropertySignatureCompare from the
16113 class, as we no longer depend on the property signature to compute
16114 whether it is possible to implement a method or not.
16116 The reason is that calling PropertyInfo.GetGetMethod will return
16117 null (in .NET, in Mono it works, and we should change this), in
16118 cases where the Get Method does not exist in that particular
16123 class X { public virtual int A { get { return 1; } } }
16125 class Z : Y { public override int A { get { return 2; } } }
16127 Would fail in Z because the parent (Y) would not have the property
16128 defined. So we avoid this completely now (because the alternative
16129 fix was ugly and slow), and we now depend exclusively on the
16132 (PropertyBase.CheckBase): Use a method-base mechanism to find our
16133 reference method, instead of using the property.
16135 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
16136 routines are gone now.
16138 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
16139 names, they were incorrectly named.
16141 * cs-tokenizer.cs: Return are more gentle token on failure.
16143 * pending.cs (PendingImplementation.InterfaceMethod): This routine
16144 had an out-of-sync index variable, which caused it to remove from
16145 the list of pending methods the wrong method sometimes.
16147 2002-10-22 Miguel de Icaza <miguel@ximian.com>
16149 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
16150 CanWrite, because those refer to this particular instance of the
16151 property, and do not take into account the fact that we can
16152 override single members of a property.
16154 Constructor requires an EmitContext. The resolution process does
16155 not happen here, but we need to compute the accessors before,
16156 because the resolution does not always happen for properties.
16158 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
16159 subclass, before we did not update this flag, but we did update
16162 (GetAccessors): Drop this routine, as it did not work in the
16163 presence of partially overwritten set/get methods.
16165 Notice that this broke the cs1540 detection, but that will require
16168 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16172 * driver.cs: issue a warning instead of an error if we don't support
16173 debugging for the platform. Also ignore a couple of errors that may
16174 arise when trying to write the symbols. Undo my previous patch.
16176 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16178 * driver.cs: ignore /debug switch except for Unix platforms.
16180 2002-10-23 Nick Drochak <ndrochak@gol.com>
16182 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
16184 2002-10-21 Miguel de Icaza <miguel@ximian.com>
16186 * driver.cs: Do not make mcs-debug conditional, so we do not break
16187 builds that use it.
16189 * statement.cs (UsageVector.MergeChildren): I would like Martin to
16190 review this patch. But basically after all the children variables
16191 have been merged, the value of "Breaks" was not being set to
16192 new_breaks for Switch blocks. I think that it should be set after
16193 it has executed. Currently I set this to the value of new_breaks,
16194 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
16195 conservative, but I do not understand this code very well.
16197 I did not break anything in the build, so that is good ;-)
16199 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
16201 2002-10-20 Mark Crichton <crichton@gimp.org>
16203 * cfold.cs: Fixed compile blocker. Really fixed it this time.
16205 2002-10-20 Nick Drochak <ndrochak@gol.com>
16207 * cfold.cs: Fixed compile blocker.
16209 2002-10-20 Miguel de Icaza <miguel@ximian.com>
16211 * driver.cs: I was chekcing the key, not the file.
16213 2002-10-19 Ravi Pratap <ravi@ximian.com>
16215 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
16216 message that we were generating - we just need to silently return
16219 2002-10-19 Miguel de Icaza <miguel@ximian.com>
16221 * class.cs (Event.Define): Change my previous commit, as this
16222 breaks the debugger. This is a temporary hack, as it seems like
16223 the compiler is generating events incorrectly to begin with.
16225 * expression.cs (Binary.ResolveOperator): Added support for
16226 "U operator - (E x, E y)"
16228 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
16231 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
16232 init-only variables, but this path did not take into account that
16233 there might be also instance readonly variables. Correct this
16236 This fixes bug 32253
16238 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
16241 * driver.cs: Change the extension for modules to `netmodule'
16243 * cs-parser.jay: Improved slightly the location tracking for
16244 the debugger symbols.
16246 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
16247 modifiers that were specified instead of the hardcoded value
16248 (FamAndAssem). This was basically ignoring the static modifier,
16249 and others. Fixes 32429.
16251 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
16252 fixed a bug in the process (32476)
16254 * expression.cs (ArrayAccess.EmitAssign): Patch from
16255 hwang_rob@yahoo.ca that fixes bug 31834.3
16257 2002-10-18 Miguel de Icaza <miguel@ximian.com>
16259 * driver.cs: Make the module extension .netmodule.
16261 2002-10-16 Miguel de Icaza <miguel@ximian.com>
16263 * driver.cs: Report an error if the resource file is not found
16264 instead of crashing.
16266 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
16267 false, like Emit does.
16269 2002-10-16 Nick Drochak <ndrochak@gol.com>
16271 * typemanager.cs: Remove unused private member. Also reported mcs
16272 bug to report this as a warning like csc.
16274 2002-10-15 Martin Baulig <martin@gnome.org>
16276 * statement.cs (Statement.Emit): Made this a virtual method; emits
16277 the line number info and calls DoEmit().
16278 (Statement.DoEmit): New protected abstract method, formerly knows
16279 as Statement.Emit().
16281 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
16283 2002-10-11 Miguel de Icaza <miguel@ximian.com>
16285 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
16286 have fixed a remaining problem: not every AddXXXX was adding a
16287 fully qualified name.
16289 Now everyone registers a fully qualified name in the DeclSpace as
16290 being defined instead of the partial name.
16292 Downsides: we are slower than we need to be due to the excess
16293 copies and the names being registered this way.
16295 The reason for this is that we currently depend (on the corlib
16296 bootstrap for instance) that types are fully qualified, because
16297 we dump all the types in the namespace, and we should really have
16298 types inserted into the proper namespace, so we can only store the
16299 basenames in the defined_names array.
16301 2002-10-10 Martin Baulig <martin@gnome.org>
16303 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
16304 from bug #31834, see the bug report for a testcase which is
16307 2002-10-10 Martin Baulig <martin@gnome.org>
16309 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
16310 flow analysis code for this.
16312 * statement.cs (Do, While, For): Tell the flow analysis code about
16314 (FlowBranching.UsageVector): Added support for infinite loops.
16315 (Block.Resolve): Moved the dead code elimination here and use flow
16318 2002-10-09 Miguel de Icaza <miguel@ximian.com>
16320 * class.cs (Field.Define): Catch cycles on struct type
16323 * typemanager.cs (IsUnmanagedtype): Do not recursively check
16324 fields if the fields are static. We only need to check instance
16327 * expression.cs (As.DoResolve): Test for reference type.
16329 * statement.cs (Using.ResolveExpression): Use
16330 ConvertImplicitRequired, not ConvertImplicit which reports an
16332 (Using.ResolveLocalVariableDecls): ditto.
16334 * expression.cs (Binary.ResolveOperator): Report errors in a few
16335 places where we had to.
16337 * typemanager.cs (IsUnmanagedtype): Finish implementation.
16339 2002-10-08 Miguel de Icaza <miguel@ximian.com>
16341 * expression.cs: Use StoreFromPtr instead of extracting the type
16342 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
16344 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
16345 an enumeration value to a System.Enum, but System.Enum is not a
16346 value type, but an class type, so we need to box.
16348 (Expression.ConvertExplicit): One codepath could return
16349 errors but not flag them. Fix this. Fixes #31853
16351 * parameter.cs (Resolve): Do not allow void as a parameter type.
16353 2002-10-06 Martin Baulig <martin@gnome.org>
16355 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
16356 if it's a class type and not a struct. Fixes #31815.
16358 2002-10-06 Martin Baulig <martin@gnome.org>
16360 * statement.cs: Reworked the flow analysis code a bit to make it
16361 usable for dead code elimination.
16363 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16365 * cs-parser.jay: allow empty source files. Fixes bug #31781.
16367 2002-10-04 Miguel de Icaza <miguel@ximian.com>
16369 * expression.cs (ComposedCast.DoResolveType): A quick workaround
16370 to fix the test 165, will investigate deeper.
16372 2002-10-04 Martin Baulig <martin@gnome.org>
16374 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
16375 finally blocks actually work.
16376 (Try.Resolve): We don't need to create a sibling for `finally' if
16377 there is no finally block.
16379 2002-10-04 Martin Baulig <martin@gnome.org>
16381 * class.cs (Constructor.Define): The default accessibility for a
16382 non-default constructor is private, not public.
16384 2002-10-04 Miguel de Icaza <miguel@ximian.com>
16386 * class.cs (Constructor): Make AllowedModifiers public, add
16389 * cs-parser.jay: Perform the modifiers test here, as the
16390 constructor for the Constructor class usually receives a zero
16391 because of the way we create it (first we create, later we
16392 customize, and we were never checking the modifiers).
16394 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
16395 is a version of LookupTypeReflection that includes the type-name
16396 cache. This can be used as a fast path for functions that know
16397 the fully qualified name and are only calling into *.GetType() to
16398 obtain a composed type.
16400 This is also used by TypeManager.LookupType during its type
16403 (LookupType): We now also track the real type name, as sometimes
16404 we can get a quey for the real type name from things like
16405 ComposedCast. This fixes bug 31422.
16407 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
16408 complete type fullname, it does not have to go through the type
16409 resolution system to obtain the composed version of the type (for
16410 obtaining arrays or pointers).
16412 (Conditional.Emit): Use the EmitBoolExpression to
16413 generate nicer code, as requested by Paolo.
16415 (ArrayCreation.CheckIndices): Use the patch from
16416 hwang_rob@yahoo.ca to validate the array initializers.
16418 2002-10-03 Miguel de Icaza <miguel@ximian.com>
16420 * class.cs (ConstructorInitializer.Emit): simplify code by using
16421 Invocation.EmitCall, and at the same time, fix the bugs in calling
16422 parent constructors that took variable arguments.
16424 * ecore.cs (Expression.ConvertNumericExplicit,
16425 Expression.ImplicitNumericConversion): Remove the code that
16426 manually wrapped decimal (InternalTypeConstructor call is now gone
16429 * expression.cs (Cast.TryReduce): Also handle decimal types when
16430 trying to perform a constant fold on the type.
16432 * typemanager.cs (IsUnmanagedtype): Partially implemented.
16434 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
16435 that only turned off an error report, and did nothing else.
16437 2002-10-02 Miguel de Icaza <miguel@ximian.com>
16439 * driver.cs: Handle and ignore /fullpaths
16441 2002-10-01 Miguel de Icaza <miguel@ximian.com>
16443 * expression.cs (Binary.ResolveOperator): Catch the case where
16444 DoNumericPromotions returns true,
16446 (Binary.DoNumericPromotions): Simplify the code, and the tests.
16448 2002-09-27 Miguel de Icaza <miguel@ximian.com>
16450 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
16453 2002-09-26 Miguel de Icaza <miguel@ximian.com>
16455 * ecore.cs (ConvertNumericExplicit): It is not enough that the
16456 conversion exists, but it is also required that the conversion be
16457 performed. This manifested in "(Type64Enum) 2".
16459 * class.cs (TypeManager.AddMethod): The fix is not to change
16460 AddEnum, because that one was using a fully qualified name (every
16461 DeclSpace derivative does), but to change the AddMethod routine
16462 that was using an un-namespaced name. This now correctly reports
16463 the duplicated name.
16465 Revert patch until I can properly fix it. The issue
16466 is that we have a shared Type space across all namespaces
16467 currently, which is wrong.
16469 Options include making the Namespace a DeclSpace, and merge
16470 current_namespace/current_container in the parser.
16472 2002-09-25 Miguel de Icaza <miguel@ximian.com>
16474 * cs-parser.jay: Improve error reporting when we get a different
16475 kind of expression in local_variable_type and
16476 local_variable_pointer_type.
16478 Propagate this to avoid missleading errors being reported.
16480 * ecore.cs (ImplicitReferenceConversion): treat
16481 TypeManager.value_type as a target just like object_type. As
16486 Is valid, and needs to result in the int 1 being boxed before it
16487 is assigned to the value type v.
16489 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
16490 to validate the enumeration name.
16492 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
16493 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
16494 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
16496 * ecore.cs (TryImplicitIntConversion): When doing an
16497 implicit-enumeration-conversion, check if the type is 64-bits and
16498 perform a conversion before passing to EnumConstant.
16500 2002-09-23 Miguel de Icaza <miguel@ximian.com>
16502 * decl.cs (Error_AmbiguousTypeReference); New routine used to
16503 report ambiguous type references. Unlike the MS version, we
16504 report what the ambiguity is. Innovation at work ;-)
16506 (DeclSpace.FindType): Require a location argument to
16507 display when we display an ambiguous error.
16509 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
16511 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
16513 * expression.cs (EmitDynamicInitializers): Apply patch from
16514 hwang_rob@yahoo.ca that fixes the order in which we emit our
16517 2002-09-21 Martin Baulig <martin@gnome.org>
16519 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
16520 delegate takes no arguments.
16522 2002-09-20 Miguel de Icaza <miguel@ximian.com>
16524 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
16527 * expression.cs: Extract the underlying type.
16529 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
16531 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
16533 2002-09-19 Miguel de Icaza <miguel@ximian.com>
16535 * class.cs (TypeContainer.DefineType): We can not use the nice
16536 PackingSize with the size set to 1 DefineType method, because it
16537 will not allow us to define the interfaces that the struct
16540 This completes the fixing of bug 27287
16542 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
16543 means also structs. This fixes part of the problem.
16544 (Expresion.ImplicitReferenceConversionExists): ditto.
16546 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
16547 error if there were no errors reported during the type lookup
16548 process, to avoid duplicates or redundant errors. Without this
16549 you would get an ambiguous errors plus a type not found. We have
16550 beaten the user enough with the first error.
16552 (DeclSparce.FindType): Emit a warning if we have an ambiguous
16555 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
16556 during the resolution process, stop the lookup, this avoids
16557 repeated error reports (same error twice).
16559 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
16561 * typemanager.cs (LookupType): Redo the type lookup code to match
16562 the needs of System.Reflection.
16564 The issue is that System.Reflection requires references to nested
16565 types to begin with a "+" sign instead of a dot. So toplevel
16566 types look like: "NameSpace.TopLevelClass", and nested ones look
16567 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
16570 2002-09-19 Martin Baulig <martin@gnome.org>
16572 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
16573 says that a method always returns or always throws an exception,
16574 don't report the CS0161.
16576 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
16577 set `Returns = new_returns'.
16579 2002-09-19 Martin Baulig <martin@gnome.org>
16581 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
16582 to an enum constant, check for a CS0176.
16584 2002-09-18 Miguel de Icaza <miguel@ximian.com>
16586 * class.cs (TypeContainer.CheckPairedOperators): Now we check
16587 for operators that must be in pairs and report errors.
16589 * ecore.cs (SimpleName.DoResolveType): During the initial type
16590 resolution process, when we define types recursively, we must
16591 check first for types in our current scope before we perform
16592 lookups in the enclosing scopes.
16594 * expression.cs (MakeByteBlob): Handle Decimal blobs.
16596 (Invocation.VerifyArgumentsCompat): Call
16597 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
16598 I thought we were supposed to always call this, but there are a
16599 few places in the code where we dont do it.
16601 2002-09-17 Miguel de Icaza <miguel@ximian.com>
16603 * driver.cs: Add support in -linkres and -resource to specify the
16604 name of the identifier.
16606 2002-09-16 Miguel de Icaza <miguel@ximian.com>
16608 * ecore.cs (StandardConversionExists): Sync with the conversion
16609 code: allow anything-* to void* conversions.
16611 (FindMostSpecificSource): Use an Expression argument
16612 instead of a Type, because we might be handed over a Literal which
16613 gets a few more implicit conversions that plain types do not. So
16614 this information was being lost.
16616 Also, we drop the temporary type-holder expression when not
16619 2002-09-17 Martin Baulig <martin@gnome.org>
16621 * class.cs (PropertyBase.CheckBase): Don't check the base class if
16622 this is an explicit interface implementation.
16624 2002-09-17 Martin Baulig <martin@gnome.org>
16626 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
16627 different `IndexerName' attributes.
16629 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
16630 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
16631 virtual CommonResolve().
16633 2002-09-16 Miguel de Icaza <miguel@ximian.com>
16635 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16636 and convert that to the UnderlyingType.
16638 * statement.cs (Foreach.Resolve): Indexers are just like variables
16639 or PropertyAccesses.
16641 * cs-tokenizer.cs (consume_string): Track line numbers and columns
16642 inside quoted strings, we were not doing this before.
16644 2002-09-16 Martin Baulig <martin@gnome.org>
16646 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16647 resolve it. This is needed for the definite assignment check of the
16648 instance expression, fixes bug #29846.
16649 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16651 2002-09-16 Nick Drochak <ndrochak@gol.com>
16653 * parameter.cs: Fix compile error. Cannot reference static member
16654 from an instance object. Is this an mcs bug?
16656 2002-09-14 Martin Baulig <martin@gnome.org>
16658 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16659 multiple times. Fixes bug #30295, added test-166.cs.
16661 2002-09-14 Martin Baulig <martin@gnome.org>
16663 * statement.cs (Block.Emit): Don't emit unreachable code.
16664 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16665 `break' statements.
16666 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16668 2002-09-14 Martin Baulig <martin@gnome.org>
16670 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16673 2002-09-14 Martin Baulig <martin@gnome.org>
16675 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16676 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16677 be false on the ms runtime.
16679 2002-09-13 Martin Baulig <martin@gnome.org>
16681 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16682 the CS0038 error message.
16684 2002-09-12 Miguel de Icaza <miguel@ximian.com>
16686 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16687 constant inside, return it.
16689 2002-09-12 Martin Baulig <martin@gnome.org>
16691 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16692 implicit conversion can be done between enum types.
16694 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16695 check whether an implicit conversion to the current enum's UnderlyingType
16696 exists and report an error if not.
16698 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16699 without debugging support.
16701 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16702 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
16704 2002-09-12 Martin Baulig <martin@gnome.org>
16706 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16708 * ecore.cs (IMemberExpr.DeclaringType): New property.
16709 (SimpleName.SimpleNameResolve): Check whether we're accessing a
16710 nonstatic member of an outer type (CS0038).
16712 2002-09-11 Miguel de Icaza <miguel@ximian.com>
16714 * driver.cs: Activate the using-error detector at warning level
16715 4 (at least for MS-compatible APIs).
16717 * namespace.cs (VerifyUsing): Small buglett fix.
16719 * pending.cs (PendingImplementation): pass the container pointer.
16721 * interface.cs (GetMethods): Allow for recursive definition. Long
16722 term, I would like to move every type to support recursive
16723 definitions, not the current ordering mechanism that we have right
16726 The situation is this: Attributes are handled before interfaces,
16727 so we can apply attributes to interfaces. But some attributes
16728 implement interfaces, we will now handle the simple cases
16729 (recursive definitions will just get an error).
16731 * parameter.cs: Only invalidate types at the end if we fail to
16734 2002-09-09 Martin Baulig <martin@gnome.org>
16736 * ecore.cs (PropertyExpr.Emit): Also check for
16737 TypeManager.system_int_array_get_length so this'll also work when
16738 compiling corlib. Fixes #30003.
16740 2002-09-09 Martin Baulig <martin@gnome.org>
16742 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16743 and throw an exception if we can't get the type's size. Fixed #30040,
16746 2002-09-09 Martin Baulig <martin@gnome.org>
16748 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16750 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16751 context. Fixes bug #30027.
16753 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16754 virtual functions. Fixes bug #30043, added test-164.cs.
16756 2002-09-08 Ravi Pratap <ravi@ximian.com>
16758 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16760 2002-09-08 Nick Drochak <ndrochak@gol.com>
16762 * driver.cs: Use an object to get the windows codepage since it's not a
16765 2002-09-08 Miguel de Icaza <miguel@ximian.com>
16767 * statement.cs (For.Emit): for infinite loops (test == null)
16768 return whether there is a break inside, not always "true".
16770 * namespace.cs (UsingEntry): New struct to hold the name of the
16771 using definition, the location where it is defined, and whether it
16772 has been used in a successful type lookup.
16774 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16779 2002-09-06 Ravi Pratap <ravi@ximian.com>
16781 * attribute.cs : Fix incorrect code which relied on catching
16782 a NullReferenceException to detect a null being passed in
16783 where an object was expected.
16785 2002-09-06 Miguel de Icaza <miguel@ximian.com>
16787 * statement.cs (Try): flag the catch variable as assigned
16789 * expression.cs (Cast): Simplified by using ResolveType instead of
16790 manually resolving.
16792 * statement.cs (Catch): Fix bug by using ResolveType.
16794 2002-09-06 Ravi Pratap <ravi@ximian.com>
16796 * expression.cs (BetterConversion): Special case for when we have
16797 a NullLiteral as the argument and we have to choose between string
16798 and object types - we choose string the way csc does.
16800 * attribute.cs (Attribute.Resolve): Catch the
16801 NullReferenceException and report error #182 since the Mono
16802 runtime no more has the bug and having this exception raised means
16803 we tried to select a constructor which takes an object and is
16806 2002-09-05 Ravi Pratap <ravi@ximian.com>
16808 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16809 message (1502, 1503) when we can't locate a method after overload
16810 resolution. This is much more informative and closes the bug
16813 * interface.cs (PopulateMethod): Return if there are no argument
16814 types. Fixes a NullReferenceException bug.
16816 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16817 expressions too. Previously we were checking only in one place for
16818 positional arguments leaving out named arguments.
16820 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16821 type to the enum type is not allowed. Remove code corresponding to
16824 (ConvertNumericExplicit): Allow explicit conversions from
16825 the underlying type to enum type. This precisely follows the spec
16826 and closes a bug filed by Gonzalo.
16828 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16831 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16833 2002-09-03 Miguel de Icaza <miguel@ximian.com>
16835 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16836 it was important that we stored the right value after the
16837 reduction in `converted'.
16839 2002-09-04 Martin Baulig <martin@gnome.org>
16841 * location.cs (Location.SymbolDocument): Use full pathnames for the
16844 2002-08-30 Miguel de Icaza <miguel@ximian.com>
16846 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16847 of the expression resolve mechanism, because that will catch the
16848 SimpleName error failures.
16850 (Conditional): If we can not resolve the
16851 expression, return, do not crash.
16853 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16856 (location): display token name instead of its number.
16858 2002-08-28 Martin Baulig <martin@gnome.org>
16860 * expression.cs (Binary.ResolveOperator): Don't silently return
16861 but return an error if an operator cannot be applied between two
16864 2002-08-28 Martin Baulig <martin@gnome.org>
16866 * class.cs (Constructor.Define): Set the permission attributes
16867 correctly instead of making all constructors public.
16869 2002-08-28 Martin Baulig <martin@gnome.org>
16871 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16872 for private members before reporting a CS0103; if we find anything,
16875 2002-08-28 Martin Baulig <martin@gnome.org>
16877 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16878 to check whether `closure_start_type == closure_invocation_type',
16879 we also need to check whether `m.DeclaringType == closure_invocation_type'
16880 before bypassing the permission checks. We might be accessing
16881 protected/private members from the base class.
16882 (TypeManager.RealMemberLookup): Only set private_ok if private
16883 members were requested via BindingFlags.NonPublic.
16885 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16887 * expression.cs (MemberAccess.ResolveMemberAccess): Set
16888 MethodGroupExpr.IsExplicitImpl if appropriate.
16889 (Invocation.DoResolve): Don't report the CS0120 for explicit
16890 interface implementations.
16892 2002-08-27 Martin Baulig <martin@gnome.org>
16894 * expression.cs (Invocation.DoResolve): If this is a static
16895 method and we don't have an InstanceExpression, we must report
16898 2002-08-25 Martin Baulig <martin@gnome.org>
16900 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
16901 `==' between a valuetype and an object.
16903 2002-08-25 Miguel de Icaza <miguel@ximian.com>
16905 * ecore.cs (TypeExpr): Provide a ToString method.
16907 2002-08-24 Martin Baulig <martin@gnome.org>
16909 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
16910 now called proggie.dbg and it's a binary file.
16912 2002-08-23 Martin Baulig <martin@gnome.org>
16914 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
16916 2002-08-23 Martin Baulig <martin@gnome.org>
16918 * struct.cs (MyStructInfo.ctor): Make this work with empty
16919 structs; it's not allowed to use foreach() on null.
16921 2002-08-23 Martin Baulig <martin@gnome.org>
16923 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
16924 writer the full pathname of the generated assembly.
16926 2002-08-23 Martin Baulig <martin@gnome.org>
16928 * statements.cs (FlowBranching.UsageVector.MergeChildren):
16929 A `finally' block never returns or breaks; improved handling of
16932 2002-08-23 Martin Baulig <martin@gnome.org>
16934 * statement.cs (Throw.Resolve): Allow `throw null'.
16936 2002-08-23 Martin Baulig <martin@gnome.org>
16938 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16939 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16940 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
16941 MemberLookup would return a wrong event if this is an explicit
16942 interface implementation and the class has an event with the same
16945 2002-08-23 Martin Baulig <martin@gnome.org>
16947 * statement.cs (Block.AddChildVariableNames): New public method.
16948 (Block.AddChildVariableName): Likewise.
16949 (Block.IsVariableNameUsedInChildBlock): Likewise.
16950 (Block.AddVariable): Check whether a variable name has already
16951 been used in a child block.
16953 * cs-parser.jay (declare_local_variables): Mark all variable names
16954 from the current block as being used in a child block in the
16957 2002-08-23 Martin Baulig <martin@gnome.org>
16959 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16960 find the symbol writer.
16962 * driver.cs: csc also allows the arguments to /define being
16963 separated by commas, not only by semicolons.
16965 2002-08-23 Martin Baulig <martin@gnome.org>
16967 * interface.cs (Interface.GetMembers): Added static check for events.
16969 2002-08-15 Martin Baulig <martin@gnome.org>
16971 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16972 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16974 * ecore.cs (Expression.MemberLookup): Added documentation and explained
16975 why the MethodData.EmitDestructor() change was necessary.
16977 2002-08-20 Martin Baulig <martin@gnome.org>
16979 * class.cs (TypeContainer.FindMembers): Added static check for events.
16981 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16983 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16984 use Type.GetEvents(), not Type.FindMembers().
16986 2002-08-20 Martin Baulig <martin@gnome.org>
16988 * decl.cs (MemberCache): Added a special method cache which will
16989 be used for method-only searched. This ensures that a method
16990 search will return a MethodInfo with the correct ReflectedType for
16993 2002-08-20 Martin Baulig <martin@gnome.org>
16995 * decl.cs (DeclSpace.FindMembers): Made this public.
16997 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16999 * delegate.cs: fixed build on windows.
17000 [FIXME: Filed as bug #29150: MCS must report these errors.]
17002 2002-08-19 Ravi Pratap <ravi@ximian.com>
17004 * ecore.cs (StandardConversionExists): Return a false
17005 if we are trying to convert the void type to anything else
17006 since that is not allowed.
17008 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
17009 we flag error 70 in the event an event is trying to be accessed
17010 directly from outside the declaring type.
17012 2002-08-20 Martin Baulig <martin@gnome.org>
17014 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
17015 MemberCache from typemanager.cs to decl.cs.
17017 2002-08-19 Martin Baulig <martin@gnome.org>
17019 * class.cs (TypeContainer): Implement IMemberContainer.
17020 (TypeContainer.DefineMembers): Create the MemberCache.
17021 (TypeContainer.FindMembers): Do better BindingFlags checking; only
17022 return public members if BindingFlags.Public was given, check
17023 whether members are static.
17025 2002-08-16 Martin Baulig <martin@gnome.org>
17027 * decl.cs (DeclSpace.Define): Splitted this in Define and
17028 DefineMembers. DefineMembers is called first and initializes the
17031 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
17032 DefineMembers() on all our DeclSpaces.
17034 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
17035 but call DefineMembers() on all nested interfaces. We call their
17036 Define() in our new Define() function.
17038 * interface.cs (Interface): Implement IMemberContainer.
17039 (Interface.Define): Moved all code except the attribute stuf to
17041 (Interface.DefineMembers): Initialize the member cache.
17043 * typemanager.cs (IMemberFinder): Removed this interface, we don't
17044 need this anymore since we can use MemberCache.FindMembers directly.
17046 2002-08-19 Martin Baulig <martin@gnome.org>
17048 * typemanager.cs (MemberCache): When creating the cache for an
17049 interface type, add all inherited members.
17050 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
17051 to `out bool used_cache' and documented it.
17052 (TypeManager.MemberLookup): If we already used the cache in the first
17053 iteration, we don't need to do the interfaces check.
17055 2002-08-19 Martin Baulig <martin@gnome.org>
17057 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
17058 here from IMemberFinder and don't implement this interface anymore.
17059 (DeclSpace.MemberCache): Moved here from IMemberFinder.
17061 * typemanager.cs (IMemberFinder): This interface is now only used by
17062 classes which actually support the member cache.
17063 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
17064 since we only put DeclSpaces into this Hashtable.
17065 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
17066 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
17068 2002-08-16 Martin Baulig <martin@gnome.org>
17070 * typemanager.cs (ICachingMemberFinder): Removed.
17071 (IMemberFinder.MemberCache): New property.
17072 (TypeManager.FindMembers): Merged this with RealFindMembers().
17073 This function will never be called from TypeManager.MemberLookup()
17074 so we can't use the cache here, just the IMemberFinder.
17075 (TypeManager.MemberLookup_FindMembers): Check whether the
17076 IMemberFinder has a MemberCache and call the cache's FindMembers
17078 (MemberCache): Rewrote larger parts of this yet another time and
17079 cleaned it up a bit.
17081 2002-08-15 Miguel de Icaza <miguel@ximian.com>
17083 * driver.cs (LoadArgs): Support quoting.
17085 (Usage): Show the CSC-like command line arguments.
17087 Improved a few error messages.
17089 2002-08-15 Martin Baulig <martin@gnome.org>
17091 * typemanager.cs (IMemberContainer.Type): New property.
17092 (IMemberContainer.IsInterface): New property.
17094 The following changes are conditional to BROKEN_RUNTIME, which is
17095 defined at the top of the file.
17097 * typemanager.cs (MemberCache.MemberCache): Don't add the base
17098 class'es members, but add all members from TypeHandle.ObjectType
17099 if we're an interface.
17100 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
17101 is the current type.
17102 (MemberCache.CacheEntry.Container): Removed this field.
17103 (TypeHandle.GetMembers): Include inherited members.
17105 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17107 * typemanager.cs: fixed compilation and added a comment on a field that
17110 2002-08-15 Martin Baulig <martin@gnome.org>
17112 * class.cs (ConstructorInitializer.Resolve): In the
17113 Expression.MemberLookup call, use the queried_type as
17116 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
17117 declared' attribute, it's always true.
17118 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
17119 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
17120 temporary wrapper for FindMembers which tells MemberLookup whether
17121 members from the base classes are included in the return value.
17122 This will go away soon.
17123 (TypeManager.MemberLookup): Use this temporary hack here; once the
17124 new MemberCache is completed, we don't need to do the DeclaredOnly
17125 looping here anymore since the MemberCache will take care of this.
17126 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
17127 (MemberCache): When creating the MemberCache for a class, get
17128 members from the current class and all its base classes.
17129 (MemberCache.CacheEntry.Container): New field. This is a
17130 temporary hack until the Mono runtime is fixed to distinguish
17131 between ReflectedType and DeclaringType. It allows us to use MCS
17132 with both the MS runtime and the unfixed Mono runtime without
17133 problems and without accecting performance.
17134 (MemberCache.SearchMembers): The DeclaredOnly looping from
17135 TypeManager.MemberLookup is now done here.
17137 2002-08-14 Martin Baulig <martin@gnome.org>
17139 * statement.cs (MyStructInfo.MyStructInfo): Don't call
17140 Type.GetFields on dynamic types but get the fields from the
17141 corresponding TypeContainer.
17142 (MyStructInfo.GetStructInfo): Added check for enum types.
17144 * typemanager.cs (MemberList.IsSynchronized): Implemented.
17145 (MemberList.SyncRoot): Implemented.
17146 (TypeManager.FilterWithClosure): No need to check permissions if
17147 closure_start_type == closure_invocation_type, don't crash if
17148 closure_invocation_type is null.
17150 2002-08-13 Martin Baulig <martin@gnome.org>
17152 Rewrote TypeContainer.FindMembers to use a member cache. This
17153 gives us a speed increase of about 35% for the self-hosting MCS
17154 build and of about 15-20% for the class libs (both on GNU/Linux).
17156 * report.cs (Timer): New class to get enhanced profiling. This
17157 whole class is "TIMER" conditional since it remarkably slows down
17160 * class.cs (MemberList): New class. This is an IList wrapper
17161 which we're now using instead of passing MemberInfo[]'s around to
17162 avoid copying this array unnecessarily.
17163 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
17164 (ICachingMemberFinder, IMemberContainer): New interface.
17165 (TypeManager.FilterWithClosure): If `criteria' is null, the name
17166 has already been checked, otherwise use it for the name comparision.
17167 (TypeManager.FindMembers): Renamed to RealMemberFinder and
17168 provided wrapper which tries to use ICachingMemberFinder.FindMembers
17169 if possible. Returns a MemberList, not a MemberInfo [].
17170 (TypeHandle): New class, implements IMemberContainer. We create
17171 one instance of this class per type, it contains a MemberCache
17172 which is used to do the member lookups.
17173 (MemberCache): New class. Each instance of this class contains
17174 all members of a type and a name-based hash table.
17175 (MemberCache.FindMembers): This is our new member lookup
17176 function. First, it looks up all members of the requested name in
17177 the hash table. Then, it walks this list and sorts out all
17178 applicable members and returns them.
17180 2002-08-13 Martin Baulig <martin@gnome.org>
17182 In addition to a nice code cleanup, this gives us a performance
17183 increase of about 1.4% on GNU/Linux - not much, but it's already
17184 half a second for the self-hosting MCS compilation.
17186 * typemanager.cs (IMemberFinder): New interface. It is used by
17187 TypeManager.FindMembers to call FindMembers on a TypeContainer,
17188 Enum, Delegate or Interface.
17189 (TypeManager.finder_to_member_finder): New PtrHashtable.
17190 (TypeManager.finder_to_container): Removed.
17191 (TypeManager.finder_to_delegate): Removed.
17192 (TypeManager.finder_to_interface): Removed.
17193 (TypeManager.finder_to_enum): Removed.
17195 * interface.cs (Interface): Implement IMemberFinder.
17197 * delegate.cs (Delegate): Implement IMemberFinder.
17199 * enum.cs (Enum): Implement IMemberFinder.
17201 * class.cs (TypeContainer): Implement IMemberFinder.
17203 2002-08-12 Martin Baulig <martin@gnome.org>
17205 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
17207 2002-08-12 Martin Baulig <martin@gnome.org>
17209 * ecore.cs (ITypeExpression): New interface for expressions which
17211 (TypeExpression): Renamed to TypeLookupExpression.
17212 (Expression.DoResolve): If we're doing a types-only lookup, the
17213 expression must implement the ITypeExpression interface and we
17214 call DoResolveType() on it.
17215 (SimpleName): Implement the new ITypeExpression interface.
17216 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
17217 hack, the situation that we're only looking up types can't happen
17218 anymore when this method is called. Moved the type lookup code to
17219 DoResolveType() and call it.
17220 (SimpleName.DoResolveType): This ITypeExpression interface method
17221 is now doing the types-only lookup.
17222 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
17223 (ResolveFlags): Added MaskExprClass.
17225 * expression.cs (MemberAccess): Implement the ITypeExpression
17227 (MemberAccess.DoResolve): Added support for a types-only lookup
17228 when we're called via ITypeExpression.DoResolveType().
17229 (ComposedCast): Implement the ITypeExpression interface.
17231 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
17232 Expression.Resolve() with ResolveFlags.Type instead.
17234 2002-08-12 Martin Baulig <martin@gnome.org>
17236 * interface.cs (Interface.Define): Apply attributes.
17238 * attribute.cs (Attribute.ApplyAttributes): Added support for
17239 interface attributes.
17241 2002-08-11 Martin Baulig <martin@gnome.org>
17243 * statement.cs (Block.Emit): Only check the "this" variable if we
17244 do not always throw an exception.
17246 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
17247 whether the property has a set accessor.
17249 2002-08-11 Martin Baulig <martin@gnome.org>
17251 Added control flow analysis support for structs.
17253 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
17254 with control flow analysis turned off.
17255 (IVariable): New interface.
17256 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
17257 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
17258 (FieldExpr.DoResolve): Resolve the instance expression with flow
17259 analysis turned off and do the definite assignment check after the
17260 resolving when we know what the expression will resolve to.
17262 * expression.cs (LocalVariableReference, ParameterReference):
17263 Implement the new IVariable interface, only call the flow analysis
17264 code if ec.DoFlowAnalysis is true.
17265 (This): Added constructor which takes a Block argument. Implement
17266 the new IVariable interface.
17267 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
17268 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
17269 This does the definite assignment checks for struct members.
17271 * class.cs (Constructor.Emit): If this is a non-static `struct'
17272 constructor which doesn't have any initializer, call
17273 Block.AddThisVariable() to tell the flow analysis code that all
17274 struct elements must be initialized before control returns from
17277 * statement.cs (MyStructInfo): New public class.
17278 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
17279 argument to this indexer. If non-zero, check an individual struct
17280 member, not the whole struct.
17281 (FlowBranching.CheckOutParameters): Check struct members.
17282 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
17283 overloaded versions of these methods which take an additional
17284 `int field_idx' argument to check struct members.
17285 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
17286 overloaded versions of these methods which take an additional
17287 `string field_name' argument to check struct member.s
17288 (VariableInfo): Implement the IVariable interface.
17289 (VariableInfo.StructInfo): New public property. Returns the
17290 MyStructInfo instance of the variable if it's a struct or null.
17291 (Block.AddThisVariable): New public method. This is called from
17292 Constructor.Emit() for non-static `struct' constructor which do
17293 not have any initializer. It creates a special variable for the
17294 "this" instance variable which will be checked by the flow
17295 analysis code to ensure that all of the struct's fields are
17296 initialized before control returns from the constructor.
17297 (UsageVector): Added support for struct members. If a
17298 variable/parameter is a struct with N members, we reserve a slot
17299 in the usage vector for each member. A struct is considered fully
17300 initialized if either the struct itself (slot 0) or all its
17301 members are initialized.
17303 2002-08-08 Martin Baulig <martin@gnome.org>
17305 * driver.cs (Driver.MainDriver): Only report an error CS5001
17306 if there were no compilation errors.
17308 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
17309 `UnsafeContext' property to determine whether the parent is in
17310 unsafe context rather than checking the parent's ModFlags:
17311 classes nested in an unsafe class are unsafe as well.
17313 2002-08-08 Martin Baulig <martin@gnome.org>
17315 * statement.cs (UsageVector.MergeChildren): Distinguish between
17316 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
17317 we return. Added test17() and test18() to test-154.cs.
17319 2002-08-08 Martin Baulig <martin@gnome.org>
17321 * typemanager.cs (TypeManager.FilterWithClosure): If we have
17322 Family access, make sure the invoking type isn't a subclass of the
17323 queried type (that'd be a CS1540).
17325 * ecore.cs (Expression.MemberLookup): Added overloaded version of
17326 this method which takes an additional `Type invocation_type'.
17328 * expression.cs (BaseAccess.DoResolve): Use the base type as
17329 invocation and query type.
17330 (MemberAccess.DoResolve): If the lookup failed and we're about to
17331 report a CS0122, try a lookup with the ec.ContainerType - if this
17332 succeeds, we must report a CS1540.
17334 2002-08-08 Martin Baulig <martin@gnome.org>
17336 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
17337 (MethodGroupExpr): Implement the IMemberExpr interface.
17339 * expression (MemberAccess.ResolveMemberAccess): No need to have
17340 any special code for MethodGroupExprs anymore, they're now
17343 2002-08-08 Martin Baulig <martin@gnome.org>
17345 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
17346 Family, FamANDAssem and FamORAssem permissions.
17347 (TypeManager.IsSubclassOrNestedChildOf): New public method.
17349 2002-08-08 Martin Baulig <martin@gnome.org>
17351 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
17352 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
17355 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
17357 * driver.cs: implemented /resource option to embed managed resources.
17359 2002-08-07 Martin Baulig <martin@gnome.org>
17361 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
17362 (FieldBase.HasFieldInitializer): New public property.
17363 (FieldBase.GetInitializerExpression): New public method. Resolves and
17364 returns the field initializer and makes sure it is only resolved once.
17365 (TypeContainer.EmitFieldInitializers): Call
17366 FieldBase.GetInitializerExpression to get the initializer, this ensures
17367 that it isn't resolved multiple times.
17369 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
17370 the resolving process (SimpleName/MemberLookup) that we're currently
17371 emitting a field initializer (which must not access any instance members,
17372 this is an error CS0236).
17374 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
17375 argument, if the `IsFieldInitializer' flag is set, we must report and
17376 error CS0236 and not an error CS0120.
17378 2002-08-07 Martin Baulig <martin@gnome.org>
17380 * ecore.cs (IMemberExpr): New public interface.
17381 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
17382 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
17383 if the expression is an IMemberExpr.
17385 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
17386 to be null, implicitly default to `this' if we're non-static in
17387 this case. Simplified the code a lot by using the new IMemberExpr
17388 interface. Also fixed bug #28176 here.
17390 2002-08-06 Martin Baulig <martin@gnome.org>
17392 * cs-parser.jay (SimpleLookup): Removed. We need to create
17393 ParameterReferences during semantic analysis so that we can do a
17394 type-only search when resolving Cast, TypeOf and SizeOf.
17395 (block): Pass the `current_local_parameters' to the Block's
17398 * class.cs (ConstructorInitializer): Added `Parameters parameters'
17399 argument to the constructor.
17400 (ConstructorInitializer.Resolve): Create a temporary implicit
17401 block with the parameters.
17403 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
17404 references here if we aren't doing a type-only search.
17406 * statement.cs (Block): Added constructor which takes a
17407 `Parameters parameters' argument.
17408 (Block.Parameters): New public property.
17410 * support.cs (InternalParameters.Parameters): Renamed `parameters'
17411 to `Parameters' and made it public readonly.
17413 2002-08-06 Martin Baulig <martin@gnome.org>
17415 * ecore.cs (Expression.Warning): Made this public as well.
17417 * report.cs (Report.Debug): Print the contents of collections.
17419 2002-08-06 Martin Baulig <martin@gnome.org>
17421 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
17422 used to tell Resolve() which kinds of expressions it may return.
17423 (Expression.Resolve): Added overloaded version of this method which
17424 takes a `ResolveFlags flags' argument. This can be used to tell
17425 Resolve() which kinds of expressions it may return. Reports a
17427 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
17428 ResolveFlags.SimpleName.
17429 (Expression.Error118): Added overloaded version of this method which
17430 takes a `ResolveFlags flags' argument. It uses the flags to determine
17431 which kinds of expressions are allowed.
17433 * expression.cs (Argument.ResolveMethodGroup): New public method.
17434 Resolves an argument, but allows a MethodGroup to be returned.
17435 This is used when invoking a delegate.
17437 * TODO: Updated a bit.
17439 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17441 Fixed compilation with csc.
17443 * ecore.cs: Expression.Error made public. Is this correct? Should
17444 Warning be made public too?
17446 * expression.cs: use ea.Location instead of ea.loc.
17447 [FIXME: Filed as bug #28607: MCS must report these errors.]
17449 2002-08-06 Martin Baulig <martin@gnome.org>
17451 * ecore.cs (Expression.loc): Moved the location here instead of
17452 duplicating it in all derived classes.
17453 (Expression.Location): New public property.
17454 (Expression.Error, Expression.Warning): Made them non-static and
17455 removed the location argument.
17456 (Expression.Warning): Added overloaded version which takes an
17457 `int level' argument.
17458 (Expression.Error118): Make this non-static and removed the
17459 expression and location arguments.
17460 (TypeExpr): Added location argument to the constructor.
17462 * expression.cs (StaticCallExpr): Added location argument to
17464 (Indirection, PointerArithmetic): Likewise.
17465 (CheckedExpr, UnCheckedExpr): Likewise.
17466 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
17467 (StringPtr): Likewise.
17470 2002-08-05 Martin Baulig <martin@gnome.org>
17472 * expression.cs (BaseAccess.DoResolve): Actually report errors.
17474 * assign.cs (Assign.DoResolve): Check whether the source
17475 expression is a value or variable.
17477 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
17478 while resolving the corresponding blocks.
17480 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
17481 an error, don't silently return null.
17483 * statement.cs (Block.AddVariable): Do the error reporting here
17484 and distinguish between CS0128 and CS0136.
17485 (Block.DoResolve): Report all unused labels (warning CS0164).
17486 (LabeledStatement): Pass the location to the constructor.
17487 (LabeledStatement.HasBeenReferenced): New property.
17488 (LabeledStatement.Resolve): Set it to true here.
17490 * statement.cs (Return.Emit): Return success even after reporting
17491 a type mismatch error (CS0126 or CS0127), this is what csc does and
17492 it avoids confusing the users with any consecutive errors.
17494 2002-08-05 Martin Baulig <martin@gnome.org>
17496 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
17498 * const.cs (Const.LookupConstantValue): Catch circular definitions.
17500 * expression.cs (MemberAccess.DoResolve): Silently return if an
17501 error has already been reported.
17503 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
17504 error has already been reported.
17506 2002-08-05 Martin Baulig <martin@gnome.org>
17508 * statement.cs (UsageVector): Only initialize the `parameters'
17509 vector if we actually have any "out" parameters.
17511 2002-08-05 Martin Baulig <martin@gnome.org>
17513 * expression.cs (Binary.ResolveOperator): When combining delegates,
17514 they must have the same type.
17516 2002-08-05 Martin Baulig <martin@gnome.org>
17518 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
17519 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
17520 work with the ms runtime and we also don't need it: if we're a
17521 PropertyBuilder and not in the `indexer_arguments' hash, then we
17522 are a property and not an indexer.
17524 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
17525 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
17526 since the latter one doesn't work with the ms runtime.
17528 2002-08-03 Martin Baulig <martin@gnome.org>
17530 Fixed bugs #27998 and #22735.
17532 * class.cs (Method.IsOperator): New public field.
17533 (Method.CheckBase): Report CS0111 if there's already a method
17534 with the same parameters in the current class. Report CS0508 when
17535 attempting to change the return type of an inherited method.
17536 (MethodData.Emit): Report CS0179 if a method doesn't have a body
17537 and it's not marked abstract or extern.
17538 (PropertyBase): New abstract base class for Property and Indexer.
17539 (PropertyBase.CheckBase): Moved here from Property and made it work
17541 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
17542 the same so we can reuse it there.
17543 (Property, Indexer): Derive from PropertyBase.
17544 (MethodSignature.inheritable_property_signature_filter): New delegate
17545 to find properties and indexers.
17547 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
17548 argument and improved error reporting.
17550 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
17551 EmptyReadOnlyParameters and made it a property.
17553 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
17554 version of this method which takes a `PropertyInfo indexer'.
17555 (TypeManager.RegisterIndexer): New method.
17557 * class.cs: Added myself as author of this file :-)
17559 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17561 * class.cs: fixed compilation on windoze.
17563 2002-08-03 Martin Baulig <martin@gnome.org>
17565 * interface.cs (Interface.GetInterfaceBases): Check whether all
17566 base interfaces are at least as accessible than the current one.
17568 * class.cs (TypeContainer.GetClassBases): Check whether base types
17569 are at least as accessible than the current type.
17570 (TypeContainer.AsAccessible): Implemented and made non-static.
17571 (MemberBase.CheckParameters): Report errors if the accessibility
17574 * delegate.cs (Delegate.Delegate): The default visibility is
17575 internal for top-level types and private for nested types.
17576 (Delegate.Define): Report errors if the accessibility checks fail.
17578 * enum.cs (Enum.Enum): The default visibility is internal for
17579 top-level types and private for nested types.
17580 (Enum.DefineType): Compute the correct visibility.
17582 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
17583 function which takes a `bool is_toplevel' instead of a TypeContainer.
17585 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
17588 2002-08-02 Martin Baulig <martin@gnome.org>
17590 * expression.cs (LocalVariableReferenc): Added constructor which
17591 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
17592 (LocalVariableReference.IsReadOnly): New property.
17593 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
17594 variable is readonly, use our own readonly flag to do this; you can
17595 use the new constructor to get a writable reference to a read-only
17598 * cs-parser.jay (foreach_statement, using_statement): Get a writable
17599 reference to the local variable.
17601 2002-08-01 Miguel de Icaza <miguel@ximian.com>
17603 * rootcontext.cs (ResolveCore): Also include System.Exception
17605 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
17606 we reach an EmptyStatement.
17608 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
17611 * expression.cs (Binary.ResolveOperator): Check error result in
17614 use brtrue/brfalse directly and avoid compares to null.
17616 2002-08-02 Martin Baulig <martin@gnome.org>
17618 * class.cs (TypeContainer.Define): Define all nested interfaces here.
17619 Fixes bug #28407, added test-155.cs.
17621 2002-08-01 Martin Baulig <martin@gnome.org>
17623 * class.cs (Event.EmitDefaultMethod): Make this work with static
17624 events. Fixes #28311, added verify-3.cs.
17626 2002-08-01 Martin Baulig <martin@gnome.org>
17628 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
17629 `is_disposable' fields.
17630 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
17631 `hm.is_disposable' if we're using the collection pattern.
17632 (Foreach.EmitCollectionForeach): Use the correct type for the
17633 enumerator's local variable, only emit the try/finally block if
17634 necessary (fixes #27713).
17636 2002-08-01 Martin Baulig <martin@gnome.org>
17638 * ecore.cs (Expression.report118): Renamed to Error118 and made
17641 * statement.cs (Throw.Resolve): Check whether the expression is of
17642 the correct type (CS0118) and whether the type derives from
17643 System.Exception (CS0155).
17644 (Catch.Resolve): New method. Do the type lookup here and check
17645 whether it derives from System.Exception (CS0155).
17646 (Catch.CatchType, Catch.IsGeneral): New public properties.
17648 * typemanager.cs (TypeManager.exception_type): Added.
17650 2002-07-31 Miguel de Icaza <miguel@ximian.com>
17652 * driver.cs: Updated About function.
17654 2002-07-31 Martin Baulig <martin@gnome.org>
17656 Implemented Control Flow Analysis.
17658 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17659 (EmitContext.CurrentBranching): Added.
17660 (EmitContext.StartFlowBranching): Added.
17661 (EmitContext.EndFlowBranching): Added.
17662 (EmitContext.KillFlowBranching): Added.
17663 (EmitContext.IsVariableAssigned): Added.
17664 (EmitContext.SetVariableAssigned): Added.
17665 (EmitContext.IsParameterAssigned): Added.
17666 (EmitContext.SetParameterAssigned): Added.
17667 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17668 Added control flow analysis stuff here.
17670 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17671 resolve the expression as lvalue.
17672 (LocalVariableReference.DoResolve): Check whether the variable has
17673 already been assigned.
17674 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17675 the parameter as assigned here.
17676 (ParameterReference.DoResolve): Check whether the parameter has already
17678 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17679 expression as lvalue.
17681 * statement.cs (FlowBranching): New class for the flow analysis code.
17682 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17683 (LabeledStatement.IsDefined): New public property.
17684 (LabeledStatement.AddUsageVector): New public method to tell flow
17685 analyis that the label may be reached via a forward jump.
17686 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17688 (VariableInfo.Number): New public field. This is used by flow analysis
17689 to number all locals of a block.
17690 (Block.CountVariables): New public property. This is the number of
17691 local variables in this block (including the locals from all parent
17693 (Block.EmitMeta): Number all the variables.
17695 * statement.cs: Added flow analysis support to all classes.
17697 2002-07-31 Martin Baulig <martin@gnome.org>
17699 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
17700 To get debugging messages, compile mcs with /define:MCS_DEBUG and
17701 then use this argument.
17703 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17705 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17706 use this to specify /define options.
17708 2002-07-29 Martin Baulig <martin@gnome.org>
17710 * statement.cs (Fixed): Moved all code that does variable lookups
17711 and resolvings from Emit to Resolve.
17713 * statement.cs (For): Moved all code that does variable lookups
17714 and resolvings from Emit to Resolve.
17716 * statement.cs (Using): Moved all code that does variable lookups
17717 and resolvings from Emit to Resolve.
17719 2002-07-29 Martin Baulig <martin@gnome.org>
17721 * attribute.cs (Attribute.Resolve): Explicitly catch a
17722 System.NullReferenceException when creating the
17723 CustromAttributeBuilder and report a different warning message.
17725 2002-07-29 Martin Baulig <martin@gnome.org>
17727 * support.cs (ParameterData.ParameterName): Added method to
17728 get the name of a parameter.
17730 * typemanager.cs (TypeManager.IsValueType): New public method.
17732 2002-07-29 Martin Baulig <martin@gnome.org>
17734 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
17735 is a flag which specifies that it's either ref or out.
17736 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
17737 the out parameter to `out Parameter.Modifier mod', also set the
17738 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17740 * support.cs (InternalParameters.ParameterModifier): Distinguish
17741 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17742 Parameter.Modifier.ISBYREF flag if it's either ref or out.
17744 * expression.cs (Argument.GetParameterModifier): Distinguish
17745 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17746 Parameter.Modifier.ISBYREF flag if it's either ref or out.
17748 2002-07-29 Martin Baulig <martin@gnome.org>
17750 * expression.cs (ParameterReference.ParameterReference): Added
17751 `Location loc' argument to the constructor.
17753 * cs-parser.jay: Pass location to ParameterReference.
17755 2002-07-28 Miguel de Icaza <miguel@ximian.com>
17757 * statement.cs (Try): Initialize the location.
17759 * cs-parser.jay: pass location to Try.
17761 * expression.cs (Unary.Reduce): Change the prototype to return
17762 whether a constant fold could be performed or not. The result is
17763 returned in an out parameters. In the case of Indirection and
17764 AddressOf, we want to perform the full tests.
17766 2002-07-26 Miguel de Icaza <miguel@ximian.com>
17768 * statement.cs (Statement.Emit): Flag dead code.
17770 2002-07-27 Andrew Birkett <andy@nobugs.org>
17772 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17774 2002-07-27 Martin Baulig <martin@gnome.org>
17776 * class.cs (MethodData.Define): Put back call to
17777 TypeManager.AddMethod(), accidentally commented this out.
17779 * report.cs (Debug): New public method to print debugging information,
17780 this is `[Conditional ("DEBUG")]'.
17782 2002-07-26 Martin Baulig <martin@gnome.org>
17784 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17785 (switch_statement): Push the current_block to the switch_stack and
17786 pop it again when we're done with the switch.
17787 (switch_section): The new block is a child of the current_block.
17788 Fixes bug #24007, added test-152.cs.
17790 2002-07-27 Martin Baulig <martin@gnome.org>
17792 * expression.cs (Invocation.EmitArguments): When calling a varargs
17793 function with only its fixed arguments, we need to pass an empty
17796 2002-07-27 Martin Baulig <martin@gnome.org>
17798 Mono 0.13 has been released.
17800 2002-07-25 Miguel de Icaza <miguel@ximian.com>
17802 * driver.cs: Rename --resource to --linkres, because that is what
17803 we do currently, we dont support --resource yet.
17805 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17807 2002-07-25 Martin Baulig <martin@gnome.org>
17809 * class.cs (MethodData): New public class. This is a `method builder'
17810 class for a method or one accessor of a Property/Indexer/Event.
17811 (MethodData.GetMethodFlags): Moved here from MemberBase.
17812 (MethodData.ApplyAttributes): Likewise.
17813 (MethodData.ApplyObsoleteAttribute): Likewise.
17814 (MethodData.ApplyConditionalAttribute): Likewise.
17815 (MethodData.ApplyDllImportAttribute): Likewise.
17816 (MethodData.CheckAbstractAndExternal): Likewise.
17817 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17818 (MethodData.Emit): Formerly known as Method.Emit().
17819 (MemberBase): Moved everything which was specific to a single
17820 accessor/method to MethodData.
17821 (Method): Create a new MethodData and call Define() and Emit() on it.
17822 (Property, Indexer, Event): Create a new MethodData objects for each
17823 accessor and call Define() and Emit() on them.
17825 2002-07-25 Martin Baulig <martin@gnome.org>
17827 Made MethodCore derive from MemberBase to reuse the code from there.
17828 MemberBase now also checks for attributes.
17830 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17831 (MemberBase.GetMethodFlags): Moved here from class Method and marked
17833 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17834 `CallingConventions cc' and `Attributes opt_attrs' arguments.
17835 (MemberBase.ApplyAttributes): New virtual method; applies the
17836 attributes to a method or accessor.
17837 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17838 (MemberBase.ApplyConditionalAttribute): Likewise.
17839 (MemberBase.ApplyDllImportAttribute): Likewise.
17840 (MemberBase.CheckAbstractAndExternal): Likewise.
17841 (MethodCore.ParameterTypes): This is now a property instead of a
17842 method, it's initialized from DoDefineParameters().
17843 (MethodCore.ParameterInfo): Removed the set accessor.
17844 (MethodCore.DoDefineParameters): New protected virtual method to
17845 initialize ParameterTypes and ParameterInfo.
17846 (Method.GetReturnType): We can now simply return the MemberType.
17847 (Method.GetMethodFlags): Override the MemberBase version and add
17848 the conditional flags.
17849 (Method.CheckBase): Moved some code from Define() here, call
17850 DoDefineParameters() here.
17851 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17852 here to avoid some larger code duplication.
17853 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17854 ensure that abstract and external accessors don't declare a body.
17856 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17857 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17858 lookup in the attribute's parent classes, so we need to abort as soon
17859 as we found the first match.
17860 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17861 the attribute has no arguments.
17863 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17866 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17868 * cs-parser.jay: reverted previous patch.
17870 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17872 * cs-parser.jay: fixed bug #22119.
17874 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17876 * attribute.cs: fixed compilation. The error was:
17877 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
17878 be assigned to before control leaves the current method."
17879 [FIXME: Filed as bug #28186: MCS must report this error.]
17881 2002-07-25 Martin Baulig <martin@gnome.org>
17883 * attribute.cs (Attribute.Conditional_GetConditionName): New static
17884 method to pull the condition name ouf of a Conditional attribute.
17885 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17886 the obsolete message and error flag out of an Obsolete attribute.
17888 * class.cs (Method.GetMethodFlags): New public method to get the
17889 TypeManager.MethodFlags for this method.
17890 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17892 (Method.Define): Get and apply the Obsolete and Conditional attributes;
17893 if we're overriding a virtual function, set the new private variable
17894 `parent_method'; call the new TypeManager.AddMethod().
17896 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
17897 the MethodBuilder and the Method in a PtrHashtable.
17898 (TypeManager.builder_to_method): Added for this purpose.
17899 (TypeManager.MethodFlags): Added IsObsoleteError.
17900 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
17901 Obsolete and Conditional arguments in MethodBuilders. If we discover
17902 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
17903 the message from the attribute.
17905 2002-07-24 Martin Baulig <martin@gnome.org>
17907 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
17908 preprocessor directives, ensure that the argument to #define/#undef is
17909 exactly one identifier and that it's actually an identifier.
17911 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
17914 2002-07-24 Martin Baulig <martin@gnome.org>
17916 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
17917 initialize it to TypeManager.object_type in the constructor.
17918 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
17919 of the `hm.get_current' method if we're using the collection pattern.
17920 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
17921 for the explicit conversion to make it work when we're using the collection
17922 pattern and the `Current' property has a different return type than `object'.
17925 2002-07-24 Martin Baulig <martin@gnome.org>
17927 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17928 does not match, but don't report any errors. This method is called in
17929 order for all methods in a MethodGroupExpr until a matching method is
17930 found, so we don't want to bail out if the first method doesn't match.
17931 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17932 matches, report the 123. Fixes #28070.
17934 2002-07-24 Martin Baulig <martin@gnome.org>
17936 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17937 TypeManager.TypeToCoreType() to the top of the method so the
17938 following equality checks will work. Fixes #28107.
17940 2002-07-24 Martin Baulig <martin@gnome.org>
17942 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17943 operand is of type uint, and the other operand is of type sbyte,
17944 short or int, the operands are converted to type long." -
17945 Actually do what this comment already told us. Fixes bug #28106,
17948 2002-07-24 Martin Baulig <martin@gnome.org>
17950 * class.cs (MethodBase): New abstract class. This is now a base
17951 class for Property, Indexer and Event to avoid some code duplication
17952 in their Define() and DefineMethods() methods.
17953 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17954 generic methods for Define() and DefineMethods().
17955 (FieldBase): Derive from MemberBase, not MemberCore.
17956 (Property): Derive from MemberBase, not MemberCore.
17957 (Property.DefineMethod): Moved all the code from this method to the
17958 new MethodBase.DefineAccessor(), just call it with appropriate
17960 (Property.Define): Call the new Property.DoDefine(), this does some
17961 sanity checks and we don't need to duplicate the code everywhere.
17962 (Event): Derive from MemberBase, not MemberCore.
17963 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17964 accessors, this will also make them work with interface events.
17965 (Indexer): Derive from MemberBase, not MemberCore.
17966 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17967 (Indexer.Define): Use the new MethodBase functions.
17969 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17970 argument to the constructor.
17971 (Interface.FindMembers): Added support for interface events.
17972 (Interface.PopluateEvent): Implemented.
17974 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
17976 2002-07-22 Miguel de Icaza <miguel@ximian.com>
17978 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17979 but this is required to check for a method name being the same as
17980 the containing class.
17984 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17986 * interface.cs: initialize variable.
17988 2002-07-23 Martin Baulig <martin@gnome.org>
17990 Implemented the IndexerName attribute in interfaces.
17992 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17993 name if this is an explicit interface implementation.
17994 (Indexer.InterfaceIndexerName): New public variable. If we're
17995 implementing an interface indexer, this is the IndexerName in that
17996 interface. Otherwise, it's the IndexerName.
17997 (Indexer.DefineMethod): If we're implementing interface indexer,
17998 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
17999 and Pending.ImplementIndexer methods.
18000 (Indexer.Define): Also define the PropertyBuilder if we're
18001 implementing an interface indexer and this is neither an explicit
18002 interface implementation nor do the IndexerName match the one in
18005 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
18006 If a method is defined here, then we always need to create a proxy
18007 for it. This is used when implementing interface indexers.
18008 (Pending.IsInterfaceIndexer): New public method.
18009 (Pending.ImplementIndexer): New public method.
18010 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
18011 This is used when implementing interface indexers to define a proxy
18013 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
18014 define a proxy if necessary.
18016 * interface.cs (Interface.IndexerName): New public variable.
18017 (Interface.PopulateIndexer): Set the IndexerName.
18018 (Interface.DefineIndexers): New private method. Populate all the
18019 indexers and make sure their IndexerNames match.
18021 * typemanager.cs (IndexerPropertyName): Added support for interface
18024 2002-07-22 Martin Baulig <martin@gnome.org>
18026 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
18027 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
18028 ret if HasReturnLabel.
18029 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
18032 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
18033 and set the ec.LoopBeginTryCatchLevel.
18034 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
18035 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
18036 the current ec.TryCatchLevel, the branch goes out of an exception
18037 block. In this case, we need to use Leave and not Br.
18039 2002-07-22 Martin Baulig <martin@gnome.org>
18041 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
18042 block unless the block does not always return or it is contained in
18043 another try { ... } catch { ... } block. Fixes bug #26506.
18044 Added verify-1.cs to the test suite.
18046 2002-07-22 Martin Baulig <martin@gnome.org>
18048 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
18049 then we do not always return. Fixes bug #24985.
18051 2002-07-22 Martin Baulig <martin@gnome.org>
18053 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
18054 lookup on a per-class level; ie. walk up the class hierarchy until we
18055 found at least one applicable method, then choose the best among them.
18056 Fixes bug #24463 and test-29.cs.
18058 2002-07-22 Martin Baulig <martin@gnome.org>
18060 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
18061 return types of the methods. The return type is not part of the
18062 signature and we must not check it to make the `new' modifier work.
18063 Fixes bug #27999, also added test-147.cs.
18064 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
18066 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
18067 on the method's return type.
18069 2002-07-21 Martin Baulig <martin@gnome.org>
18071 * assign.cs: Make this work if the rightmost source is a constant and
18072 we need to do an implicit type conversion. Also adding a few more tests
18073 to test-38.cs which should have caught this.
18075 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
18076 target in the makefile for this. The makefile.gnu is primarily intended
18077 for end-users who don't want to debug the compiler.
18079 2002-07-21 Martin Baulig <martin@gnome.org>
18081 * assign.cs: Improved the Assign class so it can now handle embedded
18082 assignments (X = Y = Z = something). As a side-effect this'll now also
18083 consume less local variables. test-38.cs now passes with MCS, added
18084 a few new test cases to that test.
18086 2002-07-20 Martin Baulig <martin@gnome.org>
18088 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
18089 instructions. Fixes bug #27977, also added test-146.cs.
18091 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18093 * cs-tokenizer.cs: fixed getHex ().
18095 2002-07-19 Martin Baulig <martin@gnome.org>
18097 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
18098 not Type.GetType() to lookup the array type. This is needed when
18099 we're constructing an array of a user-defined type.
18100 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
18101 single-dimensional arrays, but also for single-dimensial arrays of
18104 2002-07-19 Martin Baulig <martin@gnome.org>
18106 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
18107 this function is called, it's not allowed to share LocalBuilders
18108 among ILGenerators.
18110 2002-07-19 Martin Baulig <martin@gnome.org>
18112 * expression.cs (Argument.Resolve): Report an error 118 when trying
18113 to pass a type as argument.
18115 2002-07-18 Martin Baulig <martin@gnome.org>
18117 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
18118 Conv_R_Un for the signed `long' type.
18120 2002-07-15 Miguel de Icaza <miguel@ximian.com>
18122 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
18123 `expr' for the temporary result, as that will fail if we do
18124 multiple resolves on the same expression.
18126 2002-07-05 Miguel de Icaza <miguel@ximian.com>
18128 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
18129 ec.TypeContainer for looking up aliases.
18131 * class.cs (TypeContainer): Remove LookupAlias from here.
18133 * decl.cs (DeclSpace); Move here.
18135 2002-07-01 Miguel de Icaza <miguel@ximian.com>
18137 * class.cs (FindMembers): Only call filter if the constructor
18138 bulider is not null.
18140 Also handle delegates in `NestedTypes' now. Now we will perform
18141 type lookups using the standard resolution process. This also
18144 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
18145 This uses Expressions (the limited kind that can be parsed by the
18146 tree) instead of strings.
18148 * expression.cs (ComposedCast.ToString): Implement, used to flag
18149 errors since now we have to render expressions.
18151 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
18154 * ecore.cs (SimpleName.ToString): ditto.
18156 * cs-parser.jay: Instead of using strings to assemble types, use
18157 Expressions to assemble the type (using SimpleName, ComposedCast,
18158 MemberAccess). This should fix the type lookups in declarations,
18159 because we were using a different code path for this.
18161 * statement.cs (Block.Resolve): Continue processing statements
18162 even when there is an error.
18164 2002-07-17 Miguel de Icaza <miguel@ximian.com>
18166 * class.cs (Event.Define): Also remove the `remove' method from
18167 the list of pending items.
18169 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
18170 generate more compact code.
18172 2002-07-17 Martin Baulig <martin@gnome.org>
18174 * const.cs (Const.LookupConstantValue): Add support for constant
18175 `unchecked' and `checked' expressions.
18176 Also adding test case test-140.cs for this.
18178 2002-07-17 Martin Baulig <martin@gnome.org>
18180 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
18181 check whether mi.ReturnType implements the IEnumerator interface; the
18182 `==' and the IsAssignableFrom() will fail in this situation.
18184 2002-07-16 Ravi Pratap <ravi@ximian.com>
18186 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
18189 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18191 * expression.cs: fixed bug #27811.
18193 2002-07-14 Miguel de Icaza <miguel@ximian.com>
18195 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
18196 Molaro: when we are a ref, the value already contains a pointer
18197 value, do not take the address of it.
18199 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18200 * removed mb-parser.jay and mb-tokenizer.cs
18202 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18204 * expression.cs: check against the building corlib void type.
18206 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
18208 * ecore.cs: fix for valuetype static readonly fields: when
18209 initializing them, we need their address, not the address of a copy.
18211 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
18213 * typemanager.cs: register also enum_type in corlib.
18215 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18217 * class.cs: allow calling this (but not base) initializers in structs.
18219 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
18221 * ecore.cs: make sure we compare against the building base types
18224 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
18226 * typemanager.cs: fix TypeToCoreType() to handle void and object
18227 (corlib gets no more typerefs after this change).
18229 2002-07-12 Miguel de Icaza <miguel@ximian.com>
18231 * expression.cs (ArrayCreation.EmitArrayArguments): use
18232 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
18234 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
18235 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
18236 array indexes, the runtime actually forbids them.
18238 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
18239 for array arguments here.
18241 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
18242 instead of the default for ValueTypes.
18244 (New.DoEmit): Use IsValueType instead of
18245 IsSubclassOf (value_type)
18246 (New.DoResolve): ditto.
18247 (Invocation.EmitCall): ditto.
18249 * assign.cs (Assign): ditto.
18251 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
18252 Statements *are* currently doing part of their resolution during
18255 Expressions do always resolve during resolve, but statements are
18256 only required to propagate resolution to their children.
18258 2002-07-11 Miguel de Icaza <miguel@ximian.com>
18260 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
18262 (LoadAssembly): Do not add the dll if it is already specified
18264 (MainDriver): Add the System directory to the link path at the end,
18265 after all the other -L arguments.
18267 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
18268 wrong opcode for loading bytes and bools (ldelem.i1 instead of
18269 ldelem.u1) and using the opposite for sbytes.
18271 This fixes Digger, and we can finally run it.
18273 * driver.cs (UnixParseOption): Move the option parsing here.
18274 (CSCParseOption): Implement CSC-like parsing of options.
18276 We now support both modes of operation, the old Unix way, and the
18277 new CSC-like way. This should help those who wanted to make cross
18278 platform makefiles.
18280 The only thing broken is that /r:, /reference: and /lib: are not
18281 implemented, because I want to make those have the same semantics
18282 as the CSC compiler has, and kill once and for all the confussion
18283 around this. Will be doing this tomorrow.
18285 * statement.cs (Unsafe.Resolve): The state is checked during
18286 resolve, not emit, so we have to set the flags for IsUnsfe here.
18288 2002-07-10 Miguel de Icaza <miguel@ximian.com>
18290 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
18291 not catch the Error_ObjectRefRequired in SimpleName (as it is
18292 possible to have a class/instance variable name that later gets
18293 deambiguated), we have to check this here.
18295 2002-07-10 Ravi Pratap <ravi@ximian.com>
18297 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
18298 make static and put into Expression.
18300 (Event.Define): Register the private field of the event with the
18301 TypeManager so that GetFieldFromEvent can get at it.
18303 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
18304 keep track of the private field associated with an event which
18307 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
18310 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
18312 2002-07-10 Miguel de Icaza <miguel@ximian.com>
18314 * expression.cs (Binary.EmitBranchable): this routine emits the
18315 Binary expression in a branchable context. This basically means:
18316 we need to branch somewhere, not just get the value on the stack.
18318 This works together with Statement.EmitBoolExpression.
18320 * statement.cs (Statement.EmitBoolExpression): Use
18323 2002-07-09 Miguel de Icaza <miguel@ximian.com>
18325 * statement.cs (For): Reduce the number of jumps in loops.
18327 (For): Implement loop inversion for the For statement.
18329 (Break): We can be breaking out of a Try/Catch controlled section
18330 (foreach might have an implicit try/catch clause), so we need to
18331 use Leave instead of Br.
18333 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
18334 now). If the instace expression supports IMemoryLocation, we use
18335 the AddressOf method from the IMemoryLocation to extract the
18336 address instead of emitting the instance.
18338 This showed up with `This', as we were emitting the instance
18339 always (Emit) instead of the Address of This. Particularly
18340 interesting when This is a value type, as we dont want the Emit
18341 effect (which was to load the object).
18343 2002-07-08 Miguel de Icaza <miguel@ximian.com>
18345 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
18347 * statement.cs (Checked): Set the CheckedState during the resolve
18348 process too, as the ConvCast operations track the checked state on
18349 the resolve process, and not emit.
18351 * cs-parser.jay (namespace_member_declaration): Flag that we have
18352 found a declaration when we do. This is used to flag error 1529
18354 * driver.cs: Report ok when we display the help only.
18356 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
18358 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
18360 2002-07-04 Miguel de Icaza <miguel@ximian.com>
18362 * cs-tokenizer.cs (define): We also have to track locally the
18363 defines. AllDefines is just used for the Conditional Attribute,
18364 but we also need the local defines for the current source code.
18366 2002-07-03 Miguel de Icaza <miguel@ximian.com>
18368 * statement.cs (While, For, Do): These loops can exit through a
18369 Break statement, use this information to tell whether the
18370 statement is the last piece of code.
18372 (Break): Flag that we break.
18374 * codegen.cs (EmitContexts): New `Breaks' state variable.
18376 2002-07-03 Martin Baulig <martin@gnome.org>
18378 * class.cs (TypeContainer.MethodModifiersValid): Allow override
18379 modifiers in method declarations in structs. Otherwise, you won't
18380 be able to override things like Object.Equals().
18382 2002-07-02 Miguel de Icaza <miguel@ximian.com>
18384 * class.cs (Method, Property, Indexer): Do not allow the public
18385 modifier to be used in explicit interface implementations.
18387 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
18388 override modifiers in method declarations in structs
18390 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
18392 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
18393 integer or real overflow, report an error
18395 2002-07-02 Martin Baulig <martin@gnome.org>
18397 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
18398 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
18399 to tell the runtime about our newly created System.Object and
18400 System.ValueType types.
18402 2002-07-02 Miguel de Icaza <miguel@ximian.com>
18404 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
18405 struct instead of Ldarg/Starg.
18407 2002-07-02 Martin Baulig <martin@gnome.org>
18409 * expression.cs (Indirection.Indirection): Call
18410 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
18412 2002-07-02 Martin Baulig <martin@gnome.org>
18414 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
18415 ValueType, call TypeManager.TypeToCoreType() on it.
18416 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
18417 the OpCodes.Newarr argument.
18419 2002-07-02 Martin Baulig <martin@gnome.org>
18421 * expression.cs (Invocation.EmitCall): When compiling corlib,
18422 replace all calls to the system's System.Array type to calls to
18423 the newly created one.
18425 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
18426 System.Array methods.
18427 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
18428 from the system's System.Array type which must be replaced.
18430 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
18432 * typemanager.cs: load unverifiable_code_ctor so we can build
18433 corlib using the correct type. Avoid using GetTypeCode() with
18435 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
18436 TypeManager.object_type to allow building corlib.
18438 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
18440 * ecore.cs: handle System.Enum separately in LoadFromPtr().
18442 2002-07-01 Martin Baulig <martin@gnome.org>
18444 * class.cs: Make the last change actually work, we need to check
18445 whether `ifaces != null' to avoid a crash.
18447 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18449 * class.cs: when we build structs without fields that implement
18450 interfaces, we need to add the interfaces separately, since there is
18451 no API to both set the size and add the interfaces at type creation
18454 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18456 * expression.cs: the dimension arguments to the array constructors
18457 need to be converted if they are a long.
18459 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
18461 * class.cs: don't emit ldarg.0 if there is no parent constructor
18462 (fixes showstopper for corlib).
18464 2002-06-29 Martin Baulig <martin@gnome.org>
18466 MCS now compiles corlib on GNU/Linux :-)
18468 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
18469 ie. check for MethodImplOptions.InternalCall.
18471 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
18472 and TypeManager.attribute_type are null, so we must explicitly check
18473 whether parent is not null to find out whether it's an attribute type.
18474 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
18475 and SetBuilder, not only if the property is neither abstract nor external.
18476 This is necessary to set the MethodImplOptions on the accessor methods.
18477 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
18478 SetBuilder, see Property.Emit().
18480 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
18481 populate "System.Object", "System.ValueType" and "System.Attribute" since
18482 they've already been populated from BootCorlib_PopulateCoreTypes().
18484 2002-06-29 Martin Baulig <martin@gnome.org>
18486 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
18487 is the NullLiteral, we also need to make sure that target_type is not
18490 2002-06-29 Martin Baulig <martin@gnome.org>
18492 * rootcontext.cs (RootContext.ResolveCore): We must initialize
18493 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
18494 before calling BootstrapCorlib_ResolveDelegate ().
18496 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18498 * statement.cs: fixed build-breaker. All tests passed ok.
18500 2002-06-27 Martin Baulig <martin@gnome.org>
18502 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
18503 for System.Decimal when compiling corlib.
18505 2002-06-27 Martin Baulig <martin@gnome.org>
18507 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
18508 switch blocks which contain nothing but a default clause.
18510 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
18512 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
18514 2002-06-27 Martin Baulig <martin@gnome.org>
18516 * ecore.cs (PropertyExpr.PropertyExpr): Call
18517 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
18519 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
18520 is already a TypeBuilder.
18522 2002-06-27 Martin Baulig <martin@gnome.org>
18524 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
18525 `target_type == TypeManager.array_type', not IsAssignableFrom() in
18526 the "from an array-type to System.Array" case. This makes it work
18527 when compiling corlib.
18529 2002-06-27 Martin Baulig <martin@gnome.org>
18531 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
18532 non-static PropertyExpr, set its InstanceExpression. This makes
18533 the `ICollection.Count' property work in System/Array.cs.
18535 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
18537 * driver.cs: Made error handling more consistent. Errors now
18538 tracked by Report class, so many methods which used to return int
18539 now return void. Main() now prints success/failure and
18540 errors/warnings message.
18542 Renamed '--probe' compiler argument to '--expect-error'. Removed
18543 the magic number return values (123 and 124). Now, if the
18544 expected error occurs, the compiler exits with success (exit value
18545 0). If the compilation completes without seeing that particular
18546 error, the compiler exits with failure (exit value 1). The
18547 makefile in mcs/errors has been changed to handle the new behaviour.
18549 * report.cs: Made 'expected error' number a property and renamed
18550 it from 'Probe' to 'ExpectedError'.
18552 * genericparser.cs: Removed error handling support, since it is
18553 now all done by Report class.
18555 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
18556 class, so parse() no longer returns an int.
18558 * namespace.cs: Use Report.Error instead of GenericParser.error
18560 2002-06-22 Miguel de Icaza <miguel@ximian.com>
18562 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
18563 TypeContainer.AddOperator): At the front of the list put the
18564 explicit implementations, so they get resolved/defined first.
18566 2002-06-21 Miguel de Icaza <miguel@ximian.com>
18568 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
18569 interface type is implemented by this TypeContainer. Used during
18570 explicit interface implementation.
18572 (Property.Define, Indexer.Define, Method.Define): Validate that
18573 the given interface in the explicit implementation is one of the
18574 base classes for the containing type.
18576 Also if we are explicitly implementing an interface, but there is
18577 no match in the pending implementation table, report an error.
18579 (Property.Define): Only define the property if we are
18580 not explicitly implementing a property from an interface. Use the
18581 correct name also for those properties (the same CSC uses,
18582 although that is really not needed).
18584 (Property.Emit): Do not emit attributes for explicitly implemented
18585 properties, as there is no TypeBuilder.
18587 (Indexer.Emit): ditto.
18589 Hiding then means that we do not really *implement* a pending
18590 implementation, which makes code fail.
18592 2002-06-22 Martin Baulig <martin@gnome.org>
18594 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
18595 the return value of Object.GetType(). [FIXME: we need to do this whenever
18596 we get a type back from the reflection library].
18598 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
18600 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
18602 2002-06-20 Miguel de Icaza <miguel@ximian.com>
18604 * attribute.cs: Return null if we can not look up the type.
18606 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
18607 the interface types found.
18609 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
18610 interface types found.
18612 * typemanager.cs (GetInterfaces): Make this routine returns alll
18613 the interfaces and work around the lame differences between
18614 System.Type and System.Reflection.Emit.TypeBuilder in the results
18615 result for GetInterfaces.
18617 (ExpandInterfaces): Given an array of interface types, expand and
18618 eliminate repeated ocurrences of an interface. This expands in
18619 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
18622 2002-06-21 Martin Baulig <martin@gnome.org>
18624 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
18627 2002-06-21 Martin Baulig <martin@gnome.org>
18629 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
18630 and called with one of the core types, return the corresponding typebuilder for
18633 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18636 2002-06-21 Martin Baulig <martin@gnome.org>
18638 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18639 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18640 (Expression.ConvertReferenceExplicit): Likewise.
18642 * expression.cs (ElementAccess.DoResolve): Likewise.
18643 (ElementAccess.DoResolveLValue): Likewise.
18645 2002-06-10 Martin Baulig <martin@gnome.org>
18647 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18648 add the "value" parameter to the parameter list.
18650 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18653 2002-06-19 Miguel de Icaza <miguel@ximian.com>
18655 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18656 the argument to an int, uint, long or ulong, per the spec. Also
18657 catch negative constants in array creation.
18659 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18661 * class.cs: do not allow the same interface to appear twice in
18662 the definition list.
18664 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18666 * ecore.cs: don't use ldlen with System.Array.
18668 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18670 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18672 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18674 * modifiers.cs: produce correct field attributes for protected
18675 internal. Easy fix so miguel can work on ther harder stuff:-)
18677 2002-06-18 Miguel de Icaza <miguel@ximian.com>
18679 * pending.cs: New file. Move the code from class.cs here.
18680 Support clearning the pending flag for all methods (when not doing
18681 explicit interface implementation).
18683 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18685 * rootcontext.cs: added a couple more types needed to bootstrap.
18687 2002-06-17 Miguel de Icaza <miguel@ximian.com>
18689 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18690 constructor in the type, instead of any constructor in the type
18691 hierarchy. Thanks to Paolo for finding this bug (it showed up as
18692 a bug in the Mono runtime when applying the params attribute).
18694 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18695 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18697 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
18699 * expression.cs (Unary.ResolveOperator): Use TypeManager
18700 to resolve the type.
18702 2002-06-13 Ravi Pratap <ravi@ximian.com>
18704 * cs-parser.jay (enum_member_declaration): Pass in the attributes
18707 * enum.cs (AddEnumMember): Add support to store the attributes associated
18708 with each member too.
18710 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18711 field builders too - this takes care of the enum member case.
18713 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
18715 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
18716 address-of operator on both value types and pointers.
18718 2002-06-10 Martin Baulig <martin@gnome.org>
18720 * interface.cs (Interface.PopulateIndexer): Add the indexer's
18721 PropertyBuilder to the `property_builders' list.
18723 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
18724 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
18725 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
18726 find any indexers which are inherited from an interface.
18728 2002-06-09 Martin Baulig <martin@gnome.org>
18730 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
18731 the same type as the constant if necessary. There's also a test-130.cs
18734 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
18736 * typemanager.cs (TypeManager.ChangeType): Previously known as
18737 Enum.ChangeEnumType().
18739 2002-06-09 Martin Baulig <martin@gnome.org>
18741 * expression.cs (Cast.TryReduce): Added support for consts.
18743 2002-06-08 Ravi Pratap <ravi@ximian.com>
18745 * class.cs (Accessor): Hold attributes information so we can pass
18748 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18749 Modify to pass in attributes attached to the methods.
18751 (add_accessor_declaration, remove_accessor_declaration): Ditto.
18753 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18754 to handle the Accessor kind :-)
18756 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18758 2002-06-08 Martin Baulig <martin@gnome.org>
18760 * expression.cs (Unary.TryReduceNegative): Added support for
18763 2002-06-08 Martin Baulig <martin@gnome.org>
18765 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18766 name can't be found in the `defined_names' - the caller will do a
18767 MemberLookup in this case and thus find methods in System.Enum
18768 such as Enum.IsDefined().
18770 2002-06-08 Martin Baulig <martin@gnome.org>
18772 * enum.cs (Enum.ChangeEnumType): This is a custom version of
18773 Convert.ChangeType() which works with TypeBuilder created types.
18774 (Enum.LookupEnumValue, Enum.Define): Use it here.
18776 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18777 `TypeBuilder.BaseType != null' check.
18778 (TypeContainer.FindMembers): Only lookup parent members if we
18779 actually have a parent.
18780 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18781 (ConstructorInitializer.Resolve): Likewise.
18783 * interface.cs (Interface.FindMembers): Added
18784 `TypeBuilder.BaseType != null' check.
18786 * rootcontext.cs (RootContext.ResolveCore): Added
18787 "System.Runtime.CompilerServices.IndexerNameAttribute" to
18788 classes_second_stage.
18790 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18791 debug_type and trace_type when compiling with --nostdlib.
18793 2002-06-07 Martin Baulig <martin@gnome.org>
18795 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18796 (AddField): Set it to true when adding a non-static field.
18797 (DefineType): Use `have_nonstatic_fields' to find out whether we
18798 have non-static fields, not `Fields != null'.
18800 2002-06-02 Miguel de Icaza <miguel@ximian.com>
18802 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18803 dereferencing a null on the static-field code path)
18805 2002-05-30 Martin Baulig <martin@gnome.org>
18807 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18808 to take command line arguments. Use reflection to call the new
18809 custom `Initialize' function on the symbol writer and pass it the
18810 command line arguments.
18812 * driver.cs (--debug-args): New command line argument to pass command
18813 line arguments to the symbol writer.
18815 2002-05-28 Miguel de Icaza <miguel@ximian.com>
18817 * assign.cs (DoResolve): Forgot to do the implicit conversion to
18818 the target type for indexers and properties. Thanks to Joe for
18821 2002-05-27 Miguel de Icaza <miguel@ximian.com>
18823 * typemanager.cs (MethodFlags): returns the method flags
18824 (Obsolete/ShouldIgnore) that control warning emission and whether
18825 the invocation should be made, or ignored.
18827 * expression.cs (Invocation.Emit): Remove previous hack, we should
18828 not do this on matching a base type, we should do this based on an attribute
18830 Only emit calls to System.Diagnostics.Debug and
18831 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18832 on the command line.
18834 * rootcontext.cs: Global settings for tracing and debugging.
18836 * cs-tokenizer.cs (define): New utility function to track
18837 defines. Set the global settings for TRACE and DEBUG if found.
18839 2002-05-25 Ravi Pratap <ravi@ximian.com>
18841 * interface.cs (Populate*): Pass in the TypeContainer as well as
18842 the DeclSpace as parameters so that we can create EmitContexts and
18843 then use that to apply attributes etc.
18845 (PopulateMethod, PopulateEvent, PopulateProperty)
18846 (PopulateIndexer): Apply attributes everywhere.
18848 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18851 (ApplyAttributes): Update accordingly.
18853 We now apply interface attributes for all members too.
18855 2002-05-26 Miguel de Icaza <miguel@ximian.com>
18857 * class.cs (Indexer.Define); Correctly check if we are explicit
18858 implementation (instead of checking the Name for a ".", we
18859 directly look up if the InterfaceType was specified).
18861 Delay the creation of the PropertyBuilder.
18863 Only create the PropertyBuilder if we are not an explicit
18864 interface implementation. This means that explicit interface
18865 implementation members do not participate in regular function
18866 lookups, and hence fixes another major ambiguity problem in
18867 overload resolution (that was the visible effect).
18869 (DefineMethod): Return whether we are doing an interface
18872 * typemanager.cs: Temporary hack until we get attributes in
18873 interfaces (Ravi is working on that) and we get IndexerName
18874 support in interfaces.
18876 * interface.cs: Register the indexers as properties.
18878 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18879 warning, I have verified that this is a bug in the .NET runtime
18880 (JavaScript suffers of the same problem).
18882 * typemanager.cs (MemberLookup): When looking up members for
18883 interfaces, the parent of an interface is the implicit
18884 System.Object (so we succeed in searches of Object methods in an
18885 interface method invocation. Example: IEnumerable x; x.ToString
18888 2002-05-25 Miguel de Icaza <miguel@ximian.com>
18890 * class.cs (Event): Events should also register if they do
18891 implement the methods that an interface requires.
18893 * typemanager.cs (MemberLookup); use the new GetInterfaces
18896 (GetInterfaces): The code used to lookup interfaces for a type is
18897 used in more than one place, factor it here.
18899 * driver.cs: Track the errors at the bottom of the file, we kept
18902 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
18903 instance if the method we are calling is static!
18905 2002-05-24 Miguel de Icaza <miguel@ximian.com>
18907 * attribute.cs (ApplyAttributes): Make this function filter out
18908 the IndexerName attribute (as that attribute in reality is never
18909 applied) and return the string constant for the IndexerName
18912 * class.cs (TypeContainer.Emit): Validate that all the indexers
18913 have the same IndexerName attribute, and if so, set the
18914 DefaultName attribute on the class.
18916 * typemanager.cs: The return value might contain other stuff (not
18917 only methods). For instance, consider a method with an "Item"
18918 property and an Item method.
18920 * class.cs: If there is a problem with the parameter types,
18923 2002-05-24 Ravi Pratap <ravi@ximian.com>
18925 * ecore.cs (ImplicitConversionExists): Wrapper function which also
18926 looks at user defined conversion after making a call to
18927 StandardConversionExists - we need this for overload resolution.
18929 * expression.cs : Update accordingly the various method calls.
18931 This fixes 2 bugs filed against implicit user defined conversions
18933 2002-05-22 Miguel de Icaza <miguel@ximian.com>
18935 * statement.cs: Track the result of the assignment.
18937 2002-05-21 Miguel de Icaza <miguel@ximian.com>
18939 * expression.cs (MemberAccess): Improved error reporting for
18940 inaccessible members.
18942 2002-05-22 Martin Baulig <martin@gnome.org>
18944 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
18945 itself with debugging support.
18947 2002-05-22 Martin Baulig <martin@gnome.org>
18949 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18950 Removed, this isn't needed anymore.
18952 2002-05-20 Martin Baulig <martin@gnome.org>
18954 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18955 be underlying type for an enum.
18957 2002-05-20 Miguel de Icaza <miguel@ximian.com>
18959 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18960 that splits out the loading of just the core types.
18962 * rootcontext.cs (ResolveCore): Split the struct resolution in
18963 two, so we can load the enumeration underlying types before any
18966 * expression.cs (Is): Bandaid until we fix properly Switch (see
18967 bug #24985 for details).
18969 * typemanager.cs (ImplementsInterface): The hashtable will contain
18970 a null if there are no interfaces implemented.
18972 2002-05-18 Miguel de Icaza <miguel@ximian.com>
18974 * cs-parser.jay (indexer_declarator): It is fine to have array
18977 2002-05-17 Miguel de Icaza <miguel@ximian.com>
18979 * typemanager.cs: (RegisterBuilder): New function used to register
18980 TypeBuilders that implement interfaces. Since
18981 TypeBuilder.GetInterfaces (as usual) does not work with lame
18983 (AddUserType): register interfaces.
18985 (ImplementsInterface): Use the builder_to_ifaces hash if we are
18986 dealing with TypeBuilder. Also, arrays are showing up as
18987 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18988 methods can not be invoked on them!
18990 * ecore.cs (ExplicitReferenceConversionExists): Made public.
18991 (ImplicitReferenceConversionExists): Split out from
18992 StandardConversionExists.
18994 * expression.cs (As): We were only implementing one of the three
18995 cases for the as operator. We now implement them all.
18996 (Is): Implement the various other cases for Is as well.
18998 * typemanager.cs (CACHE): New define used to control if we want or
18999 not the FindMembers cache. Seems to have a negative impact on
19000 performance currently
19002 (MemberLookup): Nested types have full acess to
19003 enclosing type members
19005 Remove code that coped with instance/static returns for events, we
19006 now catch this in RealFindMembers.
19008 (RealFindMembers): only perform static lookup if the instance
19009 lookup did not return a type or an event.
19011 2002-05-17 Miguel de Icaza <miguel@ximian.com>
19013 * assign.cs (CompoundAssign): We pass more semantic information
19014 now to Compound Assignments than we did before: now we have all
19015 the information at hand, and now we resolve the target *before* we
19016 do the expression expansion, which allows the "CacheValue" method
19017 to have the effect we intended (before, a [x] += 1 would generate
19018 two differen ArrayAccess expressions from the ElementAccess,
19019 during the resolution process).
19021 (CompoundAssign.DoResolve): Resolve target and original_source here.
19023 2002-05-16 Miguel de Icaza <miguel@ximian.com>
19025 * expression.cs (ArrayAccess): dropped debugging information.
19027 * typemanager.cs: Small bug fix: I was always returning i_members,
19028 instead of one of i_members or s_members (depending on which had
19031 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
19032 method is invoked before any code generation takes place, and it
19033 is a mechanism to inform that the expression will be invoked more
19034 than once, and that the method should use temporary values to
19035 avoid having side effects
19037 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
19039 * ecore.cs (Expression.CacheTemporaries): Provide empty default
19042 * expression.cs (Indirection, ArrayAccess): Add support for
19043 CacheTemporaries in these two bad boys.
19045 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
19046 ldobj or ldind_ref.
19047 (StoreFromPtr): Handle stobj as well.
19049 * expression.cs (UnaryMutator): Share more code.
19051 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
19052 down: I was not tracking the Filter function as well, which
19053 was affecting the results of the cache.
19055 2002-05-15 Miguel de Icaza <miguel@ximian.com>
19057 * attribute.cs: Remove the hack to handle the CharSet property on
19060 2002-05-14 Miguel de Icaza <miguel@ximian.com>
19062 * attribute.cs (DoResolve): More uglyness, we now only try to
19063 resolve the attribute partially, to extract the CharSet
19064 information (only if we are a StructLayout attribute). Otherwise
19066 (GetExtraTypeInfo): Add some code to conditionally kill in the
19067 future this. I am more and more convinced that the .NET
19068 framework has special code to handle the attribute setting on
19071 * expression.cs (IsParamsMethodApplicable): Revert my previous
19072 foreach change here, it was wrong.
19074 2002-05-13 Miguel de Icaza <miguel@ximian.com>
19076 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
19077 (pp_expr): do not abort on unknown input, just return.
19078 (eval): abort if there are pending chars.
19080 * attribute.cs (Attribute.Resolve): Positional parameters are
19081 optional. Deal with that case.
19083 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
19084 the Ansi/Unicode/Auto information for the type.
19086 (TypeContainer.DefineType): instantiate the EmitContext here, as
19087 we will be using it during the type definition (to resolve
19088 attributes) and during the emit phase.
19090 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
19091 to pull type information out of the attributes
19093 (Attribute.Resolve): track the constructor builder, and allow for
19094 multiple invocations (structs and classes will use this).
19096 * ecore.cs (MemberLookupFinal): new version with all the
19097 parameters customizable.
19099 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
19100 constructors. Return if the result value is null (as the error
19101 would have been flagged already by MemberLookupFinal)
19103 Do not allow instances of abstract classes or interfaces to be
19106 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
19107 We have to compare the assembly property here when dealing with
19108 FamANDAssem and Assembly access modifiers, because we might be
19109 creating an assembly from *modules* (that means that we are not
19110 getting TypeBuilders for types defined in other modules that are
19111 part of this assembly).
19113 (Method.Emit): If the method is marked abstract and has a body,
19116 (TypeContainer.DefineMembers): If both the defined member and the
19117 parent name match are methods, then do not emit any warnings: let
19118 the Method.Define routine take care of flagging warnings. But if
19119 there is a mismatch (method overrides something else, or method is
19120 overriwritten by something, then emit warning).
19122 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
19123 set to null, this means `do not check for the return type on the
19126 (Method.Define): set the return type for the method signature to
19127 null, so that we get methods with the same name and parameters and
19128 different return types. This is used to flag warning 114 (you are
19129 hiding a method, and you probably want to use the new/override
19132 * typemanager.cs (MemberLookup): Implemented proper access
19133 control, closing a long standing set of bug reports. The problem
19134 was that the Framework only has two bits: Public and NonPublic,
19135 and NonPublic includes private and protected methods, but we need
19136 to enforce the FamANDAssem, FamOrAssem and Family.
19138 2002-05-11 Miguel de Icaza <miguel@ximian.com>
19140 * statement.cs (GotoCase): Return true: Ammounts to giving up
19141 knowledge on whether we return or not, and letting the other case
19142 be responsible for it.
19144 2002-05-10 Miguel de Icaza <miguel@ximian.com>
19146 * driver.cs: Do not load directories for each file processed, only
19147 do it if there is a pattern.
19149 * ecore.cs: Report readonly assigns here as well, as we might have
19150 been resolved only by MemberAccess.
19152 (SimpleName.SimpleNameResolve): Also be useful for LValue
19153 resolution. We need this to propagate assign to local readonly variables
19155 * typemanager.cs: Use a ptrhashtable for the criteria, because we
19156 do not want to reuse potential criteria memory.
19158 * class.cs (MyEventBuilder): Set reflected_type;
19160 * ecore.cs (Constantify): Added support for constifying bools.
19162 (RootContext.LookupType): Added a cache for values looked up in
19163 the declaration space.
19165 * typemanager.cs (FindMembers): Now is a front-end to
19166 RealFindMembers, and provides a two-level hashtable-based cache to
19169 15% performance improvement: from 22.5 to 19.2 seconds.
19171 * expression.cs (IsParamsMethodApplicable): use foreach.
19172 (Invocation.DoResolve): ditto.
19173 (New.DoResolve): ditto.
19174 (ArrayCreation.DoResolve): ditto.
19176 * ecore.cs (FindMostEncompassingType): use foreach.
19178 * delegate.cs (NewDelegate.DoResolve): Use foreach
19180 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
19181 (RemoveMethods): use foreach.
19183 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
19184 nested foreach statements instead of for, and also break out of
19185 the inner loop once a match is found.
19187 (Invocation.OverloadResolve): Use foreach, simplify the code.
19189 2002-05-08 Miguel de Icaza <miguel@ximian.com>
19191 * cfold.cs (BinaryFold): During an enumeration evaluation context,
19192 we actually unwrap the expression to allow for extra information
19195 * expression.cs: Use Shr_Un on unsigned operations.
19197 2002-05-08 Ravi Pratap <ravi@ximian.com>
19199 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
19200 applicable operators was not being considered correctly. This closes
19201 the bug Miguel reported.
19203 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
19205 * attribute.cs: check that the type derives from System.Attribute
19206 and report the correct error in that case (moved the duplicate code to
19207 its own method, too).
19209 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
19211 * attribute.cs: lookup attribute type name as the spec says: first the
19212 bare attribute name and then name + "Attribute" (nant compiles with
19213 mcs after this fix).
19215 2002-05-07 Miguel de Icaza <miguel@ximian.com>
19217 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
19218 Because of the way we parse things, we should try to see if a
19219 UIntConstant can fit in an integer.
19221 2002-05-07 Ravi Pratap <ravi@ximian.com>
19223 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
19224 when we are in an explicit context.
19226 (ConvertReferenceExplicit): When converting from Iface type S to Class
19227 T make sure the rules are implemented as an OR.
19229 * parameter.cs (ParameterType): Make it a property for now although the
19230 purpose really isn't anything immediate.
19232 * expression.cs (Is*Applicable): Do better checking on the parameter type
19233 of a ref/out parameter. The ones from the system assemblies are already
19234 marked with the correct type so we don't need to do any correction.
19236 * ecore.cs (StandardConversionExists): Conversion from Interface types to
19237 the object type is standard too so include that.
19239 2002-05-06 Miguel de Icaza <miguel@ximian.com>
19241 * ecore.cs (StandardConversionExists): Augment with missing code:
19242 deal with IntConstant, LongConstants and Enumerations.
19244 * assign.cs: Report the error, instead of failing silently
19246 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
19247 typecontainer that they are declared, because the
19248 typecontainer/namespace will have the list of using clauses that
19249 need to be applied.
19251 Assembly Attributes were escaping the normal registration
19254 (EmitCode): Apply attributes within an EmitContext that represents
19255 the container they were declared on.
19257 * cs-parser.jay: Track bases for structs. How did I get this wrong?
19259 2002-05-06 Ravi Pratap <ravi@ximian.com>
19261 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
19262 Revamp completely - make much cleaner as we now operate only
19265 (FindMostSpecificSource, FindMostSpecificTarget): New methods
19266 to implement the logic detailed in the spec more correctly.
19268 (UserDefinedConversion): Update accordingly.
19270 2002-05-06 Miguel de Icaza <miguel@ximian.com>
19272 * statement.cs: Return flow analysis information up.
19274 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
19277 (token): Do not consume an extra character before calling
19280 2002-05-06 Piers Haken <piersh@friskit.com>
19282 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
19284 2002-05-06 Miguel de Icaza <miguel@ximian.com>
19286 * class.cs (Constructor.Emit): Set the IsStatic flag in the
19287 EmitContext during the instance constructor initializer
19288 resolution, to stop access to instance variables.
19290 This is mandated by the spec, last paragraph of the `constructor
19291 initializers' section.
19293 2002-05-05 Miguel de Icaza <miguel@ximian.com>
19295 * cs-parser.jay, class.cs (Accessor): new class used to represent
19296 an accessor (get or set). In the past we used `null' to represent
19297 a missing accessor. But this is ambiguous because there was no
19298 way to tell in abstract indexers/properties if one of them was
19301 Now there is a way of addressing that.
19303 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
19304 instead of FindMembers.
19306 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
19307 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
19309 * attribute.cs: Treat indexers and properties as the same in terms
19310 of applying attributes
19312 * ecore.cs (FindMostEncompassedType): Use statically initialized
19313 EmptyExpressions()s like we do elsewhere to avoid creating useless
19314 objects (and we take this out of the tight loop).
19316 (GetConversionOperators): Move the code to extract the actual
19317 operators to a separate routine to clean things up.
19319 2002-05-04 Miguel de Icaza <miguel@ximian.com>
19321 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
19322 events are always registered FieldBuilders.
19324 * class.cs (FieldBase): New class shared by Fields
19326 * delegate.cs: If we are a toplevel delegate, use our full name.
19327 If we are a nested delegate, then only use our tail name.
19329 2002-05-02 Ravi Pratap <ravi@ximian.com>
19331 * expression.cs (IsApplicable): Ensure that we add the "&" to
19332 ref/out types before comparing it with the type of the argument.
19334 (IsParamsMethodApplicable): Ditto.
19336 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
19339 * delegate.cs : Handle the case when we have more than one applicable
19340 method. Flag an error only when we finish checking all.
19342 2002-05-02 Miguel de Icaza <miguel@ximian.com>
19344 * expression.cs: Add support for boolean static initializers.
19346 2002-05-01 Miguel de Icaza <miguel@ximian.com>
19348 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
19350 * parameter.cs (ComputeParameterTypes,
19351 ComputeAndDefineParameterTypes): Better error handling: now we
19352 clear the `types' cache if we fail during any of the type lookups.
19353 We also return the status code correctly to our caller
19355 * delegate.cs: If we fail to define a delegate, abort the extra
19358 * expression.cs (Binary.ResolveOperator): for
19359 operator==(object,object) and operator !=(object, object) we also
19360 have to verify that there is an implicit conversion from one to
19363 (ArrayAccess.DoResolve): Array Access can operate on
19366 2002-04-30 Miguel de Icaza <miguel@ximian.com>
19368 * assign.cs (CompoundAssign): A new class used as a "flag" that
19369 the assignment actually is happening as part of a compound
19370 assignment operator.
19372 During compound assignment, a few new rules exist to enable things
19379 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
19380 to the type of x) if y is implicitly convertible to the type of x,
19381 and the operator is a builtin operator and the return type of the
19382 operator is explicitly convertible to the type of x.
19384 * rootcontext.cs: Reset warning level to 2. 4 catches various
19385 "interesting" features in mcs, we must clean this up at some
19386 point, but currently am trying to kill other bugs ;-)
19388 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
19389 in container classes as well.
19391 * expression.cs (Binary.ResolveOperator): Handle string case
19392 before anything else (as operator overloading does emit an error
19393 before doing anything else).
19395 This code could go away when we move to a table driven model, but
19396 i could not come up with a good plan last night.
19398 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
19400 * typemanager.cs (CSharpName): reimplementation using regex.
19401 * class.cs: added null check for fields in Emit
19402 * rootcontext.cs: set warninglevel to 4
19404 2002-04-29 Miguel de Icaza <miguel@ximian.com>
19406 * typemanager.cs (CSharpName): reimplemented with Lupus
19409 2002-04-28 Miguel de Icaza <miguel@ximian.com>
19411 * statement.cs (If): correclty implement Resolve, because we were
19412 not catching sem errors in there. The same process is needed
19414 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
19417 (Statement.Warning_DeadCodeFound): Factorize code.
19418 (While): Report dead code here too.
19420 (Statement): Added Resolve virtual method to allow
19421 for resolution split from the emit code.
19423 2002-04-26 Miguel de Icaza <miguel@ximian.com>
19425 * statement.cs (EmitBoolExpression): No longer try to resolve the
19427 (MakeBoolean): New utility function that resolve, implicitly
19428 converts to boolean and tags the expression.
19431 (If, Do): Implement dead code elimination.
19432 (While): Implement loop inversion
19434 (Do, While, For, If): Resolve the expression prior to calling our
19437 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
19440 - added method Report28 (warning: program has more than one entry point)
19441 - added method IsEntryPoint, implements paragraph 10.1 of the spec
19442 - modified method Method.Define, the part at the end of the method
19444 * rootcontext.cs: added static public Location EntryPointLocation;
19446 * ../errors/cs0028.cs : Add test case for the above warning.
19449 - modified method CSharpName to allow arrays of primitive type to
19450 be printed nicely (e.g. instead of System.Int32[][] it now prints
19452 - added method CSharpSignature: returns the signature of a method
19453 in string format to be used in reporting errors, warnings, etc.
19455 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
19458 2002-04-26 Ravi Pratap <ravi@ximian.com>
19460 * delegate.cs (Define): Fix extremely silly bug where I was
19461 setting the type of the 'object' parameter of the BeginInvoke
19462 method to System.IAsyncResult instead of System.Object ;-)
19464 2002-04-26 Miguel de Icaza <miguel@ximian.com>
19466 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
19469 (Constructor.Emit): return if we fail to initialize the
19470 constructor. Another door closed!
19472 * expression.cs (New.DoResolve): Improve error message (from -6 to
19473 1501). Use DeclaredOnly lookup to find the exact constructor.
19475 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
19476 loop. This is useful.
19478 * cs-parser.jay: Adjust the default parameters so that destructors
19479 have the proper signature.
19481 2002-04-26 Martin Baulig <martin@gnome.org>
19483 * driver.cs (LoadAssembly): If `assembly' contains any characters
19484 which are only valid in path names and not in assembly names
19485 (currently slash, backslash and point), use Assembly.LoadFrom ()
19486 instead of Assembly.Load () on the `assembly' (before iteration
19487 over the link_paths).
19489 2002-04-26 Martin Baulig <martin@gnome.org>
19491 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
19493 2002-04-25 Miguel de Icaza <miguel@ximian.com>
19495 * class.cs (Property): use the new typemanager.MemberLookup
19497 (TypeContainer.MemberLookup): Implement using the
19498 TypeManager.MemberLookup now.
19500 * typemanager.cs: Make MemberLookup a function of the TypeManager,
19501 and return MemberInfos, so that these can be used without an
19502 EmitContext (what we had before).
19504 2002-04-24 Miguel de Icaza <miguel@ximian.com>
19506 * expression.cs: Fix the case where the argument to params if the
19507 type of the params. I omitted handling this before. Fixed
19509 2002-04-22 Miguel de Icaza <miguel@ximian.com>
19511 * driver.cs: Call BootCorlib_PopulateCoreType
19513 * class.cs (Property.CheckBase): Check for properties only, not
19516 * interface.cs: Temporary hack: try/catch around the
19517 CustomAttributeBuilder, because I am getting an exception that I
19520 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
19521 types whose definitions are required to be there (attributes are
19522 defined before standard types).
19524 Compute definitions as we boot the various types, as they are used
19525 immediately (value_type class will need object_type, but if we do
19526 not initialize object_type, we will pass a null, which will let
19527 the runtime pick the System.Object from the existing corlib, which
19528 is not what we want).
19530 2002-04-22 Patrik Torstensson <totte@labs2.com>
19532 * cs-tokenizer.cs: fixed a number of trim() issues.
19534 2002-04-22 Ravi Pratap <ravi@ximian.com>
19536 * expression.cs (Argument.Type): Ensure that we return the correct
19537 type when we have out or ref parameters [in which case we
19540 2002-04-22 Miguel de Icaza <miguel@ximian.com>
19542 * class.cs (Property, Indexer): Allow extern modifier in there.
19544 * typemanager.cs (InitBaseTypes): Initializes object_type and
19545 value_type, since those will be used early on during the bootstrap
19546 process to compile corlib.
19548 (InitCoreTypes): Move code from here to InitBaseTypes.
19550 2002-04-21 Miguel de Icaza <miguel@ximian.com>
19552 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
19553 single-dimension arrays as using the ldlen opcode.
19555 Daniel Lewis discovered this optimization.
19557 * typemanager.cs: Add signature for System.Array::get_Length
19559 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19561 * statement.cs: report the error when the foreach does not apply to an
19562 array nor a collection.
19564 2002-04-19 Miguel de Icaza <miguel@ximian.com>
19566 * expression.cs: Add implicit conversions to the operator ~.
19568 * constant.cs (DecimalConstant.Emit): Emit decimal value.
19570 * typemanager.cs: Locate the decimal constructor.
19572 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19574 * attribute.cs: use the new property of TypeOf.
19575 * expression.cs: added 'get' property around typearg.
19577 These changes fix a build breaker reported by NickD. Is this the
19578 correct way to fix? If not, please, revert my changes and make it
19581 2002-04-17 Miguel de Icaza <miguel@ximian.com>
19583 * attribute.cs: Add support for typeof in attribute invocations.
19584 I am not sure that this is right though.
19586 2002-04-14 Duncan Mak <duncan@ximian.com>
19588 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
19589 Binary.Operator.Division case.
19591 2002-04-13 Ravi Pratap <ravi@ximian.com>
19593 * class.cs (DefineType): Ensure that we do a proper check on
19594 attribute types and also register it with the TypeManager.
19596 (TypeContainer.Targets): The default for attribute types is
19597 AttributeTargets.All.
19599 * attribute.cs (ApplyAttributes): Registering the attribute type
19600 is done elsewhere, not when we discover we have a Usage attribute.
19602 2002-04-12 Ravi Pratap <ravi@ximian.com>
19604 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
19605 and get rid of is_delegate parameter.
19607 * everywhere : update.
19609 2002-04-12 Ravi Pratap <ravi@ximian.com>
19611 * cs-parser.jay (compilation_unit): Revamp completely to use
19612 some new ideas that I got from Rhys' grammar to solve the problems
19613 with assembly level attributes.
19615 (outer_declaration): New grammar production.
19617 (attribute_sections): Add.
19619 (opt_attributes): Base on attribute_sections
19621 (namespace_declaration): Allow opt_attributes to tackle the case
19622 when we have assembly level attributes - we are clever in this
19625 * attribute.cs (ApplyAttributes): Do not worry about assembly
19626 attributes in the non-global context.
19628 * rootcontext.cs (AddGlobalAttributes): Go back to using this
19629 instead of SetGlobalAttributes.
19631 * class.cs, rootcontext.cs : Ensure we define and generate
19632 attribute types before anything else.
19634 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19635 and flag the new error -20 for the case when the attribute type
19636 does not have valid targets specified. csc does not catch this.
19638 * ../errors/errors.txt : update for error # -20
19640 2002-04-11 Ravi Pratap <ravi@ximian.com>
19642 * support.cs (InternalParameters.ParameterModifier): Do some null
19643 checking and return sane values.
19645 * class.cs (Method.Define): If we are a PInvoke method, ensure
19646 that we are static and extern. Report error # 601
19648 * ../errors/cs0601.cs : Add test case for the above error.
19650 2002-04-07 Ravi Pratap <ravi@ximian.com>
19652 * rootcontext.cs (attribute_types): We need to keep type of
19653 all attribute types separately and emit code for them first.
19655 (RegisterAttribute) : Implement.
19657 * class.cs (DefineType): Check if the current Type is a custom
19658 attribute type and register it accordingly.
19660 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19661 adding the first attribute twice and rename to
19663 (SetGlobalAttributes): this.
19665 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19668 * attribute.cs (ApplyAttributes): Take an additional argument telling us
19669 if we are processing global arguments. Hmm, I am unsure of this.
19671 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19673 * expression.cs: added static array of strings to avoid calling
19674 Enum.ToString () for Operator in Binary. Significant recover of
19677 2002-04-10 Miguel de Icaza <miguel@ximian.com>
19679 * class.cs (FindMembers): Allow the Builders of the various
19680 members to be null. If they are skip them. This only happens
19681 during the PInvoke declaration.
19683 2002-04-09 Miguel de Icaza <miguel@ximian.com>
19685 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19686 failure, so we do not keep going afterwards.
19688 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19689 wanted to pass `false' as the `is_delegate' argument. If this is
19690 the case, why not use delegate_type == null to mean `is_delegate =
19691 false' and anything else as is_delegate = true.
19693 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
19695 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19696 code for the section, not the beginning of the tests.
19698 2002-04-08 Miguel de Icaza <miguel@ximian.com>
19700 * cfold.cs: Handle operator + (Enum x, Underlying x)
19702 * expression.cs (Binary): same. Warn about errors where we have
19703 Enum/Enum in operator + as well.
19705 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
19708 - added support for switch(bool)
19709 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19710 - add TableSwitchEmit() to handle table-based switch statements
19712 2002-04-05 Ravi Pratap <ravi@ximian.com>
19714 * expression.cs (Invocation.OverloadResolve): Factor out code which
19715 does parameter compatibility checking with arguments so that we can
19716 re-use the code even from Delegate.VerifyApplicability
19718 (VerifyArgumentsCompat): Move above code here.
19720 * delegate.cs (VerifyApplicability): Get rid of duplicate code
19721 and instead make a call to the above method.
19723 2002-03-31 Ravi Pratap <ravi@ximian.com>
19725 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
19726 We use it to keep track of classes which are attribute types.
19728 2002-04-02 Miguel de Icaza <miguel@ximian.com>
19730 * delegate.cs (Delegate.Define): Correctly define the types in the
19731 presence of fixed and array parameters.
19733 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
19736 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
19737 include NonPublic after the first iteration.
19739 * class.cs (Indexer.CheckBase): Only check if both parents are
19742 * cs-parser.jay (accessor_body): If empty, set to null.
19744 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19745 same code path here to resolve constants names that we did have in
19746 MemberAccess.DoResolve. There is too much code duplicated here.
19748 2002-04-01 Miguel de Icaza <miguel@ximian.com>
19750 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19752 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19755 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19756 tokens, numbers and strings.
19758 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19761 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19762 asyncronous parameters and the regular parameters.
19764 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19765 specify the target directory.
19767 * expression.cs: (This.DoResolve): Simplify
19768 (As.Emit): Optimize, do not generate IsInst if the expression is
19769 always of the given type.
19771 (Is.DoResolve): Bug fix, we were reporting both always/never for
19774 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19775 creating too many unnecessary arrays.
19777 2002-03-31 Miguel de Icaza <miguel@ximian.com>
19779 * class.cs (EmitFieldInitializer): Use Assign expression to assign
19780 fields instead of rolling our own initializer. Takes care of all
19781 implicit conversions, and drops unnecessary static checks/argument.
19783 2002-03-31 Dick Porter <dick@ximian.com>
19785 * driver.cs: use the GetDirectories() return values properly, and
19786 use "/" as path separator.
19788 2002-03-30 Miguel de Icaza <miguel@ximian.com>
19790 * expression.cs (Unary): Optimize - - expr into expr.
19791 (Binary): Optimize a + (-b) into a -b.
19793 * codegen.cs (CodeGen): Made all methods static.
19795 2002-03-29 Miguel de Icaza <miguel@ximian.com>
19799 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19800 TypeBuilder property.
19802 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19805 * tree.cs: Removed the various RecordXXXX, and replaced with a
19806 single RecordDecl. Removed all the accessor methods, and just
19807 left a single access point Type
19809 * enum.cs: Rename DefineEnum to DefineType.
19811 * decl.cs: New abstract method `DefineType' used to unify the
19812 Defines for Enumerations, Interfaces, TypeContainers and
19815 (FindType): Moved LookupInterfaceOrClass here. Moved the
19816 LookupBaseClasses method that used to live in class.cs and
19817 interface.cs here, and renamed to FindType.
19819 * delegate.cs: Implement DefineType. Take advantage of the
19820 refactored pattern for locating the parent builder without taking
19821 the parent_builder argument (which we know does not work if we are
19822 nested, and triggering a toplevel definition).
19824 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19826 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19827 accessibility of a member has changed during override and report
19830 * class.cs (Method.Define, Property.Define): Only complain on
19831 overrides if the method is private, any other accessibility is
19832 fine (and since we just checked the permission is the same, we are
19835 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19836 and elif are processed always. The other pre-processing
19837 directives are only processed if we are "taking" the path
19839 2002-03-29 Martin Baulig <martin@gnome.org>
19841 * class.cs (Method.Emit): Only emit symbolic debugging info if the
19842 current location is not Null.
19844 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19845 a separate method so we can profile it.
19847 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19848 `span.Seconds' are just seconds, but no minutes or hours.
19849 (MainDriver): Profile the CodeGen.SaveSymbols calls.
19851 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19853 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19854 Remove the gratuitous set of Final:
19856 // If an interface implementation, then we can set Final.
19857 if (((flags & MethodAttributes.Abstract) == 0) &&
19858 implementing.DeclaringType.IsInterface)
19859 flags |= MethodAttributes.Final;
19861 I do not know what I was smoking when I used that.
19864 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19865 step into fixing the name resolution issues for delegates and
19866 unifying the toplevel name resolution.
19868 2002-03-28 Martin Baulig <martin@gnome.org>
19870 * class.cs (Method.Emit): If we have a symbol writer, call its
19871 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19872 tell it about the current method.
19874 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19875 writer that we're going to emit the first byte of IL code for a new
19876 statement (a new source line).
19877 (EmitContext.EmitTopBlock): If we have a symbol writer, call
19878 EmitContext.Mark() before emitting any code.
19880 * location.cs (SymbolDocument): Return null when we're Null.
19882 * statement.cs (Statement): Moved the `Location loc' variable here.
19883 (Statement.EmitBoolExpression): If we have a symbol writer, call
19884 ec.Mark() before emitting any code to tell it that we're at the
19885 beginning of a new statement.
19886 (StatementExpression): Added `Location' argument to the constructor.
19887 (Block): Added public readonly variable `StartLocation' and public
19888 variable `EndLocation'. The latter is to be set using SetEndLocation().
19889 (Block): Added constructor which takes a start and end location.
19890 (Block.SetEndLocation): New method. This sets the end location.
19891 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19892 local variables we create.
19893 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
19894 each statement and do also mark the begin and end of the block.
19896 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
19897 tell it the current lexer.Location, use Location.Null for the end of the
19899 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
19900 current block, set its end location using SetEndLocation().
19901 (statement_expression): StatementExpression constructor now takes the
19902 lexer.Location as additional argument.
19903 (for_statement, declare_local_variables): Likewise.
19904 (declare_local_variables): When creating a new implicit block, use the
19905 new Block constructor and pass it the lexer.Location.
19907 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19909 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
19910 members also on the parent interfaces recursively.
19912 2002-03-27 Miguel de Icaza <miguel@ximian.com>
19914 * report.cs: Use new formats, since Gonzalo finished the missing
19917 * expression.cs (Binary.ResolveOperator): added missing operator|
19918 operator& and operator^ for bool/bool.
19920 * cs-parser.jay: CheckDef now takes a Location argument that is
19921 used to report errors more precisly (instead of reporting the end
19922 of a definition, we try to track something which is a lot closer
19923 to the source of the problem).
19925 * cs-tokenizer.cs: Track global token use, so we can properly flag
19926 the use of #define/#undef after the first token has been seen.
19928 Also, rename the reportXXXX to Error_DescriptiveName
19930 * decl.cs (DeclSpace.IsTopLevel): Move property here from
19931 TypeContainer, so that Enum and Interface can use this too.
19933 * class.cs (TypeContainer.LookupInterfaceOrClass,
19934 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19935 `builder' argument. Typically this was used to pass the parent
19936 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19939 The problem is that a nested class could trigger the definition of
19940 a toplevel class, and the builder would be obviously wrong in that
19943 So we drop this argument, and we compute dynamically the
19944 TypeBuilder/ModuleBuilder (the correct information was available
19945 to us anyways from DeclSpace.Parent)
19947 * interface.cs (Interface.DefineInterface): Drop builder
19948 parameter cleanup like class.cs
19950 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
19953 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19956 (Try.Emit): Propagate the returns value from the statement.
19958 (Return.Emit): Even if we are leavning
19960 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19962 * modifiers.cs: Fix the computation of MethodAttributes flags.
19964 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19966 * driver.cs: allow compilation of files that start with '/'.
19967 Add a default case when checking the argument of --target.
19969 2002-03-25 Miguel de Icaza <miguel@ximian.com>
19971 * interface.cs: Implement the same search algorithm for types in
19972 the interface code.
19974 * delegate.cs: Do not allow multiple definition.
19976 * Recovered ChangeLog that got accidentally amputated
19978 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19980 * rootcontext.cs: Load manually enum to allow core classes to
19981 contain enumerations.
19983 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19984 Update to new static methods in TypeManager.
19986 * typemanager.cs (GetMethod, GetConstructor): Use our
19987 implementation of FindMembers to find the members, since during
19988 corlib compilation, the types are TypeBuilders and GetMethod and
19989 GetConstructor do not work.
19991 Make all methods in TypeManager static.
19993 (InitCodeHelpers): Split the functionality from
19994 the InitCodeTypes function.
19996 * driver.cs: Call InitCodeHelpers after we have populated the
19999 * cs-parser.jay (delegate_declaration): we did not used to compute
20000 the delegate name correctly for void delegates.
20002 2002-03-24 Miguel de Icaza <miguel@ximian.com>
20004 * rootcontext.cs (RootContext): Init the interface_resolve_order
20005 and type_container_resolve_order always.
20007 (ResolveCore, BootstrapCorlib_ResolveClass,
20008 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
20009 compiler when compiling with --nostdlib
20011 * class.cs (TypeContainer.DefineType): Check that our parent is
20012 not null. This test is most important when we are bootstraping
20015 * codegen.cs: Split out the symbol writing code.
20017 2002-03-25 Martin Baulig <martin@gnome.org>
20019 * driver.cs (-g): Made -g an alias for --debug.
20021 2002-03-24 Martin Baulig <martin@gnome.org>
20023 * codegen.cs (SymbolWriter): New public variable. Returns the
20024 current symbol writer.
20025 (CodeGen): Added `bool want_debugging_support' argument to the
20026 constructor. If true, tell the ModuleBuild that we want debugging
20027 support and ask it for the ISymbolWriter.
20028 (Save): If we have a symbol writer, call it's Close() method after
20029 saving the assembly.
20031 * driver.c (--debug): New command line argument to create a
20032 debugger information file.
20034 * location.cs (SymbolDocument): New public property. Returns an
20035 ISymbolDocumentWriter object for the current source file or null
20036 if we don't have a symbol writer.
20038 2002-03-21 Miguel de Icaza <miguel@ximian.com>
20040 * driver.cs (LoadAssembly): Correctly return when all the paths
20041 have been tried and not before.
20043 * statement.cs (Switch.Emit): return the actual coverage for this
20044 statement (returns/not-returns)
20046 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
20047 switch of the statement if we are the last switch section. That
20048 kills two problems: try/catch problems (we used to emit an empty
20049 nop at the end) and switch statements where all branches would
20052 2002-03-19 Miguel de Icaza <miguel@ximian.com>
20054 * driver.cs: Add default assemblies (the equivalent to the
20055 Microsoft CSC.RSP file)
20057 * cs-tokenizer.cs: When updating `cols and setting it to zero,
20058 also update tokens_seen and set it to false.
20060 * driver.cs: Implement --recurse for Mike.
20062 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
20063 correctly splitting out the paths.
20065 2002-03-18 Miguel de Icaza <miguel@ximian.com>
20067 * interface.cs (Interface.PopulateProperty): Instead of using
20068 `parent' as the declaration space for the set parameters, use
20071 * support.cs (InternalParameters): InternalParameters constructor
20072 takes a DeclSpace instead of a TypeContainer.
20074 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
20075 types are being initialized, load the address of it before calling
20078 (New): Provide a mechanism to disable the generation of local
20079 value type temporaries when the caller will be providing us with
20080 an address to store it.
20082 (ArrayCreation.EmitDynamicInitializers): Use it.
20084 2002-03-17 Miguel de Icaza <miguel@ximian.com>
20086 * expression.cs (Invocation.EmitArguments): Only probe for array
20087 property if there is more than one argument. Sorry about that.
20089 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
20090 empty param arrays.
20092 * class.cs (Method.LabelParameters): Fix incorrect code path that
20093 prevented the `ParamArrayAttribute' from being applied to the
20096 2002-03-16 Miguel de Icaza <miguel@ximian.com>
20098 * support.cs (ReflectionParameters): Correctly compute whether the
20099 last argument is a params array. Fixes the problem with
20102 * typemanager.cs: Make the assemblies array always be non-null
20103 (empty, but non-null)
20105 * tree.cs (RecordDecl): New function that abstracts the recording
20106 of names. This reports error 101, and provides a pointer to the
20107 previous declaration. Fixes a crash in the compiler.
20109 * cs-parser.jay (constructor_declaration): Update to new grammar,
20110 and provide a constructor_body that can be empty.
20112 2002-03-15 Miguel de Icaza <miguel@ximian.com>
20114 * driver.cs: Add support for --resources.
20116 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
20117 Make all types for the various array helper methods be integer.
20119 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
20120 CheckState to ConvCast.
20122 (ConvCast): Now it takes a `checked' state argument, to avoid
20123 depending on the emit context for the conversion, and just using
20124 the resolve time setting.
20126 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
20127 instead of Invocation.EmitArguments. We do not emit the original
20128 arguments, instead we emit those which have been converted to
20129 unsigned int expressions.
20131 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
20133 * codegen.cs: ditto.
20135 * expression.cs (LocalVariableReference): Drop the use of the
20136 Store function that depended on the variable index.
20138 * statement.cs (VariableInfo): Drop the `Idx' property from this
20139 class, as this is not taking into account the indexes for
20140 temporaries tat we generate during the execution, getting the
20143 * class.cs: First emit class initializers, then call the parent
20146 * expression.cs (Binary): Fix opcode emision.
20147 (UnaryMutator.EmitCode): Support checked code generation
20149 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
20150 matches for events for both the Static and Instance scans,
20151 pointing to the same element. Fix that.
20153 2002-03-14 Miguel de Icaza <miguel@ximian.com>
20155 * rootcontext.cs (ResolveTree): Always set the
20156 interface_resolve_order, because nested interfaces will be calling
20159 * class.cs (GetInterfaceOrClass): Track the same resolution
20160 process used by TypeManager.LookupType. This fixes the nested
20161 type lookups in class declarations (separate path from
20164 (TypeContainer.DefineType): Also define nested interfaces.
20165 (TypeContainer.RegisterOrder): New public function used to
20166 register the order in which child interfaces need to be closed.
20168 Nested interfaces need to be closed after their parents have been
20171 * interface.cs (InterfaceAttr): Put all the logic for computing
20172 the interface attribute here.
20174 (DefineInterface): Register our interface order with the
20175 RootContext or with the TypeContainer depending on the case.
20177 2002-03-12 Miguel de Icaza <miguel@ximian.com>
20179 * cs-parser.jay: rework foreach statement to work with the new
20180 changes to the policy on SimpleNames.
20182 * report.cs: support Stacktrace on warnings as well.
20184 * makefile: drop --unsafe and /unsafe from the compile.
20186 2002-03-13 Ravi Pratap <ravi@ximian.com>
20188 * ecore.cs (StandardConversionExists): Modify to take an Expression
20189 as the first parameter. Ensure we do null -> reference type conversion
20192 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
20193 temporary Expression objects.
20195 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
20197 * interface.cs: workaround bug in method overloading resolution
20198 (there is already a bugzilla bug for it).
20200 2002-03-12 Miguel de Icaza <miguel@ximian.com>
20202 We could also solve this problem by having a separate path for
20203 performing type lookups, instead of DoResolve, we could have a
20204 ResolveType entry point, and only participating pieces of the
20205 production (simplename, deref, array) would implement this.
20207 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
20208 signal SimpleName to only resolve type names and not attempt to
20209 resolve anything else.
20211 * expression.cs (Cast): Set the flag.
20213 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
20215 * class.cs: Only report 108 if there is no `new' modifier.
20217 * cs-parser.jay: rework foreach statement to work with the new
20218 changes to the policy on SimpleNames.
20220 * report.cs: support Stacktrace on warnings as well.
20222 * makefile: drop --unsafe and /unsafe from the compile.
20224 2002-03-11 Miguel de Icaza <miguel@ximian.com>
20226 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20227 lookups here, instead of doing that at parse time. This means
20228 that our grammar will not introduce `LocalVariableReferences' as
20229 expressions at this point. That solves the problem of code like
20233 static void Main ()
20237 This is only half the fix. The full fix requires parameters to
20238 also be handled in this way.
20240 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
20241 makes the use more obvious of the DeclSpace. The
20242 ec.TypeContainer.TypeBuilder is now only used to pull the
20243 TypeBuilder for it.
20245 My theory is that I can get rid of the TypeBuilder completely from
20246 the EmitContext, and have typecasts where it is used (from
20247 DeclSpace to where it matters).
20249 The only pending problem is that the code that implements Aliases
20250 is on TypeContainer, and probably should go in DeclSpace.
20252 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20253 lookups here, instead of doing that at parse time. This means
20254 that our grammar will not introduce `LocalVariableReferences' as
20255 expressions at this point. That solves the problem of code like
20259 static void Main ()
20263 This is only half the fix. The full fix requires parameters to
20264 also be handled in this way.
20266 * class.cs (Property.DefineMethod): When implementing an interface
20267 method, set newslot, when implementing an abstract method, do not
20268 set the flag (before we tried never setting it, or always setting
20269 it, which is the difference).
20270 (Indexer.DefineMethod): same.
20271 (Method.DefineMethod): same.
20273 * ecore.cs: Only set the status used flag if we get back a Field.
20275 * attribute.cs: Temporary hack, so Paolo can keep working.
20277 2002-03-08 Ravi Pratap <ravi@ximian.com>
20279 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
20280 the unmanaged type in the case we have a MarshalAs attribute.
20282 (Resolve): Handle the case when we are parsing the special MarshalAs
20283 attribute [we need to store the unmanaged type to use later]
20285 * typemanager.cs (marshal_as_attr_type): Built in type for the
20286 MarshalAs Attribute.
20288 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
20289 on parameters and accordingly set the marshalling info.
20291 2002-03-09 Miguel de Icaza <miguel@ximian.com>
20293 * class.cs: Optimizing slightly by removing redundant code after
20294 we switched to the `NoTypes' return value.
20295 (Property.DefineMethod): use NoTypes here too.
20297 This fixes the bug I introduced in my last batch of changes.
20299 2002-03-05 Ravi Pratap <ravi@ximian.com>
20301 * tree.cs (RecordEnum): Add. We now keep track of enums too.
20303 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
20304 Enums since those are types too.
20306 * cs-parser.jay (enum_declaration): Record enums as we parse them.
20308 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
20309 thanks to a call during the lookup process.
20311 2002-03-07 Miguel de Icaza <miguel@ximian.com>
20313 * statement.cs (Foreach): Lots of work to accomodate a particular
20314 kind of foreach statement that I had not kept in mind. It is
20315 possible to have foreachs on classes that provide a GetEnumerator
20316 method that return objects that implement the "pattern" for using
20317 a foreach, there is no need to support GetEnumerator
20320 This is needed to compile nant.
20322 * decl.cs: Only report 114 if the member is not `Finalize' and if
20323 the warning level is at least 2.
20325 * class.cs: Moved the compare function from Method to
20328 (MethodSignature.InheritableMemberSignatureCompare): Add new
20329 filter function that is used to extract inheritable methods from a
20332 (Method.Define): Use the new `inheritable_method_signature_filter'
20335 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
20338 2002-03-06 Miguel de Icaza <miguel@ximian.com>
20340 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
20342 * cs-parser.jay: Add opt_semicolon to the interface declaration.
20344 * expression.cs: Pass location information to
20345 ConvertImplicitStandard.
20347 * class.cs: Added debugging code to track return values from
20350 2002-03-05 Miguel de Icaza <miguel@ximian.com>
20352 * expression.cs (Is.DoResolve): If either side of the `is' is an
20353 interface, do not flag the warning.
20355 * ecore.cs (ImplicitReferenceConversion): We need a separate test
20358 * report.cs: Allow for --fatal to be used with --probe.
20360 * typemanager.cs (NoTypes): Move the definition for the empty Type
20363 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
20365 (TypeContainer.DefineProxy): New function used to proxy to parent
20366 implementations when implementing interfaces.
20367 (TypeContainer.ParentImplements): used to lookup if our parent
20368 implements a public function that is required by an interface.
20369 (TypeContainer.VerifyPendingMethods): Hook this up.
20371 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
20372 `modules' and `assemblies' arraylists into arrays. We only grow
20373 these are the very early start up of the program, so this improves
20374 the speedof LookupType (nicely measured).
20376 * expression.cs (MakeByteBlob): Replaced unsafe code with
20377 BitConverter, as suggested by Paolo.
20379 * cfold.cs (ConstantFold.Binary): Special case: perform constant
20380 folding of string concatenation, but if either side is a string,
20381 and the other is not, then return null, and let the runtime use
20382 the concatenation on the string plus the object (using
20383 `Object.ToString').
20385 2002-03-04 Miguel de Icaza <miguel@ximian.com>
20387 Constant Folding has been implemented now.
20389 * expression.cs (Unary.Reduce): Do not throw an exception, catch
20390 the error instead on types that are not supported in one's
20393 * constant.cs (Constant and all children): New set of functions to
20394 perform implict and explicit conversions.
20396 * ecore.cs (EnumConstant): Implement the new functions to perform
20397 conversion by proxying to the child expression.
20399 * codegen.cs: (ConstantCheckState): Constant evaluation has its
20400 own separate setting that can not be turned off from the command
20401 line using --unchecked or --checked and is only controlled using
20402 the checked/unchecked statements and expressions. This setting is
20403 used by the constant folder to flag errors.
20405 * expression.cs (CheckedExpr, UncheckedExpr): Set the
20406 ConstantCheckState as well.
20408 During Resolve, they also have to flag the state, because the
20409 constant folder runs completely in the Resolve phase.
20411 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
20414 2002-03-01 Miguel de Icaza <miguel@ximian.com>
20416 * cfold.cs: New file, this file contains the constant folder.
20418 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
20419 argument to track whether we are using the resulting address to
20420 load or store a value and provide better error messages.
20422 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
20423 new AddressOf arguments.
20425 * statement.cs (Foreach.EmitCollectionForeach): Update
20427 * expression.cs (Argument.Emit): Call AddressOf with proper
20428 arguments to track usage.
20430 (New.DoEmit): Call AddressOf with new arguments.
20432 (Unary.Emit): Adjust AddressOf call.
20434 2002-03-01 Ravi Pratap <ravi@ximian.com>
20436 * cs-parser.jay (member_access): Change the case for pre-defined types
20437 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
20440 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
20443 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
20444 essentially like methods and apply attributes like MethodImplOptions to them too.
20446 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
20449 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
20450 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
20453 * Update code everywhere accordingly.
20455 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
20457 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
20459 2002-02-28 Ravi Pratap <ravi@ximian.com>
20461 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
20462 try performing lookups against those instead of jumping straight into using
20463 the 'using' clauses.
20465 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
20467 (LookupType): Perform lookups in implicit parents too.
20469 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
20470 sequence as RootContext.LookupType.
20472 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
20473 the various cases of namespace lookups into this method.
20475 2002-03-01 Miguel de Icaza <miguel@ximian.com>
20477 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
20478 in positional arguments)
20480 * class.cs (Operator): Update the AllowedModifiers to contain
20483 * cs-parser.jay: Update operator declaration to allow for the
20484 operator body to be empty.
20486 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
20489 2002-02-27 Miguel de Icaza <miguel@ximian.com>
20491 * class.cs (Method.Emit): Label parameters.
20493 * driver.cs: Return 1 or 0 as the program exit code.
20495 2002-02-26 Miguel de Icaza <miguel@ximian.com>
20497 * expression.cs: Special case the `null' object when trying to
20498 auto-compute the type, as anything can be explicitly converted to
20501 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
20502 spotting this Paolo.
20504 (Expression.ImplicitNumericConversion): Perform comparissions of
20505 the type using the underlying type in the case of an enumeration
20506 rather than using the enumeration type for the compare.
20508 Cope with the underlying == type case, which is not possible to
20511 (Expression.ConvertNumericExplicit): Perform comparissions of
20512 the type using the underlying type in the case of an enumeration
20513 rather than using the enumeration type for the compare.
20515 * driver.cs: If the user does not supply an extension, assume .exe
20517 * cs-parser.jay (if_statement): Rewrote so that we can track the
20518 location for the if statement.
20520 * expression.cs (Binary.ConstantFold): Only concat strings when
20521 the operation is "+", not everything ;-)
20523 * statement.cs (Statement.EmitBoolExpression): Take a location
20525 (If, While, Do): Track location.
20527 * expression.cs (Binary.ResolveOperator): In the object + string
20528 case, I was missing a call to ConvertImplicit
20530 2002-02-25 Ravi Pratap <ravi@ximian.com>
20532 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
20533 Location arguments. Ensure we use RootContext.LookupType to do our work
20534 and not try to do a direct Type.GetType and ModuleBuilder.GetType
20536 * interface.cs (PopulateMethod): Handle the type of the parameter being
20539 * expression.cs (Invocation.BetterFunction): Handle the case when we
20540 have a params method with no fixed arguments and a call is made with no
20543 2002-02-25 Miguel de Icaza <miguel@ximian.com>
20545 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
20546 the verbatim-string-literal
20548 * support.cs (InternalParameters.ParameterModifier): handle null
20550 (InternalParameters.ParameterType): ditto.
20552 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
20553 duplicating the name of the variable parameter.
20554 (GetParameterByName): Fix bug where we were not looking up array
20555 paramters if they were the only present (thanks Paolo!).
20556 (GetParameterInfo): We only have an empty set of types if both
20557 fixed and array are set to null.
20558 (GetParameterInfo-idx): Handle FixedParameter == null
20560 * cs-parser.jay: Handle the case where there is no catch
20561 statements (missing null test).
20563 2002-02-22 Miguel de Icaza <miguel@ximian.com>
20565 * driver.cs (MainDriver): Be conservative on our command line
20568 Catch DirectoryNotFoundException when calling GetFiles.
20570 (SplitPathAndPattern): Used to split the input specification into
20571 a path and a pattern that we can feed to Directory.GetFiles.
20573 2002-02-21 Miguel de Icaza <miguel@ximian.com>
20575 * statement.cs (Fixed): Implement the last case of the Fixed
20576 statement (string handling).
20578 * expression.cs (StringPtr): New class used to return a char * to
20579 a string; Used by the Fixed statement.
20581 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
20583 * expression.cs (Binary.ResolveOperator): Remove redundant
20584 MemberLookup pn parent type.
20585 Optimize union call, we do not need a union if the types are the same.
20586 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
20589 Specialize the use of MemberLookup everywhere, instead of using
20590 the default settings.
20592 (StackAlloc): Implement stackalloc keyword.
20594 * cs-parser.jay: Add rule to parse stackalloc.
20596 * driver.cs: Handle /h, /help, /?
20598 * expression.cs (MakeByteBlob): Removed the hacks we had in place
20599 before we supported unsafe code.
20601 * makefile: add --unsafe to the self compilation of mcs.
20603 2002-02-20 Miguel de Icaza <miguel@ximian.com>
20605 * expression.cs (PointerArithmetic): New class that is used to
20606 perform pointer arithmetic.
20607 (Binary.Resolve): Handle pointer arithmetic
20608 Handle pointer comparission.
20609 (ArrayPtr): Utility expression class that is used to take the
20610 address of an array.
20612 (ElementAccess): Implement array access for pointers
20614 * statement.cs (Fixed): Implement fixed statement for arrays, we
20615 are missing one more case before we are done.
20617 * expression.cs (Indirection): Implement EmitAssign and set the
20618 ExprClass to Variable. This allows pointer dereferences to be
20619 treated as variables, and to have values assigned to them.
20621 * ecore.cs (Expression.StoreFromPtr): New utility function to
20622 store values dereferencing.
20624 2002-02-20 Ravi Pratap <ravi@ximian.com>
20626 * expression.cs (Binary.ResolveOperator): Ensure that we are
20627 not trying to operate on a void type - this fixes the reported
20630 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
20631 the parent implementation is sealed.
20633 * ../errors/cs0239.cs : Add.
20635 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20637 * typemanager.cs (unverifiable_code_type): Corresponds to
20638 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20639 which have unsafe code in them.
20641 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
20644 2002-02-19 Miguel de Icaza <miguel@ximian.com>
20646 * cs-tokenizer.cs: Add support for @"litreal strings"
20648 Make tokenizer accept pre-processor directives
20649 on any column (remove the old C-like limitation).
20651 * rootcontext.cs (EmitCode): Emit any global attributes.
20652 (AddGlobalAttributes): Used to keep track of assembly attributes.
20654 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20656 * cs-parser.jay: Add support for global attributes.
20658 2002-02-17 Miguel de Icaza <miguel@ximian.com>
20660 * expression.cs (Indirection): New helper class. Unary will
20661 create Indirection classes to be able to implement the
20662 IMemoryLocation interface on it.
20664 2002-02-16 Miguel de Icaza <miguel@ximian.com>
20666 * cs-parser.jay (fixed_statement): reference the right statement.
20668 * statement.cs (Fixed.Emit): Finish implementing the fixed
20669 statement for the &x case.
20671 2002-02-14 Miguel de Icaza <miguel@ximian.com>
20673 * class.cs (Property.Define, Method.Define): Remove newslot when
20676 * modifiers.cs: My use of NewSlot when `Abstract' was set was
20677 wrong. NewSlot should only be used if the `new' keyword is present.
20679 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20680 locating our system dir. Sorry about this.
20682 2002-02-13 Miguel de Icaza <miguel@ximian.com>
20684 * driver.cs (GetSystemDir): Compute correctly the location of our
20685 system assemblies. I was using the compiler directory instead of
20686 the library directory.
20688 2002-02-13 Ravi Pratap <ravi@ximian.com>
20690 * expression.cs (BetterFunction): Put back in what Miguel commented out
20691 since it is the correct fix. The problem is elsewhere ;-)
20693 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20694 parameters of the parms method are themselves compatible or not !
20696 (StandardConversionExists): Fix very dangerous bug where we were forgetting
20697 to check that a class implements an interface before saying that an implicit
20698 conversion was allowed. Use ImplementsInterface to do the checking.
20700 2002-02-13 Miguel de Icaza <miguel@ximian.com>
20702 * class.cs (Method.Define): Track whether we are an explicit
20703 implementation or not. And only call DefineMethodOverride if we
20704 are an explicit implementation.
20706 (Property.DefineMethod): Ditto.
20708 2002-02-11 Ravi Pratap <ravi@ximian.com>
20710 * expression.cs (BetterFunction): Catch hideous bug which was
20711 preventing us from detecting ambiguous calls due to implicit casts i.e
20714 2002-01-29 Miguel de Icaza <miguel@ximian.com>
20716 * support.cs (Pair): Remove un-needed method. I figured why I was
20717 getting the error in cs-parser.jay, the variable in a foreach loop
20718 is readonly, and the compiler does not really treat this as a variable.
20720 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
20721 instead of EQUALS in grammar.
20723 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
20725 * expression.cs (Unary.DoResolve): Check whether the argument is
20728 2002-01-28 Miguel de Icaza <miguel@ximian.com>
20730 * support.cs: Api for Pair to set a value. Despite the fact that
20731 the variables are public the MS C# compiler refuses to compile
20732 code that accesses the field if the variable is part of a foreach
20735 * statement.cs (Fixed): Begin implementation of the fixed
20738 (Block.AddVariable): Return the VariableInfo on success and null
20739 on failure instead of true/false.
20741 * cs-parser.jay (foreach): Catch errors on variables already
20742 defined (we were ignoring this value before) and properly unwind
20743 the block hierarchy
20745 (fixed_statement): grammar for the fixed statement.
20747 2002-01-25 Miguel de Icaza <miguel@ximian.com>
20749 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20750 pointer types to be incretemented.
20752 (SizeOf): Implement.
20754 * cs-parser.jay (pointer_member_access): Implement
20755 expr->IDENTIFIER production.
20757 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20758 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20761 (Unary): Implement indirection.
20763 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20764 use in non-unsafe context).
20766 (SimpleName.DoResolve): Check for pointers in field access on safe
20769 (Expression.LoadFromPtr): Factor the load-indirect code in this
20770 function. This was duplicated in UnboxCast and ParameterReference
20772 2002-01-24 Miguel de Icaza <miguel@ximian.com>
20774 * expression.cs (ComposedCast): report an error if a pointer cast
20775 is used in a safe region.
20777 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20778 pointer type casts in unsafe context.
20780 * codegen.cs (EmitContext): Set up IsUnsafe.
20782 * cs-parser.jay (non_expression_type): Add productions for pointer
20785 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20786 code. We should not use force into static mode if the method is
20787 not virtual. Fixes bug in MIS
20789 * statement.cs (Do.Emit, While.Emit, For.Emit,
20790 Statement.EmitBoolExpression): Add support to Do and While to
20791 propagate infinite loop as `I do return' semantics.
20793 Improve the For case to also test for boolean constants.
20795 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20796 to the list of attributes we can add.
20798 Remove `EmitContext' argument.
20800 * class.cs (Method.Define): Apply parameter attributes.
20801 (Constructor.Define): Apply parameter attributes.
20802 (MethodCore.LabelParameters): Move here the core of labeling
20805 * support.cs (ReflectionParameters.ParameterModifier,
20806 InternalParameters.ParameterModifier): Use IsByRef on the type and
20807 only return the OUT bit for these parameters instead of in/out/ref
20810 This is because I miss-understood things. The ParameterInfo.IsIn
20811 and IsOut represent whether the parameter has the [In] and [Out]
20814 2002-01-22 Miguel de Icaza <miguel@ximian.com>
20816 * ecore.cs (FieldExpr.Emit): Release temporaries.
20818 * assign.cs (LocalTemporary.Release): new function.
20820 * codegen.cs (EmitContext.GetTemporaryStorage,
20821 EmitContext.FreeTemporaryStorage): Rework the way we deal with
20822 temporary storage. Now we can "put back" localbuilders when we
20825 2002-01-21 Miguel de Icaza <miguel@ximian.com>
20827 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20828 need to make a copy of the variable to generate verifiable code.
20830 2002-01-19 Miguel de Icaza <miguel@ximian.com>
20832 * driver.cs: Compute dynamically the system directory.
20834 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20835 Slower, but more generally useful. Used by the abstract
20836 registering implementation.
20838 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20839 the rules for the special rule on Type/instances. First check if
20840 we have the same name, and if so, try that special static path
20841 rather than the instance path.
20843 2002-01-18 Miguel de Icaza <miguel@ximian.com>
20845 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20848 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20849 Enum, ValueType, Delegate or Array for non-corlib compiles.
20851 * cs-tokenizer.cs: Catch long identifiers (645)
20853 * typemanager.cs (IndexerPropetyName): Ravi never tested this
20856 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20857 fix, we were returning too early, so we were not registering
20858 pending methods from abstract classes.
20860 Do not register pending methods if the class is abstract.
20862 * expression.cs (Conditional.DoResolve): Report circular implicit
20863 conversions when we neecd to compute it for conditional
20866 (Is.DoResolve): If the expression is always of the provided type,
20867 flag warning 183. If the expression can not ever be of the
20868 provided type flag warning 184.
20870 * class.cs: Catch 169 as well.
20872 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20875 2002-01-18 Nick Drochak <ndrochak@gol.com>
20877 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
20879 2002-01-17 Miguel de Icaza <miguel@ximian.com>
20881 * interface.cs: (PopulateMethod): Check for pointers being defined
20882 only if the unsafe context is active.
20883 (PopulateProperty): ditto.
20884 (PopulateIndexer): ditto.
20886 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20887 specified. If pointers are present, make sure that they are
20888 present in an unsafe context.
20889 (Constructor, Constructor.Define): ditto.
20890 (Field, Field.Define): ditto.
20891 (Property, Property.Define): ditto.
20892 (Event, Event.Define): ditto.
20894 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
20895 hashtable if there are classes or structs defined.
20897 * expression.cs (LocalVariableReference.DoResolve): Simplify this
20898 code, as the constant resolution moved.
20900 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
20901 the metadata, so we can flag error 133.
20903 * decl.cs (MemberCore.UnsafeOK): New function to test that a
20904 pointer is being declared in an unsafe context.
20906 2002-01-16 Miguel de Icaza <miguel@ximian.com>
20908 * modifiers.cs (Modifiers.Check): Require a Location argument.
20909 Report error 227 for Unsafe use.
20911 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
20913 * statement.cs (For.Emit): If the test is null, then report that
20914 we do `return', as we wont reach anything afterwards.
20916 (Switch.SwitchGoverningType): Track the expression that matched
20919 * driver.cs: Allow negative numbers as an error code to flag.
20921 * cs-parser.jay: Handle 1551.
20923 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
20925 2002-01-15 Miguel de Icaza <miguel@ximian.com>
20927 * cs-parser.jay: Report 1518 (type declaration can only contain
20928 class, struct, interface, enum or delegate)
20930 (switch_label): Report 1523 (keywords `case' or `default' must
20933 (opt_switch_sections): Report 1522 (empty switch)
20935 * driver.cs: Report 1515 (response file specified multiple times)
20936 Report 1516 (Source file specified multiple times).
20938 * expression.cs (Argument.Resolve): Signal 1510
20940 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20941 access not allowed in static code)
20943 2002-01-11 Ravi Pratap <ravi@ximian.com>
20945 * typemanager.cs (IsPointerType): Utility method which we are going
20948 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20949 the object type, so we take care of that.
20951 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20953 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20954 added to non-params parameters :-)
20956 * typemanager.cs (CSharpName): Include 'void' type too.
20958 (void_ptr_type): Include in the set of core types.
20960 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
20963 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
20966 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
20967 completely forgotten about it.
20969 2002-01-10 Ravi Pratap <ravi@ximian.com>
20971 * cs-parser.jay (pointer_type): Add. This begins our implementation
20972 of parsing rules for unsafe code.
20974 (unsafe_statement): Implement.
20976 (embedded_statement): Modify to include the above.
20978 * statement.cs (Unsafe): Implement new class for unsafe blocks.
20980 * codegen.cs (EmitContext.InUnsafe): Add. This determines
20981 if the current context is an unsafe one.
20983 * cs-parser.jay (local_variable_pointer_type): Since local variable types
20984 are handled differently, we need separate rules for them.
20986 (local_variable_declaration): Update to use local_variable_pointer_type
20987 to allow variable declarations of unmanaged pointer types.
20989 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20990 in unsafe contexts.
20992 * ../errors/cs0214.cs : Add.
20994 2002-01-16 Nick Drochak <ndrochak@gol.com>
20996 * makefile: remove 'response' file when cleaning.
20998 2002-01-15 Miguel de Icaza <miguel@ximian.com>
21000 * cs-parser.jay: Report 1524.
21002 2002-01-14 Miguel de Icaza <miguel@ximian.com>
21004 * typemanager.cs (RegisterMethod): drop checking if we have
21005 registered this from here
21007 2002-01-12 Miguel de Icaza <miguel@ximian.com>
21009 * class.cs (Method.EmitDestructor): Implement calling our base
21012 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
21013 value of InFinally.
21015 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
21016 this routine and will wrap the call in a try/catch block. Deal
21019 2002-01-11 Miguel de Icaza <miguel@ximian.com>
21021 * ecore.cs (Expression.MemberLookup): instead of taking a
21022 parameter `same_type' that was used to tell whether we could
21023 access private members we compute our containing type from the
21026 (FieldExpr): Added partial support for volatile fields. This does
21027 not work for volatile fields exposed from assemblies, as I can not
21028 figure out how to extract the modreq from it.
21030 Updated all the source files to use this.
21032 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
21033 because it is referenced by MemberLookup very often.
21035 2002-01-09 Ravi Pratap <ravi@ximian.com>
21037 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
21038 TypeBuilder.GetCustomAttributes to retrieve what we need.
21040 Get rid of redundant default_member_attr_type as this is the same as
21041 default_member_type which already exists.
21043 * interface.cs, attribute.cs : Update accordingly.
21045 2002-01-08 Miguel de Icaza <miguel@ximian.com>
21047 * typemanager.cs: Enable IndexerPropertyName again. It does not
21048 work for TYpeBuilders though. Ravi, can you please fix this?
21050 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
21052 * expression.cs (Argument.Emit): Handle the case of ref objects
21053 being passed to ref functions;
21055 (ParameterReference.EmitLoad): Loads the content of the pointer
21056 without dereferencing.
21058 2002-01-07 Miguel de Icaza <miguel@ximian.com>
21060 * cs-tokenizer.cs: Implemented the pre-processing expressions.
21062 2002-01-08 Ravi Pratap <ravi@ximian.com>
21064 * class.cs (Indexer.DefineMethod): Incorporate the interface
21065 type in the name of the method if we are doing explicit interface
21068 * expression.cs (ConversionExists): Remove as it is completely obsolete.
21070 (BetterConversion): Fix extremely trivial bug where we were referring to
21071 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
21074 * ../errors/bug16.cs : Add although we have fixed it.
21076 2002-01-07 Miguel de Icaza <miguel@ximian.com>
21078 * expression.cs (BaseIndexer): Begin implementation.
21080 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
21082 * cs-parser.jay (indexer_declarator): Use qualified_identifier
21083 production directly to remove a shift/reduce, and implement
21084 explicit interface implementation.
21086 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
21087 after a floating point suffix.
21089 * expression.cs (DoNumericPromotions): Improved the conversion for
21090 uint/uint. If we have a constant, we avoid doing a typecast to a
21093 * class.cs (Indexer): Implement explicit interface implementation
21096 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
21098 * class.cs: make the default instance constructor public and hidebysig.
21100 2001-01-03 Ravi Pratap <ravi@ximian.com>
21102 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
21103 so we can call it from elsewhere.
21105 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
21106 we emit it internally if the class has a defined indexer; otherwise the user
21107 emits it by decorating the class definition with the DefaultMemberAttribute.
21109 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
21110 attribute is not used on a type which defines an indexer.
21112 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
21113 character when we skip whitespace.
21115 * ../errors/cs0646.cs : Add.
21117 2002-01-03 Miguel de Icaza <miguel@ximian.com>
21119 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
21122 * makefile: Add practical target `mcs3.exe' which builds the third
21123 generation compiler.
21125 * expression.cs (New): Fix structures constructor calling.
21127 * class.cs (Property, Method, Indexer): Emit Final flag on the
21128 method if we are an interface implementation and we are not
21131 * ecore.cs (PropertyExpr): New public field `IsBase', tells
21132 whether this property is referencing a `base' method.
21134 * expression.cs (Invocation.EmitCall): take an extra argument:
21135 is_base, this is used to determine whether the `call' or
21136 `callvirt' opcode should be used.
21139 * delegate.cs: update EmitCall.
21141 * class.cs (Method.Define): Set NewSlot for the cases where we are
21142 not implementing an interface method.
21144 (Property.Define): ditto.
21146 2002-01-02 Miguel de Icaza <miguel@ximian.com>
21148 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
21149 'r'. Allows mcs to parse itself fully.
21151 2002-01-02 Ravi Pratap <ravi@ximian.com>
21153 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
21154 of the number of initializers that require the InitializeArray method.
21156 (CheckIndices): Store the Expression in all cases - not the plain value. Also
21157 update the above field where necessary.
21159 (MakeByteBlob): Update accordingly.
21161 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
21164 (EmitDynamicInitializers): Update in accordance with the new optimization.
21166 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
21167 same OpCode applies.
21169 * cs-parser.jay : Fix some glaring errors I introduced.
21171 2002-01-01 Ravi Pratap <ravi@ximian.com>
21173 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
21174 so that we can check for name clashes there too.
21176 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
21177 for interface indexers.
21179 * interfaces.cs (Define): Emit the default member attribute.
21181 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
21182 variable was being referred to while setting the value ;-)
21184 2002-01-01 Miguel de Icaza <miguel@ximian.com>
21186 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
21187 byte-by-byte information when we know the data is zero.
21189 Make the block always a multiple of 4, because
21190 DefineInitializedData has a bug.
21192 * assign.cs: Fix, we should assign from the temporary, not from
21195 * expression.cs (MakeByteBlob): Fix my incorrect code.
21197 2001-12-31 Miguel de Icaza <miguel@ximian.com>
21199 * typemanager.cs (EnumToUnderlying): This function is used to get
21200 the underlying type from an enumeration, because it does not
21203 * constant.cs: Use the I4_S form for values between -128 and 127.
21205 * statement.cs (Block.LookupLabel): Looks up a label.
21206 (Block): Drop support for labeled blocks.
21208 (LabeledStatement): New kind of statement that represents a label
21211 (Goto): Finally implement this bad boy.
21213 * cs-parser.jay: Update to reflect new mechanism to implement
21216 2001-12-30 Miguel de Icaza <miguel@ximian.com>
21218 * codegen.cs (EmitContext.This): a codegen property that keeps the
21219 a single instance of this instead of creating many different this
21222 * delegate.cs (Delegate.DoResolve): Update to use the property;
21224 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
21226 * expression.cs (BaseAccess.DoResolve): Ditto.
21228 2001-12-29 Ravi Pratap <ravi@ximian.com>
21230 * typemanager.cs (methodimpl_attr_type): Add to hold the type
21231 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
21233 (InitCoreTypes): Update accordingly.
21235 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
21236 so we can quickly store the state.
21238 (ApplyAttributes): Set the correct implementation flags
21239 for InternalCall methods.
21241 2001-12-29 Miguel de Icaza <miguel@ximian.com>
21243 * expression.cs (EmitCall): if a method is not virtual, then do
21244 not use callvirt on it.
21246 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
21247 user defined stuff) requires the use of stobj, which takes an
21248 address on the stack instead of an array and an index. So emit
21249 the Ldelema operation for it.
21251 (EmitStoreOpcode): Use stobj for valuetypes.
21253 (UnaryMutator.EmitCode): Use the right 1 value depending on
21254 whether we are dealing with int64/uint64, float or doubles.
21256 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
21257 constructors that I implemented last night.
21259 (Constructor.IsDefault): Fix to work properly for static
21262 * cs-parser.jay (CheckDef): report method signature errors.
21263 Update error number 103 to be 132.
21265 * decl.cs: New AdditionResult enumeration value: MethodExists.
21266 Although we do this check for methods later on in the semantic
21267 analysis, catching repeated default constructors is so easy that
21268 we catch these here.
21270 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
21273 (ParameterReference.EmitAssign, Emit): handle
21276 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
21277 (ArrayAccess.EmitStoreOpcode): ditto.
21279 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
21281 * expression.cs (MakeByteBlob): Complete all the missing types
21282 (uint, short, ushort, byte, sbyte)
21284 * class.cs: Only init instance field initializers on instance
21287 Rename `constructors' to instance_constructors.
21289 (TypeContainer.AddConstructor): Only add constructors to the list
21290 if it is not static.
21292 Make sure that we handle default_static_constructor independently
21293 everywhere where we handle instance_constructors
21295 2001-12-28 Miguel de Icaza <miguel@ximian.com>
21297 * class.cs: Do not lookup or create a base initializer for a
21298 static constructor.
21300 (ConstructorInitializer.Resolve): use the proper type to lookup
21303 * cs-parser.jay: Report error 1585 (modifiers between type and name).
21305 * enum.cs, interface.cs: Remove CloseType, this is taken care by
21308 * decl.cs: CloseType is now an virtual method, the default
21309 implementation just closes this type.
21311 2001-12-28 Ravi Pratap <ravi@ximian.com>
21313 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
21314 to PreserveSig by default. Also emit HideBySig on such methods.
21316 Basically, set the defaults to standard values.
21318 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
21319 argument, if candidate is better, it can't be worse than the best !
21321 (Invocation): Re-write bits to differentiate between methods being
21322 applicable in their expanded form and their normal form - for params
21325 Get rid of use_standard everywhere as only standard conversions are allowed
21326 in overload resolution.
21328 More spec conformance.
21330 2001-12-27 Miguel de Icaza <miguel@ximian.com>
21332 * driver.cs: Add --timestamp, to see where the compiler spends
21335 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
21336 `this' in static code.
21338 (SimpleName.DoResolve): Implement in terms of a helper function
21339 that allows static-references to be passed upstream to
21342 (Expression.ResolveWithSimpleName): Resolve specially simple
21343 names when called by MemberAccess to implement the special
21346 (Expression.ImplicitReferenceConversion): Handle conversions from
21347 Null to reference types before others, as Null's type is
21350 * expression.cs (Invocation.EmitCall): Handle the special case of
21351 calling methods declared on a reference type from a ValueType
21352 (Base classes System.Object and System.Enum)
21354 (MemberAccess.Resolve): Only perform lookups on Enumerations if
21355 the left hand side is a TypeExpr, not on every enumeration.
21357 (Binary.Resolve): If types are reference types, then do a cast to
21358 object on operators != and == of both arguments.
21360 * typemanager.cs (FindMembers): Extract instance and static
21361 members if requested.
21363 * interface.cs (PopulateProperty): Use void_type instead of null
21364 as the return type for the setter method.
21366 (PopulateIndexer): ditto.
21368 2001-12-27 Ravi Pratap <ravi@ximian.com>
21370 * support.cs (ReflectionParameters): Fix minor bug where we
21371 were examining the wrong parameter for the ParamArray attribute.
21373 Cope with requests for the type of the parameter at position
21374 greater than the params parameter's. We now return the element
21375 type of the params array as that makes more sense.
21377 * expression.cs (Invocation.IsParamsMethodApplicable): Update
21378 accordingly as we no longer have to extract the element type
21381 (Invocation.OverloadResolve): Update.
21383 2001-12-27 Miguel de Icaza <miguel@ximian.com>
21385 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
21386 against IEnumerator, test whether the return value is a descendant
21387 of the IEnumerator interface.
21389 * class.cs (Indexer.Define): Use an auxiliary method to implement
21390 the other bits of the method definition. Begin support for
21391 explicit interface implementation.
21393 (Property.DefineMethod): Use TypeManager.void_type instead of null
21394 for an empty return value.
21396 2001-12-26 Miguel de Icaza <miguel@ximian.com>
21398 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
21399 dealing with a FieldExpr which is composed of a FieldBuilder, in
21400 the code path we did extract the constant, but we should have
21401 obtained the underlying value to be able to cast it (otherwise we
21402 end up in an infinite loop, this is what Ravi was running into).
21404 (ArrayCreation.UpdateIndices): Arrays might be empty.
21406 (MemberAccess.ResolveMemberAccess): Add support for section
21407 14.5.4.1 that deals with the special case of E.I when E is a type
21408 and something else, that I can be a reference to a static member.
21410 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
21411 handle a particular array type to create byte blobs, it is just
21412 something we dont generate byteblobs for.
21414 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
21417 * location.cs (Push): remove the key from the hashtable that we
21418 are about to add. This happens for empty files.
21420 * driver.cs: Dispose files after we have parsed them.
21422 (tokenize): new function that only runs the tokenizer on its
21423 input, for speed testing.
21425 2001-12-26 Ravi Pratap <ravi@ximian.com>
21427 * class.cs (Event.Define): Define the private field only if there
21428 are no accessors defined.
21430 * expression.cs (ResolveMemberAccess): If there is no associated
21431 field with the event, that means we have an event defined with its
21432 own accessors and we should flag error cs0070 since transforming
21433 ourselves into a field is not valid in that case.
21435 * ecore.cs (SimpleName.DoResolve): Same as above.
21437 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
21438 and charset to sane values.
21440 2001-12-25 Ravi Pratap <ravi@ximian.com>
21442 * assign.cs (DoResolve): Perform check on events only if they
21443 are being accessed outside the declaring type.
21445 * cs-parser.jay (event_declarations): Update rules to correctly
21446 set the type of the implicit parameter etc.
21448 (add_accessor, remove_accessor): Set current local parameters.
21450 * expression.cs (Binary): For delegate addition and subtraction,
21451 cast the return value from the method into the appropriate delegate
21454 2001-12-24 Ravi Pratap <ravi@ximian.com>
21456 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
21457 of these as the workaround is unnecessary.
21459 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
21460 delegate data - none of that is needed at all.
21462 Re-write bits to extract the instance expression and the delegate method
21465 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
21468 * attribute.cs (ApplyAttributes): New method to take care of common tasks
21469 of attaching attributes instead of duplicating code everywhere.
21471 * everywhere : Update code to do attribute emission using the above method.
21473 2001-12-23 Miguel de Icaza <miguel@ximian.com>
21475 * expression.cs (IsParamsMethodApplicable): if there are not
21476 parameters, return immediately.
21478 * ecore.cs: The 0 literal can be implicity converted to an enum
21481 (SimpleName.DoResolve): First lookup the type, then lookup the
21484 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
21485 want to get its address. If the InstanceExpression is not
21486 addressable, store the result in a temporary variable, then get
21489 * codegen.cs: Only display 219 errors on warning level or above.
21491 * expression.cs (ArrayAccess): Make it implement the
21492 IMemoryLocation interface.
21494 (Binary.DoResolve): handle the operator == (object a, object b)
21495 and operator != (object a, object b) without incurring into a
21496 BoxedCast (because 5 != o should never be performed).
21498 Handle binary enumerator operators.
21500 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
21501 value type, otherwise use Ldelem_ref.
21503 Use precomputed names;
21505 (AddressOf): Implement address of
21507 * cs-parser.jay (labeled_statement): Fix recursive block
21508 addition by reworking the production.
21510 * expression.cs (New.DoEmit): New has a special case:
21512 If we are dealing with a ValueType, we have a few
21513 situations to deal with:
21515 * The target of New is a ValueType variable, that is
21516 easy, we just pass this as the variable reference
21518 * The target of New is being passed as an argument,
21519 to a boxing operation or a function that takes a
21522 In this case, we need to create a temporary variable
21523 that is the argument of New.
21526 2001-12-23 Ravi Pratap <ravi@ximian.com>
21528 * rootcontext.cs (LookupType): Check that current_type is not null before
21529 going about looking at nested types.
21531 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
21532 not implement the IAssignMethod interface any more.
21534 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
21535 where we tranform them into FieldExprs if they are being resolved from within
21536 the declaring type.
21538 * ecore.cs (SimpleName.DoResolve): Do the same here.
21540 * assign.cs (DoResolve, Emit): Clean up code considerably.
21542 * ../errors/bug10.cs : Add.
21544 * ../errors/cs0070.cs : Add.
21546 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
21548 * assign.cs : Get rid of EventIsLocal everywhere.
21550 2001-12-23 Miguel de Icaza <miguel@ximian.com>
21552 * ecore.cs (ConvertIntLiteral): finished the implementation.
21554 * statement.cs (SwitchLabel): Convert the value we are using as a
21555 key before looking up the table.
21557 2001-12-22 Miguel de Icaza <miguel@ximian.com>
21559 * codegen.cs (EmitTopBlock): Require a Location argument now.
21561 * cs-parser.jay (constructor_declarator): We need to setup
21562 current_local_parameters before we parse the
21563 opt_constructor_initializer, to allow the variables to be bound
21564 to the constructor arguments.
21566 * rootcontext.cs (LookupType): First lookup nested classes in our
21567 class and our parents before we go looking outside our class.
21569 * expression.cs (ConstantFold): Extract/debox the values at the
21572 * rootcontext.cs (EmitCode): Resolve the constants first before we
21573 resolve the types. This is not really needed, but it helps debugging.
21575 * statement.cs: report location.
21577 * cs-parser.jay: pass location to throw statement.
21579 * driver.cs: Small bug fix.
21581 * report.cs: Updated format to be 4-zero filled digits.
21583 2001-12-22 Ravi Pratap <ravi@ximian.com>
21585 * expression.cs (CheckIndices): Fix minor bug where the wrong
21586 variable was being referred to ;-)
21588 (DoEmit): Do not call EmitStaticInitializers when the
21589 underlying type is System.Object.
21591 2001-12-21 Ravi Pratap <ravi@ximian.com>
21593 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
21594 and do the usual workaround for SRE.
21596 * class.cs (MyEventBuilder.EventType): New member to get at the type
21597 of the event, quickly.
21599 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
21601 * assign.cs (Assign.DoResolve): Handle the case when the target
21602 is an EventExpr and perform the necessary checks.
21604 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
21607 (SimpleName.MemberStaticCheck): Include check for EventExpr.
21609 (EventExpr): Set the type in the constructor itself since we
21610 are meant to be born fully resolved.
21612 (EventExpr.Define): Revert code I wrote earlier.
21614 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
21615 instance expression is null. The instance expression is a This in that case
21616 or a null, depending on whether it is a static method or not.
21618 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
21619 refers to more than one method.
21621 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
21622 and accordingly flag errors.
21624 2001-12-21 Miguel de Icaza <miguel@ximian.com>
21626 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
21628 2001-12-22 Miguel de Icaza <miguel@ximian.com>
21630 * location.cs (ToString): Provide useful rutine.
21632 2001-12-21 Miguel de Icaza <miguel@ximian.com>
21634 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21635 objects, return the actual integral boxed.
21637 * statement.cs (SwitchLabel): define an ILLabel for each
21640 (Switch.CheckSwitch): If the value is a Literal, extract
21641 the underlying literal.
21643 Also in the unused hashtable we had, add the SwitchLabel so we can
21644 quickly look this value up.
21646 * constant.cs: Implement a bunch of new constants. Rewrite
21647 Literal based on this. Made changes everywhere to adapt to this.
21649 * expression.cs (Expression.MakeByteBlob): Optimize routine by
21650 dereferencing array only once, and also copes with enumrations.
21652 bytes are two bytes wide, not one.
21654 (Cast): Perform constant conversions.
21656 * ecore.cs (TryImplicitIntConversion): Return literals instead of
21657 wrappers to the literals here.
21659 * expression.cs (DoNumericPromotions): long literals can converted
21660 to ulong implicity (this is taken care of elsewhere, but I was
21661 missing this spot).
21663 * ecore.cs (Expression.Literalize): Make the return type Literal,
21664 to improve type checking.
21666 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21668 2001-12-20 Miguel de Icaza <miguel@ximian.com>
21670 * literal.cs: Revert code from ravi that checked the bounds. The
21671 bounds are sane by the definition of the type itself.
21673 * typemanager.cs: Fix implementation of ImplementsInterface. We
21674 need to actually look up in our parent hierarchy for interfaces
21677 * const.cs: Use the underlying type for enumerations
21679 * delegate.cs: Compute the basename for the delegate creation,
21680 that should fix the delegate test case, and restore the correct
21681 Type Lookup semantics in rootcontext
21683 * rootcontext.cs: Revert Ravi's last patch. The correct way of
21684 referencing a nested type with the Reflection API is using the "+"
21687 * cs-parser.jay: Do not require EOF token at the end.
21689 2001-12-20 Ravi Pratap <ravi@ximian.com>
21691 * rootcontext.cs (LookupType): Concatenate type names with
21692 a '.' instead of a '+' The test suite passes again.
21694 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21695 field of the enumeration.
21697 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21698 the case when the member is an EventExpr.
21700 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21701 static has an associated instance expression.
21703 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21705 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21707 * class.cs (Event.Define): Register event and perform appropriate checks
21710 We define the Add and Remove methods even if the use provides none because
21711 in that case, we provide default implementations ourselves.
21713 Define a private field of the type of the event. This is done by the CSC compiler
21714 and we should be doing it too ;-)
21716 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
21717 More methods we use in code we generate.
21719 (multicast_delegate_type, delegate_type): Two separate types since the distinction
21722 (InitCoreTypes): Update accordingly for the above.
21724 * class.cs (Event.Emit): Generate code for default accessors that we provide
21726 (EmitDefaultMethod): Do the job in the above.
21728 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
21731 2001-12-20 Miguel de Icaza <miguel@ximian.com>
21733 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
21734 builders even if we were missing one.
21736 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
21737 pass the Basename as our class name instead of the Name. The
21738 basename will be correctly composed for us.
21740 * parameter.cs (Paramters): Now takes a Location argument.
21742 * decl.cs (DeclSpace.LookupType): Removed convenience function and
21743 make all the code call directly LookupType in RootContext and take
21744 this chance to pass the Location information everywhere.
21746 * Everywhere: pass Location information.
21748 2001-12-19 Miguel de Icaza <miguel@ximian.com>
21750 * class.cs (Constructor.Define): Updated way of detecting the
21751 length of the parameters.
21753 (TypeContainer.DefineType): Use basename as the type name for
21756 (TypeContainer.Define): Do not recursively define types here, as
21757 definition is taken care in order by the RootContext.
21759 * tree.cs: Keep track of namespaces in a per-file basis.
21761 * parameter.cs (Parameter.ComputeSignature): Update to use
21764 (Parameters.GetSignature): ditto.
21766 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21767 instead of a TypeContainer.
21769 (Interface.SemanticAnalysis): Use `this' instead of our parent to
21770 resolve names. Because we need to be resolve in our context, not
21773 * driver.cs: Implement response files.
21775 * class.cs (TypeContainer.DefineType): If we are defined, do not
21776 redefine ourselves.
21778 (Event.Emit): Emit the code for add/remove handlers.
21779 (Event.Define): Save the MethodBuilders for add/remove.
21781 * typemanager.cs: Use pair here too.
21783 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21784 DictionaryEntry requires the first argument to be non-null.
21786 (enum_declaration): Compute full name for registering the
21789 (delegate_declaration): Instead of using
21790 formal_parameter_list, use opt_formal_parameter_list as the list
21793 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21794 (EventParsing): New property that controls whether `add' and
21795 `remove' are returned as tokens or identifiers (for events);
21797 2001-12-19 Ravi Pratap <ravi@ximian.com>
21799 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21800 use MyEventBuilder only and let it wrap the real builder for us.
21802 (MyEventBuilder): Revamp constructor etc.
21804 Implement all operations that we perform on EventBuilder in precisely the same
21807 (FindMembers): Update to use the EventBuilder member.
21809 (Event.Emit): Update accordingly.
21811 2001-12-18 Ravi Pratap <ravi@ximian.com>
21813 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21814 by calling the appropriate methods.
21816 (GetCustomAttributes): Make stubs as they cannot possibly do anything
21819 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21821 2001-12-17 Ravi Pratap <ravi@ximian.com>
21823 * delegate.cs (Delegate.Populate): Check that the return type
21824 and various parameters types are indeed accessible.
21826 * class.cs (Constructor.Define): Same here.
21828 (Field.Define): Ditto.
21830 (Event.Define): Ditto.
21832 (Operator.Define): Check that the underlying Method defined itself
21833 correctly - so it's MethodBuilder should not be null.
21835 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21836 expression happens to be null.
21838 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21839 members but as of now we don't seem to be able to do anything really useful with it.
21841 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21842 not the EventBuilder.
21844 2001-12-18 Miguel de Icaza <miguel@ximian.com>
21846 * cs-tokenizer.cs: Add support for defines.
21847 Add support for #if, #elif, #else, #endif
21849 (eval_var): evaluates a variable.
21850 (eval): stubbed for evaluating functions.
21852 * cs-parser.jay: Pass the defines information
21854 * driver.cs: Add --define command line option.
21856 * decl.cs: Move MemberCore here.
21858 Make it the base class for DeclSpace. This allows us to catch and
21859 report 108 and 109 for everything now.
21861 * class.cs (TypeContainer.Define): Extract all the members
21862 before populating and emit the warning 108 (new keyword required
21863 to override) instead of having each member implement this.
21865 (MemberCore.Define): New abstract method, we will be using this in
21866 the warning reporting engine in Populate.
21868 (Operator.Define): Adjust to new MemberCore protocol.
21870 * const.cs (Const): This does not derive from Expression, it is a
21871 temporary object we use to create fields, it is a MemberCore.
21873 * class.cs (Method.Define): Allow the entry point to be in a
21876 * driver.cs: Rewrite the argument handler to clean it up a bit.
21878 * rootcontext.cs: Made it just an auxiliary namespace feature by
21879 making everything static.
21881 * driver.cs: Adapt code to use RootContext type name instead of
21884 * delegate.cs: Remove RootContext argument.
21886 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21889 * class.cs (Event.Define): The lookup can fail.
21891 * cs-tokenizer.cs: Begin implementation of pre-procesor.
21893 * expression.cs: Resolve the this instance before invoking the code.
21895 2001-12-17 Miguel de Icaza <miguel@ximian.com>
21897 * cs-parser.jay: Add a production in element_access that allows
21898 the thing to become a "type" reference. This way we can parse
21899 things like "(string [])" as a type.
21901 Note that this still does not handle the more complex rules of
21905 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
21907 * ecore.cs: (CopyNewMethods): new utility function used to
21908 assemble the list of methods from running FindMembers.
21910 (MemberLookup): Rework FindMembers so that
21912 2001-12-16 Miguel de Icaza <miguel@ximian.com>
21914 * class.cs (TypeContainer): Remove Delegates who fail to be
21917 * delegate.cs (Populate): Verify that we dont get null return
21918 values. TODO: Check for AsAccessible.
21920 * cs-parser.jay: Use basename to emit error 574 (destructor should
21921 have the same name as container class), not the full name.
21923 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
21924 possible representation.
21926 Also implements integer type suffixes U and L.
21928 2001-12-15 Miguel de Icaza <miguel@ximian.com>
21930 * expression.cs (ArrayCreation.DoResolve): We need to do the
21931 argument resolution *always*.
21933 * decl.cs: Make this hold the namespace. Hold the root context as
21935 (LookupType): Move here.
21937 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21939 * location.cs (Row, Name): Fixed the code, it was always returning
21940 references to the first file.
21942 * interface.cs: Register properties defined through interfaces.
21944 * driver.cs: Add support for globbing on the command line
21946 * class.cs (Field): Make it derive from MemberCore as well.
21949 2001-12-15 Ravi Pratap <ravi@ximian.com>
21951 * class.cs (Event::Define): Check that the type of the event is a delegate
21952 type else flag error #66.
21954 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21957 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21958 values of EntryPoint, CharSet etc etc.
21960 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21962 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21963 be null and we should ignore this. I am not sure if this is really clean. Apparently,
21964 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21965 which needs this to do its work.
21967 * ../errors/cs0066.cs : Add.
21969 2001-12-14 Miguel de Icaza <miguel@ximian.com>
21971 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21974 * class.cs: (MethodSignature.MethodSignature): Removed hack that
21975 clears out the parameters field.
21976 (MemberSignatureCompare): Cleanup
21978 (MemberCore): New base class used to share code between MethodCore
21981 (RegisterRequiredImplementations) BindingFlags.Public requires
21982 either BindingFlags.Instace or Static. Use instance here.
21984 (Property): Refactored code to cope better with the full spec.
21986 * parameter.cs (GetParameterInfo): Return an empty array instead
21989 * class.cs (Property): Abstract or extern properties have no bodies.
21991 * parameter.cs (GetParameterInfo): return a zero-sized array.
21993 * class.cs (TypeContainer.MethodModifiersValid): Move all the
21994 method modifier validation to the typecontainer so we can reuse
21995 this on properties.
21997 (MethodCore.ParameterTypes): return an empty sized array of types.
21999 (Property.Define): Test property modifier validity.
22001 Add tests for sealed/override too.
22003 (Method.Emit): abstract or extern methods have no bodies.
22005 2001-12-14 Ravi Pratap <ravi@ximian.com>
22007 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
22010 (Method::Define, ::Emit): Modify accordingly.
22012 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
22014 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
22016 * makefile: Pass in /unsafe.
22018 2001-12-13 Miguel de Icaza <miguel@ximian.com>
22020 * class.cs (MakeKey): Kill routine.
22022 * class.cs (TypeContainer.Define): Correctly define explicit
22023 method implementations (they require the full interface name plus
22026 * typemanager.cs: Deply the PtrHashtable here and stop using the
22027 lame keys. Things work so much better.
22029 This of course broke everyone who depended on `RegisterMethod' to
22030 do the `test for existance' test. This has to be done elsewhere.
22032 * support.cs (PtrHashtable): A hashtable that avoid comparing with
22033 the object stupid Equals method (because, that like fails all over
22034 the place). We still do not use it.
22036 * class.cs (TypeContainer.SetRequiredInterface,
22037 TypeContainer.RequireMethods): Killed these two routines and moved
22038 all the functionality to RegisterRequiredImplementations.
22040 (TypeContainer.RegisterRequiredImplementations): This routine now
22041 registers all the implementations required in an array for the
22042 interfaces and abstract methods. We use an array of structures
22043 which can be computed ahead of time to reduce memory usage and we
22044 also assume that lookups are cheap as most classes will not
22045 implement too many interfaces.
22047 We also avoid creating too many MethodSignatures.
22049 (TypeContainer.IsInterfaceMethod): Update and optionally does not
22050 clear the "pending" bit if we find that there are problems with
22053 (TypeContainer.VerifyPendingMethods): Update to report errors of
22054 methods that look like implementations but are not.
22056 (TypeContainer.Define): Add support for explicit interface method
22059 2001-12-12 Miguel de Icaza <miguel@ximian.com>
22061 * typemanager.cs: Keep track of the parameters here instead of
22062 being a feature of the TypeContainer.
22064 * class.cs: Drop the registration of parameters here, as
22065 InterfaceMethods are also interface declarations.
22067 * delegate.cs: Register methods with the TypeManager not only with
22068 the TypeContainer. This code was buggy.
22070 * interface.cs: Full registation here.
22072 2001-12-11 Miguel de Icaza <miguel@ximian.com>
22074 * expression.cs: Remove reducer for binary expressions, it can not
22077 * const.cs: Put here the code that used to go into constant.cs
22079 * constant.cs: Put here the code for constants, this is a new base
22080 class for Literals.
22082 * literal.cs: Make Literal derive from Constant.
22084 2001-12-09 Miguel de Icaza <miguel@ximian.com>
22086 * statement.cs (Return.Emit): Report error 157 if the user
22087 attempts to return from a finally block.
22089 (Return.Emit): Instead of emitting a return, jump to the end of
22092 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
22093 LocalBuilder to store the result of the function. ReturnLabel is
22094 the target where we jump.
22097 2001-12-09 Radek Doulik <rodo@ximian.com>
22099 * cs-parser.jay: remember alias in current namespace
22101 * ecore.cs (SimpleName::DoResolve): use aliases for types or
22104 * class.cs (LookupAlias): lookup alias in my_namespace
22106 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
22108 (LookupAlias): lookup alias in this and if needed in parent
22111 2001-12-08 Miguel de Icaza <miguel@ximian.com>
22115 * rootcontext.cs: (ModuleBuilder) Made static, first step into
22116 making things static. I need this to avoid passing the
22117 TypeContainer when calling ParameterType.
22119 * support.cs (InternalParameters.ParameterType): Remove ugly hack
22120 that did string manipulation to compute the type and then call
22121 GetType. Use Parameter.ParameterType instead.
22123 * cs-tokenizer.cs: Consume the suffix for floating values.
22125 * expression.cs (ParameterReference): figure out whether this is a
22126 reference parameter or not. Kill an extra variable by computing
22127 the arg_idx during emission.
22129 * parameter.cs (Parameters.GetParameterInfo): New overloaded
22130 function that returns whether a parameter is an out/ref value or not.
22132 (Parameter.ParameterType): The type of the parameter (base,
22133 without ref/out applied).
22135 (Parameter.Resolve): Perform resolution here.
22136 (Parameter.ExternalType): The full type (with ref/out applied).
22138 * statement.cs (Using.Emit, Using.EmitExpression): Implement
22139 support for expressions on the using statement.
22141 2001-12-07 Miguel de Icaza <miguel@ximian.com>
22143 * statement.cs (Using.EmitLocalVariableDecls): Split the
22144 localvariable handling of the using statement.
22146 (Block.EmitMeta): Keep track of variable count across blocks. We
22147 were reusing slots on separate branches of blocks.
22149 (Try.Emit): Emit the general code block, we were not emitting it.
22151 Check the type of the declaration to be an IDisposable or
22152 something that can be implicity converted to it.
22154 Emit conversions if required.
22156 * ecore.cs (EmptyExpression): New utility class.
22157 (Expression.ImplicitConversionExists): New utility function.
22159 2001-12-06 Miguel de Icaza <miguel@ximian.com>
22161 * statement.cs (Using): Implement.
22163 * expression.cs (LocalVariableReference): Support read only variables.
22165 * statement.cs: Remove the explicit emit for the Leave opcode.
22166 (VariableInfo): Add a readonly field.
22168 2001-12-05 Miguel de Icaza <miguel@ximian.com>
22170 * ecore.cs (ConvCast): new class used to encapsulate the various
22171 explicit integer conversions that works in both checked and
22172 unchecked contexts.
22174 (Expression.ConvertNumericExplicit): Use new ConvCast class to
22175 properly generate the overflow opcodes.
22177 2001-12-04 Miguel de Icaza <miguel@ximian.com>
22179 * statement.cs: The correct type for the EmptyExpression is the
22180 element_type, not the variable type. Ravi pointed this out.
22182 2001-12-04 Ravi Pratap <ravi@ximian.com>
22184 * class.cs (Method::Define): Handle PInvoke methods specially
22185 by using DefinePInvokeMethod instead of the usual one.
22187 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
22188 above to do the task of extracting information and defining the method.
22190 2001-12-04 Ravi Pratap <ravi@ximian.com>
22192 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
22193 of the condition for string type.
22195 (Emit): Move that here.
22197 (ArrayCreation::CheckIndices): Keep string literals in their expression
22200 (EmitDynamicInitializers): Handle strings appropriately.
22202 2001-12-04 Miguel de Icaza <miguel@ximian.com>
22204 * codegen.cs (EmitContext): Replace multiple variables with a
22205 single pointer to the current Switch statement.
22207 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
22210 2001-12-03 Miguel de Icaza <miguel@ximian.com>
22214 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
22217 (Foreach.Emit): Foreach on arrays was not setting
22218 up the loop variables (for break/continue).
22220 (GotoCase): Semi-implented.
22222 2001-12-03 Ravi Pratap <ravi@ximian.com>
22224 * attribute.cs (CheckAttribute): Handle system attributes by using
22225 Attribute.GetAttributes to examine information we need.
22227 (GetValidPlaces): Same here.
22229 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
22231 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
22233 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
22235 (Method::Define): Set appropriate flags if we have a DllImport attribute.
22237 (Method::Emit): Handle the case when we are a PInvoke method.
22239 2001-12-03 Miguel de Icaza <miguel@ximian.com>
22241 * expression.cs: Use ResolveWithSimpleName on compound names.
22243 2001-12-02 Ravi Pratap <ravi@ximian.com>
22245 * constant.cs (EmitConstant): Make sure we resolve the associated expression
22246 before trying to reduce it.
22248 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
22250 * constant.cs (LookupConstantValue): Implement.
22252 (EmitConstant): Use the above in emitting the constant.
22254 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
22255 that are user-defined by doing a LookupConstantValue on them.
22257 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
22260 2001-11-29 Miguel de Icaza <miguel@ximian.com>
22262 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
22264 (BaseAccess.DoResolve): Implement.
22266 (MemberAccess.DoResolve): Split this routine into a
22267 ResolveMemberAccess routine that can be used independently
22269 2001-11-28 Miguel de Icaza <miguel@ximian.com>
22271 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
22272 As that share bits of the implementation. Is returns a boolean,
22273 while As returns the Type that is being probed.
22275 2001-12-01 Ravi Pratap <ravi@ximian.com>
22277 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
22278 instead of a Literal - much easier.
22280 (EnumInTransit): Remove - utterly useless :-)
22282 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
22284 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
22286 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
22287 chain when we have no associated expression.
22289 2001-11-30 Ravi Pratap <ravi@ximian.com>
22291 * constant.cs (Define): Use Location while reporting the errror.
22293 Also emit a warning when 'new' is used and there is no inherited
22296 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
22299 (LookupEnumValue): Implement to lookup an enum member's value and define it
22302 (Populate): Re-write accordingly to use the above routine.
22304 2001-11-27 Miguel de Icaza <miguel@ximian.com>
22306 * expression.cs (This): Fix prototype for DoResolveLValue to
22307 override the base class DoResolveLValue.
22309 * cs-parser.cs: Report errors cs574 and cs575 (destructor
22312 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
22313 (we need to load the address of the field here). This fixes
22316 (FieldExpr.DoResolveLValue): Call the DoResolve
22317 function to initialize the Instance expression.
22319 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
22320 correctly the GetEnumerator operation on a value type.
22322 * cs-parser.jay: Add more simple parsing error catches.
22324 * statement.cs (Switch): Add support for string switches.
22325 Handle null specially.
22327 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
22329 2001-11-28 Ravi Pratap <ravi@ximian.com>
22331 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
22333 (declare_local_constant): New helper function.
22335 * statement.cs (AddConstant): Keep a separate record of constants
22337 (IsConstant): Implement to determine if a variable is a constant.
22339 (GetConstantExpression): Implement.
22341 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
22343 * statement.cs (IsVariableDefined): Re-write.
22345 2001-11-27 Ravi Pratap <ravi@ximian.com>
22347 * class.cs (TypeContainer::FindMembers): Look for constants
22348 in the case when we are looking for MemberTypes.Field
22350 * expression.cs (MemberAccess::DoResolve): Check that in the
22351 case we are a FieldExpr and a Literal, we are not being accessed
22352 by an instance reference.
22354 * cs-parser.jay (local_constant_declaration): Implement.
22356 (declaration_statement): Implement for constant declarations.
22358 2001-11-26 Miguel de Icaza <miguel@ximian.com>
22360 * statement.cs (Switch): Catch double defaults.
22362 (Switch): More work on the switch() statement
22363 implementation. It works for integral values now, need to finish
22367 2001-11-24 Miguel de Icaza <miguel@ximian.com>
22369 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
22370 integer literals into other integer literals. To be used by
22373 2001-11-24 Ravi Pratap <ravi@ximian.com>
22375 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
22378 (EmitDynamicInitializers): Cope with the above since we extract data
22379 directly from ArrayData now.
22381 (ExpectInitializers): Keep track of whether initializers are mandatory
22384 (Bounds): Make it a hashtable to prevent the same dimension being
22385 recorded for every element in that dimension.
22387 (EmitDynamicInitializers): Fix bug which prevented the Set array method
22390 Also fix bug which was causing the indices to be emitted in the reverse
22393 2001-11-24 Miguel de Icaza <miguel@ximian.com>
22395 * expression.cs (ArrayCreation): Implement the bits that Ravi left
22396 unfinished. They do not work, because the underlying code is
22399 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22401 * cs-parser.jay: Remove bogus fixme.
22403 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
22404 on Switch statement.
22406 2001-11-23 Ravi Pratap <ravi@ximian.com>
22408 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
22411 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
22412 parameter. Apparently, any expression is allowed.
22414 (ValidateInitializers): Update accordingly.
22416 (CheckIndices): Fix some tricky bugs thanks to recursion.
22418 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
22419 I was being completely brain-dead.
22421 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
22422 and re-write acordingly.
22424 (DelegateInvocation): Re-write accordingly.
22426 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
22428 (MakeByteBlob): Handle types more correctly.
22430 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
22431 initialization from expressions but it is incomplete because I am a complete
22434 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22436 * statement.cs (If.Emit): Fix a bug that generated incorrect code
22437 on If. Basically, we have to return `true' (ie, we do return to
22438 our caller) only if both branches of the if return.
22440 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
22441 short-circuit operators, handle them as short circuit operators.
22443 (Cast.DoResolve): Resolve type.
22444 (Cast.Cast): Take an expression as the target type.
22446 * cs-parser.jay (cast_expression): Remove old hack that only
22447 allowed a limited set of types to be handled. Now we take a
22448 unary_expression and we resolve to a type during semantic
22451 Use the grammar productions from Rhys to handle casts (this is
22452 not complete like Rhys syntax yet, we fail to handle that corner
22453 case that C# has regarding (-x), but we will get there.
22455 2001-11-22 Ravi Pratap <ravi@ximian.com>
22457 * class.cs (EmitFieldInitializer): Take care of the case when we have a
22458 field which is an array type.
22460 * cs-parser.jay (declare_local_variables): Support array initialization too.
22462 * typemanager.cs (MakeKey): Implement.
22464 (everywhere): Use the above appropriately.
22466 * cs-parser.jay (for_statement): Update for array initialization while
22467 declaring variables.
22469 * ecore.cs : The error message was correct, it's the variable's names that
22470 were misleading ;-) Make the code more readable.
22472 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
22473 the correct type etc.
22475 (ConvertExplicit): Handle Enum types by examining the underlying type.
22477 2001-11-21 Ravi Pratap <ravi@ximian.com>
22479 * parameter.cs (GetCallingConvention): Always return
22480 CallingConventions.Standard for now.
22482 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22484 * expression.cs (Binary.ResolveOperator): Update the values of `l'
22485 and `r' after calling DoNumericPromotions.
22487 * ecore.cs: Fix error message (the types were in the wrong order).
22489 * statement.cs (Foreach.ProbeCollectionType): Need to pass
22490 BindingFlags.Instance as well
22492 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
22493 implicit int literal conversion in an empty cast so that we
22494 propagate the right type upstream.
22496 (UnboxCast): new class used to unbox value types.
22497 (Expression.ConvertExplicit): Add explicit type conversions done
22500 (Expression.ImplicitNumericConversion): Oops, forgot to test for
22501 the target type before applying the implicit LongLiterals to ULong
22504 2001-11-21 Miguel de Icaza <miguel@ximian.com>
22506 * cs-parser.jay (for_statement): Reworked the way For works: now
22507 we declare manually any variables that are introduced in
22508 for_initializer to solve the problem of having out-of-band code
22509 emition (that is what got for broken).
22511 (declaration_statement): Perform the actual variable declaration
22512 that used to be done in local_variable_declaration here.
22514 (local_variable_declaration): Do not declare anything, just pass
22515 the information on a DictionaryEntry
22517 2001-11-20 Ravi Pratap <ravi@ximian.com>
22519 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
22520 re-write of the logic to now make it recursive.
22522 (UpdateIndices): Re-write accordingly.
22524 Store element data in a separate ArrayData list in the above methods.
22526 (MakeByteBlob): Implement to dump the array data into a byte array.
22528 2001-11-19 Ravi Pratap <ravi@ximian.com>
22530 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
22533 * constant.cs (Define): Implement.
22535 (EmitConstant): Re-write fully.
22537 Pass in location info.
22539 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
22542 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
22543 DictionaryEntry since we need location info too.
22545 (constant_declaration): Update accordingly.
22547 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
22548 code into another method : UpdateIndices.
22550 2001-11-18 Ravi Pratap <ravi@ximian.com>
22552 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
22553 some type checking etc.
22555 2001-11-17 Ravi Pratap <ravi@ximian.com>
22557 * expression.cs (ArrayCreation::ValidateInitializers): Implement
22558 bits to provide dimension info if the user skips doing that.
22560 Update second constructor to store the rank correctly.
22562 2001-11-16 Ravi Pratap <ravi@ximian.com>
22564 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
22565 and try to implement.
22567 * ../errors/cs0150.cs : Add.
22569 * ../errors/cs0178.cs : Add.
22571 2001-11-16 Miguel de Icaza <miguel@ximian.com>
22573 * statement.cs: Implement foreach on multi-dimensional arrays.
22575 * parameter.cs (Parameters.GetParameterByName): Also lookup the
22576 name of the params argument.
22578 * expression.cs: Use EmitStoreOpcode to get the right opcode while
22579 initializing the array.
22581 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
22582 we can use this elsewhere.
22584 * statement.cs: Finish implementation of foreach for single
22587 * cs-parser.jay: Use an out-of-band stack to pass information
22588 around, I wonder why I need this.
22590 foreach_block: Make the new foreach_block the current_block.
22592 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
22593 function used to return a static Parameters structure. Used for
22594 empty parameters, as those are created very frequently.
22596 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
22598 2001-11-15 Ravi Pratap <ravi@ximian.com>
22600 * interface.cs : Default modifier is private, not public. The
22601 make verify test passes again.
22603 2001-11-15 Ravi Pratap <ravi@ximian.com>
22605 * support.cs (ReflectionParameters): Fix logic to determine
22606 whether the last parameter is a params one. Test 9 passes again.
22608 * delegate.cs (Populate): Register the builders we define with
22609 RegisterParameterForBuilder. Test 19 passes again.
22611 * cs-parser.jay (property_declaration): Reference $6 instead
22612 of $$ to get at the location.
22614 (indexer_declaration): Similar stuff.
22616 (attribute): Ditto.
22618 * class.cs (Property): Register parameters for the Get and Set methods
22619 if they exist. Test 23 passes again.
22621 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
22622 call to EmitArguments as we are sure there aren't any params arguments.
22623 Test 32 passes again.
22625 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
22626 IndexOutOfRangeException.
22628 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
22629 Test 33 now passes again.
22631 2001-11-15 Miguel de Icaza <miguel@ximian.com>
22633 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22634 broke a bunch of things. Will have to come up with a better way
22635 of tracking locations.
22637 * statement.cs: Implemented foreach for single dimension arrays.
22639 2001-11-09 Miguel de Icaza <miguel@ximian.com>
22641 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22642 an error. This removes the lookup from the critical path.
22644 * cs-parser.jay: Removed use of temporary_loc, which is completely
22647 2001-11-14 Miguel de Icaza <miguel@ximian.com>
22649 * support.cs (ReflectionParameters.ParameterModifier): Report
22650 whether the argument is a PARAMS argument or not.
22652 * class.cs: Set the attribute `ParamArrayAttribute' on the
22653 parameter argument.
22655 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22656 and cons_param_array_attribute (ConstructorInfo for
22657 ParamArrayAttribute).,
22659 * codegen.cs: Emit the return using the `Return' statement, that
22660 way we can report the error correctly for missing return values.
22662 * class.cs (Method.Emit): Clean up.
22664 * expression.cs (Argument.Resolve): Take another argument: the
22665 location where this argument is used. Notice that this is not
22666 part of the "Argument" class as to reduce the size of the
22667 structure (we know the approximate location anyways).
22669 Test if the argument is a variable-reference, if not, then
22670 complain with a 206.
22672 (Argument.Emit): Emit addresses of variables.
22674 (Argument.FullDesc): Simplify.
22676 (Invocation.DoResolve): Update for Argument.Resolve.
22678 (ElementAccess.DoResolve): ditto.
22680 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22681 method should be virtual, as this method is always virtual.
22683 (NewDelegate.DoResolve): Update for Argument.Resolve.
22685 * class.cs (ConstructorInitializer.DoResolve): ditto.
22687 * attribute.cs (Attribute.Resolve): ditto.
22689 2001-11-13 Miguel de Icaza <miguel@ximian.com>
22691 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22693 * expression.cs (ParameterReference): Drop IStackStorage and implement
22694 IAssignMethod instead.
22696 (LocalVariableReference): ditto.
22698 * ecore.cs (FieldExpr): Drop IStackStorage and implement
22699 IAssignMethod instead.
22701 2001-11-13 Miguel de Icaza <miguel@ximian.com>
22703 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22704 enumerations that are used in heavily used structures derive from
22705 byte in a laughable and pathetic attempt to reduce memory usage.
22706 This is the kind of pre-optimzations that you should not do at
22707 home without adult supervision.
22709 * expression.cs (UnaryMutator): New class, used to handle ++ and
22710 -- separatedly from the other unary operators. Cleans up the
22711 code, and kills the ExpressionStatement dependency in Unary.
22713 (Unary): Removed `method' and `Arguments' from this class, making
22714 it smaller, and moving it all to SimpleCall, so I can reuse this
22715 code in other locations and avoid creating a lot of transient data
22716 strucutres when not required.
22718 * cs-parser.jay: Adjust for new changes.
22720 2001-11-11 Miguel de Icaza <miguel@ximian.com>
22722 * enum.cs (Enum.Populate): If there is a failure during
22725 * cs-parser.jay (opt_enum_base): we used to catch type errors
22726 here, but this is really incorrect. The type error should be
22727 catched during semantic analysis.
22729 2001-12-11 Ravi Pratap <ravi@ximian.com>
22731 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
22732 current_local_parameters as expected since I, in my stupidity, had forgotten
22735 * attribute.cs (GetValidPlaces): Fix stupid bug.
22737 * class.cs (Method::Emit): Perform check on applicability of attributes.
22739 (Constructor::Emit): Ditto.
22741 (Field::Emit): Ditto.
22743 (Field.Location): Store location information.
22745 (Property, Event, Indexer, Operator): Ditto.
22747 * cs-parser.jay (field_declaration): Pass in location for each field.
22749 * ../errors/cs0592.cs : Add.
22751 2001-11-12 Ravi Pratap <ravi@ximian.com>
22753 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22755 (InitCoreTypes): Update accordingly.
22757 (RegisterAttrType, LookupAttr): Implement.
22759 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22760 info about the same.
22762 (Resolve): Update to populate the above as necessary.
22764 (Error592): Helper.
22766 (GetValidPlaces): Helper to the above.
22768 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22770 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22772 2001-11-12 Ravi Pratap <ravi@ximian.com>
22774 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22776 * ../errors/cs0617.cs : Add.
22778 2001-11-11 Ravi Pratap <ravi@ximian.com>
22780 * enum.cs (Emit): Rename to Populate to be more consistent with what
22781 we expect it to do and when exactly it is called.
22783 * class.cs, rootcontext.cs : Update accordingly.
22785 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22786 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22788 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22790 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22791 of a fieldinfo using the above, when dealing with a FieldBuilder.
22793 2001-11-10 Ravi Pratap <ravi@ximian.com>
22795 * ../errors/cs0031.cs : Add.
22797 * ../errors/cs1008.cs : Add.
22799 * ../errrors/cs0543.cs : Add.
22801 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22804 (FindMembers): Implement.
22806 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22807 enums and delegates too.
22809 (enum_types): Rename to builder_to_enum.
22811 (delegate_types): Rename to builder_to_delegate.
22813 * delegate.cs (FindMembers): Implement.
22815 2001-11-09 Ravi Pratap <ravi@ximian.com>
22817 * typemanager.cs (IsEnumType): Implement.
22819 * enum.cs (Emit): Re-write parts to account for the underlying type
22820 better and perform checking etc.
22822 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22823 of the underlying type.
22825 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22828 * enum.cs (error31): Helper to report error #31.
22830 * cs-parser.jay (enum_declaration): Store location of each member too.
22832 * enum.cs (member_to_location): New hashtable.
22834 (AddEnumMember): Update location hashtable.
22836 (Emit): Use the location of each member while reporting errors.
22838 2001-11-09 Miguel de Icaza <miguel@ximian.com>
22840 * cs-parser.jay: A for_initializer if is a
22841 local_variable_declaration really ammount to have an implicit
22842 block with the variable declaration and no initializer for for.
22844 * statement.cs (For.Emit): Cope with null initializers.
22846 This fixes the infinite loop on for initializers.
22848 2001-11-08 Miguel de Icaza <miguel@ximian.com>
22850 * enum.cs: More cleanup.
22852 * ecore.cs: Remove dead code.
22854 * class.cs (Property.Emit): More simplification.
22855 (Event.Emit): ditto.
22857 Reworked to have less levels of indentation.
22859 2001-11-08 Ravi Pratap <ravi@ximian.com>
22861 * class.cs (Property): Emit attributes.
22871 * enum.cs (Emit): Ditto.
22873 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22876 * class.cs (Field, Event, etc.): Move attribute generation into the
22877 Emit method everywhere.
22879 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22880 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22881 as we had no way of defining nested enums !
22883 * rootcontext.cs : Adjust code accordingly.
22885 * typemanager.cs (AddEnumType): To keep track of enum types separately.
22887 2001-11-07 Ravi Pratap <ravi@ximian.com>
22889 * expression.cs (EvalConstantExpression): Move into ecore.cs
22891 * enum.cs (Enum): Rename some members and make them public and readonly
22892 according to our convention.
22894 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
22897 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
22899 (Enum::Emit): Write a simple version for now which doesn't try to compute
22900 expressions. I shall modify this to be more robust in just a while.
22902 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
22904 (TypeContainer::CloseType): Create the Enum types too.
22906 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
22908 * expression.cs (EvalConstantExpression): Get rid of completely.
22910 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
22911 user-defined values and other cases.
22913 (IsValidEnumLiteral): Helper function.
22915 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
22916 out there in the case we had a literal FieldExpr.
22918 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
22920 (Literalize): Revamp a bit to take two arguments.
22922 (EnumLiteral): New class which derives from Literal to wrap enum literals.
22924 2001-11-06 Ravi Pratap <ravi@ximian.com>
22926 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22928 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22930 (Resolve): Use the above to ensure we have proper initializers.
22932 2001-11-05 Ravi Pratap <ravi@ximian.com>
22934 * expression.cs (Expression::EvalConstantExpression): New method to
22935 evaluate constant expressions.
22937 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22939 2001-11-07 Miguel de Icaza <miguel@ximian.com>
22941 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22944 (Binary.ResolveOperator): Handle operator != (object a, object b)
22945 and operator == (object a, object b);
22947 (Binary.DoNumericPromotions): Indicate whether the numeric
22948 promotion was possible.
22950 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22953 Made the ArrayAccess implement interface IAssignMethod instead of
22954 IStackStore as the order in which arguments are passed reflects
22957 * assign.cs: Instead of using expr.ExprClass to select the way of
22958 assinging, probe for the IStackStore/IAssignMethod interfaces.
22960 * typemanager.cs: Load InitializeArray definition.
22962 * rootcontext.cs (RootContext.MakeStaticData): Used to define
22963 static data that can be used to initialize arrays.
22965 2001-11-05 Miguel de Icaza <miguel@ximian.com>
22967 * expression.cs: Handle operator== and operator!= for booleans.
22969 (Conditioal.Reduce): Implement reducer for the ?: operator.
22971 (Conditional.Resolve): Implement dead code elimination.
22973 (Binary.Resolve): Catch string literals and return a new
22974 concatenated string.
22976 (Unary.Reduce): Implement reduction of unary expressions.
22978 * ecore.cs: Split out the expression core handling here.
22980 (Expression.Reduce): New method used to perform constant folding
22981 and CSE. This is needed to support constant-expressions.
22983 * statement.cs (Statement.EmitBoolExpression): Pass true and false
22984 targets, and optimize for !x.
22986 2001-11-04 Ravi Pratap <ravi@ximian.com>
22988 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22989 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22990 set custom atttributes.
22992 * literal.cs (Literal::GetValue): New abstract method to return the actual
22993 value of the literal, cast as an object.
22995 (*Literal): Implement GetValue method.
22997 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22998 expressions to the arraylist but objects of type Argument.
23000 * class.cs (TypeContainer::Emit): Emit our attributes too.
23002 (Method::Emit, Constructor::Emit): Ditto.
23004 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
23005 to be ignoring earlier.
23007 2001-11-03 Ravi Pratap <ravi@ximian.com>
23009 * attribute.cs (AttributeSection::Define): Implement to do the business
23010 of constructing a CustomAttributeBuilder.
23012 (Attribute): New trivial class. Increases readability of code.
23014 * cs-parser.jay : Update accordingly.
23016 (positional_argument_list, named_argument_list, named_argument): New rules
23018 (attribute_arguments): Use the above so that we are more correct.
23020 2001-11-02 Ravi Pratap <ravi@ximian.com>
23022 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
23023 to perform all checks for a method with a params parameter.
23025 (Invocation::OverloadResolve): Update to use the above method and therefore
23026 cope correctly with params method invocations.
23028 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
23031 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
23032 constructors in our parent too because we can't afford to miss out on
23035 * attribute.cs (AttributeSection): New name for the class Attribute
23037 Other trivial changes to improve readability.
23039 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
23040 use the new class names.
23042 2001-11-01 Ravi Pratap <ravi@ximian.com>
23044 * class.cs (Method::Define): Complete definition for params types too
23046 (Indexer::Define): Ditto.
23048 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
23049 Cope everywhere with a request for info about the array parameter.
23051 2001-11-01 Ravi Pratap <ravi@ximian.com>
23053 * tree.cs (RecordNamespace): Fix up to check for the correct key.
23055 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
23056 local_variable_type to extract the string corresponding to the type.
23058 (local_variable_type): Fixup the action to use the new helper method.
23060 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
23063 * expression.cs : Clean out code which uses the above.
23065 2001-10-31 Ravi Pratap <ravi@ximian.com>
23067 * typemanager.cs (RegisterMethod): Check if we already have an existing key
23068 and bale out if necessary by returning a false.
23070 (RegisterProperty): Ditto.
23072 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
23073 and print out appropriate error messages.
23075 * interface.cs (everywhere): Ditto.
23077 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
23078 location to constructor.
23080 * class.cs (Property, Event, Indexer): Update accordingly.
23082 * ../errors/cs111.cs : Added.
23084 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
23085 of a method, as laid down by the spec.
23087 (Invocation::OverloadResolve): Use the above method.
23089 2001-10-31 Ravi Pratap <ravi@ximian.com>
23091 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
23092 now take a TypeContainer and a Parameters object.
23094 (ParameterData): Modify return type of ParameterModifier method to be
23095 Parameter.Modifier and not a string.
23097 (ReflectionParameters, InternalParameters): Update accordingly.
23099 * expression.cs (Argument::GetParameterModifier): Same here.
23101 * support.cs (InternalParameters::ParameterType): Find a better way of determining
23102 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
23103 symbol in it at all so maybe this is only for now.
23105 2001-10-30 Ravi Pratap <ravi@ximian.com>
23107 * support.cs (InternalParameters): Constructor now takes an extra argument
23108 which is the actual Parameters class.
23110 (ParameterDesc): Update to provide info on ref/out modifiers.
23112 * class.cs (everywhere): Update call to InternalParameters to pass in
23113 the second argument too.
23115 * support.cs (ParameterData): Add ParameterModifier, which is a method
23116 to return the modifier info [ref/out etc]
23118 (InternalParameters, ReflectionParameters): Implement the above.
23120 * expression.cs (Argument::ParameterModifier): Similar function to return
23121 info about the argument's modifiers.
23123 (Invocation::OverloadResolve): Update to take into account matching modifiers
23126 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
23127 a new SetFormalParameters object which we pass to InternalParameters.
23129 2001-10-30 Ravi Pratap <ravi@ximian.com>
23131 * expression.cs (NewArray): Merge into the ArrayCreation class.
23133 2001-10-29 Ravi Pratap <ravi@ximian.com>
23135 * expression.cs (NewArray): Merge classes NewBuiltinArray and
23136 NewUserdefinedArray into one as there wasn't much of a use in having
23139 * expression.cs (Argument): Change field's name to ArgType from Type.
23141 (Type): New readonly property which returns the proper type, taking into
23142 account ref/out modifiers.
23144 (everywhere): Adjust code accordingly for the above.
23146 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
23147 whether we are emitting for a ref or out parameter.
23149 * expression.cs (Argument::Emit): Use the above field to set the state.
23151 (LocalVariableReference::Emit): Update to honour the flag and emit the
23154 * parameter.cs (Attributes): Set the correct flags for ref parameters.
23156 * expression.cs (Argument::FullDesc): New function to provide a full desc.
23158 * support.cs (ParameterData): Add method ParameterDesc to the interface.
23160 (ReflectionParameters, InternalParameters): Implement the above method.
23162 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
23165 (Invocation::FullMethodDesc): Ditto.
23167 2001-10-29 Miguel de Icaza <miguel@ximian.com>
23169 * cs-parser.jay: Add extra production for the second form of array
23172 * expression.cs (ArrayCreation): Update to reflect the above
23175 * Small changes to prepare for Array initialization.
23177 2001-10-28 Miguel de Icaza <miguel@ximian.com>
23179 * typemanager.cs (ImplementsInterface): interface might be null;
23180 Deal with this problem;
23182 Also, we do store negative hits on the cache (null values), so use
23183 this instead of calling t.GetInterfaces on the type everytime.
23185 2001-10-28 Ravi Pratap <ravi@ximian.com>
23187 * typemanager.cs (IsBuiltinType): New method to help determine the same.
23189 * expression.cs (New::DoResolve): Get rid of array creation code and instead
23190 split functionality out into different classes.
23192 (New::FormArrayType): Move into NewBuiltinArray.
23194 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
23197 (NewBuiltinArray): New class to handle creation of built-in arrays.
23199 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
23200 account creation of one-dimensional arrays.
23202 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
23204 (NewUserdefinedArray::DoResolve): Implement.
23206 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
23208 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
23209 we maintain inside the TypeManager. This is necessary to perform lookups on the
23212 (LookupType): Update to perform GetType on the module builders too.
23214 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
23216 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
23218 2001-10-23 Ravi Pratap <ravi@ximian.com>
23220 * expression.cs (New::DoResolve): Implement guts of array creation.
23222 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
23224 2001-10-27 Miguel de Icaza <miguel@ximian.com>
23226 * expression.cs: Fix bug I introduced lsat night that broke
23229 (Expression.Resolve): Report a 246 error (can not resolve name)
23230 if we find a SimpleName in the stream.
23232 (Expression.ResolveLValue): Ditto.
23234 (Expression.ResolveWithSimpleName): This function is a variant of
23235 ResolveName, this one allows SimpleNames to be returned without a
23236 warning. The only consumer of SimpleNames is MemberAccess
23238 2001-10-26 Miguel de Icaza <miguel@ximian.com>
23240 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
23241 might arrive here. I have my doubts that this is correct.
23243 * statement.cs (Lock): Implement lock statement.
23245 * cs-parser.jay: Small fixes to support `lock' and `using'
23247 * cs-tokenizer.cs: Remove extra space
23249 * driver.cs: New flag --checked, allows to turn on integer math
23252 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
23253 Threading.Monitor.Exit
23255 2001-10-23 Miguel de Icaza <miguel@ximian.com>
23257 * expression.cs (IndexerAccess::DoResolveLValue): Set the
23258 Expression Class to be IndexerAccess.
23260 Notice that Indexer::DoResolve sets the eclass to Value.
23262 2001-10-22 Miguel de Icaza <miguel@ximian.com>
23264 * class.cs (TypeContainer::Emit): Emit code for indexers.
23266 * assign.cs (IAssignMethod): New interface implemented by Indexers
23267 and Properties for handling assignment.
23269 (Assign::Emit): Simplify and reuse code.
23271 * expression.cs (IndexerAccess, PropertyExpr): Implement
23272 IAssignMethod, clean up old code.
23274 2001-10-22 Ravi Pratap <ravi@ximian.com>
23276 * typemanager.cs (ImplementsInterface): New method to determine if a type
23277 implements a given interface. Provides a nice cache too.
23279 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
23282 (ConvertReferenceExplicit): Ditto.
23284 * delegate.cs (Delegate::Populate): Update to define the parameters on the
23285 various methods, with correct names etc.
23287 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
23288 Operator.UnaryNegation.
23290 * cs-parser.jay (operator_declarator): Be a little clever in the case where
23291 we have a unary plus or minus operator.
23293 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
23296 * everywhere : update accordingly.
23298 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
23301 * class.cs (Method::Define): For the case where we are implementing a method
23302 inherited from an interface, we need to set the MethodAttributes.Final flag too.
23303 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
23305 2001-10-21 Ravi Pratap <ravi@ximian.com>
23307 * interface.cs (FindMembers): Implement to work around S.R.E
23310 * typemanager.cs (IsInterfaceType): Implement.
23312 (FindMembers): Update to handle interface types too.
23314 * expression.cs (ImplicitReferenceConversion): Re-write bits which
23315 use IsAssignableFrom as that is not correct - it doesn't work.
23317 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
23318 and accordingly override EmitStatement.
23320 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
23321 using the correct logic :-)
23323 2001-10-19 Ravi Pratap <ravi@ximian.com>
23325 * ../errors/cs-11.cs : Add to demonstrate error -11
23327 2001-10-17 Miguel de Icaza <miguel@ximian.com>
23329 * assign.cs (Assign::Resolve): Resolve right hand side first, and
23330 then pass this as a hint to ResolveLValue.
23332 * expression.cs (FieldExpr): Add Location information
23334 (FieldExpr::LValueResolve): Report assignment to readonly
23337 (Expression::ExprClassFromMemberInfo): Pass location information.
23339 (Expression::ResolveLValue): Add new method that resolves an
23342 (Expression::DoResolveLValue): Default invocation calls
23345 (Indexers): New class used to keep track of indexers in a given
23348 (IStackStore): Renamed from LValue, as it did not really describe
23349 what this did. Also ResolveLValue is gone from this interface and
23350 now is part of Expression.
23352 (ElementAccess): Depending on the element access type
23354 * typemanager.cs: Add `indexer_name_type' as a Core type
23355 (System.Runtime.CompilerServices.IndexerNameAttribute)
23357 * statement.cs (Goto): Take a location.
23359 2001-10-18 Ravi Pratap <ravi@ximian.com>
23361 * delegate.cs (Delegate::VerifyDelegate): New method to verify
23362 if two delegates are compatible.
23364 (NewDelegate::DoResolve): Update to take care of the case when
23365 we instantiate a delegate from another delegate.
23367 * typemanager.cs (FindMembers): Don't even try to look up members
23368 of Delegate types for now.
23370 2001-10-18 Ravi Pratap <ravi@ximian.com>
23372 * delegate.cs (NewDelegate): New class to take care of delegate
23375 * expression.cs (New): Split the delegate related code out into
23376 the NewDelegate class.
23378 * delegate.cs (DelegateInvocation): New class to handle delegate
23381 * expression.cs (Invocation): Split out delegate related code into
23382 the DelegateInvocation class.
23384 2001-10-17 Ravi Pratap <ravi@ximian.com>
23386 * expression.cs (New::DoResolve): Implement delegate creation fully
23387 and according to the spec.
23389 (New::DoEmit): Update to handle delegates differently.
23391 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
23392 because of which we were printing out arguments in reverse order !
23394 * delegate.cs (VerifyMethod): Implement to check if the given method
23395 matches the delegate.
23397 (FullDelegateDesc): Implement.
23399 (VerifyApplicability): Implement.
23401 * expression.cs (Invocation::DoResolve): Update to accordingly handle
23402 delegate invocations too.
23404 (Invocation::Emit): Ditto.
23406 * ../errors/cs1593.cs : Added.
23408 * ../errors/cs1594.cs : Added.
23410 * delegate.cs (InstanceExpression, TargetMethod): New properties.
23412 2001-10-16 Ravi Pratap <ravi@ximian.com>
23414 * typemanager.cs (intptr_type): Core type for System.IntPtr
23416 (InitCoreTypes): Update for the same.
23418 (iasyncresult_type, asynccallback_type): Ditto.
23420 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
23423 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
23426 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
23427 the builders for the 4 members of a delegate type :-)
23429 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
23432 * expression.cs (New::DoResolve): Implement guts for delegate creation.
23434 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
23436 2001-10-15 Miguel de Icaza <miguel@ximian.com>
23438 * statement.cs (Break::Emit): Implement.
23439 (Continue::Emit): Implement.
23441 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
23442 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
23443 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
23444 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
23447 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
23448 properties that track the label for the current loop (begin of the
23449 loop and end of the loop).
23451 2001-10-15 Ravi Pratap <ravi@ximian.com>
23453 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
23454 use of emitting anything at all.
23456 * class.cs, rootcontext.cs : Get rid of calls to the same.
23458 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
23460 (Populate): Define the constructor correctly and set the implementation
23463 * typemanager.cs (delegate_types): New hashtable to hold delegates that
23466 (AddDelegateType): Implement.
23468 (IsDelegateType): Implement helper method.
23470 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
23472 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
23473 and accordingly handle it.
23475 * delegate.cs (Populate): Take TypeContainer argument.
23476 Implement bits to define the Invoke method. However, I still haven't figured out
23477 how to take care of the native int bit :-(
23479 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
23480 Qualify the name of the delegate, not its return type !
23482 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
23485 (StandardConversionExists): Checking for array types turns out to be recursive.
23487 (ConvertReferenceExplicit): Implement array conversion.
23489 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
23491 2001-10-12 Ravi Pratap <ravi@ximian.com>
23493 * cs-parser.jay (delegate_declaration): Store the fully qualified
23494 name as it is a type declaration.
23496 * delegate.cs (ReturnType, Name): Rename members to these. Make them
23499 (DefineDelegate): Renamed from Define. Does the same thing essentially,
23500 as TypeContainer::DefineType.
23502 (Populate): Method in which all the definition of the various methods (Invoke)
23505 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
23508 (CloseDelegate): Finally creates the delegate.
23510 * class.cs (TypeContainer::DefineType): Update to define delegates.
23511 (Populate, Emit and CloseType): Do the same thing here too.
23513 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
23514 delegates in all these operations.
23516 2001-10-14 Miguel de Icaza <miguel@ximian.com>
23518 * expression.cs: LocalTemporary: a new expression used to
23519 reference a temporary that has been created.
23521 * assign.cs: Handle PropertyAccess back here, so that we can
23522 provide the proper semantic access to properties.
23524 * expression.cs (Expression::ConvertReferenceExplicit): Implement
23525 a few more explicit conversions.
23527 * modifiers.cs: `NEW' modifier maps to HideBySig.
23529 * expression.cs (PropertyExpr): Make this into an
23530 ExpressionStatement, and support the EmitStatement code path.
23532 Perform get/set error checking, clean up the interface.
23534 * assign.cs: recognize PropertyExprs as targets, and if so, turn
23535 them into toplevel access objects.
23537 2001-10-12 Miguel de Icaza <miguel@ximian.com>
23539 * expression.cs: PropertyExpr::PropertyExpr: use work around the
23542 * typemanager.cs: Keep track here of our PropertyBuilders again to
23543 work around lameness in SRE.
23545 2001-10-11 Miguel de Icaza <miguel@ximian.com>
23547 * expression.cs (LValue::LValueResolve): New method in the
23548 interface, used to perform a second resolution pass for LValues.
23550 (This::DoResolve): Catch the use of this in static methods.
23552 (This::LValueResolve): Implement.
23554 (This::Store): Remove warning, assigning to `this' in structures
23557 (Invocation::Emit): Deal with invocation of
23558 methods on value types. We need to pass the address to structure
23559 methods rather than the object itself. (The equivalent code to
23560 emit "this" for structures leaves the entire structure on the
23561 stack instead of a pointer to it).
23563 (ParameterReference::DoResolve): Compute the real index for the
23564 argument based on whether the method takes or not a `this' pointer
23565 (ie, the method is static).
23567 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
23568 value types returned from functions when we need to invoke a
23569 method on the sturcture.
23572 2001-10-11 Ravi Pratap <ravi@ximian.com>
23574 * class.cs (TypeContainer::DefineType): Method to actually do the business of
23575 defining the type in the Modulebuilder or Typebuilder. This is to take
23576 care of nested types which need to be defined on the TypeBuilder using
23577 DefineNestedMethod.
23579 (TypeContainer::GetClassBases): Implement. Essentially the code from the
23580 methods in RootContext, only ported to be part of TypeContainer.
23582 (TypeContainer::GetInterfaceOrClass): Ditto.
23584 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
23586 * interface.cs (Interface::DefineInterface): New method. Does exactly
23587 what RootContext.CreateInterface did earlier, only it takes care of nested types
23590 (Interface::GetInterfaces): Move from RootContext here and port.
23592 (Interface::GetInterfaceByName): Same here.
23594 * rootcontext.cs (ResolveTree): Re-write.
23596 (PopulateTypes): Re-write.
23598 * class.cs (TypeContainer::Populate): Populate nested types too.
23599 (TypeContainer::Emit): Emit nested members too.
23601 * typemanager.cs (AddUserType): Do not make use of the FullName property,
23602 instead just use the name argument passed in as it is already fully
23605 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
23606 to TypeContainer mapping to see if a type is user-defined.
23608 * class.cs (TypeContainer::CloseType): Implement.
23610 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
23611 the default constructor.
23613 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
23616 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
23618 * interface.cs (CloseType): Create the type here.
23620 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
23623 Remove all the methods which are now in TypeContainer.
23625 2001-10-10 Ravi Pratap <ravi@ximian.com>
23627 * delegate.cs (Define): Re-write bits to define the delegate
23630 2001-10-10 Miguel de Icaza <miguel@ximian.com>
23632 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23634 * expression.cs (ImplicitReferenceConversion): handle null as well
23635 as a source to convert to any reference type.
23637 * statement.cs (Return): Perform any implicit conversions to
23638 expected return type.
23640 Validate use of return statement.
23642 * codegen.cs (EmitContext): Pass the expected return type here.
23644 * class.cs (Method, Constructor, Property): Pass expected return
23645 type to EmitContext.
23647 2001-10-09 Miguel de Icaza <miguel@ximian.com>
23649 * expression.cs: Make DoResolve take an EmitContext instead of a
23652 Replaced `l' and `location' for `loc', for consistency.
23654 (Error, Warning): Remove unneeded Tc argument.
23656 * assign.cs, literal.cs, constant.cs: Update to new calling
23659 * codegen.cs: EmitContext now contains a flag indicating whether
23660 code is being generated in a static method or not.
23662 * cs-parser.jay: DecomposeQI, new function that replaces the old
23663 QualifiedIdentifier. Now we always decompose the assembled
23664 strings from qualified_identifier productions into a group of
23667 2001-10-08 Miguel de Icaza <miguel@ximian.com>
23669 * rootcontext.cs: Deal with field-less struct types correctly now
23670 by passing the size option to Define Type.
23672 * class.cs: Removed hack that created one static field.
23674 2001-10-07 Miguel de Icaza <miguel@ximian.com>
23676 * statement.cs: Moved most of the code generation here.
23678 2001-10-09 Ravi Pratap <ravi@ximian.com>
23680 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23683 (ElementAccess): Remove useless bits for now - keep checks as the spec
23686 2001-10-08 Ravi Pratap <ravi@ximian.com>
23688 * expression.cs (ElementAccess::DoResolve): Remove my crap code
23689 and start performing checks according to the spec.
23691 2001-10-07 Ravi Pratap <ravi@ximian.com>
23693 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23694 rank_specifiers instead.
23696 (rank_specifiers): Change the order in which the rank specifiers are stored
23698 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23700 * expression.cs (ElementAccess): Implement the LValue interface too.
23702 2001-10-06 Ravi Pratap <ravi@ximian.com>
23704 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23705 except that user defined conversions are not included.
23707 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
23708 perform the conversion of the return type, if necessary.
23710 (New::DoResolve): Check whether we are creating an array or an object
23711 and accordingly do the needful.
23713 (New::Emit): Same here.
23715 (New::DoResolve): Implement guts of array creation.
23717 (New::FormLookupType): Helper function.
23719 2001-10-07 Miguel de Icaza <miguel@ximian.com>
23721 * codegen.cs: Removed most of the code generation here, and move the
23722 corresponding code generation bits to the statement classes.
23724 Added support for try/catch/finalize and throw.
23726 * cs-parser.jay: Added support for try/catch/finalize.
23728 * class.cs: Catch static methods having the flags override,
23729 virtual or abstract.
23731 * expression.cs (UserCast): This user cast was not really doing
23732 what it was supposed to do. Which is to be born in fully resolved
23733 state. Parts of the resolution were being performed at Emit time!
23737 2001-10-05 Miguel de Icaza <miguel@ximian.com>
23739 * expression.cs: Implicity convert the result from UserCast.
23741 2001-10-05 Ravi Pratap <ravi@ximian.com>
23743 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23744 prevented it from working correctly.
23746 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23747 merely ConvertImplicit.
23749 2001-10-05 Miguel de Icaza <miguel@ximian.com>
23751 * typemanager.cs: Make the LookupTypeContainer function static,
23752 and not per-instance.
23754 * class.cs: Make static FindMembers (the one that takes a Type
23757 * codegen.cs: Add EmitForeach here.
23759 * cs-parser.jay: Make foreach a toplevel object instead of the
23760 inline expansion, as we need to perform semantic analysis on it.
23762 2001-10-05 Ravi Pratap <ravi@ximian.com>
23764 * expression.cs (Expression::ImplicitUserConversion): Rename to
23765 UserDefinedConversion.
23767 (Expression::UserDefinedConversion): Take an extra argument specifying
23768 whether we look for explicit user conversions too.
23770 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23772 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23774 (ExplicitUserConversion): Make it a call to UserDefinedConversion
23775 with the appropriate arguments.
23777 * cs-parser.jay (cast_expression): Record location too.
23779 * expression.cs (Cast): Record location info.
23781 (Expression::ConvertExplicit): Take location argument.
23783 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23784 to determine if we are doing explicit conversions.
23786 (UserCast::Emit): Update accordingly.
23788 (Expression::ConvertExplicit): Report an error if everything fails.
23790 * ../errors/cs0030.cs : Add.
23792 2001-10-04 Miguel de Icaza <miguel@ximian.com>
23794 * modifiers.cs: If the ABSTRACT keyword is present, also set the
23795 virtual and newslot bits.
23797 * class.cs (TypeContainer::RegisterRequiredImplementations):
23798 Record methods we need.
23800 (TypeContainer::MakeKey): Helper function to make keys for
23801 MethodBases, since the Methodbase key is useless.
23803 (TypeContainer::Populate): Call RegisterRequiredImplementations
23804 before defining the methods.
23806 Create a mapping for method_builders_to_methods ahead of time
23807 instead of inside a tight loop.
23809 (::RequireMethods): Accept an object as the data to set into the
23810 hashtable so we can report interface vs abstract method mismatch.
23812 2001-10-03 Miguel de Icaza <miguel@ximian.com>
23814 * report.cs: Make all of it static.
23816 * rootcontext.cs: Drop object_type and value_type computations, as
23817 we have those in the TypeManager anyways.
23819 Drop report instance variable too, now it is a global.
23821 * driver.cs: Use try/catch on command line handling.
23823 Add --probe option to debug the error reporting system with a test
23826 * report.cs: Add support for exiting program when a probe
23827 condition is reached.
23829 2001-10-03 Ravi Pratap <ravi@ximian.com>
23831 * expression.cs (Binary::DoNumericPromotions): Fix the case when
23832 we do a forcible conversion regardless of type, to check if
23833 ForceConversion returns a null.
23835 (Binary::error19): Use location to report error.
23837 (Unary::error23): Use location here too.
23839 * ../errors/cs0019.cs : Check in.
23841 * ../errors/cs0023.cs : Check in.
23843 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23844 case of a non-null MethodInfo object with a length of 0 !
23846 (Binary::ResolveOperator): Flag error if overload resolution fails to find
23847 an applicable member - according to the spec :-)
23848 Also fix logic to find members in base types.
23850 (Unary::ResolveOperator): Same here.
23852 (Unary::report23): Change name to error23 and make first argument a TypeContainer
23853 as I was getting thoroughly confused between this and error19 :-)
23855 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23856 (::FindMostEncompassedType): Implement.
23857 (::FindMostEncompassingType): Implement.
23858 (::StandardConversionExists): Implement.
23860 (UserImplicitCast): Re-vamp. We now need info about most specific
23861 source and target types so that we can do the necessary conversions.
23863 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23864 mathematical union with no duplicates.
23866 2001-10-03 Miguel de Icaza <miguel@ximian.com>
23868 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23869 in order from base classes to child classes, so that we can in
23870 child classes look up in our parent for method names and
23871 attributes (required for handling abstract, virtual, new, override
23872 constructs: we need to instrospect our base class, and if we dont
23873 populate the classes in order, the introspection might be
23874 incorrect. For example, a method could query its parent before
23875 the parent has any methods and would determine that the parent has
23876 no abstract methods (while it could have had them)).
23878 (RootContext::CreateType): Record the order in which we define the
23881 2001-10-02 Miguel de Icaza <miguel@ximian.com>
23883 * class.cs (TypeContainer::Populate): Also method definitions can
23884 fail now, keep track of this.
23886 (TypeContainer::FindMembers): Implement support for
23887 DeclaredOnly/noDeclaredOnly flag.
23889 (Constructor::Emit) Return the ConstructorBuilder.
23891 (Method::Emit) Return the MethodBuilder.
23892 Check for abstract or virtual methods to be public.
23894 * rootcontext.cs (RootContext::CreateType): Register all the
23895 abstract methods required for the class to be complete and the
23896 interface methods that must be implemented.
23898 * cs-parser.jay: Report error 501 (method requires body if it is
23899 not marked abstract or extern).
23901 * expression.cs (TypeOf::Emit): Implement.
23903 * typemanager.cs: runtime_handle_type, new global type.
23905 * class.cs (Property::Emit): Generate code for properties.
23907 2001-10-02 Ravi Pratap <ravi@ximian.com>
23909 * expression.cs (Unary::ResolveOperator): Find operators on base type
23910 too - we now conform exactly to the spec.
23912 (Binary::ResolveOperator): Same here.
23914 * class.cs (Operator::Define): Fix minor quirk in the tests.
23916 * ../errors/cs0215.cs : Added.
23918 * ../errors/cs0556.cs : Added.
23920 * ../errors/cs0555.cs : Added.
23922 2001-10-01 Miguel de Icaza <miguel@ximian.com>
23924 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
23925 single integer which is really efficient
23927 2001-10-01 Ravi Pratap <ravi@ximian.com>
23929 * expression.cs (Expression::ImplicitUserConversion): Use location
23930 even in the case when we are examining True operators.
23932 * class.cs (Operator::Define): Perform extensive checks to conform
23933 with the rules for operator overloading in the spec.
23935 * expression.cs (Expression::ImplicitReferenceConversion): Implement
23936 some of the other conversions mentioned in the spec.
23938 * typemanager.cs (array_type): New static member for the System.Array built-in
23941 (cloneable_interface): For System.ICloneable interface.
23943 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23944 we start resolving the tree and populating types.
23946 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23948 2001-10-01 Miguel de Icaza <miguel@ximian.com>
23950 * expression.cs (Expression::ExprClassFromMemberInfo,
23951 Expression::Literalize): Create literal expressions from
23952 FieldInfos which are literals.
23954 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23955 type casts, because they were wrong. The test suite in tests
23958 (ImplicitNumericConversion): ushort to ulong requires a widening
23961 Int32 constant to long requires widening cast as well.
23963 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23964 for integers because the type on the stack is not i4.
23966 2001-09-30 Miguel de Icaza <miguel@ximian.com>
23968 * expression.cs (report118): require location argument.
23970 * parameter.cs: Do not dereference potential null value.
23972 * class.cs: Catch methods that lack the `new' keyword when
23973 overriding a name. Report warnings when `new' is used without
23974 anything being there to override.
23976 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23978 * class.cs: Only add constructor to hashtable if it is non-null
23979 (as now constructors can fail on define).
23981 (TypeManager, Class, Struct): Take location arguments.
23983 Catch field instance initialization in structs as errors.
23985 accepting_filter: a new filter for FindMembers that is static so
23986 that we dont create an instance per invocation.
23988 (Constructor::Define): Catch errors where a struct constructor is
23991 * cs-parser.jay: Pass location information for various new
23994 * delegate.cs (Delegate): take a location argument.
23996 * driver.cs: Do not call EmitCode if there were problesm in the
23997 Definition of the types, as many Builders wont be there.
23999 * decl.cs (Decl::Decl): Require a location argument.
24001 * cs-tokenizer.cs: Handle properly hex constants that can not fit
24002 into integers, and find the most appropiate integer for it.
24004 * literal.cs: Implement ULongLiteral.
24006 * rootcontext.cs: Provide better information about the location of
24007 failure when CreateType fails.
24009 2001-09-29 Miguel de Icaza <miguel@ximian.com>
24011 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
24014 * expression.cs (Binary::CheckShiftArguments): Add missing type
24016 (Binary::ResolveOperator): Add type to the logical and and logical
24017 or, Bitwise And/Or and Exclusive Or code paths, it was missing
24020 (Binary::DoNumericPromotions): In the case where either argument
24021 is ulong (and most signed types combined with ulong cause an
24022 error) perform implicit integer constant conversions as well.
24024 2001-09-28 Miguel de Icaza <miguel@ximian.com>
24026 * expression.cs (UserImplicitCast): Method should always be
24028 (Invocation::BetterConversion): Simplified test for IntLiteral.
24030 (Expression::ImplicitNumericConversion): Split this routine out.
24031 Put the code that performs implicit constant integer conversions
24034 (Expression::Resolve): Become a wrapper around DoResolve so we can
24035 check eclass and type being set after resolve.
24037 (Invocation::Badness): Remove this dead function
24039 (Binary::ResolveOperator): Do not compute the expensive argumnets
24040 unless we have a union for it.
24042 (Probe::Emit): Is needs to do an isinst and then
24043 compare against null.
24045 (::CanConvert): Added Location argument. If the Location argument
24046 is null (Location.Null), then we do not report errors. This is
24047 used by the `probe' mechanism of the Explicit conversion. We do
24048 not want to generate an error for something that the user
24049 explicitly requested to be casted. But the pipeline for an
24050 explicit cast first tests for potential implicit casts.
24052 So for now, if the Location is null, it means `Probe only' to
24053 avoid adding another argument. Might have to revise this
24056 (ClassCast): New class used to type cast objects into arbitrary
24057 classes (used in Explicit Reference Conversions).
24059 Implement `as' as well.
24061 Reverted all the patches from Ravi below: they were broken:
24063 * The use of `level' as a mechanism to stop recursive
24064 invocations is wrong. That was there just to catch the
24065 bug with a strack trace but not as a way of addressing
24068 To fix the problem we have to *understand* what is going
24069 on and the interactions and come up with a plan, not
24070 just get things going.
24072 * The use of the type conversion cache that I proposed
24073 last night had an open topic: How does this work across
24074 protection domains. A user defined conversion might not
24075 be public in the location where we are applying the
24076 conversion, a different conversion might be selected
24077 (ie, private A->B (better) but public B->A (worse),
24078 inside A, A->B applies, but outside it, B->A will
24081 * On top of that (ie, even if the above is solved),
24082 conversions in a cache need to be abstract. Ie, `To
24083 convert from an Int to a Short use an OpcodeCast', not
24084 `To convert from an Int to a Short use the OpcodeCast on
24085 the variable 5' (which is what this patch was doing).
24087 2001-09-28 Ravi Pratap <ravi@ximian.com>
24089 * expression.cs (Invocation::ConversionExists): Re-write to use
24090 the conversion cache
24092 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
24093 cache all conversions done, not just user-defined ones.
24095 (Invocation::BetterConversion): The real culprit. Use ConversionExists
24096 to determine if a conversion exists instead of acutually trying to
24097 perform the conversion. It's faster too.
24099 (Expression::ConvertExplicit): Modify to use ConversionExists to check
24100 and only then attempt the implicit conversion.
24102 2001-09-28 Ravi Pratap <ravi@ximian.com>
24104 * expression.cs (ConvertImplicit): Use a cache for conversions
24105 already found. Check level of recursion and bail out if necessary.
24107 2001-09-28 Miguel de Icaza <miguel@ximian.com>
24109 * typemanager.cs (string_concat_string_string, string_concat_object_object):
24110 Export standard methods that we expect for string operations.
24112 * statement.cs (Block::UsageWarning): Track usage of variables and
24113 report the errors for not used variables.
24115 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
24118 2001-09-27 Miguel de Icaza <miguel@ximian.com>
24120 * codegen.cs: remove unnneded code
24122 * expression.cs: Removed BuiltinTypeAccess class
24124 Fix the order in which implicit conversions are
24127 The previous fixed dropped support for boxed conversions (adding a
24128 test to the test suite now)
24130 (UserImplicitCast::CanConvert): Remove test for source being null,
24131 that code is broken. We should not feed a null to begin with, if
24132 we do, then we should track the bug where the problem originates
24133 and not try to cover it up here.
24135 Return a resolved expression of type UserImplicitCast on success
24136 rather than true/false. Ravi: this is what I was talking about,
24137 the pattern is to use a static method as a "constructor" for
24140 Also, do not create arguments until the very last minute,
24141 otherwise we always create the arguments even for lookups that
24142 will never be performed.
24144 (UserImplicitCast::Resolve): Eliminate, objects of type
24145 UserImplicitCast are born in a fully resolved state.
24147 * typemanager.cs (InitCoreTypes): Init also value_type
24148 (System.ValueType).
24150 * expression.cs (Cast::Resolve): First resolve the child expression.
24152 (LValue): Add new method AddressOf to be used by
24155 Change the argument of Store to take an EmitContext instead of an
24156 ILGenerator, because things like FieldExpr need to be able to call
24157 their children expression to generate the instance code.
24159 (Expression::Error, Expression::Warning): Sugar functions for
24162 (Expression::MemberLookup): Accept a TypeContainer instead of a
24163 Report as the first argument.
24165 (Expression::ResolvePrimary): Killed. I still want to improve
24166 this as currently the code is just not right.
24168 (Expression::ResolveMemberAccess): Simplify, but it is still
24171 (Unary::Resolve): Catch errors in AddressOf operators.
24173 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
24174 index to a byte for the short-version, or the compiler will choose
24175 the wrong Emit call, which generates the wrong data.
24177 (ParameterReference::Emit, ::Store): same.
24179 (FieldExpr::AddressOf): Implement.
24181 * typemanager.cs: TypeManager: made public variable instead of
24184 * driver.cs: document --fatal.
24186 * report.cs (ErrorMessage, WarningMessage): new names for the old
24187 Error and Warning classes.
24189 * cs-parser.jay (member_access): Turn built-in access to types
24190 into a normal simplename
24192 2001-09-27 Ravi Pratap <ravi@ximian.com>
24194 * expression.cs (Invocation::BetterConversion): Fix to cope
24195 with q being null, since this was introducing a bug.
24197 * expression.cs (ConvertImplicit): Do built-in conversions first.
24199 2001-09-27 Ravi Pratap <ravi@ximian.com>
24201 * expression.cs (UserImplicitCast::Resolve): Fix bug.
24203 2001-09-27 Ravi Pratap <ravi@ximian.com>
24205 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
24206 I had introduced long ago (what's new ?).
24208 * expression.cs (UserImplicitCast::CanConvert): Static method to do
24209 the work of all the checking.
24210 (ConvertImplicit): Call CanConvert and only then create object if necessary.
24211 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
24213 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
24214 that is the right way.
24216 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
24217 overloading resolution. Use everywhere instead of cutting and pasting code.
24219 (Binary::ResolveOperator): Use MakeUnionSet.
24221 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
24222 we have to convert to bool types. Not complete yet.
24224 2001-09-27 Miguel de Icaza <miguel@ximian.com>
24226 * typemanager.cs (TypeManager::CSharpName): support ushort.
24228 * expression.cs (Expression::TryImplicitIntConversion): Attempts
24229 to provide an expression that performsn an implicit constant int
24230 conversion (section 6.1.6).
24231 (Expression::ConvertImplicitRequired): Reworked to include
24232 implicit constant expression conversions.
24234 (Expression::ConvertNumericExplicit): Finished.
24236 (Invocation::Emit): If InstanceExpression is null, then it means
24237 that we perform a call on this.
24239 2001-09-26 Miguel de Icaza <miguel@ximian.com>
24241 * expression.cs (Unary::Emit): Remove some dead code.
24242 (Probe): Implement Resolve and Emit for `is'.
24243 (Expression::ConvertImplicitRequired): Attempt to do constant
24244 expression conversions here. Maybe should be moved to
24245 ConvertImplicit, but I am not sure.
24246 (Expression::ImplicitLongConstantConversionPossible,
24247 Expression::ImplicitIntConstantConversionPossible): New functions
24248 that tell whether is it possible to apply an implicit constant
24249 expression conversion.
24251 (ConvertNumericExplicit): Started work on explicit numeric
24254 * cs-parser.jay: Update operator constants.
24256 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
24257 (Parameters::GetSignature): Hook up VerifyArgs here.
24258 (Parameters::VerifyArgs): Verifies that no two arguments have the
24261 * class.cs (Operator): Update the operator names to reflect the
24262 ones that the spec expects (as we are just stringizing the
24265 * expression.cs (Unary::ResolveOperator): Fix bug: Use
24266 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
24267 previous usage did only work for our methods.
24268 (Expression::ConvertImplicit): Handle decimal implicit numeric
24269 conversions as well.
24270 (Expression::InternalTypeConstructor): Used to invoke constructors
24271 on internal types for default promotions.
24273 (Unary::Emit): Implement special handling for the pre/post
24274 increment/decrement for overloaded operators, as they need to have
24275 the same semantics as the other operators.
24277 (Binary::ResolveOperator): ditto.
24278 (Invocation::ConversionExists): ditto.
24279 (UserImplicitCast::Resolve): ditto.
24281 2001-09-26 Ravi Pratap <ravi@ximian.com>
24283 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
24284 operator, return after emitting body. Regression tests pass again !
24286 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
24287 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
24288 (Invocation::OverloadResolve): Ditto.
24289 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
24291 * everywhere : update calls to the above methods accordingly.
24293 2001-09-26 Miguel de Icaza <miguel@ximian.com>
24295 * assign.cs (Assign): Make it inherit from ExpressionStatement.
24297 * expression.cs (ExpressionStatement): New base class used for
24298 expressions that can appear in statements, so that we can provide
24299 an alternate path to generate expression that do not leave a value
24302 (Expression::Emit, and all the derivatives): We no longer return
24303 whether a value is left on the stack or not. Every expression
24304 after being emitted leaves a single value on the stack.
24306 * codegen.cs (EmitContext::EmitStatementExpression): Use the
24307 facilties of ExpressionStatement if possible.
24309 * cs-parser.jay: Update statement_expression.
24311 2001-09-25 Miguel de Icaza <miguel@ximian.com>
24313 * driver.cs: Change the wording of message
24315 2001-09-25 Ravi Pratap <ravi@ximian.com>
24317 * expression.cs (Binary::ResolveOperator): Had forgottten to set
24318 the type of the expression to the return type of the method if
24319 we have an overloaded operator match ! The regression tests pass again !
24320 (Unary::ResolveOperator): Ditto.
24322 * expression.cs (Invocation::ConversionExists): Correct the member lookup
24323 to find "op_Implicit", not "implicit" ;-)
24324 (UserImplicitCast): New class to take care of user-defined implicit conversions.
24325 (ConvertImplicit, ForceConversion): Take TypeContainer argument
24327 * everywhere : Correct calls to the above accordingly.
24329 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
24330 (ConvertImplicit): Do user-defined conversion if it exists.
24332 2001-09-24 Miguel de Icaza <miguel@ximian.com>
24334 * assign.cs: track location.
24335 (Resolve): Use implicit conversions on assignment.
24337 * literal.cs: Oops. Not good, Emit of short access values should
24338 pass (Bytes) or the wrong argument will be selected.
24340 * expression.cs (Unary::Emit): Emit code for -expr.
24342 (Unary::ResolveOperator): Handle `Substract' for non-constants
24343 (substract from zero from the non-constants).
24344 Deal with Doubles as well.
24346 (Expression::ConvertImplicitRequired): New routine that reports an
24347 error if no implicit conversion exists.
24349 (Invocation::OverloadResolve): Store the converted implicit
24350 expressions if we make them
24352 2001-09-24 Ravi Pratap <ravi@ximian.com>
24354 * class.cs (ConstructorInitializer): Take a Location argument.
24355 (ConstructorBaseInitializer): Same here.
24356 (ConstructorThisInitializer): Same here.
24358 * cs-parser.jay : Update all calls accordingly.
24360 * expression.cs (Unary, Binary, New): Take location argument.
24361 Update accordingly everywhere.
24363 * cs-parser.jay : Update all calls to the above to take a location
24366 * class.cs : Ditto.
24368 2001-09-24 Ravi Pratap <ravi@ximian.com>
24370 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
24371 (Invocation::BetterConversion): Same here
24372 (Invocation::ConversionExists): Ditto.
24374 (Invocation::ConversionExists): Implement.
24376 2001-09-22 Ravi Pratap <ravi@ximian.com>
24378 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
24379 Also take an additional TypeContainer argument.
24381 * All over : Pass in TypeContainer as argument to OverloadResolve.
24383 * typemanager.cs (CSharpName): Update to check for the string type and return
24386 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
24389 2001-09-21 Ravi Pratap <ravi@ximian.com>
24391 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
24392 (Invocation::BetterFunction): Implement.
24393 (Invocation::BetterConversion): Implement.
24394 (Invocation::ConversionExists): Skeleton, no implementation yet.
24396 Okay, things work fine !
24398 2001-09-21 Miguel de Icaza <miguel@ximian.com>
24400 * typemanager.cs: declare and load enum_type, delegate_type and
24403 * expression.cs (Expression::Emit): Now emit returns a value that
24404 tells whether a value is left on the stack or not. This strategy
24405 might be reveted tomorrow with a mechanism that would address
24406 multiple assignments.
24407 (Expression::report118): Utility routine to report mismatches on
24410 (Unary::Report23): Report impossible type/operator combination
24413 (Unary::IsIncrementableNumber): Whether the type can be
24414 incremented or decremented with add.
24415 (Unary::ResolveOperator): Also allow enumerations to be bitwise
24417 (Unary::ResolveOperator): Implement ++, !, ~,
24419 (Invocation::Emit): Deal with new Emit convetion.
24421 * All Expression derivatives: Updated their Emit method to return
24422 whether they leave values on the stack or not.
24424 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
24425 stack for expressions that are statements.
24427 2001-09-20 Miguel de Icaza <miguel@ximian.com>
24429 * expression.cs (LValue): New interface. Must be implemented by
24431 (LocalVariableReference, ParameterReference, FieldExpr): Implement
24434 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
24435 interface for generating code, simplifies the code.
24437 2001-09-20 Ravi Pratap <ravi@ximian.com>
24439 * expression.cs (everywhere): Comment out return statements in ::Resolve
24440 methods to avoid the warnings.
24442 2001-09-20 Miguel de Icaza <miguel@ximian.com>
24444 * driver.cs (parse): Report error 2001 if we can not open the
24447 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
24450 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
24453 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
24454 otherwise nested blocks end up with the same index.
24456 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
24458 * expression.cs: Instead of having FIXMEs in the Resolve
24459 functions, throw exceptions so it is obvious that we are facing a
24462 * cs-parser.jay (invocation_expression): Pass Location information.
24464 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
24465 Use a basename for those routines because .NET does not like paths
24468 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
24471 2001-09-19 Miguel de Icaza <miguel@ximian.com>
24473 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
24474 are loading the correct data types (throws an exception if not).
24475 (TypeManager::InitCoreTypes): Use CoreLookupType
24477 * expression.cs (Unary::ResolveOperator): return the child
24478 expression for expressions which are just +expr.
24479 (Unary::ResolveOperator): Return negative literals for -LITERAL
24480 expressions (otherwise they are Unary {Literal}).
24481 (Invocation::Badness): Take into account `Implicit constant
24482 expression conversions'.
24484 * literal.cs (LongLiteral): Implement long literal class.
24485 (IntLiteral): export the `Value' of the intliteral.
24487 2001-09-19 Ravi Pratap <ravi@ximian.com>
24489 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
24491 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
24492 instead of 'Operator'
24494 * expression.cs (Binary::ResolveOperator): Update accordingly.
24495 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
24498 * cs-parser.jay (unary_expression): Update to use the new names.
24500 * gen-treedump.cs (GetUnary): Same here.
24502 * expression.cs (Unary::Resolve): Implement.
24503 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
24504 operators are found instead of making noise ;-)
24505 (Unary::ResolveOperator): New method to do precisely the same thing which
24506 Binary::ResolveOperator does for Binary expressions.
24507 (Unary.method, .Arguments): Add.
24508 (Unary::OperName): Implement.
24509 (Unary::ForceConversion): Copy and Paste !
24511 * class.cs (Operator::Define): Fix a small bug for the case when we have
24514 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
24515 for the inbuilt operators. Only overloading works for now ;-)
24517 2001-09-18 Miguel de Icaza <miguel@ximian.com>
24519 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
24520 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
24522 * expression.cs (This::Emit): Implement.
24523 (This::Resolve): Implement.
24524 (TypeOf:Resolve): Implement.
24525 (Expression::ResolveSimpleName): Add an implicit this to instance
24527 (MemberAccess::Resolve): Deal with Parameters and Fields.
24528 Bind instance variable to Field expressions.
24529 (FieldExpr::Instance): New field used to track the expression that
24530 represents the object instance.
24531 (FieldExpr::Resolve): Track potential errors from MemberLookup not
24533 (FieldExpr::Emit): Implement.
24535 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
24536 the last instruction contains a return opcode to avoid generating
24537 the last `ret' instruction (this generates correct code, and it is
24538 nice to pass the peverify output).
24540 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
24541 initializer for static and instance variables.
24542 (Constructor::Emit): Allow initializer to be null in the case of
24543 static constructors. Only emit initializer for instance
24546 (TypeContainer::FindMembers): Return a null array if there are no
24549 Also fix the code for the MemberTypes.Method branch, as it was not
24550 scanning that for operators (or tried to access null variables before).
24552 * assign.cs (Assign::Emit): Handle instance and static fields.
24556 * driver.cs: Stop compilation if there are parse errors.
24558 * cs-parser.jay (constructor_declaration): Provide default base
24559 initializer for non-static constructors.
24560 (constructor_declarator): Do not provide a default base
24561 initializers if none was specified.
24562 Catch the fact that constructors should not have parameters.
24564 * class.cs: Do not emit parent class initializers for static
24565 constructors, that should be flagged as an error.
24567 2001-09-18 Ravi Pratap <ravi@ximian.com>
24569 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
24570 Move back code into TypeContainer::Populate.
24572 2001-09-18 Ravi Pratap <ravi@ximian.com>
24574 * class.cs (TypeContainer::AddConstructor): Fix the check to
24575 compare against Name, not Basename.
24576 (Operator::OpType): Change Plus and Minus to Add and Subtract.
24578 * cs-parser.jay : Update accordingly.
24580 * class.cs (TypeContainer::FindMembers): For the case where we are searching
24581 for methods, don't forget to look into the operators too.
24582 (RegisterMethodBuilder): Helper method to take care of this for
24583 methods, constructors and operators.
24584 (Operator::Define): Completely revamp.
24585 (Operator.OperatorMethod, MethodName): New fields.
24586 (TypeContainer::Populate): Move the registering of builders into
24587 RegisterMethodBuilder.
24588 (Operator::Emit): Re-write.
24590 * expression.cs (Binary::Emit): Comment out code path to emit method
24591 invocation stuff for the case when we have a user defined operator. I am
24592 just not able to get it right !
24594 2001-09-17 Miguel de Icaza <miguel@ximian.com>
24596 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
24599 (Expression::MemberLookup): Provide a version that allows to
24600 specify the MemberTypes and BindingFlags.
24602 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
24603 so it was not fetching variable information from outer blocks.
24605 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
24606 Beforefieldinit as it was buggy.
24608 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
24609 that Ravi put here.
24611 * class.cs (Constructor::Emit): Only emit if block is not null.
24612 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
24613 deal with this by semantically definining it as if the user had
24616 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
24617 constructors as we now "emit" them at a higher level.
24619 (TypeContainer::DefineDefaultConstructor): Used to define the
24620 default constructors if none was provided.
24622 (ConstructorInitializer): Add methods Resolve and Emit.
24624 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
24626 2001-09-17 Ravi Pratap <ravi@ximian.com>
24628 * class.cs (TypeContainer::EmitDefaultConstructor): Register
24629 the default constructor builder with our hashtable for methodbuilders
24632 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24633 and argument_count is 0 in which case we have a match.
24634 (Binary::ResolveOperator): More null checking and miscellaneous coding
24637 2001-09-17 Ravi Pratap <ravi@ximian.com>
24639 * rootcontext.cs (IsNameSpace): Compare against null.
24641 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24643 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24644 and Unary::Operator.
24646 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24649 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24650 we have overloaded operators.
24651 (Binary::ResolveOperator): Implement the part which does the operator overload
24654 * class.cs (Operator::Emit): Implement.
24655 (TypeContainer::Emit): Emit the operators we have too.
24657 * expression.cs (Binary::Emit): Update to emit the appropriate code for
24658 the case when we have a user-defined operator.
24660 2001-09-17 Miguel de Icaza <miguel@ximian.com>
24662 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24664 2001-09-16 Ravi Pratap <ravi@ximian.com>
24666 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24667 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24668 (Constructor::Emit): Implement.
24669 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24670 if we have no work to do.
24671 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
24674 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24675 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24677 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24680 2001-09-15 Ravi Pratap <ravi@ximian.com>
24682 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24684 (Tree::RecordNamespace): Method to do what the name says ;-)
24685 (Tree::Namespaces): Property to get at the namespaces hashtable.
24687 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
24690 * rootcontext.cs (IsNamespace): Fixed it :-)
24692 2001-09-14 Miguel de Icaza <miguel@ximian.com>
24694 * class.cs (TypeContainer::FindMembers): Add support for
24696 (MethodCore): New class that encapsulates both the shared aspects
24697 of a Constructor and a Method.
24698 (Method, Constructor): Factored pieces into MethodCore.
24700 * driver.cs: Added --fatal which makes errors throw exceptions.
24701 Load System assembly as well as part of the standard library.
24703 * report.cs: Allow throwing exceptions on errors for debugging.
24705 * modifiers.cs: Do not use `parent', instead use the real type
24706 container to evaluate permission settings.
24708 * class.cs: Put Ravi's patch back in. He is right, and we will
24709 have to cope with the
24711 2001-09-14 Ravi Pratap <ravi@ximian.com>
24713 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
24714 FamORAssem, not FamANDAssem.
24716 2001-09-14 Miguel de Icaza <miguel@ximian.com>
24718 * driver.cs: Added --parse option that only parses its input files
24721 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
24722 incorrect. IsTopLevel is not used to tell whether an object is
24723 root_types or not (that can be achieved by testing this ==
24724 root_types). But to see if this is a top-level *class* (not
24725 necessarly our "toplevel" container).
24727 2001-09-14 Ravi Pratap <ravi@ximian.com>
24729 * enum.cs (Enum::Define): Modify to call the Lookup method on the
24730 parent instead of a direct call to GetType.
24732 2001-09-14 Ravi Pratap <ravi@ximian.com>
24734 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
24735 Modifiers.TypeAttr. This should just be a call to that method.
24737 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
24738 object so that we can determine if we are top-level or not.
24740 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
24743 * enum.cs (Enum::Define): Ditto.
24745 * modifiers.cs (FieldAttr): Re-write.
24747 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24748 (TypeContainer::HaveStaticConstructor): New property to provide access
24749 to precisely that info.
24751 * modifiers.cs (MethodAttr): Re-write.
24752 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24754 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24755 of top-level types as claimed.
24757 2001-09-13 Miguel de Icaza <miguel@ximian.com>
24759 * expression.cs (MemberLookup): Fruitless attempt to lookup
24760 constructors. Maybe I need to emit default constructors? That
24761 might be it (currently .NET emits this for me automatically).
24762 (Invocation::OverloadResolve): Cope with Arguments == null.
24763 (Invocation::EmitArguments): new function, shared by the new
24764 constructor and us.
24765 (Invocation::Emit): Handle static and instance methods. Emit
24766 proper call instruction for virtual or non-virtual invocations.
24767 (New::Emit): Implement.
24768 (New::Resolve): Implement.
24769 (MemberAccess:Resolve): Implement.
24770 (MethodGroupExpr::InstanceExpression): used conforming to the spec
24771 to track instances.
24772 (FieldExpr::Resolve): Set type.
24774 * support.cs: Handle empty arguments.
24776 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24777 SimpleLookup): Auxiliary routines to help parse a qualifier
24780 Update qualifier_identifier rule.
24782 * codegen.cs: Removed debugging messages.
24784 * class.cs: Make this a global thing, this acts just as a "key" to
24785 objects that we might have around.
24787 (Populate): Only initialize method_builders_to_methods once.
24789 * expression.cs (PropertyExpr): Initialize type from the
24792 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24793 Resolve pattern. Attempt to implicitly convert value to boolean.
24796 * expression.cs: Set the type for the int32/int32 argument case.
24797 (Binary::ResolveOperator): Set the return type to boolean for
24798 comparission operators
24800 * typemanager.cs: Remove debugging print code.
24802 (Invocation::Resolve): resolve type.
24804 * class.cs: Allocate a MemberInfo of the correct size, as the code
24805 elsewhere depends on the test to reflect the correct contents.
24807 (Method::) Keep track of parameters, due to System.Reflection holes
24809 (TypeContainer::Populate): Keep track of MethodBuilders to Method
24812 (TypeContainer::FindMembers): Use ArrayList and then copy an array
24813 of the exact size and return that.
24815 (Class::LookupMethodByBuilder): New function that maps
24816 MethodBuilders to its methods. Required to locate the information
24817 on methods because System.Reflection bit us again.
24819 * support.cs: New file, contains an interface ParameterData and
24820 two implementations: ReflectionParameters and InternalParameters
24821 used to access Parameter information. We will need to grow this
24824 * expression.cs (Invocation::GetParameterData): implement a cache
24825 and a wrapper around the ParameterData creation for methods.
24826 (Invocation::OverloadResolve): Use new code.
24828 2001-09-13 Ravi Pratap <ravi@ximian.com>
24830 * class.cs (TypeContainer::EmitField): Remove and move into
24831 (Field::Define): here and modify accordingly.
24832 (Field.FieldBuilder): New member.
24833 (TypeContainer::Populate): Update accordingly.
24834 (TypeContainer::FindMembers): Implement.
24836 2001-09-13 Miguel de Icaza <miguel@ximian.com>
24838 * statement.cs: (VariableInfo::VariableType): New field to be
24839 initialized with the full type once it is resolved.
24841 2001-09-12 Miguel de Icaza <miguel@ximian.com>
24843 * parameter.cs (GetParameterInfo): Use a type cache to compute
24844 things only once, and to reuse this information
24846 * expression.cs (LocalVariableReference::Emit): Implement.
24847 (OpcodeCast::Emit): fix.
24849 (ParameterReference::Resolve): Implement.
24850 (ParameterReference::Emit): Implement.
24852 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24853 that are expressions need to stay as Expressions.
24855 * typemanager.cs (CSharpName): Returns the C# name of a type if
24858 * expression.cs (Expression::ConvertImplicit): New function that
24859 implements implicit type conversions.
24861 (Expression::ImplicitReferenceConversion): Implements implicit
24862 reference conversions.
24864 (EmptyCast): New type for transparent casts.
24866 (OpcodeCast): New type for casts of types that are performed with
24867 a sequence of bytecodes.
24869 (BoxedCast): New type used for casting value types into reference
24870 types. Emits a box opcode.
24872 (Binary::DoNumericPromotions): Implements numeric promotions of
24873 and computation of the Binary::Type.
24875 (Binary::EmitBranchable): Optimization.
24877 (Binary::Emit): Implement code emission for expressions.
24879 * typemanager.cs (TypeManager): Added two new core types: sbyte
24882 2001-09-12 Ravi Pratap <ravi@ximian.com>
24884 * class.cs (TypeContainer::FindMembers): Method which does exactly
24885 what Type.FindMembers does, only we don't have to use reflection. No
24886 implementation yet.
24888 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24889 typecontainer objects as we need to get at them.
24890 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24892 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24893 typecontainer object.
24895 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
24896 of just a Report object.
24898 2001-09-11 Ravi Pratap <ravi@ximian.com>
24900 * class.cs (Event::Define): Go back to using the prefixes "add_" and
24902 (TypeContainer::Populate): Now define the delegates of the type too.
24903 (TypeContainer.Delegates): Property to access the list of delegates defined
24906 * delegates.cs (Delegate::Define): Implement partially.
24908 * modifiers.cs (TypeAttr): Handle more flags.
24910 2001-09-11 Ravi Pratap <ravi@ximian.com>
24912 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
24914 (Operator::Define): Re-write logic to get types by using the LookupType method
24915 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
24916 (Indexer::Define): Ditto.
24917 (Event::Define): Ditto.
24918 (Property::Define): Ditto.
24920 2001-09-10 Ravi Pratap <ravi@ximian.com>
24922 * class.cs (TypeContainer::Populate): Now define operators too.
24923 (TypeContainer.Operators): New property to access the list of operators
24925 (Operator.OperatorMethodBuilder): New member to hold the method builder
24926 for the operator we are defining.
24927 (Operator::Define): Implement.
24929 2001-09-10 Ravi Pratap <ravi@ximian.com>
24931 * class.cs (Event::Define): Make the prefixes of the accessor methods
24932 addOn_ and removeOn_
24934 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24935 of the location being passed in too. Ideally, this should go later since all
24936 error reporting should be done through the Report object.
24938 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24939 (Populate): Iterate thru the indexers we have and define them too.
24940 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24941 for the get and set accessors.
24942 (Indexer::Define): Implement.
24944 2001-09-09 Miguel de Icaza <miguel@ximian.com>
24946 * expression.cs (Binary::Resolve): Beginning of it. I scratched
24947 my previous implementation, did not work.
24949 * typemanager.cs: Add a couple of missing types (the longs).
24951 * literal.cs: Use TypeManager.bool_type instead of getting it.
24953 * expression.cs (EventExpr): New kind of expressions.
24954 (Expressio::ExprClassFromMemberInfo): finish
24956 2001-09-08 Miguel de Icaza <miguel@ximian.com>
24958 * assign.cs: Emit stores to static fields differently.
24960 2001-09-08 Ravi Pratap <ravi@ximian.com>
24962 * Merge in changes and adjust code to tackle conflicts. Backed out my
24963 code in Assign::Resolve ;-)
24965 2001-09-08 Ravi Pratap <ravi@ximian.com>
24967 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24968 instead Report.Error and also pass in the location.
24969 (CSharpParser::Lexer): New readonly property to return the reference
24970 to the Tokenizer object.
24971 (declare_local_variables): Use Report.Error with location instead of plain
24975 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24976 (Operator.CheckBinaryOperator): Ditto.
24978 * cs-parser.jay (operator_declarator): Update accordingly.
24980 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24981 (CheckBinaryOperator): Same here.
24983 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24984 on the name without any prefixes of namespace names etc. This is because we
24985 already might have something already fully qualified like
24986 'System.Console.WriteLine'
24988 * assign.cs (Resolve): Begin implementation. Stuck ;-)
24990 2001-09-07 Ravi Pratap <ravi@ximian.com>
24992 * cs-tokenizer.cs (location): Return a string which also contains
24995 * expression.cs (ElementAccess): New class for expressions of the
24996 type 'element access.'
24997 (BaseAccess): New class for expressions of the type 'base access.'
24998 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
25001 * cs-parser.jay (element_access): Implement action.
25002 (base_access): Implement actions.
25003 (checked_expression, unchecked_expression): Implement.
25005 * cs-parser.jay (local_variable_type): Correct and implement.
25006 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
25008 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
25010 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
25011 name and the specifiers.
25013 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
25015 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
25016 making them all public ;-)
25018 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
25021 2001-09-07 Miguel de Icaza <miguel@ximian.com>
25023 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
25025 (FieldExpr, PropertyExprs): New resolved expressions.
25026 (SimpleName::MemberStaticCheck): Perform static checks for access
25027 to non-static fields on static methods. Maybe this should be
25028 generalized for MemberAccesses.
25029 (SimpleName::ResolveSimpleName): More work on simple name
25032 * cs-parser.jay (primary_expression/qualified_identifier): track
25033 the parameter index.
25035 * codegen.cs (CodeGen::Save): Catch save exception, report error.
25036 (EmitContext::EmitBoolExpression): Chain to expression generation
25037 instead of temporary hack.
25038 (::EmitStatementExpression): Put generic expression code generation.
25040 * assign.cs (Assign::Emit): Implement variable assignments to
25041 local variables, parameters and fields.
25043 2001-09-06 Miguel de Icaza <miguel@ximian.com>
25045 * statement.cs (Block::GetVariableInfo): New method, returns the
25046 VariableInfo for a variable name in a block.
25047 (Block::GetVariableType): Implement in terms of GetVariableInfo
25049 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
25050 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
25052 2001-09-06 Ravi Pratap <ravi@ximian.com>
25054 * cs-parser.jay (operator_declaration): Continue on my quest : update
25055 to take attributes argument.
25056 (event_declaration): Ditto.
25057 (enum_declaration): Ditto.
25058 (indexer_declaration): Ditto.
25060 * class.cs (Operator::Operator): Update constructor accordingly.
25061 (Event::Event): Ditto.
25063 * delegate.cs (Delegate::Delegate): Same here.
25065 * enum.cs (Enum::Enum): Same here.
25067 2001-09-05 Ravi Pratap <ravi@ximian.com>
25069 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
25071 * ../tests/cs0658.cs : New file to demonstrate error 0658.
25073 * attribute.cs (Attributes): New class to encapsulate all attributes which were
25074 being passed around as an arraylist.
25075 (Attributes::AddAttribute): Method to add attribute sections.
25077 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
25078 (struct_declaration): Update accordingly.
25079 (constant_declaration): Update.
25080 (field_declaration): Update.
25081 (method_header): Update.
25082 (fixed_parameter): Update.
25083 (parameter_array): Ditto.
25084 (property_declaration): Ditto.
25085 (destructor_declaration): Ditto.
25087 * class.cs (Struct::Struct): Update constructors accordingly.
25088 (Class::Class): Ditto.
25089 (Field::Field): Ditto.
25090 (Method::Method): Ditto.
25091 (Property::Property): Ditto.
25092 (TypeContainer::OptAttribute): update property's return type.
25094 * interface.cs (Interface.opt_attributes): New member.
25095 (Interface::Interface): Update to take the extra Attributes argument.
25097 * parameter.cs (Parameter::Parameter): Ditto.
25099 * constant.cs (Constant::Constant): Ditto.
25101 * interface.cs (InterfaceMemberBase): New OptAttributes field.
25102 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
25103 the attributes as a parameter.
25104 (InterfaceProperty): Update constructor call.
25105 (InterfaceEvent): Ditto.
25106 (InterfaceMethod): Ditto.
25107 (InterfaceIndexer): Ditto.
25109 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
25110 pass the attributes too.
25111 (interface_event_declaration): Ditto.
25112 (interface_property_declaration): Ditto.
25113 (interface_method_declaration): Ditto.
25114 (interface_declaration): Ditto.
25116 2001-09-05 Miguel de Icaza <miguel@ximian.com>
25118 * class.cs (Method::Define): Track the "static Main" definition to
25119 create an entry point.
25121 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
25122 EntryPoint if we find it.
25124 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
25125 (EmitContext::ig): Make this variable public.
25127 * driver.cs: Make the default output file be the first file name
25128 with the .exe extension.
25130 Detect empty compilations
25132 Handle various kinds of output targets. Handle --target and
25133 rename -t to --dumper.
25135 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
25136 methods inherited from Expression return now an Expression. This
25137 will is used during the tree rewriting as we resolve them during
25140 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
25141 the spec. Missing entirely is the information about
25142 accessability of elements of it.
25144 (Expression::ExprClassFromMemberInfo): New constructor for
25145 Expressions that creates a fully initialized Expression based on
25146 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
25149 (Invocation::Resolve): Begin implementing resolution of invocations.
25151 * literal.cs (StringLiteral): Implement Emit.
25153 2001-09-05 Ravi Pratap <ravi@ximian.com>
25155 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
25158 2001-09-04 Ravi Pratap <ravi@ximian.com>
25160 * cs-parser.jay (attribute_arguments): Implement actions.
25161 (attribute): Fix bug in production. Implement action.
25162 (attribute_list): Implement.
25163 (attribute_target): Implement.
25164 (attribute_target_specifier, opt_target_specifier): Implement
25165 (CheckAttributeTarget): New method to check if the attribute target
25167 (attribute_section): Implement.
25168 (opt_attributes): Implement.
25170 * attribute.cs : New file to handle attributes.
25171 (Attribute): Class to hold attribute info.
25173 * cs-parser.jay (opt_attribute_target_specifier): Remove production
25174 (attribute_section): Modify production to use 2 different rules to
25175 achieve the same thing. 1 s/r conflict down !
25176 Clean out commented, useless, non-reducing dimension_separator rules.
25178 * class.cs (TypeContainer.attributes): New member to hold list
25179 of attributes for a type.
25180 (Struct::Struct): Modify to take one more argument, the attribute list.
25181 (Class::Class): Ditto.
25182 (Field::Field): Ditto.
25183 (Method::Method): Ditto.
25184 (Property::Property): Ditto.
25186 * cs-parser.jay (struct_declaration): Update constructor call to
25187 pass in the attributes too.
25188 (class_declaration): Ditto.
25189 (constant_declaration): Ditto.
25190 (field_declaration): Ditto.
25191 (method_header): Ditto.
25192 (fixed_parameter): Ditto.
25193 (parameter_array): Ditto.
25194 (property_declaration): Ditto.
25196 * constant.cs (Constant::Constant): Update constructor similarly.
25197 Use System.Collections.
25199 * parameter.cs (Parameter::Parameter): Update as above.
25201 2001-09-02 Ravi Pratap <ravi@ximian.com>
25203 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
25204 (TypeContainer.delegates): New member to hold list of delegates.
25206 * cs-parser.jay (delegate_declaration): Implement the action correctly
25207 this time as I seem to be on crack ;-)
25209 2001-09-02 Miguel de Icaza <miguel@ximian.com>
25211 * rootcontext.cs (RootContext::IsNamespace): new function, used to
25212 tell whether an identifier represents a namespace.
25214 * expression.cs (NamespaceExpr): A namespace expression, used only
25215 temporarly during expression resolution.
25216 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
25217 utility functions to resolve names on expressions.
25219 2001-09-01 Miguel de Icaza <miguel@ximian.com>
25221 * codegen.cs: Add hook for StatementExpressions.
25223 * class.cs: Fix inverted test for static flag in methods.
25225 2001-09-02 Ravi Pratap <ravi@ximian.com>
25227 * class.cs (Operator::CheckUnaryOperator): Correct error number used
25228 to make it coincide with MS' number.
25229 (Operator::CheckBinaryOperator): Ditto.
25231 * ../errors/errors.txt : Remove error numbers added earlier.
25233 * ../errors/cs1019.cs : Test case for error # 1019
25235 * ../errros/cs1020.cs : Test case for error # 1020
25237 * cs-parser.jay : Clean out commented cruft.
25238 (dimension_separators, dimension_separator): Comment out. Ostensibly not
25239 used anywhere - non-reducing rule.
25240 (namespace_declarations): Non-reducing rule - comment out.
25242 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
25243 with TypeContainer::AddEnum.
25245 * delegate.cs : New file for delegate handling classes.
25246 (Delegate): Class for declaring delegates.
25248 * makefile : Update.
25250 * cs-parser.jay (delegate_declaration): Implement.
25252 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
25254 * class.cs (Event::Define): Implement.
25255 (Event.EventBuilder): New member.
25257 * class.cs (TypeContainer::Populate): Update to define all enums and events
25259 (Events): New property for the events arraylist we hold. Shouldn't we move to using
25260 readonly fields for all these cases ?
25262 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
25264 * class.cs (Property): Revamp to use the convention of making fields readonly.
25265 Accordingly modify code elsewhere.
25267 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
25268 the Define method of the Property class.
25270 * class.cs : Clean up applied patch and update references to variables etc. Fix
25272 (TypeContainer::Populate): Update to define all the properties we have. Also
25273 define all enumerations.
25275 * enum.cs (Define): Implement.
25277 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
25279 * cs-parser.jay (overloadable_operator): The semantic value is an
25280 enum of the Operator class.
25281 (operator_declarator): Implement actions.
25282 (operator_declaration): Implement.
25284 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
25285 validity of definitions.
25286 (Operator::CheckBinaryOperator): Static method to check for binary operators
25287 (TypeContainer::AddOperator): New method to add an operator to a type.
25289 * cs-parser.jay (indexer_declaration): Added line to actually call the
25290 AddIndexer method so it gets added ;-)
25292 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
25293 already taken care of by the MS compiler ?
25295 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
25297 * class.cs (Operator): New class for operator declarations.
25298 (Operator::OpType): Enum for the various operators.
25300 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
25302 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
25303 ostensibly handle this in semantic analysis.
25305 * cs-parser.jay (general_catch_clause): Comment out
25306 (specific_catch_clauses, specific_catch_clause): Ditto.
25307 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
25308 (catch_args, opt_catch_args): New productions.
25309 (catch_clause): Rewrite to use the new productions above
25310 (catch_clauses): Modify accordingly.
25311 (opt_catch_clauses): New production to use in try_statement
25312 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
25313 and re-write the code in the actions to extract the specific and
25314 general catch clauses by being a little smart ;-)
25316 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
25317 Hooray, try and catch statements parse fine !
25319 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
25321 * statement.cs (Block::GetVariableType): Fix logic to extract the type
25322 string from the hashtable of variables.
25324 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
25325 I end up making that mistake ;-)
25326 (catch_clauses): Fixed gross error which made Key and Value of the
25327 DictionaryEntry the same : $1 !!
25329 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
25331 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
25333 * cs-parser.jay (event_declaration): Correct to remove the semicolon
25334 when the add and remove accessors are specified.
25336 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
25338 * cs-parser.jay (IndexerDeclaration): New helper class to hold
25339 information about indexer_declarator.
25340 (indexer_declarator): Implement actions.
25341 (parsing_indexer): New local boolean used to keep track of whether
25342 we are parsing indexers or properties. This is necessary because
25343 implicit_parameters come into picture even for the get accessor in the
25344 case of an indexer.
25345 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
25347 * class.cs (Indexer): New class for indexer declarations.
25348 (TypeContainer::AddIndexer): New method to add an indexer to a type.
25349 (TypeContainer::indexers): New member to hold list of indexers for the
25352 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
25354 * cs-parser.jay (add_accessor_declaration): Implement action.
25355 (remove_accessor_declaration): Implement action.
25356 (event_accessors_declaration): Implement
25357 (variable_declarators): swap statements for first rule - trivial.
25359 * class.cs (Event): New class to hold information about event
25361 (TypeContainer::AddEvent): New method to add an event to a type
25362 (TypeContainer::events): New member to hold list of events.
25364 * cs-parser.jay (event_declaration): Implement actions.
25366 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
25368 * cs-parser.jay (dim_separators): Implement. Make it a string
25369 concatenating all the commas together, just as they appear.
25370 (opt_dim_separators): Modify accordingly
25371 (rank_specifiers): Update accordingly. Basically do the same
25372 thing - instead, collect the brackets here.
25373 (opt_rank_sepcifiers): Modify accordingly.
25374 (array_type): Modify to actually return the complete type string
25375 instead of ignoring the rank_specifiers.
25376 (expression_list): Implement to collect the expressions
25377 (variable_initializer): Implement. We make it a list of expressions
25378 essentially so that we can handle the array_initializer case neatly too.
25379 (variable_initializer_list): Implement.
25380 (array_initializer): Make it a list of variable_initializers
25381 (opt_array_initializer): Modify accordingly.
25383 * expression.cs (New::NType): Add enumeration to help us
25384 keep track of whether we have an object/delegate creation
25385 or an array creation.
25386 (New:NewType, New::Rank, New::Indices, New::Initializers): New
25387 members to hold data about array creation.
25388 (New:New): Modify to update NewType
25389 (New:New): New Overloaded contructor for the array creation
25392 * cs-parser.jay (array_creation_expression): Implement to call
25393 the overloaded New constructor.
25395 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
25397 * class.cs (TypeContainer::Constructors): Return member
25398 constructors instead of returning null.
25400 2001-08-26 Miguel de Icaza <miguel@ximian.com>
25402 * typemanager.cs (InitCoreTypes): Initialize the various core
25403 types after we have populated the type manager with the user
25404 defined types (this distinction will be important later while
25405 compiling corlib.dll)
25407 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
25408 on Expression Classification. Now all expressions have a method
25409 `Resolve' and a method `Emit'.
25411 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
25412 generation from working. Also add some temporary debugging
25415 2001-08-24 Miguel de Icaza <miguel@ximian.com>
25417 * codegen.cs: Lots of code generation pieces. This is only the
25418 beginning, will continue tomorrow with more touches of polish. We
25419 handle the fundamentals of if, while, do, for, return. Others are
25420 trickier and I need to start working on invocations soon.
25422 * gen-treedump.cs: Bug fix, use s.Increment here instead of
25425 * codegen.cs (EmitContext): New struct, used during code
25426 emission to keep a context. Most of the code generation will be
25429 * cs-parser.jay: Add embedded blocks to the list of statements of
25430 this block. So code generation proceeds in a top down fashion.
25432 2001-08-23 Miguel de Icaza <miguel@ximian.com>
25434 * statement.cs: Add support for multiple child blocks.
25436 2001-08-22 Miguel de Icaza <miguel@ximian.com>
25438 * codegen.cs (EmitCode): New function, will emit the code for a
25439 Block of code given a TypeContainer and its ILGenerator.
25441 * statement.cs (Block): Standard public readonly optimization.
25442 (Block::Block constructors): Link children.
25443 (Block::Child): Child Linker.
25444 (Block::EmitVariables): Emits IL variable declarations.
25446 * class.cs: Drop support for MethodGroups here, delay until
25448 (Method::): Applied the same simplification that I did before, and
25449 move from Properties to public readonly fields.
25450 (Method::ParameterTypes): Returns the parameter types for the
25451 function, and implements a cache that will be useful later when I
25452 do error checking and the semantic analysis on the methods is
25454 (Constructor::GetCallingConvention): Renamed from CallingConvetion
25455 and made a method, optional argument tells whether this is a class
25456 or a structure to apply the `has-this' bit.
25457 (Method::GetCallingConvention): Implement, returns the calling
25459 (Method::Define): Defines the type, a second pass is performed
25460 later to populate the methods.
25462 (Constructor::ParameterTypes): implement a cache similar to the
25463 one on Method::ParameterTypes, useful later when we do semantic
25466 (TypeContainer::EmitMethod): New method. Emits methods.
25468 * expression.cs: Removed MethodGroup class from here.
25470 * parameter.cs (Parameters::GetCallingConvention): new method.
25472 2001-08-21 Miguel de Icaza <miguel@ximian.com>
25474 * class.cs (TypeContainer::Populate): Drop RootContext from the
25477 (Constructor::CallingConvention): Returns the calling convention.
25478 (Constructor::ParameterTypes): Returns the constructor parameter
25481 (TypeContainer::AddConstructor): Keep track of default constructor
25482 and the default static constructor.
25484 (Constructor::) Another class that starts using `public readonly'
25485 instead of properties.
25487 (Constructor::IsDefault): Whether this is a default constructor.
25489 (Field::) use readonly public fields instead of properties also.
25491 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
25492 track of static constructors; If none is used, turn on
25493 BeforeFieldInit in the TypeAttributes.
25495 * cs-parser.jay (opt_argument_list): now the return can be null
25496 for the cases where there are no arguments.
25498 (constructor_declarator): If there is no implicit `base' or
25499 `this', then invoke the default parent constructor.
25501 * modifiers.cs (MethodAttr): New static function maps a set of
25502 modifiers flags into a MethodAttributes enum
25503 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
25504 MethodAttr, TypeAttr to represent the various mappings where the
25505 modifiers are used.
25506 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
25508 2001-08-19 Miguel de Icaza <miguel@ximian.com>
25510 * parameter.cs (GetParameterInfo): Fix bug where there would be no
25513 * interface.cs (PopulateIndexer): Implemented the code generator
25514 for interface indexers.
25516 2001-08-17 Miguel de Icaza <miguel@ximian.com>
25518 * interface.cs (InterfaceMemberBase): Now we track the new status
25521 (PopulateProperty): Implement property population. Woohoo! Got
25522 Methods and Properties going today.
25524 Removed all the properties for interfaces, and replaced them with
25525 `public readonly' fields.
25527 2001-08-16 Miguel de Icaza <miguel@ximian.com>
25529 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
25530 initialize their hashtables/arraylists only when they are needed
25531 instead of doing this always.
25533 * parameter.cs: Handle refs and out parameters.
25535 * cs-parser.jay: Use an ArrayList to construct the arguments
25536 instead of the ParameterCollection, and then cast that to a
25539 * parameter.cs: Drop the use of ParameterCollection and use
25540 instead arrays of Parameters.
25542 (GetParameterInfo): Use the Type, not the Name when resolving
25545 2001-08-13 Miguel de Icaza <miguel@ximian.com>
25547 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
25548 and instead use public readonly fields.
25550 * class.cs: Put back walking code for type containers.
25552 2001-08-11 Miguel de Icaza <miguel@ximian.com>
25554 * class.cs (MakeConstant): Code to define constants.
25556 * rootcontext.cs (LookupType): New function. Used to locate types
25559 2001-08-08 Miguel de Icaza <miguel@ximian.com>
25561 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
25562 this System.Reflection code is. Kudos to Microsoft
25564 * typemanager.cs: Implement a type cache and avoid loading all
25565 types at boot time. Wrap in LookupType the internals. This made
25566 the compiler so much faster. Wow. I rule!
25568 * driver.cs: Make sure we always load mscorlib first (for
25569 debugging purposes, nothing really important).
25571 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
25572 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
25574 * rootcontext.cs: Lookup types on their namespace; Lookup types
25575 on namespaces that have been imported using the `using' keyword.
25577 * class.cs (TypeContainer::TypeAttr): Virtualize.
25578 (Class::TypeAttr): Return attributes suitable for this bad boy.
25579 (Struct::TypeAttr): ditto.
25580 Handle nested classes.
25581 (TypeContainer::) Remove all the type visiting code, it is now
25582 replaced with the rootcontext.cs code
25584 * rootcontext.cs (GetClassBases): Added support for structs.
25586 2001-08-06 Miguel de Icaza <miguel@ximian.com>
25588 * interface.cs, statement.cs, class.cs, parameter.cs,
25589 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
25590 Drop use of TypeRefs, and use strings instead.
25592 2001-08-04 Miguel de Icaza <miguel@ximian.com>
25596 * class.cs (Struct::Struct): set the SEALED flags after
25597 checking the modifiers.
25598 (TypeContainer::TypeAttr): new property, returns the
25599 TypeAttributes for a class.
25601 * cs-parser.jay (type_list): Oops, list production was creating a
25602 new list of base types.
25604 * rootcontext.cs (StdLib): New property.
25605 (GetInterfaceTypeByName): returns an interface by type name, and
25606 encapsulates error handling here.
25607 (GetInterfaces): simplified.
25608 (ResolveTree): Encapsulated all the tree resolution here.
25609 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
25612 * driver.cs: Add support for --nostdlib, to avoid loading the
25613 default assemblies.
25614 (Main): Do not put tree resolution here.
25616 * rootcontext.cs: Beginning of the class resolution.
25618 2001-08-03 Miguel de Icaza <miguel@ximian.com>
25620 * rootcontext.cs: Provide better error reporting.
25622 * cs-parser.jay (interface_base): set our $$ to be interfaces.
25624 * rootcontext.cs (CreateInterface): Handle the case where there
25625 are no parent interfaces.
25627 (CloseTypes): Routine to flush types at the end.
25628 (CreateInterface): Track types.
25629 (GetInterfaces): Returns an array of Types from the list of
25630 defined interfaces.
25632 * typemanager.c (AddUserType): Mechanism to track user types (puts
25633 the type on the global type hash, and allows us to close it at the
25636 2001-08-02 Miguel de Icaza <miguel@ximian.com>
25638 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25639 RecordInterface instead.
25641 * cs-parser.jay: Updated to reflect changes above.
25643 * decl.cs (Definition): Keep track of the TypeBuilder type that
25644 represents this type here. Not sure we will use it in the long
25645 run, but wont hurt for now.
25647 * driver.cs: Smaller changes to accomodate the new code.
25649 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25652 * rootcontext.cs (CreateInterface): New method, used to create
25653 the System.TypeBuilder type for interfaces.
25654 (ResolveInterfaces): new entry point to resolve the interface
25656 (CodeGen): Property, used to keep track of the code generator.
25658 2001-07-26 Miguel de Icaza <miguel@ximian.com>
25660 * cs-parser.jay: Add a second production for delegate_declaration
25663 (enum_body): Put an opt_comma here instead of putting it on
25664 enum_body or enum_member_declarations so we can handle trailing
25665 commas on enumeration members. Gets rid of a shift/reduce.
25667 (type_list): Need a COMMA in the middle.
25669 (indexer_declaration): Tell tokenizer to recognize get/set
25671 * Remove old targets.
25673 * Re-add the parser target.
25675 2001-07-13 Simon Cozens <simon@simon-cozens.org>
25677 * cs-parser.jay: Add precendence rules for a number of operators
25678 ot reduce the number of shift/reduce conflicts in the grammar.
25680 2001-07-17 Miguel de Icaza <miguel@ximian.com>
25682 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25685 Get rid of old crufty code.
25687 * rootcontext.cs: Use this to keep track of the parsed
25688 representation and the defined types available to the program.
25690 * gen-treedump.cs: adjust for new convention.
25692 * type.cs: Split out the type manager, and the assembly builder
25695 * typemanager.cs: the type manager will live here now.
25697 * cil-codegen.cs: And the code generator here.
25699 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
25701 * makefile: Fixed up for easy making.
25703 2001-07-13 Simon Cozens <simon@simon-cozens.org>
25705 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25708 (unary_expression): Expand pre_increment_expression and
25709 post_decrement_expression to reduce a shift/reduce.
25711 2001-07-11 Simon Cozens
25713 * cs-tokenizer.cs: Hex numbers should begin with a 0.
25715 Improve allow_keyword_as_indent name.
25717 2001-06-19 Miguel de Icaza <miguel@ximian.com>
25719 * Adjustments for Beta2.
25721 2001-06-13 Miguel de Icaza <miguel@ximian.com>
25723 * decl.cs: Added `Define' abstract method.
25724 (InTransit): new property, used to catch recursive definitions.
25726 * interface.cs: Implement `Define'.
25728 * modifiers.cs: Map Modifiers.constants to
25729 System.Reflection.TypeAttribute flags.
25731 * class.cs: Keep track of types and user-defined types.
25732 (BuilderInit): New method for creating an assembly
25733 (ResolveType): New function to launch the resolution process, only
25734 used by interfaces for now.
25736 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
25737 that are inserted into the name space.
25739 2001-06-08 Miguel de Icaza <miguel@ximian.com>
25741 * ARGH. I have screwed up my tree so many times due to the use of
25742 rsync rather than using CVS. Going to fix this at once.
25744 * driver.cs: Objetify driver. Load assemblies, use assemblies to
25747 2001-06-07 Miguel de Icaza <miguel@ximian.com>
25749 * Experiment successful: Use System.Type rather that our own
25752 2001-05-25 Miguel de Icaza <miguel@ximian.com>
25754 * cs-parser.jay: Removed nsAliases from here.
25756 Use new namespaces, handle `using XXX;'
25758 * namespace.cs: Reimplemented namespace handling, use a recursive
25759 definition of the class. Now we can keep track of using clauses
25760 and catch invalid using clauses.
25762 2001-05-24 Miguel de Icaza <miguel@ximian.com>
25764 * gen-treedump.cs: Adapted for all the renaming.
25766 * expression.cs (Expression): this class now has a Type property
25767 which returns an expression Type.
25769 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25770 `Type', as this has a different meaning now in the base
25772 2001-05-22 Miguel de Icaza <miguel@ximian.com>
25774 * interface.cs, class.cs: Removed from all the sources the
25775 references to signature computation, as we can not do method
25776 signature computation during the parsing time, as we are not
25777 trying to solve at that point distinguishing:
25781 void a (NS.Blah x) {}
25784 Which depending on the context might be valid or not, as we do not
25785 know if Blah is the same thing as NS.Blah at that point.
25787 * Redid everything so the code uses TypeRefs now instead of
25788 Types. TypeRefs are just temporary type placeholders, that need
25789 to be resolved. They initially have a pointer to a string and the
25790 current scope in which they are used. This is used later by the
25791 compiler to resolve the reference to an actual Type.
25793 * DeclSpace is no longer a CIR.Type, and neither are
25794 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
25795 are all DeclSpaces, but no Types.
25797 * type.cs (TypeRefManager): This implements the TypeRef manager,
25798 which keeps track of all the types that need to be resolved after
25799 the parsing has finished.
25801 2001-05-13 Miguel de Icaza <miguel@ximian.com>
25803 * ARGH. We are going to have to store `foreach' as a class rather
25804 than resolving it, as we need to verify error 1579 after name
25805 resolution. *OR* we could keep a flag that says `This request to
25806 IEnumerator comes from a foreach statement' which we can then use
25807 to generate the error.
25809 2001-05-10 Miguel de Icaza <miguel@ximian.com>
25811 * class.cs (TypeContainer.AddMethod): we now add methods to the
25812 MethodGroup instead of the method hashtable.
25814 * expression.cs: Add MethodGroup abstraction, which gets us one
25815 step closer to the specification in the way we handle method
25818 * cs-parser.jay (primary_expression): qualified_identifier now
25819 tried to match up an identifier to a local variable reference or
25820 to a parameter reference.
25822 current_local_parameters is now a parser global variable that
25823 points to the current parameters for the block, used during name
25826 (property_declaration): Now creates an implicit `value' argument to
25829 2001-05-09 Miguel de Icaza <miguel@ximian.com>
25831 * parameter.cs: Do not use `param' arguments as part of the
25832 signature, per the spec.
25834 2001-05-08 Miguel de Icaza <miguel@ximian.com>
25836 * decl.cs: Base class for classes, structs and interfaces. This
25837 is the "Declaration Space"
25839 * cs-parser.jay: Use CheckDef for checking declaration errors
25840 instead of having one on each function.
25842 * class.cs: Factor out some code for handling error handling in
25843 accordance to the "Declarations" section in the "Basic Concepts"
25844 chapter in the ECMA C# spec.
25846 * interface.cs: Make all interface member classes derive from
25847 InterfaceMemberBase.
25849 2001-05-07 Miguel de Icaza <miguel@ximian.com>
25851 * Many things: all interfaces are parsed and generated in
25852 gen-treedump. Support for member variables, constructors,
25853 destructors, properties, constants is there.
25855 Beginning of the IL backend, but very little done, just there for
25858 2001-04-29 Miguel de Icaza <miguel@ximian.com>
25860 * cs-parser.jay: Fix labeled statement.
25862 * cs-tokenizer.cs (escape): Escape " and ' always.
25863 ref_line, ref_name: keep track of the line/filename as instructed
25864 by #line by the compiler.
25867 2001-04-27 Miguel de Icaza <miguel@ximian.com>
25869 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25870 to match the values in System.CodeDOM.
25872 Divid renamed to Divide.
25874 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25876 (Statements.set): remove.
25878 * System.CodeDOM/CodeCatchClause.cs: always have a valid
25881 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25882 falseStatements always have valid values.
25884 * cs-parser.jay: Use System.CodeDOM now.