1 2006-05-11 Raja R Harinath <rharinath@novell.com>
3 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
4 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
5 (FlowBranchingException.Label): Likewise.
7 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
9 (MyBitVector.Or): Use it to avoid losing information (Count).
10 (FlowBranching.MergeOrigins): Likewise.
12 * flowanalysis.cs (UsageVector.IsDirty): Remove.
13 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
14 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
15 (UsageVector.ToString): Simplify.
16 (UsageVector.MergeSiblings): Move here from ...
17 (FlowBranching.Merge): ... here.
18 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
21 2006-05-10 Raja R Harinath <rharinath@novell.com>
23 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
24 null bitvector is treated as all-true.
26 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
27 (MyBitVector): Rationalize invariants. 'vector != null' implies
28 that we have our own copy of the bitvector. Otherwise,
29 'InheritsFrom == null' implies all inherited bits are true.
31 2006-05-09 Marek Safar <marek.safar@seznam.cz>
33 * statement.cs (LocalInfo): Add IsConstant.
34 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
35 local variable for constants.
37 2006-05-09 Raja R Harinath <rharinath@novell.com>
39 * flowanalysis.cs (MyBitVector.Empty): New.
40 (MyBitVector): Don't allow InheritedFrom to be null.
41 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
42 (UsageVector, FlowBranching): Update to changes.
44 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
45 recursion. The 'Parent == null' condition isn't sufficient for
47 (FlowBranching.AddBreakOrigin): Likewise.
48 (FlowBranching.AddContinueOrigin): Likewise.
49 (FlowBranching.AddReturnOrigin): Likewise.
50 (FlowBranching.StealFinallyClauses): Likewise.
51 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
52 (FlowBranching.CheckOutParameters): Likewise.
53 (FlowBranchingToplevel): Terminate all the above recursions here.
54 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
55 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
57 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
59 (FlowBranchingToplevel): New. Empty for now.
60 (FlowBranching.MergeTopBlock): Update.
61 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
62 branching for the anonymous delegate.
63 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
65 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
66 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
67 information at the start of the merge. Reorganize.
69 2006-05-07 Marek Safar <marek.safar@seznam.cz>
71 * class.cs (MethodData.Define): Method cannot implement interface accessor.
73 2006-05-07 Marek Safar <marek.safar@seznam.cz>
75 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
76 to newly introduced ctor.
78 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
80 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
83 2006-05-07 Marek Safar <marek.safar@seznam.cz>
85 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
87 * ecore.cs (Expression.ResolveAsConstant): Updated.
89 * statement.cs (ResolveMeta): Updated.
91 2006-05-06 Marek Safar <marek.safar@seznam.cz>
93 * cs-parser.jay: __arglist cannot be used in initializer.
95 2006-05-06 Marek Safar <marek.safar@seznam.cz>
98 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
101 2006-05-05 Raja R Harinath <rharinath@novell.com>
103 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
104 (LabeledStatement): Add 'name' parameter.
105 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
106 (Block.AddLabel): Update to changes.
107 * cs-parser.jay (labeled_statement): Likewise.
109 * flowanalysis.cs (BranchingType.Labeled): New.
110 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
111 (FlowBranchingLabeled): New. Does nothing for now, but will
112 eventually handle 'goto' flows.
113 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
114 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
115 that's terminated ...
116 (Block.Resolve): ... here.
118 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
119 (UsageVector.MergeFinallyOrigins): Likewise.
120 (FlowBranching.InTryOrCatch): Likewise.
121 (FlowBranching.AddFinallyVector): Likewise.
122 (FlowBranchingException): Update to changes.
125 * statement.cs (Return.Resolve): Move error checking to ...
126 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
127 (FlowBranchingException): Handle return origins like break and
129 (FlowBranching.UsageVector.CheckOutParameters): Remove.
131 2006-05-04 Marek Safar <marek.safar@seznam.cz>
134 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
137 2006-05-04 Marek Safar <marek.safar@seznam.cz>
140 * class.cs (MethodData.Define): Do public accessor check only when method
141 implements an interface.
143 2006-05-04 Raja R Harinath <rharinath@novell.com>
145 Remove special handling of 'break'
146 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
147 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
148 (UsageVector.Break): Remove.
149 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
151 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
153 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
154 UsageVector.Breaks (). Don't set NeedsReturnLabel.
156 2006-05-03 Marek Safar <marek.safar@seznam.cz>
159 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
160 be the interface member.
162 2006-05-03 Marek Safar <marek.safar@seznam.cz>
165 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
166 for emitting small (int) values.
168 2006-05-03 Raja R Harinath <rharinath@novell.com>
171 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
172 control-flow passes through the 'finally' after merging-in all the
173 control-flows from 'try' and the 'catch' clauses.
175 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
176 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
177 always true at the only non-recursive entry point.
178 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
179 FlowBranchingBreakable.
180 (FlowBranchingLoop): Remove.
181 * statement.cs (Return.DoResolve): Update to changes.
184 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
185 (FlowBranching.CreateBranching): Handle it: create a
186 FlowBranchingContinuable.
187 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
188 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
189 except that it handles the 'continue' command.
190 (FlowBranching.UsageVector.MergeOrigins): Rename from
192 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
193 except that it overrides AddContinueOrigin.
194 (FlowBranchingException): Override AddContinueOrigin, similar to
196 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
197 Create a new branching around the embedded statement.
198 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
199 control flow after the embedded statement.
200 (Continue.Resolve): Move all error checking to AddContinueOrigin.
202 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
203 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
204 FlowBranchingBreakable.
205 (FlowBranchingSwitch): Remove.
208 * statement.cs (Break.Resolve): Simplify. Move responsibility for
209 error reporting to ...
210 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
211 Rename from 'AddBreakVector'. Add new location argument. Return
212 a bool indicating whether the 'break' crosses an unwind-protect.
213 (FlowBranchingException.AddBreakOrigin): Add.
214 (FlowBranchingException.Merge): Propagate 'break's to surrounding
215 flowbranching after updating with the effects of the 'finally'
217 (FlowBranchingBreakable): New common base class for
218 FlowBranchingLoop and FlowBranchingSwitch.
220 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
222 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
224 2006-05-02 Raja R Harinath <rharinath@novell.com>
226 * statement.cs (Do.Resolve): If the loop is infinite, set the
228 (While.Resolve, For.Resolve): Set a barrier after the embedded
229 statement. There's no direct control flow that goes from the end
230 of the embedded statement to the end of the loop.
231 * flowanalysis.cs (FlowBranching.Infinite): Remove.
232 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
233 above ensure that the reachability is correctly computed.
235 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
236 (UsageVector.MergeBreakOrigins): If the current path is
237 unreachable, treat it as if all parameters/locals are initialized.
238 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
239 infinite loops before merging-in break origins.
241 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
242 (Reachability.Reachable): Split part into ...
243 (Reachability.Unreachable): ... this. Simplify.
244 (Reachability.IsUnreachable): Use 'Unreachable' instead.
246 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
247 (Reachability.SetThrowsSometimes): Likewise.
248 (FlowBranchingBlock.MergeTopBlock): Don't compare against
249 TriState.Always, use corresponding property.
250 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
251 (Block.Resolve): Likewise. Remove some redundant checks.
253 2006-05-02 Raja R Harinath <harinath@gmail.com>
255 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
256 (Reachability.Meet): Don't bother checking AlwaysThrows --
257 barrier is always set.
258 (FlowBranchingBlock.Merge): Likewise.
260 2006-05-01 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
262 * attribute.cs: fixed_buffer_cache is declared only if NET_2_0 is
263 defined, so it's references should also compile only for NET_2_0
264 (as occurs in mcs version)
266 2006-05-01 Raja R Harinath <harinath@gmail.com>
268 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
269 checks for unreachable.
271 2006-05-01 Marek Safar <marek.safar@seznam.cz>
274 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
276 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
277 whether field is really assigned.
279 2006-04-30 Raja R Harinath <harinath@gmail.com>
281 * flowanalysis.cs (Reachability): Make 4-argument constructor
283 (Reachability.Meet): Rename from 'And'. Remove static variant.
284 (Reachability.Always): Rename from the highly misleading
285 'Reachability.Never'.
286 (FlowBranching.Merge): Update to changes. Mark an impossible
287 situation with a 'throw'.
288 (*): Update to changes.
290 2006-04-29 Raja R Harinath <harinath@gmail.com>
292 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
294 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
295 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
296 (*): Update to changes.
297 * statement.cs: Update to changes.
299 2006-04-28 Marek Safar <marek.safar@seznam.cz>
302 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
304 2006-04-28 Raja R Harinath <harinath@gmail.com>
306 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
309 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
310 argument to two arguments: an usage-vector and a bool. Move call
311 to FlowBranching.Merge () ...
312 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
314 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
315 handling of loop and switch reachability to ...
316 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
318 2006-04-27 Raja R Harinath <harinath@gmail.com>
320 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
321 handling to FlowBranchingLoop.InLoop.
322 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
324 2006-04-26 Marek Safar <marek.safar@seznam.cz>
327 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
328 anonymous method is allowed from AnonymousContainer here.
330 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
332 2006-04-24 Raja R Harinath <rharinath@novell.com>
335 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
337 2006-04-23 Marek Safar <marek.safar@seznam.cz>
340 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
341 (DoubleConstant.Reduce): Ditto.
343 2006-04-23 Raja R Harinath <rharinath@novell.com>
345 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
346 Remove 'lvalue_right_side' argument. Move parts to ...
347 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
348 (LocalVariable.DoResolveLValue): ... these.
350 2006-04-21 Raja R Harinath <rharinath@novell.com>
353 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
354 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
355 (LocalVariableReference.DoResolveBase): Use it to implement new
357 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
358 (Argument.Resolve): Simplify. Move CS1510 check ...
359 * ecore.cs (Expression.ResolveLValue): ... here.
360 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
361 (PropertyExpr.DoResolveLValue): Likewise.
362 (FieldExpr.Report_AssignToReadonly): Likewise.
363 (FieldExpr.DoResolve): Add 'out_access' argument. Use
364 LValueMemberAccess or LValueMemberOutAccess on instance depending
366 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
367 DoResolve as appropriate.
369 2006-04-20 Raja R Harinath <rharinath@novell.com>
372 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
373 implicit conversions on 'out' and 'ref' arguments.
375 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
376 improve clarity. Remove dead code.
379 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
380 (Catch.Resolve): Resolve VarBlock if it exists.
382 2006-04-19 Miguel de Icaza <miguel@novell.com>
384 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
385 twice, this was some residual code, the enumerator was emitted
386 properly in the two branche of if later.
390 Thanks to Martin for finding the source of the problem
392 2006-04-19 Raja R Harinath <rharinath@novell.com>
394 * expression.cs (Cast.ResolveLValue): Remove. The result of a
395 cast is never an lvalue.
396 (Cast.DoResolve, Cast.ResolveRest): Combine.
397 (Argument.Emit): Simplify slightly. Move 'Expr is
398 IMemoryLocation' check ...
399 (Argument.Resolve): ... here.
400 (Argument.Error_LValueRequired): Remove. Inline into only user.
402 Simplifications. Fix cs0191-2.cs
403 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
404 CS1649 and CS1651 to ...
405 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
406 the actual selection of the error code and message to a lookup
407 table. Add a dummy return value to simplify callsites.
408 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
409 readonly fields of other instances of the same type. Move CS0197
411 * expression.cs (Argument.Resolve): ... here. Simplify code.
412 Ensure that ec.InRefOutArgumentResolving is only set during LValue
413 resolution of an out or ref argument. The code simplification
414 above uses this invariant.
416 2006-04-18 Raja R Harinath <rharinath@novell.com>
418 Possibly fix #77752. Fix cs1690-[4-7].cs.
419 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
420 CheckMarshallByRefAccess. Drop parameter.
421 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
423 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
425 * report.cs (AllWarnings): Add CS1690.
426 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
428 (LocalVariableReference.DoResolveBase): Update.
430 2006-04-09 Marek Safar <marek.safar@seznam.cz>
432 * class.cs (MethodOrOperator): Moved common parts from method class.
433 detect obsolete attributes.
434 (Method.Define): Simplified as it reuses code from base.
435 (Constructor.ValidAttributeTargets): Fixed issue found during
437 (Destructor.ValidAttributeTargets): Fixed issue found during
439 (Operator): Finished refactoring set off by #78020. Operator class is now
440 ordinary method class.
442 * anonymous.cs: Updated.
444 2006-04-09 Marek Safar <marek.safar@seznam.cz>
446 * class.cs (Constructor.Emit): Don't emit the attributes twice.
448 2006-04-09 Marek Safar <marek.safar@seznam.cz>
450 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
451 detect obsolete attributes.
452 (Method.CreateEmitContext): Moved to MethodOrOperator.
454 2006-04-09 Marek Safar <marek.safar@seznam.cz>
457 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
458 customized exception to make crash detection easier.
459 (MethodOrOperator): Started to work on new base class for methods and
461 (Method): Derives from MethodOrOperator.
462 (Constructor.Emit): Emits its own attributes.
463 (AbstractPropertyEventMethod.Emit): Ditto.
464 (Operator): Derives from MethodOrOperator, will refactor fully in extra
466 (Operator.Emit): It's temporary more tricky than should be.
468 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
470 * report.cs (InternalErrorException): Add ctor with inner exception.
472 2006-04-08 Marek Safar <marek.safar@seznam.cz>
475 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
478 2006-04-07 Marek Safar <marek.safar@seznam.cz>
481 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
484 2006-04-06 Marek Safar <marek.safar@seznam.cz>
486 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
487 attribute is present and Guid not.
488 (Interface.ApplyAttributeBuilder): Ditto.
490 * attribute.cs: Add error message.
492 2006-04-06 Marek Safar <marek.safar@seznam.cz>
496 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
497 sources (it's composite) so hold them in extra array as they are used in
498 Emit phase only. It worked in the previous versions by mistake.
499 (Attribute.Emit): Emit attribute for more owners when exist.
501 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
502 it has now different behaviour.
504 2006-04-04 Marek Safar <marek.safar@seznam.cz>
506 * constant.cs (Constant.IsDefaultInitializer): New method.
510 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
511 re-initialize default values. It saves KBs almost for every assembly.
512 Thanks Zoltan for the idea.
513 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
514 (ArrayCreation.DoResolve): Resolve only once.
515 (ArrayCreation.Emit): Emit static initializer only when it is faster.
516 (ArrayCreation.GetAttributableValue): Cope with optimized values.
518 2006-04-03 Zoltan Varga <vargaz@gmail.com>
520 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
523 2006-04-01 Marek Safar <marek.safar@seznam.cz>
525 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
526 in an embedded statement too.
528 2006-04-01 Raja R Harinath <rharinath@novell.com>
531 * typemanager.cs (IsNestedChildOf): Drop generic arguments before
535 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
538 * report.cs (SymbolRelatedToPreviousError): Drop generic type
539 arguments before checking whether a type is reflected or not.
542 * expression.cs (Invocation.IsApplicable): Ensure a generic method
543 definition doesn't take part in overload resolution.
544 (Invocation.IsParamsMethodApplicable): Likewise.
545 (Invocation.OverloadResolve): When replacing a reflected override
546 method with its base definition, ensure that type arguments are
549 2006-04-01 Marek Safar <marek.safar@seznam.cz>
553 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
556 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
558 2006-03-31 Marek Safar <marek.safar@seznam.cz>
560 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
563 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
564 LocalTemporary change.
566 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
568 (ClassOrStruct.DefineFieldInitializers): Implemented static field
569 initializers optimization.
570 (ClassOrStruct.TypeAttr): Moved from modifiers.
571 (Constructor.CheckBase): Don't crash when static ctor has parameters.
572 (FieldBase.ResolveInitializer): Resolves initializer.
573 (FieldBase.HasDefaultInitializer): New property.
575 * cs-parser.jay: Removed message.
577 * expression.cs (CompilerGeneratedThis): New specialization.
579 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
581 2006-03-28 Marek Safar <marek.safar@seznam.cz>
583 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
585 2006-03-27 Marek Safar <marek.safar@seznam.cz>
587 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
588 be now EnumConstants only.
590 2006-03-27 Marek Safar <marek.safar@seznam.cz>
592 * attribute.cs, driver.cs: Reset more caches.
594 2006-03-26 Marek Safar <marek.safar@seznam.cz>
596 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
598 2006-03-26 Marek Safar <marek.safar@seznam.cz>
600 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
601 for easier reuse. Updated all overrides.
602 (IntegralConstant): New base class for all integral constants.
603 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
604 of the constant range, report custom error.
605 (UIntConstant.Reduce): Fixed uint conversion.
607 * ecore.cs, literal.cs: Reduce updates.
609 2006-03-26 Marek Safar <marek.safar@seznam.cz>
613 * class.cs (Constructor.Define): Removed extra if for default ctors.
614 A patch from Atsushi Enomoto.
616 2006-03-26 Marek Safar <marek.safar@seznam.cz>
618 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
619 GetAttributableValue.
621 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
624 * convert.cs (ImplicitConversionRequired): Error message moved to
627 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
628 automatic implicit conversion of an output value.
629 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
631 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
633 (TypeOf.GetAttributableValue): Add extra handling for object type.
635 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
636 special error message.
638 2006-03-25 Marek Safar <marek.safar@seznam.cz>
640 * class.cs (Constructor.Emit): Don't crash when struct ctor is
642 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
643 compatible with MS runtime.
645 2006-03-23 Marek Safar <marek.safar@seznam.cz>
647 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
648 attribute arguments here.
650 * class.cs (Indexer.Define): The check was moved to attribute class.
652 2006-03-21 Marek Safar <marek.safar@seznam.cz>
654 * expression.cs (StringConcat.Append): Reverted back to no warning state.
656 2006-03-21 Marek Safar <marek.safar@seznam.cz>
658 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
660 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
663 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
665 * doc-bootstrap.cs : fix build.
667 2006-03-20 Marek Safar <marek.safar@seznam.cz>
669 * expression.cs (StringConcat.Append): Issue a warning when empty string
672 2006-03-20 Marek Safar <marek.safar@seznam.cz>
674 * assign.cs (CompoundAssign.ResolveSource): Removed.
676 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
679 * class.cs (TypeContainer.FindMethods): Removed.
680 (TypeContainer.CheckMemberUsage): Made static.
682 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
684 * constant.cs (CheckRange): Removed unused type argument.
685 (CheckUnsigned): Removed unused type argument.
687 * cs-parser.jay: Updated after MemberAccess clean up.
688 Uses Length for empty string test.
690 * cs-tokenizer.cs: Uses Length for empty string test.
691 (IsCastToken): Made static.
692 (is_hex): Made static.
693 (real_type_suffix): Made static.
695 * decl.cs (SetupCache): Made static.
696 (OnGenerateDocComment): Removed unused ds argument.
698 * delegate.cs (VerifyDelegate): Removed unused argument.
700 * doc.cs: Uses Length for empty string test.
702 * driver.cs: Uses Length for empty string test.
704 * enum.cs (IsValidEnumType): Made static
706 * expression.cs (EnumLiftUp): Removed unused argument.
707 (ResolveMethodGroup): Ditto.
708 (BetterConversion): Ditto.
709 (GetVarargsTypes): Ditto.
710 (UpdateIndices): Ditto.
711 (ValidateInitializers): Ditto.
712 (MemberAccess.ctor): Ditto.
713 (GetIndexersForType): Ditto.
715 * flowanalysis.cs: (MergeFinally): Removed unused argument.
717 * iterators.cs: Updated after MemberAccess clean up.
719 * location.cs: Uses Length for empty string test.
721 * namespace.cs: Uses Length for empty string test.
723 * report.cs (CheckWarningCode): Made static.
725 * statement.cs (LabeledStatement): Removed unused argument.
727 * typemanager.cs (FilterNone): Removed.
729 2006-03-18 Marek Safar <marek.safar@seznam.cz>
731 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
736 2006-03-18 Marek Safar <marek.safar@seznam.cz>
738 * cs-parser.jay.cs: __arglist is not allowed for delegates.
740 2006-03-18 Marek Safar <marek.safar@seznam.cz>
744 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
746 (AnonymousMethod.ImplicitStandardConversionExists): New method.
747 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
748 Add more error reporting; Fixed issue with params.
750 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
752 * cs-parser.jay: AnonymousMethod requires host container.
754 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
756 2006-03-18 Raja R Harinath <harinath@gmail.com>
758 * class.cs: Change 'TypeContainer ds' constructor argument to
759 'DeclSpace parent'. Some classes were missed below due to
760 different naming convention.
762 * class.cs (MemberCore.Parent): Delete. This makes the
763 ParentContainer changes below enforceable by the compiler.
765 Treat pointers to enclosing declaration space as 'DeclSpace', not
767 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
768 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
770 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
772 (Block.AddThisVariable): Likewise.
773 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
774 (AbstractPropertyEventMethod.Emit): Likewise.
775 (AbstractPropertyEventMethod.EmitMethod): Likewise.
776 (GetMethod.Define, SetMethod.Define): Likewise.
777 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
778 (DelegateMethod.EmitMethod): Likewise.
780 Fix regression test-partial-13.cs.
781 Rationalize use of PartialContainer. Ensure that the partial
782 class semantics can be tied to type-correctness, i.e., any
783 violation will cause a compile error.
784 * class.cs, const.cs: Access all fields that belong to class
785 TypeContainer via ParentContainer. Arguments of EmitContexts and
786 Resolve()-like functions still use 'Parent'.
788 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
789 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
790 (PropertyMethod.CheckModifiers): Remove unused argument.
791 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
794 2006-03-28 Raja R Harinath <rharinath@novell.com>
796 * decl.cs (DeclSpace.LookupGeneric): Update to changes.
798 2006-03-17 Raja R Harinath <harinath@gmail.com>
800 Make semantics of PartialContainer simpler.
801 * decl.cs (DeclSpace.IsPartial): Remove.
802 * class.cs (TypeContainer.IsPartial): Likewise.
803 (TypeContainer..ctor): Set PartialContainer to point to self.
804 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
805 (TypeContainer.FindNestedType): Likewise.
806 (MemberCore.ParentContainer): Simplify. Remove deprecation.
808 2006-03-17 Marek Safar <marek.safar@seznam.cz>
810 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
812 2006-03-15 Marek Safar <marek.safar@seznam.cz>
814 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
817 2006-03-15 Marek Safar <marek.safar@seznam.cz>
819 * class.cs (Operator.Define): An error for base conversion was not
822 2006-03-13 Marek Safar <marek.safar@seznam.cz>
824 A fix for #77593, #77574.
826 * class.cs (MethodCore.CheckBase): Another if for operator.
828 2006-03-18 Marek Safar <marek.safar@seznam.cz>
832 * expression.cs (VerifyArgumentsCompat): Reverted to double error
833 reporting, it's more tricky than I thought.
835 2006-03-09 Marek Safar <marek.safar@seznam.cz>
837 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
840 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
841 (DelegateCreation.ImplicitStandardConversionExists): New method for just
844 * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
847 2006-03-04 Marek Safar <marek.safar@seznam.cz>
851 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
852 (Event.Define): ditto
853 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
855 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
856 Removed redundant code and set NewSlot for Invoke method too.
858 * parameter.cs (Parameters.ctor): Add custom, type ctor.
859 (Parameters.MergeGenerated): New method. Use this method when you merge
860 compiler generated argument with user arguments.
862 2006-03-03 Marek Safar <marek.safar@seznam.cz>
864 * attribute.cs (ResolveAsTypeTerminal): Removed.
866 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
867 specialization for predefined types; 30% speed up.
868 Finally placed obsolete check to right place.
869 (Expression.ResolveType): Removed.
871 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
872 Updated after ResolveType was removed.
874 * expression.cs (Cast.ctor): Check void cast.
875 (Binary.ResolveAsTypeTerminal): Is never type.
876 (Conditional.ResolveAsTypeTerminal): Is never type.
878 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
880 2006-03-26 Marek Safar <marek.safar@seznam.cz>
882 * rootcontext.cs (ResolveCore): Removed System.INullableValue.
884 2006-03-23 Martin Baulig <martin@ximian.com>
886 * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
887 type check if either of the types is an open generic type.
889 2006-03-23 Martin Baulig <martin@ximian.com>
892 (Convert.ExplicitTypeParameterConversion): New method; implement
893 explicit type parameter conversions.
895 2006-03-23 Martin Baulig <martin@ximian.com>
897 * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
898 blindly allow all conversions if we do not have any constraints.
900 2006-02-27 Marek Safar <marek.safar@seznam.cz>
902 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
903 these two separated members to simplify the code.
904 (Attribute.Resolve): Refactored to use new fields and methods.
905 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
906 implemented obsolete attribute checking.
907 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
908 implemented obsolete checking again. It look line never ending quest ;-)
909 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
911 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
913 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
915 *class.cs (Property.Define): Add RegisterProperty call.
917 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
918 argument groups (only 2).
920 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
921 encoding expression to arguments.
922 (Expression.ExprClassToResolveFlags): Just turned to property.
924 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
925 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
926 optimized as well as implemented support for zero-length attributes.
928 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
929 Add caching of PropertyInfo's.
931 2006-02-25 Marek Safar <marek.safar@seznam.cz>
933 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
934 error multiple times.
936 2006-02-25 Marek Safar <marek.safar@seznam.cz>
938 New partial class implementation.
939 A fix for #77027, #77029, #77403
941 * attribute.cs (Attributable): Made attributes protected.
943 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
944 the replacements of ClassPart and PartialContainer.
945 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
946 (TypeContainer.AddInterface): Ditto.
947 (TypeContainer.AddPartial): The main method for partial classes. It checks
948 for errors and merges ModFlags and attributes. At the end class is added to
950 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
952 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
953 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
954 from the rest of partial classes.
955 (TypeContainer.GetClassBases): Simplified.
956 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
958 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
959 (TypeContainer.HasExplicitLayout): Uses Flags now.
960 (PartialContainer): Removed.
961 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
962 (StaticClass): Was merged with Class.
963 (Class.GetClassBases): class and static class bases are verified here.
964 (Class.TypeAttr): Added static attributes when class is static.
965 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
966 (MemberBase): In some cases we need to call parent container for partial
967 class. It should be eliminated but it's not easy now.
969 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
971 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
972 partial classed to accumulate class comments.
973 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
975 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
977 * driver.cs (MainDriver): Tree.GetDecl was removed.
979 * modifiers.cs (Modifiers): Add partial modifier.
981 * tree.cs (Tree.decl): Removed.
982 (RootTypes): Started to use this class more often for root types
985 2006-03-23 Raja R Harinath <rharinath@novell.com>
987 * generic.cs (TypeParameter.UpdateConstraints): Update
988 'constraints' if null.
990 2006-02-22 Marek Safar <marek.safar@seznam.cz>
994 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
995 external interface does not have an attribute.
997 2006-02-22 Marek Safar <marek.safar@seznam.cz>
999 Another prerequisites for new partial classs implementation.
1001 * attribute.cs (Attribute.Equal): Implemented.
1002 (Attribute.Emit): Changed as attributes can be applied more than twice.
1003 (Attributes.Emit): Check for duplicate attributes here.
1005 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
1006 as a parameter, clean-up.
1008 2006-02-11 Marek Safar <marek.safar@seznam.cz>
1012 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
1013 contains obsolete attribute check which can in some cases look for base
1014 type of current class which is not initialized yet.
1015 (TypeContainer.BaseType): Replacement of ptype.
1017 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
1019 2006-02-11 Marek Safar <marek.safar@seznam.cz>
1021 First of prerequisites for new partial classs implemention.
1023 * attribute.cs (Attributable): Extended by ResolveContext;
1024 Attributes finally have correct context for resolving in all cases.
1025 (AttachTo): Attribute owner is assigned here.
1027 * codegen.cs (IResolveContext): Introduce new interface to hold
1028 all information needed in resolving phase.
1029 (EmitContext): Implements IResolveContext; more clean-up needed here.
1031 * decl.cs (MemberCore): Implemented IResolveContext.
1033 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
1034 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
1035 parameter.cs, statement.cs, tree.cs, typemanager.cs:
1036 Refactored to use new IResolveContext instead of EmitContext; cleanup
1038 2006-03-22 Raja R Harinath <rharinath@novell.com>
1040 Support ParameterDefaultValueAttribute in gmcs. Also applied to
1041 mcs to keep code differences small.
1042 * attribute.cs (Attribute.GetParameterDefaultValue): New.
1043 * typemanager.cs (parameter_default_value_attribute_type): New.
1044 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
1047 2006-03-22 Martin Baulig <martin@ximian.com>
1050 (Nullable.NullableLiteral): Derive from `NullLiteral'.
1053 (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
1054 instead of the normal `NullLiteral'.
1056 2006-03-21 Martin Baulig <martin@ximian.com>
1059 * generic.cs (TypeManager.InferType): If `pt' is a generic
1060 parameter, don't check whether `pt == at'.
1062 2006-03-20 Raja R Harinath <rharinath@novell.com>
1065 * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
1066 (TypeParameter.Resolve): Update to change.
1067 (ConstraintChecker.CheckConstraints): Resolve type-argument
1068 constraints before use.
1070 2006-03-16 Martin Baulig <martin@ximian.com>
1073 (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
1074 and don't have any instance constructors, also lookup in the base class.
1075 (TypeManager.IsNullableValueType): New public method.
1077 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
1078 `BindingFlags.DeclaredOnly' flag and set `used_cache'.
1079 (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
1081 * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
1082 instead of just TypeManager.IsNullableType() to determine whether
1083 a lifted operator exists.
1084 (UnaryMutator.DoResolve): Likewise.
1085 (Conditional.DoResolve): Likewise.
1086 (Binary.DoResolve): A lifted operator only exists if both operands
1087 are valuetypes and at least one of them is a nullable type.
1089 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
1091 * iterator.cs : yield break is allowed in try statement which has
1092 catch clauses. Fixed bug #77767.
1094 2006-03-12 Martin Baulig <martin@ximian.com>
1096 * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
1097 private IsSignatureEqual() to compare types; see the comment in
1098 that method; fixes #77674.
1100 2006-03-10 Raja R Harinath <rharinath@novell.com>
1102 * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
1103 (Expression.ResolveAsTypeTerminal): Likewise.
1104 * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
1105 * expression.cs, generic.cs, iterators.cs: Likewise.
1106 * parameter.cs, statement.cs, typemanager.cs: Likewise.
1108 2006-03-09 Martin Baulig <martin@ximian.com>
1110 * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
1111 TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
1113 2006-03-09 Martin Baulig <martin@ximian.com>
1115 * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
1116 `prepared' flag is set.
1118 * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
1119 (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
1120 issues; see gtest-254.cs.
1122 2006-03-07 Martin Baulig <martin@ximian.com>
1124 * generic.cs (TypeManager.InferType): Allow infering
1125 `IEnumerable<T>' with an array of T; see gtest-251.cs.
1127 2006-03-06 Martin Baulig <martin@ximian.com>
1130 (TypeManager.InferType): Fix gtest-250.cs.
1133 (TypeManager.IsSubclassOf): Also check the base class.
1136 (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
1139 2006-03-01 Raja R Harinath <rharinath@novell.com>
1142 * expression.cs (ParameterReference.DoResolveBase): Change return
1144 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
1148 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
1151 * typemanager.cs (GetFullNameSignature): Don't nullref on
1152 protected accessors.
1154 2006-02-16 Martin Baulig <martin@ximian.com>
1157 (TypeManager.GetGenericFieldDefinition): New public method; use it
1158 instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
1160 2006-02-14 Martin Baulig <martin@ximian.com>
1162 * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
1164 2006-02-14 Martin Baulig <martin@ximian.com>
1167 (TypeManager.DropGenericMethodArguments): New public method; don't
1168 use GetGenericMethodDefinition() on something which is not a
1171 2006-02-14 Martin Baulig <martin@ximian.com>
1174 (ConstraintChecker.CheckConstraints): If a type parameter has the
1175 `struct' constraint, the type must be a non-nullable valuetype.
1177 2006-02-10 Martin Baulig <martin@ximian.com>
1180 (TypeManager.IsOverride): Make this work for instantiated methods
1181 in a generic class; fixes #77509.
1182 (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
1183 rather than calling it directly; fixes #77488.
1185 2006-02-08 Martin Baulig <martin@ximian.com>
1187 * generic.cs (ConstraintChecker.CheckConstraints): Move the error
1188 reporting into CheckConstraint() so we can use the correctly
1191 2006-02-08 Martin Baulig <martin@ximian.com>
1193 * expression.cs (BaseAccess): Add support for generic methods.
1195 * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
1196 the new MethodGroupExpr.
1198 2006-02-07 Martin Baulig <martin@ximian.com>
1200 * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
1201 also reference types; fixes #77483.
1203 2006-02-07 Martin Baulig <martin@ximian.com>
1206 (TypeManager.IsGenericMethod): We now return whether something is
1207 an instantiated generic method (and not a generic method def).
1208 (TypeManager.IsGenericMethodDefinition): New public method.
1211 (TypeManager.CSharpSignature): Only include type arguments for
1212 "real" generic methods, not for any instantiated method.
1213 (TypeManager.GetMethodName): Likewise, but also allow generic
1214 method definitions here.
1216 2006-02-06 Miguel de Icaza <miguel@novell.com>
1218 * codegen.cs (EmitScopeInitFromBlock): check here the
1219 capture_context, there is no need to make two calls to the
1222 * anonymous.cs: Add some debugging messages that might help me
1223 track other instances of this problem in the future (the
1224 regression of test 467).
1226 * cs-parser.jay: track the variable block, as we need to initalize
1227 any captured variables declared in this block for the "catch"
1228 portion of the "Try" statement.
1230 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
1231 scope initialization for captured variables.
1233 Also, move the emit for the variables after the block location has
1236 2006-02-06 Marek Safar <marek.safar@seznam.cz>
1238 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
1240 2006-02-06 Martin Baulig <martin@ximian.com>
1242 * class.cs (TypeContainer.DefineType): If we're a struct, pass
1243 `TypeManager.value_type' as parent type to
1244 ModuleBuilder.DefineType(). Fixes #77358.
1246 2006-02-02 Miguel de Icaza <miguel@novell.com>
1248 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
1249 commit yesterday, the initialization for the roots is necessary.
1250 What is not necessary is the scope activation.
1252 2006-02-02 Raja R Harinath <rharinath@novell.com>
1254 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
1255 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
1257 (Argument.Resolve): Remove CS0206 checks.
1259 2006-02-01 Miguel de Icaza <miguel@novell.com>
1261 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
1262 scopes for all the roots, the scopes will now be emitted when the
1263 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
1265 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
1266 code. This reduces a lot of existing cruft.
1268 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
1269 that the ScopeInfo is generated as we enter the scope, not at the
1270 time of use, which is what we used to do before.
1272 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
1273 every time a Block is about to be emitted if we have a
1276 2006-02-01 Raja R Harinath <rharinath@novell.com>
1278 * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
1279 attribute for mscorlib too.
1281 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
1283 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
1285 * typemanager.cs (cons_param_array_attribute): Make private.
1286 (Reset): Set it to null.
1287 (InitCoreHelpers): Don't initialize it.
1288 (ConsParamArrayAttribute): New. Initialize it as needed.
1289 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
1291 2006-01-31 Miguel de Icaza <miguel@novell.com>
1293 * expression.cs: There might be errors reported during the
1294 selection of applicable methods. If there are errors, do not
1295 continue execution as it will lead the compiler to crash.
1297 2006-01-30 Miguel de Icaza <miguel@novell.com>
1299 * expression.cs: Member access is not allowed on anonymous
1300 methods. Fixes #77402.
1302 2006-01-30 Raja R Harinath <rharinath@novell.com>
1305 * cs-parser.jay (VariableDeclaration): Don't set
1306 current_array_type to null.
1307 (field_declaration, event_declaration, declaration_statement):
1308 Set it to null here.
1310 2006-01-29 Raja R Harinath <harinath@gmail.com>
1313 * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
1315 2006-01-28 Raja R Harinath <harinath@gmail.com>
1317 * typemanager.cs (GenericParameterPosition): New.
1320 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
1322 * doc.cs : To process "include" elements, first we should create
1323 another list than XmlNodeList, because it could result in node
1324 removal, which could result in that the XmlNodeList gives up
1327 2006-01-25 Miguel de Icaza <miguel@novell.com>
1329 * expression.cs: Introduce an error report that we were not
1330 catching before. Gonzalo ran into it.
1332 2006-01-23 Miguel de Icaza <miguel@novell.com>
1334 A fix for bug: #76957
1336 * iterators.cs (MoveNextMethod.CreateMethodHost): call
1337 ComputeMethodHost before creating the method, this is a new
1340 * anonymous.cs (AnonymousContainer): Now we track all the scopes
1341 that this method references (RegisterScope). The actual scope
1342 where the method is hosted is computed with the ComputeMethodHost
1343 before we create the method.
1345 Moved the Deepest routine here.
1347 (AnonymousContainer.ComputeMethodHost): New routine used to
1348 compute the proper ScopeInfo that will host the anonymous method.
1350 (ScopeInfo): Deal with multiple roots. The problem was that we
1351 did not have a unique root where all ScopeInfos could be hanged
1352 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
1355 Remove AdjustMethodScope which is now computed at the end. Remove
1356 LinkScope which did a partial link, instead link all ScopeInfos
1357 before code generation from the new "LinkScopes" routine.
1359 Simplify all the Add* routines as they no longer need to maintain
1360 the tree, they just need to record that they are using variables
1363 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1364 routines to produce the forest of ScopeInfo trees.
1366 * class.cs (TypeContainer.AppendMethod): This is just like
1367 AddMethod, but ensures that an interface implementation method
1368 (IEnumerable.XXX) is not inserted at the beginning of the queue of
1369 methods, but at the end.
1371 We use this functionality to ensure that the generated MoveNext
1372 method in the iterator class is resolved/emitted before the
1373 enumerator methods created.
1375 This is required because the MoveNext method computes the right
1376 ScopeInfo for the method. And the other methods will eventually
1377 need to resolve and fetch information computed from the anonymous
1381 2006-01-23 Raja R Harinath <rharinath@novell.com>
1383 Improve implementation of section 14.4.2.2 (Better function member).
1384 * expression.cs (Invocation.MoreSpecific): Compare all type
1385 arguments before deciding if one type is more specific than
1386 another. Handle array types too. Return the more specific type.
1387 (Invocation.BetterFunction): Add more tie-breaking rules from
1388 section 14.4.2.2. Perform "more specific" check after
1389 other tie-breaking rules. Compare all parameter types before
1390 choosing the "more specific" method.
1392 2006-01-21 Raja R Harinath <harinath@gmail.com>
1393 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1396 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
1398 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
1399 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
1401 2006-01-18 Martin Baulig <martin@ximian.com>
1403 * class.cs (TypeContainer.AddToMemberContainer): Use
1404 `symbol.MemberName.MethodName' instead of just `symbol.Name';
1407 2006-01-18 Martin Baulig <martin@ximian.com>
1409 Fix #76417: a generic class may now have methods which may unify
1410 for some type parameter substitutions.
1412 * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
1413 for methods which may unify anymore.
1415 * expression.cs (Invocation.MoreSpecific): New private static
1416 method; checks whether one method is more specific than another
1417 according to 14.4.2.2 of the spec.
1418 (Invocation.BetterFunction): Implement the tie-breaking rules from
1419 14.4.2.2 of the spec: if two methods unify for some type parameter
1420 substitution, we need to pick the more specific one.
1422 2006-01-18 Raja R Harinath <rharinath@novell.com>
1424 Fix #76656, cs0231-2.cs.
1425 * cs-parser.jay (formal_parameter_list): Make error case catch
1427 (parenthesized_expression_0): Add CS1026 check.
1428 (invocation_expression): Remove unused { $$ = lexer.Location }.
1430 2006-01-17 Raja R Harinath <rharinath@novell.com>
1433 * cs-parser.jay (statement_expression): Don't list out the
1434 individual statement-expressions. Convert syntax error into
1437 2006-01-16 Raja R Harinath <rharinath@novell.com>
1440 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
1441 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
1442 CheckIntermediateModification.
1443 (FieldExpr.DoResolve): Add new two-argument version that
1444 allows us to resolve the InstanceExpression as an lvalue.
1445 The one-argument variant is now just a wrapper.
1446 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
1447 Resolve the lhs as an lvalue if the it has a value type.
1448 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
1449 from Assign.DoResolve.
1450 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
1451 resolved as an lvalue.
1452 (PropertyExpr.DoResolve): Update.
1453 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
1454 has a value type. Move CS1612 check here from
1455 CheckIntermediateModification.
1456 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
1457 * expression.cs (EmptyExpression.OutAccess): New. Used as the
1458 'right_side' of a ResolveLValue on an 'out' argument.
1459 (EmptyExpression.LValueMemberAccess): New. Used as the
1460 'right_side' of a propagated ResolveLValue on a value type.
1461 (LocalVariableReference.DoResolveBase): Recognize
1462 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
1464 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
1465 EmptyExpression.Null.
1467 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
1469 * typemanager.cs : added IsGenericParameter(). In gmcs it returns
1470 Type.IsGenericParameter(). Fixed bug #77183.
1471 * doc.cs : it is now identical to doc.cs in mcs.
1473 2006-01-16 Martin Baulig <martin@ximian.com>
1475 * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
1477 2006-01-16 Martin Baulig <martin@ximian.com>
1479 * typemanager.cs (TypeManager.CSharpSignature): Make this work for
1480 ctors; fixes #77250.
1482 2006-01-12 Miguel de Icaza <miguel@novell.com>
1484 This fixes the problem where we used ldfld instead of ldflda to
1485 load the "THIS" pointer on captured parameters, when THIS is a
1486 value type. See bug #77205.
1488 * iterators.cs (CapturedThisReference.Emit): Pass false to
1489 EmitThis (we do not need the address).
1491 * codegen.cs (EmitThis): it needs to know whether we need the
1492 address of `this' or not. This is used by value types.
1494 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
1495 every other call passes false.
1497 2006-01-12 Raja R Harinath <rharinath@novell.com>
1500 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
1502 * expression.cs (Invocation.OverloadResolve): Update.
1503 (Invocation.DoResolve): Avoid double resolution of invocation.
1505 2006-01-11 Raja R Harinath <rharinath@novell.com>
1508 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
1509 unary negation of floating point types as 0-expr; negation cannot
1510 overflow in floating point types.
1513 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
1514 on operands of 'void' type.
1517 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
1518 and ExclusiveOr for boolean constants too.
1520 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
1522 * expression.cs: Fix Console.WriteLine ((this = x).foo);
1524 2006-01-12 Miguel de Icaza <miguel@novell.com>
1526 * cs-tokenizer.cs (Position): New class used to save and restore
1527 the position state in the tokenizer. Before this patch the save
1528 and restore was not complete enough so the line and columns would
1529 start to drift and the debugger and stack traces will get the
1532 2006-01-10 Martin Baulig <martin@ximian.com>
1535 (TypeParameter.InflateConstraints): New public method.
1537 * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
1538 constraints; fixes #77042.
1540 2006-01-10 Martin Baulig <martin@ximian.com>
1542 * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
1543 instead of the `TypeBuilder' for this "<>THIS" variable; fixes
1546 2006-01-09 Raja R Harinath <rharinath@novell.com>
1549 * expression.cs (Invocation.OverloadResolve): Replace reflected
1550 override methods with their base virtual methods, rather than
1552 * typemanager.cs (TypeManager.GetOverride): New.
1554 2005-12-21 Miguel de Icaza <miguel@novell.com>
1556 * driver.cs: Report the case of no source files and no -out:
1559 2005-12-20 Raja R Harinath <rharinath@novell.com>
1562 * expression.cs (ComposedCast.GetSignatureForError): Define.
1564 2006-01-05 Jb Evain <jbevain@gmail.com>
1566 * class.cs (Property.Define, Indexer.Define): do not tag the
1567 properties as SpecialName | RTSpecialName.
1569 2006-01-04 Miguel de Icaza <miguel@novell.com>
1571 * class.cs (MethodCore.IsDuplicateImplementation): This method was
1572 doing a low-level comparission of parameter types. It was lacking
1573 a check for __argslist.
1575 2005-12-30 Miguel de Icaza <miguel@novell.com>
1577 * expression.cs (ParameterReference.DoResolveBase): Allow
1578 reference parameters if they are local to this block.
1580 This allows the ref and out parameters of a delegate to be used in
1581 an anonymous method, for example:
1583 delegate void set (out int x);
1585 set s = delegate (out int x){
1589 This is used by functionality introduced late in the C# language.
1591 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1592 method that take ref and out parameters.
1594 Fixes #77119 which was a late change in the spec.
1596 2005-12-23 Miguel de Icaza <miguel@novell.com>
1598 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1599 parent if its the same scope. Fixes #77060.
1601 2005-12-22 Marek Safar <marek.safar@seznam.cz>
1603 * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
1605 2005-12-21 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1607 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
1608 errors 1726 for strong named assemblies with InternalsVisibleToAttribute
1609 that doesn't contain the full public key. This is a update of the
1610 friend assemblies in .Net 2.0 release.
1612 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1616 * namespace.cs (NamespaceEntry): Add extern_aliases as a
1617 ListDictionary, to contain the ExternAliasEntry entries (in
1618 addition to the NamespaceEntry.aliases hashtable). This field is
1619 shared between the original entry and its doppelganger (bodyless
1621 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1622 extern_aliases field.
1623 (NamespaceEntry.Lookup): Move the IsImplicit check after the
1624 lookup in extern_aliases.
1626 2005-12-16 Raja R Harinath <rharinath@novell.com>
1629 * class.cs (TypeContainer.Mark_HasEquals): New.
1630 (TypeContainer.Mark_HasGetHashCode): New.
1631 (ClassPart): Override them.
1632 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1634 * generic.cs (GenericMethod.DefineMembers): Update to changes.
1635 (TypeParameter.TypeParameter): Change type of 'parent' argument to
1639 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1640 'parent' argument to the base constructor.
1642 Remove all mention of TypeContainer from decl.cs.
1643 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1644 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1645 (DeclSpace.DeclSpace): Likewise.
1646 (DeclSpace.DefineMembers): Remove unused argument.
1647 * cs-parser.jay (pop_current_class): Update to changes. Simplify
1648 debugging check -- we don't care if the debug code throws an
1649 InvalidCastException instead of an InternalErrorException.
1650 * class.cs (TypeContainer.DefineMembers): Update to changes.
1651 (TypeContainer.DoDefineMembers): Likewise.
1652 (TypeContainer.GetMethods): Likewise.
1653 (PropertyMember.Define): Likewise.
1654 (MemberBase.Parent): New property that forwards to
1655 MemberCore.Parent, but ensures that we get a TypeContainer.
1656 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1657 (RootContext.PopulateTypes): Likewise. Remove special case code
1658 for !RootContext.StdLib: DefineMembers is idempotent.
1660 2005-12-13 Marek Safar <marek.safar@seznam.cz>
1662 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1664 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
1666 * doc.cs : The search for referenced namespace was insufficient to
1667 get global one as it used to do. Fixed bug #76965.
1669 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
1671 * doc.cs : check name in cref in the last phase that whether it is
1674 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1676 * cs-tokenizer.cs : reverted the latest change: it somehow broke
1679 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1681 * doc.cs : so it turned out that we cannot skip override check for
1682 interface members. Fixed bug #76954.
1684 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1686 * cs-tokenizer.cs : fixed bug #75984:
1687 - #warning and #error should not be handled when the source line
1689 - #line is not checked strictly when the source line is disabled.
1690 - #define and #undef is on the other hand checked strictly at any
1693 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
1695 * cs-tokenizer.cs : missing Location (actually, filename) in one of
1698 2005-12-15 Raja R Harinath <rharinath@novell.com>
1700 * generic.cs (TypeManager.IsGeneric): Remove unused method.
1702 * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
1705 2005-12-14 Martin Baulig <martin@ximian.com>
1707 * typemanager.cs (TypeManager.GetFullName): Make this public;
1708 `Type.Fullname' now never returns null.
1710 * class.cs (Method.Define): Use TypeManager.GetFullName() for
1711 explicit interface implementations; we're now using the same
1712 naming convention than csc does.
1714 2005-12-14 Miguel de Icaza <miguel@novell.com>
1716 * convert.cs (ExplicitConversionCore): Check the return value from
1717 ExplicitConversionCore which can return null on failure. Fixes #76914
1719 2005-12-09 Raja R Harinath <rharinath@novell.com>
1721 * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
1722 instead of IsGenericInstance.
1723 * generic.cs (TypeManager.IsEqual): Likewise. Delete redundant
1724 code that's now covered by the more general test.
1725 * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
1727 * generic.cs (DropGenericTypeArguments): New. Captures the common
1728 pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
1729 * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
1730 * generic.cs, report.cs, typemanager.cs: Likewise.
1732 2005-12-08 Martin Baulig <martin@ximian.com>
1734 * generic.cs (TypeArguments.Resolve): Added CS1547 check.
1736 * typemanager.cs (TypeManager.CSharpSignature): Include type
1737 arguments in the signature of a generic method.
1739 2005-12-07 Martin Baulig <martin@ximian.com>
1741 Add support for custom attributes on type parameters.
1743 * cs-parser.jay (type_arguments): Added `opt_attributes'.
1745 * generic.cs (TypeParameterName): New public class; we use this
1746 instead of a `string' to store the name of a type parameter, so we
1747 can also have `Attributes'.
1748 (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
1749 array instead of a `string[]' array.
1750 (TypeParameter.ctor): We now also take an `Attributes' argument.
1751 (TypeParameter.EmitAttributes): New public method; emit our
1752 `OptAttributes' here.
1753 (GenericMethod.EmitAttributes): New public method; emit the custom
1754 attributes on all our type parameters.
1756 * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
1757 our type parameters.
1758 (MethodData.Define): If we're a generic method, call
1759 EmitAttributes() on it.
1761 2005-12-07 Martin Baulig <martin@ximian.com>
1764 (ConstraintChecker): New public abstract class; move the
1765 constraint checking here from `ConstructedType' and also do
1766 constraint checking for generic methods here.
1768 * expression.cs (Invocation.OverloadResolve): Use
1769 ConstraintChecker.CheckConstraints() if we resolved to a generic
1772 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1774 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1776 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1778 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1779 (FieldBase.Initializer): Initializer is now optional.
1780 (EventField.Define): Only event field can have initializer.
1782 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1784 * const.cs (Const): Reuse initializer.
1786 * cs-parser.jay: Updated after FieldBase changes.
1787 Added current_array_type to simplify array initializers.
1789 * ecore.cs (NullCast.IsDefaultValue): Implemented.
1791 * expression.cs, iterators.cs: Updated.
1793 * namespace.cs (NamespaceEntry): Made UsingFound private.
1795 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1797 * parameterCollection.cs: Obsolete, removed.
1798 * parser.cs: Obsolete, removed.
1800 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1803 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1805 * enum.cs (Enum.Define): Set obsolete context here.
1807 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
1810 - FindDocumentedMember() now expects 1) paramList as null
1811 when "we don't have to check the number of parameters" and
1812 2) Type.EmptyTypes when "there is no arguments".
1813 - Introduced FoundMember struct to hold the exact type which was
1814 used to find the documented member (the above change broke
1815 test-xml-044; it might be better just to use DeclaringType than
1816 what MS does, like this change does, but it depends on usage.)
1818 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
1820 * doc.cs : documented member might be from DeclaringType for nested
1821 types. Fixed bug #76782.
1823 2005-12-03 Ben Maurer <bmaurer@ximian.com>
1825 * anonymous.cs: Have the param code handle leaving copies on the
1826 stack etc. Allows anonymous params to take part in the assignment
1827 code (++, +=, etc). Fixes bug #76550
1829 * expression.cs: Handle the prepare_for_load/leave_copy by passing
1830 it down to the anon code.
1832 * iterators.cs: Use dummy var here
1834 * codegen.cs: Handle new vars
1836 2005-12-01 Marek Safar <marek.safar@seznam.cz>
1839 * class.cs (MethodData.Define): Set proper Obsolete context.
1841 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1843 (FieldExpr.DoResolve): Ditto.
1845 2005-12-01 Marek Safar <marek.safar@seznam.cz>
1848 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1849 parent is not obsolete.
1851 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
1853 * doc.cs : (FindDocumentedMember) find parameterless members first
1854 and get CS0419 in the early stage. Fixed first case of bug #76727.
1856 2005-11-30 Marek Safar <marek.safar@seznam.cz>
1859 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1860 no error was reported.
1862 *expression.cs (Binary.DoResolve): left can be null.
1864 2005-12-06 Raja R Harinath <rharinath@novell.com>
1866 * class.cs (MethodCore.CheckGenericOverride): Delete unused
1867 abstract method and all overrides.
1868 * support.cs (ParameterData.GenericConstraints): Delete.
1869 (ReflectionParameters.type_params): Delete.
1870 (ReflectionParameters.ReflectionParameters): Make private.
1871 (ReflectionParameters.GetConstaints): New factory method.
1872 * generic.cs (TypeParameterDefineType): Use it.
1873 (TypeManager.GetTypeParameterConstraints): Likewise.
1875 2005-11-22 Marek Safar <marek.safar@seznam.cz>
1878 * class.cs (MethodData.Emit): Parameters should be labeled first.
1880 2005-11-21 Marek Safar <marek.safar@seznam.cz>
1883 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1885 2005-11-18 Marek Safar <marek.safar@seznam.cz>
1887 * attribute.cs (AreParametersCompliant): Moved to Parameter.
1889 * class.cs (MethodCore): Parameter clean up.
1890 (IMethodData): Added ParameterInfo.
1891 (MethodData): Parameter clean up.
1892 (Indexer.Define): Parameter clean up.
1904 * typemanager.cs: Parameter clean up.
1906 * delegate.cs (Define): Get rid of duplicated code.
1908 * expression.cs (ParameterReference): Removed useless parameters
1910 (Invocation): Ditto.
1912 * parameter.cs (ParamsParameter): New class, params specialization.
1913 (ArglistParameter): Attemp to separate arglist.
1914 (Parameter): Refactored to be reusable and faster.
1915 (Parameter.Modifier): Made understandable.
1916 (Parameters): Changed to be used as a class for `this' assembly
1917 parameters. Refactored to use new specialized classes.
1919 * support.cs (ParameterData): Added Types property.
1920 (InternalParameters): Deleted.
1922 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1924 * doc.cs : the previous patch does not actually fix the bug.
1925 PropertyInfo override check is now implemented and really fixed it.
1926 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
1928 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1930 * doc.cs : apply "override filter" also to properties.
1933 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1935 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
1936 no need to check overrides. For classes, omit those results from
1937 interfaces since they must exist in the class. Fixed bug #76726.
1939 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1941 * typemanager.cs : (GetFullNameSignature) differentiate indexers
1942 with different parameters. Fixed the second problem in #76685.
1944 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1946 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
1947 get expected 'protected' access in CheckValidFamilyAccess()).
1950 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1952 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
1953 Fixed bug #76705. CS1569 was incorrectly commented out.
1955 2005-11-23 Martin Baulig <martin@ximian.com>
1957 * generic.cs (Constraints.Define): Removed.
1958 (TypeParameter.DefineConstraints): Removed.
1959 (TypeParameter.DefineType): Call SetGenericParameterAttributes()
1960 on the GenericTypeParameterBuilder here.
1962 2005-11-23 Martin Baulig <martin@ximian.com>
1964 * typemanager.cs (TypeManager.GetProperty): Make this public.
1966 * generic.cs (Nullable.NullableInfo.ctor): Use
1967 TypeManager.GetProperty() rather than using reflection directly.
1969 2005-11-17 Martin Baulig <martin@ximian.com>
1971 * expression.cs (Indexers.GetIndexersForType): Added support for
1972 generic parameters; fixes #76587.
1974 2005-11-17 Martin Baulig <martin@ximian.com>
1977 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
1978 inherit the scope from our parent. Fixes #76653.
1980 2005-11-15 Martin Baulig <martin@ximian.com>
1982 * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
1983 instead of `ScopeTypeBuilder' to refer to the "current" type.
1984 (AnonymousMethod.CreateScopeType): Correctly create the helper
1985 class if we're inside a generic type definition.
1987 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
1989 * doc.cs : use Invocation.IsOverride() to do real override check.
1990 * expression.cs : made Invocation.IsOverride() internal.
1992 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
1994 * doc.cs : use TypeManager.FindMembers() instead of (possible)
1995 TypeBuilder.FindMembers() and filter overriden base members out.
1998 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2000 * doc.cs : ref/out parameters are represented as '@' (instead of
2001 '&' in type FullName). Fixed bug #76630 (additionally crefs).
2003 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2005 * doc.cs : when there was no '.' in cref to methods in doc comment,
2006 then parameters were missing in the output. Fixed bug #76691.
2008 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2010 * driver.cs : don't output docs when there is an error.
2013 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2016 Now it should detect indexers. Fixed primary concern in bug #76685.
2017 Fixed CS0419 message to not show the identical member signature in
2020 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2022 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2023 instead of Type.FindMembers() since it does not handle events.
2026 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
2028 * codegen.cs: Fixed typo (speficied -> specified).
2030 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2033 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2035 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2037 * attribute.cs: Changed error message.
2039 * cs-tokenizer.cs: One more check.
2041 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2043 * statement.cs (Block.Resolve): Ignore empty statement.
2045 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2047 * report.cs: Made error/warning methods more strict to avoid
2050 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
2051 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
2052 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
2053 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2055 2005-11-11 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2057 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute):
2058 Use the more explicit AssemblyName.FullName instead of
2059 AssemblyName.Name to report errors.
2061 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2063 * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
2066 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2076 * report.cs: Fixed error reporting and typos.
2078 * generic.cs (TypeParameter.GetSignatureForError): New method.
2079 (ConstructedType.GetSignatureForError): Instead of DeclarationName.
2081 * typemanager.cs (GetFullName): Refactored.
2083 2005-11-08 Marek Safar <marek.safar@seznam.cz>
2085 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
2086 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
2088 * class.cs (TypeContainer.IsComImport): New property.
2089 (Constructor.Define): Create proper ctor for ComImport types.
2091 * expression.cs (New.CheckComImport): Fixed.
2093 2005-11-07 Miguel de Icaza <miguel@novell.com>
2095 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
2096 that a parameter has been captured does not mean that we do not
2097 have to do the rest of the processing. This fixes the second part
2098 of #76592. If there was another anonymous method capturing
2099 values in the past, the Scope would never be set for the second
2100 method that captured the same parameter.
2102 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
2103 properly manipulate the stack. Second part of fix for #76592.
2105 * expression.cs (New): Add support for invoking "new" on
2106 interfaces that have been flagged with the ComImport attribute and
2107 the CoClass. Fixes #76637
2109 * statement.cs (Try.DoEmit): When a variable is captured, do not
2110 try to emit the vi.LocalBuilder variable as it has been captured.
2111 Create a temporary variable and store the results on the
2112 FieldBuilder. Fixes #76642
2114 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2116 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
2118 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
2120 * expression.cs (Binary.DoResolve): Added && optimalization.
2122 * typemanager.cs (AddUserType): Removed useless argument.
2124 2005-11-04 Marek Safar <marek.safar@seznam.cz>
2126 * statement.cs (Block.variables): Uses ListDictionary.
2128 2005-11-03 Marek Safar <marek.safar@seznam.cz>
2131 * class.cs (PartialContainer.EmitType): Customized to emit
2132 security attributes.
2133 (ClassPart.ApplyAttributeBuilder): Transform security attribute
2134 for partial classes.
2136 2005-11-03 Marek Safar <marek.safar@seznam.cz>
2139 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
2140 access has to be fixed.
2142 * typemanager.cs (IsUnmanagedType): Wrong common field type.
2144 2005-11-01 Marek Safar <marek.safar@seznam.cz>
2147 * ecore.cs (NullCast.Reduce): Implemented.
2149 * expression.cs (ArrayCreation.CheckIndices): Correcly check
2152 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
2154 (Foreach.Resolve): Catch null properly.
2156 2005-10-29 Marek Safar <marek.safar@seznam.cz>
2158 * cs-tokenizer.cs: Warning text fix.
2160 * driver.cs: AllWarningNumbers exposed on public interface.
2162 * report.cs (): Reviewed warning numbers.
2163 (IsValidWarning): Use binary search.
2165 2005-10-29 Marek Safar <marek.safar@seznam.cz>
2167 * driver.cs: Implemeted resource visibility.
2168 (Resources): New class for code sharing between /res: and
2171 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2173 decl.cs (CurrentTypeParameters): Fixed to be public.
2175 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2177 generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
2179 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2181 gmcs.exe.sources: Use CryptoConvert.cs from corlib.
2183 2005-11-05 Kornél Pál <kornelpal@hotmail.com>
2185 * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
2187 2005-11-04 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2189 Add friend assembly access support.
2190 * typemanager.cs: assembly_internals_vis_attrs
2191 cache for friend assembly access.
2192 (TypeManager.IsFriendAssembly): New method for
2193 checking friend assembly access.
2194 (TypeManager.Error_FriendAccessNameNotMatching): New
2196 (TypeManager.CompareKeyTokens): Likewise.
2197 (TypeManager.Filter): Handle friend accessible
2200 * namespace.cs (RootNamespace.GetTypeInAssembly): Return
2201 friend accessible types.
2203 * ecore.cs (Expression.IsAccessorAccessible): Handle
2204 friend accessible properties.
2206 * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
2209 2005-10-28 Marek Safar <marek.safar@seznam.cz>
2212 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
2215 * convert (Convert.ImplicitReferenceConversion): NullCast holds
2218 * ecore.cs (NullCast): Child is contant only.
2220 * literal.cs (NullLiteral.Reduce): null can be converted to any
2223 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
2225 * driver.cs: Use Encoding.Default as default code page instead
2228 2005-10-27 Raja R Harinath <rharinath@novell.com>
2231 * expression.cs (Invocation.Error_InvalidArguments): Handle
2232 __arglist parameters.
2233 (Invocation.VerifyArgumentsCompat): Likewise.
2234 * support.cs (ReflectionParameters.GetSignatureForError): Print
2235 __arglist parameters.
2236 (InternalParamters.GetSignatureForError): Likewise.
2237 * parameter.cs (Parameters.GetSignatureForError): Likewise.
2239 2005-10-26 Marek Safar <marek.safar@seznam.cz>
2241 * attribute.cs (GetPropertyValue): Made public.
2243 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
2245 Add new property WrapNonExceptionThrows to handle 2.0 assembly
2247 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
2250 * driver.cs: Reflect method name change.
2252 * statement.cs (Try.Resolve): Warn when try has both general
2255 * typemanager.cs: runtime_compatibility_attr_type new predefined
2258 2005-10-26 Raja R Harinath <harinath@gmail.com>
2261 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
2262 treat it as an empty parameter list.
2264 2005-10-26 Raja R Harinath <rharinath@novell.com>
2267 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
2268 ResolveAsTypeStep silent.
2269 * statement.cs (Block.AddConstant): Mark block as used.
2270 (Block.ResolveMeta): Avoid piling on error messages
2271 if a constant initializer resolution fails.
2273 2005-10-25 Raja R Harinath <rharinath@novell.com>
2275 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
2277 (NamespaceEntry.VerifyAllUsing): New.
2278 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
2279 behaviour. Delegates actual resolution of alias to ...
2280 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
2281 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
2283 * driver.cs (Driver.MainDriver): Update.
2285 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
2286 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
2288 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
2290 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
2291 RootNamespace.DefineNamespacesForAll.
2293 2005-10-24 Raja R Harinath <harinath@gmail.com>
2295 * typemanager.cs (assemblies, external_aliases, modules)
2296 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
2297 (ComputeNamespaces, GetRootNamespace): Remove extra staging
2298 overhead. Move resposibility ...
2299 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
2300 * driver.cs, attribute.cs, codegen.cs: Update to changes.
2302 2005-10-23 Raja R Harinath <harinath@gmail.com>
2304 * namespace.cs (RootNamespace.all_namespaces): Renamed from
2305 cached_namespaces. Improve usage.
2306 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
2307 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
2308 Move from GlobalRootNamespace and simplify.
2309 (RootNamespace.Global): Make instance variable.
2310 (RootNamespace.RootNamespace): Add "alias name" parameter.
2311 (GlobalRootNamespace): Simplify drastically.
2312 (Namespace.Lookup): Don't use GetNamespace.
2313 * typemanager.cs (GetRootNamespace): Rename from
2314 ComputeNamespaceForAlias.
2315 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2317 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2319 * anonymous.cs (AnonymousContainer): Don't crash when container
2322 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2324 * expression.cs (Binary.DoResolve): Warn when comparing same
2327 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2330 * expression.cs (Binary.DoResolve): It looks like there are no
2331 convetsion rules in enum context.
2333 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2335 Add support for extern alias qualifiers.
2336 * typemanager.cs: Move some LookupTypeReflection code
2337 to namespace.cs, to have cleaner code. Added some methods
2338 to help us keep track of the extern aliased references.
2339 * driver.cs: Add suport for extern alias assemblies on command
2340 line and check for their warnings/errors. Also keep track of the
2341 extern aliased assemblies.
2342 * namespace.cs: Move the global functionality of Namespace
2343 to GlobalRootNamespace/RootNamespace. Now the global namespace
2344 is GlobalRootNamespace.Globa. Also the code moved from
2345 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
2346 Finally added LocalAliasEntry (AliasEntry before) and
2347 ExternAliasEntry, to handle alias statements.
2348 * cs-parser.jay: Add support in the grammar for extern alias
2350 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
2351 Update callings to Namespace (now in GlobalRootNamespace).
2353 2005-10-25 Martin Baulig <martin@ximian.com>
2355 * convert.cs (ImplicitTypeParameterConversion): Make base
2356 interfaces actually work; fixes #76557.
2358 2005-10-25 Martin Baulig <martin@ximian.com>
2361 (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
2362 all the type parameters; fixes #76551.
2364 2005-10-25 Martin Baulig <martin@ximian.com>
2369 (GenericMethod.ctor): Added `Expression return_type' and
2370 `Parameters parameters' arguments.
2371 (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
2372 parameter and return types to check their constraints if they're
2375 * codegen.cs (EmitContext.ResolvingGenericMethod): New public
2378 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
2379 constraints of a generic type if `ec.ResolvingGenericMethod'.
2381 * class.cs (MethodCore.DoDefineParameters): Set
2382 `ec.ResolvingGenericMethod' if we're a generic method.
2383 (MemberBase.MemberType): Likewise.
2385 2005-10-25 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2387 * typemanager.cs (TypeManager): Added
2388 TypeManager.internals_visible_attr_type to cache
2389 S.R.CompilerServices.InternalsVisibleToAttribute.
2391 * codegen.cs (AssemblyClass): Added checks for
2392 InternalsVisibleToAttribute in new method
2393 CheckInternalsVisibleAttribute () and also cache the
2394 AssemblyName in AssemblyClass.Name.
2396 2005-10-24 Martin Baulig <martin@ximian.com>
2399 (TypeManager.ExpandInterfaces): Added overloaded version which
2400 just takes a `Type[]' array.
2403 (Constraints.Resolve): Don't expand the interfaces here; ie. we
2404 just use the interfaces which were explicitly specified and not
2405 the interfaces they inherit. Fixes #76482.
2406 (TypeParameter.FindMembers): Expand the interfaces here.
2408 2005-10-21 Martin Baulig <martin@ximian.com>
2411 (Constraints.Resolve): Also resolve the actual types here.
2412 (Constraints.ResolveTypes): Just check the constraints here.
2413 Fixes #76363; see gtest-218.cs.
2415 2005-10-21 Martin Baulig <martin@ximian.com>
2418 (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
2419 instead of a `BoxedCast'; fixes gtest-217.cs.
2421 2005-10-20 Atsushi Enomoto <atsushi@ximian.com>
2423 * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
2424 1) "new()" is specified as generic parameter constraint and 2) the
2425 type is TypeBuilder and 3) the type is abstract even if it has a
2426 default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
2428 2005-10-20 Martin Baulig <martin@ximian.com>
2431 (GenericConstraints.TypeParameter): New public property.
2432 (TypeParameter.ctor): Also take a `DeclSpace' argument.
2433 (TypeParameter.DeclSpace): New public property.
2434 (TypeParameter.DefineType): Inflate the constraints if our
2435 `DeclSpace' is an `Iterator'.
2437 2005-10-19 Atsushi Enomoto <atsushi@ximian.com>
2439 * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added
2440 GenericMethod argument to compare methods' generic type arguments.
2443 2005-10-19 Martin Baulig <martin@ximian.com>
2445 * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
2446 not ResolveType() when resolving the base type, so we're not
2447 checking the constraints here.
2448 (TypeContainer.ResolveType): Call ResolveType() on our base_type
2451 2005-10-19 Martin Baulig <martin@ximian.com>
2453 * generic.cs (ConstructedType.CheckConstraints): Committing
2454 untested fix for #76441.
2456 2005-10-18 Raja R Harinath <rharinath@novell.com>
2459 * class.cs (TypeContainer.DefineType): Move updating of
2460 topological sort earlier in the code.
2461 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2463 2005-10-18 Marek Safar <marek.safar@seznam.cz>
2466 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
2468 * constant.cs (Constant.TryReduce): Moved from Cast class.
2469 (Reduce): Made little bit more OO and fixed missing conversions.
2471 * ecore.cs (Reduce): Implemented.
2472 (Binary.EnumLiftUp): New method to upgrade values to enum values.
2474 * literal.cs (Reduce): Implemented.
2476 * class.cs: Reverted Miguel's wrong commit.
2478 2005-10-14 Miguel de Icaza <miguel@novell.com>
2480 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2482 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
2484 * cs-parser.jay, expression.cs : CS0214 was missing error location
2485 for constants. Fixed bug #76404.
2487 2005-10-10 Raja R Harinath <rharinath@novell.com>
2489 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2491 (PropertyExpr.EmitCall): Likewise.
2492 * expression.cs (Invocation.EmitArguments): Handle case where
2494 (Invocation.EmitCall): Avoid allocating temporary variable if
2495 there are no arguments.
2497 2005-10-11 Marek Safar <marek.safar@seznam.cz>
2500 * convert.cs (ExplicitConversionCore): Fixed object->enum
2503 2005-10-07 Raja R Harinath <rharinath@novell.com>
2506 * convert.cs (ImplicitConversionStandard): Move conversion of
2507 void* to arbitrary pointer types ...
2508 (ExplicitConversionStandard): .. here.
2509 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2510 error to always print typenames.
2512 2005-10-07 Raja R Harinath <rharinath@novell.com>
2514 * convert.cs (GetConversionOperator): Rename from
2515 GetConversionOperators. Move operator selection code from ...
2516 (UserDefinedConversion): ... here.
2518 2005-10-06 Marek Safar <marek.safar@seznam.cz>
2520 * convert.cs (ExplicitConversionCore): Removed duplicate enum
2523 2005-10-05 Marek Safar <marek.safar@seznam.cz>
2525 * assign.cs (Assign.DoResolve): Error method changed.
2527 * cfold.cs (DoConstantNumericPromotions): Error method changed.
2529 * const.cs (ResolveValue): Reset in_transit immediately.
2531 * constant.cs: Error method changed.
2533 * convert.cs: Removed useless location parameter.
2534 (ExplicitNumericConversion): Don't do double enum check.
2535 (ExplicitConversionCore): Renamed from ExplicitConversion.
2536 (ExplicitUnsafe): Extracted from ExplicitConversion.
2537 (ExplicitConversion): Uses for error reporting.
2539 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2541 (ResolveBoolean): Uses common error method.
2542 (CastToDecimal): Get rid of ec.
2543 (CastFromDecimal): Optimized.
2544 (ConvCast): Get rid of ec.
2546 * enum.cs (ResolveValue): Reset in_transit immediately.
2547 (Emit): Return after first error.
2549 * expression.cs: Convert changes.
2551 * literal.cs: Error method changed.
2553 * statement.cs: Error method changed.
2555 2005-10-06 Raja R Harinath <rharinath@novell.com>
2557 Fix gtest-131.cs and gtest-211.cs.
2558 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
2559 Only emit code for a label if it is used. Unreachable code can
2560 violate ECMA evaluation stack invariants.
2562 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2564 * anonymous.cs: Implemented ExprClassName.
2566 * assign.cs (Assign.DoResolve): Don't chrash when type is not
2569 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2572 * class.cs (StaticClass.DefineContainerMembers): Report protected
2575 * codegen.cs: if(ed) PRODUCTION.
2577 * convert.cs (Error_CannotImplicitConversion): Better error
2580 * cs-parser.jay: More error checks.
2582 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2584 * driver.cs (CSCParseOption): Enabled wrong option check.
2586 * ecore.cs (Expression.ExprClassName): Turned to property.
2587 (MemberExpr.CheckIntermediateModification): For checking boxed
2588 value types modification.
2590 * statement.cs (Fixed.Resolve): Expression type must be
2591 convertible to fixed type.
2592 (CollectionForeach.GetEnumeratorFilter,TryType):
2593 Small refactoring for easier error checking.
2595 2005-09-26 Marek Safar <marek.safar@seznam.cz>
2597 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2600 * class.cs (GeneratedBaseInitializer): New class for customization
2601 compiler generated initializers.
2602 (MemberBase.DoDefine): Check Obsolete attribute here.
2603 (FieldMember.DoDefine): Ditto.
2605 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2608 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2609 (MemberCore.GetObsoleteAttribute): Removed argument.
2610 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2611 (MemberCore.CheckObsoleteType): New helper.
2615 * statement.cs: Updates after MemberCore changes.
2617 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2618 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2620 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2621 obsolete attribute for compiler construct.
2622 (As.DoResolve): Cache result.
2624 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2626 2005-10-01 Miguel de Icaza <miguel@novell.com>
2628 * expression.cs (Probe): instead of having a "Type probe_type"
2629 keep the extra information as a TypeExpr probe_type_expr since the
2630 "As" operator needs to perform some type checks.
2632 * (As.DoResolve): If the type is a type parameter, ensure that it
2633 is constrained by a class.
2635 2005-09-22 Miguel de Icaza <miguel@novell.com>
2637 * statement.cs (Lock): Use the TemporaryVariable class instead of
2638 manually using local variables as those do not work when variables
2641 * ecore.cs: Moved the TemporaryVariable class from being a nested
2642 class inside Foreach to be a public class that can be employed in
2645 2005-09-19 Marek Safar <marek.safar@seznam.cz>
2647 * cs-parser.jay: interface_accessors replaced by
2648 accessor_declarations.
2650 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2653 * statement.cs (GotoCase.Resolve): Convert null constant to
2655 (SwitchLabel.ResolveAndReduce): Ditto.
2656 (SwitchLabel.NullStringCase): Custom null stamp.
2657 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2659 typemanager.cs (CSharpSignature): Don't skip first argument
2662 2005-09-16 Marek Safar <marek.safar@seznam.cz>
2664 * cfold.cs, constant.cs, convert.cs, ecore.cs,
2665 expression.cs, iterators.cs, literal.cs: Store constants and
2668 * class.cs (MemberBase.ShortName): Pass location.
2670 * cs-parser.jay: Some location fixes.
2672 * ecore.cs (Expression.Location): Made virtual.
2674 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2677 * const.cs (Const.ResolveValue): Check for assigning non-null
2678 value to reference type.
2680 2005-09-26 Raja R Harinath <rharinath@novell.com>
2683 * expression.cs (This.VerifyFixed): In a value type T, the type of
2684 'this' is T&, iow, 'this' is either an out or ref parameter. In a
2685 value type R, 'this' is treated as a value parameter.
2687 2005-09-05 Miguel de Icaza <miguel@novell.com>
2689 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2690 if the underlying types are the same, otherwise we need to produce
2691 code that will do the proper cast.
2693 This was exposed by Marek's constant rewrite which produced
2694 invalid code for the call site:
2697 void Method (X v) {}
2701 This fixes test-49.cs
2703 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2705 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2706 Type/Object should be allowed as well. Fixed bug #75968.
2708 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2710 * expression.cs : (Binary.DoResolve): when one is enum constant and
2711 another is constant 0, then return enum one *as enum type*.
2714 2005-10-04 Martin Baulig <martin@ximian.com>
2716 * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
2717 `SetMemberIsUsed()' work for generics, too.
2719 2005-10-04 Martin Baulig <martin@ximian.com>
2721 * expression.cs (DelegateInvocation.EmitStatement): Make this work
2722 for corlib. Fixes #75691.
2724 2005-09-28 Marek Safar <marek.safar@seznam.cz>
2727 * driver.cs: Fix compilation files with full root path.
2729 2005-09-25 Miguel de Icaza <miguel@novell.com>
2731 * report.cs (SymbolRelatedToPreviousError): Format the output so
2732 it does not use an open parenthesis that is never closed.
2734 * driver.cs: Follow coding guidelines
2736 2005-09-18 Miguel de Icaza <miguel@novell.com>
2738 * driver.cs: Set InEmacs based on the environment variable EMACS.
2740 * location.cs (InEmacs): in this mode, do not report column
2741 location as it confuses Emacs.
2743 2005-10-03 Raja R Harinath <rharinath@novell.com>
2745 * support.cs (SeekableStreamReader.Position): Don't error out when
2746 the requested position is just beyond the end of the current
2749 2005-09-28 Raja R Harinath <rharinath@novell.com>
2751 * support.cs (SeekableStreamReader): Simplify drastically. Don't
2752 try to keep in sync with the byte count of the underlying Stream.
2753 However, this limits us to a window size of 2048 characters: i.e.,
2754 the maximum lookahead of our lexer/parser can be 2048 characters.
2756 2005-09-22 Martin Baulig <martin@ximian.com>
2758 * driver.cs: Removed a debugging FIXME.
2760 2005-09-21 Raja R Harinath <rharinath@novell.com>
2762 * cs-parser.jay (type_arguments): Add CS1644 check.
2763 * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
2765 2005-09-15 Raja R Harinath <rharinath@novell.com>
2767 * Makefile (PROGRAM): Make profile specific.
2768 (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
2769 the current directory.
2772 * expression.cs (Invocation.EmitCall): Remove optimization on
2773 this_call since it doesn't handle 'this' being a value type.
2775 2005-09-05 Geoff Norton <gnorton@customerdna.com>
2777 * driver.cs: Ensure file handles are closed after parsing
2779 2005-09-05 Miguel de Icaza <miguel@novell.com>
2781 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2782 if the underlying types are the same, otherwise we need to produce
2783 code that will do the proper cast.
2785 This was exposed by Marek's constant rewrite which produced
2786 invalid code for the call site:
2789 void Method (X v) {}
2793 This fixes test-49.cs
2795 2005-09-05 Martin Baulig <martin@ximian.com>
2797 * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
2798 instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
2800 * cs-parser.jay (delegate_declaration): Small fix for #75852.
2802 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2804 * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
2805 to be a pointer type due to the spec 25.2, so check if declaring
2806 type is generic type definition. Fixed bug #75772.
2808 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2811 * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
2812 both types are not defined by methods.
2813 * expression.cs : (Invocation.IsApplicable): it should work when
2814 the argument type is equal to the parameter type, not only when
2815 ImplicitConversionExists() returns true.
2817 2005-09-02 Raja R Harinath <rharinath@novell.com>
2819 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2823 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2824 flow-branching for LocalVariableReferences in case we were invoked
2825 from a MemberAccess.
2826 * expression.cs (LocalVariableReference.VerifyAssigned): New.
2828 (LocalVariableReference.DoResolveBase): ... this.
2829 (MemberAccess.Resolve): Do the check that was disabled during
2832 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
2835 (PartialContainer.Create): check abstract/sealed/static strictly
2836 but abstract/sealed can exist only at one side. Fixed bug #75883.
2838 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
2841 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2842 specified, don't default to UnmanagedType.I4.
2844 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
2846 * expression.cs : conditional operator should check possibly
2847 incorrect assign expression. Fixed bug #75946.
2849 2005-08-30 Raja R Harinath <rharinath@novell.com>
2852 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2853 (ScopeInfo.EmitScopeType): Use it to construct field names from
2854 names of captured locals.
2857 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2858 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2859 Pass 'target_type' to BoxedCast. Don't default to 'object'.
2860 (ExplicitConversion): Remove enum cases already handled by
2861 implicit conversion. Move implicit conversion check to the beginning.
2862 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2863 * expression.cs (ArrayCreation.EmitDynamicInitializers):
2864 Don't treat System.Enum as a struct.
2866 2005-08-30 Jb Evain <jbevain@gmail.com>
2868 * attribute.cs: handles as expression in parameters.
2870 2005-08-30 Raja R Harinath <rharinath@novell.com>
2873 * class.cs (TypeContainer.VerifyClsName): Don't use a
2874 PartialContainer when verifying CLS compliance.
2875 (AbstractPropertyEventMethod): Set Parent here, ...
2876 (PropertyMethod): ... not here.
2878 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
2880 * attribute.cs : escaped attribute name should not be allowed to be
2881 resolved (e.g. @class as classAttribute). Fixed bug #75930.
2883 2005-08-29 Raja R Harinath <rharinath@novell.com>
2886 * convert.cs (ImplicitStandardConversionExists): Allow zero also
2887 when converting a long constant to unsigned long.
2888 * expression.cs (Invocation.OverloadResolve): Add sanity check to
2889 detect where IsApplicable and VerifyArgumentsCompat disagree.
2891 2005-08-29 Raja R Harinath <rharinath@novell.com>
2892 and Carlos Alberto Cortez <carlos@unixmexico.org>
2895 * class.cs (TypeContainer.CanElideInitializer): New helper.
2896 (TypeContainer.EmitFieldInitializers): Use it to determine if we
2897 can safely emitting the initializer of a field.
2899 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2901 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2902 allowed inside a switch (without loop). Fixed bug #75433.
2904 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
2906 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2907 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2909 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2911 * driver.cs : kinda reverting the default encoding changes (not exact
2912 revert since I noticed that "codepage:reset" might not work fine).
2914 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2916 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2917 Location. Now getter and setter store location correctly.
2918 (errors/cs0111-12.cs now reports the expected location.)
2920 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2922 * driver.cs : Use default encoding on the environment.
2923 Removed (now that) extra parameter for SeekableStreamReader.
2924 * support.cs : (SeekableStreamReader) third .ctor() argument for
2925 StreamReader is not required (always true). preamble size could
2926 be acquired in simpler and safe way.
2928 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
2930 * cs-parser.jay: report CS0642 at warning level 3
2931 and report CS0642 for an if else statement also
2932 fixes bug #74745. Patch by John Luke (and a bit
2934 Removed extra CS0642 warning check for "while",
2936 * statement.cs: In Block.Resolve(), CS0642 check
2937 is reimplemented to check a sequence of an empty
2938 statement and a block.
2940 Both fix bug #66777.
2942 2005-08-24 Marek Safar <marek.safar@seznam.cz>
2944 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2945 detection until I fix it.
2947 * cs-tokenizer.cs: Changed error message.
2949 * cs-parser.jay: Fixed 2 error locations.
2951 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2952 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2955 * enum.cs (GetSignatureForError): Fixed.
2957 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2961 * typemanager.cs (RegisterProperty): Removed.
2963 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2965 2005-08-24 Raja R Harinath <rharinath@novell.com>
2968 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2969 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2971 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2973 * expression.cs : tiny fix is required for not warning positive ulong.
2976 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2978 * expression.cs : add CS0652 check for constant and integral
2979 expression. Fixed bug #53974.
2981 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2983 * expression.cs : in DoNumericPromotions(), check if there is implicit
2984 conversion overload for string (to check CS0034). Fixed bug #52492.
2986 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2988 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2990 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2992 * ecore.cs : report location when it is *not* Null.
2994 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3000 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
3001 correctly. Fixed bug #75721.
3003 2005-08-23 Raja R Harinath <rharinath@novell.com>
3005 * support.cs (SeekableStreamReader.Position): Avoid an expensive
3006 loop that performs 'min (pos, char_count)'.
3009 * expression.cs (Unary.ResolveOperator): Don't discard implicit
3010 converted value in Operator.OnesComplement.
3012 2005-08-22 Ben Maurer <bmaurer@ximian.com>
3014 * anonymous.cs: If the anon method is pulled into a helper class,
3015 it needs to be `internal' not `private'. Fixes runtime behavior on
3018 2005-08-17 Marek Safar <marek.safar@seznam.cz>
3021 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
3024 2005-08-16 Marek Safar <marek.safar@seznam.cz>
3026 The big constants rewrite
3027 Fix #75746, #75685 and more
3028 As a side effect saved 1MB for MWF ;-)
3030 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
3031 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
3032 enum based for corlib compilation.
3034 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
3037 * class.cs (FixedField.Define): Use ResolveAsConstant.
3039 * const.cs (IConstant): Interface constants and enums.
3040 (Const.ResolveValue): New method for constant resolvning.
3041 (ExternalConstant): Constants from imported assemblies.
3043 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
3044 conversion; like enums.
3045 (Constant.ToType): Converts this constant to different type.
3046 (Constant.Increment): Adds 1.
3048 * convert.cs (ImplicitConversionRequired): Simplified.
3050 * cs-parser.jay: Create EnumMember directly.
3052 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
3054 * doc.cs (GenerateEnumDocComment): Removed.
3056 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
3057 (ConvertIntLiteral): Removed.
3058 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
3060 * enum.cs (EnumMember): Implement IConstant.
3061 (Enum.IsValidEnumConstant): Removed.
3062 (Enum.GetNextDefaultValue): Removed.
3063 (Enum.FindMembers): Updated.
3064 (Enum.GenerateDocComment): Iterate enum members.
3066 * expression.cs (Cast.TryReduce): Handle enums correctly.
3067 (New.Constantify): Made public.
3068 (MemberAccess.DoResolve): Removed contant specific if(s).
3070 * literal.cs (NullLiteral): Implement new abstract methods.
3072 * statement.cs (GotoCase.Resolve): Use new constant methods.
3073 (SwitchLabel.ResolveAndReduce): Use new constant methods.
3075 * typemanager.cs (LookupEnum): Removed.
3076 (IsEnumType): Fixed to work with corlib.
3077 (RegisterConstant): Removed.
3078 (LookupConstant): Removed.
3079 (GetConstant): Changed to work with IConstant.
3081 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
3083 * location.cs : Fixed overflown (>255) column number.
3085 2005-08-03 Raja R Harinath <rharinath@novell.com>
3087 First cut of the qualified-alias-member feature.
3088 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
3090 * cs-parser.jay (DOUBLE_COLON): New token.
3091 (namespace_or_type_name): Add rule for recognizing
3092 qualified-alias-members.
3093 (primary_expression): Likewise.
3094 (element_access): Allow QualifiedAliasMember as a possible
3095 type-bearing expression.
3096 (local_variable_type, local_variable_pointer_type): Likewise.
3097 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
3098 aliases in the current and enclosing namespace declarations.
3099 (NamespaceEntry.UsingAlias): Add CS0440 warning.
3100 * decl.cs (MemberName.is_double_colon): New.
3101 (MemberName.MemberName): Add new constructor for alias-member.
3102 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
3103 * expression.cs (QualifiedAliasMember): New expression type.
3105 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3107 * location.cs : it borked when no argument was specified.
3109 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3111 * location.cs : tiny ToString() format fix.
3113 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3115 * statement.cs : oops, it was missing.
3117 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3119 A set of fixes for precise line/column location.
3122 "token" field now holds a file/line "delta", a line number offset
3123 from the segment, and a column number. See also:
3124 http://lists.ximian.com/pipermail/mono-devel-list/2004-
3125 December/009508.html
3126 Removed static IsNull. Use instance IsNull property instead.
3128 For some tokens it stores Location. For Identifier it stores
3129 LocatedToken which is a pair of string name and location.
3130 Column numbers are adjusted only at getChar().
3132 Use Location.ToString() for reporting (it now contains column).
3134 Largely modified to use LocatedToken instead of
3135 string (IDENTIFIER), and to acquire Location from some tokens.
3136 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
3137 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
3139 Now MemberName holds Location. DeclSpace.ctor() receives Location
3140 as a parameter. Removed extra parameters to all derived classes.
3141 Replaced Location.IsNull() with instance property.
3142 * assign.cs, expression.cs :
3143 Added .ctor() overload that omits Location.
3145 Added "nameEscaped" flag that indicates the identifier was escaped
3146 in the source file. This fixes bug #57047.
3148 2005-09-02 Martin Baulig <martin@ximian.com>
3150 * class.cs: Make CS3005 a warning, not an error.
3152 2005-08-02 Marek Safar <marek.safar@seznam.cz>
3154 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
3155 New method, looking for lo-case imported cls type.
3157 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
3160 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
3162 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
3164 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
3166 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
3168 Optimized to save 3.5 MB for SWF compilation.
3170 2005-08-01 Marek Safar <marek.safar@seznam.cz>
3172 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
3173 (PartialContainer.Create): Moved logic AddToContainer.
3174 (PartialContainer.MarkForDuplicationCheck): Shares name.
3176 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
3179 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3181 (Namespace.GetSignatureForError): New method.
3183 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3184 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3186 2005-08-01 Raja R Harinath <rharinath@novell.com>
3189 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3190 member lookup rather than qualifier_type, since qualifier_type can
3193 2005-08-01 Marek Safar <marek.safar@seznam.cz>
3195 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3198 2005-07-31 Miguel de Icaza <miguel@novell.com>
3200 * statement.cs: Copy the local exception into the exception
3201 captured local. Fixes 75674
3203 2005-07-31 Raja R Harinath <harinath@gmail.com>
3206 * expression.cs (Invocation.OverloadResolve): Don't report error
3207 CS1501 if error CS1502 has been reported.
3208 (New.DoResolve): Delegate CS1501 reporting to
3209 Invocation.OverloadResolve.
3212 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3213 invariant-meaning-in-block property in an enclosing block if
3216 2005-07-29 Marek Safar <marek.safar@seznam.cz>
3218 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3219 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3220 (Switch.CheckSwitch): Just save 50kb for SWF.
3222 2005-07-27 Martin Baulig <martin@ximian.com>
3224 * anonymous.cs (CaptureContext.AddField): Added
3225 `AnonymousContainer am' argument; compute its toplevel scope if
3226 it's not already computed. Fixes #75649.
3228 2005-07-26 Raja R Harinath <rharinath@novell.com>
3231 * class.cs (Constructor.Emit): Reset block to null if the block
3234 2005-07-25 Marek Safar <marek.safar@seznam.cz>
3236 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3238 2005-07-25 Marek Safar <marek.safar@seznam.cz>
3240 * class.cs (MethodData.Define): Check whether accessor implementing
3241 interface is public.
3243 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3245 2005-07-22 Marek Safar <marek.safar@seznam.cz>
3248 * namespace.cs (LookupType): Moved same type check to...
3250 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3253 2005-07-21 Raja R Harinath <rharinath@novell.com>
3255 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3256 already found a typebuilder.
3257 * class.cs (MethodCore.IsDuplicateImplementation): Compare
3258 MemberNames, not strings.
3260 * const.cs (Error_ExpressionMustBeConst):
3261 Rename from Error_EpressionMustBeConst.
3262 * const.cs, class.cs, statement.cd: Update.
3264 2005-07-21 Marek Safar <marek.safar@seznam.cz>
3268 * const.cs (Const.LookupConstantValue): Report missing contant expression
3270 (Error_EpressionMustBeConstant): Only one error method.
3272 * class.cs, statement.c: Updated.
3274 2005-07-20 Raja R Harinath <rharinath@novell.com>
3276 * statement.cs (Block.Flags): Add back HasVarargs.
3277 (Block.flags): Make protected.
3278 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3280 * typemanager.cs (types, typecontainers, user_types): Remove.
3281 (UserTypes, TypeContainers): Likewise.
3282 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3283 (CleanUp, Reset): Update.
3284 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
3285 (GetNestedType): Use Type.GetNestedType.
3286 (CoreLookupType): Take two arguments, the namespace and the
3287 basename of the type. Update to use the Namespace.Lookup
3289 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3290 (RealMemberLookup): Use IsNestedChildOf instead of playing with
3291 string concatenation and substring matches.
3292 * class.cs, enum.cs, delegate.cs: Update to changes.
3294 2005-07-20 Marek Safar <marek.safar@seznam.cz>
3296 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3297 Expression and made virtual.
3299 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3300 (ImplicitStandardConversionExists): Fixed `byte' typo ?
3302 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3304 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3307 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3310 2005-07-18 Marek Safar <marek.safar@seznam.cz>
3313 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3314 AssemblyCultureAttribute is not used on executable.
3317 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3319 2005-07-16 Raja R Harinath <rharinath@novell.com>
3322 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3323 New. Reports CS0252/CS0253.
3324 Mostly taken from preliminary patch by Duncak Mak.
3325 (Binary.DoResolveOperator): Store results of operator lookup.
3326 Use them to detect if we need to warn about unintended reference
3329 2005-07-15 Raja R Harinath <rharinath@novell.com>
3332 * namespace.cs (Namespace.Lookup): Add back location parameter.
3333 (Namespace.LookupType): Add CS0436 report. Add location parameter.
3334 * delegate.cs, ecore.cs, expression.cs: Update to changes.
3336 * codegen.cs (EmitContext.DeclSpace): Make readonly.
3337 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3338 (Namespace.LookupType): ... this.
3339 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3341 * typemanager.cs (LookupTypeReflection): Remove buggy code that
3342 purported to handle pointers.
3343 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3346 2005-07-15 Marek Safar <marek.safar@seznam.cz>
3348 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3351 2005-07-15 Raja R Harinath <rharinath@novell.com>
3353 * namespace.cs (Namespace.Lookup): Drop location parameter.
3354 (NamespaceEntry.LookupAlias): Remove. Merge into ...
3355 (NamespaceEntry.Lookup): ... this.
3356 (NamespaceEntry.Error_AmbiguousTypeReference):
3357 Move here from DeclSpace.
3358 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3360 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3361 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3362 Move to NamespaceEntry.
3363 * delegate.cs, expression.cs: Update to changes.
3365 2005-08-31 Martin Baulig <martin@ximian.com>
3367 Committing a patch from Atsushi Enomoto for #75850.
3369 * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
3370 Prefer a generic enumerator over a non-generic one.
3372 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
3374 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3375 * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3377 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3379 * driver.cs : reverting default encoding change as well as mcs.
3381 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3383 * driver.cs, support.cs : merged r48826.
3385 > could you integrate your mcs changes to gmcs otherwise
3386 > gmcs cannot compile some files.
3388 2005-08-20 Martin Baulig <martin@ximian.com>
3390 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3391 scope if we don't already have it.
3393 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
3394 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
3397 2005-07-31 Miguel de Icaza <miguel@novell.com>
3399 * statement.cs: Copy the local exception into the exception
3400 captured local. Fixes 75674
3402 2005-07-15 Marek Safar <marek.safar@seznam.cz>
3404 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3407 2005-08-12 Martin Baulig <martin@ximian.com>
3409 * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
3410 for nested types here to avoid hitting the cache too early.
3412 2005-08-09 Miguel de Icaza <miguel@novell.com>
3414 * enum.cs: On the new compiler CLS error 3005 is now a warning not
3417 2005-08-03 Martin Baulig <martin@ximian.com>
3419 Make iterators in generic methods work; see gtest-191.cs.
3422 (Constraints.Resolve): Protect against being called twice.
3425 (TypeContainer.GetClassBases): Make this `protected virtual'.
3427 * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
3428 (Iterator.GetClassBases): Override this and compute the base
3430 (Iterator.DefineNestedTypes): If we're a generic method, all our
3431 method type parameters become class type parameters on the proxy
3435 (ToplevelBlock.Parameters): Make this a property, not a field.
3436 (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
3438 2005-08-03 Martin Baulig <martin@ximian.com>
3440 * typemanager.cs (TypeManager.IsSubclassOf): Use
3441 `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
3442 (TypeManager.GetFullName_recursed): Improved.
3444 2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3447 * ecore.cs (Expression.IsAccessorAccessible): Change the check for
3448 Private accessor case, using TypeManager.IsPrivateAccessible instead of
3449 invocation_type == mi.DeclaringType, since the first one also checks
3450 other condition used by generic instances.
3452 2005-07-27 Martin Baulig <martin@ximian.com>
3454 * anonymous.cs (CaptureContext.AddField): Added
3455 `AnonymousContainer am' argument; compute its toplevel scope if
3456 it's not already computed. Fixes #75649.
3458 2005-07-14 Marek Safar <marek.safar@seznam.cz>
3460 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3461 CheckAttributeType and refactored.
3462 (Attribute.ResolvePossibleAttributeType): Changed to reuse
3463 ResolveAsTypeTerminal error handling.
3464 (ResolveAsTypeTerminal): Introduced because of global attributes extra
3466 (GetSignatureForError): Print errors in same way.
3469 * codegen.cs: Reflect attribute GetSignatureForError change.
3472 * expression.cs: Add silent parameter to ResolveAsTypeStep.
3474 * namespace.cs (UsingEntry): Refactored to make fields private.
3477 statement.cs: Error_UnexpectedKind has extra parameter.
3479 2005-07-14 Raja R Harinath <rharinath@novell.com>
3481 * ecore.cs (IAlias): Remove.
3482 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
3483 that implement the interface.
3484 * namespace.cs (Namespace): Likewise.
3485 (Namespace.declspaces): Renamed from 'defined_names'.
3486 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
3487 DeclSpace instead of an IAlias.
3488 * tree.cs (Tree.AddDecl): Update.
3490 2005-07-12 Raja R Harinath <rharinath@novell.com>
3492 * statement.cs (Block.Flags); Remove HasVarargs.
3493 (Block.HasVarargs): Move to ToplevelBlock.
3494 (Block.ThisVariable, Block.AddThisVariable): Likewise.
3495 (Block.Variables): Make protected. Initialize variable hashtable
3497 (Block.AddVariable): Update.
3498 (Block.Resolve): Update to changes.
3499 (ToplevelBlock.HasVarargs): New boolean.
3500 (ToplevelBlock.ThisVariable): Move here from Block.
3501 (ToplevelBlock.AddThisVariable): Likewise.
3502 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
3503 * expression.cs (This.ResolveBase): Update to changes.
3504 (ArglistAccess.DoResolve): Likewise.
3506 2005-07-11 Marek Safar <marek.safar@seznam.cz>
3509 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3511 * class.cs (TypeContainer.VerifyMembers): Distinguish between
3512 not used and not used & assigned.
3513 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3515 2005-07-11 Marek Safar <marek.safar@seznam.cz>
3518 * expression.cs (Is.DoResolve): null is never provided type.
3520 2005-07-08 Marek Safar <marek.safar@seznam.cz>
3523 * cs-parser.jay: Less strict event error rule to catch more errors.
3525 2005-07-11 Martin Baulig <martin@ximian.com>
3527 * generic.cs (ConstructedType.CheckConstraints): Improve the check
3528 for the constructor constraint: we do not only have to check
3529 whether the class has a public constructor, but also ensure that
3530 it's parameterless. Fixes #75492.
3532 2005-07-11 Martin Baulig <martin@ximian.com>
3534 * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
3535 between type parameters if they either have the reference type
3536 constraint or the class constraint.
3538 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
3540 * generic.cs: Use MakeGenericType instead of BindGenericParameters.
3542 2005-07-07 Marek Safar <marek.safar@seznam.cz>
3545 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3546 (ExtractSecurityPermissionSet): Cope with self referencing security
3547 attributes properly.
3549 * driver.cs (SetOutputFile): Made public property OutputFile.
3551 2005-07-07 Raja R Harinath <rharinath@novell.com>
3554 * class.cs (TypeContainer.first_nonstatic_field): Rename from
3555 has_nonstatic_fields. Make into a FieldBase pointer.
3556 (TypeContainer.AddField): Add CS0282 check.
3557 (TypeContainer.EmitType): Update.
3559 2005-07-06 Miguel de Icaza <miguel@novell.com>
3561 * cs-tokenizer.cs (consume_identifier): Do not create strings to
3562 compare if they start with __.
3564 2005-07-06 Raja R Harinath <rharinath@novell.com>
3566 * statement.cs (Switch.SwitchGoverningType): Only look at
3567 UserCasts that don't need implicit standard conversions to one of
3568 the allowed switch types (Fixes test-322.cs).
3569 (LocalInfo.Resolve): Re-enable sanity-test.
3571 2005-07-06 Marek Safar <marek.safar@seznam.cz>
3573 * cs-tokenizer.cs (consume_identifier): Detect double undescores
3575 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3577 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3579 2005-07-06 Raja R Harinath <rharinath@novell.com>
3582 * ecore.cs (SimpleName.GetSignatureForError): Add.
3583 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3584 (MemberAccess.GetSignatureForError): Add.
3586 2005-07-05 Marek Safar <marek.safar@seznam.cz>
3588 The big error and warning messages review.
3618 * typemanager.cs: Updated.
3620 * class.cs: (MethodCore.SetYields): Moved here to share.
3621 (PropertyMethod.Define): Moved iterator setup here.
3623 * iterators.cs: Add orig_method to have full access to parent
3626 2005-07-05 Raja R Harinath <rharinath@novell.com>
3628 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3629 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3630 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3631 variable of struct type.
3632 * expression.cs (Unary.ResolveOperator): Update to change.
3633 (Indirection.VerifyFixed): Likewise.
3634 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3635 (ParameterReference.VerifyFixed): Value parameters are fixed.
3636 (This.VerifyFixed): Treat 'this' as a value parameter.
3637 * statement.cs (LocalInfo.IsFixed): Remove.
3639 2005-07-01 Martin Baulig <martin@ximian.com>
3641 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3642 `ec.EmitThis ()' to get the correct scope.
3644 2005-07-01 Martin Baulig <martin@ximian.com>
3646 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3647 instance is a ParameterReference; fixes #75299.
3649 2005-06-30 Raja R Harinath <rharinath@novell.com>
3652 * expression.cs (Indexers.map): Remove.
3653 (Indexers.Append): Filter out inaccessible setters and getters.
3654 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3657 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
3659 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3660 (FieldExpr.Emit, PropertyExpr.Emit): Update.
3661 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3662 * expression.cs (Invocation.EmitCall): Add CS0120 check.
3664 2005-06-30 Marek Safar <marek.safar@seznam.cz>
3667 * class.cs (FieldBase.GetInitializerExpression): One more field
3670 2005-06-28 Miguel de Icaza <miguel@novell.com>
3672 * pending.cs: Do not define a proxy if the base method is virtual,
3673 it will be picked up by the runtime (bug 75270).
3675 2005-07-08 Martin Baulig <martin@ximian.com>
3677 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3678 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3680 2005-07-07 Martin Baulig <martin@ximian.com>
3682 * generic.cs (ConstructedType.CheckConstraint): Use
3683 ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
3684 called recursively; fixes #75329.
3686 2005-07-06 Martin Baulig <martin@ximian.com>
3688 * generic.cs (TypeManager.InferTypeArguments): Added support for
3689 anonymous methods; fixes #75461.
3691 2005-07-01 Martin Baulig <martin@ximian.com>
3693 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3694 `ec.EmitThis ()' to get the correct scope.
3696 2005-07-01 Martin Baulig <martin@ximian.com>
3698 * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
3699 instance is `This'; fixes #75299.
3701 2005-06-30 Martin Baulig <martin@ximian.com>
3703 * class.cs (Indexer): Implement IIteratorContainer; added support
3704 for iterators in indexers.
3707 (EmitContext.CurrentIterator): Make this a property, not a field.
3709 * anonymous.cs (AnonymousContainer.Iterator): New public property.
3711 2005-06-28 Miguel de Icaza <miguel@novell.com>
3713 * pending.cs: Do not define a proxy if the base method is virtual,
3714 it will be picked up by the runtime (bug 75270).
3716 2005-06-28 Martin Baulig <martin@ximian.com>
3718 * cs-parser.jay (interface_method_declaration): Avoid a
3719 reduce/reduce conflict by moving some of the code into a separate
3720 `interface_method_declaration_body' rule; fixes #75368.
3722 2005-06-28 Martin Baulig <martin@ximian.com>
3724 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
3725 array check after the check for TypeBuilder's.
3727 2005-06-21 Raja R Harinath <rharinath@novell.com>
3729 * convert.cs (FindMostEncompassedType): Add two trivial special
3730 cases (number_of_types == 0 || number_of_types == 1).
3731 (FindMostEncompasingType): Likewise.
3733 2005-06-17 Raja R Harinath <rharinath@novell.com>
3735 Some cleanups preparing for the fix of #75283.
3736 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3738 (EventExpr.InstanceResolve): Likewise.
3739 (EventExpr.DoResolve): Remove redundant checks.
3741 2005-06-08 Miguel de Icaza <miguel@novell.com>
3743 * class.cs: Small fix.
3745 2005-06-08 Raja R Harinath <rharinath@novell.com>
3748 * class.cs (GetPartialBases): Fix return value check of
3751 2005-06-07 Raja R Harinath <rharinath@novell.com>
3753 Ensure that partial classes are registered in their enclosing
3754 namespace. Initial part of fix of #75160.
3755 * tree.cs (Tree.RecordDecl): Add new namespace argument.
3756 Register declspace with namespace here, not in
3757 DeclSpace.RecordDecl.
3758 * cs-parser.jay: Pass namespace to RecordDecl.
3759 * class.cs (PartialContainer.Create): Likewise.
3760 (ClassPart.DefineType): New sanity-check. Throws an exception if
3762 * decl.cs (Declspace.RecordDecl): Remove.
3763 * namespace.cs (NamespaceEntry.DefineName): Remove.
3765 2005-06-06 Marek Safar <marek.safar@seznam.cz>
3767 * rootcontext.cs: Reset TargetExt as well.
3769 2005-06-03 Raja R Harinath <rharinath@novell.com>
3771 * ecore.cs (Expression.Resolve): Emit CS0654 error when
3774 2005-06-02 Raja R Harinath <rharinath@novell.com>
3776 Fix #75080, cs0119.cs.
3777 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
3779 (Expression.Resolve): ... this. Use it. Remove bogus code
3780 allowing ExprClass.Type and ExprClass.Namespace for
3781 ResolveFlags.VariableOrValue.
3782 (Expression.Resolve) [1-argument variant]: Change default resolve
3783 flags based on language version.
3784 (Expression.Error_UnexpectedKind): Use a simple string array
3785 rather than an ArrayList.
3786 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3788 (TypeOfVoid.DoResolve): Likewise.
3789 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
3790 flags argument -- it always has the same value.
3792 2005-05-31 Raja R Harinath <rharinath@novell.com>
3795 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3796 Use it in the error message.
3797 * assign.cs, expression.cs, statement.cs: Update.
3799 2005-05-30 Raja R Harinath <rharinath@novell.com>
3802 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3803 the "almostMatchedMember" case too.
3804 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3805 that failed the accessibility checks to 'almost_match'.
3807 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
3809 * attribute.cs: Use internal MethodBuilder methods to set
3810 ExactSpelling and SetLastError on PInvoke methods, instead
3811 of passing them via charset. Fixes #75060.
3813 2005-05-27 Raja R Harinath <rharinath@novell.com>
3815 * parameter.cs (Parameter): Remove TODO comment.
3816 (Parameter.DefineParameter): Remove Location parameter.
3817 (Parameters.LabelParameters): Likewise.
3818 * class.cs (Constructor.Emit): Update to change.
3819 (MethodData.Emit): Likewise.
3820 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
3821 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3823 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
3826 Removed Parameters.Location and added Parameter.Location instead.
3827 Removed Location parameter from Emit() and GetSignature().
3834 Modified all related calls.
3836 2005-06-21 Martin Baulig <martin@ximian.com>
3838 * generic.cs (NullCoalescingOperator.Emit): Make this work if the
3839 left-hand side is not a nullable type; fixes #75328.
3841 2005-06-21 Martin Baulig <martin@ximian.com>
3844 (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
3845 (TypeManager.GetFullNameSignature): Likewise.
3847 * convert.cs (Convert.Error_CannotImplicitConversion): Compare
3848 `source.FullName' and `target.FullName' to check whether there are
3849 two conflicting definitions.
3851 2005-06-21 Martin Baulig <martin@ximian.com>
3853 * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
3854 a BoxedCast - also for reference types - to be compatible with csc.
3856 2005-06-21 Martin Baulig <martin@ximian.com>
3858 * expression.cs (MemberAccess.DoResolve): Add support for nested
3859 types in a generic instance; fixes #75320.
3861 2005-06-20 Martin Baulig <martin@ximian.com>
3863 * generic.cs (TypeManager.InferType): Also walk the class
3864 hierarchy for generic instances; fixes #75261.
3866 2005-06-17 Martin Baulig <martin@ximian.com>
3868 * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
3869 to make things work for corlib.
3871 2005-06-15 Martin Baulig <martin@ximian.com>
3873 * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
3874 obsolete `SecurityAction' values.
3876 2005-06-06 Marek Safar <marek.safar@seznam.cz>
3878 * rootcontext.cs: Reset TargetExt as well.
3880 2005-06-09 Martin Baulig <martin@ximian.com>
3882 * delegate.cs (Delegate.VerifyMethod): Added
3883 `MethodGroupExpr old_mg' argument; inherit its
3884 `HasTypeParameters'; fix #75085.
3886 2005-06-09 Martin Baulig <martin@ximian.com>
3888 * expression.cs (Invocation.OverloadResolve): Correctly handle
3889 generic methods for the SetMemberIsUsed(); fix #75064.
3891 2005-06-09 Martin Baulig <martin@ximian.com>
3893 * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
3896 2005-06-08 Martin Baulig <martin@ximian.com>
3898 * cs-parser.jay (nullable_type_or_conditional): If we put the
3899 nullable back and our `type' is a `ComposedCast', remove the
3900 nullable from it. Fixes #75156.
3902 * expression.cs (ComposedCast.RemoveNullable): New public method.
3904 2005-06-08 Martin Baulig <martin@ximian.com>
3906 The big Iterators rewrite :-)
3908 * iterators.cs: Rewrite this to use the anonymous methods framework.
3910 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3911 before the TypeContainers; see 2test-21.cs.
3914 (TypeContainer.DefineType): Don't create a new EmitContext if we
3915 already have one (this only happens if we're an Iterator).
3916 (TypeContainer.Define): Also call Define() on all our iterators.
3917 (Method.CreateEmitContext): Added support for iterators.
3920 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3921 (AnonymousContainer.CreateMethodHost): Moved here from
3922 AnonymousMethod and made abstract.
3923 (AnonymousContainer.CreateScopeType): New abstract method.
3924 (AnonymousContainer.IsIterator): New public property.
3925 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3926 get the ScopeTypeBuilder rather than manually defining it here.
3927 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3930 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3931 before RootContext.DefineTypes().
3933 * codegen.cs (EmitContext.RemapToProxy): Removed.
3934 (EmitContext.CurrentAnonymousMethod): Changed type from
3935 AnonymousMethod -> AnonymousContainer.
3936 (EmitContext.ResolveTopBlock): Protect from being called twice.
3937 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3938 (EmitContext.EmitThis): Removed the iterators hacks; use the
3939 anonymous methods framework for that.
3942 (ToplevelBlock.Container): Make this a property, not a field.
3943 (ToplevelBlock.ReParent): New public method; move the
3944 ToplevelBlock into a new container.
3945 (Foreach.TemporaryVariable): Simplify.
3947 2005-06-05 Martin Baulig <martin@ximian.com>
3949 * statement.cs (LocalInfo.CompilerGenerated): New flag.
3950 (Block.AddTemporaryVariable): New public method; creates a new
3951 `LocalInfo' for a temporary variable.
3952 (Block.EmitMeta): Create the LocalBuilders for all the temporary
3954 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3955 non-iterator variables.
3957 2005-06-05 Martin Baulig <martin@ximian.com>
3959 * statement.cs (Foreach.TemporaryVariable): Create the
3960 LocalBuilder in the Emit phase and not in Resolve since in some
3961 situations, we don't have an ILGenerator during Resolve; see
3962 2test-19.cs for an example.
3964 2005-06-04 Martin Baulig <martin@ximian.com>
3966 The big Foreach rewrite - Part II.
3968 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3969 with `PropertyInfo ienumerator_getcurrent'.
3971 * codegen.cs (VariableStorage): Removed.
3974 (Foreach): Derive from Statement, not ExceptionStatement.
3975 (Foreach.CollectionForeach): New nested class. Moved all the code
3976 dealing with collection foreach here.
3977 (Foreach.ForeachHelperMethods): Removed.
3978 (Foreach.TemporaryVariable): Implement IMemoryLocation.
3980 2005-05-23 Martin Baulig <martin@ximian.com>
3982 * statement.cs (Try.DoResolve): Don't create a `finally' if we
3983 don't need to. Fix #75014.
3985 2005-05-26 Raja R Harinath <rharinath@novell.com>
3987 Improve user-defined conversion handling.
3988 * convert.cs (GetConversionOperators): Rewrite. Return only the
3989 applicable operators.
3990 (AddConversionOperators): New. Helper for GetConversionOperators.
3991 (FindMostEncompassedType, FindMostEncompassingType): Verify that
3992 there is only one most encompassed/encompassing type.
3993 (FindMostSpecificSource, FindMostSpecificTarget): Remove
3994 "applicable operator" handling.
3995 (UserConversion): Move cache here from GetConversionOperators.
3996 Directly cache the chosen operator, rather than the whole
3998 (ExplicitNumericConversion): Fix buggy implementation of Decimal
3999 case. Allow conversion of decimal to sbyte and byte too.
4000 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4001 New static methods. Used to avoid allocating EmptyExpressions in
4004 2005-05-24 Duncan Mak <duncan@novell.com>
4006 * ecore.cs (CastFromDecimal): New class for casting a decimal to
4007 another class, used in Convert.ExplicitNumericConversion.
4008 (CastToDecimal): New class, similar to above, but casts to
4009 System.Decimal, used in Convert.ImplicitNumericConversion and also
4010 in explicit convesion from double/float to decimal.
4012 * convert.cs (ImplicitNumericConversion): Handle implicit
4013 conversions to System.Decimal.
4014 (ExplicitNumericConversion): handle explicit conversions to
4019 2005-05-20 Miguel de Icaza <miguel@novell.com>
4021 * typemanager.cs: Do not throw an exception in the TypeBuilder
4022 case, we take care of it on the TypeCode.
4024 2005-05-17 Marek Safar <marek.safar@seznam.cz>
4026 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
4029 * cs-parser.jay: Catch more lexical errors.
4031 * report.cs: Add one more Error method.
4034 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
4036 2005-05-20 Martin Baulig <martin@ximian.com>
4038 * class.cs (TypeContainer.CircularDepException): Removed.
4039 (TypeContainer.DefineType): Removed the `InTransit' stuff.
4040 (TypeContainer.CheckRecursiveDefinition): Check for circular class
4041 (CS0146) and interface (CS0529) dependencies here.
4043 2005-05-20 Martin Baulig <martin@ximian.com>
4045 * expression.cs (New.DoResolve): Move the CS0712 check above the
4046 CS0144 check; otherwise it can never be reached.
4048 2005-05-20 Martin Baulig <martin@ximian.com>
4050 * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
4052 2005-05-20 Martin Baulig <martin@ximian.com>
4054 * class.cs (TypeContainer.DefineType): Fix CS0698 check.
4056 * typemanager.cs (TypeManager.IsAttributeType): New public method.
4058 2005-05-19 Martin Baulig <martin@ximian.com>
4061 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
4062 to disable error reporting.
4064 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
4065 here since we don't want to report an error; see the new test-336.cs.
4067 2005-05-19 Raja R Harinath <rharinath@novell.com>
4069 * statement.cs (ToplevelBlock.GetParameterReference)
4070 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
4071 Move here from class Block.
4072 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
4073 * expression.cs (ParameterReference.DoResolveBase): Likewise.
4075 2005-05-18 Martin Baulig <martin@ximian.com>
4080 (FlowBranching.Reachability): Add non-static public And() and Or()
4082 (FlowBranchingSwitch): New class; do the `break_origins' thing
4083 like in FlowBranchingLoop.
4084 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
4085 reachability, not just locals and parameters.
4086 (FlowBranching.MergeChild): Remove some of the hacks for loop and
4087 switch; MergeBreakOrigins() now takes care of that.
4089 2005-05-18 Martin Baulig <martin@ximian.com>
4091 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4092 a loop and may leave it, reset the barrier; fixes #74974.
4094 2005-05-16 Raja R Harinath <rharinath@novell.com>
4096 Fix test-382.cs. Emit values of decimal constants.
4097 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
4099 (TypeContainer.AddField): ... this.
4100 (TypeContainer.EmitFieldInitializers): Allow the list of fields
4101 with initializers to include 'Const's.
4102 (ClassPart.RegisterFieldForInitialization): Forward to
4104 * const.cs (Const.Const): Pass initializer to base class.
4105 (Const.Define): In case of decimal constants, register them for
4106 initialization in a static constructor.
4108 2005-05-14 Martin Baulig <martin@ximian.com>
4110 * statement.cs (Block.Resolve): Correctly handle unreachable code;
4111 do not call ResolveUnreachable() on unreachable statements in
4112 here, see the comment in the source code.
4114 2005-05-13 Raja R Harinath <rharinath@novell.com>
4117 * expression.cs (BinaryResolveOperator): If one of the operands of
4118 an equality comparison is 'null' and the other is a pointer type,
4119 convert the null to a NullPointer.
4120 * convert.cs (ImplicitReferenceConversion): If the expression is a
4121 NullLiteral and the target type is a pointer type, return a
4122 NullPointer instead.
4123 (ImplicitConversionStandard): Likewise.
4125 2005-05-13 Marek Safar <marek.safar@seznam.cz>
4127 * cs-parser.jay: Set readonly context based on special constructs.
4129 * expression.cs (LocalVariableReference.DoResolveBase): Improved
4130 readonly variable error handling.
4132 * rootcontext.cs (EmitCode): Don't verify members when error
4135 * statement.cs (LocalInfo): Add reaodnly context information.
4136 (SetReadOnlyContext, GetReadOnlyContext): New methods.
4138 2005-05-17 Martin Baulig <martin@ximian.com>
4140 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
4143 2005-05-13 Martin Baulig <martin@ximian.com>
4145 * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
4146 handle unreachable blocks.
4148 2005-05-13 Martin Baulig <martin@ximian.com>
4151 (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
4152 (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
4155 2005-05-13 Martin Baulig <martin@ximian.com>
4157 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
4158 instance variable, not a local. Fix #74873.
4159 (Block.ResolveUnreachable): Set it to true here.
4161 2005-05-12 Martin Baulig <martin@ximian.com>
4163 * cs-parser.jay (property_declaration): Pass the `current_class',
4164 not the `current_container' to Property's .ctor. Fixes #74912.
4166 2005-05-11 Martin Baulig <martin@ximian.com>
4168 * typemanager.cs (Closure): Copy this from MCS and merge all the
4169 GMCS-specific changes into it.
4171 2005-05-12 Raja R Harinath <harinath@gmail.com>
4174 * typemanager.cs (unmanaged_enclosing_types): New.
4175 (IsUnmanagedType): Avoid infloops by using
4176 'unmanaged_enclosing_types' to talk with recursive invocations.
4178 2005-05-11 Duncan Mak <duncan@novell.com>
4180 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
4181 continuing to process for 'arg'.
4182 (handle_preprocessing_directive): Check the argument of the #endif
4183 directive and report error CS1025 if there are any trailing
4186 According to the C# spec, having even whitespace after the #endif
4187 directive is illegal; however, because we call arg.TrimEnd ()
4188 beforehand, we have the same behavior as csc, allowing whitespace
4189 after the directive.
4193 2005-05-11 Marek Safar <marek.safar@seznam.cz>
4197 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
4198 (Constructor.GetObsoleteAttribute): Implemented correctly.
4200 2005-05-10 Martin Baulig <martin@ximian.com>
4202 * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
4203 resolve the type; fixes #74864.
4204 (DefaultValueExpression): Create the LocalTemporary in Emit(), not
4205 in DoResolve(); fixes #74862.
4207 2005-05-10 Martin Baulig <martin@ximian.com>
4209 * support.cs (ReflectionParameters.ParameterModifier): Use
4210 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
4211 and `ParameterAttributes.In'. Fixes #74884.
4213 2005-05-10 Martin Baulig <martin@ximian.com>
4215 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
4216 the cache if we're just looking for `MemberTypes.NestedType' in a
4219 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
4220 constraints if we're still resolving the type tree.
4221 (Expression.MemberLookup): If we're resolving the type tree, only
4222 look for `MemberTypes.NestedType' since we're only interested in
4225 * class.cs (TypeContainer.DefineType): Don't resolve the type
4226 parameters here; do this later in ResolveType() after the type
4227 tree has been resolved.
4228 (TypeContainer.ResolveType): New public method; this is called
4229 after the type tree is resolved and before the types are being
4230 populated. We resolve the generic constraints here.
4231 (TypeContainer.DoDefineMember): Check the constraints on our base
4232 class and interfaces.
4234 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
4235 set the `ResolvingTypeTree' flag on the EmitContext.
4237 * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
4239 2005-05-10 Marek Safar <marek.safar@seznam.cz>
4241 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
4243 * expression.cs (Argument.GetParameterModifier): Turned to property.
4244 (Invocation.Error_InvalidArguments): Add more descriptive errors.
4246 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
4249 2005-05-09 Raja R Harinath <rharinath@novell.com>
4252 * decl.cs (MemberCache.AddMethods): Register override methods,
4253 rather than non-override methods.
4254 * typemanager.cs (RegisterOverride): New.
4255 (IsOverride): Update.
4257 2005-05-09 Marek Safar <marek.safar@seznam.cz>
4259 * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
4261 2005-05-06 Martin Baulig <martin@ximian.com>
4264 (Attributable.IsClsComplianceRequired): Fix typo in the method name.
4265 (AttributeTester.AnalyzeTypeCompliance): Add generics support.
4267 2005-05-09 Marek Safar <marek.safar@seznam.cz>
4271 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
4272 recursive declaration.
4274 * statement.cs (Block.ResolveMeta): Report any error in resolving.
4276 2005-05-06 Marek Safar <marek.safar@seznam.cz>
4278 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
4280 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
4282 2005-05-05 Raja R Harinath <rharinath@novell.com>
4285 * decl.cs (DeclSpace.FamilyAccessible):
4286 Use TypeManager.IsNestedFamilyAccessible.
4288 Fix reopened #64812.
4289 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
4292 2005-05-04 Raja R Harinath <rharinath@novell.com>
4293 Abin Thomas <projectmonokochi@rediffmail.com>
4294 Anoob V E <projectmonokochi@rediffmail.com>
4295 Harilal P R <projectmonokochi@rediffmail.com>
4298 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
4299 allow access to all static members.
4301 2005-05-04 Martin Baulig <martin@ximian.com>
4303 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
4305 2005-05-04 Martin Baulig <martin@ximian.com>
4309 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
4310 section at the end; make things work if `default' is not the last
4313 2005-05-04 Martin Baulig <martin@ximian.com>
4317 * statement.cs (Switch): Replaced the `got_default' field with a
4318 `default_section' one.
4319 (Switch.CheckSwitch): Set `default_section' here.
4320 (Switch.Resolve): If we're a constant switch and the constant is
4321 not found, use the default section.
4323 2005-05-03 Martin Baulig <martin@ximian.com>
4325 * expression.cs (ArrayAccess.EmitGetLength): New public method.
4327 * statement.cs (Foreach.ArrayForeach): New nested class.
4328 (Foreach.TemporaryVariable): New nested class.
4329 (Foreach.EmitArrayForeach): Removed; this is now in the new
4332 2005-05-03 Raja R Harinath <rharinath@novell.com>
4334 * pending.cs (BaseImplements): Move the #74773 fix here. This is
4336 (VerifyPendingMethods): Revert change below.
4338 * typemanager.cs (IsOverride, RegisterNonOverride): New.
4339 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
4340 that used to trigger warning -28. Remove warning -28.
4341 * expression.cs (Invocation.OverloadResolve): Use
4342 TypeManager.IsOverride to distinguish override methods.
4345 * pending.cs (VerifyPendingMethods): If a base type implements the
4346 requested interface, don't bother checking individual methods of
4347 the base type. As a side-effect, this prevents the creation of
4348 unnecessary proxies.
4350 2005-05-02 Martin Baulig <martin@ximian.com>
4354 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4355 Also `And' the locals if the old vector is null.
4356 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
4357 null; in this case we basically reset all the variables.
4359 2005-05-02 Martin Baulig <martin@ximian.com>
4363 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
4364 Added `FlowBranching branching' argument; always `and' the
4365 variables instead of `or'ing them unless we're an infinite loop.
4367 * statement.cs (While.Resolve): Create a new sibling unless we're
4370 2005-05-02 Martin Baulig <martin@ximian.com>
4374 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
4375 arguments; use it instead of creating a new TopLevelBlock.
4376 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
4377 our ConstructorInitializer.
4380 (TopLevelBlock.TopLevelBranching): New public property.
4381 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
4382 and create our `TopLevelBranching'.
4384 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
4385 anonymous method host, use `block.TopLevelBranching' rather than
4386 creating a new branching.
4388 2005-04-20 Miguel de Icaza <miguel@novell.com>
4390 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
4391 a ScopeInfo, if any of the current children is a child of the new
4392 entry, move those children there.
4394 2005-04-30 Martin Baulig <martin@ximian.com>
4396 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
4397 at the beginning of a SwitchSection. Fix #73335.
4399 2005-04-27 Marek Safar <marek.safar@seznam.cz>
4402 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
4404 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
4405 (FieldExpr.DoResolve): Obsolete members are ignored for field
4408 2005-04-26 Marek Safar <marek.safar@seznam.cz>
4410 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
4411 of arrays detection.
4413 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
4415 (Field.VerifyClsCompliance): Volatile fields are not compliant.
4417 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
4420 2005-04-25 Ben Maurer <bmaurer@ximian.com>
4422 * cs-parser.jay: Use the prefered version of -unsafe in error
4425 2005-04-22 Marek Safar <marek.safar@seznam.cz>
4427 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4430 2005-04-20 John Luke <john.luke@gmail.com>
4432 * driver.cs: fix typo in error message, --outout to --output
4434 2005-04-30 Martin Baulig <martin@ximian.com>
4436 * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
4437 handle the .NET 2.x security attributes.
4439 2005-04-30 Martin Baulig <martin@ximian.com>
4442 (TypeManager.ExpandInterfaces): Don't add things twice.
4445 (TypeContainer.VerifyClsCompliance): Allow generic instances.
4447 2005-04-29 Martin Baulig <martin@ximian.com>
4449 * generic.cs (Constraints.ResolveTypes): Expand interfaces.
4451 * anonymous.cs: Added support for anonymous generic methods.
4453 2005-04-29 Martin Baulig <martin@ximian.com>
4455 * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
4458 2005-04-29 Martin Baulig <martin@ximian.com>
4460 * generic.cs (TypeManager.HasConstructorConstraint): Removed.
4462 * expression.cs (New.DoResolve): Fix the CS0304 check.
4464 2005-04-29 Martin Baulig <martin@ximian.com>
4466 * typemanager.cs (TypeManager.GetFullName): Updated to the new
4469 * class.cs (MethodCore.IsDuplicateImplementation): If we're an
4470 explicit interface implementation, compare the interface types.
4471 (MethodData.Define): Use the new naming scheme from the latest
4473 (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
4475 * decl.cs (MemberName.GetMemberName): Removed.
4476 (MemberName.MethodName, FullName): New properties.
4478 2005-04-25 Raja R Harinath <rharinath@novell.com>
4480 * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
4482 2005-04-22 Martin Baulig <martin@ximian.com>
4484 * generic.cs (GenericMethod): Create the EmitContext in the
4485 `Define()'; in `Define(MethodBuilder)', create the type parameters
4486 before calling `Define()'. Fixes #73933.
4488 2005-04-22 Martin Baulig <martin@ximian.com>
4491 (Constraints.Resolve): Make things work wrt. the new type lookup system.
4492 (ConstructedType.ResolveAsTypeTerminal): Don't override this.
4494 * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
4495 ConstructedType, check its constraints.
4497 2005-04-20 Marek Safar <marek.safar@seznam.cz>
4499 * codegen.cs (InRefOutArgumentResolving): New field.
4501 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4502 fields outside contructor.
4504 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4506 2005-04-19 Miguel de Icaza <miguel@novell.com>
4508 * anonymous.cs (CaptureContext.EmitParameterInstance): The
4509 parameter code was not completed ever, so it was not as up-to-date
4510 as local variables. Must finish it.
4512 The bug fix was to compare the Toplevel of the block, not the
4513 current block. Thanks for Ben for pointing this out.
4515 2005-04-19 Raja R Harinath <rharinath@novell.com>
4517 * decl.cs (AddMethods): Use the declaring type of the problem
4518 method to determine if we want to squash a warning.
4520 2005-04-19 Marek Safar <marek.safar@seznam.cz>
4522 * attribute.cs: Removed debug output.
4524 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4526 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4529 2005-04-18 Raja R Harinath <rharinath@novell.com>
4532 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4533 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4534 all null comparisons against reference types.
4536 2005-04-18 Marek Safar <marek.safar@seznam.cz>
4539 * class.cs (TypeContainer.CircularDepException) New nested
4541 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4542 (TypeContainer.DefineType): Removed error, reset InTransit before
4544 (Class.DefineType): Throw exception when is in Transit.
4545 Catch exception and report error.
4546 (Struct.DefineType): Throw exception when is in Transit.
4547 Catch exception and report error.
4548 (Interface.DefineType): Throw exception when is in Transit.
4549 Catch exception and report error.
4551 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4552 handle nested exception handlers.
4554 * flowanalysis.cs (InTryWithCatch): New method, search for try with
4557 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4558 InFinally and InCatch storage.
4560 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4561 (Catch.Resolve): Set and Restore ec.InCatch.
4562 (Try.Resolve): Set and Restore ec.InFinally.
4563 (Try.HasCatch): True when try has catch.
4565 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
4567 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4568 for the same event member, so exclude such cases from warning 419.
4571 2005-04-16 Miguel de Icaza <miguel@novell.com>
4573 * expression.cs (Binary.ResolveOperator): Apply patch from John
4574 Luke to fix bug 59864: operators &, | and ^ on enumerations
4575 require that the same enum type on both sides.
4577 * driver.cs: Add warnings to old flag usage, this is to assist
4578 people who produce Makefiles and hope that the Makefiles will be
4581 * class.cs (TypeContainer.EmitType): Moved the definition of the
4582 special $PRIVATE$ field from the resolve phase to the Emit phase.
4583 During resolve we do not know if we are a struct with
4584 HasExplicitLayout, we know this only after the attributes for the
4587 Set the FieldOffset to zero on the dummy field that we create for
4588 the class. Fixes 74590.
4590 2005-04-16 Raja R Harinath <rharinath@novell.com>
4593 * ecore.cs (PropertyExpr.resolved): New.
4594 (DoResolve): Use it to handle a case of double resolution here.
4595 Handle a case of identical-name-and-type-name.
4596 * expression.cs (ArrayCreation.CheckIndices): Avoid double
4597 resolution by storing the results of expression resolution back
4598 into the "probes" array.
4600 2005-04-15 Raja R Harinath <rharinath@novell.com>
4602 Fix cs0208-7.cs and cs0208-8.cs.
4603 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4604 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
4605 error reporting to point out the reason a struct is not unmanaged.
4607 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4609 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
4610 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4612 2005-04-13 Raja R Harinath <rharinath@novell.com>
4615 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4616 IdenticalNameAndTypeName here.
4617 (EventExpr.InstanceResolve): Likewise.
4619 2005-04-13 Marek Safar <marek.safar@seznam.cz>
4621 C# 2.0 DefaultCharSetAttribute implementation
4623 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4624 which allows us to set GlobalNamespace for every resolve.
4625 (Attribute.ResolveArguments): Cut from Resolve.
4626 (Attribute.GetCharSetValue): Returns CharSet named argument.
4627 (Attribute.DefinePInvokeMethod): Gets default charset from
4629 (GlobalAttribute.ResolveAsTypeStep): Override.
4630 (GlobalAttribute.ResolveArguments): Override.
4632 * class.cs (TypeAttr): Is protected.
4634 * codegen.cs (ModuleClass.DefaultCharSet): New member.
4635 (ModuleClass.DefaultCharSetType): New memeber.
4636 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4638 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4639 charset from module.
4641 * delegate.cs (TypeAttr): Override.
4642 (Delegate.DefineType): Use this TypeAttr.
4644 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4645 at very early stage (before types are defined) to resolve model
4646 module attributes. It will probably not work with corlib but it
4649 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4650 charset from module.
4652 * typemanager.cs (default_charset_type): New type.
4654 2005-04-13 Raja R Harinath <rharinath@novell.com>
4656 * decl.cs (MemberCache.AddMethods): Don't warn if
4657 System.Object.Finalize has buggy MethodAttributes.
4659 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4662 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4664 * doc.cs : detect ambiguous reference to overloaded members.
4665 Fixed bug #71603. MS 1.1 csc does not detect it.
4667 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4669 * doc.cs : delegates must not be referenced with parameters.
4672 2005-04-12 Miguel de Icaza <miguel@novell.com>
4674 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4676 2005-04-10 Miguel de Icaza <miguel@novell.com>
4678 * driver.cs (MainDriver): Stop processing if the CLS stage found
4681 (CompilerCallableEntryPoint.InvokeCompiler): Always
4682 reset after execution; Take a TextWriter argument for the
4685 * report.cs: Use the error stream instead of hardcoding stderr.
4687 2005-04-09 Miguel de Icaza <miguel@novell.com>
4689 * class.cs: Reduce code paths to test, too small of an
4690 optimization to make it worth the extra testing. Always perform
4693 2005-04-08 Raja R Harinath <rharinath@novell.com>
4696 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4697 operators that had errors reported on them.
4699 2005-04-08 Marek Safar <marek.safar@seznam.cz>
4701 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4703 (Attribute.Resolve): Add named argument type checking.
4705 * class.cs (FixedField.Define): Use IsPrimitiveType
4707 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4709 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4710 unsafe parameter types.
4712 * statement.cs (Using.ResolveExpression): Add better error description.
4714 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4716 2005-04-08 Raja R Harinath <rharinath@novell.com>
4719 * attribute.cs (Attribute.GetAttributeUsage): Resolve
4720 AttributeUsageAttribute in the emitcontext of the attribute class,
4721 not in the emitcontext of the attributable entity it was attached to.
4722 * cs-parser.jay: Use 'current_class', not 'current_container',
4723 when creating a GlobalAttribute.
4725 2005-04-08 Alp Toker <alp@atoker.com>
4727 * pending.cs: The fix to #58413 failed to compile methods implementing
4728 interfaces with/without params modifiers and vice versa, even though
4729 params modifiers aren't part of the signature. Make the modifier check
4730 less strict as in csc.
4732 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
4733 Anoob V E <projectmonokochi@rediffmail.com>
4734 Harilal P R <projectmonokochi@rediffmail.com>
4737 * pending.cs (TypeAndMethods.mods): New. Store the parameter
4738 modifiers of pending methods.
4739 (PendingImplementation.PendingImplementation): Initialize it.
4740 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4741 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4742 with ParameterData. Add check for modifiers.
4743 * class.cs (MethodData.Define): Update to changes.
4745 2005-04-07 Raja R Harinath <rharinath@novell.com>
4747 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4749 2005-04-07 Marek Safar <marek.safar@seznam.cz>
4751 * class.cs (PropertyMethod.Define): Check private accessor in abstract
4754 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4757 * typemanager.cs: Registered RequiredAttributeAttribute.
4759 2005-04-06 Marek Safar <marek.safar@seznam.cz>
4761 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4762 Warning CS0169 is back at level 3.
4763 (IMethodData.SetMemberIsUsed): New method.
4765 * decl.cs (IsUsed): New value; moved from FieldBase.Status
4766 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4768 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4770 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4772 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4775 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4778 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4779 to avoid the problems with nested types.
4781 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
4782 Anoob V.E <projectmonokochi@rediffmail.com>
4783 Harilal P.R <projectmonokochi@rediffmail.com>
4784 Raja R Harinath <rharinath@novell.com>
4787 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4789 * typemanager (GetConstructor): Make public.
4791 2005-04-05 John Luke <john.luke@gmail.com>
4792 Raja R Harinath <rharinath@novell.com>
4795 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4796 struct too. Return false quicker in a few cases.
4797 (VerifyUnManaged): Use it.
4799 2005-04-05 Raja R Harinath <rharinath@novell.com>
4802 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4803 not 'unreachable_seen'.
4805 2005-04-04 Marek Safar <marek.safar@seznam.cz>
4807 * attribute.cs (Attribute.GetValue): Removed unused.
4809 * codegen.cs (CodeGen.TrimExt): Removed unused.
4811 * cs-parser.jay (output): Removed unused.
4813 * cs-tokenizer.cs (hex_digits): Removed unused.
4815 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4817 * expression.cs (Indirection.LoadExprValue): Removed unused.
4818 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4820 * iterators.cs (Iterator.param_types): Removed unused.
4822 * statement.cs (Goto.block): Removed unused.
4823 (ToplevelBlock.did): Removed unused.
4824 (Switch.ResolveConstantSwitch): Removed unused.
4826 2005-04-01 Ben Maurer <bmaurer@ximian.com>
4828 * rootcontext.cs: Allow mcs to bootstrap with the compilation
4831 2005-04-19 Martin Baulig <martin@ximian.com>
4833 Merged r42462 from MCS and made it work for GMCS.
4835 * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
4837 * generic.cs (GenericMethod.Define): Removed `return_type' argument.
4839 2005-04-01 Raja R Harinath <rharinath@novell.com>
4841 Fix #74232 and cs0208-3.cs.
4842 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4843 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4844 unmanaged type. Don't use FieldBuilders when 't' is a
4845 TypeBuilder. Use ModFlags and MemberType fields.
4846 * class.cs (MemberBase.member_type): Rename from MemberType.
4847 (MemberBase.MemberType): New property. Determines member_type on
4849 (MemberBase.DoDefine): Don't initialize MemberType here.
4850 (FieldMember.Define): Likewise.
4852 2005-04-01 Marek Safar <marek.safar@seznam.cz>
4855 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4856 Attributes are emitted there.
4858 2005-04-01 Raja R Harinath <rharinath@novell.com>
4860 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4861 keyword in 'partial enum' too.
4862 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4864 Report from Kamil Skalski <nazgul@omega.pl>.
4867 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4868 have partial containers too.
4870 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4871 in block' checks to Block.CheckInvariantMeaningInBlock.
4872 * statement.cs (Block.GetKnownVariableInfo): Make private.
4873 (Block.IsVariableUsedInChildBlock): Remove.
4874 (Block.IsVariableUsedInBlock): Likewise.
4875 (Block.CheckInvariantMeaningInBlock): New. Show location of
4876 conflicting declaration.
4877 (Block.AddVariable): Make error messages less long-winded and more
4878 specific. Show location of conflicting declaration.
4879 * parameter.cs (Parameters.Location): New readonly property.
4881 2005-03-31 Raja R Harinath <rharinath@novell.com>
4883 Clean up semantics of invoking ResolveMemberAccess.
4884 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4885 can have an instance, ensure that we pass in a non-TypeExpression
4886 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
4887 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4888 argument. Update to changes and simplify.
4889 (FieldExpr.Emitinstance): Remove CS0120 check.
4890 (PropertyExpr.EmitInstance): Likewise.
4891 * expression.cs (Argument.Resolve): Likewise.
4892 (Invocation.DoResolve): Update to changes in semantics of
4895 2005-03-31 Marek Safar <marek.safar@seznam.cz>
4898 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4901 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4903 2005-03-31 Raja R Harinath <rharinath@novell.com>
4905 Fix difference in behaviour with commandline invocation.
4906 * driver.cs (Driver.Reset): New.
4907 (CompilerCallableEntryPoint): Call it.
4909 * statement.cs (If.Resolve): Avoid spurious "uninitialized
4910 variable" warnings if the boolean expression failed to resolve.
4912 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
4914 * attribute.cs: Fix the union of several permissions when some of them
4915 are unrestricted (so the result isn't an unrestricted permission set).
4918 2005-03-30 Raja R Harinath <rharinath@novell.com>
4920 * ecore.cs (MemberExpr): New class. Convert from interface
4922 (MemberExpr.ResolveMemberAccess): Refactor and move here from
4923 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
4925 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4926 (MethodGroupExpr.IsExplicitImpl): Remove.
4927 (Expression.GetFieldFromEvent): Remove.
4928 (SimpleName.MemberStaticCheck): Remove.
4929 (SimpleName.DoSimpleNameResolve): Update to changes.
4930 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4931 (MemberAccess.IdenticalNameAndTypeName): Remove.
4932 (MemberAccess.error176): Move to MemberExpr.
4933 (MemberAccess.DoResolve): Update to changes.
4934 (BaseAccess.DoResolve): Likewise.
4936 2005-03-30 Marek Safar <marek.safar@seznam.cz>
4938 C# 2.0 Conditional attribute class implementation
4940 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4941 Analyzes class whether it has attribute which has ConditionalAttribute
4942 and its condition is not defined.
4944 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4945 (Class.IsExcluded): New method. Search for at least one defined
4946 condition in ConditionalAttribute of attribute class.
4948 2005-03-30 Raja R Harinath <rharinath@novell.com>
4950 * ecore.cs (PropertyExpr): Derive from Expression, not
4951 ExpressionStatement.
4952 (PropertyExpr.EmitStatement): Remove.
4954 2005-03-29 Raja R Harinath <rharinath@novell.com>
4957 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4958 internal field "value__" of an enum be private. The examples for
4959 "value__" that I found on MSDN all used FieldAttributes.Private.
4961 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4962 Don't mention IL method attribute names.
4964 Fix #47991. Remove a TODO.
4965 * statement.cs (Block.Toplevel): Make into a field.
4966 (Block.Parameters): Move into ToplevelBlock.
4967 (Block.known_variables): Rename from child_variable_names.
4968 (Block.Block): Remove variants that take Parameters. Initialize
4969 'Toplevel' with the immediately surrounding toplevel block.
4970 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
4971 LocalInfo parameter.
4972 (Block.GetKnownVariableInfo): New.
4973 (Block.IsVariableNameUsedInChildBlock): Update.
4974 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
4975 the block, even though it may not be in scope.
4976 (Block.AddVariable): Remove Parameters parameter. Use
4977 Toplevel.Parameters instead.
4978 (Block.AddConstant): Remove Parameters parameter.
4979 (Block.GetParameterReference): Update to use Toplevel.Parameters.
4980 (Block.IsParamaterReference): Likewise.
4981 (Block.IsLocalParameter): Likewise. Simplify a lot.
4982 (ToplevelBlock.Parameters): New. Moved from Block.
4983 (ToplevelBlock.ToplevelBlock): Update to changes. Always
4984 initialize Parameters to a non-null value.
4985 * cs-parser.jay: Update to changes.
4986 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4987 simple names that mean different things in the same block. Use
4988 Block.IsVariableNameUsedInBlock.
4990 2005-03-28 Raja R Harinath <rharinath@novell.com>
4992 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4994 2005-03-26 Raja R Harinath <harinath@acm.org>
4997 * assign.cs (Assign.DoResolve): When the RHS of an assignment
4998 fails to resolve, ensure that the LHS is still resolved as an
5001 2005-03-25 Raja R Harinath <harinath@acm.org>
5003 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
5005 (Enum.current_ec): Remove.
5006 (Enum.LookupEnumValue): Remove EmitContext argument.
5007 Just uses the one created during DefineType.
5008 (Enum.FindMembers): Update.
5009 * expression.cs (MemberAccess.DoResolve): Update.
5011 2005-03-22 Marek Safar <marek.safar@seznam.cz>
5013 * assign.cs (Assign.DoResolve): Check for CS1717 when
5014 source and target are same (uses Equals).
5016 * expression.cs (LocalVariableReference, ParameterReference,
5017 This): Implemented Equals, GetHashCode.
5019 * statement.cs (Block.GetParameterReference): Removed useless
5022 2005-03-22 Raja R Harinath <rharinath@novell.com>
5025 * statement.cs (Block.AddVariable): Ensure that we skip implicit
5026 blocks before deciding whether the error is cs0136 or cs0128.
5028 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
5029 (using_alias_directive, using_namespace_directive): Pass
5030 MemberName, not an expression to Namespace.UsingAlias and
5032 (MakeName): Use the MemberName of the namespace.
5033 * namespace.cs (Namespace.MemberName): New.
5034 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
5035 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
5037 * decl.cs (MemberName.Name): Make readonly.
5038 (MemberName.FromDotted): New "constructor".
5039 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
5040 (MemberCore.Name): Compute from MemberName on demand.
5041 (MemberCore.SetMemberName): Provide a way to change the
5043 (MemberCore.AddToContainer): Don't take a fullname parameter.
5044 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
5045 fully qualified name of the container to the member name.
5046 (TypeContainer.AddToTypeContainer): Use a fully qualified name
5047 only if the type is a member of the root container.
5048 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
5049 MemberName.Left rather than searching for an embedded ".".
5050 (PartialContainer.CreatePart): Update to changes in RootContext.
5051 (MemberBase.ShortName): Turn into a property. Use
5052 MemberCore.SetMemberName.
5053 (MemberBase.ExplicitInterfaceName): Remove.
5054 (MemberBase.UpdateMemberName): Remove.
5055 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
5056 (PropertyBase.SetMemberName): New override.
5057 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
5058 (Tree.GetDecl): New.
5059 (Tree.AllDecls): Rename from Decls.
5060 * attribute.cs, enum.cs, report.cs: Update to changes.
5061 * driver.cs (MainDriver): Use MemberName.FromDotted on
5062 RootContext.MainClass.
5064 2005-03-21 Marek Safar <marek.safar@seznam.cz>
5066 * class.cs (FixedField.Define): Check for CS1664 and more sanity
5069 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
5071 2005-03-18 Marek Safar <marek.safar@seznam.cz>
5073 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
5074 property accessor modifiers.
5076 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
5077 fixed buffer attribute (CS1716).
5078 (PropertyMethod.HasCustomAccessModifier): When property accessor
5079 has custom modifier.
5081 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
5083 (PropertyExpr.DoResolveLValue): Add CS0272.
5085 2005-03-17 Miguel de Icaza <miguel@novell.com>
5087 * convert.cs: When converting to a pointer, use the proper Conv.U
5088 or Conv.I depending on the source data type.
5090 * cs-tokenizer.cs: Make the size for large decimal constants,
5093 2005-03-17 Martin Baulig <martin@ximian.com>
5095 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5096 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
5098 2005-03-17 Martin Baulig <martin@ximian.com>
5100 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5101 to bool so we can return an error condition.
5102 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5105 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
5107 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
5110 2005-03-16 Raja R Harinath <rharinath@novell.com>
5112 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
5113 Refactor to avoid traversing the list of assemblies, and to avoid
5114 string concatenation.
5115 * typemanager.cs (guid_attr_type): Remove.
5116 (negative_hits, pointers, references): Remove hashes.
5118 (GetConstructedType): New. Uses type_hash to handle constructed
5119 types (arrays, references, pointers).
5120 (GetReferenceType, GetPointerType): Use it.
5121 (GetNestedType): New. Uses type_hash to handle nested types of
5123 (LookupType, LookupTypeDirect): Remove.
5124 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
5125 'types' hash and LookupTypeReflection directly.
5126 (params_string, params_object): Use GetConstructedType.
5127 * namespace.cs (Namespace.cached_types): New. Cache of reflected
5129 (Namespace.Lookup): Use cached_types.
5130 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
5131 provided by old TypeManager.LookupType.
5132 * rootcontext.cs (MakeFQN): Remove.
5133 * decl.cs (DeclSpace.MakeFQN): Likewise.
5134 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
5135 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
5136 TypeManager.GetConstructedType.
5137 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
5139 2005-04-16 Zoltan Varga <vargaz@freemail.hu>
5141 * cs-parser.jay: Fix build.
5143 2005-03-15 Marek Safar <marek.safar@seznam.cz>
5145 * class.cs (TypeContainer.CircularDepException) New nested
5146 (MethodCore.CheckBase): Report CS1715 for properties and indexers.
5148 * cs-parser.jay: Reports CS1527 for any namespace element.
5150 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
5153 * expression.cs (ParameterReference.IsAssigned): Changed error to
5155 (Error_WrongNumArguments): Moved CS0245 detection here.
5157 * statement.cs (Return.Resolve): Add CS1622 report.
5159 2005-03-11 Marek Safar <marek.safar@seznam.cz>
5161 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
5163 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
5165 * attribute.cs expression.cs: Get rid of some allocations.
5167 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
5169 * doc.cs : just eliminate the latest change.
5171 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5173 * doc.cs : commented out the latest change. It breaks xml-030.cs
5175 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5177 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
5178 fail. So invoke CreateType() in FindDocumentedType().
5180 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5182 * cs-tokenizer.cs : added IsKeyword().
5183 * doc.cs : Detect keyword incorrectly used as identifier.
5184 Allow identifiers prefixed by @.
5186 2005-03-10 Marek Safar <marek.safar@seznam.cz>
5188 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
5189 It caused exception in namespace resolving (again!).
5191 * class.cs (Class.ctor): Removed exit.
5192 (PropertyMethod.ctor): ditto.
5194 * codegen.cs (Codegen.Reset): Reset static data.
5195 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
5197 * cs-tokenizer.cs (Cleanup): Removed.
5199 * driver.cs (GetSystemDir): Rewrote to one line command.
5200 It caused problem with unloaded dynamic modules.
5201 (UnixParseOption): Removed Exit.
5202 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
5203 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
5204 Now can be mcs used as library.
5206 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
5209 * location.cs (Reset): Reset static data.
5211 * namespace.cs (Reset): Reset static data.
5213 * report.cs (Report.Reset): Reset static data.
5215 * rootcontext.cs (RootContext.Reset): Reset static data.
5217 * tree.cs (RootTypes.ctor): Use Location.Null
5219 * typemanager.cs (TypeManager.Reset): Reset static data.
5220 (CoreLookupType): Removed Exit.
5221 (TypeHandle.Reset): Reset static data.
5223 2005-03-10 Raja R Harinath <rharinath@novell.com>
5226 * typemanager.cs (ComputeNamespaces): Import namespaces from
5227 referenced modules too.
5229 2005-03-09 Raja R Harinath <rharinath@novell.com>
5231 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
5234 2005-03-09 Raja R Harinath <rharinath@novell.com>
5236 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
5237 enclosing DeclSpace. This ensures that a name-lookup populates
5238 more caches and there are fewer 'TypeExpression's. Carve out
5239 nested type lookup into ...
5240 (LookupNestedTypeInHierarchy): ... this.
5242 2005-04-15 Martin Baulig <martin@ximian.com>
5244 Merged r41590 from MCS and make it work in the generics land.
5246 * generic.cs (TypeParameter.UpdateConstraints): Removed the
5249 * class.cs (PartialContainer.UpdateConstraints): Removed.
5250 (PartialContainer.CheckConstraints): Removed.
5251 (PartialContainer.SetParameterInfo): Store the constraints here.
5252 (PartialContainer.DefineTypeParameters): New public method;
5253 resolve the type parameter's constraints here. Note that the
5254 PartialContainer doesn't have an EmitContext anymore, so we must
5255 do this in the ClassPart.
5257 2005-03-09 Raja R Harinath <rharinath@novell.com>
5259 Clean up a few partial-class semantics.
5260 Fixes test-357.cs and cs1618-2.cs.
5261 * cs-parser.jay (struct_declaration): Use 'current_class' as
5262 parent of newly-created struct. Remove call to Register ().
5263 Use 'pop_current_class' to complete handing the current struct.
5264 (interface_declaration): Likewise.
5265 (class_declaration): Likewise.
5266 (enum_declaration): Use 'current_class' as parent of newly created
5268 (delegate_declaration): Likewise.
5269 (pop_current_class): New function. This is used to handle closing
5270 up the 'current_class' and 'current_container', and pointing them
5271 to the enclosing class/container.
5272 (CSharpParser): Initialize 'current_class' too.
5273 * decl.cs (MemberCore): Add check for invariant: a partial
5274 container is not a parsed entity, and thus does not enclose any
5276 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
5277 (DeclSpace.BaseTypeExpr): Use it.
5278 (DeclSpace.LookupType): Add check for invariant.
5279 * class.cs (TypeContainer): Add check for invariant: a nested
5280 class should have the same NamespaceEntry as its enclosing class.
5281 (TypeContainer.EmitFieldInitializers): Make virtual.
5282 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
5284 (TypeContainer.Register): Remove.
5285 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
5286 null. Use TypeResolveEmitContext for resolving base types and
5287 interfaces. Move initialization of Parts.TypeBuilder here from
5289 (TypeContainer.DefineNestedTypes): ... here.
5290 (PartialContainer): Take a Namespace not a NamespaceEntry.
5291 (PartialContainer.Create): Don't use Register. Call the
5292 appropriate Add... function directly.
5293 (ClassPart): Take both the PartialContainer and the enclosing
5294 class as constructor arguments.
5295 (ClassPart.EmitFieldInitializers): Override.
5296 (ClassPart.PartFindNestedTypes): Remove.
5297 (FieldBase.GetInitializerExpression): Resolve the initializer
5298 expression in the emit context of the enclosing class.
5299 * tree.cs (RootTypes): Remove Register ().
5301 2005-03-08 Marek Safar <marek.safar@seznam.cz>
5303 * cs-parser.jay: Removed CS0134.
5305 * driver.cs: Removed CS1901.
5307 * expression.cs (SizeOf.DoResolve): Don't report CS0233
5308 for predefined types.
5310 2005-03-07 Duncan Mak <duncan@novell.com>
5312 * codegen.cs (Save): Catch UnauthorizedAccessException as
5313 well. Fixes bug #73454.
5315 2005-03-07 Marek Safar <marek.safar@seznam.cz>
5317 * cs-tokenizer.cs (xtoken): Add CS1035.
5319 * class.cs (MethodData.Define): Add CS0683.
5320 (FieldMember.ctor): Add CS0681.
5322 2005-03-07 Raja R Harinath <rharinath@novell.com>
5324 * ecore.cs (SimpleName.DoResolve): Rename from
5325 SimpleName.DoResolveAllowStatic.
5326 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
5327 Pass 'intermediate' flag to MemberStaticCheck.
5328 (SimpleName.MemberStaticCheck): Skip "static check" only in case
5329 of "intermediate" lookups via MemberAccess.
5330 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
5331 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
5333 2005-03-07 Raja R Harinath <rharinath@novell.com>
5336 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
5337 slipped in because of variable names that are identical to a
5338 builtin type's BCL equivalent ('string String;', 'int Int32;').
5339 (PropertyExpr.EmitInstance): Likewise.
5341 2005-03-04 Marek Safar <marek.safar@seznam.cz>
5343 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
5345 * report.cs (warning_ignore_table): Made public.
5347 2005-03-04 Raja R Harinath <rharinath@novell.com>
5350 * class.cs (MethodData.Emit): Pass 'container' to
5351 container.GetObsoleteAttribute instead of 'container.Parent'.
5353 2005-03-03 Marek Safar <marek.safar@seznam.cz>
5355 * cs-parser.jay: Add 1534 error test.
5357 * iterators.cs (Yield.CheckContext): Add error 1629.
5358 (Iterator.ctor): Save unsafe modifier.
5359 (MoveNextMethod.DoEmit): Restore unsafe context.
5361 * namespace.cs (UsingAlias): Better error message.
5363 2005-03-03 Dan Winship <danw@novell.com>
5365 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
5366 the warning message [#73219]
5368 2005-03-03 Raja R Harinath <rharinath@novell.com>
5370 Fix compile with MCS 1.0.0.0.
5371 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
5372 w_restore to not depend on string constant folding.
5374 2005-03-03 Raja R Harinath <rharinath@novell.com>
5376 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
5377 CS0246 check to users who passed 'silent = false'.
5378 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
5380 (SimpleName.SimpleNameResolve): Update.
5381 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
5382 (MemberAccess.IdenticalNameAndTypeName): Update.
5383 * doc.cs (FindDocumentedTypeNonArray): Update.
5385 2005-03-03 Raja R Harinath <rharinath@novell.com>
5387 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
5388 * parameters.cs (ComputeAndDefineParameters): Remove.
5389 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
5390 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
5391 Use GetParameterInfo.
5393 2005-03-02 Marek Safar <marek.safar@seznam.cz>
5395 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
5397 2005-03-02 Raja R Harinath <rharinath@novell.com>
5399 Unify DeclSpace.LookupType and DeclSpace.FindType.
5400 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
5401 is in charge of defining nested types on demand.
5402 (DeclSpace.LookupType): Use it when the current_type is a
5403 TypeBuilder. Use LookupTypeDirect for reflected types.
5404 (DeclSpace.FindType): Remove.
5405 (DeclSpace.LookupInterfaceOrClass): Likewise.
5406 (DeclSpace.DefineTypeAndParents): Likewise.
5407 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
5408 DeclSpace.LookupType.
5409 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
5410 * typemanager.cs (LookupType): Simplify.
5411 (AddUserType): Remove type from negative_hits.
5412 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
5413 * class.cs (TypeContainer.FindMembers): Move handling of nested
5415 (TypeContainer.FindMembers_NestedTypes): ... here.
5416 (TypeContainer.FindNestedType): Implement override.
5417 (ClassPart.FindNestedType): Delegate to PartialContainer.
5418 (ClassPart.PartFindNestedType): Looks up the nested types of the
5421 2005-04-14 Martin Baulig <martin@ximian.com>
5423 * generic.cs (ConstructedType): Moved all the type lookup and
5424 nested class logic into SimpleName.
5425 (ConstructedType.ResolveConstructedType): Our underlying type is
5426 already fully resolved; all the type lookup stuff is in
5429 * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
5430 constructed types here instead of in ConstructedType.
5432 * decl.cs (MemberName.GetTypeExpression): Always create a
5433 SimpleName, not a ConstructedType.
5434 (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
5436 2005-03-02 Martin Baulig <martin@ximian.com>
5438 * class.cs (TypeContainer.DoDefineMembers): We also need a default
5439 static constructor in static classes.
5441 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
5443 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
5444 sizeParamIndex is not specified.
5446 2005-03-01 Marek Safar <marek.safar@seznam.cz>
5449 * report.cs (WarningMessage.IsEnabled): Missing null check.
5451 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5453 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
5454 in the fields and not in the properties.
5456 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
5458 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
5461 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5463 * attribute.cs: Small refactoring (improved robustness).
5464 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
5465 (ValidateGuid): Removed.
5466 (Resolve): Removed referenced to above mentioned.
5467 (GetAttributeUsage): Made private and changed to work without
5469 (GetIndexerAttributeValue): Don't crash.
5470 (GetConditionalAttributeValue): Ditto.
5471 (GetClsCompliantAttributeValue): Ditto.
5472 (ExtractSecurityPermissionSet): All attributes exceptions are
5474 (GetPropertyValue): New helper.
5475 (GetMethodImplOptions): New method.
5476 (DefinePInvokeMethod): Reuse common code. Implemented handling of
5477 some missing properties.
5479 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5480 (Method.ApplyAttributeBuilder): Updated.
5482 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5485 2005-02-28 Raja R Harinath <rharinath@novell.com>
5488 * report.cs (Report.SymbolRelatedToPreviousError): Handle
5489 non-simple types (array, pointer, reference).
5491 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5493 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5495 * class.cs (MethodCore.IsDuplicateImplementation): Special error
5497 (Method.CheckBase): Catch wrong destructor here.
5498 (MethodData.Define): Add errors 550, 668.
5500 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5502 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5504 * pending.cs (VerifyPendingMethods): Add error 551.
5506 * typemanager.cs (CSharpName): Next error report helper.
5508 2005-02-25 Marek Safar <marek.safar@seznam.cz>
5510 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5511 attributes. Removed useless attribute double check.
5512 It saves almost 2MBs for corlib.
5514 2005-02-25 Raja R Harinath <rharinath@novell.com>
5517 * statement.cs (ExpressionStatement.Resolve): Make robust to being
5518 called twice in case of error.
5520 2005-02-23 Chris Toshok <toshok@ximian.com>
5522 Fix compiler portions of #72827.
5523 * statement.cs (Block.Emit): call Begin/EndScope on the
5524 EmitContext instead of the ILGenerator.
5526 * codegen.cs (EmitContext.BeginScope): new method, call
5527 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5529 (EmitContext.BeginScope): same, but EndScope and CloseScope
5531 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5532 offset and call the superclass's OpenScope(int) with it.
5533 (SymbolWriter.CloseScope): get the current il
5534 offset and call superclass's CloseScope(int) with it.
5536 2005-02-23 Marek Safar <marek.safar@seznam.cz>
5538 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5539 CS1677 for out and ref as well.
5541 * class.cs (Method.Define): Add error CS1599 detection.
5543 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5545 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5547 * delegate.cs (Delegate.Define): Add error CS1599 detection.
5549 * support.cs.cs (ModifierDesc): New helper method.
5551 2005-02-23 Raja R Harinath <rharinath@novell.com>
5552 Abin Thomas <projectmonokochi@rediffmail.com>
5553 Anoob V E <projectmonokochi@rediffmail.com>
5554 Harilal P R <projectmonokochi@rediffmail.com>
5557 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5558 MemberLookup (used for error reporting) actually returns a result.
5559 Fix error report number (122, not 112).
5561 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
5562 Anoob V E <projectmonokochi@rediffmail.com>
5563 Harilal P R <projectmonokochi@rediffmail.com>
5566 * pending.cs (PendingImplementation.GetAbstractMethods):
5567 Find NonPublic members too.
5569 2005-02-22 Marek Safar <marek.safar@seznam.cz>
5571 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5574 * class.cs (MethodCore.CheckMethodAgainstBase):
5575 Add error 239 report.
5577 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5579 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5581 * class.cs (Operator.Define): Add error 217 report.
5583 2005-02-21 Raja R Harinath <rharinath@novell.com>
5586 * expression.cs (Invocation.IsApplicable): Make public.
5587 (Invocation.IsParamsMethodApplicable): Likewise.
5588 * delegate.cs (Delegate.VerifyApplicability): Don't use
5589 Invocation.VerifyArgumentCompat for parameter applicability
5590 testing. Use Invocation.IsApplicable and
5591 Invocation.IsParamsMethodApplicable.
5593 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5595 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5597 * class.cs (Operator.Define): Add error 217 report.
5599 2005-02-21 Raja R Harinath <rharinath@novell.com>
5601 * namespace.cs (UsingEntry.Resolve): Undo change below.
5603 2005-02-21 Raja R Harinath <rharinath@novell.com>
5606 * ecore.cs (Expression.MemberLookupFailed): Add argument to
5607 disable the error message when the extended MemberLookup also
5609 (Expression.MemberLookupFinal): Update.
5610 (SimpleName.DoSimpleNameResolve): Update.
5611 * expression.cs (MemberAccess.ResolveNamespaceOrType):
5612 Don't use MemberLookupFinal.
5613 (New.DoResolve): Update.
5614 (BaseAccess.CommonResolve): Update.
5616 2005-02-21 Raja R Harinath <rharinath@novell.com>
5619 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5620 occured previously, don't resolve again.
5622 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5625 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5626 argument. Call ResolveAttributeUsage for unresolved.
5627 when types doesn't match ctor arguments.
5629 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5630 for nested attribute classes.
5631 (Class.attribute_usage): Removed.
5632 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5633 for attribute class.
5635 * ecore.cs (IsAttribute): Removed.
5637 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5639 * rootcontext.cs (RegisterAttribute): Removed, attributes are
5641 (attribute_types): Removed.
5642 (EmitCode): Global attributes are emited as the latest.
5644 2005-02-18 Marek Safar <marek.safar@seznam.cz>
5646 * class.cs (EmitFieldInitializers): Don't emit field initializer
5647 for default values when optimilization is on.
5649 * constant.cs (Constant.IsDefaultValue): New property.
5651 * driver.cs: Add /optimize handling.
5655 * literal.cs: Implement new IsDefaultValue property.
5657 * rootcontext.cs (Optimize): New field, holds /optimize option.
5659 2005-02-18 Raja R Harinath <rharinath@novell.com>
5661 Fix crasher in re-opened #72347.
5662 * namespace.cs (Namespace.Lookup): Return null if
5663 DeclSpace.DefineType returns null.
5666 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5668 2005-02-18 Raja R Harinath <rharinath@novell.com>
5670 Fix remainder of #63202. Change semantics of DoResolveLValue: it
5671 now returns null if it cannot resolve to an lvalue.
5672 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5673 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5674 returned null. Remove check for SimpleName.
5675 (EventExpr.DoResolveLValue): New.
5676 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5677 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
5679 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
5681 (Unary.ResolveOperator): Move CS0211 check ...
5682 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
5684 (Unary.DoResolveLValue): Simplify.
5685 (AddressOf.DoResolveLValue): New.
5686 (ArrayAccess.DoResolveLValue): New.
5688 2005-02-16 Marek Safar <marek.safar@seznam.cz>
5690 * attribute.cs (Attribute.Resolve): Add arguments casting for
5691 when types doesn't match ctor arguments.
5693 2005-02-16 Raja R Harinath <rharinath@novell.com>
5695 Fix parts of #63202.
5696 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5697 lookup of operator in base type. Ensure that all checks happen
5698 when the operator resolves to an "op_..." method.
5700 2005-02-15 Raja R Harinath <rharinath@novell.com>
5703 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5704 'ignore_cs0104' parameter. Pass it to ...
5705 (NamespaceEntry.Lookup): ... this.
5706 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5707 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5708 (TypeLookupExpression.DoResolveAsTypeStep): Update.
5709 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5710 Update. Request that cs0104 errors be ignored.
5711 (ComposedCast.ResolveAsTypeStep): Update.
5713 2005-02-14 Raja R Harinath <rharinath@novell.com>
5716 * expression.cs (Invocation.BetterFunction): Remove support for
5717 comparing virtual functions and their overrides.
5718 (Invocation.IsOverride): New.
5719 (Invocation.OverloadResolve): Don't consider 'override' functions
5720 during candidate selection. Store them in a lookaside list.
5721 If the selected method is a 'virtual' function, use the list to
5722 find any overrides that are closer to the LHS type.
5724 2005-02-14 Marek Safar <marek.safar@seznam.cz>
5726 * expression.cs (New.DoResolve): Add complex core type reduction.
5727 (New.Constantify): Converts complex core type syntax like 'new int ()'
5730 2005-02-14 Raja R Harinath <rharinath@novell.com>
5732 * decl.cs (EntryType.EntryType): New constructor to create an
5733 updated copy of a cache entry.
5734 (MemberCache.AddMethods): Use it.
5735 (MemberCache.ClearDeclaredOnly): Remove.
5736 (MemberCache.MemberCache): Update.
5738 2005-02-11 Miguel de Icaza <miguel@novell.com>
5740 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5741 variable. This one is represents the actual low-level declaration
5742 of the method, as opposed to the semantic level `IsStatic'.
5744 An anonymous method which is hosted into a static method might be
5745 actually an instance method. IsStatic would reflect the
5746 container, while MethodIsStatic represents the actual code
5749 * expression.cs (ParameterReference): Use the new MethodIsStatic
5750 instead of IsStatic.
5752 * anonymous.cs (AnonymousMethod.Compatible): Pass the
5753 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5754 set on the current EmitContext.
5756 * expression.cs (Cast): Overload DoResolveLValue so we can pass
5757 resolve our casted expression as an LValue. This triggers the
5758 proper LValue processing that is later required by Assign.
5762 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5764 2005-02-11 Marek Safar <marek.safar@seznam.cz>
5766 C# 2.0 Fixed buffer implementation
5768 * anonymous.cs: Update after RegisterHelperClass renaming.
5770 * attribute.cs (AttributeTester.fixed_buffer_cache):
5771 Cache of external fixed buffers.
5772 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5773 implementation if field is fixed buffer else null.
5776 (TypeContainer.AddField): Accept FieldMember instead of Field.
5777 (FieldBase.IsFieldClsCompliant): Extracted code from
5778 VerifyClsCompliance descendant customization.
5779 (FixedField): New class handles fixed buffer fields.
5780 (FixedFieldExternal): Keeps information about imported fixed
5782 (IFixedField): Make access to internal or external fixed buffer
5785 * cs-parser.jay: Add fixed buffer parsing.
5787 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5790 * expression.cs (Indirection): Extended implementation to accept
5792 (PointerArithmetic.Emit): Get element from fixed buffer as well.
5793 (ElementAccess.MakePointerAccess): Get type as parameter.
5794 (DoResolve): Add fixed buffer field expression conversion.
5795 (DoResolveLValue): Ditto.
5796 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5797 (ArrayPtr): Derives from FixedBufferPtr.
5798 (ArrayPtr.Emit): Add extra emit for array elements.
5800 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5802 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5803 for compiler generated types.
5804 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5806 * statement.cs (Fixed): Refactored to be easier add fixed buffer
5807 and consume less memory.
5808 (Fixed.Resolve): Add fixed buffer case.
5810 * typemanager.cs (compiler_generated_attr_ctor,
5811 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5812 (HasElementType): Add our own implementation to work on every
5815 2005-02-11 Miguel de Icaza <miguel@novell.com>
5817 * anonymous.cs (CaptureContext): Track whether `this' has been
5820 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
5821 only captured `this' if it was implicitly done (instance
5822 methods/variables were used).
5824 * codegen.cs (EmitContext.CaptureThis): New method to flag that
5825 `this' must be captured.
5827 2005-01-30 Miguel de Icaza <miguel@novell.com>
5829 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5830 is null it means that there has been no need to capture anything,
5831 so we just create a sibling.
5833 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5835 Just a partial fix. The other half is fairly elusive.
5837 2005-02-10 Raja R Harinath <rharinath@novell.com>
5839 Fix #52586, cs0121-4.cs.
5840 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
5841 and return a hashtable.
5842 (MemberCache.ClearDeclaredOnly): New.
5843 (MemberCache.MemberCache): Update to change. Make a deep copy of
5844 the method_hash of a base type too.
5845 (MemberCache.AddMethods): Adapt to having a deep copy of the base
5846 type methods. Overwrite entries with the same MethodHandle so
5847 that the ReflectedType is correct. The process leaves in base
5848 virtual functions and their overrides as distinct entries.
5849 (CacheEntry): Now a class instead of a struct. It shouldn't alter
5850 matters since it was boxed in a ArrayList before.
5851 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5853 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
5854 case of a virtual function and its override (choose the overload
5856 (Invocation.OverloadResolve): Avoid 'override' members during
5857 'applicable_type' calculation.
5859 2005-03-28 Raja R Harinath <rharinath@novell.com>
5861 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5862 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5863 GetTypeHandle. It is possible for a reflected type to derive from
5864 a TypeBuilder (e.g., int[] derives from the TypeBuilder
5865 System.Array during mscorlib compilation).
5866 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5867 contain a method_hash, don't create one either. Don't create a
5868 deep copy of the base cache's method_hash.
5869 (MemberCache.SetupCache): Rename back from DeepCopy.
5870 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5871 already initialized. If we see an override function, add its
5872 underlying base virtual function to the member_hash too.
5874 2005-02-09 Raja R Harinath <rharinath@novell.com>
5876 Combine two near-redundant caches.
5877 * typemanager.cs (method_params): Rename from method_internal_params.
5878 (TypeManager.GetParameterData): New. Replace
5879 Invocation.GetParameterData.
5880 (TypeManager.LookupParametersByBuilder): Remove.
5881 * expression.cs (Invocation.method_parameter_cache): Remove.
5882 (Invocation.GetParameterData): Remove.
5884 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5887 2005-02-08 Raja R Harinath <rharinath@novell.com>
5890 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5891 TypeManager.multicast_delegate_type is null, resolve it by looking
5892 up "System.MulticastDelegate".
5893 * rootcontext.cs (RootContext.ResolveCore): Simplify.
5895 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
5896 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
5897 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
5900 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5901 (LabeledStatement.AddReference): New. Set 'referenced'.
5902 (Goto.Resolve): Use it.
5904 2005-02-05 John Luke <john.luke@gmail.com>
5906 * driver.cs: remove duplicate -doc line in Usage ()
5908 2005-02-04 Raja R Harinath <rharinath@novell.com>
5910 * location.cs (Location.AddFile): Fix CS2002 error report.
5912 2005-02-02 Martin Baulig <martin@ximian.com>
5914 * delegate.cs (Delegate.DefineType): Report an internal error if
5915 TypeManager.multicast_delegate_type is null. See bug #72015 for
5918 2005-02-02 Raja R Harinath <rharinath@novell.com>
5920 Fix a crasher in a variant of #31984.
5921 * const.cs (Constant.CheckBase): New override that defers the
5922 new-or-override check in case the base type hasn't been populated
5924 (Constant.Define): Ensure the new-or-override check is performed.
5926 2005-02-01 Duncan Mak <duncan@ximian.com>
5928 * const.cs (LookupConstantValue): Check that `ce' is not null
5929 before calling GetValue ().
5931 2005-02-01 Raja R Harinath <rharinath@novell.com>
5933 Fix test-334.cs (#69519).
5934 * cs-parser.jay (using_alias_directive): Pass in an expression to
5935 NamespaceEntry.UsingAlias.
5936 (using_namespace_directive): Pass in an expression to
5937 NamespaceEntry.Using.
5938 (namespace_name): Don't flatten to a string.
5939 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5940 (NamespaceEntry.AliasEntry.Resolve): Lookup using
5942 (NamespaceEntry.UsingEntry): Likewise.
5943 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5945 (NamespaceEntry.LookupForUsing): Remove.
5946 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5948 (NamespaceEntry.Lookup): Remove support for dotted names.
5950 2005-02-01 Raja R Harinath <rharinath@novell.com>
5952 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5954 (NamespaceEntry.ImplicitParent): Compute on demand.
5955 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5956 parallels the current.
5957 (NamespaceEntry.LookupForUsing): Use it.
5958 (NamespaceEntry.Lookup): If the current namespace-entry is
5959 implicit, don't search aliases and using tables.
5961 2005-02-01 Raja R Harinath <rharinath@novell.com>
5964 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5966 (TypeContainer.BaseCache): Compute on demand.
5967 (TypeContainer.FindMembers): Define constants and types if they're
5968 not already created.
5969 (FieldMember.Define): Move resetting of ec.InUnsafe before error
5971 * const.cs (Constant.Define): Make idempotent.
5973 2005-01-29 Miguel de Icaza <miguel@novell.com>
5975 * pending.cs: Produce better code (no nops produced by using Ldarg
5978 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5979 i - 1' it should be arg + 1.
5983 2005-01-28 Raja R Harinath <rharinath@novell.com>
5985 * attribute.cs (Attribute.CheckAttributeType): Make private
5987 (Attribute.ResolveType): Make virtual.
5988 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5989 handling of RootContext.Tree.Types.
5991 2005-01-27 Raja R Harinath <rharinath@novell.com>
5993 Update attribute-handling to use the SimpleName/MemberAccess
5995 * cs-parser.jay (attribute): Pass in an expression to the
5996 constructors of Attribute and GlobalAttribute.
5997 * attribute.cs (Attribute): Take an expression for the name.
5998 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
5999 passed in attribute name expression.
6000 (Attribute.CheckAttributeType): Use it.
6001 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
6002 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
6003 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
6004 argument to prevent error messages if the lookup fails.
6006 2005-01-27 Marek Safar <marek.safar@seznam.cz>
6008 * expression.cs (Indirection): Implemented IVariable interface
6009 to support indirection in AddressOf operator.
6010 (PointerArithmetic.Emit): Add optimalization for case where
6011 result can be precomputed.
6013 2005-01-26 Martin Baulig <martin@ximian.com>
6015 * class.cs (TypeContainer.AttributeTargets): Return the correct
6016 AttributeTargets depending on our `Kind' instead of throwing an
6017 exception; fixes #71632.
6019 2005-01-26 Marek Safar <marek.safar@seznam.cz>
6022 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
6025 2005-03-17 Martin Baulig <martin@ximian.com>
6027 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6028 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
6030 2005-03-17 Martin Baulig <martin@ximian.com>
6032 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6033 to bool so we can return an error condition.
6034 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6037 2005-03-17 Martin Baulig <martin@ximian.com>
6039 * generic.cs (TypeMananager.IsIEnumerable): New public method.
6041 * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
6042 converting from an array-type of T to `IEnumerable<T>'.
6044 2005-03-16 Martin Baulig <martin@ximian.com>
6046 * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
6047 (Nullable.LiftedUnaryMutator): New public class.
6049 * expression.cs (UnaryMutator.DoResolve): Added support for
6052 2005-03-14 Martin Baulig <martin@ximian.com>
6054 * generic.cs (Nullable.NullCoalescingOperator): Implemented.
6056 2005-03-14 Martin Baulig <martin@ximian.com>
6058 * generic.cs (Nullable.LiftedBinaryOperator): Added support for
6059 the comparision operators `<', `>', `<=' and `>='.
6061 2005-03-13 Martin Baulig <martin@ximian.com>
6064 (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
6065 avoid confusion with the `NullLiteral'.
6066 (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
6068 2005-03-13 Martin Baulig <martin@ximian.com>
6070 * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
6071 comparing arbitrary types with the null literal.
6073 2005-03-13 Martin Baulig <martin@ximian.com>
6075 * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
6076 boolean operators '&&', '||', '&' and '|'.
6077 (Nullable.OperatorTrueOrFalse): New public class.
6079 * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
6080 instead of a `StaticCallExpr'; added support for nullables.
6082 2005-03-10 Martin Baulig <martin@ximian.com>
6085 (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
6086 rather than `etype.IsSubclassOf (TypeManager.value_type)'.
6088 2005-03-07 Martin Baulig <martin@ximian.com>
6090 * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
6091 it work if `expr' is not an IMemoryLocation.
6092 (Nullable.Lifted): Implement IMemoryLocation.
6093 (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
6096 2005-03-05 Martin Baulig <martin@ximian.com>
6098 * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
6099 (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
6100 (Nullable): Added support for lifted unary and binary operators.
6102 * expression.cs (Unary.DoResolve): Added support for nullable types.
6103 (Binary.DoResolve): Likewise.
6104 (Conditional.DoResolve): Likewise.
6106 2005-03-02 Martin Baulig <martin@ximian.com>
6108 * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
6110 * class.cs (ClassPart.SetParameterInfo): Override this.
6111 (PartialContainer.SetParameterInfo): Override this.
6112 (TypeContainer.CheckConstraints): New protected method.
6113 (PartialContainer.CheckConstraints): Override this and check
6114 whether the same contraints were specified in all parts of a
6115 partial generic type definition.
6116 (PartialContainer.UpdateConstraints): New public method.
6118 * generic.cs (TypeParameter.UpdateConstraints): New public method.
6120 2005-03-02 Martin Baulig <martin@ximian.com>
6122 Committing a patch from Carlos Alberto Cortez to fix #72887.
6124 * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
6125 casts from `T []' to `int []'.
6127 2005-03-02 Martin Baulig <martin@ximian.com>
6129 * generic.cs (TypeManager.IsEqual): Make this symmetric.
6131 * expression.cs (Binary.ResolveOperator): When resolving a
6132 BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
6133 `=='. Fixes #71866. See gen-127.cs.
6135 2005-03-02 Martin Baulig <martin@ximian.com>
6137 * class.cs (TypeContainer.DoDefineMembers): We also need a default
6138 static constructor in static classes.
6140 2005-03-02 Martin Baulig <martin@ximian.com>
6143 (NullableType.Name, NullableType.FullName): Add a "?" to the name.
6144 (Nullable.LiftedConversion): Added support for user-defined
6147 * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
6149 * cs-parser.jay: Use ComposedCast everywhere instead of
6150 NullableType, so we don't need to check for NullableType
6152 (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
6153 case where we'll be resolved into a `parenthesized_expression_0'
6157 (Convert.UserDefinedConversion): Added nullable conversions.
6159 2005-02-28 Martin Baulig <martin@ximian.com>
6161 * generic.cs (TypeManager.IsNullableType): New static method.
6162 (Nullable): New abstract class.
6163 (Nullable.NullLiteral): New public class.
6164 (Nullable.LiftedConversion): New public class.
6166 * cs-parser.jay (non_expression_type): Changed `builtin_types' to
6167 `builtin_types opt_nullable'.
6170 (Convert.ImplicitConversionStandard): Added nullable conversions.
6171 (Convert.ExplicitConversionStandard): Likewise.
6172 (Convert.ExplicitConversion): Likewise.
6174 2005-02-26 Martin Baulig <martin@ximian.com>
6176 * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
6177 begin with a "?", for instance "?[]". Don't do a type lookup if
6180 2005-02-25 Martin Baulig <martin@ximian.com>
6182 The first part of Nullable Types :-)
6184 * generic.cs (NullableType): New public class.
6185 (NullCoalescingOperator): New public class.
6186 (TypeArguments.Resolve): Add a CS0306 check.
6188 * cs-parser.jay (opt_error_modifier): Removed, this was unused.
6189 (opt_nullable): New rule.
6190 (type): Added `opt_nullable' to `namespace_or_type_name',
6191 `builtin_types' and `pointer_type'.
6192 (array_type): Added `opt_nullable'.
6193 (opt_rank_specifier_or_nullable): New rule; this is the
6194 combination of `opt_rank_specifier' and `opt_nullable'.
6195 (opt_error): New rule; catch errors here.
6196 (nullable_type_or_conditional): New rule; we use this to check for
6197 nullable and still detect the conditional operator.
6198 (local_variable_type): Use `opt_rank_specifier_or_nullable'
6199 instead `opt_rank_specifier'.
6201 * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
6204 2005-02-24 Martin Baulig <martin@ximian.com>
6206 * README, README.Changes: Removed; they're old and obsolete.
6208 2005-02-22 Martin Baulig <martin@ximian.com>
6210 * generic.cs (TypeParameter.Resolve): If resolving the constraints
6211 returned an error, set `constraints' to null to avoid a crash
6213 (TypeParameter.ResolveType): Likewise.
6215 2005-02-22 Martin Baulig <martin@ximian.com>
6218 (Constraints.ResolveTypes): Protect against being called twice.
6219 (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
6220 (TypeParameter.ResolveType): New public method; calls
6221 constraints.ResolveTypes().
6222 (TypeParameter.DefineType): Moved constraints.ResolveType() out
6223 into the new ResolveType().
6224 (GenericMethod.Define): Call ResolveType() on all our
6227 2005-02-21 Martin Baulig <martin@ximian.com>
6230 (TypeManager.generic_nullable_type): New static public field.
6231 (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
6234 (RootContext.ResolveCore): Resolve "System.Nullable`1".
6236 2005-02-15 Martin Baulig <martin@ximian.com>
6238 * generic.cs (ConstructedType.Constraints): Correctly check
6239 constraints if the argument type is a type parameter; fixes
6242 2005-02-02 Martin Baulig <martin@ximian.com>
6244 * delegate.cs (Delegate.DefineType): Report an internal error if
6245 TypeManager.multicast_delegate_type is null. See bug #72015 for
6248 2005-01-29 Miguel de Icaza <miguel@novell.com>
6250 * pending.cs: Produce better code (no nops produced by using Ldarg
6253 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6254 i - 1' it should be arg + 1.
6258 2005-01-26 Martin Baulig <martin@ximian.com>
6260 * cs-parser.jay (indexer_declarator): Don't report an error if we
6261 have type parameters since we can be an explicit interface
6262 implementation; fixes #71449.
6264 2005-01-26 Martin Baulig <martin@ximian.com>
6266 * class.cs (TypeContainer.AttributeTargets): Return the correct
6267 AttributeTargets depending on our `Kind' instead of throwing an
6268 exception; fixes #71632.
6270 2005-01-26 Martin Baulig <martin@ximian.com>
6272 * delegate.cs (Delegate.DefineType): Correctly define our type
6273 parameters. Fixes #71483.
6275 2005-01-25 Raja R Harinath <rharinath@novell.com>
6278 * expression.cs (MemberAccess.DoResolve): Don't complain with
6279 cs0572 when the LHS of a member access has identical name and type
6282 2005-01-25 Marek Safar <marek.safar@seznam.cz>
6285 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
6287 Create custom PermissionSet only for PermissionSetAttribute.
6289 2005-01-24 Marek Safar <marek.safar@seznam.cz>
6292 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
6293 delegates in static class.
6295 2005-01-24 Martin Baulig <martin@ximian.com>
6297 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6298 merging an implicit block, just use its reachability.
6300 * statement.cs (Block.Resolve): Make the unreachable code check
6301 work wrt. implicit blocks; see test-337 from #63842.
6303 2005-01-21 Alp Toker <alp@atoker.com>
6305 * cs-parser.jay: destructor_declaration's container is PartialContainer
6306 not Class when partial types are used, so use Kind prop instead of
6309 2005-01-22 Miguel de Icaza <miguel@ximian.com>
6311 * cs-parser.jay: Improve error reporting when an interface
6314 2005-01-20 Dick Porter <dick@ximian.com>
6316 * support.cs: SeekableStreamReader fix from Sandor Dobos
6317 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
6318 chars are read. Fixes bug 70369.
6320 2005-01-20 Raja R Harinath <rharinath@novell.com>
6322 * cs-parser.jay (catch_clause): Simplify current_block handling
6325 2005-01-17 Miguel de Icaza <miguel@ximian.com>
6327 * convert.cs (ImplicitStandardConversionExists): Synchronize the
6328 code with ImplicitStandardConversion to handle the implicit
6329 conversion of method groups into valid delegate invocations.
6331 The problem is that in parameter handling we were using this code
6332 path. Fixes bug #64698
6334 2005-01-19 Raja R Harinath <rharinath@novell.com>
6336 * cs-parser.jay: Fix several infelicities.
6337 - Avoid assigning to the parser value stack. Code like
6338 '$3 = null' is unclean. Synthesize a value for the code block
6340 - Avoid using oob_stack for storing location information. Use ...
6341 (_mark_): ... this. New (empty) rule. Saves the current location
6343 (foreach_statement): Avoid using oob_stack for current_block
6344 handling. Use technique used in for_statement and
6345 using_statement. Synthesize a value for the code block to store
6346 additional intermediate information.
6348 2005-01-13 Miguel de Icaza <miguel@ximian.com>
6350 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
6351 of a different type is only allowed to private fields of a
6352 containing type, not on fields of a base class.
6354 See test-174.cs and error cs0122-9.cs
6356 2005-01-13 Raja R Harinath <rharinath@novell.com>
6358 Fix test-335.cs (bug #58126).
6359 * cs-parser.jay (argument): Split out non-expression parts of the
6360 rule into 'non_simple_argument'.
6361 (invocation_expression): Support parenthesized invocations with
6362 multiple arguments, and with single non-simple arguments.
6364 2005-01-13 Raja R Harinath <rharinath@novell.com>
6366 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
6369 2005-01-12 Raja R Harinath <rharinath@novell.com>
6371 Fix cs0038-1.cs, cs1640-6.cs.
6372 * ecore.cs (Expression.Resolve): Remove special-case for
6373 SimpleName in error-handling.
6374 (Expression.almostMatchedMembers): Relax access permission to
6376 (Expression.MemberLookupFailed): Handle duplicates in
6377 almostMatchedMembers list.
6378 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
6379 * expression.cs (New.DoResolve): Report CS1540 for more cases.
6380 * typemanager.cs (GetFullNameSignature): Use the MethodBase
6381 overload if the passed in MemberInfo is a MethodBase.
6383 2005-01-25 Martin Baulig <martin@ximian.com>
6386 (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
6388 2005-01-12 Marek Safar <marek.safar@seznam.cz>
6391 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
6392 for non-CAS & merge permission sets properly.
6394 2005-01-11 Raja R Harinath <rharinath@novell.com>
6396 Improve standard-compliance of simple name and member access
6397 resolution. Fixes bugs #52697, #57200, #67520, #69519.
6398 * ecore.cs (FullNamedExpression): New abstract base class
6399 for Namespaces and TypeExpressions.
6400 (ResolveFlags.SimpleName): Remove.
6401 (SimpleName): Remove support for dotted names.
6402 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
6403 DeclSpace.FindType and DeclSpace.LookupType.
6404 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
6405 (Expression.ExprClassName): Make member function.
6406 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
6407 a namespace. Remove creation of dotted "SimpleName"s.
6408 (MemberAccess.DoResolve): Likewise.
6409 * decl.cs (DeclSpace.Cache): Make private.
6410 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
6411 (DeclSpace.FindType): Update.
6412 (DeclSpace.LookupType): Move here from RootContext. Return a
6413 FullNamedExpression.
6414 * namespace.cs (Namespace): Derive from FullNamedExpression
6415 so that it can be part of expression resolution.
6416 (Namespace.Lookup): Return an FullNamedExpression.
6417 (NamespaceEntry.LookupAlias): Lookup aliases only in current
6419 * rootcontext.cs (NamespaceLookup): Remove.
6420 (LookupType): Move to DeclSpace.
6421 * attribute.cs (CheckAttributeType): Update.
6422 * doc.cs (FindDocumentedType): Remove allowAlias argument.
6423 (FindDocumentedTypeNonArray): Likewise.
6425 2005-01-11 Raja R Harinath <rharinath@novell.com>
6427 Fix cs0509.cs, cs1632.cs.
6428 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
6429 is the same as IsInterface.
6430 (TypeContainer.GetClassBases): Likewise.
6431 * statement.cs (LabeledStatement.ig): New field.
6432 (LabeledStatement.LabelTarget): Save ILGenerator which created the
6434 (LabeledStatement.DoEmit): Check that the label was created with
6435 the same ILGenerator.
6437 2005-01-10 Marek Safar <marek.safar@seznam.cz>
6440 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
6441 accessors to its properties.
6443 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
6444 from accessors to property.
6446 2005-01-10 Marek Safar <marek.safar@seznam.cz>
6449 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
6452 2005-01-08 Miguel de Icaza <miguel@ximian.com>
6454 * attribute.cs: Check for null and empty strings.
6456 I have lost another battle to Paolo.
6458 2005-01-07 Marek Safar <marek.safar@seznam.cz>
6461 * class.cs (PropertyMethod): Set Parent field in ctors.
6462 (SetMethod.InternalParameters): Add unsafe switch hack.
6463 Override MarkForDuplicationCheck where it is appropriate.
6465 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
6466 It says whether container allows members with the same name.
6468 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
6469 Removed is_method parameter.
6471 2005-01-06 Duncan Mak <duncan@ximian.com>
6473 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6474 because the previous change led to incorrect reporting of CS1032
6475 ("Cannot define/undefine preprocessor symbols after first token in
6476 file"). Instead of using `tokens_seen' as the only flag that
6477 triggers CS1040, introduce `comments_seen'. This new flag is used
6478 to signify having seen comments on the current line, so it is
6479 unset after a newline.
6481 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
6483 * doc.cs : When searching for a type, find nested type too.
6484 This fixes bug #71040.
6486 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
6489 - Warn missing member comment on those classes which also does not
6490 have doc comments. Fixed bug #71041.
6491 - Don't warn missing doc comment on default constructor.
6494 2005-01-06 Duncan Mak <duncan@ximian.com>
6496 * cs-tokenizer.cs (xtoken): After handling traditional C-style
6497 comments, set `tokens_seen' to true. This allows us to detect
6498 misplaced preprocessor directives (i.e. not at the beginning of
6499 the a line, nor after whitespaces). In that case, report error
6500 CS1040. This fixes bug #56460.
6502 * cs-parser.jay (interface_member_declaration): Add checks for
6503 IsExplicitImpl, and report CS0541 error if an interface member is
6504 defined as an explicit interface declaration.
6506 2005-01-06 Marek Safar <marek.safar@seznam.cz>
6509 * class.cs (PropertyMethod): Set Parent field in ctors.
6510 (SetMethod.InternalParameters): Add unsafe switch hack.
6512 * decl.cs (MemberCore.Parent): Cannot be readonly.
6514 2005-01-06 Raja R Harinath <rharinath@novell.com>
6516 * decl.cs (DeclSpace.ResolveType): Remove.
6517 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
6518 Merge in code from ...
6519 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
6520 * class.cs, enum.cs: Update to changes.
6522 2005-01-06 Miguel de Icaza <miguel@ximian.com>
6524 * anonymous.cs: Ensure that we init the scope of our parent if it
6525 has not been initialized yet.
6527 2004-12-30 Duncan Mak <duncan@ximian.com>
6529 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6530 if field.FieldBuilder is null. Fixes #70758.
6532 * convert.cs: Fixed some typos and updated some of the comments.
6533 (ImplicitStandardConversionExists):
6534 (TryImplicitIntConversion): If `target_type' is an interface and
6535 the type of `ic' implements this interface, return true or a new
6536 BoxedCast instead of null. This fixes #70468.
6538 2004-12-29 Duncan Mak <duncan@ximian.com>
6540 * expression.cs (Argument.Emit): Check that Expr is
6541 IMemoryLocation before casting to it, and report CS1510 otherwise.
6545 2004-12-21 Ben Maurer <bmaurer@ximian.com>
6547 * statement.cs (Block.ThisVariable): remove the recursion here, to
6548 make the --profile more sane.
6550 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
6552 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6553 assembly, by JB Evain.
6555 2004-12-17 Raja R Harinath <rharinath@novell.com>
6557 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
6558 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6559 "parent" refers to enclosing type/class. "base" refers to superclass.
6561 2004-12-17 Raja R Harinath <rharinath@novell.com>
6563 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6564 Ensure that we only have GlobalAttributes.
6565 * attribute.cs (Attribute.Emit): Make non-virtual.
6566 (GlobalAttribute.Emit): Remove.
6567 (Attribute.Resolve): Make virtual.
6568 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
6569 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6570 the argument. Don't create one.
6571 (Attribute.GetObsoleteAttribute): Likewise.
6572 (Attribute.GetClsCompliantAttributeValue): Likewise.
6573 * class.cs, decl.cs: Update to changes.
6575 2004-12-17 Marek Safar <marek.safar@seznam.cz>
6577 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6579 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6581 * statement.cs (Foreach.Resolve): Add error 186 report.
6583 2004-12-16 Marek Safar <marek.safar@seznam.cz>
6585 * expression.cs (Conditional.DoResolve): Add warning 429.
6587 * statement.cs (If.Resolve): Add warning 665.
6589 2004-12-16 Raja R Harinath <rharinath@novell.com>
6591 New invariant: RootContext.Tree.Types.NamespaceEntry == null
6592 except when in the parser, and in GlobalAttribute.
6593 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6594 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6595 RootContext.Tree.Types.NamespaceEntry once work is done.
6596 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
6597 and resets RootContext.Tree.Types.NamespaceEntry.
6599 2004-12-15 Marek Safar <marek.safar@seznam.cz>
6601 * cs-parser.jay: Don't create a block for every variable.
6603 2004-12-14 Miguel de Icaza <miguel@ximian.com>
6605 * location.cs: Provide extra information.
6607 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6608 variables from the captured environment, it is the ldarg_0.
6610 2004-12-14 Marek Safar <marek.safar@seznam.cz>
6612 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6615 * class.cs: Changed warning level for 169 to avoid developer
6616 displeasure from warning flooding. It will be changed back when they
6617 fix most of current BCL warnings.
6619 * RootContext.cs: Pushed default WarningLevel to 3.
6621 * statement.cs: Removed unused variable.
6623 2004-12-14 Marek Safar <marek.safar@seznam.cz>
6625 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6626 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6627 Add error 502 report.
6628 (StaticClass.DefineType): Add error 441 report.
6629 (Class.AllowedModifiersProp): New virtual property as temporary
6630 extension to AllowedModifiers.
6631 (Class.DefineType): Add error 418 report. Moved ModFlags check here
6632 to share implementation with StaticClass and don't call virtual
6635 * driver.cs (MainDriver): Add error 1558 test.
6637 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6638 report. Moved error 36 test here.
6640 * statement.cs (Throw.Resolve): Add error 724 report.
6642 * typemanager.cs: Add out_attribute_type core type.
6644 2004-12-13 Marek Safar <marek.safar@seznam.cz>
6646 * class.cs (TypeContainer.VerifyClsCompliance): Add error
6648 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6650 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6653 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6655 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
6656 Add error 3023 report.
6657 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6659 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6662 2004-12-12 John Luke <john.luke@gmail.com>
6664 * driver.cs (AddArgs): take -- into account when
6665 adding arguments, fixes bug 65710
6667 2004-12-12 Martin Baulig <martin@ximian.com>
6669 * expression.cs (Unary.TryReduceNegative): Added support for
6670 SByteConstant and ByteConstant.
6671 (Unary.Reduce): Check error values from TryReduceNegative().
6673 2004-12-10 Marek Safar <marek.safar@seznam.cz>
6675 * attributes.cs (Attribute.Resolve): Avoid multiple error report
6676 and report exception as error 182.
6678 2004-12-10 Raja R Harinath <rharinath@novell.com>
6680 * driver.cs (Main): Fix message when there are warnings.
6682 2004-12-09 Miguel de Icaza <miguel@ximian.com>
6684 * delegate.cs: Fixed my fix from yesterday, sorry about that.
6686 2004-12-09 Marek Safar <marek.safar@seznam.cz>
6688 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
6689 Reduced number of warnings.
6691 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6693 2004-12-08 Miguel de Icaza <miguel@ximian.com>
6695 * driver.cs: Removed message.
6697 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6699 2004-12-08 <vargaz@freemail.hu>
6701 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6703 2004-12-08 Martin Baulig <martin@ximian.com>
6705 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6706 instead of a CS3002 for properties and indexer.
6708 2004-12-08 Martin Baulig <martin@ximian.com>
6710 * decl.cs (MemberName.ToString): Make this work again.
6712 2004-12-08 Marek Safar <marek.safar@seznam.cz>
6714 * attribute.cs (Resolve): Add error 591 detection.
6716 * class.cs (FieldMember.Define): Add error 1547 detection.
6717 (Indexer.Define): Add error 620 detection.
6718 (Operator.Define): Add error 590 detection.
6720 * ecore.cs: Missing argument for error 79.
6722 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6725 2004-12-07 Marek Safar <marek.safar@seznam.cz>
6728 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6731 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
6733 * cs-parser.jay : handle doc comments on implicit/explicit operators.
6734 Some operator comments were suppressed.
6735 * doc.cs : Implicit/explicit operator name in doc comments are like
6736 "op_Explicit(type)~returnType", so added suffix handling.
6738 2005-01-21 Alp Toker <alp@atoker.com>
6740 * cs-parser.jay: destructor_declaration's container is PartialContainer
6741 not Class when partial types are used, so use Kind prop instead of 'is'.
6743 2004-12-12 Martin Baulig <martin@ximian.com>
6745 * expression.cs (Unary.TryReduceNegative): Added support for
6746 SByteConstant and ByteConstant.
6747 (Unary.Reduce): Check error values from TryReduceNegative().
6749 2004-12-11 Martin Baulig <martin@ximian.com>
6751 * support.cs (ReflectionParameters.ParameterName): If we have a
6752 `gpd', call `ParameterName' on it.
6754 * parameter.cs (Parameter.GetParameterAttributes): New static method.
6756 * pending.cs (PendingImplementation.DefineProxy): Call
6757 DefineParameter() for all of the MethodBuilder's arguments.
6759 2004-12-09 Martin Baulig <martin@ximian.com>
6761 * doc.cs (DocUtil): Make this a static class.
6763 2004-12-09 Martin Baulig <martin@ximian.com>
6765 * expression.cs (Invocation.InferType): Moved the type inference
6766 implementation into TypeManager.
6768 * generics.cs (TypeManager): Moved the type inference
6769 implementation here.
6771 2004-12-09 Martin Baulig <martin@ximian.com>
6773 * typemanager.cs (TypeManager): Make this a partial class.
6776 (TypeManager): Move the generics part of `TypeManager' here.
6778 2004-12-08 Martin Baulig <martin@ximian.com>
6780 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6781 instead of a CS3002 for properties and indexer. Added CS3024
6782 check for generic interfaces.
6784 * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
6785 instances are not CLS-compliant.
6787 2004-12-08 Martin Baulig <martin@ximian.com>
6790 (void_pointer_expression): New rule for `void*', `void**' etc.
6791 (typeof_expression): Add `void_pointer_expression'; fixes #66846.
6793 2004-12-08 Martin Baulig <martin@ximian.com>
6795 * expression.cs (Invocation.InferType): Removed the hack for
6796 MethodCore.MayUnify().
6798 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
6801 * class.cs (MethodCore.MayUnify): Use
6802 TypeManager.MayBecomeEqualGenericTypes().
6804 2004-12-08 Martin Baulig <martin@ximian.com>
6806 * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
6807 parameter, box it. Fixes #69233.
6809 2004-12-08 Martin Baulig <martin@ximian.com>
6811 * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
6812 have the ctor constraint. Fixes #68326.
6814 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
6816 * cs-parser.jay : interface comment was not consumed because of
6817 extra opt_semicolon before doc handling.
6819 2004-12-03 Raja R Harinath <rharinath@novell.com>
6821 Fix test-327.cs, test-328.cs, and put in early infrastructure
6822 for eventually fixing #52697.
6823 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6824 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6826 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6827 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6828 (VerifyUsing, error246): Update.
6829 * rootcontext.cs (RootContext.NamespaceLookup): Just use
6830 'NamespaceEntry.LookupNamespaceOrType'.
6832 2004-12-07 Martin Baulig <martin@ximian.com>
6834 * driver.cs: Call it "BETA SOFTWARE" :-)
6836 2004-12-06 Raja R Harinath <rharinath@novell.com>
6838 Fix crash on cs0657-17.cs.
6839 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6840 Use RootContext.Tree.Types, not 'new RootTypes ()'.
6841 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6842 the case where the NamespaceEntry gets overwritten.
6844 2004-12-06 Marek Safar <marek.safar@seznam.cz>
6846 Fixed #69195, #56821
6847 * ecore.cs (ResolveBoolean): Tiny refactoring.
6849 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6850 of right expression resolving when left is false constant and
6851 operator is LogicalAnd OR true constant and operator is LogicalOr.
6853 * statement.cs (ResolveUnreachable): Always reports warning.
6855 2004-12-05 Miguel de Icaza <miguel@ximian.com>
6857 * class.cs: Distinguish between 1721 and 1722 (just a little help
6858 for the programmer).
6860 2004-12-03 Miguel de Icaza <miguel@ximian.com>
6862 * delegate.cs: Only allow this on new versions of the language.
6864 2004-12-02 Duncan Mak <duncan@ximian.com>
6866 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6868 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6869 here as a static method. Take an additional bool out parameter
6870 `must_do_cs1540_check' for signaling to InstanceResolve.
6871 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6872 member field from PropertyExpr class and made it an argument of
6874 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6875 check for MarshalByRefObject, and report CS0122 instead of CS1540.
6876 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6877 and `remove_accessor' as well as InstanceResolve: report CS0122
6882 2004-12-07 Martin Baulig <martin@ximian.com>
6884 * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
6885 and CS0692 where appropriate.
6887 2004-12-06 Martin Baulig <martin@ximian.com>
6889 * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
6890 IsDuplicateImplementation() and improved it.
6892 * expression.cs (Invocation.InferTypeArguments): Added
6893 `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
6894 and removed the "ref" modifier from `infered_types'.
6896 * decl.cs (MemberName.ToString): Removed the exception.
6898 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
6900 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6901 comments are allowed.
6903 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6905 * delegate.cs: Add checks for subtypes in paramaters and return values
6906 in VerifyMethod () to add support for Covariance/Contravariance
6909 2004-12-02 Miguel de Icaza <miguel@ximian.com>
6911 * report.cs: Remove extra closing parenthesis.
6913 * convert.cs (Error_CannotImplicitConversion): If the name of the
6914 types are the same, provide some extra information.
6916 2004-12-02 Marek Safar <marek.safar@seznam.cz>
6919 * attribute.cs (Resolve): Improved implementation of params
6920 attribute arguments.
6922 * support.cs (ParameterData): Add HasParams to be faster.
6924 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
6926 all things are for /doc support:
6928 * doc.cs: new file that supports XML documentation generation.
6929 * mcs.exe.sources: added doc.cs.
6931 Handle /doc command line option.
6932 Report error 2006 instead of 5 for missing file name for /doc.
6933 Generate XML documentation when required, after type resolution.
6935 Added support for picking up documentation (/// and /** ... */),
6936 including a new XmlCommentState enumeration.
6938 Added lines to fill Documentation element for field, constant,
6939 property, indexer, method, constructor, destructor, operator, event
6940 and class, struct, interface, delegate, enum.
6941 Added lines to warn incorrect comment.
6943 Added Documentation field (passed only when /doc was specified).
6945 Added DocComment, DocCommentHeader, GenerateDocComment() and
6946 OnGenerateDocComment() and some supporting private members for
6947 /doc feature to MemberCore.
6949 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6951 Added overriden DocCommentHeader.
6953 Added overriden DocCommentHeader and GenerateDocComment().
6955 2004-12-01 Miguel de Icaza <miguel@ximian.com>
6957 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6958 unwrapping the enumeration values, chain to
6959 DoConstantNumericPromotions again, so we can promote things to the
6960 fundamental types (takes care of enums that are bytes, sbytes).
6964 2004-12-01 Raja R Harinath <rharinath@novell.com>
6966 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6967 Fix long-standing bug in type-lookup. Use FindType instead of
6968 LookupType when ec.ResolvingTypeTree.
6969 (Attribute.ResolveType, Attribute.Resolve)
6970 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6972 (Attributes.Search): Remove internal version. Update.
6973 (Attributes.SearchMulti): Update.
6974 (Attributes.GetClsCompliantAttribute): Remove.
6975 (Attributes.GetIndexerNameAttribute): Remove.
6976 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6977 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6978 * class.cs (Indexer.Define): Likewise.
6980 2004-12-01 Marek Safar <marek.safar@seznam.cz>
6983 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6984 MarshallByReference members access.
6986 * expression.cs: Use CheckMarshallByRefAccess;
6987 Better error CS0197 message.
6989 * report.cs: Print whole related error message.
6991 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6993 * class (GetClassBases): Better error 60 report.
6994 (EventProperty): Disabled warning 67 detection.
6996 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6999 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
7001 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
7004 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7007 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
7009 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
7011 2004-11-26 Miguel de Icaza <miguel@ximian.com>
7013 * attribute.cs (Attribute.Resolve): Refine error reporting and
7014 report a cs0117 if the identifier does not exist, to distinguish
7015 from 0617 which is a miss-use of the actual identifier.
7017 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
7018 between cs0070 and cs0079.
7020 * class.cs (MemberBase.DoDefine): When reporting a wrong
7021 accessibility level, we use MethodCore to compare instead of
7022 Method (this was a regression in some refactoring effort).
7024 So now we correctly report cs0056 again.
7026 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
7027 testing the target_type (which was known to be object_type) and
7028 not the source type (which is anonymous_method).
7030 Fixed reporting of error cs1660.
7032 * expression.cs (UserCast.Source): Expose the underlying cast.
7034 * statement.cs (Switch.SwitchGoverningType): Sort the list of
7035 allowed types to find a match to int32 first (most common).
7037 In addition, it ignores any ImplicitUserConversions that did an
7038 internal implicit conversion (as the switch statement allows only
7039 one integral conversion to exist).
7041 * class.cs (PartialContainer.Create): rename `name' to
7042 `member_name' for clarity. Then replace the string calls with a
7043 call to MemberName.GetPartialName, as now using
7044 MemberName.ToString is an error (this is due to the side effects
7045 it had, that were fixed in the past).
7047 This will restore the error reporting on a number of partial class
7048 errors that were missusing this (and getting an exception as a
7049 results, which is now just a plain textual warning, because
7050 yyparse debug output would crash otherwise).
7052 2004-11-26 Raja R Harinath <rharinath@novell.com>
7054 * Makefile (PROGRAM_INSTALL_DIR): Remove.
7056 2004-11-25 Ben Maurer <bmaurer@ximian.com>
7058 * rootcontext.cs (LookupType): Make sure to cache lookups that
7059 don't give us a negative result. This saves about 5% of corlib
7062 2004-11-25 Miguel de Icaza <miguel@ximian.com>
7064 * report.cs (AbstractMessage.Print): messages are sent to stderr
7066 * class.cs (TypeContainer.GetClassBases): It is an error to have a
7067 non-interface in the list of interfaces (at this point, either
7068 parent was properly set, or a base class is being listed in the
7069 interfaces section).
7071 This flags error 1722, and resolves the crash from bug 69259.
7073 2004-11-25 Ben Maurer <bmaurer@ximian.com>
7075 * statement.cs (Using.EmitExpressionFinally): make this work right
7076 for valuetypes. Fixes 69926.
7078 2004-11-25 Miguel de Icaza <miguel@ximian.com>
7080 * const.cs (Const.ChangeType): Cope with the "0 literal can be
7081 converted to an enum" here, before we try to change the underlying
7082 type. This code exists, but it is a different code path than the
7083 one used while encoding constants.
7085 (ImplicitReferenceConversionExists): In addition, resynchronized
7086 the code here, so it matches the same code in
7087 ImplicitReferenceConversionExists for the `from any class-type S
7088 to any interface-type T'.
7090 2004-11-25 Marek Safar <marek.safar@seznam.cz>
7092 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
7094 2004-11-24 Miguel de Icaza <miguel@ximian.com>
7096 * cs-parser.jay: Use verbosity accordingly.
7098 2004-11-24 Marek Safar <marek.safar@seznam.cz>
7100 * expression.cs (Unary.ResolveOperator): Do not report warning;
7101 AddressOf reads from variable.
7103 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
7105 2004-11-24 Marek Safar <marek.safar@seznam.cz>
7109 * attribute.cs (Attributable): Removed CheckTargets.
7110 (Attributes.Emit): Explicit attribute targets are tested here.
7112 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
7113 not enabled for interfaces.
7115 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
7116 (GetAssemblyName): Ouch next bug there.
7118 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7120 * expression.cs: Error 275 added.
7122 2004-11-23 Marek Safar <marek.safar@seznam.cz>
7124 Fix bug #69177 (Implemented decimal constant support)
7126 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
7127 (BinaryFold): Add DecimalConstant.
7129 * const.cs (Define): Decimal constant
7131 (ChangeType): Add decimal type handling.
7132 (LookupConstantValue): Don't set value for decimal type but
7133 emit DecimalConstantAttribute. Needed for constant optimization.
7135 * constant.cs (ToDecimal): New method.
7136 (ConvertToDecimal): New method.
7137 (IntConstant): Implemented ConvertToDecimal.
7138 (DecimalConstant.Emit): Emit optimized version for decimals in
7141 * expression.cs (ResolveOperator): Changed order of constant
7142 reduction to work correctly with native types which have
7143 overloaded operators.
7144 (ResolveMemberAccess): Extract constant value from attribute
7147 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
7149 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
7150 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
7151 (ChangeType): Decimal is special.
7152 (TypeToCoreType): Add decimal type.
7154 2004-11-22 Marek Safar <marek.safar@seznam.cz>
7156 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
7159 2004-11-22 Marek Safar <marek.safar@seznam.cz>
7161 * class.cs (EventField.ApplyAttributeBuilder): Fix error
7164 2004-11-19 Marek Safar <marek.safar@seznam.cz>
7166 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
7168 * pending.cs (PendingImplementation): Grab only interfaces.
7170 2004-11-19 Marek Safar <marek.safar@seznam.cz>
7172 * statement.cs (ForeachHelperMethods): Add location member and
7173 error 202 detection.
7175 2004-11-18 Marek Safar <marek.safar@seznam.cz>
7177 * expression.cs (DoResolveBase): Fixed wrong warning for out
7180 2004-12-04 Martin Baulig <martin@ximian.com>
7182 * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
7183 to check whether the conversion is ok.
7185 * typemanager.cs (TypeManager.GetTypeArguments): Just return
7186 `Type.EmptyTypes' if we're not a generic TypeContainer.
7188 2004-11-25 Miguel de Icaza <miguel@ximian.com>
7190 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
7191 old bug: when converting from the null literal to a pointer,
7192 return an EmptyCast, not the NullLiteral.
7194 This fixes #69921, the recent null_type changes probably made this
7197 2004-12-03 Martin Baulig <martin@ximian.com>
7199 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7200 method as our child, call AnonymousMethod.Compatible() on it.
7202 2004-12-02 Miguel de Icaza <miguel@ximian.com>
7204 * class.cs (FieldBase): Use an unused bit field from the field to
7205 encode the `has_offset' property from the FieldMember. This saves
7206 a couple of Ks on bootstrap compilation.
7208 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7209 method as our child, return the AnonymousMethod resolved
7212 * expression.cs (New.DoResolve): Allow return values from
7213 NewDelegate to also include AnonymousMethods.
7217 2004-11-29 Raja R Harinath <rharinath@novell.com>
7219 * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
7221 * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
7222 System.Runtime.InteropServices._Exception, since it's a base
7223 interface of the core type System.Exception in the net_2_0 profile.
7225 2004-11-27 Martin Baulig <martin@ximian.com>
7227 * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
7229 2004-11-26 Raja R Harinath <rharinath@novell.com>
7231 * Makefile: Convert to use executable.make.
7232 * gmcs.exe.sources: New.
7234 2004-11-25 Martin Baulig <martin@ximian.com>
7236 * expression.cs (Invocation.InferType): Added support for byref types.
7238 2004-11-25 Martin Baulig <martin@ximian.com>
7240 * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
7241 in TypeManager.TypeToCoreType().
7243 2004-11-25 Martin Baulig <martin@ximian.com>
7245 * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
7246 "Dispose" method from the `current_type'.
7247 (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
7248 DoDefineMembers() instead of using the MethodBuilder; this is
7249 required for generic iterators.
7251 * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
7253 2004-11-24 Martin Baulig <martin@ximian.com>
7255 * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
7257 2004-11-20 Martin Baulig <martin@ximian.com>
7259 * expression.cs (Invocation.InferType): Correctly infer generic
7260 instances; see gen-103.cs.
7261 (Invocation.InferTypeArguments): If a generic method doesn't have
7262 any unbound type parameters, we don't need to infer anything.
7264 2004-11-19 Raja R Harinath <rharinath@novell.com>
7266 * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
7268 2004-11-17 Raja R Harinath <rharinath@novell.com>
7270 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
7271 (TypeHandle.GetMemberCache): New.
7272 (TypeHandle.TypeHandle): Update.
7273 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
7274 (TypeManager.LookupParentInterfacesCache):
7275 Rename from LookupInterfaceCache. Optimize slightly.
7276 (TypeManager.MemberLookup_FindMembers): Update.
7277 * decl.cs (MemberCache.MemberCache): Set Container to null in the
7279 (AddCacheContents): Rename from AddHashtable.
7280 * class.cs (TypeContainer.parent_container): Remove.
7281 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
7282 (TypeContainer.DoDefineMembers): Don't initialize it.
7283 Update to name changes.
7285 2004-11-17 Miguel de Icaza <miguel@ximian.com>
7287 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
7288 that factors the code to check access modifiers on override.
7290 (PropertyBase): Use the code here.
7292 Patch from Lluis S'anchez, fixes bug #69361.
7294 2004-11-15 Miguel de Icaza <miguel@ximian.com>
7296 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
7297 routine that is used to report the use of a captured variable
7298 whose address has been taken.
7300 There are two checks: one when variables are being captured and
7301 the other check is when the address of a variable is taken.
7303 (because an anonymous methods might be resolved before *or* after
7304 the address has been taken) and
7306 * expression.cs (Conditional.DoResolve): Remove the special
7307 casing that Martin added to trueExpr and falseExpr being both
7308 NullLiteral. We get the right behavior now just by introducing
7309 the null_type into the compiler.
7311 * convert.cs (ExplicitConversion): Change the code to use
7312 null_type instead of testing `expr is NullLiteral'.
7313 (ImplicitConversionStandard): use null_type too.
7314 (ImplicitReferenceConversionExists): use null_type too.
7315 (ImplicitReferenceConversion): use null_type too.
7317 * literal.cs: The type of `NullLiteral' is now null_type instead
7319 (Resolve): Set the type here.
7321 * typemanager.cs: Introduce null_type.
7323 2004-11-18 Martin Baulig <martin@ximian.com>
7326 (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
7328 2004-11-18 Martin Baulig <martin@ximian.com>
7330 * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
7332 2004-11-18 Martin Baulig <martin@ximian.com>
7334 * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
7335 of a `DeclSpace'. If one of our constraints is a `ConstructedType',
7336 call ResolveConstructedType() on it to resolve it without checking
7338 (Constraints.ResolveTypes): Check them here.
7339 (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
7340 but don't check constraints.
7341 (ConstructedType.ResolveAsTypeTerminal): Override this and also
7342 check constraints here.
7343 (ConstructedType.ResolveConstructedType): New public method. This
7344 is called from DoResolveAsTypeStep() and Constraints.Resolve() to
7345 resolve ourselves without checking constraints.
7347 * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
7349 2004-11-18 Martin Baulig <martin@ximian.com>
7352 (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
7354 * delegate.cs (Delegate.DefineType): Always create the EmitContext.
7356 2004-11-18 Martin Baulig <martin@ximian.com>
7358 * ecore.cs (TypeExpr.ResolveType): Removed.
7359 (Expression.ResolveAsTypeTerminal): We always return a fully
7360 resolved `TypeExpr', so we can just access its `Type'.
7362 * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
7364 2004-11-17 Martin Baulig <martin@ximian.com>
7366 * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
7367 sure we don't return any unresolved TypeExpr's.
7368 (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
7370 (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
7372 * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
7373 unresolved `ConstructedType's.
7375 2004-11-17 Martin Baulig <martin@ximian.com>
7377 * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
7379 2004-11-17 Martin Baulig <martin@ximian.com>
7382 (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
7384 * decl.cs (DeclSpace.ResolveType): Removed.
7385 (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
7387 2004-11-17 Martin Baulig <martin@ximian.com>
7389 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
7390 direction, like FindMembers() does. Fixes #69546, testcase is in
7393 2004-11-16 Martin Baulig <martin@ximian.com>
7395 This is based on a patch from Marek Safar, see bug #69082.
7396 Fixes bugs #63705 and #67130.
7398 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
7399 method; create a MemberCache for an interface type and cache the
7402 * decl.cs (IMemberContainer.ParentContainer): Removed.
7403 (IMemberContainer.ParentCache): New property.
7404 (MemberCache.SetupCacheForInterface): Removed.
7405 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
7406 to create a cache for an interface's "parent".
7408 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
7411 2004-11-14 Ben Maurer <bmaurer@ximian.com>
7413 * statement.cs: Avoid adding bools to a hashtable.
7415 2004-11-15 Martin Baulig <martin@ximian.com>
7417 * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
7419 2004-11-11 Martin Baulig <martin@ximian.com>
7421 * typemanager.cs (TypeManager.GetMethodName): New method.
7423 * class.cs (MethodData.Define): Include the generic arity in the
7424 name of an explicit interface; also add it to the method name.
7426 * pending.cs (PendingImplementation.InterfaceMethod): The method
7427 name now includes the generic arity.
7429 2004-11-07 Miguel de Icaza <miguel@ximian.com>
7431 * expression.cs (Invocation.OverloadResolve): Flag error if we are
7432 calling an unsafe method from a safe location.
7434 2004-11-06 Marek Safar <marek.safar@seznam.cz>
7437 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
7439 2004-11-06 Miguel de Icaza <miguel@ximian.com>
7441 * namespace.cs (VerifyUsing): use GetPartialName instead of
7444 2004-11-05 Miguel de Icaza <miguel@ximian.com>
7446 * statement.cs (Return.Resolve): Fix regression in typo: if
7447 `in_exc', we have to request a NeedReturnLabel, this was a typo
7448 introduced in the anonymous method check-in. Fixes #69131.
7450 * Indexers were using the ShortName when defining themselves,
7451 causing a regression in the compiler bootstrap when applying the
7452 patch from 2004-11-02 (first part), now they use their full name
7453 and the bug is gone.
7455 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
7457 * driver.cs: Strip the path from the names of embedded resources. Fixes
7460 2004-11-04 Raja R Harinath <rharinath@novell.com>
7462 Fix error message regression: cs0104-2.cs.
7463 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
7464 (AliasEntry.Resolve): Update.
7465 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
7467 (RootContext.LookupType): Update.
7469 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
7471 * cs-parser.jay: Add support for handling accessor modifiers
7472 * class: Add support port accessor modifiers and error checking,
7473 define PropertyMethod.Define as virtual (not abstract anymore)
7474 * ecore.cs: Add checking for proeprties access with access modifiers
7475 * iterators.cs: Modify Accessor constructor call based in the modified
7477 2004-11-02 Ben Maurer <bmaurer@ximian.com>
7479 * expression.cs (StringConcat): Handle being called twice,
7480 as when we have a concat in a field init with more than two
7483 2004-11-02 Miguel de Icaza <miguel@ximian.com>
7485 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
7486 special case explicit implementations, we should always produce
7487 the .property or .event declaration.
7489 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
7490 since it will not return correct data if people use this
7491 unresolved in the presence of using statements (see test-313).
7493 * class.cs (MethodData.Define): If we are an explicit interface
7494 implementation, set the method name to the full name of the
7495 interface plus the name of the method.
7497 Notice that using the method.MethodName.GetFullName() does not
7498 work, as it will only contain the name as declared on the source
7499 file (it can be a shorthand in the presence of using statements)
7500 and not the fully qualifed type name, for example:
7504 class D : ICloneable {
7505 object ICloneable.Clone () {
7509 Would produce a method called `ICloneable.Clone' instead of
7510 `System.ICloneable.Clone'.
7512 * namespace.cs (Alias.Resolve): Use GetPartialName.
7514 2004-11-01 Marek Safar <marek.safar@seznam.cz>
7516 * cs-parser.jay: Add error 1055 report.
7518 2004-11-01 Miguel de Icaza <miguel@ximian.com>
7520 * assign.cs (Assign.DoResolve): Only do the transform of
7521 assignment into a New if the types are compatible, if not, fall
7522 through and let the implicit code deal with the errors and with
7523 the necessary conversions.
7525 2004-11-01 Marek Safar <marek.safar@seznam.cz>
7527 * cs-parser.jay: Add error 1031 report.
7529 * cs-tokenizer.cs: Add location for error 1038.
7531 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7533 * cs-parser.jay: Add error 1016 report.
7535 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7537 * cs-parser.jay: Add errors 1575,1611 report.
7539 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7541 * cs-parser.jay: Add error 1001 report.
7543 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7546 * attribute.cs (GetMarshal): Add method argument for
7547 caller identification.
7549 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7550 agument for GetMarshal and RuntimeMissingSupport.
7552 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7554 * attribute.cs (ExtractSecurityPermissionSet): Removed
7555 TypeManager.code_access_permission_type.
7557 * typemanager.cs: Removed TypeManager.code_access_permission_type.
7559 2004-10-27 Miguel de Icaza <miguel@ximian.com>
7561 * expression.cs (LocalVariableReference.DoResolveLValue): Check
7562 for obsolete use of a variable here. Fixes regression on errors
7563 cs0619-25 and cs0619-26.
7565 2004-10-27 Marek Safar <marek.safar@seznam.cz>
7567 Fix #62358, implemented security attribute encoding.
7569 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7570 Tests permitted SecurityAction for assembly or other types.
7571 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7572 data from SecurityPermissionAttribute to PermisionSet class.
7574 * class.cs (ApplyAttributeBuilder): Added special handling
7575 for System.Security.Permissions.SecurityAttribute based types.
7577 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7578 special handling for System.Security.Permissions.SecurityAttribute
7581 * enum.cs (ApplyAttributeBuilder): Added special handling
7582 for System.Security.Permissions.SecurityAttribute based types.
7584 * parameter.cs (ApplyAttributeBuilder): Added special handling
7585 for System.Security.Permissions.SecurityAttribute based types.
7587 * rootcontext.cs: Next 2 core types.
7589 * typemanager.cs (TypeManager.security_permission_attr_type):
7590 Built in type for the SecurityPermission Attribute.
7591 (code_access_permission_type): Build in type.
7593 2004-10-17 Miguel de Icaza <miguel@ximian.com>
7595 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7596 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7597 all of this information into
7598 EmitContext.EmitCapturedVariableInstance.
7600 * codegen.cs (EmitCapturedVariableInstance): move here the
7601 funcionality of emitting an ldarg.0 in the presence of a
7602 remapping. This centralizes the instance emit code.
7604 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7605 then emit a load of this: it means that we have reached the
7606 topmost ScopeInfo: the one that contains the pointer to the
7607 instance of the class hosting the anonymous method.
7609 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7610 captures to the topmost CaptureContext.
7612 2004-10-12 Miguel de Icaza <miguel@ximian.com>
7614 * expression.cs (LocalVariableReference): Move the knowledge about
7615 the iterators into codegen's EmitCapturedVariableInstance.
7617 2004-10-11 Miguel de Icaza <miguel@ximian.com>
7619 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7620 all code paths return a value from an anonymous method (it is the
7621 same as the 161 error, but for anonymous methods).
7623 2004-10-08 Miguel de Icaza <miguel@ximian.com>
7625 The introduction of anonymous methods in the compiler changed
7626 various ways of doing things in the compiler. The most
7627 significant one is the hard split between the resolution phase
7628 and the emission phases of the compiler.
7630 For instance, routines that referenced local variables no
7631 longer can safely create temporary variables during the
7632 resolution phase: they must do so from the emission phase,
7633 since the variable might have been "captured", hence access to
7634 it can not be done with the local-variable operations from the runtime.
7638 (Block.Flags): New flag `IsTopLevel' to indicate that this block
7639 is a toplevel block.
7641 (ToplevelBlock): A new kind of Block, these are the blocks that
7642 are created by the parser for all toplevel method bodies. These
7643 include methods, accessors and anonymous methods.
7645 These contain some extra information not found in regular blocks:
7646 A pointer to an optional CaptureContext (for tracking captured
7647 local variables and parameters). A pointer to the parent
7650 (Return.Resolve): Catch missmatches when returning a value from an
7651 anonymous method (error 1662).
7652 Invoke NeedReturnLabel from the Resolve phase instead of the emit
7655 (Break.Resolve): ditto.
7657 (SwitchLabel): instead of defining the labels during the
7658 resolution phase, we now turned the public ILLabel and ILLabelCode
7659 labels into methods called GetILLabelCode() and GetILLabel() that
7660 only define the label during the Emit phase.
7662 (GotoCase): Track the SwitchLabel instead of the computed label
7663 (its contained therein). Emit the code by using
7664 SwitchLabel.GetILLabelCode ().
7666 (LocalInfo.Flags.Captured): A new flag has been introduce to track
7667 whether the Local has been captured or not.
7669 (LocalInfo.IsCaptured): New property, used to tell whether the
7670 local has been captured.
7672 * anonymous.cs: Vastly updated to contain the anonymous method
7675 The main classes here are: CaptureContext which tracks any
7676 captured information for a toplevel block and ScopeInfo used to
7677 track the activation frames for various local variables.
7679 Each toplevel block has an optional capture context associated
7680 with it. When a method contains an anonymous method both the
7681 toplevel method and the anonymous method will create a capture
7682 context. When variables or parameters are captured, they are
7683 recorded on the CaptureContext that owns them, for example:
7687 MyDelegate d = delegate {
7692 Here `a' will be recorded as captured on the toplevel
7693 CapturedContext, the inner captured context will not have anything
7694 (it will only have data if local variables or parameters from it
7695 are captured in a nested anonymous method.
7697 The ScopeInfo is used to track the activation frames for local
7698 variables, for example:
7700 for (int i = 0; i < 10; i++)
7701 for (int j = 0; j < 10; j++){
7702 MyDelegate d = delegate {
7707 At runtime this captures a single captured variable `i', but it
7708 captures 10 different versions of the variable `j'. The variable
7709 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7710 recorded on a child.
7712 The toplevel ScopeInfo will also track information like the `this'
7713 pointer if instance variables were referenced (this is necessary
7714 as the anonymous method lives inside a nested class in the host
7715 type of the method).
7717 (AnonymousMethod): Expanded to track the Toplevel, implement
7718 `AnonymousMethod.Compatible' to tell whether an anonymous method
7719 can be converted to a target delegate type.
7721 The routine now also produces the anonymous method content
7723 (AnonymousDelegate): A helper class that derives from
7724 DelegateCreation, this is used to generate the code necessary to
7725 produce the delegate for the anonymous method that was created.
7727 * assign.cs: API adjustments for new changes in
7728 Convert.ImplicitStandardConversionExists.
7730 * class.cs: Adjustments to cope with the fact that now toplevel
7731 blocks are of type `ToplevelBlock'.
7733 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7734 insteda of standard blocks.
7736 Flag errors if params arguments are passed to anonymous methods.
7738 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7739 `CurrentAnonymousMethod' which points to the current Anonymous
7740 Method. The variable points to the AnonymousMethod class that
7741 holds the code being compiled. It is set in the new EmitContext
7742 created for the anonymous method.
7744 (EmitContext.Phase): Introduce a variable and an enumeration to
7745 assist in enforcing some rules about when and where we are allowed
7746 to invoke certain methods (EmitContext.NeedsReturnLabel is the
7747 only one that enfonces this right now).
7749 (EmitContext.HaveCaptureInfo): new helper method that returns
7750 whether we have a CapturedContext initialized.
7752 (EmitContext.CaptureVariable): New method used to register that a
7753 LocalInfo must be flagged for capturing.
7755 (EmitContext.CapturedParameter): New method used to register that a
7756 parameters must be flagged for capturing.
7758 (EmitContext.CapturedField): New method used to register that a
7759 field must be flagged for capturing.
7761 (EmitContext.HaveCapturedVariables,
7762 EmitContext.HaveCapturedFields): Return whether there are captured
7763 variables or fields.
7765 (EmitContext.EmitMethodHostInstance): This is used to emit the
7766 instance for the anonymous method. The instance might be null
7767 (static methods), this (for anonymous methods that capture nothing
7768 and happen to live side-by-side with the current method body) or a
7769 more complicated expression if the method has a CaptureContext.
7771 (EmitContext.EmitTopBlock): Routine that drives the emission of
7772 code: it will first resolve the top block, then emit any metadata
7773 and then emit the code. The split is done so that we can extract
7774 any anonymous methods and flag any captured variables/parameters.
7776 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7777 during this phase, the ILGenerator should not be used as labels
7778 and local variables declared here might not be accessible to any
7779 code that is part of an anonymous method.
7781 Exceptions to this include the temporary variables that are
7782 created by some statements internally for holding temporary
7785 (EmitContext.EmitMeta): New routine, in charge of emitting all the
7788 (EmitContext.TemporaryReturn): This method is typically called
7789 from the Emit phase, and its the only place where we allow the
7790 ReturnLabel to be defined other than the EmitMeta. The reason is
7791 that otherwise we would have to duplicate a lot of logic in the
7792 Resolve phases of various methods that today is on the Emit
7795 (EmitContext.NeedReturnLabel): This no longer creates the label,
7796 as the ILGenerator is not valid during the resolve phase.
7798 (EmitContext.EmitThis): Extended the knowledge in this class to
7799 work in anonymous methods in addition to iterators.
7801 (EmitContext.EmitCapturedVariableInstance): This emits whatever
7802 code is necessary on the stack to access the instance to a local
7803 variable (the variable will be accessed as a field).
7805 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7806 EmitContext.EmitAddressOfParameter): Routines to support
7807 parameters (not completed at this point).
7809 Removals: Removed RemapLocal and RemapLocalLValue. We probably
7810 will also remove the parameters.
7812 * convert.cs (Convert): Define a `ConstantEC' which points to a
7813 null. This is just to prefity some code that uses
7814 ImplicitStandardConversion code and do not have an EmitContext
7817 The idea is to flag explicitly that at that point in time, it is
7818 known that the conversion will not trigger the delegate checking
7819 code in implicit conversions (which requires a valid
7822 Everywhere: pass new EmitContext parameter since
7823 ImplicitStandardConversionExists now requires it to check for
7824 anonymous method conversions.
7826 (Convert.ImplicitStandardConversionExists): If the type of an
7827 expression is the anonymous_method_type, and the type is a
7828 delegate, we invoke the AnonymousMethod.Compatible method to check
7829 whether an implicit conversion is possible.
7831 (Convert.ImplicitConversionStandard): Only do implicit method
7832 group conversions if the language level is not ISO_1.
7834 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7835 MethodInfo for the Invoke method. used by Delegate and
7838 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7839 method conversions if the target type is a delegate.
7841 Removed extra debugging nops.
7843 (LocalVariableReference): Turn the `local_info' into a public
7846 Add `prepared' field, the same hack used for FieldExprs to cope
7847 with composed assignments, as Local variables do not necessarily
7848 operate purely on the stack as they used to: they can be captured
7851 Add `temp' for a temporary result, like fields.
7853 Refactor DoResolve and DoResolveLValue into DoResolveBase.
7855 It now copes with Local variables that are captured and emits the
7856 proper instance variable to load it from a field in the captured
7859 (ParameterReference.DoResolveBase): During the resolve phase,
7860 capture parameters if we are in an anonymous method.
7862 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7863 anonymous method, use the EmitContext helper routines to emit the
7864 parameter reference.
7866 * iterators.cs: Set RemapToProxy to true/false during the
7869 * parameters.cs (GetParameterByName): New helper method.
7871 * typemanager.cs (anonymous_method_type) a new type that
7872 represents an anonyous method. This is always an internal type,
7873 used as a fencepost to test against the anonymous-methodness of an
7876 2004-10-20 Marek Safar <marek.safar@seznam.cz>
7878 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7880 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7882 2004-11-10 Martin Baulig <martin@ximian.com>
7884 * expression.cs (Invocation.BetterFunction): If two methods have
7885 equal parameter types, but only one of them is generic, the
7886 non-generic one wins.
7887 (New.DoResolve): Don't set `is_struct' to false if we're a generic
7888 instance; just use `Type.IsValueType' to determine whether
7889 something is a struct or not.
7890 (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
7891 so we can be called multiple times.
7893 2004-11-10 Martin Baulig <martin@ximian.com>
7895 * generic.cs (TypeParameter.DefineConstraints): New public method.
7896 (TypeParameter.CheckAccessLevel): Override this and return true.
7897 (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
7898 override ResolveType() anymore.
7899 (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
7901 2004-11-10 Martin Baulig <martin@ximian.com>
7903 * rootcontext.cs (RootContext.LookupType): If we're a nested type,
7904 call DeclSpace.ResolveNestedType() on it.
7906 2004-11-10 Martin Baulig <martin@ximian.com>
7908 * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
7909 non-null, call ParameterModifier() on it.
7911 2004-11-10 Martin Baulig <martin@ximian.com>
7914 (Iterators): Added `current_type' and `this_type' fields.
7915 (Iterators.DefineIterator): Create a new EmitContext and store it
7916 in `ec'; compute `this_type'.
7918 2004-11-10 Martin Baulig <martin@ximian.com>
7921 (TypeManager.IsPrivateAccessible): New public method.
7922 (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
7924 2004-11-10 Martin Baulig <martin@ximian.com>
7926 * class.cs (TypeContainer.DefineType): Call
7927 TypeBuilder.DefineGenericParameters() before resolving the type
7929 (MethodData.parent_method): New protected field.
7930 (MethodData..ctor): Added `MethodInfo parent_method' argument.
7931 (MethodData.Define): Compute `parent_method'.
7934 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7935 (MemberCore.GetClsCompliantAttributeValue): Likewise.
7936 (DeclSpace.ec): New protected field; store the EmitContext here.
7937 (DeclSpace.EmitContext): New public property.
7938 (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
7939 (DeclSpace.ResolveNestedType): New public method.
7940 (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
7941 (DeclSpace.NestedAccessible): Added `Type tb' argument.
7942 (DeclSpace.FamilyAccessible): Likewise.
7943 (DeclSpace.FindType): Call ResolveNestedType() for nested types.
7944 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7947 * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
7950 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7951 (Enum.Emit): Don't create a new EmitContext.
7953 2004-10-18 Martin Baulig <martin@ximian.com>
7955 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7956 `Type' directly, but call ResolveType() on it.
7957 (Catch.Resolve): Likewise.
7958 (Foreach.Resolve): Likewise.
7960 2004-10-18 Martin Baulig <martin@ximian.com>
7962 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7963 `Type' directly, but call ResolveType() on it.
7964 (Probe.DoResolve): Likewise.
7965 (ArrayCreation.LookupType): Likewise.
7966 (TypeOf.DoResolve): Likewise.
7967 (SizeOf.DoResolve): Likewise.
7969 2004-10-18 Raja R Harinath <rharinath@novell.com>
7971 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7974 2004-10-17 John Luke <john.luke@gmail.com>
7976 * class.cs (Operator.GetSignatureForError): use CSharpName
7978 * parameter.cs (Parameter.GetSignatureForError): Returns
7979 correct name even if was not defined.
7981 2004-10-13 Raja R Harinath <rharinath@novell.com>
7984 * class.cs (TypeContainer.EmitContext): New property.
7985 (DefineNestedTypes): Create an emitcontext for each part.
7986 (MethodCore.DoDefineParameters): Use container's emitcontext.
7987 Pass type array to InternalParameters.
7988 (MemberBase.DoDefine): Use container's emitcontext.
7989 (FieldMember.Define): Likewise.
7990 (Event.Define): Likewise.
7991 (SetMethod.GetParameterInfo): Change argument to EmitContext.
7992 Pass type array to InternalParameters.
7993 (SetIndexerMethod.GetParameterInfo): Likewise.
7994 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7995 * delegate.cs (Define): Pass emitcontext to
7996 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
7997 array to InternalParameters.
7998 * expression.cs (ParameterReference.DoResolveBase): Pass
7999 emitcontext to GetParameterInfo.
8000 (ComposedCast.DoResolveAsTypeStep): Remove check on
8001 ec.ResolvingTypeTree.
8002 * parameter.cs (Parameter.Resolve): Change argument to
8003 EmitContext. Use ResolveAsTypeTerminal.
8004 (Parameter.GetSignature): Change argument to EmitContext.
8005 (Parameters.ComputeSignature): Likewise.
8006 (Parameters.ComputeParameterTypes): Likewise.
8007 (Parameters.GetParameterInfo): Likewise.
8008 (Parameters.ComputeAndDefineParameterTypes): Likewise.
8009 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
8010 * support.cs (InternalParameters..ctor): Remove variant that takes
8012 * typemanager.cs (system_intptr_expr): New.
8013 (InitExpressionTypes): Initialize it.
8015 2004-10-12 Chris Toshok <toshok@ximian.com>
8017 * cs-parser.jay: fix location for try_statement and catch_clause.
8019 2004-10-18 Martin Baulig <martin@ximian.com>
8021 * class.cs (FieldMember.Define): Don't access the TypeExpr's
8022 `Type' directly, but call ResolveType() on it.
8023 (MemberBase.DoDefine): Likewise.
8025 * expression.cs (New.DoResolve): Don't access the TypeExpr's
8026 `Type' directly, but call ResolveType() on it.
8027 (ComposedCast.DoResolveAsTypeStep): Likewise.
8029 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
8030 `Type' directly, but call ResolveType() on it.
8032 2004-10-17 John Luke <john.luke@gmail.com>
8034 * class.cs (Operator.GetSignatureForError): use CSharpName
8036 * parameter.cs (Parameter.GetSignatureForError): Returns
8037 correct name even if was not defined.
8039 2004-10-13 Raja R Harinath <rharinath@novell.com>
8042 * class.cs (TypeContainer.EmitContext): New property.
8043 (DefineNestedTypes): Create an emitcontext for each part.
8044 (MethodCore.DoDefineParameters): Use container's emitcontext.
8045 Pass type array to InternalParameters.
8046 (MemberBase.DoDefine): Use container's emitcontext.
8047 (FieldMember.Define): Likewise.
8048 (Event.Define): Likewise.
8049 (SetMethod.GetParameterInfo): Change argument to EmitContext.
8050 Pass type array to InternalParameters.
8051 (SetIndexerMethod.GetParameterInfo): Likewise.
8052 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8053 * delegate.cs (Define): Pass emitcontext to
8054 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
8055 array to InternalParameters.
8056 * expression.cs (ParameterReference.DoResolveBase): Pass
8057 emitcontext to GetParameterInfo.
8058 (ComposedCast.DoResolveAsTypeStep): Remove check on
8059 ec.ResolvingTypeTree.
8060 * parameter.cs (Parameter.Resolve): Change argument to
8061 EmitContext. Use ResolveAsTypeTerminal.
8062 (Parameter.GetSignature): Change argument to EmitContext.
8063 (Parameters.ComputeSignature): Likewise.
8064 (Parameters.ComputeParameterTypes): Likewise.
8065 (Parameters.GetParameterInfo): Likewise.
8066 (Parameters.ComputeAndDefineParameterTypes): Likewise.
8067 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
8068 * support.cs (InternalParameters..ctor): Remove variant that takes
8070 * typemanager.cs (system_intptr_expr): New.
8071 (InitExpressionTypes): Initialize it.
8073 2004-10-12 Chris Toshok <toshok@ximian.com>
8075 * cs-parser.jay: fix location for try_statement and catch_clause.
8077 2004-10-07 Raja R Harinath <rharinath@novell.com>
8079 More DeclSpace.ResolveType avoidance.
8080 * decl.cs (MemberCore.InUnsafe): New property.
8081 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
8082 with newly created EmitContext.
8083 (FieldMember.Define): Likewise.
8084 * delegate.cs (Delegate.Define): Likewise.
8085 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
8086 only if normal name-lookup fails.
8087 (TypeExpr.DoResolve): Enable error-checking.
8088 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
8089 (SizeOf.DoResolve): Likewise.
8090 (ComposedCast.DoResolveAsTypeStep): Likewise.
8091 (StackAlloc.DoResolve): Likewise.
8092 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
8093 (Block.Unsafe): New property.
8094 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
8095 (Unsafe): Set 'unsafe' flag of contained block.
8096 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
8097 (Fixed.Resolve): Likewise.
8098 (Catch.Resolve): Likewise.
8099 (Using.ResolveLocalVariableDecls): Likewise.
8100 (Foreach.Resolve): Likewise.
8102 2004-10-05 John Luke <john.luke@gmail.com>
8104 * cs-parser.jay: add location to error CS0175
8106 2004-10-04 Miguel de Icaza <miguel@ximian.com>
8108 * ecore.cs (Expression.Constantity): Add support for turning null
8111 * const.cs (Const.Define): Allow constants to be reference types
8112 as long as the value is Null.
8114 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
8116 * namespace.cs (NamespaceEntry.Using): No matter which warning
8117 level is set, check if this namespace name has already been added.
8119 2004-10-03 Ben Maurer <bmaurer@ximian.com>
8121 * expression.cs: reftype [!=]= null should always use br[true,false].
8124 2004-10-03 Marek Safar <marek.safar@seznam.cz>
8127 * attribute.cs: Enum conversion moved to
8128 GetAttributeArgumentExpression to be applied to the all
8131 2004-10-01 Raja R Harinath <rharinath@novell.com>
8133 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
8134 * class.c (TypeContainer.DefineType): Flag error if
8135 base types aren't accessible due to access permissions.
8136 * decl.cs (DeclSpace.ResolveType): Move logic to
8137 Expression.ResolveAsTypeTerminal.
8138 (DeclSpace.ResolveTypeExpr): Thin layer over
8139 Expression.ResolveAsTypeTerminal.
8140 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
8141 Refactor code into NestedAccess. Use it.
8142 (DeclSpace.NestedAccess): New.
8143 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
8144 argument to silence errors. Check access permissions.
8145 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
8146 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
8147 (Cast.DoResolve): Likewise.
8148 (New.DoResolve): Likewise.
8149 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
8150 (TypeOf.DoResolve): Likewise.
8152 * expression.cs (Invocation.BetterConversion): Return the Type of
8153 the better conversion. Implement section 14.4.2.3 more faithfully.
8154 (Invocation.BetterFunction): Make boolean. Make correspondence to
8155 section 14.4.2.2 explicit.
8156 (Invocation.OverloadResolve): Update.
8157 (Invocation): Remove is_base field.
8158 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
8159 (Invocation.Emit): Likewise.
8161 2004-09-24 Marek Safar <marek.safar@seznam.cz>
8163 * cs-parser.jay: Reverted 642 warning fix.
8165 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8168 * decl.cs (FindMemberWithSameName): Indexer can have more than
8171 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8173 * expression.cs (LocalVariableReference.DoResolveLValue):
8174 Do not report warning 219 for out values.
8175 (EmptyExpression.Null): New member to avoid extra allocations.
8177 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8179 * cs-parser.jay: Fix wrong warning 642 report.
8181 * cs-tokenizer.cs (CheckNextToken): New helper;
8182 Inspect next character if is same as expected.
8184 2004-09-23 Martin Baulig <martin@ximian.com>
8186 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8187 (Convert.ImplicitReferenceConversionExists): Likewise.
8189 2004-11-09 Raja R Harinath <rharinath@novell.com>
8191 * Makefile (DISTFILES): Comment out a few missing files.
8193 2004-10-29 Raja R Harinath <rharinath@novell.com>
8195 * Makefile (bootstrap_libs,bootstrap_libfiles): New.
8196 (bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
8197 (gmcs.exe): Invoke bootstrap-libs.
8198 (clean-local): Clean the net_2_0_bootstrap profile too.
8199 (PROGRAM_INSTALL_DIR): New.
8200 (install-local): Use it.
8202 2004-10-13 Martin Baulig <martin@ximian.com>
8204 * generic.cs (TypeManager.InflatedConstraints): New nested class.
8205 (TypeParameter.DefineType): If we're a method type parameter and
8206 that method is overriding something, "inflate" its constraints.
8208 2004-10-12 Martin Baulig <martin@ximian.com>
8210 * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
8211 and have type arguments, create and resolve a ConstructedType.
8213 2004-10-12 Martin Baulig <martin@ximian.com>
8215 * decl.cs (MemberCache.FindMemberToOverride): Use
8216 TypeManager.IsEqual() to compare the parameters and Type.Equals()
8217 to compare the invocationType.
8219 * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
8220 When comparing two type parameters, only do the signature-only
8221 comparision for method type parameters.
8223 2004-10-11 Martin Baulig <martin@ximian.com>
8225 * report.cs: Don't make --fatal abort on warnings, we have
8226 -warnaserror for that.
8228 2004-10-11 Martin Baulig <martin@ximian.com>
8231 (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
8232 (TypeManager.IsEqual): Call ourself recursively instead of using
8235 2004-10-11 Martin Baulig <martin@ximian.com>
8237 * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
8238 on our own type parameters, not on the ones we inherit from a containing
8241 * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
8244 * generic.cs (TypeParameter.Define): We may only be called once.
8246 * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
8247 instead of TypeManager.IsEqual().
8249 2004-09-28 Martin Baulig <martin@ximian.com>
8252 (GenericConstraints.EffectiveBaseClass): New public property.
8253 (TypeParameter.GenericConstraints): New public property.
8254 (ConstructedType.CheckConstraints): Improved.
8256 * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
8257 (Convert.TypeParameterConversion): New private method; use this in
8258 ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
8259 for all conversions related to type parameters.
8261 2004-09-24 Martin Baulig <martin@ximian.com>
8263 * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
8264 type parameter conversions for type parameters which are known to
8267 2004-09-24 Martin Baulig <martin@ximian.com>
8269 * generic.cs (GenericConstraints): Added `IsReferenceType' and
8270 `IsValueType' properties.
8272 * support.cs (ReflectionConstraints): Use
8273 Type.GetGenericParameterConstraints() instead of the old hack.
8275 2004-09-24 Martin Baulig <martin@ximian.com>
8277 * generic.cs (GenericConstraints): Moved here and made it an
8280 * support.cs (GenericConstraints): Moved to generic.cs.
8282 2004-09-24 Martin Baulig <martin@ximian.com>
8285 (ReflectionConstraints): Un-nested this class and made it public.
8288 (TypeManager.GetTypeParameterConstraints): New public method.
8289 (TypeManager.HasConstructorConstraint): Use the attributes.
8291 2004-09-24 Martin Baulig <martin@ximian.com>
8293 * support.cs (GenericConstraints): Replaced `HasConstructor',
8294 `IsReferenceType' and `IsValueType' with `Attributes'.
8295 (ReflectionParameters.ReflectionConstraints): Removed the Create()
8296 method and made the .ctor public.
8298 * generic.cs (Constraints.Attributes): New public property.
8299 (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
8300 `IsReferenceType' -> `HasReferenceTypeConstraint' and
8301 `IsValueType' -> `HasValueTypeConstraint'.
8303 2004-09-23 Martin Baulig <martin@ximian.com>
8305 * generic.cs (Constraints): Reflect latest runtime changes.
8307 2004-09-23 Martin Baulig <martin@ximian.com>
8309 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8310 (Convert.ImplicitReferenceConversionExists): Likewise.
8312 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8314 * class.cs (Operator.Define): Add error 448 and 559 report.
8316 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8318 * class.cs (MemberBase.IsTypePermitted): New protected
8319 method for checking error CS0610.
8321 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8323 * class.cs (TypeContainer.HasExplicitLayout): New property
8324 Returns whether container has StructLayout attribute set Explicit.
8325 (FieldMember): New abstract class for consts and fields.
8326 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
8327 (Field): Reuse FieldMember.
8329 * const.cs (Const): Reuse FieldMember.
8331 * rootcontext.cs: EmitConstants call moved to class.
8333 2004-09-22 Martin Baulig <martin@ximian.com>
8335 Marek and me just fixed one of our oldest bugs: #28562 :-)
8337 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
8339 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
8340 we're an EnumConstant, just return that.
8341 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
8342 an EnumConstant. In this case, we need to use GetValueAsEnumType()
8343 to get the value which'll actually be written into the attribute.
8344 However, we have to use GetValue() to access the attribute's value
8347 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8349 * constant.cs (Constant.IsNegative): New abstract property
8352 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
8353 (StackAlloc.DoResolve): Reused IsNegative.
8355 2004-09-22 Martin Baulig <martin@ximian.com>
8357 * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
8358 public method; like LookupTypeContainer, but also works for
8361 * report.cs (Report.SymbolRelatedToPreviousError): Use
8362 TypeManager.LookupGenericTypeContainer().
8364 2004-09-22 Martin Baulig <martin@ximian.com>
8366 Thanks to Peter Sestoft for this bug report.
8368 * expression.cs (Conditional): If both the `trueExpr' and the
8369 `falseExpr' is a NullLiteral, return a NullLiteral.
8371 2004-09-22 Martin Baulig <martin@ximian.com>
8373 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
8374 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
8375 for the "get_Current" call.
8377 2004-09-21 Martin Baulig <martin@ximian.com>
8379 * convert.cs (Convert.ImplicitReferenceConversion): When
8380 converting to an interface type, first check whether we're
8381 converting from a reference type.
8383 2004-09-14 Martin Baulig <martin@ximian.com>
8385 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
8387 2004-09-14 Marek Safar <marek.safar@seznam.cz>
8390 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
8391 called and is obsolete then this member suppress message
8392 when call is inside next [Obsolete] method or type.
8394 * expression.cs: Use TestObsoleteMethodUsage member.
8396 2004-09-14 Martin Baulig <martin@ximian.com>
8398 * genericparser.cs: Removed.
8400 2004-09-13 Marek Safar <marek.safar@seznam.cz>
8402 * class.cs (MethodCore.CheckBase): Fix bug #65757.
8404 2004-09-12 Marek Safar <marek.safar@seznam.cz>
8406 * attribute.cs (Attribute.Resolve): Add error 653 report.
8408 * class.cs (Class.ApplyAttributeBuilder): Add error 641
8410 (Method.ApplyAttributeBuilder): Add error 685 report.
8411 (Operator.Define): Add error 564 report.
8413 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
8415 * expression.cs (Invocation.DoResolve): Add error
8418 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
8421 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8423 * class.cs (ConstructorInitializer.Resolve):
8424 Wrong error number (515->516).
8426 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8428 * class.cs (Indexer.Define): Add error 631 report.
8430 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8432 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
8434 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8436 * expression.cs (Probe.DoResolve): Add error CS0241 report.
8438 2004-09-10 Marek Safar <marek.safar@seznam.cz>
8440 * cs-parser.jay: Added error CS0241 report.
8442 2004-09-10 Raja R Harinath <rharinath@novell.com>
8444 * cs-parser.jay (fixed_statement): Introduce a scope for the
8445 declaration in the 'fixed' statement.
8447 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8449 * cs-parser.jay: Added CS0230 error report.
8451 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8453 * cs-parser.jay: Added errors CS0231 and CS0257 report.
8455 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8457 * expression.cs (Argument.Resolve): Added error CS0192 and
8460 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8462 C# 2.0 #pragma warning feature
8464 * cs-tokenizer.cs (PreProcessPragma): New method;
8465 Handles #pragma directive.
8467 * report.cs (WarningRegions): New class; Support
8468 class for #pragma warning directive. It tests whether
8469 warning is enabled for a given line.
8471 2004-09-08 Miguel de Icaza <miguel@ximian.com>
8473 * const.cs: Add more descriptive error report, tahnks to
8476 2004-09-08 Marek Safar <marek.safar@seznam.cz>
8478 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
8480 2004-09-07 Miguel de Icaza <miguel@ximian.com>
8482 * expression.cs: Apply patch from Ben: Remove dead code from
8483 ArrayCreation, and remove the TurnintoConstant call in const.cs,
8484 as that code just threw an exception anwyays.
8486 * const.cs: Remove the call to the turnintoconstant, for details
8489 * literal.cs: The type of the null-literal is the null type; So
8490 we use a placeholder type (literal.cs:System.Null, defined here)
8493 * expression.cs (Conditional.DoResolve): Remove some old code that
8494 is no longer needed, conversions have been fixed.
8496 (ArrayCreationExpression.DoResolve): Return false if we fail to
8497 resolve the inner expression.
8499 2004-09-07 Raja R Harinath <rharinath@novell.com>
8502 * cs-parser.jay (delegate_declaration): Record a delegate
8503 declaration as a type declaration.
8504 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
8506 2004-09-06 Miguel de Icaza <miguel@ximian.com>
8508 * parameter.cs: Do not crash if the type can not be resolved.
8510 * expression.cs: Report errors with unsafe pointers, fixes #64896
8512 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
8514 * expression.cs: Pointer arith always needs to do a conv.i
8515 if the operand is a long. fix 65320
8517 2004-09-04 Marek Safar <marek.safar@seznam.cz>
8519 Fixed cs0619-37.cs, cs0619-38.cs
8521 * enum.cs (GetObsoleteAttribute): Removed.
8523 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
8524 on Enum member is double staged. The first is tested member
8527 2004-09-04 Marek Safar <marek.safar@seznam.cz>
8529 Fixed #56986, #63631, #65231
8531 * class.cs: (TypeContainer.AddToMemberContainer): New method,
8532 adds member to name container.
8533 (TypeContainer.AddToTypeContainer): New method, adds type to
8535 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8536 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8537 AddOperator): Simplified by reusing AddToMemberContainer.
8538 (TypeContainer.UserDefinedStaticConstructor): Changed to property
8540 (Method.CheckForDuplications): Fixed implementation to test all
8542 (MemberBase): Detection whether member is explicit interface
8543 implementation is now in constructor.
8544 (MemberBase.UpdateMemberName): Handles IndexerName.
8545 (Accessor): Changed to keep also location information.
8546 (AbstractPropertyEventMethod): Is derived from MemberCore.
8547 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8548 will be emited or not.
8549 (PropertyBase.AreAccessorsDuplicateImplementation):
8550 Tests whether accessors are not in collision with some method.
8551 (Operator): Is derived from MethodCore to simplify common
8554 * decl.cs (Flags.TestMethodDuplication): Test for duplication
8556 (DeclSpace.AddToContainer): Adds the member to defined_names
8557 table. It tests for duplications and enclosing name conflicts.
8559 * enum.cs (EnumMember): Clean up to reuse the base structures
8561 2004-09-03 Martin Baulig <martin@ximian.com>
8563 Merged latest changes into gmcs. Please keep this comment in
8564 here, it makes it easier for me to see what changed in MCS since
8565 the last time I merged.
8567 2004-09-03 Martin Baulig <martin@ximian.com>
8569 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8570 into TypeContainer, to make partial classes work again.
8572 2004-09-03 Martin Baulig <martin@ximian.com>
8574 * rootcontext.cs (RootContext.V2): Removed.
8576 2004-03-23 Martin Baulig <martin@ximian.com>
8578 * expression.cs (Invocation.OverloadResolve): Added `bool
8579 may_fail' argument and use it instead of the Location.IsNull() hack.
8581 2004-09-09 Martin Baulig <martin@ximian.com>
8583 * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
8585 2004-09-09 Martin Baulig <martin@ximian.com>
8587 * generic.cs (TypeParameter.DefineType): Added support for
8588 explicit interface methods.
8590 2004-09-09 Martin Baulig <martin@ximian.com>
8592 * README.Changes: New document. Started to list important changes
8593 between MCS and GMCS here.
8595 2004-09-08 Martin Baulig <martin@ximian.com>
8598 (TypeContainer.CheckRecursiveDefinition): New protected method.
8599 (TypeContainer.DefineType): Move the CS0146 check into
8600 CheckRecursiveDefinition().
8602 2004-09-06 Martin Baulig <martin@ximian.com>
8604 * generic.cs (ConstructedType.CheckConstraints): Allow builtin
8605 types for the constructor constraint.
8607 2004-09-03 Martin Baulig <martin@ximian.com>
8609 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8610 into TypeContainer, to make partial classes work again.
8612 2004-09-03 Martin Baulig <martin@ximian.com>
8614 * rootcontext.cs (RootContext.V2): Removed.
8616 2004-03-23 Martin Baulig <martin@ximian.com>
8618 * expression.cs (Invocation.OverloadResolve): Added `bool
8619 may_fail' argument and use it instead of the Location.IsNull() hack.
8621 2004-09-03 Martin Baulig <martin@ximian.com>
8623 Merged latest changes into gmcs. Please keep this comment in
8624 here, it makes it easier for me to see what changed in MCS since
8625 the last time I merged.
8627 2004-09-03 Raja R Harinath <rharinath@novell.com>
8630 * expression.cs (BetterConversion): Don't allow either conversion
8631 to be null. Remove redundant implicit conversion test when 'q ==
8632 null' -- when this function is invoked, we already know that the
8633 implicit conversion exists.
8634 (BetterFunction): Assume that 'best' is non-null. Remove
8635 redundant reimplementation of IsApplicable when 'best' is null.
8636 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
8637 number of arguments.
8638 (IsAncestralType): Extract from OverloadResolve.
8639 (OverloadResolve): Make robust to the MethodGroupExpr being
8640 unsorted. Implement all the logic of Section 14.5.5.1, and
8641 support overloading of methods from multiple applicable types.
8642 Clean up logic somewhat. Don't pass null methods to BetterFunction.
8644 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
8645 (RealError, Warning): Append type of report to related symbol.
8647 2004-09-03 Marek Safar <marek.safar@seznam.cz>
8649 * enum.cs: Fixed CLS-Compliance checks for enum members.
8650 Error tests cs3008-8.cs, cs3014-8.cs
8652 2004-09-02 Marek Safar <marek.safar@seznam.cz>
8654 Fixed bug #62342, #63102
8655 * class.cs: ImplementIndexer uses member.IsExplicitImpl
8656 like ImplementMethod.
8658 2004-09-02 Marek Safar <marek.safar@seznam.cz>
8660 * attribute.cs (Attribute.GetAttributeArgumentExpression):
8663 2004-09-02 Martin Baulig <martin@ximian.com>
8665 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8666 TypeManager.GetArgumentTypes() rather than calling GetParameters()
8669 2004-09-01 Marek Safar <marek.safar@seznam.cz>
8671 C# 2.0 Static classes implemented
8673 * class.cs (TypeContainer): instance_constructors,
8674 initialized_fields, initialized_static_fields,
8675 default_constructor, base_inteface_types are protected to be
8676 accessible from StaticClass.
8677 (TypeContainer.DefineDefaultConstructor): New virtual method
8678 for custom default constructor generating
8679 (StaticClass): New class to handle "Static classes" feature.
8681 * cs-parser.jay: Handle static keyword on class like instance
8684 * driver.cs: Added "/langversion" command line switch with two
8685 options (iso-1, default).
8687 2004-08-31 Marek Safar <marek.safar@seznam.cz>
8689 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8691 2004-08-31 Miguel de Icaza <miguel@ximian.com>
8693 * delegate.cs: Style.
8695 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
8697 * delegate.cs: Add seperate instance expr field for miguel.
8699 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
8701 * PointerArithmetic (Resolve): make sure we are not doing
8702 pointer arith on void*. Also, make sure we are resolved
8703 by not setting eclass until resolve.
8705 All callers: Make sure that PointerArithmetic gets resolved.
8707 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
8709 * ArrayCreation (LookupType): If the type does not resolve
8710 to an array, give an error.
8712 2004-08-27 Marek Safar <marek.safar@seznam.cz>
8714 * statement.cs (Try.Resolve): Fixed bug #64222
8716 2004-08-27 Martin Baulig <martin@ximian.com>
8719 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8722 2004-08-26 Marek Safar <marek.safar@seznam.cz>
8724 * ecore.cs (Constantify): Get underlying type via
8725 System.Enum.GetUnderlyingType to avoid StackOverflow on the
8726 Windows in special cases.
8728 2004-08-26 Marek Safar <marek.safar@seznam.cz>
8730 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8731 for obtaining also private methods.
8732 (GetRemoveMethod): Used GetRemoveMethod (true)
8733 for obtaining also private methods.
8735 2004-09-02 Martin Baulig <martin@ximian.com>
8737 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8738 TypeManager.GetArgumentTypes() rather than calling GetParameters()
8741 2004-08-27 Martin Baulig <martin@ximian.com>
8744 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8747 2004-08-25 Martin Baulig <martin@ximian.com>
8749 * support.cs (ReflectionParameters..ctor): If this is a generic
8750 method, retrieve and store its type parameters.
8751 (InternalParameters..ctor): Added `TypeParameter[]' argument.
8752 (ReflectionParameters.GenericConstraints): The argument specifies
8753 the type parameter, not the method parameter.
8754 (InternalParameters.GenericConstraints): Likewise.
8756 * generic.cs (TypeParameter.DefineType): Correctly handle
8757 constraints wrt. generic methods in interfaces and their
8760 2004-08-24 Martin Baulig <martin@ximian.com>
8762 * generic.cs (TypeParameter.IsSubclassOf): New public method.
8763 (Constraints.IsSubclassOf): New internal method.
8765 * typemanager.cs (TypeManager.FindMembers): Added special support
8766 for GenericTypeParameterBuilder's.
8767 (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
8770 2004-08-24 Martin Baulig <martin@ximian.com>
8773 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8774 this for accessibility checks.
8775 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8776 IsNestedFamilyAccessible.
8777 (TypeManager.IsSubclassOf): New method, do what the name actually
8780 2004-08-24 Martin Baulig <martin@ximian.com>
8782 * expression.cs (MemberAccess.DoResolve): When resolving ourselves
8783 as a SimpleName, include the generic arity.
8785 2004-08-24 Martin Baulig <martin@ximian.com>
8787 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8788 MethodAttributes.HideBySig for operators.
8790 2004-08-23 Martin Baulig <martin@ximian.com>
8792 Back to the old error reporting system :-)
8794 * report.cs (Message): Removed.
8795 (Report.MessageData, ErrorData, WarningData): Removed.
8796 (Report.Error, Warning): Back to the old system.
8798 2004-08-23 Martin Baulig <martin@ximian.com>
8800 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8802 * class.cs (TypeContainer.ParentContainer): New public virtual
8803 method; replaces the explicit interface implementation.
8804 (ClassPart.ParentContainer): Override.
8806 2004-08-23 Martin Baulig <martin@ximian.com>
8808 * statement.cs (Switch): Added support for constant switches; see
8809 #59428 or test-285.cs.
8811 2004-08-22 Marek Safar <marek.safar@seznam.cz>
8814 * statement.cs (GetEnumeratorFilter): Removed useless
8815 logic because C# specs is strict. GetEnumerator must be
8818 2004-08-22 Martin Baulig <martin@ximian.com>
8820 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8821 a switch and may break, reset the barrier. Fixes #59867.
8823 2004-08-22 Marek Safar <marek.safar@seznam.cz>
8825 CLS-Compliance speed up (~5% for corlib)
8827 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8828 New method. Tests container for CLS-Compliant names
8830 * class.cs (TypeContainer.VerifyClsName): New method.
8831 Checks whether container name is CLS Compliant.
8832 (Constructor): Implements IMethodData.
8834 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8835 low-case table for CLS Compliance test.
8836 (MemberCache.VerifyClsParameterConflict): New method.
8837 Checks method parameters for CS3006 error.
8839 * enum.cs (EnumMember): Is derived from MemberCore.
8840 (Enum.VerifyClsName): Optimized for better performance.
8842 2004-08-06 Marek Safar <marek.safar@seznam.cz>
8844 * report.cs: Renamed Error_T to Error and changed all
8847 2004-08-06 Marek Safar <marek.safar@seznam.cz>
8849 * class.cs (TypeContainer.IndexerArrayList): New inner class
8850 container for indexers.
8851 (TypeContainer.DefaultIndexerName): New constant for default
8852 indexer name. Replaced all "Item" with this constant.
8853 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8855 * typemanager.cs (TypeManager.default_member_ctor): Cache here
8856 DefaultMemberAttribute constructor.
8858 2004-08-05 Martin Baulig <martin@ximian.com>
8860 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8863 2004-08-05 Marek Safar <marek.safar@seznam.cz>
8865 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8866 multi platforms problem.
8868 * compiler.csproj: Included shared files.
8870 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8872 Fix bug 60333, 55971 in the more general way
8873 * attribute.cs (Attribute.GetAttributeArgumentExpression):
8874 Added arg_type argument for constant conversion.
8875 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8877 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8880 * class.cs (TypeContainer ): New inner classes MethodArrayList,
8881 OperatorArrayList, MethodCoreArrayList for typecontainer
8882 containers. Changed class member types to these new types.
8883 (MethodArrayList.DefineMembers): Added test for CS0659.
8885 2004-08-04 Miguel de Icaza <miguel@ximian.com>
8887 * cfold.cs: Synchronize the folding with the code in expression.cs
8888 Binary.DoNumericPromotions for uint operands.
8890 * attribute.cs: Revert patch from Raja, it introduced a regression
8891 while building Blam-1.2.1 (hard to isolate a test case).
8893 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8897 (TypeContainer.Define): Renamed to DefineContainerMembers because of
8899 (MethodCore.parent_method): New member. The method we're overriding
8900 if this is an override method.
8901 (MethodCore.CheckBase): Moved from Method class and made common.
8902 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8904 (MethodCore.CheckForDuplications): New abstract method. For custom
8905 member duplication search in a container
8906 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8907 method and its return type.
8908 (Event.conflict_symbol): New member. Symbol with same name in the
8912 (MemberCache.FindMemberWithSameName): New method. The method
8913 is looking for conflict with inherited symbols.
8915 2004-08-04 Martin Baulig <martin@ximian.com>
8917 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8919 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8921 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8923 * report.cs (Message): New enum for better error, warning reference in
8925 (MessageData): New inner abstract class. It generally handles printing of
8926 error and warning messages.
8927 Removed unused Error, Warning, Message methods.
8929 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8931 Fix for cs0592-8.cs test
8933 (Attributable.ValidAttributeTargets): Made public.
8934 (Attribute.ExplicitTarget): New member for explicit target value.
8935 (Attribute.CheckTargets): Now we translate explicit attribute
8936 target to Target here.
8938 2004-08-03 Ben Maurer <bmaurer@ximian.com>
8940 * ecore.cs (MethodGroupExpr): new IsBase property.
8942 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8944 * delegate.cs (DelegateCreation): store a MethodGroupExpr
8945 rather than an instance expr.
8947 (DelegateCreation.Emit): Use the method group rather than
8948 the instance expression. Also, if you have base.Foo as the
8949 method for a delegate, make sure to emit ldftn, not ldftnvirt.
8951 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
8953 (NewDelegate.DoResolve): Only check for the existance of Invoke
8954 if the method is going to be needed. Use MethodGroupExpr.
8956 (NewDelegate.Emit): Remove, DelegateCreation implements this.
8958 * expression.cs: For pointer arith., make sure to use
8959 the size of the type, not the size of the pointer to
8962 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8965 * class.cs (Class): Added error CS0502 test.
8967 2004-08-03 John Luke <jluke@cfl.rr.com>
8968 Raja R Harinath <rharinath@novell.com>
8971 * attribute.cs (Attribute.complained_before): New flag.
8972 (Attribute.ResolveType, Attribute.Resolve),
8973 (Attribute.DefinePInvokeMethod): Set it.
8974 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8976 2004-08-03 Martin Baulig <martin@ximian.com>
8978 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8979 use a user-defined operator; we still need to do numeric
8980 promotions in case one argument is a builtin type and the other
8981 one has an implicit conversion to that type. Fixes #62322.
8983 2004-08-18 Martin Baulig <martin@ximian.com>
8985 * class.cs (Method.Define): Use the correct method name when
8986 creating the MethodBuilder for a generic method.
8988 2004-08-17 Martin Baulig <martin@ximian.com>
8990 * generic.cs (Constraints): Support type parameter constraints.
8992 2004-08-16 Martin Baulig <martin@ximian.com>
8994 * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
8995 (Token.GENERIC_DIMENSION): New token; this is returned if we
8996 encounter an unbound generic type in a typeof() expression.
8998 * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
8999 this token is only generated while parsing a typeof() expression.
9000 (typeof_expression): Removed the old unbound_type hack.
9002 * generic.cs (TypeArguments.IsUnbound): New public property.
9004 * decl.cs (MemberName): Added support for unbound types.
9006 2004-08-14 Martin Baulig <martin@ximian.com>
9009 (TypeManager.IsEqualGenericInstance): New static method.
9010 (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
9011 just used to check accessibility, so follow the rules of 26.1.6.
9013 * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
9014 ConstructedType instead of a TypeExpression if we have type arguments.
9016 * cs-parser.jay (typeof_expression): Support unbound generic types.
9018 * ecore.cs (UnboundTypeExpression): New public class.
9020 2004-08-12 Martin Baulig <martin@ximian.com>
9022 * typemanager.cs (TypeManager.IsNestedChildOf): Use
9023 TypeManager.IsEqual() rather than `=='.
9025 * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
9026 generic instances as well.
9028 2004-08-12 Martin Baulig <martin@ximian.com>
9030 * expression.cs (Invocation.InferType): We can only infer method
9031 type parameters. Fixes #62647.
9033 2004-08-11 Martin Baulig <martin@ximian.com>
9035 * class.cs (TypeContainer.DefineType): Create the TypeBuilder
9036 before resolving the base classes.
9038 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9040 * Makefile: install .mdb file too.
9042 2004-08-05 Martin Baulig <martin@ximian.com>
9044 * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
9045 initializer, the current type is just the TypeBuilder, not the
9046 instantiated generic type.
9047 (FieldExpr.IsFieldInitializer): New public property.
9049 2004-08-04 Martin Baulig <martin@ximian.com>
9051 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9053 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9055 2004-08-03 Martin Baulig <martin@ximian.com>
9057 * class.cs (MethodData.Define): If we're an explicit
9058 implementation, remove the generic arity from the type name.
9060 2004-08-03 Martin Baulig <martin@ximian.com>
9062 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9063 use a user-defined operator; we still need to do numeric
9064 promotions in case one argument is a builtin type and the other
9065 one has an implicit conversion to that type. Fixes #62322.
9067 2004-08-02 Martin Baulig <martin@ximian.com>
9069 * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
9071 (TypeContainer.GetClassBases): Return the unexpanded list of
9072 interfaces; we expand them later.
9073 (TypeContainer.DefineType): After creating the TypeBuilder, call
9074 TypeManager.ExpandInterfaces() to get an expanded and resolved
9077 * ecore.cs (TypeExpr.GetInterfaces): Removed
9079 * generics.cs (Constraints.InterfaceConstraints): Remove.
9080 (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
9081 register the interface constraints.
9084 (TypeManager.AddUserType): Removed the `ifaces' argument.
9085 (TypeManager.AddTypeParameter): Likewise.
9086 (TypeManager.AddUserInterface): Removed, was unused.
9087 (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
9088 `TypeExpr[]' array for the interfaces.
9089 (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
9090 has been defined, returns a list of the resolved interfaces types.
9091 (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
9092 (TypeManager.GetExplicitInterfaces): Likewise.
9094 2004-08-02 Martin Baulig <martin@ximian.com>
9096 * expression.cs (Invocation.EmitCall): If we're invoking a method
9097 on a type parameter, use the new `Constrained' prefix opcode.
9099 2004-08-02 Martin Baulig <martin@ximian.com>
9101 * statement.cs (LocalInfo.Flags): Added `IsThis'.
9102 (LocalInfo.IsThis): New public property.
9103 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
9105 2004-08-01 Martin Baulig <martin@ximian.com>
9107 * class.cs (TypeContainer.GetClassBases): Don't set the default
9108 here since we may get called from GetPartialBases().
9109 (TypeContainer.DefineType): If GetClassBases() didn't return a
9110 parent, use the default one.
9112 2004-07-30 Martin Baulig <martin@ximian.com>
9114 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
9116 * class.cs (SourceMethod): New public class, derive from the
9117 symbol writer's ISourceMethod.
9118 (Method): Use the new symbol writer API.
9120 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
9121 as argument and use the new symbol writer.
9124 (SourceFile): Implement the symbol writer's ISourceFile.
9125 (Location.SymbolDocument): Removed.
9126 (Location.SourceFile): New public property.
9128 * symbolwriter.cs: Use the new symbol writer API.
9130 2004-07-30 Raja R Harinath <rharinath@novell.com>
9132 * Makefile (install-local): Remove. Functionality moved to
9135 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
9137 * Makefile: Install mcs.exe.config file together with mcs.exe.
9138 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
9139 correct runtime version.
9141 2004-07-25 Martin Baulig <martin@ximian.com>
9144 (TypeContainer.RegisterOrder): Removed, this was unused.
9145 (TypeContainer, interface_order): Removed.
9146 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
9147 TypeContainer as argument since we can also be called with a
9148 `PartialContainer' for a partial class/struct/interface.
9149 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
9150 of checking whether we're an `Interface' - we could be a
9152 (PartialContainer.Register): Override; call
9153 AddClass()/AddStruct()/AddInterface() on our parent.
9155 * cs-parser.jay (interface_member_declaration): Add things to the
9156 `current_container', not the `current_class'.
9158 * rootcontext.cs (RegisterOrder): The overloaded version which
9159 takes an `Interface' was unused, removed.
9161 * typemanager.cs (TypeManager.LookupInterface): Return a
9162 `TypeContainer', not an `Interface'.
9163 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
9164 contain a `PartialContainer' for an interface, so check it's
9165 `Kind' to figure out what it is.
9167 2004-07-25 Martin Baulig <martin@ximian.com>
9169 * class.cs (Class.DefaultTypeAttributes): New public constant.
9170 (Struct.DefaultTypeAttributes): Likewise.
9171 (Interface.DefaultTypeAttributes): Likewise.
9172 (PartialContainer.TypeAttr): Override this and add the
9173 DefaultTypeAttributes.
9175 2004-07-25 Martin Baulig <martin@ximian.com>
9177 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
9178 we can just use the `Parent' field instead.
9180 2004-07-25 Martin Baulig <martin@ximian.com>
9182 * class.cs (TypeContainer.Emit): Renamed to EmitType().
9184 2004-07-25 Martin Baulig <martin@ximian.com>
9186 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
9187 our parts before defining any methods.
9188 (TypeContainer.VerifyImplements): Make this virtual.
9189 (ClassPart.VerifyImplements): Override and call VerifyImplements()
9190 on our PartialContainer.
9192 2004-07-25 Martin Baulig <martin@ximian.com>
9194 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
9196 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
9197 argument, we can just use the `Parent' field instead.
9200 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
9201 (MemberBase.DoDefine): Likewise.
9203 2004-07-24 Martin Baulig <martin@ximian.com>
9205 * decl.cs (MemberCore.Parent): New public field.
9206 (DeclSpace.Parent): Moved to MemberCore.
9208 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
9209 (MemberBase.ctor): Added TypeContainer argument, pass it to our
9211 (FieldBase, Field, Operator): Likewise.
9212 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
9213 (EventField, Event): Likewise.
9215 2004-07-23 Martin Baulig <martin@ximian.com>
9217 * class.cs (PartialContainer): New public class.
9218 (ClassPart): New public class.
9219 (TypeContainer): Added support for partial classes.
9220 (TypeContainer.GetClassBases): Splitted some of the functionality
9221 out into GetNormalBases() and GetPartialBases().
9223 * cs-tokenizer.cs (Token.PARTIAL): New token.
9224 (Tokenizer.consume_identifier): Added some hacks to recognize
9225 `partial', but only if it's immediately followed by `class',
9226 `struct' or `interface'.
9228 * cs-parser.jay: Added support for partial clases.
9230 2004-07-23 Martin Baulig <martin@ximian.com>
9232 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
9233 a `DeclSpace' and also made it readonly.
9234 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
9235 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
9236 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
9238 * cs-parser.jay: Pass the `current_class', not the
9239 `current_container' (at the moment, this is still the same thing)
9240 to a new Method, Property, Event, Indexer or Constructor.
9242 2004-07-23 Martin Baulig <martin@ximian.com>
9244 * cs-parser.jay (CSharpParser): Added a new `current_class' field
9245 and removed the `current_interface' one.
9246 (struct_declaration, class_declaration, interface_declaration):
9247 Set `current_class' to the newly created class/struct/interface;
9248 set their `Bases' and call Register() before parsing their body.
9250 2004-07-23 Martin Baulig <martin@ximian.com>
9252 * class.cs (Kind): New public enum.
9253 (TypeContainer): Made this class abstract.
9254 (TypeContainer.Kind): New public readonly field.
9255 (TypeContainer.CheckDef): New public method; moved here from
9257 (TypeContainer.Register): New public abstract method.
9258 (TypeContainer.GetPendingImplementations): New public abstract
9260 (TypeContainer.GetClassBases): Removed the `is_class' and
9261 `is_iface' parameters.
9262 (TypeContainer.DefineNestedTypes): Formerly known as
9264 (ClassOrStruct): Made this class abstract.
9266 * tree.cs (RootTypes): New public type.
9268 2004-07-20 Martin Baulig <martin@ximian.com>
9270 * tree.cs (Tree.RecordNamespace): Removed.
9271 (Tree.Namespaces): Removed.
9273 * rootcontext.cs (RootContext.IsNamespace): Removed.
9275 * cs-parser.jay (namespace_declaration): Just create a new
9276 NamespaceEntry here.
9278 2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
9280 * Makefile: Install gmcs.exe.config file together with gmcs.exe.
9281 * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
9282 entry to make sure it runs in the correct runtime version.
9284 2004-07-18 Martin Baulig <martin@ximian.com>
9286 * generic.cs (ConstructedType.CheckConstraints): Improved
9287 constraints checking.
9289 2004-07-18 Martin Baulig <martin@ximian.com>
9291 * expression.cs (Invocation.BetterMethod): Call
9292 TypeManager.TypeToCoreType() on all types and removed my previous
9293 hack; we're already doig the right thing here.
9295 2004-07-17 Martin Baulig <martin@ximian.com>
9297 * decl.cs (MemberName.MakeName): Create the "class`1" names here.
9299 2004-07-16 Martin Baulig <martin@ximian.com>
9301 * iterators.cs: Added generics support.
9303 2004-07-16 Martin Baulig <martin@ximian.com>
9305 * iterators.cs: Rewrote this. We're now using one single Proxy
9306 class for both the IEnumerable and the IEnumerator interface and
9307 `Iterator' derives from Class so we can use the high-level API.
9309 * class.cs (TypeContainer.AddIterator): New method.
9310 (TypeContainer.DoDefineType): New protected virtual method, which
9311 is called from DefineType().
9312 (TypeContainer.DoDefineMembers): Call DefineType() and
9313 DefineMembers() on all our iterators.
9314 (TypeContainer.Emit): Call Emit() on all our iterators.
9315 (TypeContainer.CloseType): Call CloseType() on all our iterators.
9317 * codegen.cs (EmitContext.CurrentIterator): New public field.
9319 2004-07-15 Martin Baulig <martin@ximian.com>
9322 (TypeManager.not_supported_exception_type): New type.
9324 2004-07-14 Martin Baulig <martin@ximian.com>
9327 (TypeManager.generic_ienumerable_type): New type.
9328 (TypeManager.generic_ienumerator_type): New type.
9331 (RootContext.interfaces_first_stage): Added
9332 "System.Collections.Generic.IEnumerator`1" and
9333 "System.Collections.Generic.IEnumerable`1".
9335 2004-07-14 Martin Baulig <martin@ximian.com>
9337 * iterators.cs: Use real error numbers.
9339 2004-07-14 Martin Baulig <martin@ximian.com>
9341 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
9342 requires this to be a System.Collection.IEnumerable and not a
9343 class implementing that interface.
9344 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
9346 2004-07-13 Marek Safar <marek.safar@seznam.cz>
9348 * class.cs: Fixed previous fix, it broke some error tests.
9350 2004-07-12 Martin Baulig <martin@ximian.com>
9352 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
9355 2004-07-14 Martin Baulig <martin@ximian.com>
9357 * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
9358 an exclamation mark (!) for the generic arity to reflect the
9359 latest spec changes; ie. use "System.Collections.Generic.IList`1".
9361 2004-07-13 Martin Baulig <martin@ximian.com>
9363 * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
9364 specifiers being part of a type argument.
9366 2004-07-13 Martin Baulig <martin@ximian.com>
9368 * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
9369 name for generic types.
9371 2004-07-13 Martin Baulig <martin@ximian.com>
9373 * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
9376 2004-07-09 Miguel de Icaza <miguel@ximian.com>
9378 * assign.cs (LocalTemporary): Add new argument: is_address,If
9379 `is_address' is true, then the value that we store is the address
9380 to the real value, and not the value itself.
9382 * ecore.cs (PropertyExpr): use the new local temporary
9383 stuff to allow us to handle X.Y += z (where X is a struct)
9385 2004-07-08 Martin Baulig <martin@ximian.com>
9387 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
9388 not always return, just like we're doing in Using.Resolve().
9390 2004-07-07 Miguel de Icaza <miguel@ximian.com>
9392 * cs-parser.jay (fixed_statement): flag this as Pinned.
9394 2004-07-06 Miguel de Icaza <miguel@ximian.com>
9396 * typemanager.cs (TypeManager): Removed MakePinned method, this
9397 mechanism is replaced with the .NET 2.x compatible mechanism of
9398 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
9400 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
9401 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
9402 `IsFixed' property which has a different meaning.
9404 2004-07-02 Raja R Harinath <rharinath@novell.com>
9406 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
9407 visible from inside a nested class, not just the names of the
9408 immediately enclosing class.
9411 2004-06-24 Raja R Harinath <rharinath@novell.com>
9413 * expression.cs (BetterConversion): Remove buggy special-case
9414 handling of "implicit constant expression conversions". At this
9415 point, we already know that the conversion is possible -- we're
9416 only checking to see which is better.
9418 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9420 * cs-parser.jay: Added error CS0210 test.
9422 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9424 * cs-parser.jay: Added error CS0134 test.
9426 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9429 * cs-parser.jay: Added error CS0145 test.
9431 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9433 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
9435 2004-06-23 Ben Maurer <bmaurer@ximian.com>
9437 * expression.cs (StackAlloc.Resolve): The argument may not
9438 be a constant; deal with this case.
9440 2004-06-23 Marek Safar <marek.safar@seznam.cz>
9442 * attribute.cs (IndexerName_GetIndexerName): Renamed to
9443 GetIndexerAttributeValue.
9444 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
9446 * class.cs (Indexer.Define): Added error tests for CS0415,
9449 2004-06-23 Miguel de Icaza <miguel@ximian.com>
9451 * attribute.cs (Attribute.Resolve): Keep field code in sync with
9454 2004-06-23 Martin Baulig <martin@ximian.com>
9456 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
9457 neither return nor throw, reset the barrier as well. Fixes #60457.
9459 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
9461 * class.cs : EventAttributes is now set to None by default.
9462 This fixes bug #60459.
9464 2004-06-18 Marek Safar <marek.safar@seznam.cz>
9467 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9468 Don't throw exception but return null (it's sufficient now).
9470 2004-06-18 Marek Safar <marek.safar@seznam.cz>
9472 * typemanager.cs (GetArgumentTypes): Faster implementation.
9474 2004-06-18 Martin Baulig <martin@ximian.com>
9476 * attribute.cs (Attribute.Resolve): Check whether we're an
9477 EmptyCast which a Constant child. Fixes #60333.
9479 2004-06-17 Ben Maurer <bmaurer@ximian.com>
9481 * statement.cs (EmitCollectionForeach): Account for the fact that
9482 not all valuetypes are in areas which we can take the address of.
9483 For these variables, we store to a temporary variable. Also, make
9484 sure that we dont emit a `callvirt' on a valuetype method.
9486 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9488 * expression.cs (StackAlloc.DoReSolve): Added test for
9489 negative parameter (CS0247).
9491 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9494 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
9496 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9499 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
9502 2004-06-14 Marek Safar <marek.safar@seznam.cz>
9504 Fix bug #58254 & cs1555.cs, cs1556.cs
9505 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
9507 2004-06-14 Marek Safar <marek.safar@seznam.cz>
9509 * cs-parser.jay: Added error CS1669 test for indexers.
9511 2004-06-18 Martin Baulig <martin@ximian.com>
9513 * generics.cs (GenericMethod.ctor): Don't take an Attributes
9514 argument. Fixes #60441.
9516 2004-06-16 Ben Maurer <bmaurer@ximian.com>
9517 * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
9518 The name needs to have the actual name of the method in order
9519 for other tests (such as the one in OverloadResolve for Invoke
9520 on a delegate) to work. As well, it does not really help
9521 error reporting because the method group had multiple methods.
9522 * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
9523 Make profiling work.
9525 2004-06-13 Martin Baulig <martin@ximian.com>
9527 * cs-parser.jay: Don't allow generic attributes.
9529 2004-06-13 Martin Baulig <martin@ximian.com>
9531 * class.cs (MemberBase.DoDefineBase): New protected method.
9532 (MemberBase.DoDefine): Compute the `flags' in the new
9533 DoDefineBase() which must be called first.
9534 (Method.Define): Call DoDefineBase() first so we have the flags
9535 when defining the generic method.
9537 * cs-parser.jay (interface_method_declaration): Support generic methods.
9539 2004-06-13 Martin Baulig <martin@ximian.com>
9541 * decl.cs (TypeName): Removed.
9542 (MemberName): Removed TypeName and MemberNow; now we just have
9545 * cs-parser.jay: Don't distinguish between type arguments and type
9546 parameters in the grammar and simplified the rules a bit. The
9547 reduce/reduce conflicts are now gone (except the one we inherited
9550 2004-06-11 Martin Baulig <martin@ximian.com>
9552 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9553 call this twice: for params and varargs methods.
9555 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9558 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9560 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9562 * attribute.cs (Attribute.GetValidTargets): Made public.
9565 (AbstractPropertyEventMethod): New class for better code sharing.
9566 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
9568 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
9570 2004-06-09 Martin Baulig <martin@ximian.com>
9572 * cs-parser.jay: Removed a reduce/reduce conflict.
9574 2004-06-03 Martin Baulig <martin@ximian.com>
9576 * generic.cs (ConstructedType.GetMemberAccess): Renamed to
9577 GetSimpleName() and return a SimpleName.
9579 * ecore.cs (SimpleName.Arguments): New public field.
9580 (SimpleName): Added overloaded ctor which takes an additional
9581 TypeArguments argument.
9582 (SimpleName.SimpleNameResolve): Added support for generic methods.
9583 (MethodGroupExpr.ResolveGeneric): New public method. The code was
9584 formerly in MemberAccess.DoResolve(), but we also need it in
9585 SimpleNameResolve().
9587 * expression.cs (MemberAccess.DoResolve): Use the new
9588 MethodGroupExpr.ResolveGeneric().
9590 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9592 * decl.cs: If possible, use lookuptypedirect here. We can only do
9593 this if there is no `.' after the namespace. Avoids using
9594 LookupType, which does lots of slow processing.
9595 (FindNestedType) New method, does what it says :-).
9596 * namespace.cs: use LookupTypeDirect.
9597 * rootcontext.cs: use membercache, if possible.
9598 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9600 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9603 According to the spec,
9605 In a member access of the form E.I, if E is a single identifier,
9606 and if the meaning of E as a simple-name (§7.5.2) is a constant,
9607 field, property, localvariable, or parameter with the same type as
9608 the meaning of E as a type-name (§3.8), then both possible
9609 meanings of E are permitted.
9611 We did not check that E as a simple-name had the same type as E as
9614 This trivial check gives us 5-7% on bootstrap time.
9616 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9618 * expression.cs (Invocation.OverloadResolve): Avoid the
9619 use of hashtables and boxing here by allocating on demand.
9621 2004-05-30 Martin Baulig <martin@ximian.com>
9623 * rootcontext.cs (RootContext.LookupType): Don't cache things if
9624 we're doing a silent lookup. Don't try to lookup nested types in
9625 TypeManager.object_type (thanks to Ben Maurer).
9627 2004-05-30 Martin Baulig <martin@ximian.com>
9629 Committing a patch from Ben Maurer.
9631 * rootcontext.cs (RootContext.LookupType): Cache negative results.
9633 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9635 * convert.cs: add a trivial cache for overload operator resolution.
9637 2004-05-31 Marek Safar <marek.safar@seznam.cz>
9640 (AttributeTester.GetObsoleteAttribute): Returns instance of
9641 ObsoleteAttribute when type is obsolete.
9644 (TypeContainer.VerifyObsoleteAttribute): Override.
9645 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
9646 (MethodCode.VerifyObsoleteAttribute): Override.
9647 (MemberBase.VerifyObsoleteAttribute): Override.
9650 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
9651 and report proper error.
9654 (Delegate.VerifyObsoleteAttribute): Override.
9657 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
9658 and report proper error.
9659 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
9662 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
9666 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
9667 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
9668 Added test for ObsoleteAttribute.
9671 (Catch): Derived from Statement.
9673 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9675 * decl.cs: If possible, use lookuptypedirect here. We can only do
9676 this if there is no `.' after the namespace. Avoids using
9677 LookupType, which does lots of slow processing.
9678 (FindNestedType) New method, does what it says :-).
9679 * namespace.cs: use LookupTypeDirect.
9680 * rootcontext.cs: use membercache, if possible.
9681 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9683 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9686 According to the spec,
9688 In a member access of the form E.I, if E is a single identifier,
9689 and if the meaning of E as a simple-name (§7.5.2) is a constant,
9690 field, property, localvariable, or parameter with the same type as
9691 the meaning of E as a type-name (§3.8), then both possible
9692 meanings of E are permitted.
9694 We did not check that E as a simple-name had the same type as E as
9697 This trivial check gives us 5-7% on bootstrap time.
9699 2004-05-30 Marek Safar <marek.safar@seznam.cz>
9701 Fixed bug #59071 & cs0160.cs
9702 * statement.cs (Try.Resolve): Check here whether order of catch
9703 clauses matches their dependencies.
9705 2004-05-30 Marek Safar <marek.safar@seznam.cz>
9708 * ecore.cs (SimpleName.SimpleNameResolve): Added test for
9711 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9713 * expression.cs (Invocation.OverloadResolve): Avoid the
9714 use of hashtables and boxing here by allocating on demand.
9716 2004-05-30 Martin Baulig <martin@ximian.com>
9718 * rootcontext.cs (RootContext.LookupType): Don't cache things if
9719 we're doing a silent lookup. Don't try to lookup nested types in
9720 TypeManager.object_type (thanks to Ben Maurer).
9722 2004-05-30 Martin Baulig <martin@ximian.com>
9724 Committing a patch from Ben Maurer.
9726 * rootcontext.cs (RootContext.LookupType): Cache negative results.
9728 2004-05-29 Martin Baulig <martin@ximian.com>
9730 * class.cs (IMethodData.ShouldIgnore): New method.
9732 * typemanager.cs (TypeManager.MethodFlags): Don't take a
9733 `Location' argument, we don't need it anywhere. Use
9734 `IMethodData.ShouldIgnore ()' instead of
9735 `MethodData.GetMethodFlags ()'.
9736 (TypeManager.AddMethod): Removed.
9737 (TypeManager.AddMethod2): Renamed to AddMethod.
9739 2004-05-29 Martin Baulig <martin@ximian.com>
9741 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9743 * convert.cs (Convert.ImplicitReferenceConversion): If we're
9744 converting from a class type S to an interface type and we already
9745 have an object on the stack, don't box it again. Fixes #52578.
9747 2004-05-29 Martin Baulig <martin@ximian.com>
9749 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9750 Added support for `params' parameters. Fixes #59267.
9752 2004-05-29 Martin Baulig <martin@ximian.com>
9754 * literal.cs (NullPointer): Provide a private .ctor which sets
9755 `type' to TypeManager.object_type. Fixes #59048.
9757 2004-05-29 Martin Baulig <martin@ximian.com>
9759 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9760 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
9762 * ecore.cs (EventExpr.instance_expr): Make the field private.
9764 2004-05-26 Marek Safar <marek.safar@seznam.cz>
9766 Fixed bug #50080 & cs0214-2.cs
9767 * expression.cs (Cast.DoResolve): Check unsafe context here.
9769 * statement.cs (Resolve.DoResolve): Likewise.
9771 2004-05-26 Martin Baulig <martin@ximian.com>
9773 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9775 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9776 (RootContext.LookupType): Pass down the `silent' flag.
9778 2004-05-25 Martin Baulig <martin@ximian.com>
9781 (MethodGroupExpr.IdenticalTypeName): New public property.
9782 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9783 expression actually refers to a type.
9785 2004-05-25 Martin Baulig <martin@ximian.com>
9787 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9788 for #56176 and made it actually work.
9790 2004-05-25 Martin Baulig <martin@ximian.com>
9792 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9793 (FieldExpr, PropertyExpr): Override and implement
9794 CacheTemporaries. Fixes #52279.
9796 2004-05-25 Miguel de Icaza <miguel@ximian.com>
9798 * location.cs: In the new compiler listing a file twice is a
9799 warning, not an error.
9801 2004-05-24 Martin Baulig <martin@ximian.com>
9803 * enum.cs (Enum.DefineType): For the `BaseType' to be a
9804 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
9806 2004-05-24 Martin Baulig <martin@ximian.com>
9808 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9809 walking the `using' list. Fixes #53921.
9811 2004-05-24 Martin Baulig <martin@ximian.com>
9813 * const.cs (Const.LookupConstantValue): Added support for
9814 EmptyCast's; fixes #55251.
9816 2004-05-24 Martin Baulig <martin@ximian.com>
9818 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9819 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9820 which does the CS0135 check. The reason is that we first need to
9821 check whether the variable actually exists.
9823 2004-05-24 Martin Baulig <martin@ximian.com>
9825 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9826 than RootContext.LookupType() to find the explicit interface
9829 2004-05-24 Raja R Harinath <rharinath@novell.com>
9831 * Makefile: Simplify. Use executable.make.
9832 * mcs.exe.sources: New file. List of sources of mcs.exe.
9834 2004-05-24 Anders Carlsson <andersca@gnome.org>
9838 Use the invariant culture when doing String.Compare for CLS case
9841 2004-05-23 Martin Baulig <martin@ximian.com>
9843 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9844 don't have any dots. Fixes #52622, added cs0246-8.cs.
9846 * namespace.cs (NamespaceEntry.Lookup): Likewise.
9848 2004-05-23 Marek Safar <marek.safar@seznam.cz>
9850 * class.cs (MemberBase.Define): Reuse MemberType member for
9851 resolved type. Other methods can use it too.
9853 2004-05-23 Martin Baulig <martin@ximian.com>
9855 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9856 the variable also exists in the current block (otherwise, we need
9857 to report a CS0103). Fixes #58670.
9859 2004-05-23 Martin Baulig <martin@ximian.com>
9861 * flowanalysis.cs (Reachability.Reachable): Compute this
9862 on-the-fly rather than storing it as a field.
9864 2004-05-23 Martin Baulig <martin@ximian.com>
9866 * flowanalysis.cs (Reachability.And): Manually compute the
9867 resulting `barrier' from the reachability.
9869 2004-05-23 Marek Safar <marek.safar@seznam.cz>
9872 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9873 instance of ObsoleteAttribute when symbol is obsolete.
9876 (IMethodData): Extended interface for ObsoleteAttribute support.
9878 2004-05-22 Marek Safar <marek.safar@seznam.cz>
9880 * attribute.cs: Fix bug #55970
9882 2004-05-22 Marek Safar <marek.safar@seznam.cz>
9886 (GetObsoleteAttribute): New method. Creates the instance of
9888 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9889 ObsoleteAttribute when member is obsolete.
9890 (AttributeTester.Report_ObsoleteMessage): Common method for
9891 Obsolete error/warning reporting.
9894 (TypeContainer.base_classs_type): New member for storing parent type.
9897 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9898 for this MemberCore.
9900 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9902 * attribute.cs, const.cs: Fix bug #58590
9904 2004-05-21 Martin Baulig <martin@ximian.com>
9906 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9907 out parameters if the end of the method is unreachable. Fixes
9910 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9912 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9913 Hari was right, why extra method.
9915 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9917 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9919 2004-05-20 Martin Baulig <martin@ximian.com>
9921 * delegate.cs: Convert this file to Unix mode - like the original
9924 2004-05-20 Martin Baulig <martin@ximian.com>
9926 * attribute.cs: Convert this file to Unix mode - like the original
9929 2004-05-19 Marek Safar <marek.safar@seznam.cz>
9931 Fix bug #58688 (MCS does not report error when the same attribute
9934 * attribute.cs (Attribute.Emit): Distinction between null and default.
9936 2004-05-19 Raja R Harinath <rharinath@novell.com>
9938 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9939 of a top-level attribute without an attribute target.
9940 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
9942 (Attribute.Conditional_GetConditionName),
9943 (Attribute.Obsolete_GetObsoleteMessage): Update.
9944 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
9945 part of ScanForIndexerName.
9946 (Attribute.CanIgnoreInvalidAttribute): New function.
9947 (Attribute.ScanForIndexerName): Move to ...
9948 (Attributes.ScanForIndexerName): ... here.
9949 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9950 (Attributes.Search): New internal variant that can choose not to
9951 complain if types aren't resolved. The original signature now
9953 (Attributes.GetClsCompliantAttribute): Use internal variant, with
9954 complaints suppressed.
9955 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9956 only if it not useful.
9957 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9958 top-level for attributes that are shared between the assembly
9959 and a top-level class.
9960 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9961 * class.cs: Update to reflect changes.
9962 (DefineIndexers): Fuse loops.
9963 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
9964 a couple more variants of attribute names.
9966 2004-05-18 Marek Safar <marek.safar@seznam.cz>
9968 Fix bug #52585 (Implemented explicit attribute declaration)
9971 (Attributable.ValidAttributeTargets): New abstract method. It gets
9972 list of valid attribute targets for explicit target declaration.
9973 (Attribute.Target): It holds target itself.
9974 (AttributeSection): Removed.
9975 (Attribute.CheckTargets): New method. It checks whether attribute
9976 target is valid for the current element.
9979 (EventProperty): New class. For events that are declared like
9980 property (with add and remove accessors).
9981 (EventField): New class. For events that are declared like field.
9984 * cs-parser.jay: Implemented explicit attribute target declaration.
9986 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
9987 Override ValidAttributeTargets.
9990 (ReturnParameter): Class for applying custom attributes on
9992 (ParameterAtribute): New class. Class for applying custom
9993 attributes on the parameter type.
9995 2004-05-17 Miguel de Icaza <miguel@ximian.com>
9997 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
10000 (Method): Allow UNSAFE here.
10002 * modifiers.cs: Support unsafe reporting.
10004 2004-05-17 Marek Safar <marek.safar@seznam.cz>
10006 * decl.cs: Fix bug #58478.
10008 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10010 * statement.cs: When checking for unreachable code on an EmptyStatement,
10011 set the location. Fixes bug #58488.
10013 2004-05-13 Miguel de Icaza <miguel@ximian.com>
10015 * driver.cs: Add -pkg handling.
10017 From Gonzalo: UseShelLExecute=false
10019 2004-05-12 Marek Safar <marek.safar@seznam.cz>
10022 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
10024 (Attribute.IsClsCompliaceRequired): Moved to base for better
10026 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
10027 when attribute is AttributeUsageAttribute.
10028 (Attribute.GetValidTargets): Simplified.
10029 (Attribute.GetAttributeUsage): New method returns AttributeUsage
10030 attribute for this type.
10031 (Attribute.ApplyAttributes): Method renamed to Emit and make
10033 (GlobalAttributeSection): New class for special handling of global
10034 attributes (assembly, module).
10035 (AttributeSection.Emit): New method.
10037 * class.cs: Implemented Attributable abstract methods.
10038 (MethodCore.LabelParameters): Moved to Parameter class.
10039 (Accessor): Is back simple class.
10040 (PropertyMethod): Implemented Attributable abstract class.
10041 (DelegateMethod): Implemented Attributable abstract class.
10042 (Event): New constructor for disctintion between normal Event
10043 and Event with accessors.
10045 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
10047 * codegen.cs, const.cs, decl.cs, delegate.cs:
10048 (CommonAssemblyModulClass): Implemented Attributable abstract class
10051 * enum.cs: Implement IAttributeSupport interface.
10052 (EnumMember): New class for emum members. Implemented Attributable
10056 (ParameterBase): Is abstract.
10057 (ReturnParameter): New class for easier [return:] attribute handling.
10059 * typemanager.cs: Removed builder_to_attr.
10061 2004-05-11 Raja R Harinath <rharinath@novell.com>
10064 * attribute.cs (Attribute.GetPositionalValue): New function.
10065 * class.cs (TypeContainer.VerifyMembers): New function.
10066 (TypeContainer.Emit): Use it.
10067 (ClassOrStruct): New base class for Class and Struct.
10068 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
10069 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
10071 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
10072 then each non-static field should have a FieldOffset attribute.
10073 Otherwise, none of the fields should have a FieldOffset attribute.
10074 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
10075 and FieldOffset attributes.
10076 * typemanager.cs (TypeManager.struct_layout_attribute_type)
10077 (TypeManager.field_offset_attribute_type): New core types.
10078 (TypeManager.InitCoreTypes): Initialize them.
10080 2004-05-11 Michal Moskal <malekith@pld-linux.org>
10082 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
10083 Return correct type.
10086 2004-05-09 Miguel de Icaza <miguel@ximian.com>
10088 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
10089 be implicitly converted to ulong.
10091 * expression.cs: The logic for allowing operator &, | and ^ worked
10092 was wrong, it worked before because we did not report an error in
10093 an else branch. Fixes 57895.
10095 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
10096 allow volatile fields to be reference types.
10098 2004-05-07 Miguel de Icaza <miguel@ximian.com>
10100 * driver.cs: Add support for /debug-
10102 2004-05-07 Raja R Harinath <rharinath@novell.com>
10104 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
10105 Add a 'complain' parameter to silence errors.
10106 (Attribute.Resolve): Update to changes. Put in sanity check to catch
10107 silently overlooked type-resolutions.
10108 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
10109 to reflect changes.
10110 (Attributes.Search): New function.
10111 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
10112 (Attributes.GetAttributeFullName): Remove hack.
10113 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
10114 Update to reflect changes.
10115 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10116 Use Attributes.Search instead of nested loops.
10118 2004-05-07 Marek Safar <marek.safar@seznam.cz>
10121 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
10122 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
10123 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
10125 * report.cs: (Report.Warning): Renamed to Warning_T because of
10126 parameter collision.
10128 2004-05-05 Raja R Harinath <rharinath@novell.com>
10130 * expression.cs (MemberAccess.ResolveMemberAccess):
10131 Exit with non-zero status after Report.Error.
10132 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
10134 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
10136 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
10138 * support.cs: Don't hang when the file is empty.
10140 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
10142 * support.cs: In SeekableStreamReader, compute the preamble size of the
10143 underlying stream. Position changes should take into account that initial
10146 2004-05-03 Todd Berman <tberman@sevenl.net>
10148 * driver.cs: remove unused GetSysVersion function.
10150 2004-05-03 Todd Berman <tberman@sevenl.net>
10152 * driver.cs: Remove the hack from saturday, as well as the hack
10153 from jackson (LoadAssemblyFromGac), also adds the CWD to the
10154 link_paths to get that bit proper.
10156 2004-05-01 Todd Berman <tberman@sevenl.net>
10158 * driver.cs: Try a LoadFrom before a Load, this checks the current
10159 path. This is currently a bug in mono that is be fixed, however, this
10160 provides a workaround for now. This will be removed when the bug
10163 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
10165 * CryptoConvert.cs: Updated to latest version. Fix issue with
10166 incomplete key pairs (#57941).
10168 2004-05-01 Todd Berman <tberman@sevenl.net>
10170 * driver.cs: Remove '.' from path_chars, now System.* loads properly
10173 2004-04-30 Jackson Harper <jackson@ximian.com>
10175 * codegen.cs: Open keys readonly.
10177 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10179 * typemanager.cs: don't report cyclic struct layout when a struct
10180 contains 2 or more fields of the same type. Failed for Pango.AttrShape
10181 which has 2 Pango.Rectangle fields.
10183 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
10185 * expression.cs: Handle IntPtr comparisons with IL code
10186 rather than a method call.
10188 2004-04-29 Martin Baulig <martin@ximian.com>
10190 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
10191 the list of PropertyInfo's in class hierarchy and find the
10192 accessor. Fixes #56013.
10194 2004-04-29 Martin Baulig <martin@ximian.com>
10196 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
10198 2004-04-29 Martin Baulig <martin@ximian.com>
10200 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10202 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
10204 2004-04-29 Martin Baulig <martin@ximian.com>
10206 * class.cs (ConstructorInitializer.Resolve): Check whether the
10207 parent .ctor is accessible. Fixes #52146.
10209 2004-04-29 Martin Baulig <martin@ximian.com>
10211 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10213 * statement.cs (Using.EmitLocalVariableDecls): Use
10214 TypeManager.idisposable_type, not typeof (IDisposable).
10215 (Foreach.EmitCollectionForeach): Added support for valuetypes.
10217 2004-04-29 Martin Baulig <martin@ximian.com>
10219 * class.cs (Event.Define): Don't emit the field and don't set
10220 RTSpecialName and SpecialName for events on interfaces. Fixes
10223 2004-04-29 Raja R Harinath <rharinath@novell.com>
10225 Refactor Attribute.ApplyAttributes.
10226 * attribute.cs (Attributable): New base class for objects that can
10227 have Attributes applied on them.
10228 (Attribute): Make AttributeUsage fields public.
10229 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
10230 (Attribute.IsInternalCall): New property.
10231 (Attribute.UsageAttr): Convert to a public read-only property.
10232 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
10233 (Attribute.ResolveType, Attribute.Resolve)
10234 (Attribute.ScanForIndexerName): Update to reflect changes.
10235 (Attribute.CheckAttributeTarget): Re-format.
10236 (Attribute.ApplyAttributes): Refactor, to various
10237 Attributable.ApplyAttributeBuilder methods.
10238 * decl.cs (MemberCore): Make Attributable.
10239 * class.cs (Accessor): Make Attributable.
10240 (MethodData.ApplyAttributes): Use proper attribute types, not
10242 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
10243 (TypeContainer.ApplyAttributeBuilder)
10244 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
10245 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
10246 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
10247 (Operator.ApplyAttributeBuilder): New factored-out methods.
10248 * const.cs (Const.ApplyAttributeBuilder): Likewise.
10249 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
10250 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
10251 * parameter.cs (ParameterBase): New Attributable base class
10252 that can also represent Return types.
10253 (Parameter): Update to the changes.
10255 2004-04-29 Jackson Harper <jackson@ximian.com>
10257 * driver.cs: Prefer the corlib system version when looking for
10258 assemblies in the GAC. This is still a hack, but its a better hack
10261 2004-04-29 Marek Safar <marek.safar@seznam.cz>
10263 * decl.cs, enum.cs: Improved error 3005 reporting.
10265 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
10266 (related_symbols): New private member for list of symbols
10267 related to reported error/warning.
10269 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
10271 2004-04-29 Martin Baulig <martin@ximian.com>
10273 * ecore.cs (Expression.Constantify): If we're an enum and
10274 TypeManager.TypeToCoreType() doesn't give us another type, use
10275 t.UnderlyingSystemType. Fixes #56178.
10277 2004-04-29 Martin Baulig <martin@ximian.com>
10279 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
10280 interfaces and for each interface, only add members directly
10281 declared in that interface. Fixes #53255.
10283 2004-04-28 Martin Baulig <martin@ximian.com>
10285 * expression.cs (ConditionalLogicalOperator): Use a temporary
10286 variable for `left' to avoid that we evaluate it more than once;
10289 2004-04-28 Martin Baulig <martin@ximian.com>
10291 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
10294 2004-04-28 Martin Baulig <martin@ximian.com>
10296 * statement.cs (LocalInfo.Resolve): Check whether the type is not
10299 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
10300 whether the type is not void (CS1547).
10302 2004-04-28 Martin Baulig <martin@ximian.com>
10304 * expression.cs (Unary.DoResolveLValue): Override this and report
10305 CS0131 for anything but Operator.Indirection.
10307 2004-04-28 Martin Baulig <martin@ximian.com>
10309 Committing a patch from Ben Maurer; see bug #50820.
10311 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10314 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10317 2004-04-28 Martin Baulig <martin@ximian.com>
10319 Committing a patch from Ben Maurer; see bug #50820.
10321 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10324 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10327 2004-04-28 Martin Baulig <martin@ximian.com>
10329 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
10330 (Block.AddLabel): Call DoLookupLabel() to only search in the
10333 2004-04-28 Martin Baulig <martin@ximian.com>
10335 * cfold.cs (ConstantFold.BinaryFold): Added special support for
10336 comparing StringConstants and NullLiterals in Equality and Inequality.
10338 2004-04-28 Jackson Harper <jackson@ximian.com>
10340 * driver.cs: Attempt to load referenced assemblies from the
10341 GAC. This is the quick and dirty version of this method that
10342 doesnt take into account versions and just takes the first
10343 canidate found. Will be good enough for now as we will not have more
10344 then one version installed into the GAC until I update this method.
10346 2004-04-28 Martin Baulig <martin@ximian.com>
10348 * typemanager.cs (TypeManager.CheckStructCycles): New public
10349 static method to check for cycles in the struct layout.
10351 * rootcontext.cs (RootContext.PopulateTypes): Call
10352 TypeManager.CheckStructCycles() for each TypeContainer.
10353 [Note: We only need to visit each type once.]
10355 2004-04-28 Martin Baulig <martin@ximian.com>
10357 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
10359 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
10360 success and added `out object value'. Use a `bool resolved' field
10361 to check whether we've already been called rather than
10362 `ConstantValue != null' since this breaks for NullLiterals.
10364 2004-04-28 Raja R Harinath <rharinath@novell.com>
10366 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
10367 setting of this flag, since the 'set' method may be non-public.
10369 2004-04-28 Raja R Harinath <rharinath@novell.com>
10371 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
10372 check on current_vector.Block.
10374 2004-04-27 Martin Baulig <martin@ximian.com>
10376 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
10377 a field initializer. Fixes #56459.
10379 2004-04-27 Martin Baulig <martin@ximian.com>
10381 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
10382 we're not attempting to use an indexer. Fixes #52154.
10384 2004-04-27 Martin Baulig <martin@ximian.com>
10386 * statement.cs (Return): Don't create a return label if we don't
10387 need it; reverts my change from January 20th. Thanks to Ben
10390 2004-04-27 Martin Baulig <martin@ximian.com>
10392 According to the spec, `goto' can only leave a nested scope, but
10395 * statement.cs (Block.LookupLabel): Only lookup in the current
10396 block, don't recurse into parent or child blocks.
10397 (Block.AddLabel): Check in parent and child blocks, report
10398 CS0140/CS0158 if we find a duplicate.
10399 (Block): Removed this indexer for label lookups.
10400 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
10401 this already does the error reporting for us.
10404 (FlowBranching.UsageVector.Block): New public variable; may be null.
10405 (FlowBranching.CreateSibling): Added `Block' argument.
10406 (FlowBranching.LookupLabel): New public virtual method. Lookup a
10407 label for the target of a `goto' and check whether we're not
10408 leaving a `finally'.
10410 2004-04-27 Martin Baulig <martin@ximian.com>
10412 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10413 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
10416 2004-04-27 Martin Baulig <martin@ximian.com>
10418 * statement.cs (Block.AddLabel): Also check for implicit blocks
10419 and added a CS0158 check.
10421 2004-04-27 Martin Baulig <martin@ximian.com>
10423 * flowanalysis.cs (FlowBranchingLoop): New class.
10424 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
10425 UsageVector's instead of an ArrayList.
10426 (FlowBranching.Label): Likewise.
10427 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
10428 (FlowBranching.AddBreakVector): New method.
10430 2004-04-27 Miguel de Icaza <miguel@ximian.com>
10432 * attribute.cs: Small regression fix: only convert the type if we
10433 the type is different, fixes System.Drawing build.
10435 2004-04-27 Martin Baulig <martin@ximian.com>
10437 * attribute.cs (Attribute.Resolve): If we have a constant value
10438 for a named field or property, implicity convert it to the correct
10441 2004-04-27 Raja R Harinath <rharinath@novell.com>
10443 * statement.cs (Block.Block): Implicit blocks share
10444 'child_variable_names' fields with parent blocks.
10445 (Block.AddChildVariableNames): Remove.
10446 (Block.AddVariable): Mark variable as "used by a child block" in
10447 every surrounding block.
10448 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
10449 been used in a child block, complain about violation of "Invariant
10450 meaning in blocks" rule.
10451 * cs-parser.jay (declare_local_variables): Don't use
10452 AddChildVariableNames.
10453 (foreach_statement): Don't create an implicit block: 'foreach'
10454 introduces a scope.
10456 2004-04-23 Miguel de Icaza <miguel@ximian.com>
10458 * convert.cs (ImplicitNumericConversion): 0 is also positive when
10459 converting from 0L to ulong. Fixes 57522.
10461 2004-04-22 Marek Safar <marek.safar@seznam.cz>
10463 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
10464 derived class hides via 'new' keyword field from base class (test-242.cs).
10465 TODO: Handle this in the more general way.
10467 * class.cs (CheckBase): Ditto.
10469 2004-04-22 Marek Safar <marek.safar@seznam.cz>
10471 * decl.cs (caching_flags): New member for storing cached values
10473 (MemberCore.Flags): New enum where bit flags for caching_flags
10475 (MemberCore.cls_compliance): Moved to caching_flags.
10476 (DeclSpace.Created): Moved to caching_flags.
10478 * class.cs: Use caching_flags instead of DeclSpace.Created
10480 2004-04-21 Miguel de Icaza <miguel@ximian.com>
10482 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
10483 if we are only a derived class, not a nested class.
10485 * typemanager.cs: Same as above, but do this at the MemberLookup
10486 level (used by field and methods, properties are handled in
10487 PropertyExpr). Allow for the qualified access if we are a nested
10490 2004-04-21 Marek Safar <marek.safar@seznam.cz>
10492 * class.cs: Refactoring.
10493 (IMethodData): New inteface; Holds links to parent members
10494 to avoid member duplication (reduced memory allocation).
10495 (Method): Implemented IMethodData interface.
10496 (PropertyBase): New inner classes for get/set methods.
10497 (PropertyBase.PropertyMethod): Implemented IMethodData interface
10498 (Event): New inner classes for add/remove methods.
10499 (Event.DelegateMethod): Implemented IMethodData interface.
10501 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
10502 EmitContext (related to class.cs refactoring).
10504 2004-04-21 Raja R Harinath <rharinath@novell.com>
10506 * delegate.cs (Delegate.VerifyApplicability): If the number of
10507 arguments are the same as the number of parameters, first try to
10508 verify applicability ignoring any 'params' modifier on the last
10512 2004-04-08 Martin Baulig <martin@ximian.com>
10514 Merged latest changes into gmcs. Please keep this comment in
10515 here, it makes it easier for me to see what changed in MCS since
10516 the last time I merged.
10518 2004-04-16 Raja R Harinath <rharinath@novell.com>
10520 * class.cs (TypeContainer.AddIndexer): Use
10521 'ExplicitInterfaceName' to determine if interface name was
10522 explicitly specified. 'InterfaceType' is not initialized at this time.
10523 (TypeContainer.DefineIndexers): Remove use of temporary list. The
10524 Indexers array is already in the required order. Initialize
10525 'IndexerName' only if there are normal indexers.
10526 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10527 (TypeContainer.Emit): Emit DefaultMember attribute only if
10528 IndexerName is initialized.
10531 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
10533 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10536 2004-04-15 Raja R Harinath <rharinath@novell.com>
10538 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10542 * attribute.cs (Attribute.Resolve): Check for duplicate named
10546 2004-04-15 Miguel de Icaza <miguel@ximian.com>
10548 * iterators.cs (MarkYield): track whether we are in an exception,
10549 and generate code accordingly. Use a temporary value to store the
10550 result for our state.
10552 I had ignored a bit the interaction of try/catch with iterators
10553 since their behavior was not entirely obvious, but now it is
10554 possible to verify that our behavior is the same as MS .NET 2.0
10558 2004-04-14 Miguel de Icaza <miguel@ximian.com>
10560 * iterators.cs: Avoid creating temporaries if there is no work to
10563 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10564 Enumerations, use TypeManager.EnumToUnderlying and call
10567 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10570 (This.Emit): Use EmitContext.EmitThis to emit our
10573 (This.EmitAssign): Ditto.
10575 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
10576 codepaths, we will move all the functionality into
10579 (FieldExpr.EmitAssign): Ditto.
10581 This fixes several hidden bugs that I uncovered while doing a code
10582 review of this today.
10584 * codegen.cs (EmitThis): reworked so the semantics are more clear
10585 and also support value types "this" instances.
10587 * iterators.cs: Changed so that for iterators in value types, we
10588 do not pass the value type as a parameter.
10590 Initialization of the enumerator helpers is now done in the caller
10591 instead of passing the parameters to the constructors and having
10592 the constructor set the fields.
10594 The fields have now `assembly' visibility instead of private.
10596 2004-04-11 Miguel de Icaza <miguel@ximian.com>
10598 * expression.cs (Argument.Resolve): Check if fields passed as ref
10599 or out are contained in a MarshalByRefObject.
10601 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
10602 another compiler type.
10604 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
10606 * class.cs (Indexer.Define): use the new name checking method.
10607 Also, return false on an error.
10608 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
10609 (is_identifier_[start/part]_character): make static.
10611 2004-04-10 Miguel de Icaza <miguel@ximian.com>
10613 * expression.cs (Binary.ResolveOperator): Do no append strings
10614 twice: since we can be invoked more than once (array evaluation)
10615 on the same concatenation, take care of this here. Based on a fix
10616 from Ben (bug #56454)
10618 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
10620 * codegen.cs: Fix another case where CS1548 must be reported (when
10621 delay-sign isn't specified and no private is available #56564). Fix
10622 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
10623 error when MCS is used on the MS runtime and we need to delay-sign
10624 (which seems unsupported by AssemblyBuilder - see #56621).
10626 2004-04-08 Marek Safar <marek.safar@seznam.cz>
10628 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
10629 (TypeManager.ComputeNamespaces): Faster implementation for
10632 * compiler.csproj: Updated AssemblyName to mcs.
10634 2004-05-11 Jackson Harper <jackson@ximian.com>
10636 * Makefile: Preserve MONO_PATH
10638 2004-05-11 Jackson Harper <jackson@ximian.com>
10640 * Makefile: Use mono and mcs to build gmcs
10642 2004-05-03 Miguel de Icaza <miguel@ximian.com>
10644 * codegen.cs: Add patch from Robert Shade
10645 <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
10648 2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
10650 * CryptoConvert.cs: Updated to latest version. Fix issue with
10651 incomplete key pairs (#57941).
10653 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
10655 * codegen.cs: Fix another case where CS1548 must be reported (when
10656 delay-sign isn't specified and no private is available #56564). Fix
10657 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
10658 error when MCS is used on the MS runtime and we need to delay-sign
10659 (which seems unsupported by AssemblyBuilder - see #56621).
10661 2004-04-29 Jackson Harper <jackson@ximian.com>
10663 * Makefile: Set MONO_PATH to use the bootstrap corlib
10664 * driver.cs: Check the GAC for referenced assemblies.
10666 2004-04-29 Martin Baulig <martin@ximian.com>
10668 * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
10670 2004-04-07 Martin Baulig <martin@ximian.com>
10672 * expression.cs (Binary.ResolveOperator): Added special case for
10673 Equality/Inequality between a type parameter and a null literal.
10675 2004-04-07 Martin Baulig <martin@ximian.com>
10677 * convert.cs: Check null literal -> type parameter conversions.
10679 2004-04-07 Martin Baulig <martin@ximian.com>
10681 * generic.cs (ConstructedType.CheckConstraints): Enforce the
10682 `class' and `struct' constraints.
10684 2004-04-07 Martin Baulig <martin@ximian.com>
10686 * generic.cs (SpecialConstraint): New public enum.
10687 (Constraints.Resolve): Added support for the `class' and `struct'
10690 * cs-parser.jay (type_parameter_constraint): Added support for the
10691 `class' and `struct' constraints.
10693 2004-04-07 Martin Baulig <martin@ximian.com>
10695 * support.cs (GenericConstraints): Replaced `Types' by
10696 `ClassConstraint' and `InterfaceConstraints'; added
10697 `HasClassConstraint'.
10699 2004-04-07 Martin Baulig <martin@ximian.com>
10702 (Constraints.InterfaceConstraints): New public property.
10703 (Constraints.Types): Make this property public
10704 (TypeParameter): Implement IMemberContainer.
10705 (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
10706 instead of a TypeBuilder/MethodBuilder; pass the interface
10707 constraints to TypeManager.AddTypeParameter().
10708 (TypeParameter.DefineType): Just take an EmitContext and no
10709 TypeBuilder/MethodBuilder. Use the new public API.
10711 * typemanager.cs (TypeManager.AddTypeParameter): Added
10712 `TypeExpr[]' argument; add the interfaces to the
10713 `builder_to_ifaces' hash.
10714 (TypeManager.LookupMemberContainer): For
10715 GenericTypeParameterBuilders, get the TypeParameter from the
10716 `builder_to_type_param'.
10717 (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
10718 the TypeParameter and call FindMembers on it.
10720 2004-04-07 Martin Baulig <martin@ximian.com>
10723 (MethodCore.GenericMethod): Moved this field here from Method.
10724 (MethodCore.IsDuplicateImplementation): Take the number of type
10725 parameters into account if we're a generic method.
10727 * expression.cs (Invocation.InferTypeArguments): Don't return true
10728 if `arguments' is null; we still need to check whether we actually
10729 don't need to infer anything in this case.
10730 (MemberAccess): Merged the functionality from GenericMemberAccess
10733 * generic.cs (GenericMemberAccess): Removed.
10735 2004-04-05 Martin Baulig <martin@ximian.com>
10737 * decl.cs (MemberCore): For generic classes, interfaces and
10738 structs, `Name' now includes the number of type parameters
10739 ("Stack!1.Node!1").
10740 (DeclSpace.FindType): Removed the `num_type_args' argument; we now
10741 encode the number of type arguments in the type name.
10743 * expression.cs (Expression.MemberLookup): Removed the
10744 `num_type_args' argument; we now encode the number of type
10745 arguments in the type name.
10747 * ecore.cs (SimpleName): Encode the number of type arguments in
10748 the type name itself.
10750 * generic.cs (ConstructedType): Likewise.
10752 * tree.cs (Tree.RecordDecl): Take a `string' instead of a
10753 `MemberName'; we now include the number of type parameters in the
10756 * typemanager.cs (TypeManager.CheckGeneric): Removed.
10757 (TypeManager.MemberLookup): Removed the
10758 `num_type_args' argument; we now encode the number of type
10759 arguments in the type name.
10761 2004-04-03 Martin Baulig <martin@ximian.com>
10763 * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
10764 (MemberCore.MemberName): Moved here from MemberBase.
10765 (DeclSpace.SetParameterInfo): Just take the constraints as an
10766 ArrayList; we already have the type parameters in our
10767 `MemberName'; also do the CS0080 reporting here.
10769 * cs-parser.jay (struct_declaration): Use `member_name' instead of
10770 `IDENTIFIER opt_type_parameter_list'; when constructing our
10771 `MemberName', it'll already include our type parameters.
10772 (class_declaration, interface_declaration): Likewise.
10773 (delegate_declaration): Likewise.
10774 (MakeName): Take a MemberName and return a MemberName.
10775 The following two changes are required to avoid shift/reduce conflicts:
10776 (member_name): Don't include a TypeName anymore; ie. this is now
10777 just 'IDENTIFIER opt_type_parameter_list'.
10778 (property_declaration, event_declaration): Use a
10779 `namespace_or_type_name' instead of a `member_name'.
10781 2004-04-03 Martin Baulig <martin@ximian.com>
10783 * decl.cs (MemberName): Renamed to `TypeName' and created a new
10784 `MemberName' class.
10785 (TypeName): Formerly known as MemberName.
10787 * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
10788 instead of a `MemberName'.
10790 * cs-parser.jay (namespace_or_type_name): Create a TypeName.
10791 (member_name): New rule; create a MemberName.
10793 2004-04-02 Martin Baulig <martin@ximian.com>
10795 * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
10796 (CS0305 and CS0308).
10798 2004-04-02 Martin Baulig <martin@ximian.com>
10800 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
10801 support for nested types.
10803 2004-04-02 Martin Baulig <martin@ximian.com>
10805 * ecore.cs (IAlias): New public interface.
10806 (TypeExpr, TypeExpression): Implement IAlias.
10807 (TypeAliasExpression): New public class.
10809 * namespace.cs (Namespace): Implement IAlias.
10810 (Namespace.Lookup): Return an IAlias instead on an object.
10811 (Namespace.DefineName): Take an IAlias instead of an object.
10812 (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
10814 (NamespaceEntry.UsingAlias): Take a Membername instead of an
10816 (NamespaceEntry.LookupAlias): Return an IAlias instead on an
10818 (NamespaceEntry.Lookup): Likewise.
10820 * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
10823 * decl.cs (DeclSpace): Implement IAlias.
10824 (DeclSpace.LookupAlias): Return an IAlias instead of a string.
10826 * generic.cs (ConstructedType): Improved error checking.
10828 2004-04-02 Martin Baulig <martin@ximian.com>
10830 * convert.cs: Added type parameter conversions.
10833 (UnboxCast.Emit): Emit an `unbox.any' for type params.
10834 (ClassCast.Emit): If the source type is a type parameter, box it.
10835 If the target type is a type parameter, emit an `unbox.any'
10836 instead of a `classcast'.1
10838 2004-04-01 Martin Baulig <martin@ximian.com>
10840 * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
10842 2004-04-01 Martin Baulig <martin@ximian.com>
10844 * generic.cs (ConstructedType.CheckConstraints): Use
10845 Convert.ImplicitStandardConversionExists(); user-defined implicit
10846 conversions are not allowed according to the spec.
10848 2004-03-30 Martin Baulig <martin@ximian.com>
10850 * expression.cs (New): Added support for type parameters.
10853 (TypeManager.activator_type): New public static field.
10854 (TypeManager.activator_create_instance): Likewise.
10856 2004-03-30 Martin Baulig <martin@ximian.com>
10858 * typemanager.cs (TypeManager.HasConstructorConstraint): New
10861 2004-03-30 Martin Baulig <martin@ximian.com>
10863 * generic.cs (ConstructedType.CheckConstraints): Actually follow
10864 the spec here: the argument type must be convertible to the
10867 2004-03-30 Martin Baulig <martin@ximian.com>
10870 (TypeParameter.Define, TypeParameter.DefineMethod): Call
10871 TypeManager.AddTypeParameter().
10872 (ConstructedType.CheckConstraints): Re-enable this and actually
10873 check whether we have a constructor constraint.
10876 (TypeManager.builder_to_type_param): New static field.
10877 (TypeManager.AddTypeParameter): New static method.
10878 (TypeManager.LookupTypeParameter): New public method.
10880 2004-03-30 Martin Baulig <martin@ximian.com>
10882 * generic.cs (TypeParameter.DefineType): Return a boolean and use
10883 the new API to actually define the constructor constraint.
10886 (TypeManager.new_constraint_attr_type): New static field.
10887 (TypeManager.InitCoreTypes): Initialize it.
10889 2004-03-30 Martin Baulig <martin@ximian.com>
10891 * generic.cs (Constraints): Completed error checking, use correct
10894 2004-03-29 Martin Baulig <martin@ximian.com>
10896 * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
10898 * expression.cs (Invocation.InferTypeArguments): Added overloaded
10899 public version which takes a `ParameterData pd' instead of an
10902 2004-03-29 Martin Baulig <martin@ximian.com>
10904 * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
10907 2004-03-29 Martin Baulig <martin@ximian.com>
10909 * expression.cs (Argument.ResolveMethodGroup): If we're a
10910 ConstructedType, call GetMemberAccess() on it.
10912 2004-03-29 Martin Baulig <martin@ximian.com>
10914 * class.cs (MethodBase.CheckGenericOverride): New abstract method.
10915 (MethodCore.CheckGenericOverride): When overriding a generic
10916 method, check whether the constraints match.
10918 * support.cs (GenericConstraints): New public interface.
10919 (ParameterData.GenericConstraints): New public method.
10921 * parameter.cs (Parameter.Resolve): Check whether we're a generic
10922 method parameter and compute our constraints if appropriate.
10923 (Parameter.GenericConstraints): New public property.
10925 * generic.cs (Constraints): Implement GenericConstraints.
10927 2004-03-29 Martin Baulig <martin@ximian.com>
10929 * decl.cs (MemberCache.FindMemberToOverride): Use
10930 `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
10932 2004-03-29 Martin Baulig <martin@ximian.com>
10934 * generic.cs (GenericMethod.Define): Resolve our type parameters.
10936 2004-03-29 Martin Baulig <martin@ximian.com>
10938 * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
10939 not allowed on non-generic declarations").
10941 2004-03-29 Martin Baulig <martin@ximian.com>
10943 * expression.cs (Invocation.InferTypeArguments): Added overloaded
10944 public version of this method.
10946 * class.cs (MethodCore.IsDuplicateImplementation): Use
10947 Invocation.InferTypeArguments() to check this.
10949 2004-03-29 Martin Baulig <martin@ximian.com>
10951 * convert.cs: Use TypeManager.IsDelegateType() instead of
10952 comparing types correctly.
10954 2004-03-29 Martin Baulig <martin@ximian.com>
10956 * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
10957 types directly to make it work for generic instances.
10959 * typemanager.cs (TypeManager.IsSubclassOf): New static method.
10961 2004-03-29 Martin Baulig <martin@ximian.com>
10963 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
10964 support for arrays.
10966 2004-03-24 Martin Baulig <martin@ximian.com>
10968 * decl.cs (DeclSpace.FindType): Also use
10969 TypeManager.CheckGeneric() for types from the using clauses.
10971 2004-03-23 Martin Baulig <martin@ximian.com>
10973 * expression.cs (Invocation.OverloadResolve): Added `bool
10974 may_fail' argument and use it instead of the Location.IsNull() hack.
10976 2004-03-23 Martin Baulig <martin@ximian.com>
10978 * expression.cs (Invocation.InferType): Use correct type inference
10981 2004-03-23 Martin Baulig <martin@ximian.com>
10983 * ecore.cs (MethodGroupExpr.Name): Use
10984 TypeManager.CSharpSignature() instead of just the name.
10986 * expression.cs (Invocation.OverloadResolve): Provide better error
10988 (Invocation.DoResolve): OverloadResolve() never returns null
10989 without reporting an error, so removed the error -6 reporting here.
10991 2004-03-23 Martin Baulig <martin@ximian.com>
10993 * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
10996 * cs-parser.jay (delegate_declaration): Support generic delegates.
10998 * delegate.cs: Support generic delegates.
11000 2004-03-22 Martin Baulig <martin@ximian.com>
11002 * expression.cs (Invocation.InferParamsTypeArguments): New static
11003 method; does type inference for params arguments.
11005 2004-03-21 Martin Baulig <martin@ximian.com>
11007 * typemanager.cs (TypeManager.IsGenericMethod): New public static
11008 method; checks whether a method is a generic method.
11010 * expression.cs (Invocation.InferTypeArguments): New static method;
11011 infer type arguments for generic method invocation.
11013 * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
11014 property; we set this to true if we're resolving a generic method
11015 invocation and the user specified type arguments, ie. we're not
11016 doing type inference.
11018 2004-03-20 Martin Baulig <martin@ximian.com>
11020 * class.cs (MethodData.DeclaringType): New public property.
11021 (MethodData.Define): Set DeclaringType here.
11022 (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
11023 instead of OperatorMethodBuilder.DeclaringType.
11025 2004-03-20 Martin Baulig <martin@ximian.com>
11027 * cs-tokenizer.cs (xtoken): Return a special
11028 Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
11030 * cs-parser.jay (default_value_expression): Switch to the new
11033 2004-03-19 Martin Baulig <martin@ximian.com>
11035 * decl.cs (MemberName): New class. We use this to "construct"
11036 namespace_or_type_name's.
11038 * generics.cs (TypeArguments.GetDeclarations): New public method;
11039 returns the type arguments as a string[] and reports a CS0081 if
11040 one of them is not an identifier.
11042 * class.cs (MemberBase): The .ctor now takes the name as a
11043 MemberName instead of a string.
11044 (MemberBase.ExplicitInterfaceName): Changed type from string to
11046 (MemberBase.DoDefine): If we're an explicit implementation, the
11047 InterfaceType may be a generic instance.
11049 * cs-parser.jay (namespace_or_type_name): Return a MemberName.
11050 (namespace_name): Call MemberName.GetName () to transform the
11051 MemberName into a string and ensure we don't have any type
11053 (type_name): Call MemberName.GetTypeExpression() to transfrom the
11054 MemberName into an expression.
11055 (method_header): Use namespace_or_type_name instead of member_name.
11057 2004-04-07 Miguel de Icaza <miguel@ximian.com>
11059 * rootcontext.cs: Add new types to the boot resolution.
11061 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
11062 MulticastDelegate is not allowed.
11064 * typemanager.cs: Add new types to lookup: System.TypedReference
11067 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
11068 check for TypedReference or ArgIterator, they are not allowed.
11070 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
11071 makes us properly catch 1510 in some conditions (see bug 56016 for
11074 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
11076 * CryptoConvert.cs: update from corlib version
11079 2004-04-05 Miguel de Icaza <miguel@ximian.com>
11081 * class.cs (Indexer.Define): Check indexername declaration
11083 2004-04-05 Marek Safar <marek.safar@seznam.cz>
11085 * attribute.cs (IsClsCompliant): Fixed problem with handling
11086 all three states (compliant, not-compliant, undetected).
11088 2004-03-30 Marek Safar <marek.safar@seznam.cz>
11090 * attribute.cs (Attribute): Location is now public.
11091 (Resolve): Store resolved arguments (pos_values) in attribute class.
11092 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
11093 (GetClsCompliantAttributeValue): New method that gets
11094 CLSCompliantAttribute value.
11095 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
11096 if exists else null.
11097 (AttributeTester): New class for CLS-Compliant verification routines.
11099 * class.cs (Emit): Add CLS-Compliant verification.
11100 (Method.GetSignatureForError): Implemented.
11101 (Constructor.GetSignatureForError): Implemented
11102 (Constructor.HasCompliantArgs): Returns if constructor has
11103 CLS-Compliant arguments.
11104 (Constructor.Emit): Override.
11105 (Construcor.IsIdentifierClsCompliant): New method; For constructors
11106 is needed to test only parameters.
11107 (FieldBase.GetSignatureForError): Implemented.
11108 (TypeContainer): New member for storing base interfaces.
11109 (TypeContainer.FindMembers): Search in base interfaces too.
11111 * codegen.cs (GetClsComplianceAttribute): New method that gets
11112 assembly or module CLSCompliantAttribute value.
11113 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
11115 (ModuleClass.Emit): Add error 3012 test.
11117 * const.cs (Emit): Override and call base for CLS-Compliant tests.
11119 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
11120 state for all decl types.
11121 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
11122 if CLS-Compliant tests are required.
11123 (IsClsCompliaceRequired): New method. Analyze whether code
11124 must be CLS-Compliant.
11125 (IsExposedFromAssembly): New method. Returns true when MemberCore
11126 is exposed from assembly.
11127 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
11128 value or gets cached value.
11129 (HasClsCompliantAttribute): New method. Returns true if MemberCore
11130 is explicitly marked with CLSCompliantAttribute.
11131 (IsIdentifierClsCompliant): New abstract method. This method is
11132 used to testing error 3005.
11133 (IsIdentifierAndParamClsCompliant): New method. Common helper method
11134 for identifier and parameters CLS-Compliant testing.
11135 (VerifyClsCompliance): New method. The main virtual method for
11136 CLS-Compliant verifications.
11137 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
11138 null. I don't know why is null (too many public members !).
11139 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
11140 and get value of first CLSCompliantAttribute that found.
11142 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
11143 (VerifyClsCompliance): Override and add extra tests.
11145 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
11146 clscheck- disable CLS-Compliant verification event if assembly is has
11147 CLSCompliantAttribute(true).
11149 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
11150 ApllyAttribute is now called in emit section as in the other cases.
11151 Possible future Emit integration.
11152 (IsIdentifierClsCompliant): New override.
11153 (VerifyClsCompliance): New override.
11154 (GetEnumeratorName): Returns full enum name.
11156 * parameter.cs (GetSignatureForError): Implemented.
11158 * report.cs (WarningData): New struct for Warning message information.
11159 (LocationOfPreviousError): New method.
11160 (Warning): New method. Reports warning based on the warning table.
11161 (Error_T): New method. Reports error based on the error table.
11163 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
11164 verifications are done here.
11166 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
11168 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
11169 CLSCompliantAttribute.
11170 (all_imported_types): New member holds all imported types from other
11172 (LoadAllImportedTypes): New method fills static table with exported types
11173 from all referenced assemblies.
11174 (Modules): New property returns all assembly modules.
11176 2004-03-30 Miguel de Icaza <miguel@ximian.com>
11178 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
11179 throwing a parser error.
11181 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
11182 which removes the hardcoded get_/set_ prefixes for properties, as
11183 IL allows for the properties to be named something else.
11187 * expression.cs: Do not override operand before we know if it is
11188 non-null. Fix 56207
11190 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
11192 * typemanager.cs: support for pinned variables.
11194 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
11196 * decl.cs, typemanager.cs: Avoid using an arraylist
11197 as a buffer if there is only one result set.
11199 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
11201 * expression.cs: Make sure you cant call a static method
11202 with an instance expression, bug #56174.
11204 2004-03-29 Miguel de Icaza <miguel@ximian.com>
11206 * class.cs (IsDuplicateImplementation): Improve error reporting to
11207 flag 663 (method only differs in parameter modifier).
11209 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
11210 in preprocessor directives.
11212 * location.cs (LookupFile): Allow for the empty path.
11214 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
11215 better approach for some of that patch, but its failing with the
11216 CharSet enumeration. For now try/catch will do.
11218 * typemanager.cs: Do not crash if a struct does not have fields.
11221 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
11223 * expression.cs: cs0213, cant fix a fixed expression.
11226 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
11228 * cs-parser.jay: detect invalid embeded statements gracefully.
11231 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
11233 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
11236 the invocation type may not be a subclass of the tye of the item/
11237 The type of the item must be a subclass of the invocation item.
11242 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
11244 * attribute.cs: Added methods to get a string and a bool from an
11245 attribute. Required to information from AssemblyKeyFileAttribute,
11246 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
11247 * codegen.cs: Modified AssemblyName creation to include support for
11248 strongnames. Catch additional exceptions to report them as CS1548.
11249 * compiler.csproj: Updated include CryptoConvert.cs.
11250 * compiler.csproj.user: Removed file - user specific configuration.
11251 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
11252 Mono.Security assembly. The original class is maintained and tested in
11253 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
11254 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
11255 like CSC 8.0 (C# v2) supports.
11256 * Makefile: Added CryptoConvert.cs to mcs sources.
11257 * rootcontext.cs: Added new options for strongnames.
11259 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
11261 * driver.cs: For --expect-error, report error code `2'
11262 if the program compiled with no errors, error code `1' if
11263 it compiled with an error other than the one expected.
11265 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
11267 * compiler.csproj: Updated for Visual Studio .NET 2003.
11268 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
11269 * compiler.sln: Updated for Visual Studio .NET 2003.
11271 2004-03-24 Ravi Pratap M <ravi@ximian.com>
11273 * expression.cs: Fix bug #47234. We basically need to apply the
11274 rule that we prefer the conversion of null to a reference type
11275 when faced with a conversion to 'object' (csc behaviour).
11277 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11279 * statement.cs: Shorter form for foreach, eliminates
11280 a local variable. r=Martin.
11282 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11284 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
11285 checks if we can use brtrue/brfalse to test for 0.
11286 * expression.cs: use the above in the test for using brtrue/brfalse.
11287 cleanup code a bit.
11289 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11291 * expression.cs: Rewrite string concat stuff. Benefits:
11293 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
11294 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
11295 rather than a concat chain.
11297 * typemanager.cs: Add lookups for more concat overloads.
11299 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11301 * expression.cs: Emit shorter il code for array init.
11318 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
11320 * statement.cs: Before, two switch blocks would be merged if the
11321 total size of the blocks (end_item - begin_item + 1) was less than
11322 two times the combined sizes of the blocks.
11324 Now, it will only merge if after the merge at least half of the
11329 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
11331 * class.cs : csc build fix for GetMethods(). See bug #52503.
11333 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
11335 * expression.cs: Make sure fp comparisons work with NaN.
11336 This fixes bug #54303. Mig approved this patch a long
11337 time ago, but we were not able to test b/c the runtime
11340 2004-03-19 Miguel de Icaza <miguel@ximian.com>
11342 * ecore.cs (TypExpr.GetHashCode): implement this overload.
11344 2004-03-19 Martin Baulig <martin@ximian.com>
11346 * class.cs (MemberCore.IsDuplicateImplementation): Check whether
11347 two overloads may unify for some type parameter substitutions and
11348 report a CS0408 if appropriate.
11350 2004-03-19 Martin Baulig <martin@ximian.com>
11352 * class.cs (MemberCore.IsDuplicateImplementation): Report the
11353 error here and not in our caller.
11355 2004-03-19 Martin Baulig <martin@ximian.com>
11357 * interface.cs: Completely killed this file.
11358 (Interface): We're now a TypeContainer and live in class.cs.
11360 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
11361 argument; we're now also called for interfaces.
11362 (TypeContainer.DefineMembers): Allow this method being called
11364 (TypeContainer.GetMethods): New public method; formerly known as
11365 Interface.GetMethod(). This is used by PendingImplementation.
11366 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
11367 it's now private and non-static.
11368 (Interface): Moved this here; it's now implemented similar to
11370 (Method, Property, Event, Indexer): Added `bool is_interface'
11371 argument to their .ctor's.
11372 (MemberBase.IsInterface): New public field.
11374 * cs-parser.jay: Create normal Method, Property, Event, Indexer
11375 instances instead of InterfaceMethod, InterfaceProperty, etc.
11376 (opt_interface_base): Removed; we now use `opt_class_base' instead.
11377 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
11379 2004-03-19 Martin Baulig <martin@ximian.com>
11381 * class.cs (MethodCore.IsDuplicateImplementation): New private
11382 method which does the CS0111 checking.
11383 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
11384 Use IsDuplicateImplementation().
11386 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
11388 * decl.cs (FindMemberToOverride): New method to find the correct
11389 method or property to override in the base class.
11391 - Make Method/Property use the above method to find the
11392 version in the base class.
11393 - Remove the InheritableMemberSignatureCompare as it is now
11396 This patch makes large code bases much faster to compile, as it is
11397 O(n) rather than O(n^2) to do this validation.
11399 Also, it fixes bug 52458 which is that nested classes are not
11400 taken into account when finding the base class member.
11402 Reviewed/Approved by Martin.
11404 2004-03-17 Martin Baulig <martin@ximian.com>
11406 * expression.cs (MemberAccess.DoResolve): Take the parent's number
11407 of type arguments into account; use the `real_num_type_args'
11408 approach like in DoResolveAsTypeStep().
11410 * generic.cs (GenericMemberAccess.DoResolve): Make this work for
11413 2004-03-17 Marek Safar <marek.safar@seznam.cz>
11415 * interface.cs: In all interface classes removed redundant
11416 member initialization.
11418 2004-03-16 Martin Baulig <martin@ximian.com>
11420 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11422 2004-03-15 Miguel de Icaza <miguel@ximian.com>
11424 * decl.cs (DefineTypeAndParents): New helper method to define a
11425 type's containers before the type itself is defined; This is a
11426 bug exposed by the recent changes to Windows.Forms when an
11427 implemented interface was defined inside a class that had not been
11430 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
11432 (Check): Loop correctly to report errors modifiers
11433 (UNSAFE was not in the loop, since it was the same as TOP).
11435 * interface.cs: Every interface member now takes a ModFlags,
11436 instead of a "is_new" bool, which we set on the base MemberCore.
11438 Every place where we called "UnsafeOk" in the interface, now we
11439 call the proper member (InterfaceMethod.UnsafeOK) instead to get
11440 the unsafe settings from the member declaration instead of the
11441 container interface.
11443 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
11445 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11446 `set_indexer_name' to the pending bits (one per type).
11448 We fixed a bug today that was picking the wrong method to
11449 override, since for properties the existing InterfaceMethod code
11450 basically ignored the method name. Now we make sure that the
11451 method name is one of the valid indexer names.
11453 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
11455 * support.cs (SeekableStreamReader): Keep track of stream byte
11456 positions and don't mix them with character offsets to the buffer.
11458 Patch from Gustavo Giráldez
11460 2004-03-15 Marek Safar <marek.safar@seznam.cz>
11462 * interface.cs (InterfaceSetGetBase): Removed double member
11463 initialization, base class does it as well.
11465 2004-03-13 Martin Baulig <martin@ximian.com>
11467 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
11468 when compiling corlib.
11470 2004-03-13 Miguel de Icaza <miguel@ximian.com>
11472 * convert.cs (ExplicitConversion): We were reporting an error on
11473 certain conversions (object_type source to a value type, when the
11474 expression was `null') before we had a chance to pass it through
11475 the user defined conversions.
11477 * driver.cs: Replace / and \ in resource specifications to dots.
11480 * class.cs: Add check for duplicate operators. Fixes 52477
11482 2004-03-11 Miguel de Icaza <miguel@ximian.com>
11484 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
11485 that are in the middle of the statements, not only at the end.
11488 * class.cs (TypeContainer.AddField): No longer set the
11489 `HaveStaticConstructor' flag, now we call it
11490 `UserDefineStaticConstructor' to diferentiate the slightly
11491 semantic difference.
11493 The situation is that we were not adding BeforeFieldInit (from
11494 Modifiers.TypeAttr) to classes that could have it.
11495 BeforeFieldInit should be set to classes that have no static
11500 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
11502 And most importantly Zoltan's comment:
11504 http://bugzilla.ximian.com/show_bug.cgi?id=44229
11506 "I think beforefieldinit means 'it's ok to initialize the type sometime
11507 before its static fields are used', i.e. initialization does not need
11508 to be triggered by the first access to the type. Setting this flag
11509 helps the JIT to compile better code, since it can run the static
11510 constructor at JIT time, and does not need to generate code to call it
11511 (possibly lots of times) at runtime. Unfortunately, mcs does not set
11512 this flag for lots of classes like String.
11514 csc sets this flag if the type does not have an explicit static
11515 constructor. The reasoning seems to be that if there are only static
11516 initalizers for a type, and no static constructor, then the programmer
11517 does not care when this initialization happens, so beforefieldinit
11520 This bug prevents the AOT compiler from being usable, since it
11521 generates so many calls to mono_runtime_class_init that the AOT code
11522 is much slower than the JITted code. The JITted code is faster,
11523 because it does not generate these calls if the vtable is type is
11524 already initialized, which is true in the majority of cases. But the
11525 AOT compiler can't do this."
11527 2004-03-10 Miguel de Icaza <miguel@ximian.com>
11529 * class.cs (MethodData.Emit): Refactor the code so symbolic
11530 information is generated for destructors; For some reasons we
11531 were taking a code path that did not generate symbolic information
11534 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
11536 * class.cs: Create a Constructor.CheckBase method that
11537 takes care of all validation type code. The method
11538 contains some code that was moved from Define.
11540 It also includes new code that checks for duplicate ctors.
11541 This fixes bug #55148.
11543 2004-03-09 Joshua Tauberer <tauberer@for.net>
11545 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
11546 a { ... }-style array creation invokes EmitStaticInitializers
11547 which is not good for reference-type arrays. String, decimal
11548 and now null constants (NullCast) are not counted toward
11549 static initializers.
11551 2004-03-05 Martin Baulig <martin@ximian.com>
11553 * location.cs (SourceFile.HasLineDirective): New public field;
11554 specifies whether the file contains or is referenced by a "#line"
11556 (Location.DefineSymbolDocuments): Ignore source files which
11557 either contain or are referenced by a "#line" directive.
11559 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
11561 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
11562 direct access to our parent, so check the method inline there.
11564 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
11566 * expression.cs (Invocation.EmitCall): Miguel's last commit
11567 caused a regression. If you had:
11572 In Foo the implict this would be null.
11574 2004-02-27 Miguel de Icaza <miguel@ximian.com>
11576 * expression.cs (Invocation.EmitCall): If the method is not
11577 virtual, do not emit a CallVirt to it, use Call.
11579 * typemanager.cs (GetFullNameSignature): Improve the method to
11580 cope with ".ctor" and replace it with the type name.
11582 * class.cs (ConstructorInitializer.Resolve): Now the method takes
11583 as an argument the ConstructorBuilder where it is being defined,
11584 to catch the recursive constructor invocations.
11586 2004-03-16 Martin Baulig <martin@ximian.com>
11588 * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
11589 ConstructedType, call ResolveType() on it to get the type rather
11590 than just using `expr.Type'.
11592 2004-03-16 Martin Baulig <martin@ximian.com>
11594 * generics.cs (ConstructedType.GetMemberAccess): Take the
11595 EmitContext instead on the TypeExpr and use
11596 ec.TypeContainer.CurrentType/ec.ContainerType.
11598 2004-03-16 Martin Baulig <martin@ximian.com>
11600 * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
11601 parameters before aliases.
11603 2004-03-16 Martin Baulig <martin@ximian.com>
11605 * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
11606 New oublic function; checks whether two generic instances may become
11607 equal under some instantiations (26.3.1).
11609 * class.cs (TypeContainer.Define): Call
11610 TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
11613 2004-03-16 Martin Baulig <martin@ximian.com>
11615 * class.cs (TypeContainer.GetClassBases): Moved
11616 Error_TypeParameterAsBase() here and also check whether the base
11617 class is not an attribute.
11619 2004-03-16 Martin Baulig <martin@ximian.com>
11621 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11623 2004-03-16 Martin Baulig <martin@ximian.com>
11625 * class.cs (Error_TypeParameterAsBase): Use correct error number
11628 2004-03-16 Martin Baulig <martin@ximian.com>
11630 * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
11633 * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
11636 2004-03-15 Martin Baulig <martin@ximian.com>
11638 * typemanager.cs (TypeManager.GetFullName): New public method.
11639 (TypeManager.MemberLookup): Added `int_num_type_arguments'
11640 argument; only return members with the correct number of type
11642 (TypeManager.CheckGeneric): Allow -1 to bypass the check.
11643 (TypeManager.FilterWithClosure): Call CheckGeneric() to check
11644 whether the number of type arguments matches.
11646 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
11647 not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
11649 * expression.cs (MemberAccess): Added public `NumTypeArguments'
11650 field; it's set by the protected .ctor when we're actually a
11651 GenericMemberAccess.
11652 (MemberAccess.ResolveAsTypeStep): Compute the total number of type
11653 arguments and pass it to MemberLookupFinal ().
11655 * ecore.cs (Expression.MemberLookup): Added `int
11656 num_type_arguments' argument; only return members with the correct
11657 number of type arguments.
11658 (Expression.MemberLookupFailed): Check whether the MemberLookup
11659 failed because we did not have the correct number of type
11660 arguments; report CS0305 in this case.
11662 * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
11663 `e.ResolveAsTypeTerminal()' already did so.
11665 2004-03-15 Martin Baulig <martin@ximian.com>
11667 * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
11668 we're a ConstructedType; in this case, the caller must report an
11669 error (for instance CS0131).
11671 * generic.cs (TypeArguments): Added Location argument to the .ctor.
11672 (TypeArguments.Resolve): Actually report errors here.
11674 2004-03-15 Miguel de Icaza <miguel@ximian.com>
11676 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11677 `set_indexer_name' to the pending bits (one per type).
11679 We fixed a bug today that was picking the wrong method to
11680 override, since for properties the existing InterfaceMethod code
11681 basically ignored the method name. Now we make sure that the
11682 method name is one of the valid indexer names.
11684 2004-03-15 Martin Baulig <martin@ximian.com>
11686 * typemanager.cs (TypeManager.IndexerPropertyName): Added support
11687 for generic instances.
11689 2004-03-13 Martin Baulig <martin@ximian.com>
11691 * class.cs (TypeContainer.DefineType): Call
11692 TypeManager.AddUserType() immediately after creating the
11693 TypeBuilder; pass all type parameters when creating the
11696 * decl.cs (DeclSpace.FindNestedType): New public method.
11697 (DeclSpace.FindType): Added `int num_type_args' argument; only
11698 return types with the correct number of type parameters.
11699 (DeclSpace.CountTypeParams): New public property.
11701 * ecore.cs (SimpleName.ctor): Added overloaded version which takes
11702 the number of type parameters; defaults to zero.
11704 * generic.cs (TypeArguments.Count): New public property.
11705 (ConstructedType.DoResolveAsTypeStep): First call
11706 ds.FindNestedType() to find out whether we're nested in the
11707 current generic type; in this case, we inherit all type parameters
11708 from the current class.
11710 * rootcontext.cs (RootContext.NamespaceLookup): Added `int
11711 num_type_args' argument.
11712 (RootContext.LookupType): Added overloaded version which takes the
11713 number of type arguments; only return types with the correct
11714 number of type arguments.
11716 * typemanager.cs (TypeManager.CheckGeneric): New public function;
11717 checks whether `Type t' has `int num_type_args'.
11719 2004-03-13 Martin Baulig <martin@ximian.com>
11721 * generic.cs (GenericMethod.DefineType): New method; calls
11722 DefineType() on all the type parameters.
11724 * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
11725 (MethodData.Define): If we're a generic method, call
11726 GenericMethod.DefineType() to define the type parameters.
11728 2004-03-10 Martin Baulig <martin@ximian.com>
11730 * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
11731 instead of IsAssignableFrom.
11733 2004-03-10 Martin Baulig <martin@ximian.com>
11735 * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
11737 * support.cs (ParameterData.HasArrayParameter): New property.
11738 (ReflectionParameters.ctor): Take a MethodBase instead of a
11739 ParameterInfo[]. If we have any type parameters, get the generic
11740 method definition and ask it whether we have variable arguments.
11742 2004-02-26 Miguel de Icaza <miguel@ximian.com>
11744 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11745 routines to check if a type is an enumerable/enumerator allow
11746 classes that implement the IEnumerable or IEnumerator interfaces.
11748 * class.cs (Property, Operator): Implement IIteratorContainer, and
11749 implement SetYields.
11751 (Property.Define): Do the block swapping for get_methods in the
11752 context of iterators. We need to check if Properties also
11753 include indexers or not.
11755 (Operator): Assign the Block before invoking the
11756 OperatorMethod.Define, so we can trigger the Iterator code
11759 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
11760 Property and Operator classes are not created when we parse the
11761 declarator but until we have the block completed, so we use a
11762 singleton SimpleIteratorContainer.Simple to flag whether the
11763 SetYields has been invoked.
11765 We propagate this setting then to the Property or the Operator to
11766 allow the `yield' to function.
11768 2004-02-25 Marek Safar <marek.safar@seznam.cz>
11770 * codegen.cs: Implemented attribute support for modules.
11771 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11772 Assembly/Module functionality.
11774 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11775 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11776 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11778 2004-02-16 Marek Safar <marek.safar@seznam.cz>
11780 * interface.cs (FindMembers): The operation is performed on all base
11781 interfaces and not only on the first. It is required for future CLS Compliance patch.
11783 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
11785 * statement.cs, codegen.cs:
11786 This patch deals with patterns such as:
11788 public class List : IEnumerable {
11790 public MyEnumerator GetEnumerator () {
11791 return new MyEnumerator(this);
11794 IEnumerator IEnumerable.GetEnumerator () {
11798 public struct MyEnumerator : IEnumerator {
11803 Before, there were a few things we did wrong:
11804 1) we would emit callvirt on a struct, which is illegal
11805 2) we emited ldarg when we needed to emit ldarga
11806 3) we would mistakenly call the interface methods on an enumerator
11807 type that derived from IEnumerator and was in another assembly. For example:
11809 public class MyEnumerator : IEnumerator
11811 Would have the interface methods called, even if there were public impls of the
11812 method. In a struct, this lead to invalid IL code.
11814 2004-02-11 Marek Safar <marek.safar@seznam.cz>
11816 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11819 * delegate.cs (Define): Fixed crash when delegate type is undefined.
11821 2004-02-11 Miguel de Icaza <miguel@ximian.com>
11823 * cs-parser.jay: Fix small regression: we were not testing V2
11824 compiler features correctly.
11826 * interface.cs: If the emit context is null, then create one
11828 2004-02-09 Marek Safar <marek.safar@seznam.cz>
11830 * decl.cs (GetSignatureForError): New virtual method to get full name
11831 for error messages.
11833 * attribute.cs (IAttributeSupport): New interface for attribute setting.
11834 Now it is possible to rewrite ApplyAttributes method to be less if/else.
11836 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11837 Duplicated members and code in these classes has been removed.
11838 Better encapsulation in these classes.
11840 2004-02-07 Miguel de Icaza <miguel@ximian.com>
11842 * assign.cs (Assign.DoResolve): When dealing with compound
11843 assignments, there is a new rule in ECMA C# 2.4 (might have been
11844 there before, but it is documented here) that states that in:
11848 If b is of type int, and the `op' is a shift-operator, then the
11849 above is evaluated as:
11853 * expression.cs (Binary.ResolveOperator): Instead of testing for
11854 int/uint/long/ulong, try to implicitly convert to any of those
11855 types and use that in pointer arithmetic.
11857 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11858 method to print information for from the type, not from the
11859 null-method we were given.
11861 2004-02-01 Duncan Mak <duncan@ximian.com>
11863 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11864 parsing for cmd, fixes bug #53694.
11866 2004-02-04 Marek Safar <marek.safar@seznam.cz>
11868 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11869 in the member name duplication tests. Property and operator name duplication
11870 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11872 2004-02-03 Marek Safar <marek.safar@seznam.cz>
11874 * interface.cs (PopulateMethod): Fixed crash when interface method
11875 returns not existing type (error test cs0246-3.cs).
11877 2004-02-02 Ravi Pratap M <ravi@ximian.com>
11879 * cs-parser.jay (interface_accessors): Re-write actions to also
11880 store attributes attached to get and set methods. Fix spelling
11883 (inteface_property_declaration): Modify accordingly.
11885 (InterfaceAccessorInfo): New helper class to store information to pass
11886 around between rules that use interface_accessors.
11888 * interface.cs (Emit): Apply attributes on the get and set
11889 accessors of properties and indexers too.
11891 * attribute.cs (ApplyAttributes): Modify accordingly to use the
11892 right MethodBuilder when applying attributes to the get and set accessors.
11894 2004-01-31 Miguel de Icaza <miguel@ximian.com>
11896 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11898 2004-01-26 Miguel de Icaza <miguel@ximian.com>
11900 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11902 2004-01-25 Miguel de Icaza <miguel@ximian.com>
11904 * cs-parser.jay: Remove YIELD token, instead use the new grammar
11905 changes that treat `yield' specially when present before `break'
11906 or `return' tokens.
11908 * cs-tokenizer.cs: yield is no longer a keyword.
11910 2004-01-23 Marek Safar <marek.safar@seznam.cz>
11912 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11913 setting for default constructors.
11914 For default constructors are almost every time set wrong Modifier. The
11915 generated IL code has been alright. But inside mcs this values was
11916 wrong and this was reason why several of my CLS Compliance tests
11919 2004-02-27 Martin Baulig <martin@ximian.com>
11921 * generics.cs (ConstructedType.ResolveType): Make the nested type
11922 stuff actually work.
11924 2004-02-25 Martin Baulig <martin@ximian.com>
11926 * decl.cs (DeclSpace.CurrentTypeParameters): New protected
11927 property; returns the type parameters just from the current type,
11928 ie. with the ones from outer classes.
11929 (DeclSpace.LookupGeneric): First search in the current class, then
11931 (DeclSpace.initialize_type_params): When hiding a type parameter
11932 from an outer class, put it into the `type_param_list' anyways.
11934 * expression.cs (MemberAccess.expr): Made this field protected.
11936 * class.cs (TypeContainer.Define): The `CurrentType' just contains
11937 the type parameters from the current class.
11939 * generic.cs (ConstructedType.ResolveType): Support nested generic
11940 types by taking the type parameters which we inherit from outer
11941 classes into account.
11942 (GenericMemberAccess.ResolveAsTypeStep): Override this and added
11943 support for nested generic types.
11945 2004-02-23 Martin Baulig <martin@ximian.com>
11947 * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
11948 field and check whether we're nested inside a generic type.
11949 (DeclSpace.ResolveType): If we're resolving to a generic type
11950 definition, create a ConstructedType and return its resolved type.
11951 (DeclSpace.initialize_type_params): New private method;
11952 initializes the `type_param_list' field from the type parameters
11953 from this and all enclosing classes.
11954 (DeclSpace.TypeParameters): Call initialize_type_params() unless
11955 we're already initialized.
11957 2004-02-23 Martin Baulig <martin@ximian.com>
11959 * class.cs (Method.Define): Create the generic method before
11960 calling DoDefine().
11961 (Memberbase.DoDefine): Added DeclSpace argument (in addition to
11962 the TypeContainer one); we use this for generic methods.
11964 * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
11965 parent's TypeBuilder.
11967 2004-02-18 Martin Baulig <martin@ximian.com>
11969 * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
11970 to check for equality.
11972 2004-02-05 Martin Baulig <martin@ximian.com>
11974 * ecore.cs (FieldExpr.DoResolveLValue): If we have an
11975 `ec.TypeContainer.CurrentType', use it instead of
11976 `ec.ContainerType' to check whether we're in the type's ctor.
11978 2004-01-29 Martin Baulig <martin@ximian.com>
11980 * expression.cs (Invocation.DoResolve): If we're a
11981 `ConstructedType', then we're actually a generic method, so
11982 rewrite the expr as a GenericMemberAccess.
11984 * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
11985 here; manually parse it into a string.
11987 2004-01-28 Martin Baulig <martin@ximian.com>
11989 * typemanager.cs (TypeManager.IsEqual): New static method.
11990 (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
11991 check for equality instead of using `=='.
11993 2004-01-26 Martin Baulig <martin@ximian.com>
11995 * decl.cs (DeclSpace.CurrentType): New public field.
11997 * expression.cs (This.ResolveBase): If we have an
11998 `ec.TypeContainer.CurrentType', use it instead of
11999 `ec.ContainerType'.
12001 * class.cs (TypeContainer.DefineType): If we're a generic type,
12002 create the `CurrentType' (unresolved).
12003 (TypeContainer.GenericType): New private field.
12004 (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
12005 it and store it in `GenericType' before creating the MemberCache.
12006 (TypeContainer.GetMembers): If we have a `GenericType', call
12007 TypeManager.FindMembers() on it.
12009 * interface.cs (Interface.GenericType): New private field.
12010 (Interface.DefineType): If we're a generic type, create the
12011 `CurrentType' (unresolved).
12012 (Interface.DefineMembers): If we have a `CurrentType', resolve it
12013 and store it in `GenericType' before creating the MemberCache.
12014 (Interface.GetMembers): If we have a `GenericType', call
12015 TypeManager.FindMembers() on it.
12017 2004-01-22 Martin Baulig <martin@ximian.com>
12019 * cs-parser.jay (namespace_or_type_name): Return an Expression,
12020 not a QualifiedIdentifier. This is what `type_name_expression'
12021 was previously doing.
12022 (type_name_expression): Removed; the code is now in
12023 `namespace_or_type_name'.
12024 (qualified_identifier): Removed, use `namespace_or_type_name'
12026 (QualifiedIdentifier): Removed this class.
12028 2004-01-22 Martin Baulig <martin@ximian.com>
12030 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
12031 not a string as alias name.
12033 2004-01-21 Miguel de Icaza <miguel@ximian.com>
12035 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
12036 #52730 bug, and instead compute correctly the need to use a
12037 temporary variable when requesting an address based on the
12038 static/instace modified of the field and the constructor.
12040 2004-01-21 Martin Baulig <martin@ximian.com>
12042 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
12043 class and namespace before looking up aliases. Fixes #52517.
12045 2004-01-21 Martin Baulig <martin@ximian.com>
12047 * flowanalysis.cs (UsageVector.Merge): Allow variables being
12048 assinged in a 'try'; fixes exception4.cs.
12050 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12051 * class.cs : Implemented parameter-less constructor for TypeContainer
12053 * decl.cs: Attributes are now stored here. New property OptAttributes
12055 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
12057 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
12059 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12061 * typemanager.cs (CSharpSignature): Now reports also inner class name.
12062 (CSharpSignature): New method for indexer and property signature.
12064 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12066 * pending.cs (IsVirtualFilter): Faster implementation.
12068 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12070 * typemanager.cs: Avoid inclusion of same assembly more than once.
12072 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12074 * cs-parser.jay: Fixed problem where the last assembly attribute
12075 has been applied also to following declaration (class, struct, etc.)
12077 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12079 * class.cs: Added error CS0538, CS0539 reporting.
12080 Fixed crash on Microsoft runtime when field type is void.
12082 * cs-parser.jay: Added error CS0537 reporting.
12084 * pending.cs: Added error CS0535 reporting.
12085 Improved error report for errors CS0536, CS0534.
12087 2004-01-20 Miguel de Icaza <miguel@ximian.com>
12089 Merge a few bits from the Anonymous Method MCS tree.
12091 * statement.cs (ToplevelBlock): New class for toplevel methods,
12092 will hold anonymous methods, lifted variables.
12094 * cs-parser.jay: Create toplevel blocks for delegates and for
12095 regular blocks of code.
12097 2004-01-20 Martin Baulig <martin@ximian.com>
12099 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
12100 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
12101 and `NeedExplicitReturn'; added `IsLastStatement'.
12102 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
12103 have a `ReturnLabel' or we're not unreachable.
12105 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
12106 child's reachability; don't just override ours with it. Fixes
12107 #58058 (lluis's example).
12108 (FlowBranching): Added public InTryOrCatch(), InCatch(),
12109 InFinally(), InLoop(), InSwitch() and
12110 BreakCrossesTryCatchBoundary() methods.
12112 * statement.cs (Return): Do all error checking in Resolve().
12113 Unless we are the last statement in a top-level block, always
12114 create a return label and jump to it.
12115 (Break, Continue): Do all error checking in Resolve(); also make
12116 sure we aren't leaving a `finally'.
12117 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
12118 statement in a top-level block.
12119 (Block.Flags): Added `IsDestructor'.
12120 (Block.IsDestructor): New public property.
12122 2004-01-20 Martin Baulig <martin@ximian.com>
12124 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
12126 2004-01-20 Martin Baulig <martin@ximian.com>
12128 * statement.cs (Statement.ResolveUnreachable): New public method.
12129 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
12130 (Block.Resolve): Resolve unreachable statements.
12132 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
12134 * expression.cs: We need to fix the case where we do
12135 not have a temp variable here.
12137 * assign.cs: Only expression compound assignments need
12138 temporary variables.
12140 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
12142 * flowanalysis.cs: Reduce memory allocation in a few ways:
12143 - A block with no variables should not allocate a bit
12145 - A method with no out parameters does not need any tracking
12146 for assignment of the parameters, so we need not allocate
12149 public readonly Type[] VariableTypes;
12150 public readonly string[] VariableNames;
12151 Are redundant. The data is already stored in the variable
12152 map, so we need not allocate another array for it.
12153 - We need to add alot of checks for if (params | locals) == null
12154 due to the first two changes.
12156 2004-01-18 Miguel de Icaza <miguel@ximian.com>
12158 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
12159 implement IMemoryLocation, we store a copy on a local variable and
12160 take the address of it. Patch from Benjamin Jemlich
12162 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
12163 to use a special "type_name_expression" rule which reduces the
12164 number of "QualifiedIdentifier" classes created, and instead
12165 directly creates MemberAccess expressions.
12167 2004-01-17 Miguel de Icaza <miguel@ximian.com>
12169 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
12170 that fixes #52853. Null literal assignment to ValueType
12172 * class.cs (MethodData.Emit): Instead of checking the name of the
12173 method to determine if its a destructor, create a new derived
12174 class from Method called Destructor, and test for that.
12176 * cs-parser.jay: Create a Destructor object instead of a Method.
12178 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
12182 2004-01-16 Miguel de Icaza <miguel@ximian.com>
12184 * expression.cs (Binary.ResolveOperator): Perform an implicit
12185 conversion from MethodGroups to their delegate types on the
12186 Addition operation.
12188 * delegate.cs: Introduce a new class DelegateCreation that is the
12189 base class for `NewDelegate' and `ImplicitDelegateCreation',
12190 factor some code in here.
12192 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
12193 conversion from MethodGroups to compatible delegate types.
12195 * ecore.cs (Expression.Resolve): Do not flag error 654
12196 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
12197 we allow conversions from MethodGroups to delegate types now.
12199 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
12200 assignments in v2 either.
12202 2004-01-10 Miguel de Icaza <miguel@ximian.com>
12204 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
12205 static read-only fields in ctors.
12207 Applied patch from Benjamin Jemlich
12209 * expression.cs (UnaryMutator): Avoid leaking local variables.
12211 2004-01-09 Miguel de Icaza <miguel@ximian.com>
12213 * cs-tokenizer.cs (IsCastToken): Allow the various native types
12214 here to return true, as they can be used like this:
12216 (XXX) int.MEMBER ()
12218 Fixed 49836 and all the other dups
12220 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
12222 * driver.cs: Implement /win32res and /win32icon.
12224 2004-01-08 Miguel de Icaza <miguel@ximian.com>
12226 * cs-parser.jay: Add a rule to improve error handling for the
12227 common mistake of placing modifiers after the type.
12229 2004-01-07 Miguel de Icaza <miguel@ximian.com>
12231 * cs-parser.jay (interface_event_declaration): Catch
12232 initialization of events on interfaces, and report cs0068
12234 * cs-parser.jay (interface_event_declaration): Catch
12235 initialization of events.
12237 * ecore.cs: Better report missing constructors.
12239 * expression.cs (Binary.ResolveOperator): My previous bug fix had
12240 the error reporting done in the wrong place. Fix.
12242 * expression.cs (Binary.ResolveOperator): Catch the
12243 operator + (E x, E y) error earlier, and later allow for implicit
12244 conversions in operator +/- (E e, U x) from U to the underlying
12247 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
12248 52596, if the container class is abstract, the default constructor
12249 is protected otherwise its public (before, we were always public).
12251 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
12254 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
12255 Jemlich that fixes bug #52597, MCS was generating invalid code for
12256 idisposable structs. Thanks to Ben for following up with this
12259 2004-01-06 Miguel de Icaza <miguel@ximian.com>
12261 * driver.cs: Allow assemblies without code to be generated, fixes
12264 2004-01-07 Nick Drochak <ndrochak@gol.com>
12266 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
12268 2004-01-05 Miguel de Icaza <miguel@ximian.com>
12270 * cs-parser.jay: Add rules to improve error reporting if fields or
12271 methods are declared at the namespace level (error 116)
12273 * Add rules to catch event add/remove
12275 2004-01-04 David Sheldon <dave-mono@earth.li>
12277 * expression.cs: Added matching ")" to error message for
12280 2004-01-03 Todd Berman <tberman@gentoo.org>
12282 * ecore.cs, attribute.cs:
12283 Applying fix from #52429.
12285 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12287 * ecore.cs, expression.cs, statement.cs:
12288 Total rewrite of how we handle branching. We
12289 now handle complex boolean expressions with fewer
12290 jumps. As well if (x == 0) no longer emits a ceq.
12292 if (x is Foo) is much faster now, because we generate
12295 Overall, we get a pretty big improvement on our benchmark
12296 tests. The code we generate is smaller and more readable.
12298 I did a full two-stage bootstrap. The patch was reviewed
12299 by Martin and Miguel.
12301 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12303 * cs-parser.jay: Make primary_expression not take a QI.
12304 we dont need this because the member_access rule covers
12305 us here. So we replace the rule with just IDENTIFIER.
12307 This has two good effects. First, we remove a s/r conflict.
12308 Second, we allocate many fewer QualifiedIdentifier objects.
12310 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12312 * attribute.cs: Handle MarshalAs attributes as pseudo, and
12313 set the correct information via SRE. This prevents
12314 hanging on the MS runtime. Fixes #29374.
12316 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12318 * convert.cs: correctly handle conversions to value types
12319 from Enum and ValueType as unboxing conversions.
12321 Fixes bug #52569. Patch by Benjamin Jemlich.
12323 2004-01-02 Ravi Pratap <ravi@ximian.com>
12325 * expression.cs (BetterConversion): Prefer int -> uint
12326 over int -> ulong (csc's behaviour). This fixed bug #52046.
12328 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
12330 * decl.cs (MemberCache.FindMembers): now returns a
12333 * typemanager.cs: In general, go with with ^^.
12334 (CopyNewMethods): take an IList.
12335 (RealMemberLookup): Only allocate an arraylist
12336 if we copy from two sets of methods.
12338 This change basically does two things:
12339 1) Fewer array lists allocated due to CopyNewMethods.
12340 2) the explicit cast in MemberList costed ALOT.
12342 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
12344 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
12345 a hashtable to avoid needless string allocations when an identifier is
12346 used more than once (the common case).
12348 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
12350 * pending.cs: MS's TypeBuilder.GetInterfaces ()
12351 is broken, it will not return anything. So, we
12352 have to use the information we have in mcs to
12355 * typemanager.cs: Add a cache for GetInterfaces,
12356 since this will now be used more often (due to ^^)
12358 (GetExplicitInterfaces) New method that gets the
12359 declared, not effective, interfaces on a type
12360 builder (eg, if you have interface IFoo, interface
12361 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
12364 This patch makes MCS able to bootstrap itself on
12367 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
12369 * expression.cs: Remove the Nop's that Miguel put
12372 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12374 * report.cs, codegen.cs: Give the real stack trace to
12375 the error when an exception is thrown.
12377 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12379 * decl.cs: only allocate hashtables for ifaces if
12382 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12384 * expression.cs: fix the error from cs0121-2.cs
12385 (a parent interface has two child interfaces that
12386 have a function with the same name and 0 params
12387 and the function is called through the parent).
12389 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
12391 * class.cs, rootcontext.cs, typmanager.cs: do not
12394 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
12396 * codegen.cs: remove stack for the ec flow branching.
12397 It is already a linked list, so no need.
12399 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
12401 * Makefile: Allow custom profiler here.
12403 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
12405 * typemanager.cs (LookupType):
12406 - Use a static char [], because split takes
12407 a param array for args, so it was allocating
12409 - Do not store true in a hashtable, it boxes.
12411 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
12413 * flowanalysis.cs: bytify common enums.
12415 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12417 * modifiers.cs: Add a new set of flags for the
12418 flags allowed on explicit interface impls.
12419 * cs-parser.jay: catch the use of modifiers in
12420 interfaces correctly.
12421 * class.cs: catch private void IFoo.Blah ().
12423 All related to bug #50572.
12425 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12427 * decl.cs: Rewrite the consistant accessability checking.
12428 Accessability is not linear, it must be implemented in
12429 a tableish way. Fixes #49704.
12431 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12433 * expression.cs: Handle negation in a checked context.
12434 We must use subtraction from zero. Fixes #38674.
12436 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
12438 * class.cs: Ignore static void main in DLLs.
12439 * rootcontext.cs: Handle the target type here,
12440 since we are have to access it from class.cs
12441 * driver.cs: account for the above.
12443 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
12445 * report.cs: Give line numbers and files if available.
12447 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
12449 * driver.cs: Implement /addmodule.
12451 * typemanager.cs: Change 'modules' field so it now contains Modules not
12454 2003-12-20 Martin Baulig <martin@ximian.com>
12456 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
12457 (FieldBase.IsAssigned): Removed this field.
12458 (FieldBase.SetAssigned): New public method.
12459 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
12461 2003-12-20 Martin Baulig <martin@ximian.com>
12463 * expression.cs (LocalVariableReference.DoResolve): Don't set
12464 `vi.Used' if we're called from DoResolveLValue().
12466 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
12467 returns the usage vector it just merged into the current one -
12468 pass this one to UsageWarning().
12469 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
12470 of the `EmitContext', don't call this recursively on our children.
12472 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
12474 * driver.cs: Implement /target:module.
12476 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
12478 * support.cs (CharArrayHashtable): New helper class.
12480 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
12481 char arrays, not strings, so we can avoid creating a string in
12482 consume_identifier if the identifier is a keyword.
12484 2003-12-16 Martin Baulig <martin@ximian.com>
12486 * statement.cs (LocalInfo.Assigned): Removed this property.
12487 (LocalInfo.Flags): Removed `Assigned'.
12488 (LocalInfo.IsAssigned): New public method; takes the EmitContext
12489 and uses flow analysis.
12490 (Block.UsageWarning): Made this method private.
12491 (Block.Resolve): Call UsageWarning() if appropriate.
12493 * expression.cs (LocalVariableReference.DoResolve): Always set
12494 LocalInfo.Used here.
12496 2003-12-13 Martin Baulig <martin@ximian.com>
12498 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
12499 any value here; we're now using flow analysis to figure out
12500 whether a statement/block returns a value.
12502 2003-12-13 Martin Baulig <martin@ximian.com>
12504 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
12506 (FlowBranching.MergeFinally): Don't call
12507 `branching.CheckOutParameters()' here, this is called in
12509 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
12510 when adding the `finally' vector.
12512 2003-12-13 Martin Baulig <martin@ximian.com>
12515 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
12516 actually work and also fix #48962.
12518 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
12520 * decl.cs: Do not check System.Object for nested types,
12521 since we know it does not have any. Big bang for buck:
12524 Run 1: 8.35 seconds
12525 Run 2: 8.32 seconds
12526 corlib: 17.99 seconds
12528 Run 1: 8.17 seconds
12529 Run 2: 8.17 seconds
12530 corlib: 17.39 seconds
12532 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
12534 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
12535 time we are returning 0 members, so we save alot here.
12537 2003-12-11 Martin Baulig <martin@ximian.com>
12539 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
12540 `MergeChild()', also just take the `FlowBranching' as argument;
12541 call Merge() on it and return the result.
12542 (FlowBranching.Merge): We don't need to do anything if we just
12545 2003-12-11 Martin Baulig <martin@ximian.com>
12547 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
12548 them in an `ArrayList' to reduce memory usage. Thanks to Ben
12549 Maurer for this idea.
12551 2003-12-11 Martin Baulig <martin@ximian.com>
12553 * flowanalysis.cs (MergeResult): This class is now gone; we now
12554 use the `UsageVector' for this. The reason for this is that if a
12555 branching just has one sibling, we don't need to "merge" them at
12556 all - that's the next step to do.
12557 (FlowBranching.Merge): We now return a `UsageVector' instead of a
12560 2003-12-11 Martin Baulig <martin@ximian.com>
12562 Reworked flow analyis and made it more precise and bug-free. The
12563 most important change is that we're now using a special `Reachability'
12564 class instead of having "magic" meanings of `FlowReturns'. I'll
12565 do some more cleanups and optimizations and also add some more
12566 documentation this week.
12568 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
12569 largely reworked this class.
12570 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
12571 the new `Reachability' class instead of having "magic" values here.
12572 (FlowBranching): We're now using an instance of `Reachability'
12573 instead of having separate `Returns', `Breaks' etc. fields.
12575 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
12576 based on flow analysis; ignore the return value of block.Emit ().
12578 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
12580 * driver.cs typemanager.cs: Find the mono extensions to corlib even
12581 if they are private.
12583 2003-12-09 Martin Baulig <martin@ximian.com>
12585 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
12586 call them directly on the UsageVector.
12588 2003-12-09 Martin Baulig <martin@ximian.com>
12590 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
12591 Changed return type from `FlowReturns' to `Reachability'.
12593 2003-12-09 Martin Baulig <martin@ximian.com>
12595 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
12596 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
12597 `Reachable' fields with a single `Reachability' one.
12599 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12601 * class.cs (FindMembers): Remove foreach's.
12606 Run 1: 8.74 seconds
12607 Run 2: 8.71 seconds
12610 Run 1: 8.64 seconds
12611 Run 2: 8.58 seconds
12614 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12619 This patch does a few things:
12620 1. EmptyStatement is now a singleton, so it is never reallocated.
12621 2. All blah is EmptyStatement constructs have been changed to
12622 blah == EmptyStatement.Value, which is much faster and valid
12623 now that EmptyStatement is a singleton.
12624 3. When resolving a block, rather than allocating a new array for
12625 the non-empty statements, empty statements are replaced with
12626 EmptyStatement.Value
12627 4. Some recursive functions have been made non-recursive.
12628 Mainly the performance impact is from (3), however (1) and (2) are needed for
12629 this to work. (4) does not make a big difference in normal situations, however
12630 it makes the profile look saner.
12635 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12636 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12637 Total memory allocated: 56397 KB
12640 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
12641 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
12642 Total memory allocated: 55666 KB
12644 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12646 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
12647 than the hashtable in a hashtable version
12649 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
12650 we always end up concating a string. This results in a huge perf
12651 loss, because many strings have to be tracked by the GC. In this
12652 patch, we first use a hashtable that works with two keys, so that
12653 the strings do not need to be concat'ed.
12657 Run 1: 8.74 seconds
12658 Run 2: 8.71 seconds
12661 Run 1: 8.65 seconds
12662 Run 2: 8.56 seconds
12664 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12666 * Makefile: Add a new target `do-time' that does a quick and simple
12667 profile, leaving easy to parse output.
12669 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
12671 * codegen.cs (Init): Create the dynamic assembly with
12672 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
12674 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
12676 * support.cs: Make the PtrHashtable use only one
12677 instance of its comparer.
12679 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
12681 * typemanager.cs: Fix lookup of GetNamespaces.
12683 2003-11-29 Miguel de Icaza <miguel@ximian.com>
12685 * expression.cs: Removed redundant line.
12687 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
12688 ArrayLists, use for loops with bounds.
12690 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
12693 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
12694 arraylists, use for loop with bounds.
12696 The above three changes give us a 0.071 second performance
12697 improvement out of 3.294 seconds down to 3.223. On my machine
12698 the above changes reduced the memory usage by 1,387 KB during
12699 compiler bootstrap.
12701 * cs-parser.jay (QualifiedIdentifier): New class used to represent
12702 QualifiedIdentifiers. Before we created a new string through
12703 concatenation, and mostly later on, the result would be
12704 manipulated by DecomposeQI through string manipulation.
12706 This reduced the compiler memory usage for bootstrapping from
12707 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
12708 compile times in 0.05 seconds.
12710 2003-11-28 Dick Porter <dick@ximian.com>
12712 * support.cs: Do string compares with the Invariant culture.
12720 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
12721 the comparison is done with the Invariant culture.
12723 2003-11-27 Miguel de Icaza <miguel@ximian.com>
12725 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
12726 GetEnumerator method.
12728 (ProbeCollectionType): Iterate starting at the most specific type
12729 upwards looking for a GetEnumerator
12731 * expression.cs: Shift count can be up to 31 for int/uint and 63
12734 2003-11-26 Miguel de Icaza <miguel@ximian.com>
12736 * statement.cs (Block.LookupLabel): Also look for the label on the
12737 children blocks. Use a hash table to keep track of visited
12740 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12741 we actually did transform the other operand, otherwise fall back
12742 to the common codepath that casts to long.
12744 * cs-tokenizer.cs: Use the same code pattern as the int case.
12745 Maybe I should do the parsing myself, and avoid depending on the
12746 Parse routines to get this done.
12748 2003-11-25 Miguel de Icaza <miguel@ximian.com>
12750 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
12751 which fixes bug 51347. This time test it.
12753 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12754 attributes for example can not tell the difference between these.
12755 The difference was only a syntax feature of the language.
12757 * attribute.cs: Apply attributes to delegates.
12759 * delegate.cs: Call the apply attributes method.
12761 2003-11-24 Miguel de Icaza <miguel@ximian.com>
12763 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12764 comparing 0 vs Byte.MinValue, not the value
12766 (ImplicitConversionRequired): When reporting a conversion error,
12767 use error 31 to print out the constant error instead of the
12770 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
12771 which fixes bug 51347.
12773 2003-11-22 Miguel de Icaza <miguel@ximian.com>
12775 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
12776 which fixes the -warnaserror command line option.
12778 2003-11-21 Miguel de Icaza <miguel@ximian.com>
12780 * cfold.cs (DoNumericPromotions): During constant folding of
12781 additions on UIntConstant, special case intconstants with
12782 IntConstants like we do on the expression binary operator.
12784 2003-11-12 Miguel de Icaza <miguel@ximian.com>
12786 * convert.cs (ImplicitReferenceConversion): We were missing a case
12787 (System.Enum are not value types or class types, so we need to
12788 classify them separatedly).
12790 * driver.cs: We do not support error 2007.
12792 2003-11-12 Jackson Harper <jackson@ximian.com>
12794 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
12795 system directory. Also use the full file name so users can
12796 libraries names mscorlib-o-tron.dll in a non system dir.
12798 2004-01-04 David Sheldon <dave-mono@earth.li>
12800 * expression.cs: Added matching ")" to error message for CS0077.
12802 2003-12-19 Martin Baulig <martin@ximian.com>
12804 * typemanager.cs (TypeManager.IsEqualGenericType): New public
12805 static method; see documentation in the method.
12806 (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
12808 * convert.cs (Convert.ImplicitReferenceConversion,
12809 Convert.ImplicitReferenceConversionExists): Add support for
12810 generic type declarations; see gen-36.cs.
12812 2003-12-19 Martin Baulig <martin@ximian.com>
12814 * pending.cs (Pending.InterfaceMethod): Use
12815 `Type.IsAssignableFrom()' instead of `=='.
12817 2003-12-18 Martin Baulig <martin@ximian.com>
12819 * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
12822 * convert.cs (Convert.ImplicitStandardConversionExists): Use
12823 `expr_type.Equals (target_type)' instead of `=='.
12825 2003-12-08 Martin Baulig <martin@ximian.com>
12827 * generics.cs (Constraints.Types): Removed.
12828 (Constraints.Resolve): Just resolve everything to TypeExpr's, not
12830 (Constraints.ResolveTypes): New public method; resolves the
12831 TypeExpr's to Type's.
12832 (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
12833 longer takes the constraints.
12834 (TypeParameter.DefineMethod): Likewise.
12835 (TypeParameter.DefineType): New public method. Calls
12836 `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
12839 2003-12-08 Martin Baulig <martin@ximian.com>
12841 * convert.cs (Convert.ImplicitConversionStandard): Use
12842 `expr_type.Equals (target_type)' instead of `=='.
12844 2003-12-08 Martin Baulig <martin@ximian.com>
12846 * typemanager.cs (TypeManager.GetReferenceType): Call
12847 `Type.MakeByRefType ()'.
12849 2003-12-08 Martin Baulig <martin@ximian.com>
12851 * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
12852 just has some special meaning in some situations. For instance,
12853 it is allowed to use `where' as the name of a variable etc.
12855 2003-12-04 Martin Baulig <martin@ximian.com>
12857 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12858 `Type.MakeArrayType()' for array types.
12860 2003-11-18 Miguel de Icaza <miguel@ximian.com>
12862 * expression.cs (Invocation.VerifyArgumentsCompat): Remove
12865 (SizeOf.DoResolve): assign the `type_queried' field. This gets
12868 2003-11-16 Martin Baulig <martin@ximian.com>
12870 * codegen.cs (EmitContext.IsGeneric): Removed.
12872 * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
12873 ResolveGeneric() on the DeclSpace.
12875 2003-11-16 Martin Baulig <martin@ximian.com>
12877 * generic.cs (TypeArguments.Resolve):
12878 `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
12879 `ResolveType()' on it to get the Type.
12881 2003-11-15 Martin Baulig <martin@ximian.com>
12883 * generic.cs (ConstructedType.GetInterfaces): Override this.
12885 2003-11-14 Martin Baulig <martin@ximian.com>
12887 * interface.cs (Interface.DefineType): Define all type parameters
12888 before adding the interfaces we inherit.
12890 2003-11-11 Martin Baulig <martin@ximian.com>
12892 * generic.cs (ConstructedType.ResolveType): Always call
12893 `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
12895 2003-11-10 Martin Baulig <martin@ximian.com>
12897 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12898 (TypeManager.InitCoreTypes): Initialize them here, but instead of
12899 calling `ResolveType()' on them, directly assign their `Type'.
12901 2003-11-08 Martin Baulig <martin@ximian.com>
12903 * generic.cs (ConstructedType): Override `IsClass' etc.
12905 2003-11-08 Martin Baulig <martin@ximian.com>
12907 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12908 return value and the `out parent' parameter.
12909 (TypeContainer.DefineType): Moved the CS0644 check into
12910 GetClassBases(). Don't pass the interface types to the
12911 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12912 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12914 * ecore.cs (TypeExpr.IsAttribute): New property.
12915 (TypeExpr.GetInterfaces): New method.
12917 * interface.cs (Interface.GetInterfaceTypeByName): Return a
12918 TypeExpr instead of a Type.
12919 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12920 (Interface.DefineType): Don't pass the interface types to the
12921 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12922 them later and then call `TypeBulider.AddInterfaceImplementation()'.
12924 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12925 instead of a `Type[]'.
12926 (TypeManager.RegisterBuilder): Likewise.
12927 (TypeManager.AddUserInterface): Likewise.
12928 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12929 `Type[]' and also return a `TypeExpr[]'.
12930 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12932 2003-11-08 Martin Baulig <martin@ximian.com>
12934 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12937 2003-11-08 Martin Baulig <martin@ximian.com>
12939 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12940 TypeManager.ResolveExpressionTypes().
12942 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12943 instead of an Expression.
12944 (TypeExpr): This is now an abstract base class for `TypeExpression'.
12945 (TypeExpression): New public class; formerly known as `TypeExpr'.
12947 * expression.cs (ComposedCast): Derive from TypeExpr.
12949 * typemanager.cs (TypeManager.system_*_expr): These are now
12950 TypExpr's instead of Expression's.
12951 (TypeManager.ResolveExpressionTypes): New public static function;
12952 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12955 2003-11-06 Miguel de Icaza <miguel@ximian.com>
12957 * expression.cs (New.DoResolve): Do not dereference value that
12958 might be a null return.
12960 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12961 sure that the constant value has the right type. Fixes an
12962 unreported bug, similar to 50425.
12964 * const.cs (Const.LookupConstantValue): Call
12965 ImplicitStandardConversionExists before doing a conversion to
12966 avoid havng the TypeManager.ChangeType do conversions.
12968 Reduced the number of casts used
12970 (Const.ChangeType): New routine to enable reuse of the constant
12971 type changing code from statement.
12973 * typemanager.cs (ChangeType): Move common initialization to
12974 static global variables.
12978 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12979 every value type to go through, even if it was void. Fix that.
12981 * cs-tokenizer.cs: Use is_identifier_start_character on the start
12982 character of the define, and the is_identifier_part_character for
12983 the rest of the string.
12985 2003-11-05 Miguel de Icaza <miguel@ximian.com>
12987 * expression.cs (UnaryMutator.EmitCode): When I updated
12988 LocalVariableReference.DoResolve, I overdid it, and dropped an
12989 optimization done on local variable references.
12991 2003-11-04 Miguel de Icaza <miguel@ximian.com>
12993 * ecore.cs: Convert the return from Ldlen into an int.
12995 2003-10-20 Miguel de Icaza <miguel@ximian.com>
12997 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12998 the accessibility, this is a special case for toplevel non-public
12999 classes (internal for instance).
13001 2003-10-20 Nick Drochak <ndrochak@gol.com>
13003 * ecore.cs: Fix typo and build. Needed another right paren.
13005 2003-10-19 Miguel de Icaza <miguel@ximian.com>
13007 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
13008 `internal' case regular and protected, but not allowing protected
13009 to be evaluated later. Bug 49840
13011 2003-10-15 Miguel de Icaza <miguel@ximian.com>
13013 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
13014 to kb.Nlast, and not the kb.nFirst to isolate the switch
13017 Extract the underlying type, so enumerations of long/ulong are
13018 treated like long/ulong.
13020 2003-10-14 Miguel de Icaza <miguel@ximian.com>
13022 * expression.cs (New): Overload the meaning of RequestedType to
13023 track the possible creation of the NewDelegate type, since
13024 DoResolve is invoked more than once for new constructors on field
13027 See bugs: #48800 and #37014
13029 * cs-parser.jay (declare_local_constants): Take an arraylist
13030 instead of a single constant.
13032 (local_constant_declaration): It should take a
13033 constant_declarators, not a constant_declarator. Fixes 49487
13035 * convert.cs: Fix error report.
13037 2003-10-13 Jackson Harper <jackson@ximian.com>
13039 * typemanager.cs (TypeToCoreType): Add float and double this fixes
13042 2003-11-03 Martin Baulig <martin@ximian.com>
13044 * expression.cs (ArrayAccess.GetStoreOpcode): Added
13045 `out bool has_type_arg'; if set, we need to pass the type to
13047 (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
13048 Stelem_Any/Ldelem_Any for generic parameters.
13050 2003-11-02 Martin Baulig <martin@ximian.com>
13052 * expression.cs (Invocation.EmitCall): Use
13053 `TypeManager.IsValueType()' to check whether it's a value type.
13054 Don't set `struct_call' when calling a method on a type parameter.
13056 2003-11-02 Martin Baulig <martin@ximian.com>
13058 * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
13059 and removed the TypeBuilder argument.
13061 * typemanager.cs (TypeManager.IsValueType): Return
13062 `t.IsGenericParameter || t.IsValueType'.
13064 2003-10-25 Martin Baulig <martin@ximian.com>
13066 * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
13067 call ConstructedType.Resolve() on it.
13069 * generic.cs (ConstructedType.Resolve): Set `type' on success.
13071 2003-10-25 Martin Baulig <martin@ximian.com>
13073 * class.cs (TypeContainer.GetClassBases): Changed
13074 `out Type parent' into `out TypeExpr parent'. Moved CS0644 and
13075 CS8214 reporting here.
13076 (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
13077 instead of a `Type' for our parent. In case of a recursive
13078 declaration (see tests/gen-23.cs for an example), our parent is a
13079 ConstructedType and it doesn't have its type set. So, first
13080 create our own TypeBuilder, then call constructed.Resolve() to get
13081 the parent's type and finally TypeBuilder.SetParent() it.
13083 * ecore.cs (TypeExpr.Name): New public virtual property.
13086 (ConstructedType): We're now a TypeExpr and not just an Expression.
13087 (ConstructedType.ResolveAsTypeStep): Don't resolve our type
13088 arguments here; this is done later.
13089 (ConstructedType.Resolve): New public method to resolve the type
13090 arguments and bind them.
13092 2003-10-21 Martin Baulig <martin@ximian.com>
13094 * convert.cs: Use `TypeManager.IsValueType' instead of
13095 'type.IsValueType' everywhere.
13097 * typemanager.cs (TypeManager.IsValueType): Return true for type
13098 parameters. The reason for this is that we need to box a type
13099 parameter when converting it to a reference type.
13101 * cs-parser.jay: Added support for default value expressions.
13103 * generics.cs (DefaultValueExpression): New public class.
13105 2003-10-17 Martin Baulig <martin@ximian.com>
13107 * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
13108 TypeContainer so we can also use this for Interfaces.
13109 (TypeParameter.Resolve): Likewise.
13111 * interface.cs (Interface.DefineType): Added support for generic
13114 * cs-parser.jay: Added support for generic structs and interfaces.
13116 2003-10-17 Martin Baulig <martin@ximian.com>
13118 * generic.cs (GenericMemberAccess.DoResolve): We can now actually
13119 call generic methods :-)
13121 2003-10-16 Martin Baulig <martin@ximian.com>
13123 * cs-parser.jay (namespace_or_type_name): Only create a
13124 GenericMemberAccess if we actually have type arguments.
13126 2003-10-13 Martin Baulig <martin@ximian.com>
13128 * class.cs (Method.Define): If we're a generic method, call
13129 TypeBuilder.DefineGenericMethod () before resolving
13131 (MethodData): Added .ctor which takes an additional MethodBuilder
13132 argument; this is used for generic methods.
13133 (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
13134 we already have a MethodBuilder.
13136 2003-10-10 Martin Baulig <martin@ximian.com>
13138 * class.cs (Method): Added .ctor which takes a `GenericMethod'
13139 instead of a `DeclSpace'. This is used for generic methods.
13141 * cs-parser.jay (method_header): Added support for generic
13142 methods; create a `GenericMethod' instance and pass it to the
13143 `Method's .ctor; it'll be used as the `DeclSpace' to lookup
13144 parameters and locals.
13146 * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
13147 since we already have the location. Check whether we're a generic
13148 type declaration or a generic method and create the correct type
13151 * generic.cs (TypeParameter.DefineMethod): New public method.
13152 (GenericMethod): New public class; derives from DeclSpace and is
13153 used for generic methods.
13155 2003-10-09 Martin Baulig <martin@ximian.com>
13157 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
13159 (MethodCore.DoDefineParameters): Removed the TypeContainer
13160 argument; use the DeclSpace which was passed to the .ctor instead.
13161 (MethodCore.CheckParameter): Take a DeclSpace instead of a
13162 TypeContainer; we only need a DeclSpace here.
13164 2003-10-09 Martin Baulig <martin@ximian.com>
13166 * class.cs (MethodData): Added additional `DeclSpace ds' argument
13168 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
13169 EmitContext's .ctor.
13171 2003-10-09 Martin Baulig <martin@ximian.com>
13173 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
13174 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
13175 AsAccessible(), moved them as well.
13177 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
13179 2003-10-07 Miguel de Icaza <miguel@ximian.com>
13181 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
13182 generation for >=, as spotted by Paolo, bug 48679.
13183 Patch from David Waite.
13185 * cs-tokenizer.cs: Add handling for #pragma.
13187 * cs-parser.jay: Allow for both yield and yield return in the
13188 syntax. The anti-cobolization of C# fight will go on!
13190 * class.cs (TypeBuilder.DefineType): Catch error condition here
13191 (Parent.DefineType erroring out and returning null).
13193 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13194 coping with enumerations variables, we were mistakenly processing
13195 them as a regular value type instead of built-in types. Fixes the
13198 * typemanager.cs (IsBuiltinOrEnum): New method.
13200 2003-09-30 Miguel de Icaza <miguel@ximian.com>
13202 * cs-parser.jay: Upgrade: yield now needs the return clause.
13204 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
13206 * cs-parser.jay : Renamed yyName to yyNames related to jay.
13208 2003-09-29 Martin Baulig <martin@ximian.com>
13210 * typemanager.cs (TypeManager.GetMethodFlags): Added support for
13211 inflated generic methods.
13213 * generics.cs (ConstructedType): Distinguish between open and
13214 closed constructed types; correctly resolve the arguments.
13216 2003-09-22 Martin Baulig <martin@ximian.com>
13218 * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
13219 all type arguments meet their constraints.
13221 2003-09-19 Martin Baulig <martin@ximian.com>
13223 * decl.cs (MemberCache.SetupCacheForInterface): Take a
13224 `MemberCache parent' argument. Normally, an interface doesn't
13225 have a parent type except System.Object, but we use this in gmcs
13226 for generic type parameters.
13228 2003-09-18 Martin Baulig <martin@ximian.com>
13230 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
13231 on `type.IsInterface'; don't check whether the type has a parent
13232 to determine whether it's an interface.
13234 2003-09-17 Martin Baulig <martin@ximian.com>
13236 * generic.cs (ConstructedType.ToString): Always use `name' as the
13239 2003-09-15 Martin Baulig <martin@ximian.com>
13241 * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
13243 * generic.cs (Constraints.Resolve): New public method; this is
13244 called to resolve the constraint types and to check whether all
13245 the constraints are correct.
13246 (Constraints.Types): New public property.
13247 (TypeParameter.Resolve): New public method; resolves all the
13248 type's constraints.
13250 * class.cs (TypeContainer.DefineType): Call
13251 TypeParameter.Resolve() before actually defining the type.
13253 2003-09-15 Martin Baulig <martin@ximian.com>
13255 * class.cs (TypeContainer.DefineType): Added an error flag to
13256 avoid reporting duplicate CS0146's ("class definition is
13259 * driver.cs (Driver.MainDriver): Abort if
13260 RootContext.ResolveTree() reported any errors.
13262 2003-09-07 Martin Baulig <martin@ximian.com>
13264 * report.cs (Error, Warning): Added overloaded versions which take
13265 a `params object[] args' and call String.Format().
13267 2003-09-07 Martin Baulig <martin@ximian.com>
13269 * decl.cs (DeclSpace..ctor): Don't call
13270 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
13271 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
13272 (DeclSpace.RecordDecl): New method.
13274 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
13276 2003-09-02 Ravi Pratap <ravi@ximian.com>
13278 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
13279 value attributes to be applied to ParameterBuilders.
13281 * class.cs (MethodCore.LabelParameters): Make static and more
13282 generic so that it can be used from other places - like interface
13283 methods, for instance.
13285 * interface.cs (Interface.Emit): Call LabelParameters before
13286 emitting attributes on the InterfaceMethod.
13288 2003-09-07 Martin Baulig <martin@ximian.com>
13290 * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
13291 if the number of type parameters doesn't match.
13293 2003-09-04 Martin Baulig <martin@ximian.com>
13295 * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
13296 for arrays of generic type params (ie. `!0[]').
13298 2003-09-04 Martin Baulig <martin@ximian.com>
13300 * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
13303 2003-09-04 Martin Baulig <martin@ximian.com>
13305 * decl.cs (DeclSpace.LookupGeneric): New method.
13306 (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
13309 * generic.cs (TypeParameterExpr): Take a TypeParameter as
13310 argument, not just a string.
13311 (TypeParameter.Define): New public method; this is called to
13312 actually define the generic parameter; after this, you can use the
13313 new `Type' property to get the type.
13315 2003-09-04 Martin Baulig <martin@ximian.com>
13317 * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
13318 is now an ArrayList; initialize the result of the `TypeParameters'
13320 (DeclSpace.GetGenericData): Removed.
13321 (DeclSpace.LookupGeneric): Temporarily removed; we need to
13322 implement this in a different way.
13323 (DeclSpace.GetTypeParameters): Removed; there's now a
13324 `TypeParameters' property.
13325 (DeclSpace.TypeParameters): New public property.
13327 * generic.cs (Constraints): Make this class public.
13328 (TypeParameter): New public class.
13330 2003-09-04 Martin Baulig <martin@ximian.com>
13332 * decl.cs (DeclSpace.GetTypeParameters): New method to return the
13333 generic parameters.
13335 * class.cs (TypeContainer.DefineType): Call
13336 TypeBuilder.DefineGenericParameter () on all generic parameters if
13337 this is a generic type.
13339 2003-08-28 Martin Baulig <martin@ximian.com>
13341 * sample-stack.il: Compile this with ilasm: "ilasm /dll
13344 * sample-hello.cs: Compile this with gmcs: "gmcs
13345 /r:sample-stack.dll sample-hello.cs".
13347 2003-08-28 Martin Baulig <martin@ximian.com>
13349 * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
13350 the parameters to the generic type.
13352 2003-08-28 Martin Baulig <martin@ximian.com>
13354 * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
13356 2003-08-28 Martin Baulig <martin@ximian.com>
13358 * cs-parser.jay (opt_type_argument_list): Use
13359 `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
13360 (primary_expression): Replace `qualified_identifier' with `type_name'.
13361 (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
13363 * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
13364 parser to check whether it is syntactically a type parameter list;
13365 return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
13368 2003-08-26 Martin Baulig <martin@ximian.com>
13370 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
13371 resolving aliases; fixes #47927.
13373 2003-08-26 Martin Baulig <martin@ximian.com>
13375 * statement.cs (Using.DoResolve): This is internally emitting a
13376 try/finally clause, so we need to set ec.NeedExplicitReturn if we
13377 do not always return. Fixes #47681.
13379 2003-08-26 Martin Baulig <martin@ximian.com>
13381 * decl.cs (MemberCore): Moved WarningNotHiding(),
13382 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
13384 (AdditionResult): Make this nested in DeclSpace.
13385 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
13386 argument; call NamespaceEntry.Define() unless we're nested in a
13389 * namespace.cs (Namespace.DefineName): New public function. This
13390 is called from DeclSpace's .ctor to add
13391 (Namespace.Lookup): Include DeclSpaces in the lookup.
13393 * class.cs (Operator): Derive from MemberBase, not MemberCore.
13395 * const.cs (Const): Derive from MemberBase, not MemberCore.
13397 2003-08-25 Martin Baulig <martin@ximian.com>
13399 * convert.cs (Convert.ExplicitReferenceConversion): When
13400 converting from an interface type to a class, unbox if the target
13401 type is a struct type. Fixes #47822.
13403 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13405 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
13408 2003-08-22 Martin Baulig <martin@ximian.com>
13410 * class.cs (TypeManager.DefineType): When defining a nested type,
13411 call DefineType() on our parent; fixes #47801.
13413 2003-08-22 Martin Baulig <martin@ximian.com>
13415 * class.cs (MethodData.Define): While checking if a method is an
13416 interface implementation, improve the test a bit more to fix #47654.
13418 2003-08-22 Martin Baulig <martin@ximian.com>
13420 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
13421 correctly; fixes #47722.
13423 2003-08-22 Martin Baulig <martin@ximian.com>
13425 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
13426 LocalVariableReference, ensure it's not read-only. Fixes #47536.
13428 * statement.cs (Fixed.DoResolve): Make all variables read-only.
13430 2003-08-22 Martin Baulig <martin@ximian.com>
13432 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
13433 can only be assigned in static constructors. Fixes #47161.
13435 2003-08-22 Martin Baulig <martin@ximian.com>
13437 Rewrote and improved the flow analysis code.
13439 * flowbranching.cs (FlowBranching): Make this class abstract.
13440 (FlowBranching.CreateBranching): New static function to create a
13441 new flow branching.
13442 (FlowBranchingBlock, FlowBranchingException): New classes.
13443 (FlowBranching.UsageVector.Type): New public readonly field.
13444 (FlowBranching.UsageVector.Breaks): Removed the setter.
13445 (FlowBranching.UsageVector.Returns): Removed the setter.
13446 (FlowBranching.UsageVector): Added Break(), Return(),
13447 NeverReachable() and Throw() methods to modify the reachability.
13448 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
13449 done by FlowBranching.Merge().
13450 (FlowBranching.UsageVector.MergeChild): New method; merges the
13451 merge result into the current vector.
13452 (FlowBranching.Merge): New abstract method to merge a branching.
13454 2003-08-12 Martin Baulig <martin@ximian.com>
13456 * expression.cs (Indirection.CacheTemporaries): Create the
13457 LocalTemporary with the pointer type, not its element type.
13459 2003-08-10 Miguel de Icaza <miguel@ximian.com>
13461 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
13462 token was a keyword or not.
13464 Add `error' options where an IDENTIFIER was expected; Provide
13465 CheckToken and CheckIdentifierToken convenience error reporting
13468 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
13470 * decl.cs: Rename `NamespaceEntry Namespace' public field into
13471 NameSpaceEntry NameSpaceEntry.
13473 (LookupInterfaceOrClass): Avoid creating a full qualified name
13474 from namespace and name: avoid doing lookups when we know the
13475 namespace is non-existant. Use new Tree.LookupByNamespace which
13476 looks up DeclSpaces based on their namespace, name pair.
13478 * driver.cs: Provide a new `parser verbose' to display the
13479 exception thrown during parsing. This is turned off by default
13480 now, so the output of a failure from mcs is more graceful.
13482 * namespace.cs: Track all the namespaces defined in a hashtable
13485 (IsNamespace): New method
13487 2003-08-09 Miguel de Icaza <miguel@ximian.com>
13489 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
13490 we know that we need to concatenate (full typename can never be
13495 * statement.cs: Use a bitfield; Do not initialize to null things
13496 which are done by the constructor by default.
13498 * cs-parser.jay: bug fix, parameter was 4, not 3.
13500 * expression.cs: Just use the property;
13502 * statement.cs: No need for GetVariableInfo method.
13504 2003-08-08 Martin Baulig <martin@ximian.com>
13506 * flowanalysis.cs (FlowReturns): This is now nested in the
13507 `FlowBranching' class.
13508 (MyBitVector): Moved this here from statement.cs.
13509 (FlowBranching.SiblingType): New enum type.
13510 (FlowBranching.CreateSibling): Added `SiblingType' argument.
13512 2003-08-07 Martin Baulig <martin@ximian.com>
13514 * flowanalysis.cs (FlowBranchingType): This is now nested in the
13515 `FlowBranching' class and called `BranchingType'.
13517 2003-08-07 Martin Baulig <martin@ximian.com>
13519 * flowanalysis.cs: Moved all the control flow analysis code into
13522 2003-08-07 Martin Baulig <martin@ximian.com>
13524 * assign.cs (Assign.DoResolve): `target' must either be an
13525 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
13528 2003-08-07 Miguel de Icaza <miguel@ximian.com>
13530 * expression.cs (BinaryMethod): This kind of expression is created by the
13531 Binary class if it determines that the operator has to be handled
13534 (BinaryDelegate): This kind of expression is created if we are
13535 dealing with a + or - operator on delegates.
13537 (Binary): remove method, argumetns, and DelegateOperator: when
13538 dealing with methods,
13540 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
13542 * statement.cs (Block): use bitfields for the three extra booleans
13543 we had in use. Remove unused topblock parameter.
13545 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
13547 * assign.cs: Drop extra unneeded tests.
13549 2003-08-06 Miguel de Icaza <miguel@ximian.com>
13551 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
13553 * statement.cs (Foreach): Use VariableStorage instead of
13556 * codegen.cs (VariableStorage): New class used by clients that
13557 require a variable stored: locals or fields for variables that
13558 need to live across yield.
13560 Maybe provide a convenience api for EmitThis+EmitLoad?
13562 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
13565 2003-08-05 Miguel de Icaza <miguel@ximian.com>
13567 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
13568 RemapParameterLValue): New methods that are used to turn a
13569 precomputed FieldInfo into an expression like this:
13573 The idea is to use this instead of making LocalVariableReference
13574 have more than one meaning.
13576 * cs-parser.jay: Add error production to BASE.
13578 * ecore.cs: Deal with TypeManager.GetField returning null, which
13579 is now a valid return value.
13581 (FieldExprNoAddress): New expression for Fields whose address can
13584 * expression.cs (LocalVariableReference): During the resolve
13585 phases, create new expressions if we are in a remapping context.
13586 Remove code that dealt with remapping here.
13588 (ParameterReference): same.
13590 (ProxyInstance): New expression, like the `This' expression, but
13591 it is born fully resolved. We know what we are doing, so remove
13592 the errors that are targeted to user-provided uses of `this'.
13594 * statement.cs (Foreach): our variable is now stored as an
13595 Expression; During resolution, follow the protocol, dont just
13596 assume it will return this.
13598 2003-08-06 Martin Baulig <martin@ximian.com>
13600 * support.cs (SeekableStreamReader.cs): New public class.
13602 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
13603 SeekableStreamReader instead of the normal StreamReader.
13605 2003-08-04 Martin Baulig <martin@ximian.com>
13607 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
13608 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
13609 deambiguate casts and delegate invocations.
13610 (parenthesized_expression): Use the new tokens to ensure this is
13611 not a cast of method invocation.
13613 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
13614 when reading a `)' and Deambiguate_CloseParens () was previously
13617 * expression.cs (ParenthesizedExpression): New class. This is
13618 just used for the CS0075 test.
13619 (Binary.DoResolve): Check for CS0075.
13621 2003-07-29 Ravi Pratap <ravi@ximian.com>
13623 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
13624 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
13625 reference comparison.
13627 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
13628 examine the ReturnType for equality - this is necessary in the
13629 cases of implicit and explicit operators whose signature also
13630 includes the return type.
13632 2003-07-26 Miguel de Icaza <miguel@ximian.com>
13634 * namespace.cs: Cache the result of the namespace computation,
13635 instead of computing it every time.
13637 2003-07-24 Miguel de Icaza <miguel@ximian.com>
13639 * decl.cs: Use a global arraylist that we reuse over invocations
13640 to avoid excesive memory consumption. Reduces memory usage on an
13641 mcs compile by one meg (45 average).
13643 * typemanager.cs (LookupTypeReflection): In .NET pointers are
13644 private, work around that.
13646 2003-07-23 Miguel de Icaza <miguel@ximian.com>
13648 * literal.cs (IntLiteral): Define Zero and One static literals.
13650 * cs-parser.jay (integer_literal): use static literals to reduce
13651 memory usage for the most used literals (0, 1 and -1). 211kb
13652 reduced in memory usage.
13654 Replace all calls to `new ArrayList' with `new
13655 ArrayList(4)' which is a good average number for most allocations,
13656 and also requires only 16 bytes of memory for its buffer by
13659 This reduced MCS memory usage in seven megabytes for the RSS after
13662 2003-07-28 Ravi Pratap <ravi@ximian.com>
13664 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
13665 handle params methods the correct way by forming only one
13666 applicable set with params and normal methods in them. Earlier we
13667 were looking at params methods only if we found no normal methods
13668 which was not the correct thing to do.
13670 (Invocation.BetterFunction): Take separate arguments indicating
13671 when candidate and the best method are params methods in their
13674 This fixes bugs #43367 and #46199.
13676 * attribute.cs: Documentation updates.
13678 (CheckAttribute): Rename to CheckAttributeTarget.
13679 (GetValidPlaces): Rename to GetValidTargets.
13681 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
13682 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
13686 2003-07-28 Miguel de Icaza <miguel@ximian.com>
13688 * codegen.cs: Compute IsGeneric correctly.
13690 * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
13693 Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
13694 OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
13695 regressions, and I was chasing more bugs than I required.
13697 * interface.cs: Use expressions for base type names (like classes
13698 and structs have been doing for a while now), and resolve that.
13699 This patch should probably go into head as well.
13701 This makes it one less user of FindType.
13703 2003-07-24 Miguel de Icaza <miguel@ximian.com>
13705 This compiler can not self host currently. Need to fix that.
13707 * Makefile: compile to `gmcs.exe'
13709 * driver.cs: Turn on v2 by default on gmcs.
13711 * generic.cs (ConstructedType): Does no longer take a container
13712 type argument; That will be taken care of later.
13714 (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
13715 Use SimpleName to resolve for now, so we can continue the work on
13716 the parser, until we get Type.GetType that understands generics.
13718 (ConstructedType.ToString): Implement
13720 (TypeArguments.Resolve): Resolve the child expressions as types.
13722 * cs-parser.jay: Rename interface_constraints to
13723 type_parameter_constraints
13725 (namespace_or_type_name): Only use constructed types for the basic
13726 construction, we will deal with identifier<...> later.
13728 (type/type_name): No longer call DecomposeQI, as
13729 namespace_or_type_name is always decoded now.
13731 2003-07-22 Ravi Pratap <ravi@ximian.com>
13733 * expression.cs (Invocation.OverloadResolve): Follow the spec more
13734 closely: we eliminate methods in base types when we have an
13735 applicable method in a top-level type.
13737 Please see section 14.5.5.1 for an exact description of what goes
13740 This fixes bug #45127 and a host of other related to corlib compilation.
13742 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13743 array is the method corresponding to the top-level type (this is
13744 because of the changes made to icall.c) so we change this
13747 (MethodGroupExpr.Name): This too.
13749 * typemanager.cs (GetElementType): New method which does the right
13750 thing when compiling corlib.
13752 * everywhere: Make use of the above in the relevant places.
13754 2003-07-22 Martin Baulig <martin@ximian.com>
13756 * cs-parser.jay (invocation_expression): Moved
13757 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
13758 `cast_expression', but create a InvocationOrCast which later
13759 resolves to either an Invocation or a Cast.
13761 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
13762 method; call this before EmitStatement() to make sure that this
13763 expression can be used as a statement.
13765 * expression.cs (InvocationOrCast): New class; resolves to either
13766 an Invocation or a Cast.
13768 * statement.cs (StatementExpression): Call ResolveStatement() on
13769 the ExpressionStatement before emitting it.
13771 2003-07-21 Martin Baulig <martin@ximian.com>
13773 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
13774 `ref' and `out' attributes match; fixes #46220.
13775 (MemberAccess.ResolveMemberAccess): You can't reference a type
13776 through an expression; fixes #33180.
13777 (Indexers.GetIndexersForType): Don't return the indexers from
13778 interfaces the class implements; fixes #46502.
13780 2003-07-21 Martin Baulig <martin@ximian.com>
13782 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
13783 CS0661 checks; fixes bug #30442.
13785 2003-07-21 Martin Baulig <martin@ximian.com>
13787 * decl.cs (AdditionResult): Added `Error'.
13789 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
13791 * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
13792 cs0031.cs actually work.
13794 2003-07-20 Miguel de Icaza <miguel@ximian.com>
13796 * cs-parser.jay (namespace_name): do not use
13797 namespace_or_type_name, use qualified_identifier, because
13798 namespace_or_type_name will soon return a composed expression
13799 instead of a string.
13801 (namespace_or_type_name): Instead of returning a string, now this
13802 production returns an expression.
13804 * codegen.cs (EmitContext): Setup IsGeneric property based on
13805 whether our DeclSpace is generic, our the method is generic.
13807 * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
13808 the method is generic.
13810 * cs-parser.jay (type_arguments, opt_type_argument_list,
13811 type_parameters, type_parameter_list, opt_type_parameter_list,
13812 type_parameter,, opt_type_parameter_constraints_clauses,
13813 type_parameter_constraints_clauses,
13814 type_parameter_constraint_clause, type_parameter_constraint,
13815 interface_constraints): Add new production
13817 * decl.cs (DeclSpace): IsGeneric, flag to track whether this
13818 DeclSpace is generic or not.
13820 (DeclSpace.SetParameterInfo): New routine, used to set the
13821 parameter info for a type.
13823 (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
13824 returns a GenericTypeExpr
13826 * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
13827 generic, lookup the generic argument.
13829 * attribute.cs: Do not allow TypeParameterExpressions in
13832 * class.cs: Do not allow the Main method to be defined in a
13835 * expression.cs (SizeOf): Do not allow generic types to be used as
13836 arguments to sizeof.
13838 * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
13839 it: whether a type is generic or not. Only works for types we are
13840 currently building for now.
13842 2003-07-20 Martin Baulig <martin@ximian.com>
13844 * namespace.cs: Fixed that bug which caused a crash when compiling
13845 the debugger's GUI.
13847 2003-07-20 Miguel de Icaza <miguel@ximian.com>
13849 * typemanager.cs (LookupTypeReflection): Never expose types which
13850 are NotPublic, NestedPrivate, NestedAssembly, or
13851 NestedFamANDAssem. We used to return these, and later do a check
13852 that would report a meaningful error, but the problem is that we
13853 would not get the real match, if there was a name override.
13855 2003-07-18 Miguel de Icaza <miguel@ximian.com>
13857 * namespace.cs (Namespace, Name): Do not compute the namespace
13858 name dynamically, compute it in the constructor. This reduced
13859 memory usage by 1697 KB.
13861 * driver.cs: Use --pause to pause at the end.
13863 2003-07-17 Peter Williams <peter@newton.cx>
13865 * Makefile: Change the name of the test target so that it doesn't
13866 conflict with the recursive test target.
13868 2003-07-17 Miguel de Icaza <miguel@ximian.com>
13870 * expression.cs (LocalVariableReference.Emit, EmitAssign,
13871 AddressOf): Do not use EmitThis, that was wrong, use the actual
13874 2003-07-15 Miguel de Icaza <miguel@ximian.com>
13876 * class.cs (MethodData.Define): While checking if a method is an
13877 interface implementation, improve the test: If we are not public
13878 (use new test here: use the computed MethodAttributes directly,
13879 instead of the parsed modifier flags) check if the `implementing'
13880 method comes from an interface or not.
13882 * pending.cs (VerifyPendingMethods): Slightly better error
13885 * makefile: add test target that does the mcs bootstrap.
13887 2003-07-16 Ravi Pratap <ravi@ximian.com>
13889 * interface.cs (Define): Do nothing here since there are no
13890 members to populate etc. Move the attribute emission out of here
13891 since this was just totally the wrong place to put it. Attribute
13892 application happens during the 'Emit' phase, not in the 'Define'
13895 (Emit): Add this method and move the attribute emission here
13897 * rootcontext.cs (EmitCode): Call the Emit method on interface
13900 2003-07-14 Ravi Pratap M <ravi@ximian.com>
13902 * expression.cs (OverloadResolve): Report error only if Location
13903 is not 'Null' which means that there was a probe going on.
13905 2003-07-14 Martin Baulig <martin@ximian.com>
13907 * expression.cs (ConditionalLogicalOperator): New public class to
13908 implement user defined conditional logical operators.
13909 This is section 14.11.2 in the spec and bug #40505.
13911 2003-07-14 Martin Baulig <martin@ximian.com>
13913 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13915 2003-07-14 Martin Baulig <martin@ximian.com>
13917 * codegen.cs (EmitContext.InFixedInitializer): New public field.
13919 * ecore.cs (IVariable.VerifyFixed): New interface method.
13921 * expression.cs (Unary.ResolveOperator): When resolving the `&'
13922 operator, check whether the variable is actually fixed. Fixes bug
13923 #36055. Set a variable definitely assigned when taking its
13924 address as required by the spec.
13926 * statement.cs (LocalInfo.IsFixed): New field.
13927 (LocalInfo.MakePinned): Set `IsFixed' to true.
13929 2003-07-14 Ravi Pratap M <ravi@ximian.com>
13931 * attribute.cs (Attribute.Resolve): While doing a Member lookup
13932 for .ctors, ensure that we only ask for members declared in the
13933 attribute type (BindingFlags.DeclaredOnly).
13937 * expression.cs (Error_WrongNumArguments): Report error 1501
13938 correctly the way CSC does.
13940 2003-07-13 Martin Baulig <martin@ximian.com>
13942 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13943 lookup on the fully qualified name, to make things like "X.X" work
13944 where "X.X" is a fully qualified type name, but we also have a
13945 namespace "X" in the using list. Fixes #41975.
13947 2003-07-13 Martin Baulig <martin@ximian.com>
13949 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13950 function. If we're a CompoundAssign, we need to create an embedded
13951 CompoundAssign, not an embedded Assign.
13952 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13955 2003-07-13 Martin Baulig <martin@ximian.com>
13957 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13958 work to fix bug #46088.
13960 2003-07-13 Ravi Pratap <ravi@ximian.com>
13962 * class.cs (Operator.Emit): Do not emit attributes here - it is
13963 taken care of by the Method class that we delegate too. This takes
13964 care of bug #45876.
13966 2003-07-10 Martin Baulig <martin@ximian.com>
13968 * expression.cs (TypeOfVoid): New class.
13969 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
13971 2003-07-10 Martin Baulig <martin@ximian.com>
13973 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13976 2003-07-10 Martin Baulig <martin@ximian.com>
13978 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13979 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13981 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13983 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13985 2003-07-10 Martin Baulig <martin@ximian.com>
13987 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13988 of decimal. Fixes #42850.
13990 NOTE: I also fixed the created byte blob, but this doesn't work on
13991 the MS runtime and csc never produces any byte blobs for decimal
13994 2003-07-10 Martin Baulig <martin@ximian.com>
13996 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13997 structs; fixes #32068.
13998 (Block.AddChildVariableNames): Fixed #44302.
14000 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14002 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
14004 2003-07-07 Miguel de Icaza <miguel@ximian.com>
14006 * attribute.cs: And this test is onger needed.
14008 2003-07-08 Martin Baulig <martin@ximian.com>
14010 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
14011 inaccessible types. Fixes #36313.
14013 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
14015 * namespace.cs (NamespaceEntry): Create implicit entries for all
14016 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
14017 implicit entries for N1.N2 and N1.
14019 2003-07-08 Martin Baulig <martin@ximian.com>
14021 Rewrote the handling of namespaces to fix a lot of the issues
14022 wrt. `using' aliases etc.
14024 * namespace.cs (Namespace): Splitted this class into a
14025 per-assembly `Namespace' and a per-file `NamespaceEntry'.
14027 * typemanager.cs (TypeManager.IsNamespace): Removed.
14028 (TypeManager.ComputeNamespaces): Only compute namespaces from
14029 loaded assemblies here, not the namespaces from the assembly we're
14030 currently compiling.
14032 2003-07-08 Martin Baulig <martin@ximian.com>
14034 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
14036 2003-07-07 Miguel de Icaza <miguel@ximian.com>
14038 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
14041 I thought about the memory savings here, but LookupTypeReflection
14042 is used under already very constrained scenarios. Compiling
14043 corlib or mcs only exposes one hit, so it would not really reduce
14044 any memory consumption.
14046 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14048 * typemanager.cs: fixes bug #45889 by only adding public types from
14049 other assemblies to the list of known types.
14051 2003-07-07 Miguel de Icaza <miguel@ximian.com>
14053 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
14054 on the type we resolved.
14056 2003-07-05 Martin Baulig <martin@ximian.com>
14058 * pending.cs (PendingImplementation.ParentImplements): Don't
14059 create the proxy if the parent is abstract.
14061 * class.cs (TypeContainer.DefineIndexers): Process explicit
14062 interface implementations first. Fixes #37714.
14064 2003-07-04 Miguel de Icaza <miguel@ximian.com>
14066 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
14067 defined recursively; but since we modify the input parameters
14068 (left is set to `this' temporarily), we reset this value if the
14069 left_is_explicit is false, which gives the original semantics to
14072 * literal.cs (NullPointer): new class used to represent a null
14073 literal in a pointer context.
14075 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
14076 type is a pointer, use a NullPointer object instead of a
14077 NullLiteral. Closes 43687
14079 (ExplicitConversion): Convert pointer values using
14080 the conv opcode to the proper type.
14082 * ecore.cs (New): change ValueTypeVariable property into a method,
14083 that returns whether the valuetype is suitable for being used.
14085 * expression.cs (Binary.DoNumericPromotions): Only return if we
14086 the int constant was a valid uint, and we can return both left and
14087 right as uints. If not, we continue processing, to trigger the
14088 type conversion. This fixes 39018.
14090 * statement.cs (Block.EmitMeta): During constant resolution, set
14091 the CurrentBlock property on the emitcontext, so that we resolve
14092 constants propertly.
14094 2003-07-02 Martin Baulig <martin@ximian.com>
14096 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
14097 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
14099 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
14100 than emitting it here.
14102 * statement.cs: Fixed some more flow analysis bugs.
14104 2003-07-02 Martin Baulig <martin@ximian.com>
14106 * class.cs (MethodData.Define): When implementing interface
14107 methods, set Final unless we're Virtual.
14109 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
14110 check work for interface methods.
14112 2003-07-01 Martin Baulig <martin@ximian.com>
14114 * ecore.cs (EmitContext.This): Replaced this property with a
14115 GetThis() method which takes a Location argument. This ensures
14116 that we get the correct error location for a CS0188.
14118 2003-07-01 Miguel de Icaza <miguel@ximian.com>
14120 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
14121 ImplicitStandardConversion.
14123 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
14125 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
14127 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
14130 2003-06-30 Miguel de Icaza <miguel@ximian.com>
14132 * class.cs (Constructor.Define): Turn off initlocals for unsafe
14135 (MethodData.Define): Turn off initlocals for unsafe methods.
14137 2003-06-29 Miguel de Icaza <miguel@ximian.com>
14139 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
14140 complete; Fixes #37521.
14142 * delegate.cs: Use Modifiers.TypeAttr to compute the
14143 TypeAttributes, instead of rolling our own. This makes the flags
14144 correct for the delegates.
14146 2003-06-28 Miguel de Icaza <miguel@ximian.com>
14148 * class.cs (Constructor.Define): Set the private flag for static
14149 constructors as well.
14151 * cs-parser.jay (statement_expression): Set the return value to
14152 null, to avoid a crash when we catch an error.
14154 2003-06-24 Miguel de Icaza <miguel@ximian.com>
14156 * cs-parser.jay: Applied patch from Jackson that adds support for
14157 extern and unsafe modifiers to destructor declarations.
14159 * expression.cs: Report error 21 if the user is trying to index a
14162 * driver.cs: Add an error message, suggested by the bug report.
14164 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
14165 if we do not have a ": this ()" constructor initializer. Fixes 45149
14167 2003-06-14 Miguel de Icaza <miguel@ximian.com>
14169 * namespace.cs: Add some information to reduce FAQs.
14171 2003-06-13 Miguel de Icaza <miguel@ximian.com>
14173 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
14174 underlying enumeration types. Fixes #43915.
14176 * expression.cs: Treat ushort/short as legal values to be used in
14177 bitwise operations.
14179 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
14181 * delegate.cs: transfer custom attributes for paramenters from
14182 the delegate declaration to Invoke and BeginInvoke.
14184 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
14186 * attribute.cs: handle custom marshalers and emit marshal info
14189 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
14191 * makefile.gnu: Added anonymous.cs to the compiler sources.
14193 2003-05-28 Miguel de Icaza <miguel@ximian.com>
14195 * iterators.cs: Change the name of the proxy class to include two
14198 * cs-parser.jay: Update grammar to include anonymous methods.
14200 * anonymous.cs: new file.
14202 2003-05-27 Miguel de Icaza <miguel@ximian.com>
14204 * class.cs (Field.Define): Add missing test for pointers and
14207 2003-05-27 Ravi Pratap <ravi@ximian.com>
14209 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
14210 we use the stobj opcode.
14212 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
14213 since it wasn't the correct fix.
14215 It still is puzzling that we are required to use stobj for IntPtr
14216 which seems to be a ValueType.
14218 2003-05-26 Miguel de Icaza <miguel@ximian.com>
14220 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
14221 during regular simple name resolution. Now, the trick is that
14222 instead of returning for processing the simplename, we do a
14223 TypeManager.LookupType (ie, a rooted lookup as opposed to a
14224 contextual lookup type). If a match is found, return that, if
14225 not, return for further composition.
14227 This fixes long-standing 30485.
14229 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14230 using the address to initialize an object, do an Stobj instead of
14231 using the regular Stelem.
14233 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
14234 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
14235 Because if we are a BaseIndexerAccess that value will be true.
14238 * statement.cs (GotoCase.Resolve): Return after reporting an
14239 error, do not attempt to continue.
14241 * expression.cs (PointerArithmetic.Emit): If our operand is a
14242 long, convert our constants to match the operand before
14243 multiplying. Convert to I type before adding. Fixes 43670.
14245 2003-05-14 Ravi Pratap <ravi@ximian.com>
14247 * enum.cs (ImplicitConversionExists) : Rename to
14248 ImplicitEnumConversionExists to remove ambiguity.
14250 * ecore.cs (NullCast): New type of cast expression class which
14251 basically is very similar to EmptyCast with the difference being
14252 it still is a constant since it is used only to cast a null to
14254 (eg. (string) null)
14256 * convert.cs (ImplicitReferenceConversion): When casting a null
14257 literal, we return a NullCast.
14259 * literal.cs (NullLiteralTyped): Remove - I don't see why this
14260 should be around anymore.
14262 The renaming (reported was slightly wrong). Corrections:
14264 ConvertImplicitStandard -> ImplicitConversionStandard
14265 ConvertExplicitStandard -> ExplicitConversionStandard
14267 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
14268 before passing them in !
14270 * convert.cs (ImplicitConversionStandard): When comparing for
14271 equal expr and target types, ensure that expr is not a
14274 In general, we must not be checking (expr_type ==
14275 target_type) in the top level conversion methods
14276 (ImplicitConversion, ExplicitConversion etc). This checking is
14277 done in the methods that they delegate to.
14279 2003-05-20 Miguel de Icaza <miguel@ximian.com>
14281 * convert.cs: Move Error_CannotConvertType,
14282 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
14283 ImplicitNumericConversion, ImplicitConversionExists,
14284 ImplicitUserConversionExists, StandardConversionExists,
14285 FindMostEncompassedType, FindMostSpecificSource,
14286 FindMostSpecificTarget, ImplicitUserConversion,
14287 ExplicitUserConversion, GetConversionOperators,
14288 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
14289 TryImplicitIntConversion, Error_CannotConvertImplicit,
14290 ConvertImplicitRequired, ConvertNumericExplicit,
14291 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
14292 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
14295 Perform the following renames:
14297 StandardConversionExists -> ImplicitStandardConversionExists
14298 ConvertImplicit -> ImplicitConversion
14299 ConvertImplicitStandard -> ImplicitStandardConversion
14300 TryImplicitIntConversion -> ImplicitIntConversion
14301 ConvertImplicitRequired -> ImplicitConversionRequired
14302 ConvertNumericExplicit -> ExplicitNumericConversion
14303 ConvertReferenceExplicit -> ExplicitReferenceConversion
14304 ConvertExplicit -> ExplicitConversion
14305 ConvertExplicitStandard -> ExplicitStandardConversion
14307 2003-05-19 Martin Baulig <martin@ximian.com>
14309 * statement.cs (TypeInfo.StructInfo): Made this type protected.
14310 (TypeInfo): Added support for structs having structs as fields.
14312 * ecore.cs (FieldExpr): Implement IVariable.
14313 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
14314 VariableInfo for the field.
14316 2003-05-18 Martin Baulig <martin@ximian.com>
14318 * expression.cs (This.DoResolve): Report a CS0027 if we're
14319 emitting a field initializer.
14321 2003-05-18 Martin Baulig <martin@ximian.com>
14323 * expression.cs (This.ResolveBase): New public function.
14324 (This.DoResolve): Check for CS0188.
14326 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
14329 * ecore.cs (MethodGroupExpr.DoResolve): Set the
14330 `instance_expression' to null if we don't have any non-static
14333 2003-05-18 Martin Baulig <martin@ximian.com>
14335 Reworked the way how local variables and parameters are handled by
14336 the flow analysis code.
14338 * statement.cs (TypeInfo, VariableMap): New public classes.
14339 (VariableInfo): New public class. This is now responsible for
14340 checking whether a variable has been assigned. It is used for
14341 parameters and local variables.
14342 (Block.EmitMeta): Take the InternalParameters as argument; compute
14343 the layout of the flow vectors here.
14344 (Block.LocalMap, Block.ParameterMap): New public properties.
14345 (FlowBranching): The .ctor doesn't get the InternalParameters
14346 anymore since Block.EmitMeta() now computes the layout of the flow
14348 (MyStructInfo): This class is now known as `StructInfo' and nested
14349 in `TypeInfo'; we don't access this directly anymore.
14351 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
14352 property and removed IsAssigned(), IsFieldAssigned(),
14353 SetAssigned() and SetFieldAssigned(); we now call them on the
14354 VariableInfo so we don't need to duplicate this code everywhere.
14356 * expression.cs (ParameterReference): Added `Block block' argument
14358 (LocalVariableReference, ParameterReference, This): The new
14359 VariableInfo class is now responsible for all the definite
14362 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
14363 IsParameterAssigned, SetParameterAssigned): Removed.
14365 2003-05-18 Martin Baulig <martin@ximian.com>
14367 * typemanager.cs (InitCoreTypes): Try calling
14368 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
14369 the 3-args-version. Corlib now also needs our `void_type'.
14370 (GetMethod): Added overloaded version which takes an optional
14371 `bool report_errors' to allow lookups of optional methods.
14373 2003-05-12 Martin Baulig <martin@ximian.com>
14375 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
14376 only used for locals and not for parameters.
14378 2003-05-12 Miguel de Icaza <miguel@ximian.com>
14380 * support.cs (InternalParameters.ParameterType): Return the
14381 ExternalType of the parameter.
14383 * parameter.cs (Parameter.ExternalType): drop the two arguments,
14386 2003-05-11 Miguel de Icaza <miguel@ximian.com>
14388 * class.cs (MethodData.Define): Do not set the `newslot' on
14389 interface members, if they are also flagged as "override".
14391 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
14392 better code for ++i and i++. This only works for static fields
14393 and local variables.
14395 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
14396 want to pull the DeclSpace out of the builder_to_declspace instead
14397 of the TypeBuilder (like in TypeContainer.FindMembers).
14399 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
14400 instead of LookupTypeContainer. Fixes the crash on .NET for
14401 looking up interface members.
14403 * const.cs: Create our own emit context during the Definition
14404 stage, so that constants are evaluated in the proper context, when
14405 a recursive definition happens.
14407 2003-05-11 Martin Baulig <martin@ximian.com>
14409 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
14410 new block for a switch section.
14411 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
14412 the adding/lookup in the switch block. Fixes #39828.
14414 2003-05-09 Miguel de Icaza <miguel@ximian.com>
14416 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
14417 functionality: I needed to convert the data after I had performed
14418 the add/sub operation into the operands type size.
14420 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
14421 pass the type for the box operation, otherwise the resulting
14422 object would have been of type object.
14424 (BoxedCast): Add constructor to specify the type to box as.
14426 2003-05-07 Miguel de Icaza <miguel@ximian.com>
14428 * iterators.cs: I was reusing the `count' variable inadvertently,
14429 take steps to not allow this to happen.
14431 2003-05-06 Miguel de Icaza <miguel@ximian.com>
14433 * attribute.cs (Attribute.Resolve): Params attributes are encoded
14434 by creating an array at the point where the params starts and
14435 putting all those arguments there, then adjusting the size of the
14438 2003-05-05 Miguel de Icaza <miguel@ximian.com>
14440 * expression.cs (New.AddressOf): Implement interface
14441 IMemoryLocation. This is used when the `new' operator is used in
14442 the context of an invocation to a method on a value type.
14444 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
14447 * namespace.cs: Also check the using aliases here.
14449 * driver.cs: Move the test for using validity after the types have
14450 been entered, so we do a single pass that also includes the using
14453 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
14454 in the regular case. CreateSiblingForFinally is doing extra
14457 * attribute.cs (GetAttributeArgumentExpression): Store the result
14458 on an out value, and use the return value to indicate failure
14459 instead of using null (which is a valid return for Constant.GetValue).
14461 * statement.cs: Perform the analysis flow for the increment
14462 portion after the statement, because this will be the real flow of
14463 execution. Fixes #42385
14465 * codegen.cs (EmitContext.EmitArgument,
14466 EmitContext.EmitStoreArgument): New helper functions when the
14467 RemapToProxy flag is set.
14469 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
14472 Add support for remapping parameters.
14474 * iterators.cs: Propagate parameter values; Store parameter
14475 values in the proxy classes.
14477 2003-05-04 Miguel de Icaza <miguel@ximian.com>
14479 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
14480 need a proxy reference; I do not know what I was thinking
14482 * cs-parser.jay (constructor_initializer): catch another error,
14483 and display nice message.
14485 (field_declaration): catch void field declaration
14486 to flag a better error.
14488 * class.cs (MemberBase.CheckBase): Report an error instead of a
14489 warning if a new protected member is declared in a struct.
14490 (Field.Define): catch the error of readonly/volatile.
14492 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
14494 (FieldExpr.AddressOf): ditto. Catch error where the address of a
14495 volatile variable is taken
14497 2003-05-02 Miguel de Icaza <miguel@ximian.com>
14499 * statement.cs (Fixed.Resolve): Report an error if we are not in
14502 2003-05-01 Miguel de Icaza <miguel@ximian.com>
14504 * typemanager.cs: reuse the code that handles type clashes for
14505 delegates and enumerations.
14507 * class.cs (Report28): Always report.
14509 * expression.cs (EncodeAsAttribute): Allow nulls here.
14511 2003-04-28 Miguel de Icaza <miguel@ximian.com>
14513 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
14514 the functionality for testing whether an expression is valid for
14515 an attribute here. Also handle the case of arrays of elements
14518 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
14519 encoding a linear array into an array of objects that are suitable
14520 to be passed to an CustomAttributeBuilder.
14522 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
14524 * ecore.cs: (FieldExpr): Handle field remapping here.
14526 * iteratators.cs: Pass the instance variable (if the method is an
14527 instance method) to the constructors, so we can access the field
14528 variables on the class.
14530 TODO: Test this with structs. I think the THIS variable on
14531 structs might have to be a pointer, and not a refenrece
14533 2003-04-27 Miguel de Icaza <miguel@ximian.com>
14535 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
14536 local variables to fields in a proxy class.
14538 * iterators.cs (PopulateProxy): Rename our internal fields to
14540 Create a <THIS> field if we are an instance method, so we can
14541 reference our parent container variables.
14542 (MapVariable): Called back from the EmitContext code to enter a
14543 new variable to field mapping into the proxy class (we just create
14547 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
14548 for using the remapped locals to fields.
14550 I placed the code here, because that gives the same semantics to
14551 local variables, and only changes the Emit code.
14553 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
14554 statements inside iterators.
14555 (VariableInfo): Add a FieldBuilder for the cases when we are
14556 remapping local variables to fields in a proxy class
14558 * ecore.cs (SimpleNameResolve): Avoid testing two times for
14559 current_block != null.
14561 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
14562 not cope with strings, as it has been moved to the
14563 TableSwitchEmit. Fixed bug in switch generation.
14565 * expression.cs (New.DoResolve): Provide more context for the user
14566 when reporting an error.
14568 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
14571 * expression.cs (MemberAccess.DoResolve): When we get a type back,
14572 check the permissions for it. Note than in a type-resolution
14573 context the check was already present in DeclSpace.ResolveType,
14574 but was missing from the MemberAccess.
14576 (ArrayCreation.CheckIndices): warn if the user has
14577 more nested levels of expressions, but there are no more
14578 dimensions specified. Avoids crash on bug 41906.
14580 2003-04-26 Miguel de Icaza <miguel@ximian.com>
14582 * statement.cs (Block): replace Implicit bool, for a generic
14584 New flag: `Unchecked'. This is used during the EmitMeta phase
14585 (which is out-of-line with the regular Resolve/Emit process for a
14586 statement, as this is done ahead of time, but still gets a chance
14587 to call constant resolve).
14589 (Block.Flags): new enum for adding a new flag.
14591 (Block.EmitMeta): track the state of unchecked.
14593 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
14594 to enable constant resolution to work there as well.
14596 2003-04-22 Miguel de Icaza <miguel@ximian.com>
14598 * typemanager.cs (ienumerable_type): Also look up
14599 System.Collections.IEnumerable.
14601 2003-04-21 Miguel de Icaza <miguel@ximian.com>
14603 TODO: Test more than one conditional per method.
14605 * class.cs (Indexer.Define): Report the location where the user is
14606 referencing the unsupported feature.
14608 (MethodData): Overload the use of `conditionals' to
14609 minimize the creation of needless ArrayLists. This saves roughly
14610 212kb on my machine.
14612 (Method): Implement the new IIteratorContainer interface.
14613 (Method.SetYields): Implement the method by setting the ModFlags
14614 to contain METHOD_YIELDS.
14616 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
14617 which just got set to null.
14619 * iterators.cs: New file.
14621 (Yield, YieldBreak): New statements.
14623 * statement.cs (Return.Resolve): Flag an error if we are used in
14624 an iterator method.
14626 * codegen.cs (InIterator): New flag set if the code is being
14627 compiled in an iterator method.
14629 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
14630 internal modifier, and we just use it to avoid adding extra
14631 fields, as this is seldom used.
14633 * cs-parser.jay: Add yield_statement (yield and yield break).
14635 * driver.cs: New flag -v2 to turn on version 2 features.
14637 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
14638 hashtable when v2 is enabled.
14640 2003-04-20 Miguel de Icaza <miguel@ximian.com>
14642 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
14643 there is already a namespace defined with this name.
14645 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
14646 people upgraded their corlibs.
14648 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
14649 always use fully qualified types, no need to use the compiler
14652 (TypeManager.IsNamespace): Use binarysearch.
14654 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
14655 AddDelegate): I did not quite use the new IsValid API properly: I
14656 have to pass the short-name and the fullname. I was passing only
14657 the basename instead of the fullname sometimes.
14659 (TypeContainer.DefineType): call NamespaceClash.
14661 * interface.cs (Interface.DefineType): use NamespaceClash before
14664 * delegate.cs (Delegate.DefineType): use NamespaceClash before
14667 * enum.cs: (Enum.DefineType): use NamespaceClash before
14670 * typemanager.cs (: 3-line patch that gives us some tasty 11%
14671 speed increase. First, use the negative_hits cache when we get a
14672 negative. Second, add the type with its full original name
14673 instead of the new . and + encoded name (reflection uses + to
14674 separate type from a nested type). Use LookupTypeReflection
14675 directly which bypasses the type->name hashtable (that we already
14676 know does not contain the type.
14678 * decl.cs (DeclSpace.ResolveTypeExpr): track the
14679 location/container type.
14681 * driver.cs: When passing utf8, use directly the UTF8Encoding.
14683 2003-04-19 Miguel de Icaza <miguel@ximian.com>
14685 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
14687 * delegate.cs (NewDelegate.Resolve): Test whether an instance
14688 method is being referenced in the method group from a static
14689 context, and report error 120 if so.
14691 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
14694 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
14695 is created, we create the A namespace).
14697 * cs-parser.jay: A namespace also introduces a DeclarationFound.
14700 2003-04-18 Miguel de Icaza <miguel@ximian.com>
14702 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
14703 invocation to ModuleBuilder.GetType with the same values will
14704 return a new type instance, so we need to cache its return
14707 * expression.cs (Binary.ResolveOperator): Only allow the compare
14708 operators on enums if they are of the same type.
14710 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
14711 types of ValueType on their own case. Before we were giving them
14712 the same treatment as objects.
14714 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
14715 fullname. Short name is used to compare against container name.
14716 Fullname is used to check against defined namespace names.
14718 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
14719 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
14721 (Method.CheckBase): Call parent.
14722 (MemberBase.CheckBase): Check for protected members on sealed
14724 (PropertyBase.CheckBase): Call parent.
14725 (Field.Define): Call parent.
14727 * report.cs: Negative error codes are now mapped to 8000 - code,
14728 so that the display is render more nicely.
14730 * typemanager.cs: Do not use try/catch, instead report a regular
14733 (GetPointerType, GetReferenceType): These methods provide
14734 mechanisms to obtain the T* and T& from a T. We had the code
14735 previously scattered around the code base, and it also used
14736 TypeManager.LookupType that would go through plenty of caches.
14737 This one goes directly to the type source.
14739 In some places we did the Type.GetType followed by
14740 ModuleBuilder.GetType, but not in others, so this unifies the
14741 processing as well.
14743 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14744 statements now that we have namespace information.
14746 * typemanager.cs (IsNamespace): New method, returns whether the
14747 string presented is a namespace or not.
14749 (ComputeNamespaces): New public entry point, computes the list of
14750 available namespaces, using the GetNamespaces API call in Mono, or
14751 the slower version in MS.NET.
14753 Now before we start the semantic analysis phase, we have a
14754 complete list of namespaces including everything that the user has
14757 Deleted old code to cache namespaces in .nsc files.
14759 2003-04-17 Miguel de Icaza <miguel@ximian.com>
14761 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14762 class/struct location definition Location for the implicit
14763 constructor location.
14765 (Operator.Define): Use the location of the operator for the
14766 implicit Method definition.
14768 (Constructor.Emit): use the constructor location for the implicit
14769 base initializer constructor.
14771 * ecore.cs: Remove ITypeExpression. This interface is now gone,
14772 and the Expression class now contains two new methods:
14774 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
14775 isolate type lookup from the rest of the resolution process.
14777 Since we use Expressions to hold type definitions due to the way
14778 we parse the input we have historically overloaded Resolve to
14779 perform the Type lookups if a special flag is passed. Now this is
14780 eliminated and two methods take their place.
14782 The differences in the two methods between xStep and xTerminal is
14783 that xStep is involved in our current lookup system that uses
14784 SimpleNames to compose a name, while xTerminal is used just to
14785 catch the case where the simplename lookup failed.
14787 2003-04-16 Miguel de Icaza <miguel@ximian.com>
14789 * expression.cs (ResolveMemberAccess): Remove redundant code.
14790 TypeExpr expressions are always born fully resolved.
14792 * interface.cs (PopulateMethod): Do not lookup the types twice.
14793 We were doing it once during SemanticAnalysis and once during
14796 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
14797 in local variable type definitions, were being returned as a
14798 SimpleName (we decomposed everything into a string), that is
14799 because primary_expression was being used instead of a type in the
14800 grammar (reduce/reduce conflicts).
14802 The part that was wrong is that we converted the expression into a
14803 string (an oversimplification in one hand, compounded with primary
14804 expressions doing string concatenation).
14810 Would return "A.B.C[]" as a SimpleName. This stopped things like
14811 using clauses from working on this particular context. And a type
14812 was being matched directly against "A.B.C[]".
14814 We now use the correct approach, and allow for ComposedCast to be
14815 part of the unary expression. So the "A.B.C []" become a composed
14816 cast of "A.B.C" (as a nested group of MemberAccess with a
14817 SimpleName at the end) plus the rank composition "[]".
14821 2003-04-10 Miguel de Icaza <miguel@ximian.com>
14823 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
14824 for the access level checking.
14826 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
14827 `TypeContainer container', because I kept getting confused when I
14828 was debugging this code.
14830 * expression.cs (Indexers): Instead of tracking getters/setters,
14831 we now track them in parallel. We create one arraylist less, but
14832 most importantly it is possible now for the LValue code to find a
14833 matching get for a set.
14835 (IndexerAccess.DoResolveLValue): Update the code.
14836 GetIndexersForType has been modified already to extract all the
14837 indexers from a type. The code assumed it did not.
14839 Also make the code set the correct return type for the indexer.
14840 This was fixed a long time ago for properties, but was missing for
14841 indexers. It used to be void_type.
14843 (Binary.Emit): Test first for doubles instead of
14844 floats, as they are more common.
14846 (Binary.EmitBranchable): Use the .un version of the branch opcodes
14847 when dealing with floats and the <=, >= operators. This fixes bug
14850 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14851 to load the array value by emitting a load on the foreach variable
14852 type. This was incorrect.
14854 We now emit the code to load an element using the the array
14855 variable type, and then we emit the conversion operator.
14859 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
14861 * attribute.cs: Avoid allocation of ArrayLists in the common case.
14863 2003-04-09 Miguel de Icaza <miguel@ximian.com>
14865 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14866 test for protection before we test for signatures.
14868 (MethodSignature.ToString): implement.
14870 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14871 to the case where we reduced into a LongConstant.
14873 * decl.cs (CheckAccessLevel): If the type is an array, we can not
14874 depend on whether the information is acurrate, because the
14875 Microsoft runtime will always claim that the array type is public,
14876 regardless of the real state.
14878 If the type is a pointer, another problem happens: the type is
14879 reported as non-public in Microsoft.
14881 In both cases we have to call CheckAccessLevel recursively with
14882 the underlying type as the argument to be tested.
14884 2003-04-08 Miguel de Icaza <miguel@ximian.com>
14886 * assign.cs (Assign.Emit): If we are dealing with a compound
14887 assignment expression, we should use the code path that stores the
14888 intermediate result in a temporary value. This fixes #40903.
14890 *expression.cs (Indirection.ToString): Provide ToString method for
14893 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
14895 * class.cs: Null out fields holding references to Block objects so
14896 they can be garbage collected.
14898 * expression.cs (OverloadResolve): Remove unused local.
14900 2003-04-07 Martin Baulig <martin@ximian.com>
14902 * codegen.cs (EmitContext.CurrentFile): New public field.
14903 (EmitContext.Mark): Use the CurrentFile to check whether the
14904 location is in the correct file.
14905 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14907 2003-04-07 Martin Baulig <martin@ximian.com>
14909 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14911 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14912 location. [FIXME: The location argument which gets passed to this
14913 method is sometimes wrong!]
14915 2003-04-07 Nick Drochak <ndrochak@gol.com>
14917 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14919 2003-04-07 Miguel de Icaza <miguel@ximian.com>
14921 * expression.cs (Indirection.EmitAssign): We were using the
14922 temporary, but returning immediately instead of continuing the
14925 2003-04-06 Martin Baulig <martin@ximian.com>
14927 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14928 if it's a nested child, but also deriving from the outer class.
14931 * typemanager.cs (IsNestedChildOf): Make this work if it's a
14932 nested child, but also deriving from the outer class. See
14934 (FilterWithClosure): We may access private members of the outer
14935 class if we're a nested child and deriving from the outer class.
14936 (RealMemberLookup): Only set `closure_private_ok' if the
14937 `original_bf' contained BindingFlags.NonPublic.
14939 2003-04-05 Martin Baulig <martin@ximian.com>
14941 * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
14942 probe if its a type parameter, and if so, flag an error.
14944 * decl.cs: Move here the SetParameterInfo code from class.cs.
14945 Handle IsGeneric here.
14947 Handle a variety of errors in the parameter info definition.
14949 * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
14950 type parameters here.
14952 * cs-parser.jay (class_declaration): report errors for parameters
14955 2003-01-21 Miguel de Icaza <miguel@ximian.com>
14957 * generic.cs: New file, contains support code for generics.
14959 * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
14960 OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
14962 Update parser for the above removals.
14964 * cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
14965 now taken care of in the parser.
14967 2003-04-02 Miguel de Icaza <miguel@ximian.com>
14969 * class.cs (Event.Define): Do not allow abstract events to have
14972 2003-04-01 Miguel de Icaza <miguel@ximian.com>
14974 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14975 block in event declarations.
14977 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14978 value type, get its address.
14980 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14981 leaving a class on the stack instead of a boolean value (int
14982 0/1). Change the code so we compare against null, and then the
14983 result against zero.
14985 * class.cs (TypeContainer.GetClassBases): We were checking for the
14986 parent class being sealed too late.
14988 * expression.cs (Binary.Emit): For <= and >= when dealing with
14989 floating point values, use cgt.un and clt.un instead of cgt and
14992 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
14994 * statement.cs: Apply the same optimization as MS: skip the
14995 GetEnumerator returning an IEnumerator, and use the one returning a
14996 CharEnumerator instead. This allows us to avoid the try-finally block
14999 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
15001 * cs-parser.jay: Attributes cannot be applied to
15002 namespaces. Fixes #40473
15004 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15007 (Add*): check if the name is valid using the full name for constants,
15008 fields, properties and events.
15010 2003-03-28 Miguel de Icaza <miguel@ximian.com>
15012 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
15013 char constants to be part of the enumeration.
15015 * expression.cs (Conditional.DoResolve): Add support for operator
15016 true. Implements the missing functionality from 14.12
15018 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
15019 operator true/false as required by the spec.
15021 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
15022 implicit conversion to boolean.
15024 * statement.cs (Statement.ResolveBoolean): A boolean expression is
15025 also one where the type implements `operator true'.
15027 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
15028 get an expression that will invoke operator true based on an
15031 (GetConversionOperators): Removed the hack that called op_True
15034 (Expression.ResolveBoolean): Move this from Statement.
15036 2003-03-17 Miguel de Icaza <miguel@ximian.com>
15038 * ecore.cs (FieldExpr): do not allow initialization of initonly
15039 fields on derived classes
15041 2003-03-13 Martin Baulig <martin@ximian.com>
15043 * statement.cs (Block.Emit): Call ig.BeginScope() and
15044 ig.EndScope() when compiling with debugging info; call
15045 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
15047 2003-03-08 Miguel de Icaza <miguel@ximian.com>
15049 * expression.cs (Indexers): Do not construct immediately, allow
15050 for new members to be appended as we go. Fixes 38143
15052 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15054 * expression.cs: save/restore context when resolving an unchecked
15057 2003-03-05 Miguel de Icaza <miguel@ximian.com>
15059 * cfold.cs: Catch division by zero in modulus operator during
15062 2003-03-03 Miguel de Icaza <miguel@ximian.com>
15064 * interface.cs (Interface.DefineMembers): Avoid defining members
15067 2003-02-27 Miguel de Icaza <miguel@ximian.com>
15069 * driver.cs: handle the +/- options for -noconfig
15071 * statement.cs (Unckeched.Resolve): Also track the state of
15072 unchecked in the Resolve phase.
15074 2003-02-27 Martin Baulig <martin@ximian.com>
15076 * ecore.cs (Expression.MemberLookup): Don't create a
15077 MethodGroupExpr for something which is not a method. Fixes #38291.
15079 2003-02-25 Miguel de Icaza <miguel@ximian.com>
15081 * class.cs (MemberBase.CheckParameters): Also check that the type
15082 is unmanaged if it is a pointer.
15084 * expression.cs (SizeOf.Resolve): Add location information.
15086 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
15087 a managed type is declared.
15089 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
15090 parameter modifiers as well. Fixes bug 38606
15092 * class.cs: Very sad. Am backing out the speed up changes
15093 introduced by the ArrayList -> Array in the TypeContainer, as they
15094 were not actually that much faster, and introduced a bug (no error
15095 reports on duplicated methods).
15097 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
15098 source first, this will guarantee that we have a valid expression
15099 before calling in lower levels functions that will require a
15100 resolved object. Then use this original_source in the
15101 target.ResolveLValue instead of the original source that was
15104 Another change. Use target.Resolve instead of LValueResolve.
15105 Although we are resolving for LValues, we will let the Assign code
15106 take care of that (it will be called again from Resolve). This
15107 basically allows code like this:
15109 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
15110 class Y { void A (X x) { x [0] += o; }
15112 The problem was that the indexer was trying to resolve for
15113 set_Item (idx, object o) and never finding one. The real set_Item
15114 was set_Item (idx, X). By delaying the process we get the right
15119 2003-02-23 Martin Baulig <martin@ximian.com>
15121 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
15122 while calling DoEmit ().
15124 * codegen.cs (EmitContext.Mark): Don't mark locations in other
15125 source files; if you use the #line directive inside a method, the
15126 compiler stops emitting line numbers for the debugger until it
15127 reaches the end of the method or another #line directive which
15128 restores the original file.
15130 2003-02-23 Martin Baulig <martin@ximian.com>
15132 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
15134 2003-02-23 Martin Baulig <martin@ximian.com>
15136 * statement.cs (Block.AddChildVariableNames): We need to call this
15137 recursively, not just for our immediate children.
15139 2003-02-23 Martin Baulig <martin@ximian.com>
15141 * class.cs (Event.Define): Always make the field private, like csc does.
15143 * typemanager.cs (TypeManager.RealMemberLookup): Make events
15144 actually work, fixes bug #37521.
15146 2003-02-23 Miguel de Icaza <miguel@ximian.com>
15148 * delegate.cs: When creating the various temporary "Parameters"
15149 classes, make sure that we call the ComputeAndDefineParameterTypes
15150 on those new parameters (just like we do with the formal ones), to
15151 allow them to be resolved in the context of the DeclSpace.
15153 This fixes the bug that Dick observed in Bugzilla #38530.
15155 2003-02-22 Miguel de Icaza <miguel@ximian.com>
15157 * expression.cs (ResolveMemberAccess): When resolving a constant,
15158 do not attempt to pull a constant if the value was not able to
15159 generate a valid constant.
15161 * const.cs (LookupConstantValue): Do not report more errors than required.
15163 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15165 * expression.cs: fixes bug #38328.
15167 2003-02-18 Miguel de Icaza <miguel@ximian.com>
15169 * class.cs: Changed all the various members that can be part of a
15170 class from being an ArrayList to be an Array of the right type.
15171 During the DefineType type_list, interface_list, delegate_list and
15172 enum_list are turned into types, interfaces, delegates and enums
15175 And during the member population, indexer_list, event_list,
15176 constant_list, field_list, instance_constructor_list, method_list,
15177 operator_list and property_list are turned into their real arrays.
15179 Although we could probably perform this operation earlier, for
15180 good error reporting we need to keep the lists and remove the
15181 lists for longer than required.
15183 This optimization was triggered by Paolo profiling the compiler
15184 speed on the output of `gen-sample-program.pl' perl script.
15186 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
15187 not crash in methods like MemberLookupFailed that use this field.
15189 This problem arises when the compiler fails to resolve a type
15190 during interface type definition for example.
15192 2003-02-18 Miguel de Icaza <miguel@ximian.com>
15194 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
15195 inherit from System.Object, so we have to stop at null, not only
15196 when reaching System.Object.
15198 2003-02-17 Miguel de Icaza <miguel@ximian.com>
15200 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
15201 DeclaredOnly because the parent indexer might have had a different
15202 name, but did not loop until the top of the hierarchy was reached.
15204 The problem this one fixes is 35492: when a class implemented an
15205 indexer from an interface, we were getting the interface method
15206 (which was abstract) and we were flagging an error (can not invoke
15209 This also keeps bug 33089 functioning, and test-148 functioning.
15211 * typemanager.cs (IsSpecialMethod): The correct way of figuring
15212 out if a method is special is to see if it is declared in a
15213 property or event, or whether it is one of the predefined operator
15214 names. This should fix correctly #36804.
15216 2003-02-15 Miguel de Icaza <miguel@ximian.com>
15218 The goal here is to remove the dependency on EmptyCast.Peel ().
15219 Killing it completely.
15221 The problem is that currently in a number of places where
15222 constants are expected, we have to "probe" for an EmptyCast, and
15223 Peel, which is not the correct thing to do, as this will be
15224 repetitive and will likely lead to errors.
15226 The idea is to remove any EmptyCasts that are used in casts that
15227 can be reduced to constants, so we only have to cope with
15230 This bug hunt was triggered by Bug 37363 and the desire to remove
15231 the duplicate pattern where we were "peeling" emptycasts to check
15232 whether they were constants. Now constants will always be
15235 * ecore.cs: Use an enumconstant here instead of wrapping with
15238 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
15239 throwing me off. By handling this we can get rid of a few hacks.
15241 * statement.cs (Switch): Removed Peel() code.
15243 2003-02-14 Miguel de Icaza <miguel@ximian.com>
15245 * class.cs: Location information for error 508
15247 * expression.cs (New.DoResolve): Add a guard against double
15248 resolution of an expression.
15250 The New DoResolve might be called twice when initializing field
15251 expressions (see EmitFieldInitializers, the call to
15252 GetInitializerExpression will perform a resolve on the expression,
15253 and later the assign will trigger another resolution
15255 This leads to bugs (#37014)
15257 * delegate.cs: The signature for EndInvoke should contain any ref
15258 or out parameters as well. We were not doing this in the past.
15260 * class.cs (Field.Define): Do not overwrite the type definition
15261 inside the `volatile' group. Turns out that volatile enumerations
15262 were changing the type here to perform a validity test, which
15265 2003-02-12 Miguel de Icaza <miguel@ximian.com>
15267 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
15268 and structs, we do not want to load the instance variable
15270 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
15271 enum_type has to be handled like an object reference (implicit
15272 conversions exists from this to object), but the regular IsClass
15273 and IsValueType tests will never return true for this one.
15275 Also we use TypeManager.IsValueType instead of type.IsValueType,
15276 just for consistency with the rest of the code (this is only
15277 needed if we ever use the construct exposed by test-180.cs inside
15278 corlib, which we dont today).
15280 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
15282 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
15285 2003-02-09 Martin Baulig <martin@ximian.com>
15287 * namespace.cs (Namespace..ctor): Added SourceFile argument.
15288 (Namespace.DefineNamespaces): New static public method; this is
15289 called when we're compiling with debugging to add all namespaces
15290 to the symbol file.
15292 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
15293 pass it to the Namespace's .ctor.
15295 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
15296 and MethodBase arguments; pass the namespace ID to the symwriter;
15297 pass the MethodBase instead of the token to the symwriter.
15298 (SymbolWriter.DefineNamespace): New method to add a namespace to
15301 2003-02-09 Martin Baulig <martin@ximian.com>
15303 * symbolwriter.cs: New file. This is a wrapper around
15304 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
15305 methods here in near future.
15307 2003-02-09 Martin Baulig <martin@ximian.com>
15309 * codegen.cs (EmitContext.Mark): Just pass the arguments to
15310 ILGenerator.MarkSequencePoint() which are actually used by the
15313 2003-02-09 Martin Baulig <martin@ximian.com>
15315 * location.cs (SourceFile): New public sealed class. This
15316 contains the name and an index which is used in the location's token.
15317 (Location): Reserve an appropriate number of bits in the token for
15318 the source file instead of walking over that list, this gives us a
15319 really huge performance improvement when compiling with debugging.
15321 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
15322 `SourceFile' argument instead of a string.
15323 (Driver.ProcessFile): Add all the files via Location.AddFile(),
15324 but don't parse/tokenize here, we need to generate the list of all
15325 source files before we do that.
15326 (Driver.ProcessFiles): New static function. Parses/tokenizes all
15329 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
15330 instead of a string.
15332 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
15335 2003-02-09 Martin Baulig <martin@ximian.com>
15337 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
15338 filename on `#line default'.
15340 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
15342 * statement.cs: don't clear the pinned var when the fixed statement
15343 returns from the method (fixes bug#37752).
15345 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
15347 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
15350 2003-02-07 Martin Baulig <martin@ximian.com>
15352 * driver.cs: Removed the `--debug-args' command line argument.
15354 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
15355 automatically by the AsssemblyBuilder.
15356 (CodeGen.InitializeSymbolWriter): We don't need to call any
15357 initialization function on the symbol writer anymore. This method
15358 doesn't take any arguments.
15360 2003-02-03 Miguel de Icaza <miguel@ximian.com>
15362 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
15363 from referenced assemblies as well.
15365 2003-02-02 Martin Baulig <martin@ximian.com>
15367 * class.cs (MethodData.Emit): Generate debugging info for external methods.
15369 2003-02-02 Martin Baulig <martin@ximian.com>
15371 * class.cs (Constructor.Emit): Open the symbol writer before
15372 emitting the constructor initializer.
15373 (ConstructorInitializer.Emit): Call ec.Mark() to allow
15374 single-stepping through constructor initializers.
15376 2003-01-30 Miguel de Icaza <miguel@ximian.com>
15378 * class.cs: Handle error 549: do not allow virtual methods in
15381 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
15383 * decl.cs: Check access levels when resolving types
15385 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
15387 * statement.cs: Add parameters and locals set in catch blocks that might
15388 return to set vector
15390 2003-01-29 Miguel de Icaza <miguel@ximian.com>
15392 * class.cs (Operator): Set the SpecialName flags for operators.
15394 * expression.cs (Invocation.DoResolve): Only block calls to
15395 accessors and operators on SpecialName methods.
15397 (Cast.TryReduce): Handle conversions from char constants.
15400 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
15402 * statement.cs: small memory and time optimization in FlowBranching.
15404 2003-01-28 Pedro Mart <yoros@wanadoo.es>
15406 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
15407 problem that the last fix but in the other sid (Set).
15409 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
15410 access when there is no indexer in the hierarchy.
15412 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
15414 * class.cs: Combine some if statements.
15416 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15418 * driver.cs: fixed bug #37187.
15420 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
15422 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
15423 any indexer, it's needed to build a list with all the indexers in the
15424 hierarchy (AllGetters), else we have problems. Fixes #35653.
15426 2003-01-23 Miguel de Icaza <miguel@ximian.com>
15428 * class.cs (MethodData.Define): It is wrong for an interface
15429 implementation to be static in both cases: explicit and implicit.
15430 We were only handling this in one case.
15432 Improve the if situation there to not have negations.
15434 * class.cs (Field.Define): Turns out that we do not need to check
15435 the unsafe bit on field definition, only on usage. Remove the test.
15437 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15439 * driver.cs: use assembly.Location instead of Codebase (the latest
15440 patch made mcs fail when using MS assemblies).
15442 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
15444 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
15445 get the path to *corlib.dll.
15447 2003-01-21 Nick Drochak <ndrochak@gol.com>
15451 * typemanager.cs: Remove compiler warnings
15453 2003-01-20 Duncan Mak <duncan@ximian.com>
15455 * AssemblyInfo.cs: Bump the version number to 0.19.
15457 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15459 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
15461 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
15463 * class.cs (Constructor::Emit): Emit debugging info for constructors.
15465 2003-01-17 Miguel de Icaza <miguel@ximian.com>
15467 * cs-parser.jay: Small fix: we were not comparing the constructor
15468 name correctly. Thanks to Zoltan for the initial pointer.
15470 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
15472 * cs-tokenizer.cs: Set file name when specified with #line
15474 2003-01-15 Miguel de Icaza <miguel@ximian.com>
15476 * cs-parser.jay: Only perform the constructor checks here if we
15477 are named like the class; This will help provider a better
15478 error. The constructor path is taken when a type definition is
15479 not found, but most likely the user forgot to add the type, so
15480 report that rather than the constructor error.
15482 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
15484 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
15487 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15489 * cs-parser.jay: Add cleanup call.
15491 2003-01-13 Duncan Mak <duncan@ximian.com>
15493 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
15494 consistent with other methods.
15496 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15498 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
15500 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
15502 * attribute.cs: only set GuidAttr to true when we have a
15505 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15509 * typemanager.cs: fixes to allow mcs compile corlib with the new
15510 Type.IsSubclassOf fix.
15512 2003-01-08 Miguel de Icaza <miguel@ximian.com>
15514 * expression.cs (LocalVariableReference.DoResolve): Classify a
15515 constant as a value, not as a variable. Also, set the type for
15518 * cs-parser.jay (fixed_statement): take a type instead of a
15519 pointer_type, so we can produce a better error message later.
15521 * statement.cs (Fixed.Resolve): Flag types that are not pointers
15524 (For.DoEmit): Make inifinite loops have a
15525 non-conditional branch back.
15527 (Fixed.DoEmit): First populate the pinned variables, then emit the
15528 statement, then clear the variables. Before I was emitting the
15529 code once for each fixed piece.
15532 2003-01-08 Martin Baulig <martin@ximian.com>
15534 * statement.cs (FlowBranching.MergeChild): A break in a
15535 SWITCH_SECTION does not leave a loop. Fixes #36155.
15537 2003-01-08 Martin Baulig <martin@ximian.com>
15539 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
15540 lives in the same number space than `param_map'. Fixes #36154.
15542 2003-01-07 Miguel de Icaza <miguel@ximian.com>
15544 * cs-parser.jay (constructor_declaration): Set the
15545 Constructor.ModFlags before probing for it. This makes the
15546 compiler report 514, 515 and 132 (the code was there, but got
15549 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
15550 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
15551 (GotoCase.Resolve): Set `Returns' to ALWAYS.
15553 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
15555 * enum.cs: create the enum static fields using the enum type.
15557 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
15559 * class.cs: don't try to create the ParamBuilder for the return
15560 type if it's not needed (and handle it breaking for the ms runtime
15563 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
15565 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
15567 2002-12-29 Miguel de Icaza <miguel@ximian.com>
15569 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
15570 the command. This showed up while compiling the JANET source
15571 code, which used \r as its only newline separator.
15573 2002-12-28 Miguel de Icaza <miguel@ximian.com>
15575 * class.cs (Method.Define): If we are an operator (because it
15576 reuses our code), then set the SpecialName and HideBySig. #36128
15578 2002-12-22 Miguel de Icaza <miguel@ximian.com>
15580 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
15581 exception, report error 120 `object reference required'.
15583 * driver.cs: Add --pause option, used during to measure the size
15584 of the process as it goes with --timestamp.
15586 * expression.cs (Invocation.DoResolve): Do not allow methods with
15587 SpecialName to be invoked.
15589 2002-12-21 Miguel de Icaza <miguel@ximian.com>
15591 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
15592 number before adding it.
15594 2002-12-21 Ravi Pratap <ravi@ximian.com>
15596 * ecore.cs (StandardImplicitConversion): When in an unsafe
15597 context, we allow conversion between void * to any other pointer
15598 type. This fixes bug #35973.
15600 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
15602 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
15603 is not thrown when extensionless outputs are used
15605 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15607 * rootcontext.cs: fixed compilation of corlib.
15609 2002-12-19 Miguel de Icaza <miguel@ximian.com>
15611 * attribute.cs (Attributes.Contains): Add new method.
15613 * class.cs (MethodCore.LabelParameters): if the parameter is an
15614 `out' parameter, check that no attribute `[In]' has been passed.
15616 * enum.cs: Handle the `value__' name in an enumeration.
15618 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
15620 * decl.cs: Added special case to allow overrides on "protected
15623 2002-12-18 Ravi Pratap <ravi@ximian.com>
15625 * attribute.cs (Attributes.AddAttributeSection): Rename to this
15626 since it makes much more sense.
15628 (Attributes.ctor): Don't require a Location parameter.
15630 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
15632 * attribute.cs (ApplyAttributes): Remove extra Location parameters
15633 since we already have that information per attribute.
15635 * everywhere : make appropriate changes.
15637 * class.cs (LabelParameters): Write the code which actually
15638 applies attributes to the return type. We can't do this on the MS
15639 .NET runtime so we flag a warning in the case an exception is
15642 2002-12-18 Miguel de Icaza <miguel@ximian.com>
15644 * const.cs: Handle implicit null conversions here too.
15646 2002-12-17 Ravi Pratap <ravi@ximian.com>
15648 * class.cs (MethodCore.LabelParameters): Remove the extra
15649 Type [] parameter since it is completely unnecessary. Instead
15650 pass in the method's attributes so that we can extract
15651 the "return" attribute.
15653 2002-12-17 Miguel de Icaza <miguel@ximian.com>
15655 * cs-parser.jay (parse): Use Report.Error to flag errors instead
15656 of ignoring it and letting the compile continue.
15658 * typemanager.cs (ChangeType): use an extra argument to return an
15659 error condition instead of throwing an exception.
15661 2002-12-15 Miguel de Icaza <miguel@ximian.com>
15663 * expression.cs (Unary.TryReduce): mimic the code for the regular
15664 code path. Perform an implicit cast in the cases where we can
15665 implicitly convert to one of the integral types, and then reduce
15666 based on that constant. This fixes bug #35483.
15668 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15670 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
15672 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15674 * namespace.cs: fixed bug #35489.
15676 2002-12-12 Miguel de Icaza <miguel@ximian.com>
15678 * class.cs: Remove some dead code.
15680 * cs-parser.jay: Estimate the number of methods needed
15681 (RootContext.MethodCount);
15683 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
15684 numbers instead of StringBuilders.
15686 * support.cs (PtrHashtable): Add constructor with initial size;
15687 We can now reduce reallocations of the method table.
15689 2002-12-10 Ravi Pratap <ravi@ximian.com>
15691 * attribute.cs (ApplyAttributes): Keep track of the emitted
15692 attributes on a per-target basis. This fixes bug #35413.
15694 2002-12-10 Miguel de Icaza <miguel@ximian.com>
15696 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
15697 default to the Windows 1252 encoding.
15699 (UnixParseOption): Support version, thanks to Alp for the missing
15702 * AssemblyInfo.cs: Add nice assembly information.
15704 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
15707 * cs-parser.jay: Allow a trailing comma before the close bracked
15708 in the attribute_section production.
15710 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
15711 address of the instance was being taken, I will take this out,
15712 because we take the address of the object immediately here.
15714 2002-12-09 Ravi Pratap <ravi@ximian.com>
15716 * typemanager.cs (AreMultipleAllowed): Take care of the most
15717 obvious case where attribute type is not in the current assembly -
15720 2002-12-08 Miguel de Icaza <miguel@ximian.com>
15722 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
15723 definitions, instead of doing that afterwards.
15725 Also we use a nice little hack, depending on the constructor, we
15726 know if we are a "composed" name or a simple name. Hence, we
15727 avoid the IndexOf test, and we avoid
15729 * codegen.cs: Add code to assist in a bug reporter to track down
15730 the source of a compiler crash.
15732 2002-12-07 Ravi Pratap <ravi@ximian.com>
15734 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
15735 types have been emitted for a given element and flag an error
15736 if something which does not have AllowMultiple set is used more
15739 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15740 attribute types and their corresponding AllowMultiple properties
15742 (AreMultipleAllowed): Check the property for a given type.
15744 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15745 property in the case we have a TypeContainer.
15747 (Attributes.AddAttribute): Detect duplicates and just skip on
15748 adding them. This trivial fix catches a pretty gross error in our
15749 attribute emission - global attributes were being emitted twice!
15751 Bugzilla bug #33187 is now fixed.
15753 2002-12-06 Miguel de Icaza <miguel@ximian.com>
15755 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15756 instead of pp_and).
15758 * expression.cs (Binary.ResolveOperator): I can only use the
15759 Concat (string, string, string) and Concat (string, string,
15760 string, string) if the child is actually a concatenation of
15763 2002-12-04 Miguel de Icaza <miguel@ximian.com>
15765 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15766 context where we need a 2-character lookahead.
15768 * pending.cs (PendingImplementation): Rework so we can keep track
15769 of interface types all the time, and flag those which were
15770 implemented by parents as optional.
15772 2002-12-03 Miguel de Icaza <miguel@ximian.com>
15774 * expression.cs (Binary.ResolveOperator): Use
15775 String.Concat(string,string,string) or
15776 String.Concat(string,string,string,string) when possible.
15778 * typemanager: More helper methods.
15781 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15783 * pending.cs: remove the bogus return from GetMissingInterfaces()
15784 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15786 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15788 * namespace.cs: avoid duplicated 'using xxx' being added to
15789 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15790 when we get more than one 'using' statement for the same namespace.
15791 Report a CS0105 warning for it.
15793 2002-11-30 Miguel de Icaza <miguel@ximian.com>
15795 * cs-tokenizer.cs (consume_identifier): use read directly, instead
15796 of calling getChar/putback, uses internal knowledge of it.
15798 (xtoken): Reorder tokenizer so most common patterns are checked
15799 first. This reduces the compilation time in another 5% (from 8.11s
15800 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15802 The parsing time is 22% of the compilation in mcs, and from that
15803 64% is spent on the tokenization process.
15805 I tried using a binary search for keywords, but this is slower
15806 than the hashtable. Another option would be to do a couple of
15809 * Not use a StringBuilder, instead use an array of chars,
15810 with a set value. Notice that this way we could catch
15811 the 645 error without having to do it *afterwards*.
15813 * We could write a hand-parser to avoid the hashtable
15814 compares altogether.
15816 The identifier consumption process takes 37% of the tokenization
15817 time. Another 15% is spent on is_number. 56% of the time spent
15818 on is_number is spent on Int64.Parse:
15820 * We could probably choose based on the string length to
15821 use Int32.Parse or Int64.Parse and avoid all the 64-bit
15824 Another 3% is spend on wrapping `xtoken' in the `token' function.
15826 Handle 0xa0 as whitespace (#34752)
15828 2002-11-26 Miguel de Icaza <miguel@ximian.com>
15830 * typemanager.cs (IsCLRType): New routine to tell whether a type
15831 is one of the builtin types.
15833 Maybe it needs to use TypeCodes to be faster. Maybe we could use
15834 typecode in more places instead of doing pointer comparissions.
15835 We could leverage some knowledge about the way the typecodes are
15838 New code to cache namespaces in assemblies, it is currently not
15839 invoked, to be used soon.
15841 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
15843 * expression.cs (Binary.ResolveOperator): specially handle
15844 strings, and do not perform user-defined operator overloading for
15847 2002-11-24 Miguel de Icaza <miguel@ximian.com>
15849 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15850 internalcall as it is a pretty simple operation; Avoid whenever
15851 possible to call Char.IsLetter.
15853 (consume_identifier): Cut by half the number of
15854 hashtable calls by merging the is_keyword and GetKeyword behavior.
15856 Do not short-circuit, because if we do, we
15857 report errors (ie, #if false && true would produce an invalid
15861 2002-11-24 Martin Baulig <martin@ximian.com>
15863 * expression.cs (Cast.TryReduce): If we're in checked syntax,
15864 check constant ranges and report a CS0221. Fixes #33186.
15866 2002-11-24 Martin Baulig <martin@ximian.com>
15868 * cs-parser.jay: Make this work for uninitialized variable
15869 declarations in the `for' initializer. Fixes #32416.
15871 2002-11-24 Martin Baulig <martin@ximian.com>
15873 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15874 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
15876 2002-11-24 Martin Baulig <martin@ximian.com>
15878 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15879 argument; if true, we also check for user-defined conversions.
15880 This is only needed if both arguments are of a user-defined type.
15881 Fixes #30443, added test-175.cs.
15882 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15884 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15886 2002-11-24 Martin Baulig <martin@ximian.com>
15888 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15889 function to get the store opcode.
15890 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15891 only emit the Ldelema if the store opcode is Stobj. You must run
15892 both test-34 and test-167 to test this. Fixes #34529.
15894 2002-11-23 Martin Baulig <martin@ximian.com>
15896 * ecore.cs (Expression.MemberLookup): Added additional
15897 `qualifier_type' argument which is used when we're being called
15898 from MemberAccess.DoResolve() and null if we're called from a
15900 (Expression.MemberLookupFailed): New method to report errors; this
15901 does the CS1540 check and reports the correct error message.
15903 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15904 argument for the CS1540 check and redone the way how we're dealing
15905 with private members. See the comment in the source code for details.
15906 (FilterWithClosure): Reverted this back to revision 1.197; renamed
15907 `closure_start_type' to `closure_qualifier_type' and check whether
15908 it's not null. It was not this filter being broken, it was just
15909 being called with the wrong arguments.
15911 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15912 and pass it the correct `qualifier_type'; this also does the error
15915 2002-11-22 Miguel de Icaza <miguel@ximian.com>
15917 * expression.cs (Invocation.EmitParams): If the we are dealing
15918 with a non-built-in value type, load its address as well.
15920 (ArrayCreation): Use a a pretty constant instead
15921 of the hardcoded value 2. Use 6 instead of 2 for the number of
15922 static initializers.
15924 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15925 because they are not really value types, just glorified integers.
15927 * driver.cs: Do not append .exe, the CSC compiler does not do it.
15929 * ecore.cs: Remove redundant code for enumerations, make them use
15930 the same code path as everything else, fixes the casting issue
15931 with enumerations in Windows.Forms.
15933 * attribute.cs: Do only cast to string if it is a string, the
15934 validation happens later.
15936 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15937 people upgrade their corlibs.
15939 * ecore.cs: Oops, enumerations were not following the entire code path
15941 2002-11-21 Miguel de Icaza <miguel@ximian.com>
15943 * typemanager.cs (FilterWithClosure): Commented out the test for
15944 1540 in typemanager.cs, as it has problems when accessing
15945 protected methods from a parent class (see test-174.cs).
15947 * attribute.cs (Attribute.ValidateGuid): new method.
15948 (Attribute.Resolve): Use above.
15950 2002-11-19 Miguel de Icaza <miguel@ximian.com>
15952 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15954 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15955 handling for enumerations, as we only needed the TypeContainer
15956 functionality to begin with (this is required for the fix below to
15957 work for enums that reference constants in a container class for
15960 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15962 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15963 a valid TypeBuilder to perform lookups on.o
15965 * class.cs (InheritableMemberSignatureCompare): Use true in the
15966 call to GetGetMethod and GetSetMethod, because we are comparing
15967 the signature, and we need to get the methods *even* if they are
15970 (PropertyBase.CheckBase): ditto.
15972 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15973 GotoCase.Resolve): Use Peel on EmpytCasts.
15975 * ecore.cs (EmptyCast): drop child, add Peel method.
15977 2002-11-17 Martin Baulig <martin@ximian.com>
15979 * ecore.cs (EmptyCast.Child): New public property.
15981 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15982 label resolved to an EmptyCast. Fixes #34162.
15983 (GotoCase.Resolve): Likewise.
15984 (Block.EmitMeta): Likewise.
15986 2002-11-17 Martin Baulig <martin@ximian.com>
15988 * expression.cs (Invocation.BetterConversion): Prefer int over
15989 uint; short over ushort; long over ulong for integer literals.
15990 Use ImplicitConversionExists instead of StandardConversionExists
15991 since we also need to check for user-defined implicit conversions.
15992 Fixes #34165. Added test-173.cs.
15994 2002-11-16 Martin Baulig <martin@ximian.com>
15996 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15997 with the `true' and `false' literals. Fixes #33151.
15999 2002-11-16 Martin Baulig <martin@ximian.com>
16001 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
16002 October 22nd; don't do the cs1540 check for static members.
16004 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
16005 now using our own filter here and doing the cs1540 check again.
16007 2002-11-16 Martin Baulig <martin@ximian.com>
16009 * support.cs (InternalParameters): Don't crash if we don't have
16010 any fixed parameters. Fixes #33532.
16012 2002-11-16 Martin Baulig <martin@ximian.com>
16014 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
16015 when looking up static methods to make this work on Windows.
16018 2002-11-16 Martin Baulig <martin@ximian.com>
16020 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
16021 a setter rather than using PropertyInfo.CanWrite.
16023 2002-11-15 Nick Drochak <ndrochak@gol.com>
16025 * class.cs: Allow acces to block member by subclasses. Fixes build
16028 2002-11-14 Martin Baulig <martin@ximian.com>
16030 * class.cs (Constructor.Emit): Added the extern/block check.
16033 2002-11-14 Martin Baulig <martin@ximian.com>
16035 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
16036 iteration while looking for indexers, this is needed because the
16037 indexer may have a different name in our base classes. Fixed the
16038 error reporting (no indexers at all, not get accessor, no
16039 overloaded match). Fixes bug #33089.
16040 (IndexerAccess.DoResolveLValue): Likewise.
16042 2002-11-14 Martin Baulig <martin@ximian.com>
16044 * class.cs (PropertyBase.CheckBase): Make this work for multiple
16045 indexers. Fixes the first part of bug #33089.
16046 (MethodSignature.InheritableMemberSignatureCompare): Added support
16049 2002-11-13 Ravi Pratap <ravi@ximian.com>
16051 * attribute.cs (Attribute.Resolve): Catch the
16052 NullReferenceException and report it since it isn't supposed to
16055 2002-11-12 Miguel de Icaza <miguel@ximian.com>
16057 * expression.cs (Binary.EmitBranchable): Also handle the cases for
16058 LogicalOr and LogicalAnd that can benefit from recursively
16059 handling EmitBranchable. The code now should be nice for Paolo.
16061 2002-11-08 Miguel de Icaza <miguel@ximian.com>
16063 * typemanager.cs (LookupType): Added a negative-hit hashtable for
16064 the Type lookups, as we perform quite a number of lookups on
16065 non-Types. This can be removed once we can deterministically tell
16066 whether we have a type or a namespace in advance.
16068 But this might require special hacks from our corlib.
16072 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
16073 and double which avoids a conversion from an integer to a double.
16075 * expression.cs: tiny optimization, avoid calling IsConstant,
16076 because it effectively performs the lookup twice.
16078 2002-11-06 Miguel de Icaza <miguel@ximian.com>
16080 But a bogus return here to keep the semantics of the old code
16081 until the Mono runtime is fixed.
16083 * pending.cs (GetMissingInterfaces): New method used to remove all
16084 the interfaces that are already implemented by our parent
16085 classes from the list of pending methods.
16087 * interface.cs: Add checks for calls after ResolveTypeExpr.
16089 2002-11-05 Miguel de Icaza <miguel@ximian.com>
16091 * class.cs (Class.Emit): Report warning 67: event not used if the
16092 warning level is beyond 3.
16094 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
16095 being a NullLiteral.
16097 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
16100 * class.cs (TypeContainer.GetClassBases): Cover a missing code
16101 path that might fail if a type can not be resolved.
16103 * expression.cs (Binary.Emit): Emit unsigned versions of the
16106 * driver.cs: use error 5.
16108 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
16110 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
16112 2002-11-01 Miguel de Icaza <miguel@ximian.com>
16114 * cs-parser.jay (switch_section): A beautiful patch from Martin
16115 Baulig that fixed 33094.
16117 2002-10-31 Miguel de Icaza <miguel@ximian.com>
16119 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
16120 Check whether the base is abstract and report an error if so.
16122 * expression.cs (IndexerAccess.DoResolveLValue,
16123 IndexerAccess.DoResolve): ditto.
16125 (Invocation.DoResolve): ditto.
16127 (Invocation.FullMethodDesc): Improve the report string.
16129 * statement.cs (Block): Eliminate IsVariableDefined as it is
16130 basically just a wrapper for GetVariableInfo.
16132 * ecore.cs (SimpleName): Use new
16134 * support.cs (ReflectionParamter.ParameterType): We unwrap the
16135 type, as we return the actual parameter ref/unref state on a
16138 2002-10-30 Miguel de Icaza <miguel@ximian.com>
16140 * support.cs: Return proper flags REF/OUT fixing the previous
16143 * expression.cs: Reverted last patch, that was wrong. Is_ref is
16144 not used to mean `ref' but `ref or out' in ParameterReference
16146 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
16147 full type signature instead of calling TypeManger.CSharpName
16150 * support.cs (InternalParameters.ParameterDesc): Do not compare
16151 directly to the modflags, because REF/OUT will actually be bitsets
16154 * delegate.cs (VerifyMethod): Check also the modifiers.
16156 * cs-tokenizer.cs: Fix bug where floating point values with an
16157 exponent where a sign was missing was ignored.
16159 * driver.cs: Allow multiple assemblies to be specified in a single
16162 2002-10-28 Miguel de Icaza <miguel@ximian.com>
16164 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
16165 because identifiers after a parenthesis would end up in this kind
16166 of production, and we needed to desamiguate it for having casts
16169 (UserDefinedType *) xxx
16171 2002-10-24 Miguel de Icaza <miguel@ximian.com>
16173 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
16174 we should set on the Bindingflags.NonPublic, but not turn on
16175 private_ok. private_ok controls whether a Private member is
16176 returned (this is chekced on the filter routine), while the
16177 BindingFlags.NonPublic just controls whether private/protected
16178 will be allowed. This fixes the problem part of the problem of
16179 private properties being allowed to be used in derived classes.
16181 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
16182 so we can call the children DoResolveLValue method (this will
16183 properly signal errors on lvalue assignments to base properties)
16185 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
16186 getter are null, and we have a property info, we know that this
16187 happened because the lookup failed, so we report an error 122 for
16188 protection level violation.
16190 We also silently return if setter and getter are null in the
16191 resolve functions, this condition only happens if we have flagged
16192 the error before. This is the other half of the problem.
16194 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
16195 not have accessibility information, that is why we were returning
16196 true in the filter function in typemanager.cs.
16198 To properly report 122 (property is inaccessible because of its
16199 protection level) correctly, we report this error in ResolveAccess
16200 by failing if both the setter and the getter are lacking (ie, the
16203 DoResolve and DoLResolve have been modified to check for both
16204 setter/getter being null and returning silently, the reason being
16205 that I did not want to put the knowledge about this error in upper
16208 int old = Report.Errors;
16209 x = new PropertyExpr (...);
16210 if (old != Report.Errors)
16215 So the property expr is returned, but it is invalid, so the error
16216 will be flagged during the resolve process.
16218 * class.cs: Remove InheritablePropertySignatureCompare from the
16219 class, as we no longer depend on the property signature to compute
16220 whether it is possible to implement a method or not.
16222 The reason is that calling PropertyInfo.GetGetMethod will return
16223 null (in .NET, in Mono it works, and we should change this), in
16224 cases where the Get Method does not exist in that particular
16229 class X { public virtual int A { get { return 1; } } }
16231 class Z : Y { public override int A { get { return 2; } } }
16233 Would fail in Z because the parent (Y) would not have the property
16234 defined. So we avoid this completely now (because the alternative
16235 fix was ugly and slow), and we now depend exclusively on the
16238 (PropertyBase.CheckBase): Use a method-base mechanism to find our
16239 reference method, instead of using the property.
16241 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
16242 routines are gone now.
16244 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
16245 names, they were incorrectly named.
16247 * cs-tokenizer.cs: Return are more gentle token on failure.
16249 * pending.cs (PendingImplementation.InterfaceMethod): This routine
16250 had an out-of-sync index variable, which caused it to remove from
16251 the list of pending methods the wrong method sometimes.
16253 2002-10-22 Miguel de Icaza <miguel@ximian.com>
16255 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
16256 CanWrite, because those refer to this particular instance of the
16257 property, and do not take into account the fact that we can
16258 override single members of a property.
16260 Constructor requires an EmitContext. The resolution process does
16261 not happen here, but we need to compute the accessors before,
16262 because the resolution does not always happen for properties.
16264 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
16265 subclass, before we did not update this flag, but we did update
16268 (GetAccessors): Drop this routine, as it did not work in the
16269 presence of partially overwritten set/get methods.
16271 Notice that this broke the cs1540 detection, but that will require
16274 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16278 * driver.cs: issue a warning instead of an error if we don't support
16279 debugging for the platform. Also ignore a couple of errors that may
16280 arise when trying to write the symbols. Undo my previous patch.
16282 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16284 * driver.cs: ignore /debug switch except for Unix platforms.
16286 2002-10-23 Nick Drochak <ndrochak@gol.com>
16288 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
16290 2002-10-21 Miguel de Icaza <miguel@ximian.com>
16292 * driver.cs: Do not make mcs-debug conditional, so we do not break
16293 builds that use it.
16295 * statement.cs (UsageVector.MergeChildren): I would like Martin to
16296 review this patch. But basically after all the children variables
16297 have been merged, the value of "Breaks" was not being set to
16298 new_breaks for Switch blocks. I think that it should be set after
16299 it has executed. Currently I set this to the value of new_breaks,
16300 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
16301 conservative, but I do not understand this code very well.
16303 I did not break anything in the build, so that is good ;-)
16305 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
16307 2002-10-20 Mark Crichton <crichton@gimp.org>
16309 * cfold.cs: Fixed compile blocker. Really fixed it this time.
16311 2002-10-20 Nick Drochak <ndrochak@gol.com>
16313 * cfold.cs: Fixed compile blocker.
16315 2002-10-20 Miguel de Icaza <miguel@ximian.com>
16317 * driver.cs: I was chekcing the key, not the file.
16319 2002-10-19 Ravi Pratap <ravi@ximian.com>
16321 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
16322 message that we were generating - we just need to silently return
16325 2002-10-19 Miguel de Icaza <miguel@ximian.com>
16327 * class.cs (Event.Define): Change my previous commit, as this
16328 breaks the debugger. This is a temporary hack, as it seems like
16329 the compiler is generating events incorrectly to begin with.
16331 * expression.cs (Binary.ResolveOperator): Added support for
16332 "U operator - (E x, E y)"
16334 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
16337 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
16338 init-only variables, but this path did not take into account that
16339 there might be also instance readonly variables. Correct this
16342 This fixes bug 32253
16344 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
16347 * driver.cs: Change the extension for modules to `netmodule'
16349 * cs-parser.jay: Improved slightly the location tracking for
16350 the debugger symbols.
16352 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
16353 modifiers that were specified instead of the hardcoded value
16354 (FamAndAssem). This was basically ignoring the static modifier,
16355 and others. Fixes 32429.
16357 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
16358 fixed a bug in the process (32476)
16360 * expression.cs (ArrayAccess.EmitAssign): Patch from
16361 hwang_rob@yahoo.ca that fixes bug 31834.3
16363 2002-10-18 Miguel de Icaza <miguel@ximian.com>
16365 * driver.cs: Make the module extension .netmodule.
16367 2002-10-16 Miguel de Icaza <miguel@ximian.com>
16369 * driver.cs: Report an error if the resource file is not found
16370 instead of crashing.
16372 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
16373 false, like Emit does.
16375 2002-10-16 Nick Drochak <ndrochak@gol.com>
16377 * typemanager.cs: Remove unused private member. Also reported mcs
16378 bug to report this as a warning like csc.
16380 2002-10-15 Martin Baulig <martin@gnome.org>
16382 * statement.cs (Statement.Emit): Made this a virtual method; emits
16383 the line number info and calls DoEmit().
16384 (Statement.DoEmit): New protected abstract method, formerly knows
16385 as Statement.Emit().
16387 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
16389 2002-10-11 Miguel de Icaza <miguel@ximian.com>
16391 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
16392 have fixed a remaining problem: not every AddXXXX was adding a
16393 fully qualified name.
16395 Now everyone registers a fully qualified name in the DeclSpace as
16396 being defined instead of the partial name.
16398 Downsides: we are slower than we need to be due to the excess
16399 copies and the names being registered this way.
16401 The reason for this is that we currently depend (on the corlib
16402 bootstrap for instance) that types are fully qualified, because
16403 we dump all the types in the namespace, and we should really have
16404 types inserted into the proper namespace, so we can only store the
16405 basenames in the defined_names array.
16407 2002-10-10 Martin Baulig <martin@gnome.org>
16409 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
16410 from bug #31834, see the bug report for a testcase which is
16413 2002-10-10 Martin Baulig <martin@gnome.org>
16415 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
16416 flow analysis code for this.
16418 * statement.cs (Do, While, For): Tell the flow analysis code about
16420 (FlowBranching.UsageVector): Added support for infinite loops.
16421 (Block.Resolve): Moved the dead code elimination here and use flow
16424 2002-10-09 Miguel de Icaza <miguel@ximian.com>
16426 * class.cs (Field.Define): Catch cycles on struct type
16429 * typemanager.cs (IsUnmanagedtype): Do not recursively check
16430 fields if the fields are static. We only need to check instance
16433 * expression.cs (As.DoResolve): Test for reference type.
16435 * statement.cs (Using.ResolveExpression): Use
16436 ConvertImplicitRequired, not ConvertImplicit which reports an
16438 (Using.ResolveLocalVariableDecls): ditto.
16440 * expression.cs (Binary.ResolveOperator): Report errors in a few
16441 places where we had to.
16443 * typemanager.cs (IsUnmanagedtype): Finish implementation.
16445 2002-10-08 Miguel de Icaza <miguel@ximian.com>
16447 * expression.cs: Use StoreFromPtr instead of extracting the type
16448 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
16450 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
16451 an enumeration value to a System.Enum, but System.Enum is not a
16452 value type, but an class type, so we need to box.
16454 (Expression.ConvertExplicit): One codepath could return
16455 errors but not flag them. Fix this. Fixes #31853
16457 * parameter.cs (Resolve): Do not allow void as a parameter type.
16459 2002-10-06 Martin Baulig <martin@gnome.org>
16461 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
16462 if it's a class type and not a struct. Fixes #31815.
16464 2002-10-06 Martin Baulig <martin@gnome.org>
16466 * statement.cs: Reworked the flow analysis code a bit to make it
16467 usable for dead code elimination.
16469 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16471 * cs-parser.jay: allow empty source files. Fixes bug #31781.
16473 2002-10-04 Miguel de Icaza <miguel@ximian.com>
16475 * expression.cs (ComposedCast.DoResolveType): A quick workaround
16476 to fix the test 165, will investigate deeper.
16478 2002-10-04 Martin Baulig <martin@gnome.org>
16480 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
16481 finally blocks actually work.
16482 (Try.Resolve): We don't need to create a sibling for `finally' if
16483 there is no finally block.
16485 2002-10-04 Martin Baulig <martin@gnome.org>
16487 * class.cs (Constructor.Define): The default accessibility for a
16488 non-default constructor is private, not public.
16490 2002-10-04 Miguel de Icaza <miguel@ximian.com>
16492 * class.cs (Constructor): Make AllowedModifiers public, add
16495 * cs-parser.jay: Perform the modifiers test here, as the
16496 constructor for the Constructor class usually receives a zero
16497 because of the way we create it (first we create, later we
16498 customize, and we were never checking the modifiers).
16500 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
16501 is a version of LookupTypeReflection that includes the type-name
16502 cache. This can be used as a fast path for functions that know
16503 the fully qualified name and are only calling into *.GetType() to
16504 obtain a composed type.
16506 This is also used by TypeManager.LookupType during its type
16509 (LookupType): We now also track the real type name, as sometimes
16510 we can get a quey for the real type name from things like
16511 ComposedCast. This fixes bug 31422.
16513 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
16514 complete type fullname, it does not have to go through the type
16515 resolution system to obtain the composed version of the type (for
16516 obtaining arrays or pointers).
16518 (Conditional.Emit): Use the EmitBoolExpression to
16519 generate nicer code, as requested by Paolo.
16521 (ArrayCreation.CheckIndices): Use the patch from
16522 hwang_rob@yahoo.ca to validate the array initializers.
16524 2002-10-03 Miguel de Icaza <miguel@ximian.com>
16526 * class.cs (ConstructorInitializer.Emit): simplify code by using
16527 Invocation.EmitCall, and at the same time, fix the bugs in calling
16528 parent constructors that took variable arguments.
16530 * ecore.cs (Expression.ConvertNumericExplicit,
16531 Expression.ImplicitNumericConversion): Remove the code that
16532 manually wrapped decimal (InternalTypeConstructor call is now gone
16535 * expression.cs (Cast.TryReduce): Also handle decimal types when
16536 trying to perform a constant fold on the type.
16538 * typemanager.cs (IsUnmanagedtype): Partially implemented.
16540 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
16541 that only turned off an error report, and did nothing else.
16543 2002-10-02 Miguel de Icaza <miguel@ximian.com>
16545 * driver.cs: Handle and ignore /fullpaths
16547 2002-10-01 Miguel de Icaza <miguel@ximian.com>
16549 * expression.cs (Binary.ResolveOperator): Catch the case where
16550 DoNumericPromotions returns true,
16552 (Binary.DoNumericPromotions): Simplify the code, and the tests.
16554 2002-09-27 Miguel de Icaza <miguel@ximian.com>
16556 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
16559 2002-09-26 Miguel de Icaza <miguel@ximian.com>
16561 * ecore.cs (ConvertNumericExplicit): It is not enough that the
16562 conversion exists, but it is also required that the conversion be
16563 performed. This manifested in "(Type64Enum) 2".
16565 * class.cs (TypeManager.AddMethod): The fix is not to change
16566 AddEnum, because that one was using a fully qualified name (every
16567 DeclSpace derivative does), but to change the AddMethod routine
16568 that was using an un-namespaced name. This now correctly reports
16569 the duplicated name.
16571 Revert patch until I can properly fix it. The issue
16572 is that we have a shared Type space across all namespaces
16573 currently, which is wrong.
16575 Options include making the Namespace a DeclSpace, and merge
16576 current_namespace/current_container in the parser.
16578 2002-09-25 Miguel de Icaza <miguel@ximian.com>
16580 * cs-parser.jay: Improve error reporting when we get a different
16581 kind of expression in local_variable_type and
16582 local_variable_pointer_type.
16584 Propagate this to avoid missleading errors being reported.
16586 * ecore.cs (ImplicitReferenceConversion): treat
16587 TypeManager.value_type as a target just like object_type. As
16592 Is valid, and needs to result in the int 1 being boxed before it
16593 is assigned to the value type v.
16595 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
16596 to validate the enumeration name.
16598 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
16599 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
16600 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
16602 * ecore.cs (TryImplicitIntConversion): When doing an
16603 implicit-enumeration-conversion, check if the type is 64-bits and
16604 perform a conversion before passing to EnumConstant.
16606 2002-09-23 Miguel de Icaza <miguel@ximian.com>
16608 * decl.cs (Error_AmbiguousTypeReference); New routine used to
16609 report ambiguous type references. Unlike the MS version, we
16610 report what the ambiguity is. Innovation at work ;-)
16612 (DeclSpace.FindType): Require a location argument to
16613 display when we display an ambiguous error.
16615 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
16617 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
16619 * expression.cs (EmitDynamicInitializers): Apply patch from
16620 hwang_rob@yahoo.ca that fixes the order in which we emit our
16623 2002-09-21 Martin Baulig <martin@gnome.org>
16625 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
16626 delegate takes no arguments.
16628 2002-09-20 Miguel de Icaza <miguel@ximian.com>
16630 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
16633 * expression.cs: Extract the underlying type.
16635 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
16637 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
16639 2002-09-19 Miguel de Icaza <miguel@ximian.com>
16641 * class.cs (TypeContainer.DefineType): We can not use the nice
16642 PackingSize with the size set to 1 DefineType method, because it
16643 will not allow us to define the interfaces that the struct
16646 This completes the fixing of bug 27287
16648 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
16649 means also structs. This fixes part of the problem.
16650 (Expresion.ImplicitReferenceConversionExists): ditto.
16652 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
16653 error if there were no errors reported during the type lookup
16654 process, to avoid duplicates or redundant errors. Without this
16655 you would get an ambiguous errors plus a type not found. We have
16656 beaten the user enough with the first error.
16658 (DeclSparce.FindType): Emit a warning if we have an ambiguous
16661 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
16662 during the resolution process, stop the lookup, this avoids
16663 repeated error reports (same error twice).
16665 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
16667 * typemanager.cs (LookupType): Redo the type lookup code to match
16668 the needs of System.Reflection.
16670 The issue is that System.Reflection requires references to nested
16671 types to begin with a "+" sign instead of a dot. So toplevel
16672 types look like: "NameSpace.TopLevelClass", and nested ones look
16673 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
16676 2002-09-19 Martin Baulig <martin@gnome.org>
16678 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
16679 says that a method always returns or always throws an exception,
16680 don't report the CS0161.
16682 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
16683 set `Returns = new_returns'.
16685 2002-09-19 Martin Baulig <martin@gnome.org>
16687 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
16688 to an enum constant, check for a CS0176.
16690 2002-09-18 Miguel de Icaza <miguel@ximian.com>
16692 * class.cs (TypeContainer.CheckPairedOperators): Now we check
16693 for operators that must be in pairs and report errors.
16695 * ecore.cs (SimpleName.DoResolveType): During the initial type
16696 resolution process, when we define types recursively, we must
16697 check first for types in our current scope before we perform
16698 lookups in the enclosing scopes.
16700 * expression.cs (MakeByteBlob): Handle Decimal blobs.
16702 (Invocation.VerifyArgumentsCompat): Call
16703 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
16704 I thought we were supposed to always call this, but there are a
16705 few places in the code where we dont do it.
16707 2002-09-17 Miguel de Icaza <miguel@ximian.com>
16709 * driver.cs: Add support in -linkres and -resource to specify the
16710 name of the identifier.
16712 2002-09-16 Miguel de Icaza <miguel@ximian.com>
16714 * ecore.cs (StandardConversionExists): Sync with the conversion
16715 code: allow anything-* to void* conversions.
16717 (FindMostSpecificSource): Use an Expression argument
16718 instead of a Type, because we might be handed over a Literal which
16719 gets a few more implicit conversions that plain types do not. So
16720 this information was being lost.
16722 Also, we drop the temporary type-holder expression when not
16725 2002-09-17 Martin Baulig <martin@gnome.org>
16727 * class.cs (PropertyBase.CheckBase): Don't check the base class if
16728 this is an explicit interface implementation.
16730 2002-09-17 Martin Baulig <martin@gnome.org>
16732 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
16733 different `IndexerName' attributes.
16735 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
16736 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
16737 virtual CommonResolve().
16739 2002-09-16 Miguel de Icaza <miguel@ximian.com>
16741 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16742 and convert that to the UnderlyingType.
16744 * statement.cs (Foreach.Resolve): Indexers are just like variables
16745 or PropertyAccesses.
16747 * cs-tokenizer.cs (consume_string): Track line numbers and columns
16748 inside quoted strings, we were not doing this before.
16750 2002-09-16 Martin Baulig <martin@gnome.org>
16752 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16753 resolve it. This is needed for the definite assignment check of the
16754 instance expression, fixes bug #29846.
16755 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16757 2002-09-16 Nick Drochak <ndrochak@gol.com>
16759 * parameter.cs: Fix compile error. Cannot reference static member
16760 from an instance object. Is this an mcs bug?
16762 2002-09-14 Martin Baulig <martin@gnome.org>
16764 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16765 multiple times. Fixes bug #30295, added test-166.cs.
16767 2002-09-14 Martin Baulig <martin@gnome.org>
16769 * statement.cs (Block.Emit): Don't emit unreachable code.
16770 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16771 `break' statements.
16772 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16774 2002-09-14 Martin Baulig <martin@gnome.org>
16776 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16779 2002-09-14 Martin Baulig <martin@gnome.org>
16781 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16782 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16783 be false on the ms runtime.
16785 2002-09-13 Martin Baulig <martin@gnome.org>
16787 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16788 the CS0038 error message.
16790 2002-09-12 Miguel de Icaza <miguel@ximian.com>
16792 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16793 constant inside, return it.
16795 2002-09-12 Martin Baulig <martin@gnome.org>
16797 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16798 implicit conversion can be done between enum types.
16800 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16801 check whether an implicit conversion to the current enum's UnderlyingType
16802 exists and report an error if not.
16804 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16805 without debugging support.
16807 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16808 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
16810 2002-09-12 Martin Baulig <martin@gnome.org>
16812 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16814 * ecore.cs (IMemberExpr.DeclaringType): New property.
16815 (SimpleName.SimpleNameResolve): Check whether we're accessing a
16816 nonstatic member of an outer type (CS0038).
16818 2002-09-11 Miguel de Icaza <miguel@ximian.com>
16820 * driver.cs: Activate the using-error detector at warning level
16821 4 (at least for MS-compatible APIs).
16823 * namespace.cs (VerifyUsing): Small buglett fix.
16825 * pending.cs (PendingImplementation): pass the container pointer.
16827 * interface.cs (GetMethods): Allow for recursive definition. Long
16828 term, I would like to move every type to support recursive
16829 definitions, not the current ordering mechanism that we have right
16832 The situation is this: Attributes are handled before interfaces,
16833 so we can apply attributes to interfaces. But some attributes
16834 implement interfaces, we will now handle the simple cases
16835 (recursive definitions will just get an error).
16837 * parameter.cs: Only invalidate types at the end if we fail to
16840 2002-09-09 Martin Baulig <martin@gnome.org>
16842 * ecore.cs (PropertyExpr.Emit): Also check for
16843 TypeManager.system_int_array_get_length so this'll also work when
16844 compiling corlib. Fixes #30003.
16846 2002-09-09 Martin Baulig <martin@gnome.org>
16848 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16849 and throw an exception if we can't get the type's size. Fixed #30040,
16852 2002-09-09 Martin Baulig <martin@gnome.org>
16854 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16856 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16857 context. Fixes bug #30027.
16859 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16860 virtual functions. Fixes bug #30043, added test-164.cs.
16862 2002-09-08 Ravi Pratap <ravi@ximian.com>
16864 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16866 2002-09-08 Nick Drochak <ndrochak@gol.com>
16868 * driver.cs: Use an object to get the windows codepage since it's not a
16871 2002-09-08 Miguel de Icaza <miguel@ximian.com>
16873 * statement.cs (For.Emit): for infinite loops (test == null)
16874 return whether there is a break inside, not always "true".
16876 * namespace.cs (UsingEntry): New struct to hold the name of the
16877 using definition, the location where it is defined, and whether it
16878 has been used in a successful type lookup.
16880 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16885 2002-09-06 Ravi Pratap <ravi@ximian.com>
16887 * attribute.cs : Fix incorrect code which relied on catching
16888 a NullReferenceException to detect a null being passed in
16889 where an object was expected.
16891 2002-09-06 Miguel de Icaza <miguel@ximian.com>
16893 * statement.cs (Try): flag the catch variable as assigned
16895 * expression.cs (Cast): Simplified by using ResolveType instead of
16896 manually resolving.
16898 * statement.cs (Catch): Fix bug by using ResolveType.
16900 2002-09-06 Ravi Pratap <ravi@ximian.com>
16902 * expression.cs (BetterConversion): Special case for when we have
16903 a NullLiteral as the argument and we have to choose between string
16904 and object types - we choose string the way csc does.
16906 * attribute.cs (Attribute.Resolve): Catch the
16907 NullReferenceException and report error #182 since the Mono
16908 runtime no more has the bug and having this exception raised means
16909 we tried to select a constructor which takes an object and is
16912 2002-09-05 Ravi Pratap <ravi@ximian.com>
16914 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16915 message (1502, 1503) when we can't locate a method after overload
16916 resolution. This is much more informative and closes the bug
16919 * interface.cs (PopulateMethod): Return if there are no argument
16920 types. Fixes a NullReferenceException bug.
16922 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16923 expressions too. Previously we were checking only in one place for
16924 positional arguments leaving out named arguments.
16926 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16927 type to the enum type is not allowed. Remove code corresponding to
16930 (ConvertNumericExplicit): Allow explicit conversions from
16931 the underlying type to enum type. This precisely follows the spec
16932 and closes a bug filed by Gonzalo.
16934 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16937 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16939 2002-09-03 Miguel de Icaza <miguel@ximian.com>
16941 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16942 it was important that we stored the right value after the
16943 reduction in `converted'.
16945 2002-09-04 Martin Baulig <martin@gnome.org>
16947 * location.cs (Location.SymbolDocument): Use full pathnames for the
16950 2002-08-30 Miguel de Icaza <miguel@ximian.com>
16952 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16953 of the expression resolve mechanism, because that will catch the
16954 SimpleName error failures.
16956 (Conditional): If we can not resolve the
16957 expression, return, do not crash.
16959 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16962 (location): display token name instead of its number.
16964 2002-08-28 Martin Baulig <martin@gnome.org>
16966 * expression.cs (Binary.ResolveOperator): Don't silently return
16967 but return an error if an operator cannot be applied between two
16970 2002-08-28 Martin Baulig <martin@gnome.org>
16972 * class.cs (Constructor.Define): Set the permission attributes
16973 correctly instead of making all constructors public.
16975 2002-08-28 Martin Baulig <martin@gnome.org>
16977 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16978 for private members before reporting a CS0103; if we find anything,
16981 2002-08-28 Martin Baulig <martin@gnome.org>
16983 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16984 to check whether `closure_start_type == closure_invocation_type',
16985 we also need to check whether `m.DeclaringType == closure_invocation_type'
16986 before bypassing the permission checks. We might be accessing
16987 protected/private members from the base class.
16988 (TypeManager.RealMemberLookup): Only set private_ok if private
16989 members were requested via BindingFlags.NonPublic.
16991 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16993 * expression.cs (MemberAccess.ResolveMemberAccess): Set
16994 MethodGroupExpr.IsExplicitImpl if appropriate.
16995 (Invocation.DoResolve): Don't report the CS0120 for explicit
16996 interface implementations.
16998 2002-08-27 Martin Baulig <martin@gnome.org>
17000 * expression.cs (Invocation.DoResolve): If this is a static
17001 method and we don't have an InstanceExpression, we must report
17004 2002-08-25 Martin Baulig <martin@gnome.org>
17006 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
17007 `==' between a valuetype and an object.
17009 2002-08-25 Miguel de Icaza <miguel@ximian.com>
17011 * ecore.cs (TypeExpr): Provide a ToString method.
17013 2002-08-24 Martin Baulig <martin@gnome.org>
17015 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
17016 now called proggie.dbg and it's a binary file.
17018 2002-08-23 Martin Baulig <martin@gnome.org>
17020 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
17022 2002-08-23 Martin Baulig <martin@gnome.org>
17024 * struct.cs (MyStructInfo.ctor): Make this work with empty
17025 structs; it's not allowed to use foreach() on null.
17027 2002-08-23 Martin Baulig <martin@gnome.org>
17029 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
17030 writer the full pathname of the generated assembly.
17032 2002-08-23 Martin Baulig <martin@gnome.org>
17034 * statements.cs (FlowBranching.UsageVector.MergeChildren):
17035 A `finally' block never returns or breaks; improved handling of
17038 2002-08-23 Martin Baulig <martin@gnome.org>
17040 * statement.cs (Throw.Resolve): Allow `throw null'.
17042 2002-08-23 Martin Baulig <martin@gnome.org>
17044 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
17045 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
17046 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
17047 MemberLookup would return a wrong event if this is an explicit
17048 interface implementation and the class has an event with the same
17051 2002-08-23 Martin Baulig <martin@gnome.org>
17053 * statement.cs (Block.AddChildVariableNames): New public method.
17054 (Block.AddChildVariableName): Likewise.
17055 (Block.IsVariableNameUsedInChildBlock): Likewise.
17056 (Block.AddVariable): Check whether a variable name has already
17057 been used in a child block.
17059 * cs-parser.jay (declare_local_variables): Mark all variable names
17060 from the current block as being used in a child block in the
17063 2002-08-23 Martin Baulig <martin@gnome.org>
17065 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
17066 find the symbol writer.
17068 * driver.cs: csc also allows the arguments to /define being
17069 separated by commas, not only by semicolons.
17071 2002-08-23 Martin Baulig <martin@gnome.org>
17073 * interface.cs (Interface.GetMembers): Added static check for events.
17075 2002-08-15 Martin Baulig <martin@gnome.org>
17077 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
17078 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
17080 * ecore.cs (Expression.MemberLookup): Added documentation and explained
17081 why the MethodData.EmitDestructor() change was necessary.
17083 2002-08-20 Martin Baulig <martin@gnome.org>
17085 * class.cs (TypeContainer.FindMembers): Added static check for events.
17087 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
17089 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
17090 use Type.GetEvents(), not Type.FindMembers().
17092 2002-08-20 Martin Baulig <martin@gnome.org>
17094 * decl.cs (MemberCache): Added a special method cache which will
17095 be used for method-only searched. This ensures that a method
17096 search will return a MethodInfo with the correct ReflectedType for
17099 2002-08-20 Martin Baulig <martin@gnome.org>
17101 * decl.cs (DeclSpace.FindMembers): Made this public.
17103 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17105 * delegate.cs: fixed build on windows.
17106 [FIXME: Filed as bug #29150: MCS must report these errors.]
17108 2002-08-19 Ravi Pratap <ravi@ximian.com>
17110 * ecore.cs (StandardConversionExists): Return a false
17111 if we are trying to convert the void type to anything else
17112 since that is not allowed.
17114 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
17115 we flag error 70 in the event an event is trying to be accessed
17116 directly from outside the declaring type.
17118 2002-08-20 Martin Baulig <martin@gnome.org>
17120 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
17121 MemberCache from typemanager.cs to decl.cs.
17123 2002-08-19 Martin Baulig <martin@gnome.org>
17125 * class.cs (TypeContainer): Implement IMemberContainer.
17126 (TypeContainer.DefineMembers): Create the MemberCache.
17127 (TypeContainer.FindMembers): Do better BindingFlags checking; only
17128 return public members if BindingFlags.Public was given, check
17129 whether members are static.
17131 2002-08-16 Martin Baulig <martin@gnome.org>
17133 * decl.cs (DeclSpace.Define): Splitted this in Define and
17134 DefineMembers. DefineMembers is called first and initializes the
17137 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
17138 DefineMembers() on all our DeclSpaces.
17140 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
17141 but call DefineMembers() on all nested interfaces. We call their
17142 Define() in our new Define() function.
17144 * interface.cs (Interface): Implement IMemberContainer.
17145 (Interface.Define): Moved all code except the attribute stuf to
17147 (Interface.DefineMembers): Initialize the member cache.
17149 * typemanager.cs (IMemberFinder): Removed this interface, we don't
17150 need this anymore since we can use MemberCache.FindMembers directly.
17152 2002-08-19 Martin Baulig <martin@gnome.org>
17154 * typemanager.cs (MemberCache): When creating the cache for an
17155 interface type, add all inherited members.
17156 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
17157 to `out bool used_cache' and documented it.
17158 (TypeManager.MemberLookup): If we already used the cache in the first
17159 iteration, we don't need to do the interfaces check.
17161 2002-08-19 Martin Baulig <martin@gnome.org>
17163 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
17164 here from IMemberFinder and don't implement this interface anymore.
17165 (DeclSpace.MemberCache): Moved here from IMemberFinder.
17167 * typemanager.cs (IMemberFinder): This interface is now only used by
17168 classes which actually support the member cache.
17169 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
17170 since we only put DeclSpaces into this Hashtable.
17171 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
17172 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
17174 2002-08-16 Martin Baulig <martin@gnome.org>
17176 * typemanager.cs (ICachingMemberFinder): Removed.
17177 (IMemberFinder.MemberCache): New property.
17178 (TypeManager.FindMembers): Merged this with RealFindMembers().
17179 This function will never be called from TypeManager.MemberLookup()
17180 so we can't use the cache here, just the IMemberFinder.
17181 (TypeManager.MemberLookup_FindMembers): Check whether the
17182 IMemberFinder has a MemberCache and call the cache's FindMembers
17184 (MemberCache): Rewrote larger parts of this yet another time and
17185 cleaned it up a bit.
17187 2002-08-15 Miguel de Icaza <miguel@ximian.com>
17189 * driver.cs (LoadArgs): Support quoting.
17191 (Usage): Show the CSC-like command line arguments.
17193 Improved a few error messages.
17195 2002-08-15 Martin Baulig <martin@gnome.org>
17197 * typemanager.cs (IMemberContainer.Type): New property.
17198 (IMemberContainer.IsInterface): New property.
17200 The following changes are conditional to BROKEN_RUNTIME, which is
17201 defined at the top of the file.
17203 * typemanager.cs (MemberCache.MemberCache): Don't add the base
17204 class'es members, but add all members from TypeHandle.ObjectType
17205 if we're an interface.
17206 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
17207 is the current type.
17208 (MemberCache.CacheEntry.Container): Removed this field.
17209 (TypeHandle.GetMembers): Include inherited members.
17211 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17213 * typemanager.cs: fixed compilation and added a comment on a field that
17216 2002-08-15 Martin Baulig <martin@gnome.org>
17218 * class.cs (ConstructorInitializer.Resolve): In the
17219 Expression.MemberLookup call, use the queried_type as
17222 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
17223 declared' attribute, it's always true.
17224 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
17225 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
17226 temporary wrapper for FindMembers which tells MemberLookup whether
17227 members from the base classes are included in the return value.
17228 This will go away soon.
17229 (TypeManager.MemberLookup): Use this temporary hack here; once the
17230 new MemberCache is completed, we don't need to do the DeclaredOnly
17231 looping here anymore since the MemberCache will take care of this.
17232 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
17233 (MemberCache): When creating the MemberCache for a class, get
17234 members from the current class and all its base classes.
17235 (MemberCache.CacheEntry.Container): New field. This is a
17236 temporary hack until the Mono runtime is fixed to distinguish
17237 between ReflectedType and DeclaringType. It allows us to use MCS
17238 with both the MS runtime and the unfixed Mono runtime without
17239 problems and without accecting performance.
17240 (MemberCache.SearchMembers): The DeclaredOnly looping from
17241 TypeManager.MemberLookup is now done here.
17243 2002-08-14 Martin Baulig <martin@gnome.org>
17245 * statement.cs (MyStructInfo.MyStructInfo): Don't call
17246 Type.GetFields on dynamic types but get the fields from the
17247 corresponding TypeContainer.
17248 (MyStructInfo.GetStructInfo): Added check for enum types.
17250 * typemanager.cs (MemberList.IsSynchronized): Implemented.
17251 (MemberList.SyncRoot): Implemented.
17252 (TypeManager.FilterWithClosure): No need to check permissions if
17253 closure_start_type == closure_invocation_type, don't crash if
17254 closure_invocation_type is null.
17256 2002-08-13 Martin Baulig <martin@gnome.org>
17258 Rewrote TypeContainer.FindMembers to use a member cache. This
17259 gives us a speed increase of about 35% for the self-hosting MCS
17260 build and of about 15-20% for the class libs (both on GNU/Linux).
17262 * report.cs (Timer): New class to get enhanced profiling. This
17263 whole class is "TIMER" conditional since it remarkably slows down
17266 * class.cs (MemberList): New class. This is an IList wrapper
17267 which we're now using instead of passing MemberInfo[]'s around to
17268 avoid copying this array unnecessarily.
17269 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
17270 (ICachingMemberFinder, IMemberContainer): New interface.
17271 (TypeManager.FilterWithClosure): If `criteria' is null, the name
17272 has already been checked, otherwise use it for the name comparision.
17273 (TypeManager.FindMembers): Renamed to RealMemberFinder and
17274 provided wrapper which tries to use ICachingMemberFinder.FindMembers
17275 if possible. Returns a MemberList, not a MemberInfo [].
17276 (TypeHandle): New class, implements IMemberContainer. We create
17277 one instance of this class per type, it contains a MemberCache
17278 which is used to do the member lookups.
17279 (MemberCache): New class. Each instance of this class contains
17280 all members of a type and a name-based hash table.
17281 (MemberCache.FindMembers): This is our new member lookup
17282 function. First, it looks up all members of the requested name in
17283 the hash table. Then, it walks this list and sorts out all
17284 applicable members and returns them.
17286 2002-08-13 Martin Baulig <martin@gnome.org>
17288 In addition to a nice code cleanup, this gives us a performance
17289 increase of about 1.4% on GNU/Linux - not much, but it's already
17290 half a second for the self-hosting MCS compilation.
17292 * typemanager.cs (IMemberFinder): New interface. It is used by
17293 TypeManager.FindMembers to call FindMembers on a TypeContainer,
17294 Enum, Delegate or Interface.
17295 (TypeManager.finder_to_member_finder): New PtrHashtable.
17296 (TypeManager.finder_to_container): Removed.
17297 (TypeManager.finder_to_delegate): Removed.
17298 (TypeManager.finder_to_interface): Removed.
17299 (TypeManager.finder_to_enum): Removed.
17301 * interface.cs (Interface): Implement IMemberFinder.
17303 * delegate.cs (Delegate): Implement IMemberFinder.
17305 * enum.cs (Enum): Implement IMemberFinder.
17307 * class.cs (TypeContainer): Implement IMemberFinder.
17309 2002-08-12 Martin Baulig <martin@gnome.org>
17311 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
17313 2002-08-12 Martin Baulig <martin@gnome.org>
17315 * ecore.cs (ITypeExpression): New interface for expressions which
17317 (TypeExpression): Renamed to TypeLookupExpression.
17318 (Expression.DoResolve): If we're doing a types-only lookup, the
17319 expression must implement the ITypeExpression interface and we
17320 call DoResolveType() on it.
17321 (SimpleName): Implement the new ITypeExpression interface.
17322 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
17323 hack, the situation that we're only looking up types can't happen
17324 anymore when this method is called. Moved the type lookup code to
17325 DoResolveType() and call it.
17326 (SimpleName.DoResolveType): This ITypeExpression interface method
17327 is now doing the types-only lookup.
17328 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
17329 (ResolveFlags): Added MaskExprClass.
17331 * expression.cs (MemberAccess): Implement the ITypeExpression
17333 (MemberAccess.DoResolve): Added support for a types-only lookup
17334 when we're called via ITypeExpression.DoResolveType().
17335 (ComposedCast): Implement the ITypeExpression interface.
17337 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
17338 Expression.Resolve() with ResolveFlags.Type instead.
17340 2002-08-12 Martin Baulig <martin@gnome.org>
17342 * interface.cs (Interface.Define): Apply attributes.
17344 * attribute.cs (Attribute.ApplyAttributes): Added support for
17345 interface attributes.
17347 2002-08-11 Martin Baulig <martin@gnome.org>
17349 * statement.cs (Block.Emit): Only check the "this" variable if we
17350 do not always throw an exception.
17352 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
17353 whether the property has a set accessor.
17355 2002-08-11 Martin Baulig <martin@gnome.org>
17357 Added control flow analysis support for structs.
17359 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
17360 with control flow analysis turned off.
17361 (IVariable): New interface.
17362 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
17363 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
17364 (FieldExpr.DoResolve): Resolve the instance expression with flow
17365 analysis turned off and do the definite assignment check after the
17366 resolving when we know what the expression will resolve to.
17368 * expression.cs (LocalVariableReference, ParameterReference):
17369 Implement the new IVariable interface, only call the flow analysis
17370 code if ec.DoFlowAnalysis is true.
17371 (This): Added constructor which takes a Block argument. Implement
17372 the new IVariable interface.
17373 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
17374 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
17375 This does the definite assignment checks for struct members.
17377 * class.cs (Constructor.Emit): If this is a non-static `struct'
17378 constructor which doesn't have any initializer, call
17379 Block.AddThisVariable() to tell the flow analysis code that all
17380 struct elements must be initialized before control returns from
17383 * statement.cs (MyStructInfo): New public class.
17384 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
17385 argument to this indexer. If non-zero, check an individual struct
17386 member, not the whole struct.
17387 (FlowBranching.CheckOutParameters): Check struct members.
17388 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
17389 overloaded versions of these methods which take an additional
17390 `int field_idx' argument to check struct members.
17391 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
17392 overloaded versions of these methods which take an additional
17393 `string field_name' argument to check struct member.s
17394 (VariableInfo): Implement the IVariable interface.
17395 (VariableInfo.StructInfo): New public property. Returns the
17396 MyStructInfo instance of the variable if it's a struct or null.
17397 (Block.AddThisVariable): New public method. This is called from
17398 Constructor.Emit() for non-static `struct' constructor which do
17399 not have any initializer. It creates a special variable for the
17400 "this" instance variable which will be checked by the flow
17401 analysis code to ensure that all of the struct's fields are
17402 initialized before control returns from the constructor.
17403 (UsageVector): Added support for struct members. If a
17404 variable/parameter is a struct with N members, we reserve a slot
17405 in the usage vector for each member. A struct is considered fully
17406 initialized if either the struct itself (slot 0) or all its
17407 members are initialized.
17409 2002-08-08 Martin Baulig <martin@gnome.org>
17411 * driver.cs (Driver.MainDriver): Only report an error CS5001
17412 if there were no compilation errors.
17414 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
17415 `UnsafeContext' property to determine whether the parent is in
17416 unsafe context rather than checking the parent's ModFlags:
17417 classes nested in an unsafe class are unsafe as well.
17419 2002-08-08 Martin Baulig <martin@gnome.org>
17421 * statement.cs (UsageVector.MergeChildren): Distinguish between
17422 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
17423 we return. Added test17() and test18() to test-154.cs.
17425 2002-08-08 Martin Baulig <martin@gnome.org>
17427 * typemanager.cs (TypeManager.FilterWithClosure): If we have
17428 Family access, make sure the invoking type isn't a subclass of the
17429 queried type (that'd be a CS1540).
17431 * ecore.cs (Expression.MemberLookup): Added overloaded version of
17432 this method which takes an additional `Type invocation_type'.
17434 * expression.cs (BaseAccess.DoResolve): Use the base type as
17435 invocation and query type.
17436 (MemberAccess.DoResolve): If the lookup failed and we're about to
17437 report a CS0122, try a lookup with the ec.ContainerType - if this
17438 succeeds, we must report a CS1540.
17440 2002-08-08 Martin Baulig <martin@gnome.org>
17442 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
17443 (MethodGroupExpr): Implement the IMemberExpr interface.
17445 * expression (MemberAccess.ResolveMemberAccess): No need to have
17446 any special code for MethodGroupExprs anymore, they're now
17449 2002-08-08 Martin Baulig <martin@gnome.org>
17451 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
17452 Family, FamANDAssem and FamORAssem permissions.
17453 (TypeManager.IsSubclassOrNestedChildOf): New public method.
17455 2002-08-08 Martin Baulig <martin@gnome.org>
17457 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
17458 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
17461 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
17463 * driver.cs: implemented /resource option to embed managed resources.
17465 2002-08-07 Martin Baulig <martin@gnome.org>
17467 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
17468 (FieldBase.HasFieldInitializer): New public property.
17469 (FieldBase.GetInitializerExpression): New public method. Resolves and
17470 returns the field initializer and makes sure it is only resolved once.
17471 (TypeContainer.EmitFieldInitializers): Call
17472 FieldBase.GetInitializerExpression to get the initializer, this ensures
17473 that it isn't resolved multiple times.
17475 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
17476 the resolving process (SimpleName/MemberLookup) that we're currently
17477 emitting a field initializer (which must not access any instance members,
17478 this is an error CS0236).
17480 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
17481 argument, if the `IsFieldInitializer' flag is set, we must report and
17482 error CS0236 and not an error CS0120.
17484 2002-08-07 Martin Baulig <martin@gnome.org>
17486 * ecore.cs (IMemberExpr): New public interface.
17487 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
17488 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
17489 if the expression is an IMemberExpr.
17491 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
17492 to be null, implicitly default to `this' if we're non-static in
17493 this case. Simplified the code a lot by using the new IMemberExpr
17494 interface. Also fixed bug #28176 here.
17496 2002-08-06 Martin Baulig <martin@gnome.org>
17498 * cs-parser.jay (SimpleLookup): Removed. We need to create
17499 ParameterReferences during semantic analysis so that we can do a
17500 type-only search when resolving Cast, TypeOf and SizeOf.
17501 (block): Pass the `current_local_parameters' to the Block's
17504 * class.cs (ConstructorInitializer): Added `Parameters parameters'
17505 argument to the constructor.
17506 (ConstructorInitializer.Resolve): Create a temporary implicit
17507 block with the parameters.
17509 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
17510 references here if we aren't doing a type-only search.
17512 * statement.cs (Block): Added constructor which takes a
17513 `Parameters parameters' argument.
17514 (Block.Parameters): New public property.
17516 * support.cs (InternalParameters.Parameters): Renamed `parameters'
17517 to `Parameters' and made it public readonly.
17519 2002-08-06 Martin Baulig <martin@gnome.org>
17521 * ecore.cs (Expression.Warning): Made this public as well.
17523 * report.cs (Report.Debug): Print the contents of collections.
17525 2002-08-06 Martin Baulig <martin@gnome.org>
17527 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
17528 used to tell Resolve() which kinds of expressions it may return.
17529 (Expression.Resolve): Added overloaded version of this method which
17530 takes a `ResolveFlags flags' argument. This can be used to tell
17531 Resolve() which kinds of expressions it may return. Reports a
17533 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
17534 ResolveFlags.SimpleName.
17535 (Expression.Error118): Added overloaded version of this method which
17536 takes a `ResolveFlags flags' argument. It uses the flags to determine
17537 which kinds of expressions are allowed.
17539 * expression.cs (Argument.ResolveMethodGroup): New public method.
17540 Resolves an argument, but allows a MethodGroup to be returned.
17541 This is used when invoking a delegate.
17543 * TODO: Updated a bit.
17545 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17547 Fixed compilation with csc.
17549 * ecore.cs: Expression.Error made public. Is this correct? Should
17550 Warning be made public too?
17552 * expression.cs: use ea.Location instead of ea.loc.
17553 [FIXME: Filed as bug #28607: MCS must report these errors.]
17555 2002-08-06 Martin Baulig <martin@gnome.org>
17557 * ecore.cs (Expression.loc): Moved the location here instead of
17558 duplicating it in all derived classes.
17559 (Expression.Location): New public property.
17560 (Expression.Error, Expression.Warning): Made them non-static and
17561 removed the location argument.
17562 (Expression.Warning): Added overloaded version which takes an
17563 `int level' argument.
17564 (Expression.Error118): Make this non-static and removed the
17565 expression and location arguments.
17566 (TypeExpr): Added location argument to the constructor.
17568 * expression.cs (StaticCallExpr): Added location argument to
17570 (Indirection, PointerArithmetic): Likewise.
17571 (CheckedExpr, UnCheckedExpr): Likewise.
17572 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
17573 (StringPtr): Likewise.
17576 2002-08-05 Martin Baulig <martin@gnome.org>
17578 * expression.cs (BaseAccess.DoResolve): Actually report errors.
17580 * assign.cs (Assign.DoResolve): Check whether the source
17581 expression is a value or variable.
17583 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
17584 while resolving the corresponding blocks.
17586 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
17587 an error, don't silently return null.
17589 * statement.cs (Block.AddVariable): Do the error reporting here
17590 and distinguish between CS0128 and CS0136.
17591 (Block.DoResolve): Report all unused labels (warning CS0164).
17592 (LabeledStatement): Pass the location to the constructor.
17593 (LabeledStatement.HasBeenReferenced): New property.
17594 (LabeledStatement.Resolve): Set it to true here.
17596 * statement.cs (Return.Emit): Return success even after reporting
17597 a type mismatch error (CS0126 or CS0127), this is what csc does and
17598 it avoids confusing the users with any consecutive errors.
17600 2002-08-05 Martin Baulig <martin@gnome.org>
17602 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
17604 * const.cs (Const.LookupConstantValue): Catch circular definitions.
17606 * expression.cs (MemberAccess.DoResolve): Silently return if an
17607 error has already been reported.
17609 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
17610 error has already been reported.
17612 2002-08-05 Martin Baulig <martin@gnome.org>
17614 * statement.cs (UsageVector): Only initialize the `parameters'
17615 vector if we actually have any "out" parameters.
17617 2002-08-05 Martin Baulig <martin@gnome.org>
17619 * expression.cs (Binary.ResolveOperator): When combining delegates,
17620 they must have the same type.
17622 2002-08-05 Martin Baulig <martin@gnome.org>
17624 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
17625 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
17626 work with the ms runtime and we also don't need it: if we're a
17627 PropertyBuilder and not in the `indexer_arguments' hash, then we
17628 are a property and not an indexer.
17630 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
17631 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
17632 since the latter one doesn't work with the ms runtime.
17634 2002-08-03 Martin Baulig <martin@gnome.org>
17636 Fixed bugs #27998 and #22735.
17638 * class.cs (Method.IsOperator): New public field.
17639 (Method.CheckBase): Report CS0111 if there's already a method
17640 with the same parameters in the current class. Report CS0508 when
17641 attempting to change the return type of an inherited method.
17642 (MethodData.Emit): Report CS0179 if a method doesn't have a body
17643 and it's not marked abstract or extern.
17644 (PropertyBase): New abstract base class for Property and Indexer.
17645 (PropertyBase.CheckBase): Moved here from Property and made it work
17647 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
17648 the same so we can reuse it there.
17649 (Property, Indexer): Derive from PropertyBase.
17650 (MethodSignature.inheritable_property_signature_filter): New delegate
17651 to find properties and indexers.
17653 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
17654 argument and improved error reporting.
17656 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
17657 EmptyReadOnlyParameters and made it a property.
17659 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
17660 version of this method which takes a `PropertyInfo indexer'.
17661 (TypeManager.RegisterIndexer): New method.
17663 * class.cs: Added myself as author of this file :-)
17665 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17667 * class.cs: fixed compilation on windoze.
17669 2002-08-03 Martin Baulig <martin@gnome.org>
17671 * interface.cs (Interface.GetInterfaceBases): Check whether all
17672 base interfaces are at least as accessible than the current one.
17674 * class.cs (TypeContainer.GetClassBases): Check whether base types
17675 are at least as accessible than the current type.
17676 (TypeContainer.AsAccessible): Implemented and made non-static.
17677 (MemberBase.CheckParameters): Report errors if the accessibility
17680 * delegate.cs (Delegate.Delegate): The default visibility is
17681 internal for top-level types and private for nested types.
17682 (Delegate.Define): Report errors if the accessibility checks fail.
17684 * enum.cs (Enum.Enum): The default visibility is internal for
17685 top-level types and private for nested types.
17686 (Enum.DefineType): Compute the correct visibility.
17688 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
17689 function which takes a `bool is_toplevel' instead of a TypeContainer.
17691 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
17694 2002-08-02 Martin Baulig <martin@gnome.org>
17696 * expression.cs (LocalVariableReferenc): Added constructor which
17697 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
17698 (LocalVariableReference.IsReadOnly): New property.
17699 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
17700 variable is readonly, use our own readonly flag to do this; you can
17701 use the new constructor to get a writable reference to a read-only
17704 * cs-parser.jay (foreach_statement, using_statement): Get a writable
17705 reference to the local variable.
17707 2002-08-01 Miguel de Icaza <miguel@ximian.com>
17709 * rootcontext.cs (ResolveCore): Also include System.Exception
17711 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
17712 we reach an EmptyStatement.
17714 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
17717 * expression.cs (Binary.ResolveOperator): Check error result in
17720 use brtrue/brfalse directly and avoid compares to null.
17722 2002-08-02 Martin Baulig <martin@gnome.org>
17724 * class.cs (TypeContainer.Define): Define all nested interfaces here.
17725 Fixes bug #28407, added test-155.cs.
17727 2002-08-01 Martin Baulig <martin@gnome.org>
17729 * class.cs (Event.EmitDefaultMethod): Make this work with static
17730 events. Fixes #28311, added verify-3.cs.
17732 2002-08-01 Martin Baulig <martin@gnome.org>
17734 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
17735 `is_disposable' fields.
17736 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
17737 `hm.is_disposable' if we're using the collection pattern.
17738 (Foreach.EmitCollectionForeach): Use the correct type for the
17739 enumerator's local variable, only emit the try/finally block if
17740 necessary (fixes #27713).
17742 2002-08-01 Martin Baulig <martin@gnome.org>
17744 * ecore.cs (Expression.report118): Renamed to Error118 and made
17747 * statement.cs (Throw.Resolve): Check whether the expression is of
17748 the correct type (CS0118) and whether the type derives from
17749 System.Exception (CS0155).
17750 (Catch.Resolve): New method. Do the type lookup here and check
17751 whether it derives from System.Exception (CS0155).
17752 (Catch.CatchType, Catch.IsGeneral): New public properties.
17754 * typemanager.cs (TypeManager.exception_type): Added.
17756 2002-07-31 Miguel de Icaza <miguel@ximian.com>
17758 * driver.cs: Updated About function.
17760 2002-07-31 Martin Baulig <martin@gnome.org>
17762 Implemented Control Flow Analysis.
17764 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17765 (EmitContext.CurrentBranching): Added.
17766 (EmitContext.StartFlowBranching): Added.
17767 (EmitContext.EndFlowBranching): Added.
17768 (EmitContext.KillFlowBranching): Added.
17769 (EmitContext.IsVariableAssigned): Added.
17770 (EmitContext.SetVariableAssigned): Added.
17771 (EmitContext.IsParameterAssigned): Added.
17772 (EmitContext.SetParameterAssigned): Added.
17773 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17774 Added control flow analysis stuff here.
17776 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17777 resolve the expression as lvalue.
17778 (LocalVariableReference.DoResolve): Check whether the variable has
17779 already been assigned.
17780 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17781 the parameter as assigned here.
17782 (ParameterReference.DoResolve): Check whether the parameter has already
17784 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17785 expression as lvalue.
17787 * statement.cs (FlowBranching): New class for the flow analysis code.
17788 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17789 (LabeledStatement.IsDefined): New public property.
17790 (LabeledStatement.AddUsageVector): New public method to tell flow
17791 analyis that the label may be reached via a forward jump.
17792 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17794 (VariableInfo.Number): New public field. This is used by flow analysis
17795 to number all locals of a block.
17796 (Block.CountVariables): New public property. This is the number of
17797 local variables in this block (including the locals from all parent
17799 (Block.EmitMeta): Number all the variables.
17801 * statement.cs: Added flow analysis support to all classes.
17803 2002-07-31 Martin Baulig <martin@gnome.org>
17805 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
17806 To get debugging messages, compile mcs with /define:MCS_DEBUG and
17807 then use this argument.
17809 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17811 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17812 use this to specify /define options.
17814 2002-07-29 Martin Baulig <martin@gnome.org>
17816 * statement.cs (Fixed): Moved all code that does variable lookups
17817 and resolvings from Emit to Resolve.
17819 * statement.cs (For): Moved all code that does variable lookups
17820 and resolvings from Emit to Resolve.
17822 * statement.cs (Using): Moved all code that does variable lookups
17823 and resolvings from Emit to Resolve.
17825 2002-07-29 Martin Baulig <martin@gnome.org>
17827 * attribute.cs (Attribute.Resolve): Explicitly catch a
17828 System.NullReferenceException when creating the
17829 CustromAttributeBuilder and report a different warning message.
17831 2002-07-29 Martin Baulig <martin@gnome.org>
17833 * support.cs (ParameterData.ParameterName): Added method to
17834 get the name of a parameter.
17836 * typemanager.cs (TypeManager.IsValueType): New public method.
17838 2002-07-29 Martin Baulig <martin@gnome.org>
17840 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
17841 is a flag which specifies that it's either ref or out.
17842 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
17843 the out parameter to `out Parameter.Modifier mod', also set the
17844 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17846 * support.cs (InternalParameters.ParameterModifier): Distinguish
17847 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17848 Parameter.Modifier.ISBYREF flag if it's either ref or out.
17850 * expression.cs (Argument.GetParameterModifier): Distinguish
17851 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17852 Parameter.Modifier.ISBYREF flag if it's either ref or out.
17854 2002-07-29 Martin Baulig <martin@gnome.org>
17856 * expression.cs (ParameterReference.ParameterReference): Added
17857 `Location loc' argument to the constructor.
17859 * cs-parser.jay: Pass location to ParameterReference.
17861 2002-07-28 Miguel de Icaza <miguel@ximian.com>
17863 * statement.cs (Try): Initialize the location.
17865 * cs-parser.jay: pass location to Try.
17867 * expression.cs (Unary.Reduce): Change the prototype to return
17868 whether a constant fold could be performed or not. The result is
17869 returned in an out parameters. In the case of Indirection and
17870 AddressOf, we want to perform the full tests.
17872 2002-07-26 Miguel de Icaza <miguel@ximian.com>
17874 * statement.cs (Statement.Emit): Flag dead code.
17876 2002-07-27 Andrew Birkett <andy@nobugs.org>
17878 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17880 2002-07-27 Martin Baulig <martin@gnome.org>
17882 * class.cs (MethodData.Define): Put back call to
17883 TypeManager.AddMethod(), accidentally commented this out.
17885 * report.cs (Debug): New public method to print debugging information,
17886 this is `[Conditional ("DEBUG")]'.
17888 2002-07-26 Martin Baulig <martin@gnome.org>
17890 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17891 (switch_statement): Push the current_block to the switch_stack and
17892 pop it again when we're done with the switch.
17893 (switch_section): The new block is a child of the current_block.
17894 Fixes bug #24007, added test-152.cs.
17896 2002-07-27 Martin Baulig <martin@gnome.org>
17898 * expression.cs (Invocation.EmitArguments): When calling a varargs
17899 function with only its fixed arguments, we need to pass an empty
17902 2002-07-27 Martin Baulig <martin@gnome.org>
17904 Mono 0.13 has been released.
17906 2002-07-25 Miguel de Icaza <miguel@ximian.com>
17908 * driver.cs: Rename --resource to --linkres, because that is what
17909 we do currently, we dont support --resource yet.
17911 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17913 2002-07-25 Martin Baulig <martin@gnome.org>
17915 * class.cs (MethodData): New public class. This is a `method builder'
17916 class for a method or one accessor of a Property/Indexer/Event.
17917 (MethodData.GetMethodFlags): Moved here from MemberBase.
17918 (MethodData.ApplyAttributes): Likewise.
17919 (MethodData.ApplyObsoleteAttribute): Likewise.
17920 (MethodData.ApplyConditionalAttribute): Likewise.
17921 (MethodData.ApplyDllImportAttribute): Likewise.
17922 (MethodData.CheckAbstractAndExternal): Likewise.
17923 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17924 (MethodData.Emit): Formerly known as Method.Emit().
17925 (MemberBase): Moved everything which was specific to a single
17926 accessor/method to MethodData.
17927 (Method): Create a new MethodData and call Define() and Emit() on it.
17928 (Property, Indexer, Event): Create a new MethodData objects for each
17929 accessor and call Define() and Emit() on them.
17931 2002-07-25 Martin Baulig <martin@gnome.org>
17933 Made MethodCore derive from MemberBase to reuse the code from there.
17934 MemberBase now also checks for attributes.
17936 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17937 (MemberBase.GetMethodFlags): Moved here from class Method and marked
17939 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17940 `CallingConventions cc' and `Attributes opt_attrs' arguments.
17941 (MemberBase.ApplyAttributes): New virtual method; applies the
17942 attributes to a method or accessor.
17943 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17944 (MemberBase.ApplyConditionalAttribute): Likewise.
17945 (MemberBase.ApplyDllImportAttribute): Likewise.
17946 (MemberBase.CheckAbstractAndExternal): Likewise.
17947 (MethodCore.ParameterTypes): This is now a property instead of a
17948 method, it's initialized from DoDefineParameters().
17949 (MethodCore.ParameterInfo): Removed the set accessor.
17950 (MethodCore.DoDefineParameters): New protected virtual method to
17951 initialize ParameterTypes and ParameterInfo.
17952 (Method.GetReturnType): We can now simply return the MemberType.
17953 (Method.GetMethodFlags): Override the MemberBase version and add
17954 the conditional flags.
17955 (Method.CheckBase): Moved some code from Define() here, call
17956 DoDefineParameters() here.
17957 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17958 here to avoid some larger code duplication.
17959 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17960 ensure that abstract and external accessors don't declare a body.
17962 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17963 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17964 lookup in the attribute's parent classes, so we need to abort as soon
17965 as we found the first match.
17966 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17967 the attribute has no arguments.
17969 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17972 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17974 * cs-parser.jay: reverted previous patch.
17976 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17978 * cs-parser.jay: fixed bug #22119.
17980 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17982 * attribute.cs: fixed compilation. The error was:
17983 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
17984 be assigned to before control leaves the current method."
17985 [FIXME: Filed as bug #28186: MCS must report this error.]
17987 2002-07-25 Martin Baulig <martin@gnome.org>
17989 * attribute.cs (Attribute.Conditional_GetConditionName): New static
17990 method to pull the condition name ouf of a Conditional attribute.
17991 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17992 the obsolete message and error flag out of an Obsolete attribute.
17994 * class.cs (Method.GetMethodFlags): New public method to get the
17995 TypeManager.MethodFlags for this method.
17996 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17998 (Method.Define): Get and apply the Obsolete and Conditional attributes;
17999 if we're overriding a virtual function, set the new private variable
18000 `parent_method'; call the new TypeManager.AddMethod().
18002 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
18003 the MethodBuilder and the Method in a PtrHashtable.
18004 (TypeManager.builder_to_method): Added for this purpose.
18005 (TypeManager.MethodFlags): Added IsObsoleteError.
18006 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
18007 Obsolete and Conditional arguments in MethodBuilders. If we discover
18008 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
18009 the message from the attribute.
18011 2002-07-24 Martin Baulig <martin@gnome.org>
18013 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
18014 preprocessor directives, ensure that the argument to #define/#undef is
18015 exactly one identifier and that it's actually an identifier.
18017 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
18020 2002-07-24 Martin Baulig <martin@gnome.org>
18022 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
18023 initialize it to TypeManager.object_type in the constructor.
18024 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
18025 of the `hm.get_current' method if we're using the collection pattern.
18026 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
18027 for the explicit conversion to make it work when we're using the collection
18028 pattern and the `Current' property has a different return type than `object'.
18031 2002-07-24 Martin Baulig <martin@gnome.org>
18033 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
18034 does not match, but don't report any errors. This method is called in
18035 order for all methods in a MethodGroupExpr until a matching method is
18036 found, so we don't want to bail out if the first method doesn't match.
18037 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
18038 matches, report the 123. Fixes #28070.
18040 2002-07-24 Martin Baulig <martin@gnome.org>
18042 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
18043 TypeManager.TypeToCoreType() to the top of the method so the
18044 following equality checks will work. Fixes #28107.
18046 2002-07-24 Martin Baulig <martin@gnome.org>
18048 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
18049 operand is of type uint, and the other operand is of type sbyte,
18050 short or int, the operands are converted to type long." -
18051 Actually do what this comment already told us. Fixes bug #28106,
18054 2002-07-24 Martin Baulig <martin@gnome.org>
18056 * class.cs (MethodBase): New abstract class. This is now a base
18057 class for Property, Indexer and Event to avoid some code duplication
18058 in their Define() and DefineMethods() methods.
18059 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
18060 generic methods for Define() and DefineMethods().
18061 (FieldBase): Derive from MemberBase, not MemberCore.
18062 (Property): Derive from MemberBase, not MemberCore.
18063 (Property.DefineMethod): Moved all the code from this method to the
18064 new MethodBase.DefineAccessor(), just call it with appropriate
18066 (Property.Define): Call the new Property.DoDefine(), this does some
18067 sanity checks and we don't need to duplicate the code everywhere.
18068 (Event): Derive from MemberBase, not MemberCore.
18069 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
18070 accessors, this will also make them work with interface events.
18071 (Indexer): Derive from MemberBase, not MemberCore.
18072 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
18073 (Indexer.Define): Use the new MethodBase functions.
18075 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
18076 argument to the constructor.
18077 (Interface.FindMembers): Added support for interface events.
18078 (Interface.PopluateEvent): Implemented.
18080 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
18082 2002-07-22 Miguel de Icaza <miguel@ximian.com>
18084 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
18085 but this is required to check for a method name being the same as
18086 the containing class.
18090 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18092 * interface.cs: initialize variable.
18094 2002-07-23 Martin Baulig <martin@gnome.org>
18096 Implemented the IndexerName attribute in interfaces.
18098 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
18099 name if this is an explicit interface implementation.
18100 (Indexer.InterfaceIndexerName): New public variable. If we're
18101 implementing an interface indexer, this is the IndexerName in that
18102 interface. Otherwise, it's the IndexerName.
18103 (Indexer.DefineMethod): If we're implementing interface indexer,
18104 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
18105 and Pending.ImplementIndexer methods.
18106 (Indexer.Define): Also define the PropertyBuilder if we're
18107 implementing an interface indexer and this is neither an explicit
18108 interface implementation nor do the IndexerName match the one in
18111 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
18112 If a method is defined here, then we always need to create a proxy
18113 for it. This is used when implementing interface indexers.
18114 (Pending.IsInterfaceIndexer): New public method.
18115 (Pending.ImplementIndexer): New public method.
18116 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
18117 This is used when implementing interface indexers to define a proxy
18119 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
18120 define a proxy if necessary.
18122 * interface.cs (Interface.IndexerName): New public variable.
18123 (Interface.PopulateIndexer): Set the IndexerName.
18124 (Interface.DefineIndexers): New private method. Populate all the
18125 indexers and make sure their IndexerNames match.
18127 * typemanager.cs (IndexerPropertyName): Added support for interface
18130 2002-07-22 Martin Baulig <martin@gnome.org>
18132 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
18133 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
18134 ret if HasReturnLabel.
18135 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
18138 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
18139 and set the ec.LoopBeginTryCatchLevel.
18140 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
18141 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
18142 the current ec.TryCatchLevel, the branch goes out of an exception
18143 block. In this case, we need to use Leave and not Br.
18145 2002-07-22 Martin Baulig <martin@gnome.org>
18147 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
18148 block unless the block does not always return or it is contained in
18149 another try { ... } catch { ... } block. Fixes bug #26506.
18150 Added verify-1.cs to the test suite.
18152 2002-07-22 Martin Baulig <martin@gnome.org>
18154 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
18155 then we do not always return. Fixes bug #24985.
18157 2002-07-22 Martin Baulig <martin@gnome.org>
18159 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
18160 lookup on a per-class level; ie. walk up the class hierarchy until we
18161 found at least one applicable method, then choose the best among them.
18162 Fixes bug #24463 and test-29.cs.
18164 2002-07-22 Martin Baulig <martin@gnome.org>
18166 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
18167 return types of the methods. The return type is not part of the
18168 signature and we must not check it to make the `new' modifier work.
18169 Fixes bug #27999, also added test-147.cs.
18170 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
18172 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
18173 on the method's return type.
18175 2002-07-21 Martin Baulig <martin@gnome.org>
18177 * assign.cs: Make this work if the rightmost source is a constant and
18178 we need to do an implicit type conversion. Also adding a few more tests
18179 to test-38.cs which should have caught this.
18181 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
18182 target in the makefile for this. The makefile.gnu is primarily intended
18183 for end-users who don't want to debug the compiler.
18185 2002-07-21 Martin Baulig <martin@gnome.org>
18187 * assign.cs: Improved the Assign class so it can now handle embedded
18188 assignments (X = Y = Z = something). As a side-effect this'll now also
18189 consume less local variables. test-38.cs now passes with MCS, added
18190 a few new test cases to that test.
18192 2002-07-20 Martin Baulig <martin@gnome.org>
18194 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
18195 instructions. Fixes bug #27977, also added test-146.cs.
18197 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18199 * cs-tokenizer.cs: fixed getHex ().
18201 2002-07-19 Martin Baulig <martin@gnome.org>
18203 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
18204 not Type.GetType() to lookup the array type. This is needed when
18205 we're constructing an array of a user-defined type.
18206 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
18207 single-dimensional arrays, but also for single-dimensial arrays of
18210 2002-07-19 Martin Baulig <martin@gnome.org>
18212 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
18213 this function is called, it's not allowed to share LocalBuilders
18214 among ILGenerators.
18216 2002-07-19 Martin Baulig <martin@gnome.org>
18218 * expression.cs (Argument.Resolve): Report an error 118 when trying
18219 to pass a type as argument.
18221 2002-07-18 Martin Baulig <martin@gnome.org>
18223 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
18224 Conv_R_Un for the signed `long' type.
18226 2002-07-15 Miguel de Icaza <miguel@ximian.com>
18228 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
18229 `expr' for the temporary result, as that will fail if we do
18230 multiple resolves on the same expression.
18232 2002-07-05 Miguel de Icaza <miguel@ximian.com>
18234 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
18235 ec.TypeContainer for looking up aliases.
18237 * class.cs (TypeContainer): Remove LookupAlias from here.
18239 * decl.cs (DeclSpace); Move here.
18241 2002-07-01 Miguel de Icaza <miguel@ximian.com>
18243 * class.cs (FindMembers): Only call filter if the constructor
18244 bulider is not null.
18246 Also handle delegates in `NestedTypes' now. Now we will perform
18247 type lookups using the standard resolution process. This also
18250 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
18251 This uses Expressions (the limited kind that can be parsed by the
18252 tree) instead of strings.
18254 * expression.cs (ComposedCast.ToString): Implement, used to flag
18255 errors since now we have to render expressions.
18257 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
18260 * ecore.cs (SimpleName.ToString): ditto.
18262 * cs-parser.jay: Instead of using strings to assemble types, use
18263 Expressions to assemble the type (using SimpleName, ComposedCast,
18264 MemberAccess). This should fix the type lookups in declarations,
18265 because we were using a different code path for this.
18267 * statement.cs (Block.Resolve): Continue processing statements
18268 even when there is an error.
18270 2002-07-17 Miguel de Icaza <miguel@ximian.com>
18272 * class.cs (Event.Define): Also remove the `remove' method from
18273 the list of pending items.
18275 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
18276 generate more compact code.
18278 2002-07-17 Martin Baulig <martin@gnome.org>
18280 * const.cs (Const.LookupConstantValue): Add support for constant
18281 `unchecked' and `checked' expressions.
18282 Also adding test case test-140.cs for this.
18284 2002-07-17 Martin Baulig <martin@gnome.org>
18286 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
18287 check whether mi.ReturnType implements the IEnumerator interface; the
18288 `==' and the IsAssignableFrom() will fail in this situation.
18290 2002-07-16 Ravi Pratap <ravi@ximian.com>
18292 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
18295 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18297 * expression.cs: fixed bug #27811.
18299 2002-07-14 Miguel de Icaza <miguel@ximian.com>
18301 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
18302 Molaro: when we are a ref, the value already contains a pointer
18303 value, do not take the address of it.
18305 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18306 * removed mb-parser.jay and mb-tokenizer.cs
18308 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18310 * expression.cs: check against the building corlib void type.
18312 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
18314 * ecore.cs: fix for valuetype static readonly fields: when
18315 initializing them, we need their address, not the address of a copy.
18317 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
18319 * typemanager.cs: register also enum_type in corlib.
18321 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18323 * class.cs: allow calling this (but not base) initializers in structs.
18325 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
18327 * ecore.cs: make sure we compare against the building base types
18330 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
18332 * typemanager.cs: fix TypeToCoreType() to handle void and object
18333 (corlib gets no more typerefs after this change).
18335 2002-07-12 Miguel de Icaza <miguel@ximian.com>
18337 * expression.cs (ArrayCreation.EmitArrayArguments): use
18338 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
18340 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
18341 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
18342 array indexes, the runtime actually forbids them.
18344 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
18345 for array arguments here.
18347 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
18348 instead of the default for ValueTypes.
18350 (New.DoEmit): Use IsValueType instead of
18351 IsSubclassOf (value_type)
18352 (New.DoResolve): ditto.
18353 (Invocation.EmitCall): ditto.
18355 * assign.cs (Assign): ditto.
18357 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
18358 Statements *are* currently doing part of their resolution during
18361 Expressions do always resolve during resolve, but statements are
18362 only required to propagate resolution to their children.
18364 2002-07-11 Miguel de Icaza <miguel@ximian.com>
18366 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
18368 (LoadAssembly): Do not add the dll if it is already specified
18370 (MainDriver): Add the System directory to the link path at the end,
18371 after all the other -L arguments.
18373 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
18374 wrong opcode for loading bytes and bools (ldelem.i1 instead of
18375 ldelem.u1) and using the opposite for sbytes.
18377 This fixes Digger, and we can finally run it.
18379 * driver.cs (UnixParseOption): Move the option parsing here.
18380 (CSCParseOption): Implement CSC-like parsing of options.
18382 We now support both modes of operation, the old Unix way, and the
18383 new CSC-like way. This should help those who wanted to make cross
18384 platform makefiles.
18386 The only thing broken is that /r:, /reference: and /lib: are not
18387 implemented, because I want to make those have the same semantics
18388 as the CSC compiler has, and kill once and for all the confussion
18389 around this. Will be doing this tomorrow.
18391 * statement.cs (Unsafe.Resolve): The state is checked during
18392 resolve, not emit, so we have to set the flags for IsUnsfe here.
18394 2002-07-10 Miguel de Icaza <miguel@ximian.com>
18396 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
18397 not catch the Error_ObjectRefRequired in SimpleName (as it is
18398 possible to have a class/instance variable name that later gets
18399 deambiguated), we have to check this here.
18401 2002-07-10 Ravi Pratap <ravi@ximian.com>
18403 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
18404 make static and put into Expression.
18406 (Event.Define): Register the private field of the event with the
18407 TypeManager so that GetFieldFromEvent can get at it.
18409 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
18410 keep track of the private field associated with an event which
18413 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
18416 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
18418 2002-07-10 Miguel de Icaza <miguel@ximian.com>
18420 * expression.cs (Binary.EmitBranchable): this routine emits the
18421 Binary expression in a branchable context. This basically means:
18422 we need to branch somewhere, not just get the value on the stack.
18424 This works together with Statement.EmitBoolExpression.
18426 * statement.cs (Statement.EmitBoolExpression): Use
18429 2002-07-09 Miguel de Icaza <miguel@ximian.com>
18431 * statement.cs (For): Reduce the number of jumps in loops.
18433 (For): Implement loop inversion for the For statement.
18435 (Break): We can be breaking out of a Try/Catch controlled section
18436 (foreach might have an implicit try/catch clause), so we need to
18437 use Leave instead of Br.
18439 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
18440 now). If the instace expression supports IMemoryLocation, we use
18441 the AddressOf method from the IMemoryLocation to extract the
18442 address instead of emitting the instance.
18444 This showed up with `This', as we were emitting the instance
18445 always (Emit) instead of the Address of This. Particularly
18446 interesting when This is a value type, as we dont want the Emit
18447 effect (which was to load the object).
18449 2002-07-08 Miguel de Icaza <miguel@ximian.com>
18451 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
18453 * statement.cs (Checked): Set the CheckedState during the resolve
18454 process too, as the ConvCast operations track the checked state on
18455 the resolve process, and not emit.
18457 * cs-parser.jay (namespace_member_declaration): Flag that we have
18458 found a declaration when we do. This is used to flag error 1529
18460 * driver.cs: Report ok when we display the help only.
18462 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
18464 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
18466 2002-07-04 Miguel de Icaza <miguel@ximian.com>
18468 * cs-tokenizer.cs (define): We also have to track locally the
18469 defines. AllDefines is just used for the Conditional Attribute,
18470 but we also need the local defines for the current source code.
18472 2002-07-03 Miguel de Icaza <miguel@ximian.com>
18474 * statement.cs (While, For, Do): These loops can exit through a
18475 Break statement, use this information to tell whether the
18476 statement is the last piece of code.
18478 (Break): Flag that we break.
18480 * codegen.cs (EmitContexts): New `Breaks' state variable.
18482 2002-07-03 Martin Baulig <martin@gnome.org>
18484 * class.cs (TypeContainer.MethodModifiersValid): Allow override
18485 modifiers in method declarations in structs. Otherwise, you won't
18486 be able to override things like Object.Equals().
18488 2002-07-02 Miguel de Icaza <miguel@ximian.com>
18490 * class.cs (Method, Property, Indexer): Do not allow the public
18491 modifier to be used in explicit interface implementations.
18493 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
18494 override modifiers in method declarations in structs
18496 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
18498 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
18499 integer or real overflow, report an error
18501 2002-07-02 Martin Baulig <martin@gnome.org>
18503 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
18504 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
18505 to tell the runtime about our newly created System.Object and
18506 System.ValueType types.
18508 2002-07-02 Miguel de Icaza <miguel@ximian.com>
18510 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
18511 struct instead of Ldarg/Starg.
18513 2002-07-02 Martin Baulig <martin@gnome.org>
18515 * expression.cs (Indirection.Indirection): Call
18516 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
18518 2002-07-02 Martin Baulig <martin@gnome.org>
18520 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
18521 ValueType, call TypeManager.TypeToCoreType() on it.
18522 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
18523 the OpCodes.Newarr argument.
18525 2002-07-02 Martin Baulig <martin@gnome.org>
18527 * expression.cs (Invocation.EmitCall): When compiling corlib,
18528 replace all calls to the system's System.Array type to calls to
18529 the newly created one.
18531 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
18532 System.Array methods.
18533 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
18534 from the system's System.Array type which must be replaced.
18536 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
18538 * typemanager.cs: load unverifiable_code_ctor so we can build
18539 corlib using the correct type. Avoid using GetTypeCode() with
18541 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
18542 TypeManager.object_type to allow building corlib.
18544 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
18546 * ecore.cs: handle System.Enum separately in LoadFromPtr().
18548 2002-07-01 Martin Baulig <martin@gnome.org>
18550 * class.cs: Make the last change actually work, we need to check
18551 whether `ifaces != null' to avoid a crash.
18553 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18555 * class.cs: when we build structs without fields that implement
18556 interfaces, we need to add the interfaces separately, since there is
18557 no API to both set the size and add the interfaces at type creation
18560 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18562 * expression.cs: the dimension arguments to the array constructors
18563 need to be converted if they are a long.
18565 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
18567 * class.cs: don't emit ldarg.0 if there is no parent constructor
18568 (fixes showstopper for corlib).
18570 2002-06-29 Martin Baulig <martin@gnome.org>
18572 MCS now compiles corlib on GNU/Linux :-)
18574 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
18575 ie. check for MethodImplOptions.InternalCall.
18577 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
18578 and TypeManager.attribute_type are null, so we must explicitly check
18579 whether parent is not null to find out whether it's an attribute type.
18580 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
18581 and SetBuilder, not only if the property is neither abstract nor external.
18582 This is necessary to set the MethodImplOptions on the accessor methods.
18583 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
18584 SetBuilder, see Property.Emit().
18586 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
18587 populate "System.Object", "System.ValueType" and "System.Attribute" since
18588 they've already been populated from BootCorlib_PopulateCoreTypes().
18590 2002-06-29 Martin Baulig <martin@gnome.org>
18592 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
18593 is the NullLiteral, we also need to make sure that target_type is not
18596 2002-06-29 Martin Baulig <martin@gnome.org>
18598 * rootcontext.cs (RootContext.ResolveCore): We must initialize
18599 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
18600 before calling BootstrapCorlib_ResolveDelegate ().
18602 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18604 * statement.cs: fixed build-breaker. All tests passed ok.
18606 2002-06-27 Martin Baulig <martin@gnome.org>
18608 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
18609 for System.Decimal when compiling corlib.
18611 2002-06-27 Martin Baulig <martin@gnome.org>
18613 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
18614 switch blocks which contain nothing but a default clause.
18616 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
18618 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
18620 2002-06-27 Martin Baulig <martin@gnome.org>
18622 * ecore.cs (PropertyExpr.PropertyExpr): Call
18623 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
18625 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
18626 is already a TypeBuilder.
18628 2002-06-27 Martin Baulig <martin@gnome.org>
18630 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
18631 `target_type == TypeManager.array_type', not IsAssignableFrom() in
18632 the "from an array-type to System.Array" case. This makes it work
18633 when compiling corlib.
18635 2002-06-27 Martin Baulig <martin@gnome.org>
18637 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
18638 non-static PropertyExpr, set its InstanceExpression. This makes
18639 the `ICollection.Count' property work in System/Array.cs.
18641 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
18643 * driver.cs: Made error handling more consistent. Errors now
18644 tracked by Report class, so many methods which used to return int
18645 now return void. Main() now prints success/failure and
18646 errors/warnings message.
18648 Renamed '--probe' compiler argument to '--expect-error'. Removed
18649 the magic number return values (123 and 124). Now, if the
18650 expected error occurs, the compiler exits with success (exit value
18651 0). If the compilation completes without seeing that particular
18652 error, the compiler exits with failure (exit value 1). The
18653 makefile in mcs/errors has been changed to handle the new behaviour.
18655 * report.cs: Made 'expected error' number a property and renamed
18656 it from 'Probe' to 'ExpectedError'.
18658 * genericparser.cs: Removed error handling support, since it is
18659 now all done by Report class.
18661 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
18662 class, so parse() no longer returns an int.
18664 * namespace.cs: Use Report.Error instead of GenericParser.error
18666 2002-06-22 Miguel de Icaza <miguel@ximian.com>
18668 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
18669 TypeContainer.AddOperator): At the front of the list put the
18670 explicit implementations, so they get resolved/defined first.
18672 2002-06-21 Miguel de Icaza <miguel@ximian.com>
18674 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
18675 interface type is implemented by this TypeContainer. Used during
18676 explicit interface implementation.
18678 (Property.Define, Indexer.Define, Method.Define): Validate that
18679 the given interface in the explicit implementation is one of the
18680 base classes for the containing type.
18682 Also if we are explicitly implementing an interface, but there is
18683 no match in the pending implementation table, report an error.
18685 (Property.Define): Only define the property if we are
18686 not explicitly implementing a property from an interface. Use the
18687 correct name also for those properties (the same CSC uses,
18688 although that is really not needed).
18690 (Property.Emit): Do not emit attributes for explicitly implemented
18691 properties, as there is no TypeBuilder.
18693 (Indexer.Emit): ditto.
18695 Hiding then means that we do not really *implement* a pending
18696 implementation, which makes code fail.
18698 2002-06-22 Martin Baulig <martin@gnome.org>
18700 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
18701 the return value of Object.GetType(). [FIXME: we need to do this whenever
18702 we get a type back from the reflection library].
18704 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
18706 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
18708 2002-06-20 Miguel de Icaza <miguel@ximian.com>
18710 * attribute.cs: Return null if we can not look up the type.
18712 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
18713 the interface types found.
18715 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
18716 interface types found.
18718 * typemanager.cs (GetInterfaces): Make this routine returns alll
18719 the interfaces and work around the lame differences between
18720 System.Type and System.Reflection.Emit.TypeBuilder in the results
18721 result for GetInterfaces.
18723 (ExpandInterfaces): Given an array of interface types, expand and
18724 eliminate repeated ocurrences of an interface. This expands in
18725 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
18728 2002-06-21 Martin Baulig <martin@gnome.org>
18730 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
18733 2002-06-21 Martin Baulig <martin@gnome.org>
18735 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
18736 and called with one of the core types, return the corresponding typebuilder for
18739 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18742 2002-06-21 Martin Baulig <martin@gnome.org>
18744 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18745 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18746 (Expression.ConvertReferenceExplicit): Likewise.
18748 * expression.cs (ElementAccess.DoResolve): Likewise.
18749 (ElementAccess.DoResolveLValue): Likewise.
18751 2002-06-10 Martin Baulig <martin@gnome.org>
18753 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18754 add the "value" parameter to the parameter list.
18756 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18759 2002-06-19 Miguel de Icaza <miguel@ximian.com>
18761 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18762 the argument to an int, uint, long or ulong, per the spec. Also
18763 catch negative constants in array creation.
18765 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18767 * class.cs: do not allow the same interface to appear twice in
18768 the definition list.
18770 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18772 * ecore.cs: don't use ldlen with System.Array.
18774 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18776 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18778 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18780 * modifiers.cs: produce correct field attributes for protected
18781 internal. Easy fix so miguel can work on ther harder stuff:-)
18783 2002-06-18 Miguel de Icaza <miguel@ximian.com>
18785 * pending.cs: New file. Move the code from class.cs here.
18786 Support clearning the pending flag for all methods (when not doing
18787 explicit interface implementation).
18789 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18791 * rootcontext.cs: added a couple more types needed to bootstrap.
18793 2002-06-17 Miguel de Icaza <miguel@ximian.com>
18795 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18796 constructor in the type, instead of any constructor in the type
18797 hierarchy. Thanks to Paolo for finding this bug (it showed up as
18798 a bug in the Mono runtime when applying the params attribute).
18800 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18801 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18803 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
18805 * expression.cs (Unary.ResolveOperator): Use TypeManager
18806 to resolve the type.
18808 2002-06-13 Ravi Pratap <ravi@ximian.com>
18810 * cs-parser.jay (enum_member_declaration): Pass in the attributes
18813 * enum.cs (AddEnumMember): Add support to store the attributes associated
18814 with each member too.
18816 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18817 field builders too - this takes care of the enum member case.
18819 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
18821 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
18822 address-of operator on both value types and pointers.
18824 2002-06-10 Martin Baulig <martin@gnome.org>
18826 * interface.cs (Interface.PopulateIndexer): Add the indexer's
18827 PropertyBuilder to the `property_builders' list.
18829 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
18830 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
18831 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
18832 find any indexers which are inherited from an interface.
18834 2002-06-09 Martin Baulig <martin@gnome.org>
18836 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
18837 the same type as the constant if necessary. There's also a test-130.cs
18840 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
18842 * typemanager.cs (TypeManager.ChangeType): Previously known as
18843 Enum.ChangeEnumType().
18845 2002-06-09 Martin Baulig <martin@gnome.org>
18847 * expression.cs (Cast.TryReduce): Added support for consts.
18849 2002-06-08 Ravi Pratap <ravi@ximian.com>
18851 * class.cs (Accessor): Hold attributes information so we can pass
18854 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18855 Modify to pass in attributes attached to the methods.
18857 (add_accessor_declaration, remove_accessor_declaration): Ditto.
18859 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18860 to handle the Accessor kind :-)
18862 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18864 2002-06-08 Martin Baulig <martin@gnome.org>
18866 * expression.cs (Unary.TryReduceNegative): Added support for
18869 2002-06-08 Martin Baulig <martin@gnome.org>
18871 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18872 name can't be found in the `defined_names' - the caller will do a
18873 MemberLookup in this case and thus find methods in System.Enum
18874 such as Enum.IsDefined().
18876 2002-06-08 Martin Baulig <martin@gnome.org>
18878 * enum.cs (Enum.ChangeEnumType): This is a custom version of
18879 Convert.ChangeType() which works with TypeBuilder created types.
18880 (Enum.LookupEnumValue, Enum.Define): Use it here.
18882 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18883 `TypeBuilder.BaseType != null' check.
18884 (TypeContainer.FindMembers): Only lookup parent members if we
18885 actually have a parent.
18886 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18887 (ConstructorInitializer.Resolve): Likewise.
18889 * interface.cs (Interface.FindMembers): Added
18890 `TypeBuilder.BaseType != null' check.
18892 * rootcontext.cs (RootContext.ResolveCore): Added
18893 "System.Runtime.CompilerServices.IndexerNameAttribute" to
18894 classes_second_stage.
18896 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18897 debug_type and trace_type when compiling with --nostdlib.
18899 2002-06-07 Martin Baulig <martin@gnome.org>
18901 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18902 (AddField): Set it to true when adding a non-static field.
18903 (DefineType): Use `have_nonstatic_fields' to find out whether we
18904 have non-static fields, not `Fields != null'.
18906 2002-06-02 Miguel de Icaza <miguel@ximian.com>
18908 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18909 dereferencing a null on the static-field code path)
18911 2002-05-30 Martin Baulig <martin@gnome.org>
18913 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18914 to take command line arguments. Use reflection to call the new
18915 custom `Initialize' function on the symbol writer and pass it the
18916 command line arguments.
18918 * driver.cs (--debug-args): New command line argument to pass command
18919 line arguments to the symbol writer.
18921 2002-05-28 Miguel de Icaza <miguel@ximian.com>
18923 * assign.cs (DoResolve): Forgot to do the implicit conversion to
18924 the target type for indexers and properties. Thanks to Joe for
18927 2002-05-27 Miguel de Icaza <miguel@ximian.com>
18929 * typemanager.cs (MethodFlags): returns the method flags
18930 (Obsolete/ShouldIgnore) that control warning emission and whether
18931 the invocation should be made, or ignored.
18933 * expression.cs (Invocation.Emit): Remove previous hack, we should
18934 not do this on matching a base type, we should do this based on an attribute
18936 Only emit calls to System.Diagnostics.Debug and
18937 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18938 on the command line.
18940 * rootcontext.cs: Global settings for tracing and debugging.
18942 * cs-tokenizer.cs (define): New utility function to track
18943 defines. Set the global settings for TRACE and DEBUG if found.
18945 2002-05-25 Ravi Pratap <ravi@ximian.com>
18947 * interface.cs (Populate*): Pass in the TypeContainer as well as
18948 the DeclSpace as parameters so that we can create EmitContexts and
18949 then use that to apply attributes etc.
18951 (PopulateMethod, PopulateEvent, PopulateProperty)
18952 (PopulateIndexer): Apply attributes everywhere.
18954 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18957 (ApplyAttributes): Update accordingly.
18959 We now apply interface attributes for all members too.
18961 2002-05-26 Miguel de Icaza <miguel@ximian.com>
18963 * class.cs (Indexer.Define); Correctly check if we are explicit
18964 implementation (instead of checking the Name for a ".", we
18965 directly look up if the InterfaceType was specified).
18967 Delay the creation of the PropertyBuilder.
18969 Only create the PropertyBuilder if we are not an explicit
18970 interface implementation. This means that explicit interface
18971 implementation members do not participate in regular function
18972 lookups, and hence fixes another major ambiguity problem in
18973 overload resolution (that was the visible effect).
18975 (DefineMethod): Return whether we are doing an interface
18978 * typemanager.cs: Temporary hack until we get attributes in
18979 interfaces (Ravi is working on that) and we get IndexerName
18980 support in interfaces.
18982 * interface.cs: Register the indexers as properties.
18984 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18985 warning, I have verified that this is a bug in the .NET runtime
18986 (JavaScript suffers of the same problem).
18988 * typemanager.cs (MemberLookup): When looking up members for
18989 interfaces, the parent of an interface is the implicit
18990 System.Object (so we succeed in searches of Object methods in an
18991 interface method invocation. Example: IEnumerable x; x.ToString
18994 2002-05-25 Miguel de Icaza <miguel@ximian.com>
18996 * class.cs (Event): Events should also register if they do
18997 implement the methods that an interface requires.
18999 * typemanager.cs (MemberLookup); use the new GetInterfaces
19002 (GetInterfaces): The code used to lookup interfaces for a type is
19003 used in more than one place, factor it here.
19005 * driver.cs: Track the errors at the bottom of the file, we kept
19008 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
19009 instance if the method we are calling is static!
19011 2002-05-24 Miguel de Icaza <miguel@ximian.com>
19013 * attribute.cs (ApplyAttributes): Make this function filter out
19014 the IndexerName attribute (as that attribute in reality is never
19015 applied) and return the string constant for the IndexerName
19018 * class.cs (TypeContainer.Emit): Validate that all the indexers
19019 have the same IndexerName attribute, and if so, set the
19020 DefaultName attribute on the class.
19022 * typemanager.cs: The return value might contain other stuff (not
19023 only methods). For instance, consider a method with an "Item"
19024 property and an Item method.
19026 * class.cs: If there is a problem with the parameter types,
19029 2002-05-24 Ravi Pratap <ravi@ximian.com>
19031 * ecore.cs (ImplicitConversionExists): Wrapper function which also
19032 looks at user defined conversion after making a call to
19033 StandardConversionExists - we need this for overload resolution.
19035 * expression.cs : Update accordingly the various method calls.
19037 This fixes 2 bugs filed against implicit user defined conversions
19039 2002-05-22 Miguel de Icaza <miguel@ximian.com>
19041 * statement.cs: Track the result of the assignment.
19043 2002-05-21 Miguel de Icaza <miguel@ximian.com>
19045 * expression.cs (MemberAccess): Improved error reporting for
19046 inaccessible members.
19048 2002-05-22 Martin Baulig <martin@gnome.org>
19050 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
19051 itself with debugging support.
19053 2002-05-22 Martin Baulig <martin@gnome.org>
19055 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
19056 Removed, this isn't needed anymore.
19058 2002-05-20 Martin Baulig <martin@gnome.org>
19060 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
19061 be underlying type for an enum.
19063 2002-05-20 Miguel de Icaza <miguel@ximian.com>
19065 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
19066 that splits out the loading of just the core types.
19068 * rootcontext.cs (ResolveCore): Split the struct resolution in
19069 two, so we can load the enumeration underlying types before any
19072 * expression.cs (Is): Bandaid until we fix properly Switch (see
19073 bug #24985 for details).
19075 * typemanager.cs (ImplementsInterface): The hashtable will contain
19076 a null if there are no interfaces implemented.
19078 2002-05-18 Miguel de Icaza <miguel@ximian.com>
19080 * cs-parser.jay (indexer_declarator): It is fine to have array
19083 2002-05-17 Miguel de Icaza <miguel@ximian.com>
19085 * typemanager.cs: (RegisterBuilder): New function used to register
19086 TypeBuilders that implement interfaces. Since
19087 TypeBuilder.GetInterfaces (as usual) does not work with lame
19089 (AddUserType): register interfaces.
19091 (ImplementsInterface): Use the builder_to_ifaces hash if we are
19092 dealing with TypeBuilder. Also, arrays are showing up as
19093 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
19094 methods can not be invoked on them!
19096 * ecore.cs (ExplicitReferenceConversionExists): Made public.
19097 (ImplicitReferenceConversionExists): Split out from
19098 StandardConversionExists.
19100 * expression.cs (As): We were only implementing one of the three
19101 cases for the as operator. We now implement them all.
19102 (Is): Implement the various other cases for Is as well.
19104 * typemanager.cs (CACHE): New define used to control if we want or
19105 not the FindMembers cache. Seems to have a negative impact on
19106 performance currently
19108 (MemberLookup): Nested types have full acess to
19109 enclosing type members
19111 Remove code that coped with instance/static returns for events, we
19112 now catch this in RealFindMembers.
19114 (RealFindMembers): only perform static lookup if the instance
19115 lookup did not return a type or an event.
19117 2002-05-17 Miguel de Icaza <miguel@ximian.com>
19119 * assign.cs (CompoundAssign): We pass more semantic information
19120 now to Compound Assignments than we did before: now we have all
19121 the information at hand, and now we resolve the target *before* we
19122 do the expression expansion, which allows the "CacheValue" method
19123 to have the effect we intended (before, a [x] += 1 would generate
19124 two differen ArrayAccess expressions from the ElementAccess,
19125 during the resolution process).
19127 (CompoundAssign.DoResolve): Resolve target and original_source here.
19129 2002-05-16 Miguel de Icaza <miguel@ximian.com>
19131 * expression.cs (ArrayAccess): dropped debugging information.
19133 * typemanager.cs: Small bug fix: I was always returning i_members,
19134 instead of one of i_members or s_members (depending on which had
19137 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
19138 method is invoked before any code generation takes place, and it
19139 is a mechanism to inform that the expression will be invoked more
19140 than once, and that the method should use temporary values to
19141 avoid having side effects
19143 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
19145 * ecore.cs (Expression.CacheTemporaries): Provide empty default
19148 * expression.cs (Indirection, ArrayAccess): Add support for
19149 CacheTemporaries in these two bad boys.
19151 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
19152 ldobj or ldind_ref.
19153 (StoreFromPtr): Handle stobj as well.
19155 * expression.cs (UnaryMutator): Share more code.
19157 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
19158 down: I was not tracking the Filter function as well, which
19159 was affecting the results of the cache.
19161 2002-05-15 Miguel de Icaza <miguel@ximian.com>
19163 * attribute.cs: Remove the hack to handle the CharSet property on
19166 2002-05-14 Miguel de Icaza <miguel@ximian.com>
19168 * attribute.cs (DoResolve): More uglyness, we now only try to
19169 resolve the attribute partially, to extract the CharSet
19170 information (only if we are a StructLayout attribute). Otherwise
19172 (GetExtraTypeInfo): Add some code to conditionally kill in the
19173 future this. I am more and more convinced that the .NET
19174 framework has special code to handle the attribute setting on
19177 * expression.cs (IsParamsMethodApplicable): Revert my previous
19178 foreach change here, it was wrong.
19180 2002-05-13 Miguel de Icaza <miguel@ximian.com>
19182 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
19183 (pp_expr): do not abort on unknown input, just return.
19184 (eval): abort if there are pending chars.
19186 * attribute.cs (Attribute.Resolve): Positional parameters are
19187 optional. Deal with that case.
19189 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
19190 the Ansi/Unicode/Auto information for the type.
19192 (TypeContainer.DefineType): instantiate the EmitContext here, as
19193 we will be using it during the type definition (to resolve
19194 attributes) and during the emit phase.
19196 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
19197 to pull type information out of the attributes
19199 (Attribute.Resolve): track the constructor builder, and allow for
19200 multiple invocations (structs and classes will use this).
19202 * ecore.cs (MemberLookupFinal): new version with all the
19203 parameters customizable.
19205 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
19206 constructors. Return if the result value is null (as the error
19207 would have been flagged already by MemberLookupFinal)
19209 Do not allow instances of abstract classes or interfaces to be
19212 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
19213 We have to compare the assembly property here when dealing with
19214 FamANDAssem and Assembly access modifiers, because we might be
19215 creating an assembly from *modules* (that means that we are not
19216 getting TypeBuilders for types defined in other modules that are
19217 part of this assembly).
19219 (Method.Emit): If the method is marked abstract and has a body,
19222 (TypeContainer.DefineMembers): If both the defined member and the
19223 parent name match are methods, then do not emit any warnings: let
19224 the Method.Define routine take care of flagging warnings. But if
19225 there is a mismatch (method overrides something else, or method is
19226 overriwritten by something, then emit warning).
19228 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
19229 set to null, this means `do not check for the return type on the
19232 (Method.Define): set the return type for the method signature to
19233 null, so that we get methods with the same name and parameters and
19234 different return types. This is used to flag warning 114 (you are
19235 hiding a method, and you probably want to use the new/override
19238 * typemanager.cs (MemberLookup): Implemented proper access
19239 control, closing a long standing set of bug reports. The problem
19240 was that the Framework only has two bits: Public and NonPublic,
19241 and NonPublic includes private and protected methods, but we need
19242 to enforce the FamANDAssem, FamOrAssem and Family.
19244 2002-05-11 Miguel de Icaza <miguel@ximian.com>
19246 * statement.cs (GotoCase): Return true: Ammounts to giving up
19247 knowledge on whether we return or not, and letting the other case
19248 be responsible for it.
19250 2002-05-10 Miguel de Icaza <miguel@ximian.com>
19252 * driver.cs: Do not load directories for each file processed, only
19253 do it if there is a pattern.
19255 * ecore.cs: Report readonly assigns here as well, as we might have
19256 been resolved only by MemberAccess.
19258 (SimpleName.SimpleNameResolve): Also be useful for LValue
19259 resolution. We need this to propagate assign to local readonly variables
19261 * typemanager.cs: Use a ptrhashtable for the criteria, because we
19262 do not want to reuse potential criteria memory.
19264 * class.cs (MyEventBuilder): Set reflected_type;
19266 * ecore.cs (Constantify): Added support for constifying bools.
19268 (RootContext.LookupType): Added a cache for values looked up in
19269 the declaration space.
19271 * typemanager.cs (FindMembers): Now is a front-end to
19272 RealFindMembers, and provides a two-level hashtable-based cache to
19275 15% performance improvement: from 22.5 to 19.2 seconds.
19277 * expression.cs (IsParamsMethodApplicable): use foreach.
19278 (Invocation.DoResolve): ditto.
19279 (New.DoResolve): ditto.
19280 (ArrayCreation.DoResolve): ditto.
19282 * ecore.cs (FindMostEncompassingType): use foreach.
19284 * delegate.cs (NewDelegate.DoResolve): Use foreach
19286 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
19287 (RemoveMethods): use foreach.
19289 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
19290 nested foreach statements instead of for, and also break out of
19291 the inner loop once a match is found.
19293 (Invocation.OverloadResolve): Use foreach, simplify the code.
19295 2002-05-08 Miguel de Icaza <miguel@ximian.com>
19297 * cfold.cs (BinaryFold): During an enumeration evaluation context,
19298 we actually unwrap the expression to allow for extra information
19301 * expression.cs: Use Shr_Un on unsigned operations.
19303 2002-05-08 Ravi Pratap <ravi@ximian.com>
19305 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
19306 applicable operators was not being considered correctly. This closes
19307 the bug Miguel reported.
19309 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
19311 * attribute.cs: check that the type derives from System.Attribute
19312 and report the correct error in that case (moved the duplicate code to
19313 its own method, too).
19315 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
19317 * attribute.cs: lookup attribute type name as the spec says: first the
19318 bare attribute name and then name + "Attribute" (nant compiles with
19319 mcs after this fix).
19321 2002-05-07 Miguel de Icaza <miguel@ximian.com>
19323 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
19324 Because of the way we parse things, we should try to see if a
19325 UIntConstant can fit in an integer.
19327 2002-05-07 Ravi Pratap <ravi@ximian.com>
19329 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
19330 when we are in an explicit context.
19332 (ConvertReferenceExplicit): When converting from Iface type S to Class
19333 T make sure the rules are implemented as an OR.
19335 * parameter.cs (ParameterType): Make it a property for now although the
19336 purpose really isn't anything immediate.
19338 * expression.cs (Is*Applicable): Do better checking on the parameter type
19339 of a ref/out parameter. The ones from the system assemblies are already
19340 marked with the correct type so we don't need to do any correction.
19342 * ecore.cs (StandardConversionExists): Conversion from Interface types to
19343 the object type is standard too so include that.
19345 2002-05-06 Miguel de Icaza <miguel@ximian.com>
19347 * ecore.cs (StandardConversionExists): Augment with missing code:
19348 deal with IntConstant, LongConstants and Enumerations.
19350 * assign.cs: Report the error, instead of failing silently
19352 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
19353 typecontainer that they are declared, because the
19354 typecontainer/namespace will have the list of using clauses that
19355 need to be applied.
19357 Assembly Attributes were escaping the normal registration
19360 (EmitCode): Apply attributes within an EmitContext that represents
19361 the container they were declared on.
19363 * cs-parser.jay: Track bases for structs. How did I get this wrong?
19365 2002-05-06 Ravi Pratap <ravi@ximian.com>
19367 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
19368 Revamp completely - make much cleaner as we now operate only
19371 (FindMostSpecificSource, FindMostSpecificTarget): New methods
19372 to implement the logic detailed in the spec more correctly.
19374 (UserDefinedConversion): Update accordingly.
19376 2002-05-06 Miguel de Icaza <miguel@ximian.com>
19378 * statement.cs: Return flow analysis information up.
19380 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
19383 (token): Do not consume an extra character before calling
19386 2002-05-06 Piers Haken <piersh@friskit.com>
19388 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
19390 2002-05-06 Miguel de Icaza <miguel@ximian.com>
19392 * class.cs (Constructor.Emit): Set the IsStatic flag in the
19393 EmitContext during the instance constructor initializer
19394 resolution, to stop access to instance variables.
19396 This is mandated by the spec, last paragraph of the `constructor
19397 initializers' section.
19399 2002-05-05 Miguel de Icaza <miguel@ximian.com>
19401 * cs-parser.jay, class.cs (Accessor): new class used to represent
19402 an accessor (get or set). In the past we used `null' to represent
19403 a missing accessor. But this is ambiguous because there was no
19404 way to tell in abstract indexers/properties if one of them was
19407 Now there is a way of addressing that.
19409 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
19410 instead of FindMembers.
19412 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
19413 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
19415 * attribute.cs: Treat indexers and properties as the same in terms
19416 of applying attributes
19418 * ecore.cs (FindMostEncompassedType): Use statically initialized
19419 EmptyExpressions()s like we do elsewhere to avoid creating useless
19420 objects (and we take this out of the tight loop).
19422 (GetConversionOperators): Move the code to extract the actual
19423 operators to a separate routine to clean things up.
19425 2002-05-04 Miguel de Icaza <miguel@ximian.com>
19427 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
19428 events are always registered FieldBuilders.
19430 * class.cs (FieldBase): New class shared by Fields
19432 * delegate.cs: If we are a toplevel delegate, use our full name.
19433 If we are a nested delegate, then only use our tail name.
19435 2002-05-02 Ravi Pratap <ravi@ximian.com>
19437 * expression.cs (IsApplicable): Ensure that we add the "&" to
19438 ref/out types before comparing it with the type of the argument.
19440 (IsParamsMethodApplicable): Ditto.
19442 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
19445 * delegate.cs : Handle the case when we have more than one applicable
19446 method. Flag an error only when we finish checking all.
19448 2002-05-02 Miguel de Icaza <miguel@ximian.com>
19450 * expression.cs: Add support for boolean static initializers.
19452 2002-05-01 Miguel de Icaza <miguel@ximian.com>
19454 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
19456 * parameter.cs (ComputeParameterTypes,
19457 ComputeAndDefineParameterTypes): Better error handling: now we
19458 clear the `types' cache if we fail during any of the type lookups.
19459 We also return the status code correctly to our caller
19461 * delegate.cs: If we fail to define a delegate, abort the extra
19464 * expression.cs (Binary.ResolveOperator): for
19465 operator==(object,object) and operator !=(object, object) we also
19466 have to verify that there is an implicit conversion from one to
19469 (ArrayAccess.DoResolve): Array Access can operate on
19472 2002-04-30 Miguel de Icaza <miguel@ximian.com>
19474 * assign.cs (CompoundAssign): A new class used as a "flag" that
19475 the assignment actually is happening as part of a compound
19476 assignment operator.
19478 During compound assignment, a few new rules exist to enable things
19485 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
19486 to the type of x) if y is implicitly convertible to the type of x,
19487 and the operator is a builtin operator and the return type of the
19488 operator is explicitly convertible to the type of x.
19490 * rootcontext.cs: Reset warning level to 2. 4 catches various
19491 "interesting" features in mcs, we must clean this up at some
19492 point, but currently am trying to kill other bugs ;-)
19494 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
19495 in container classes as well.
19497 * expression.cs (Binary.ResolveOperator): Handle string case
19498 before anything else (as operator overloading does emit an error
19499 before doing anything else).
19501 This code could go away when we move to a table driven model, but
19502 i could not come up with a good plan last night.
19504 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
19506 * typemanager.cs (CSharpName): reimplementation using regex.
19507 * class.cs: added null check for fields in Emit
19508 * rootcontext.cs: set warninglevel to 4
19510 2002-04-29 Miguel de Icaza <miguel@ximian.com>
19512 * typemanager.cs (CSharpName): reimplemented with Lupus
19515 2002-04-28 Miguel de Icaza <miguel@ximian.com>
19517 * statement.cs (If): correclty implement Resolve, because we were
19518 not catching sem errors in there. The same process is needed
19520 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
19523 (Statement.Warning_DeadCodeFound): Factorize code.
19524 (While): Report dead code here too.
19526 (Statement): Added Resolve virtual method to allow
19527 for resolution split from the emit code.
19529 2002-04-26 Miguel de Icaza <miguel@ximian.com>
19531 * statement.cs (EmitBoolExpression): No longer try to resolve the
19533 (MakeBoolean): New utility function that resolve, implicitly
19534 converts to boolean and tags the expression.
19537 (If, Do): Implement dead code elimination.
19538 (While): Implement loop inversion
19540 (Do, While, For, If): Resolve the expression prior to calling our
19543 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
19546 - added method Report28 (warning: program has more than one entry point)
19547 - added method IsEntryPoint, implements paragraph 10.1 of the spec
19548 - modified method Method.Define, the part at the end of the method
19550 * rootcontext.cs: added static public Location EntryPointLocation;
19552 * ../errors/cs0028.cs : Add test case for the above warning.
19555 - modified method CSharpName to allow arrays of primitive type to
19556 be printed nicely (e.g. instead of System.Int32[][] it now prints
19558 - added method CSharpSignature: returns the signature of a method
19559 in string format to be used in reporting errors, warnings, etc.
19561 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
19564 2002-04-26 Ravi Pratap <ravi@ximian.com>
19566 * delegate.cs (Define): Fix extremely silly bug where I was
19567 setting the type of the 'object' parameter of the BeginInvoke
19568 method to System.IAsyncResult instead of System.Object ;-)
19570 2002-04-26 Miguel de Icaza <miguel@ximian.com>
19572 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
19575 (Constructor.Emit): return if we fail to initialize the
19576 constructor. Another door closed!
19578 * expression.cs (New.DoResolve): Improve error message (from -6 to
19579 1501). Use DeclaredOnly lookup to find the exact constructor.
19581 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
19582 loop. This is useful.
19584 * cs-parser.jay: Adjust the default parameters so that destructors
19585 have the proper signature.
19587 2002-04-26 Martin Baulig <martin@gnome.org>
19589 * driver.cs (LoadAssembly): If `assembly' contains any characters
19590 which are only valid in path names and not in assembly names
19591 (currently slash, backslash and point), use Assembly.LoadFrom ()
19592 instead of Assembly.Load () on the `assembly' (before iteration
19593 over the link_paths).
19595 2002-04-26 Martin Baulig <martin@gnome.org>
19597 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
19599 2002-04-25 Miguel de Icaza <miguel@ximian.com>
19601 * class.cs (Property): use the new typemanager.MemberLookup
19603 (TypeContainer.MemberLookup): Implement using the
19604 TypeManager.MemberLookup now.
19606 * typemanager.cs: Make MemberLookup a function of the TypeManager,
19607 and return MemberInfos, so that these can be used without an
19608 EmitContext (what we had before).
19610 2002-04-24 Miguel de Icaza <miguel@ximian.com>
19612 * expression.cs: Fix the case where the argument to params if the
19613 type of the params. I omitted handling this before. Fixed
19615 2002-04-22 Miguel de Icaza <miguel@ximian.com>
19617 * driver.cs: Call BootCorlib_PopulateCoreType
19619 * class.cs (Property.CheckBase): Check for properties only, not
19622 * interface.cs: Temporary hack: try/catch around the
19623 CustomAttributeBuilder, because I am getting an exception that I
19626 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
19627 types whose definitions are required to be there (attributes are
19628 defined before standard types).
19630 Compute definitions as we boot the various types, as they are used
19631 immediately (value_type class will need object_type, but if we do
19632 not initialize object_type, we will pass a null, which will let
19633 the runtime pick the System.Object from the existing corlib, which
19634 is not what we want).
19636 2002-04-22 Patrik Torstensson <totte@labs2.com>
19638 * cs-tokenizer.cs: fixed a number of trim() issues.
19640 2002-04-22 Ravi Pratap <ravi@ximian.com>
19642 * expression.cs (Argument.Type): Ensure that we return the correct
19643 type when we have out or ref parameters [in which case we
19646 2002-04-22 Miguel de Icaza <miguel@ximian.com>
19648 * class.cs (Property, Indexer): Allow extern modifier in there.
19650 * typemanager.cs (InitBaseTypes): Initializes object_type and
19651 value_type, since those will be used early on during the bootstrap
19652 process to compile corlib.
19654 (InitCoreTypes): Move code from here to InitBaseTypes.
19656 2002-04-21 Miguel de Icaza <miguel@ximian.com>
19658 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
19659 single-dimension arrays as using the ldlen opcode.
19661 Daniel Lewis discovered this optimization.
19663 * typemanager.cs: Add signature for System.Array::get_Length
19665 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19667 * statement.cs: report the error when the foreach does not apply to an
19668 array nor a collection.
19670 2002-04-19 Miguel de Icaza <miguel@ximian.com>
19672 * expression.cs: Add implicit conversions to the operator ~.
19674 * constant.cs (DecimalConstant.Emit): Emit decimal value.
19676 * typemanager.cs: Locate the decimal constructor.
19678 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19680 * attribute.cs: use the new property of TypeOf.
19681 * expression.cs: added 'get' property around typearg.
19683 These changes fix a build breaker reported by NickD. Is this the
19684 correct way to fix? If not, please, revert my changes and make it
19687 2002-04-17 Miguel de Icaza <miguel@ximian.com>
19689 * attribute.cs: Add support for typeof in attribute invocations.
19690 I am not sure that this is right though.
19692 2002-04-14 Duncan Mak <duncan@ximian.com>
19694 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
19695 Binary.Operator.Division case.
19697 2002-04-13 Ravi Pratap <ravi@ximian.com>
19699 * class.cs (DefineType): Ensure that we do a proper check on
19700 attribute types and also register it with the TypeManager.
19702 (TypeContainer.Targets): The default for attribute types is
19703 AttributeTargets.All.
19705 * attribute.cs (ApplyAttributes): Registering the attribute type
19706 is done elsewhere, not when we discover we have a Usage attribute.
19708 2002-04-12 Ravi Pratap <ravi@ximian.com>
19710 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
19711 and get rid of is_delegate parameter.
19713 * everywhere : update.
19715 2002-04-12 Ravi Pratap <ravi@ximian.com>
19717 * cs-parser.jay (compilation_unit): Revamp completely to use
19718 some new ideas that I got from Rhys' grammar to solve the problems
19719 with assembly level attributes.
19721 (outer_declaration): New grammar production.
19723 (attribute_sections): Add.
19725 (opt_attributes): Base on attribute_sections
19727 (namespace_declaration): Allow opt_attributes to tackle the case
19728 when we have assembly level attributes - we are clever in this
19731 * attribute.cs (ApplyAttributes): Do not worry about assembly
19732 attributes in the non-global context.
19734 * rootcontext.cs (AddGlobalAttributes): Go back to using this
19735 instead of SetGlobalAttributes.
19737 * class.cs, rootcontext.cs : Ensure we define and generate
19738 attribute types before anything else.
19740 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19741 and flag the new error -20 for the case when the attribute type
19742 does not have valid targets specified. csc does not catch this.
19744 * ../errors/errors.txt : update for error # -20
19746 2002-04-11 Ravi Pratap <ravi@ximian.com>
19748 * support.cs (InternalParameters.ParameterModifier): Do some null
19749 checking and return sane values.
19751 * class.cs (Method.Define): If we are a PInvoke method, ensure
19752 that we are static and extern. Report error # 601
19754 * ../errors/cs0601.cs : Add test case for the above error.
19756 2002-04-07 Ravi Pratap <ravi@ximian.com>
19758 * rootcontext.cs (attribute_types): We need to keep type of
19759 all attribute types separately and emit code for them first.
19761 (RegisterAttribute) : Implement.
19763 * class.cs (DefineType): Check if the current Type is a custom
19764 attribute type and register it accordingly.
19766 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19767 adding the first attribute twice and rename to
19769 (SetGlobalAttributes): this.
19771 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19774 * attribute.cs (ApplyAttributes): Take an additional argument telling us
19775 if we are processing global arguments. Hmm, I am unsure of this.
19777 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19779 * expression.cs: added static array of strings to avoid calling
19780 Enum.ToString () for Operator in Binary. Significant recover of
19783 2002-04-10 Miguel de Icaza <miguel@ximian.com>
19785 * class.cs (FindMembers): Allow the Builders of the various
19786 members to be null. If they are skip them. This only happens
19787 during the PInvoke declaration.
19789 2002-04-09 Miguel de Icaza <miguel@ximian.com>
19791 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19792 failure, so we do not keep going afterwards.
19794 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19795 wanted to pass `false' as the `is_delegate' argument. If this is
19796 the case, why not use delegate_type == null to mean `is_delegate =
19797 false' and anything else as is_delegate = true.
19799 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
19801 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19802 code for the section, not the beginning of the tests.
19804 2002-04-08 Miguel de Icaza <miguel@ximian.com>
19806 * cfold.cs: Handle operator + (Enum x, Underlying x)
19808 * expression.cs (Binary): same. Warn about errors where we have
19809 Enum/Enum in operator + as well.
19811 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
19814 - added support for switch(bool)
19815 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19816 - add TableSwitchEmit() to handle table-based switch statements
19818 2002-04-05 Ravi Pratap <ravi@ximian.com>
19820 * expression.cs (Invocation.OverloadResolve): Factor out code which
19821 does parameter compatibility checking with arguments so that we can
19822 re-use the code even from Delegate.VerifyApplicability
19824 (VerifyArgumentsCompat): Move above code here.
19826 * delegate.cs (VerifyApplicability): Get rid of duplicate code
19827 and instead make a call to the above method.
19829 2002-03-31 Ravi Pratap <ravi@ximian.com>
19831 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
19832 We use it to keep track of classes which are attribute types.
19834 2002-04-02 Miguel de Icaza <miguel@ximian.com>
19836 * delegate.cs (Delegate.Define): Correctly define the types in the
19837 presence of fixed and array parameters.
19839 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
19842 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
19843 include NonPublic after the first iteration.
19845 * class.cs (Indexer.CheckBase): Only check if both parents are
19848 * cs-parser.jay (accessor_body): If empty, set to null.
19850 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19851 same code path here to resolve constants names that we did have in
19852 MemberAccess.DoResolve. There is too much code duplicated here.
19854 2002-04-01 Miguel de Icaza <miguel@ximian.com>
19856 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19858 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19861 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19862 tokens, numbers and strings.
19864 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19867 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19868 asyncronous parameters and the regular parameters.
19870 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19871 specify the target directory.
19873 * expression.cs: (This.DoResolve): Simplify
19874 (As.Emit): Optimize, do not generate IsInst if the expression is
19875 always of the given type.
19877 (Is.DoResolve): Bug fix, we were reporting both always/never for
19880 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19881 creating too many unnecessary arrays.
19883 2002-03-31 Miguel de Icaza <miguel@ximian.com>
19885 * class.cs (EmitFieldInitializer): Use Assign expression to assign
19886 fields instead of rolling our own initializer. Takes care of all
19887 implicit conversions, and drops unnecessary static checks/argument.
19889 2002-03-31 Dick Porter <dick@ximian.com>
19891 * driver.cs: use the GetDirectories() return values properly, and
19892 use "/" as path separator.
19894 2002-03-30 Miguel de Icaza <miguel@ximian.com>
19896 * expression.cs (Unary): Optimize - - expr into expr.
19897 (Binary): Optimize a + (-b) into a -b.
19899 * codegen.cs (CodeGen): Made all methods static.
19901 2002-03-29 Miguel de Icaza <miguel@ximian.com>
19905 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19906 TypeBuilder property.
19908 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19911 * tree.cs: Removed the various RecordXXXX, and replaced with a
19912 single RecordDecl. Removed all the accessor methods, and just
19913 left a single access point Type
19915 * enum.cs: Rename DefineEnum to DefineType.
19917 * decl.cs: New abstract method `DefineType' used to unify the
19918 Defines for Enumerations, Interfaces, TypeContainers and
19921 (FindType): Moved LookupInterfaceOrClass here. Moved the
19922 LookupBaseClasses method that used to live in class.cs and
19923 interface.cs here, and renamed to FindType.
19925 * delegate.cs: Implement DefineType. Take advantage of the
19926 refactored pattern for locating the parent builder without taking
19927 the parent_builder argument (which we know does not work if we are
19928 nested, and triggering a toplevel definition).
19930 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19932 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19933 accessibility of a member has changed during override and report
19936 * class.cs (Method.Define, Property.Define): Only complain on
19937 overrides if the method is private, any other accessibility is
19938 fine (and since we just checked the permission is the same, we are
19941 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19942 and elif are processed always. The other pre-processing
19943 directives are only processed if we are "taking" the path
19945 2002-03-29 Martin Baulig <martin@gnome.org>
19947 * class.cs (Method.Emit): Only emit symbolic debugging info if the
19948 current location is not Null.
19950 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19951 a separate method so we can profile it.
19953 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19954 `span.Seconds' are just seconds, but no minutes or hours.
19955 (MainDriver): Profile the CodeGen.SaveSymbols calls.
19957 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19959 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19960 Remove the gratuitous set of Final:
19962 // If an interface implementation, then we can set Final.
19963 if (((flags & MethodAttributes.Abstract) == 0) &&
19964 implementing.DeclaringType.IsInterface)
19965 flags |= MethodAttributes.Final;
19967 I do not know what I was smoking when I used that.
19970 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19971 step into fixing the name resolution issues for delegates and
19972 unifying the toplevel name resolution.
19974 2002-03-28 Martin Baulig <martin@gnome.org>
19976 * class.cs (Method.Emit): If we have a symbol writer, call its
19977 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19978 tell it about the current method.
19980 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19981 writer that we're going to emit the first byte of IL code for a new
19982 statement (a new source line).
19983 (EmitContext.EmitTopBlock): If we have a symbol writer, call
19984 EmitContext.Mark() before emitting any code.
19986 * location.cs (SymbolDocument): Return null when we're Null.
19988 * statement.cs (Statement): Moved the `Location loc' variable here.
19989 (Statement.EmitBoolExpression): If we have a symbol writer, call
19990 ec.Mark() before emitting any code to tell it that we're at the
19991 beginning of a new statement.
19992 (StatementExpression): Added `Location' argument to the constructor.
19993 (Block): Added public readonly variable `StartLocation' and public
19994 variable `EndLocation'. The latter is to be set using SetEndLocation().
19995 (Block): Added constructor which takes a start and end location.
19996 (Block.SetEndLocation): New method. This sets the end location.
19997 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19998 local variables we create.
19999 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
20000 each statement and do also mark the begin and end of the block.
20002 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
20003 tell it the current lexer.Location, use Location.Null for the end of the
20005 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
20006 current block, set its end location using SetEndLocation().
20007 (statement_expression): StatementExpression constructor now takes the
20008 lexer.Location as additional argument.
20009 (for_statement, declare_local_variables): Likewise.
20010 (declare_local_variables): When creating a new implicit block, use the
20011 new Block constructor and pass it the lexer.Location.
20013 2002-03-28 Miguel de Icaza <miguel@ximian.com>
20015 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
20016 members also on the parent interfaces recursively.
20018 2002-03-27 Miguel de Icaza <miguel@ximian.com>
20020 * report.cs: Use new formats, since Gonzalo finished the missing
20023 * expression.cs (Binary.ResolveOperator): added missing operator|
20024 operator& and operator^ for bool/bool.
20026 * cs-parser.jay: CheckDef now takes a Location argument that is
20027 used to report errors more precisly (instead of reporting the end
20028 of a definition, we try to track something which is a lot closer
20029 to the source of the problem).
20031 * cs-tokenizer.cs: Track global token use, so we can properly flag
20032 the use of #define/#undef after the first token has been seen.
20034 Also, rename the reportXXXX to Error_DescriptiveName
20036 * decl.cs (DeclSpace.IsTopLevel): Move property here from
20037 TypeContainer, so that Enum and Interface can use this too.
20039 * class.cs (TypeContainer.LookupInterfaceOrClass,
20040 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
20041 `builder' argument. Typically this was used to pass the parent
20042 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
20045 The problem is that a nested class could trigger the definition of
20046 a toplevel class, and the builder would be obviously wrong in that
20049 So we drop this argument, and we compute dynamically the
20050 TypeBuilder/ModuleBuilder (the correct information was available
20051 to us anyways from DeclSpace.Parent)
20053 * interface.cs (Interface.DefineInterface): Drop builder
20054 parameter cleanup like class.cs
20056 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
20059 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
20062 (Try.Emit): Propagate the returns value from the statement.
20064 (Return.Emit): Even if we are leavning
20066 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
20068 * modifiers.cs: Fix the computation of MethodAttributes flags.
20070 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
20072 * driver.cs: allow compilation of files that start with '/'.
20073 Add a default case when checking the argument of --target.
20075 2002-03-25 Miguel de Icaza <miguel@ximian.com>
20077 * interface.cs: Implement the same search algorithm for types in
20078 the interface code.
20080 * delegate.cs: Do not allow multiple definition.
20082 * Recovered ChangeLog that got accidentally amputated
20084 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
20086 * rootcontext.cs: Load manually enum to allow core classes to
20087 contain enumerations.
20089 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
20090 Update to new static methods in TypeManager.
20092 * typemanager.cs (GetMethod, GetConstructor): Use our
20093 implementation of FindMembers to find the members, since during
20094 corlib compilation, the types are TypeBuilders and GetMethod and
20095 GetConstructor do not work.
20097 Make all methods in TypeManager static.
20099 (InitCodeHelpers): Split the functionality from
20100 the InitCodeTypes function.
20102 * driver.cs: Call InitCodeHelpers after we have populated the
20105 * cs-parser.jay (delegate_declaration): we did not used to compute
20106 the delegate name correctly for void delegates.
20108 2002-03-24 Miguel de Icaza <miguel@ximian.com>
20110 * rootcontext.cs (RootContext): Init the interface_resolve_order
20111 and type_container_resolve_order always.
20113 (ResolveCore, BootstrapCorlib_ResolveClass,
20114 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
20115 compiler when compiling with --nostdlib
20117 * class.cs (TypeContainer.DefineType): Check that our parent is
20118 not null. This test is most important when we are bootstraping
20121 * codegen.cs: Split out the symbol writing code.
20123 2002-03-25 Martin Baulig <martin@gnome.org>
20125 * driver.cs (-g): Made -g an alias for --debug.
20127 2002-03-24 Martin Baulig <martin@gnome.org>
20129 * codegen.cs (SymbolWriter): New public variable. Returns the
20130 current symbol writer.
20131 (CodeGen): Added `bool want_debugging_support' argument to the
20132 constructor. If true, tell the ModuleBuild that we want debugging
20133 support and ask it for the ISymbolWriter.
20134 (Save): If we have a symbol writer, call it's Close() method after
20135 saving the assembly.
20137 * driver.c (--debug): New command line argument to create a
20138 debugger information file.
20140 * location.cs (SymbolDocument): New public property. Returns an
20141 ISymbolDocumentWriter object for the current source file or null
20142 if we don't have a symbol writer.
20144 2002-03-21 Miguel de Icaza <miguel@ximian.com>
20146 * driver.cs (LoadAssembly): Correctly return when all the paths
20147 have been tried and not before.
20149 * statement.cs (Switch.Emit): return the actual coverage for this
20150 statement (returns/not-returns)
20152 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
20153 switch of the statement if we are the last switch section. That
20154 kills two problems: try/catch problems (we used to emit an empty
20155 nop at the end) and switch statements where all branches would
20158 2002-03-19 Miguel de Icaza <miguel@ximian.com>
20160 * driver.cs: Add default assemblies (the equivalent to the
20161 Microsoft CSC.RSP file)
20163 * cs-tokenizer.cs: When updating `cols and setting it to zero,
20164 also update tokens_seen and set it to false.
20166 * driver.cs: Implement --recurse for Mike.
20168 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
20169 correctly splitting out the paths.
20171 2002-03-18 Miguel de Icaza <miguel@ximian.com>
20173 * interface.cs (Interface.PopulateProperty): Instead of using
20174 `parent' as the declaration space for the set parameters, use
20177 * support.cs (InternalParameters): InternalParameters constructor
20178 takes a DeclSpace instead of a TypeContainer.
20180 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
20181 types are being initialized, load the address of it before calling
20184 (New): Provide a mechanism to disable the generation of local
20185 value type temporaries when the caller will be providing us with
20186 an address to store it.
20188 (ArrayCreation.EmitDynamicInitializers): Use it.
20190 2002-03-17 Miguel de Icaza <miguel@ximian.com>
20192 * expression.cs (Invocation.EmitArguments): Only probe for array
20193 property if there is more than one argument. Sorry about that.
20195 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
20196 empty param arrays.
20198 * class.cs (Method.LabelParameters): Fix incorrect code path that
20199 prevented the `ParamArrayAttribute' from being applied to the
20202 2002-03-16 Miguel de Icaza <miguel@ximian.com>
20204 * support.cs (ReflectionParameters): Correctly compute whether the
20205 last argument is a params array. Fixes the problem with
20208 * typemanager.cs: Make the assemblies array always be non-null
20209 (empty, but non-null)
20211 * tree.cs (RecordDecl): New function that abstracts the recording
20212 of names. This reports error 101, and provides a pointer to the
20213 previous declaration. Fixes a crash in the compiler.
20215 * cs-parser.jay (constructor_declaration): Update to new grammar,
20216 and provide a constructor_body that can be empty.
20218 2002-03-15 Miguel de Icaza <miguel@ximian.com>
20220 * driver.cs: Add support for --resources.
20222 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
20223 Make all types for the various array helper methods be integer.
20225 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
20226 CheckState to ConvCast.
20228 (ConvCast): Now it takes a `checked' state argument, to avoid
20229 depending on the emit context for the conversion, and just using
20230 the resolve time setting.
20232 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
20233 instead of Invocation.EmitArguments. We do not emit the original
20234 arguments, instead we emit those which have been converted to
20235 unsigned int expressions.
20237 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
20239 * codegen.cs: ditto.
20241 * expression.cs (LocalVariableReference): Drop the use of the
20242 Store function that depended on the variable index.
20244 * statement.cs (VariableInfo): Drop the `Idx' property from this
20245 class, as this is not taking into account the indexes for
20246 temporaries tat we generate during the execution, getting the
20249 * class.cs: First emit class initializers, then call the parent
20252 * expression.cs (Binary): Fix opcode emision.
20253 (UnaryMutator.EmitCode): Support checked code generation
20255 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
20256 matches for events for both the Static and Instance scans,
20257 pointing to the same element. Fix that.
20259 2002-03-14 Miguel de Icaza <miguel@ximian.com>
20261 * rootcontext.cs (ResolveTree): Always set the
20262 interface_resolve_order, because nested interfaces will be calling
20265 * class.cs (GetInterfaceOrClass): Track the same resolution
20266 process used by TypeManager.LookupType. This fixes the nested
20267 type lookups in class declarations (separate path from
20270 (TypeContainer.DefineType): Also define nested interfaces.
20271 (TypeContainer.RegisterOrder): New public function used to
20272 register the order in which child interfaces need to be closed.
20274 Nested interfaces need to be closed after their parents have been
20277 * interface.cs (InterfaceAttr): Put all the logic for computing
20278 the interface attribute here.
20280 (DefineInterface): Register our interface order with the
20281 RootContext or with the TypeContainer depending on the case.
20283 2002-03-12 Miguel de Icaza <miguel@ximian.com>
20285 * cs-parser.jay: rework foreach statement to work with the new
20286 changes to the policy on SimpleNames.
20288 * report.cs: support Stacktrace on warnings as well.
20290 * makefile: drop --unsafe and /unsafe from the compile.
20292 2002-03-13 Ravi Pratap <ravi@ximian.com>
20294 * ecore.cs (StandardConversionExists): Modify to take an Expression
20295 as the first parameter. Ensure we do null -> reference type conversion
20298 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
20299 temporary Expression objects.
20301 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
20303 * interface.cs: workaround bug in method overloading resolution
20304 (there is already a bugzilla bug for it).
20306 2002-03-12 Miguel de Icaza <miguel@ximian.com>
20308 We could also solve this problem by having a separate path for
20309 performing type lookups, instead of DoResolve, we could have a
20310 ResolveType entry point, and only participating pieces of the
20311 production (simplename, deref, array) would implement this.
20313 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
20314 signal SimpleName to only resolve type names and not attempt to
20315 resolve anything else.
20317 * expression.cs (Cast): Set the flag.
20319 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
20321 * class.cs: Only report 108 if there is no `new' modifier.
20323 * cs-parser.jay: rework foreach statement to work with the new
20324 changes to the policy on SimpleNames.
20326 * report.cs: support Stacktrace on warnings as well.
20328 * makefile: drop --unsafe and /unsafe from the compile.
20330 2002-03-11 Miguel de Icaza <miguel@ximian.com>
20332 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20333 lookups here, instead of doing that at parse time. This means
20334 that our grammar will not introduce `LocalVariableReferences' as
20335 expressions at this point. That solves the problem of code like
20339 static void Main ()
20343 This is only half the fix. The full fix requires parameters to
20344 also be handled in this way.
20346 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
20347 makes the use more obvious of the DeclSpace. The
20348 ec.TypeContainer.TypeBuilder is now only used to pull the
20349 TypeBuilder for it.
20351 My theory is that I can get rid of the TypeBuilder completely from
20352 the EmitContext, and have typecasts where it is used (from
20353 DeclSpace to where it matters).
20355 The only pending problem is that the code that implements Aliases
20356 is on TypeContainer, and probably should go in DeclSpace.
20358 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20359 lookups here, instead of doing that at parse time. This means
20360 that our grammar will not introduce `LocalVariableReferences' as
20361 expressions at this point. That solves the problem of code like
20365 static void Main ()
20369 This is only half the fix. The full fix requires parameters to
20370 also be handled in this way.
20372 * class.cs (Property.DefineMethod): When implementing an interface
20373 method, set newslot, when implementing an abstract method, do not
20374 set the flag (before we tried never setting it, or always setting
20375 it, which is the difference).
20376 (Indexer.DefineMethod): same.
20377 (Method.DefineMethod): same.
20379 * ecore.cs: Only set the status used flag if we get back a Field.
20381 * attribute.cs: Temporary hack, so Paolo can keep working.
20383 2002-03-08 Ravi Pratap <ravi@ximian.com>
20385 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
20386 the unmanaged type in the case we have a MarshalAs attribute.
20388 (Resolve): Handle the case when we are parsing the special MarshalAs
20389 attribute [we need to store the unmanaged type to use later]
20391 * typemanager.cs (marshal_as_attr_type): Built in type for the
20392 MarshalAs Attribute.
20394 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
20395 on parameters and accordingly set the marshalling info.
20397 2002-03-09 Miguel de Icaza <miguel@ximian.com>
20399 * class.cs: Optimizing slightly by removing redundant code after
20400 we switched to the `NoTypes' return value.
20401 (Property.DefineMethod): use NoTypes here too.
20403 This fixes the bug I introduced in my last batch of changes.
20405 2002-03-05 Ravi Pratap <ravi@ximian.com>
20407 * tree.cs (RecordEnum): Add. We now keep track of enums too.
20409 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
20410 Enums since those are types too.
20412 * cs-parser.jay (enum_declaration): Record enums as we parse them.
20414 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
20415 thanks to a call during the lookup process.
20417 2002-03-07 Miguel de Icaza <miguel@ximian.com>
20419 * statement.cs (Foreach): Lots of work to accomodate a particular
20420 kind of foreach statement that I had not kept in mind. It is
20421 possible to have foreachs on classes that provide a GetEnumerator
20422 method that return objects that implement the "pattern" for using
20423 a foreach, there is no need to support GetEnumerator
20426 This is needed to compile nant.
20428 * decl.cs: Only report 114 if the member is not `Finalize' and if
20429 the warning level is at least 2.
20431 * class.cs: Moved the compare function from Method to
20434 (MethodSignature.InheritableMemberSignatureCompare): Add new
20435 filter function that is used to extract inheritable methods from a
20438 (Method.Define): Use the new `inheritable_method_signature_filter'
20441 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
20444 2002-03-06 Miguel de Icaza <miguel@ximian.com>
20446 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
20448 * cs-parser.jay: Add opt_semicolon to the interface declaration.
20450 * expression.cs: Pass location information to
20451 ConvertImplicitStandard.
20453 * class.cs: Added debugging code to track return values from
20456 2002-03-05 Miguel de Icaza <miguel@ximian.com>
20458 * expression.cs (Is.DoResolve): If either side of the `is' is an
20459 interface, do not flag the warning.
20461 * ecore.cs (ImplicitReferenceConversion): We need a separate test
20464 * report.cs: Allow for --fatal to be used with --probe.
20466 * typemanager.cs (NoTypes): Move the definition for the empty Type
20469 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
20471 (TypeContainer.DefineProxy): New function used to proxy to parent
20472 implementations when implementing interfaces.
20473 (TypeContainer.ParentImplements): used to lookup if our parent
20474 implements a public function that is required by an interface.
20475 (TypeContainer.VerifyPendingMethods): Hook this up.
20477 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
20478 `modules' and `assemblies' arraylists into arrays. We only grow
20479 these are the very early start up of the program, so this improves
20480 the speedof LookupType (nicely measured).
20482 * expression.cs (MakeByteBlob): Replaced unsafe code with
20483 BitConverter, as suggested by Paolo.
20485 * cfold.cs (ConstantFold.Binary): Special case: perform constant
20486 folding of string concatenation, but if either side is a string,
20487 and the other is not, then return null, and let the runtime use
20488 the concatenation on the string plus the object (using
20489 `Object.ToString').
20491 2002-03-04 Miguel de Icaza <miguel@ximian.com>
20493 Constant Folding has been implemented now.
20495 * expression.cs (Unary.Reduce): Do not throw an exception, catch
20496 the error instead on types that are not supported in one's
20499 * constant.cs (Constant and all children): New set of functions to
20500 perform implict and explicit conversions.
20502 * ecore.cs (EnumConstant): Implement the new functions to perform
20503 conversion by proxying to the child expression.
20505 * codegen.cs: (ConstantCheckState): Constant evaluation has its
20506 own separate setting that can not be turned off from the command
20507 line using --unchecked or --checked and is only controlled using
20508 the checked/unchecked statements and expressions. This setting is
20509 used by the constant folder to flag errors.
20511 * expression.cs (CheckedExpr, UncheckedExpr): Set the
20512 ConstantCheckState as well.
20514 During Resolve, they also have to flag the state, because the
20515 constant folder runs completely in the Resolve phase.
20517 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
20520 2002-03-01 Miguel de Icaza <miguel@ximian.com>
20522 * cfold.cs: New file, this file contains the constant folder.
20524 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
20525 argument to track whether we are using the resulting address to
20526 load or store a value and provide better error messages.
20528 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
20529 new AddressOf arguments.
20531 * statement.cs (Foreach.EmitCollectionForeach): Update
20533 * expression.cs (Argument.Emit): Call AddressOf with proper
20534 arguments to track usage.
20536 (New.DoEmit): Call AddressOf with new arguments.
20538 (Unary.Emit): Adjust AddressOf call.
20540 2002-03-01 Ravi Pratap <ravi@ximian.com>
20542 * cs-parser.jay (member_access): Change the case for pre-defined types
20543 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
20546 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
20549 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
20550 essentially like methods and apply attributes like MethodImplOptions to them too.
20552 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
20555 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
20556 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
20559 * Update code everywhere accordingly.
20561 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
20563 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
20565 2002-02-28 Ravi Pratap <ravi@ximian.com>
20567 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
20568 try performing lookups against those instead of jumping straight into using
20569 the 'using' clauses.
20571 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
20573 (LookupType): Perform lookups in implicit parents too.
20575 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
20576 sequence as RootContext.LookupType.
20578 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
20579 the various cases of namespace lookups into this method.
20581 2002-03-01 Miguel de Icaza <miguel@ximian.com>
20583 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
20584 in positional arguments)
20586 * class.cs (Operator): Update the AllowedModifiers to contain
20589 * cs-parser.jay: Update operator declaration to allow for the
20590 operator body to be empty.
20592 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
20595 2002-02-27 Miguel de Icaza <miguel@ximian.com>
20597 * class.cs (Method.Emit): Label parameters.
20599 * driver.cs: Return 1 or 0 as the program exit code.
20601 2002-02-26 Miguel de Icaza <miguel@ximian.com>
20603 * expression.cs: Special case the `null' object when trying to
20604 auto-compute the type, as anything can be explicitly converted to
20607 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
20608 spotting this Paolo.
20610 (Expression.ImplicitNumericConversion): Perform comparissions of
20611 the type using the underlying type in the case of an enumeration
20612 rather than using the enumeration type for the compare.
20614 Cope with the underlying == type case, which is not possible to
20617 (Expression.ConvertNumericExplicit): Perform comparissions of
20618 the type using the underlying type in the case of an enumeration
20619 rather than using the enumeration type for the compare.
20621 * driver.cs: If the user does not supply an extension, assume .exe
20623 * cs-parser.jay (if_statement): Rewrote so that we can track the
20624 location for the if statement.
20626 * expression.cs (Binary.ConstantFold): Only concat strings when
20627 the operation is "+", not everything ;-)
20629 * statement.cs (Statement.EmitBoolExpression): Take a location
20631 (If, While, Do): Track location.
20633 * expression.cs (Binary.ResolveOperator): In the object + string
20634 case, I was missing a call to ConvertImplicit
20636 2002-02-25 Ravi Pratap <ravi@ximian.com>
20638 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
20639 Location arguments. Ensure we use RootContext.LookupType to do our work
20640 and not try to do a direct Type.GetType and ModuleBuilder.GetType
20642 * interface.cs (PopulateMethod): Handle the type of the parameter being
20645 * expression.cs (Invocation.BetterFunction): Handle the case when we
20646 have a params method with no fixed arguments and a call is made with no
20649 2002-02-25 Miguel de Icaza <miguel@ximian.com>
20651 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
20652 the verbatim-string-literal
20654 * support.cs (InternalParameters.ParameterModifier): handle null
20656 (InternalParameters.ParameterType): ditto.
20658 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
20659 duplicating the name of the variable parameter.
20660 (GetParameterByName): Fix bug where we were not looking up array
20661 paramters if they were the only present (thanks Paolo!).
20662 (GetParameterInfo): We only have an empty set of types if both
20663 fixed and array are set to null.
20664 (GetParameterInfo-idx): Handle FixedParameter == null
20666 * cs-parser.jay: Handle the case where there is no catch
20667 statements (missing null test).
20669 2002-02-22 Miguel de Icaza <miguel@ximian.com>
20671 * driver.cs (MainDriver): Be conservative on our command line
20674 Catch DirectoryNotFoundException when calling GetFiles.
20676 (SplitPathAndPattern): Used to split the input specification into
20677 a path and a pattern that we can feed to Directory.GetFiles.
20679 2002-02-21 Miguel de Icaza <miguel@ximian.com>
20681 * statement.cs (Fixed): Implement the last case of the Fixed
20682 statement (string handling).
20684 * expression.cs (StringPtr): New class used to return a char * to
20685 a string; Used by the Fixed statement.
20687 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
20689 * expression.cs (Binary.ResolveOperator): Remove redundant
20690 MemberLookup pn parent type.
20691 Optimize union call, we do not need a union if the types are the same.
20692 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
20695 Specialize the use of MemberLookup everywhere, instead of using
20696 the default settings.
20698 (StackAlloc): Implement stackalloc keyword.
20700 * cs-parser.jay: Add rule to parse stackalloc.
20702 * driver.cs: Handle /h, /help, /?
20704 * expression.cs (MakeByteBlob): Removed the hacks we had in place
20705 before we supported unsafe code.
20707 * makefile: add --unsafe to the self compilation of mcs.
20709 2002-02-20 Miguel de Icaza <miguel@ximian.com>
20711 * expression.cs (PointerArithmetic): New class that is used to
20712 perform pointer arithmetic.
20713 (Binary.Resolve): Handle pointer arithmetic
20714 Handle pointer comparission.
20715 (ArrayPtr): Utility expression class that is used to take the
20716 address of an array.
20718 (ElementAccess): Implement array access for pointers
20720 * statement.cs (Fixed): Implement fixed statement for arrays, we
20721 are missing one more case before we are done.
20723 * expression.cs (Indirection): Implement EmitAssign and set the
20724 ExprClass to Variable. This allows pointer dereferences to be
20725 treated as variables, and to have values assigned to them.
20727 * ecore.cs (Expression.StoreFromPtr): New utility function to
20728 store values dereferencing.
20730 2002-02-20 Ravi Pratap <ravi@ximian.com>
20732 * expression.cs (Binary.ResolveOperator): Ensure that we are
20733 not trying to operate on a void type - this fixes the reported
20736 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
20737 the parent implementation is sealed.
20739 * ../errors/cs0239.cs : Add.
20741 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20743 * typemanager.cs (unverifiable_code_type): Corresponds to
20744 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20745 which have unsafe code in them.
20747 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
20750 2002-02-19 Miguel de Icaza <miguel@ximian.com>
20752 * cs-tokenizer.cs: Add support for @"litreal strings"
20754 Make tokenizer accept pre-processor directives
20755 on any column (remove the old C-like limitation).
20757 * rootcontext.cs (EmitCode): Emit any global attributes.
20758 (AddGlobalAttributes): Used to keep track of assembly attributes.
20760 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20762 * cs-parser.jay: Add support for global attributes.
20764 2002-02-17 Miguel de Icaza <miguel@ximian.com>
20766 * expression.cs (Indirection): New helper class. Unary will
20767 create Indirection classes to be able to implement the
20768 IMemoryLocation interface on it.
20770 2002-02-16 Miguel de Icaza <miguel@ximian.com>
20772 * cs-parser.jay (fixed_statement): reference the right statement.
20774 * statement.cs (Fixed.Emit): Finish implementing the fixed
20775 statement for the &x case.
20777 2002-02-14 Miguel de Icaza <miguel@ximian.com>
20779 * class.cs (Property.Define, Method.Define): Remove newslot when
20782 * modifiers.cs: My use of NewSlot when `Abstract' was set was
20783 wrong. NewSlot should only be used if the `new' keyword is present.
20785 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20786 locating our system dir. Sorry about this.
20788 2002-02-13 Miguel de Icaza <miguel@ximian.com>
20790 * driver.cs (GetSystemDir): Compute correctly the location of our
20791 system assemblies. I was using the compiler directory instead of
20792 the library directory.
20794 2002-02-13 Ravi Pratap <ravi@ximian.com>
20796 * expression.cs (BetterFunction): Put back in what Miguel commented out
20797 since it is the correct fix. The problem is elsewhere ;-)
20799 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20800 parameters of the parms method are themselves compatible or not !
20802 (StandardConversionExists): Fix very dangerous bug where we were forgetting
20803 to check that a class implements an interface before saying that an implicit
20804 conversion was allowed. Use ImplementsInterface to do the checking.
20806 2002-02-13 Miguel de Icaza <miguel@ximian.com>
20808 * class.cs (Method.Define): Track whether we are an explicit
20809 implementation or not. And only call DefineMethodOverride if we
20810 are an explicit implementation.
20812 (Property.DefineMethod): Ditto.
20814 2002-02-11 Ravi Pratap <ravi@ximian.com>
20816 * expression.cs (BetterFunction): Catch hideous bug which was
20817 preventing us from detecting ambiguous calls due to implicit casts i.e
20820 2002-01-29 Miguel de Icaza <miguel@ximian.com>
20822 * support.cs (Pair): Remove un-needed method. I figured why I was
20823 getting the error in cs-parser.jay, the variable in a foreach loop
20824 is readonly, and the compiler does not really treat this as a variable.
20826 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
20827 instead of EQUALS in grammar.
20829 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
20831 * expression.cs (Unary.DoResolve): Check whether the argument is
20834 2002-01-28 Miguel de Icaza <miguel@ximian.com>
20836 * support.cs: Api for Pair to set a value. Despite the fact that
20837 the variables are public the MS C# compiler refuses to compile
20838 code that accesses the field if the variable is part of a foreach
20841 * statement.cs (Fixed): Begin implementation of the fixed
20844 (Block.AddVariable): Return the VariableInfo on success and null
20845 on failure instead of true/false.
20847 * cs-parser.jay (foreach): Catch errors on variables already
20848 defined (we were ignoring this value before) and properly unwind
20849 the block hierarchy
20851 (fixed_statement): grammar for the fixed statement.
20853 2002-01-25 Miguel de Icaza <miguel@ximian.com>
20855 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20856 pointer types to be incretemented.
20858 (SizeOf): Implement.
20860 * cs-parser.jay (pointer_member_access): Implement
20861 expr->IDENTIFIER production.
20863 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20864 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20867 (Unary): Implement indirection.
20869 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20870 use in non-unsafe context).
20872 (SimpleName.DoResolve): Check for pointers in field access on safe
20875 (Expression.LoadFromPtr): Factor the load-indirect code in this
20876 function. This was duplicated in UnboxCast and ParameterReference
20878 2002-01-24 Miguel de Icaza <miguel@ximian.com>
20880 * expression.cs (ComposedCast): report an error if a pointer cast
20881 is used in a safe region.
20883 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20884 pointer type casts in unsafe context.
20886 * codegen.cs (EmitContext): Set up IsUnsafe.
20888 * cs-parser.jay (non_expression_type): Add productions for pointer
20891 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20892 code. We should not use force into static mode if the method is
20893 not virtual. Fixes bug in MIS
20895 * statement.cs (Do.Emit, While.Emit, For.Emit,
20896 Statement.EmitBoolExpression): Add support to Do and While to
20897 propagate infinite loop as `I do return' semantics.
20899 Improve the For case to also test for boolean constants.
20901 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20902 to the list of attributes we can add.
20904 Remove `EmitContext' argument.
20906 * class.cs (Method.Define): Apply parameter attributes.
20907 (Constructor.Define): Apply parameter attributes.
20908 (MethodCore.LabelParameters): Move here the core of labeling
20911 * support.cs (ReflectionParameters.ParameterModifier,
20912 InternalParameters.ParameterModifier): Use IsByRef on the type and
20913 only return the OUT bit for these parameters instead of in/out/ref
20916 This is because I miss-understood things. The ParameterInfo.IsIn
20917 and IsOut represent whether the parameter has the [In] and [Out]
20920 2002-01-22 Miguel de Icaza <miguel@ximian.com>
20922 * ecore.cs (FieldExpr.Emit): Release temporaries.
20924 * assign.cs (LocalTemporary.Release): new function.
20926 * codegen.cs (EmitContext.GetTemporaryStorage,
20927 EmitContext.FreeTemporaryStorage): Rework the way we deal with
20928 temporary storage. Now we can "put back" localbuilders when we
20931 2002-01-21 Miguel de Icaza <miguel@ximian.com>
20933 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20934 need to make a copy of the variable to generate verifiable code.
20936 2002-01-19 Miguel de Icaza <miguel@ximian.com>
20938 * driver.cs: Compute dynamically the system directory.
20940 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20941 Slower, but more generally useful. Used by the abstract
20942 registering implementation.
20944 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20945 the rules for the special rule on Type/instances. First check if
20946 we have the same name, and if so, try that special static path
20947 rather than the instance path.
20949 2002-01-18 Miguel de Icaza <miguel@ximian.com>
20951 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20954 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20955 Enum, ValueType, Delegate or Array for non-corlib compiles.
20957 * cs-tokenizer.cs: Catch long identifiers (645)
20959 * typemanager.cs (IndexerPropetyName): Ravi never tested this
20962 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20963 fix, we were returning too early, so we were not registering
20964 pending methods from abstract classes.
20966 Do not register pending methods if the class is abstract.
20968 * expression.cs (Conditional.DoResolve): Report circular implicit
20969 conversions when we neecd to compute it for conditional
20972 (Is.DoResolve): If the expression is always of the provided type,
20973 flag warning 183. If the expression can not ever be of the
20974 provided type flag warning 184.
20976 * class.cs: Catch 169 as well.
20978 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20981 2002-01-18 Nick Drochak <ndrochak@gol.com>
20983 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
20985 2002-01-17 Miguel de Icaza <miguel@ximian.com>
20987 * interface.cs: (PopulateMethod): Check for pointers being defined
20988 only if the unsafe context is active.
20989 (PopulateProperty): ditto.
20990 (PopulateIndexer): ditto.
20992 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20993 specified. If pointers are present, make sure that they are
20994 present in an unsafe context.
20995 (Constructor, Constructor.Define): ditto.
20996 (Field, Field.Define): ditto.
20997 (Property, Property.Define): ditto.
20998 (Event, Event.Define): ditto.
21000 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
21001 hashtable if there are classes or structs defined.
21003 * expression.cs (LocalVariableReference.DoResolve): Simplify this
21004 code, as the constant resolution moved.
21006 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
21007 the metadata, so we can flag error 133.
21009 * decl.cs (MemberCore.UnsafeOK): New function to test that a
21010 pointer is being declared in an unsafe context.
21012 2002-01-16 Miguel de Icaza <miguel@ximian.com>
21014 * modifiers.cs (Modifiers.Check): Require a Location argument.
21015 Report error 227 for Unsafe use.
21017 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
21019 * statement.cs (For.Emit): If the test is null, then report that
21020 we do `return', as we wont reach anything afterwards.
21022 (Switch.SwitchGoverningType): Track the expression that matched
21025 * driver.cs: Allow negative numbers as an error code to flag.
21027 * cs-parser.jay: Handle 1551.
21029 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
21031 2002-01-15 Miguel de Icaza <miguel@ximian.com>
21033 * cs-parser.jay: Report 1518 (type declaration can only contain
21034 class, struct, interface, enum or delegate)
21036 (switch_label): Report 1523 (keywords `case' or `default' must
21039 (opt_switch_sections): Report 1522 (empty switch)
21041 * driver.cs: Report 1515 (response file specified multiple times)
21042 Report 1516 (Source file specified multiple times).
21044 * expression.cs (Argument.Resolve): Signal 1510
21046 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
21047 access not allowed in static code)
21049 2002-01-11 Ravi Pratap <ravi@ximian.com>
21051 * typemanager.cs (IsPointerType): Utility method which we are going
21054 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
21055 the object type, so we take care of that.
21057 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
21059 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
21060 added to non-params parameters :-)
21062 * typemanager.cs (CSharpName): Include 'void' type too.
21064 (void_ptr_type): Include in the set of core types.
21066 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
21069 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
21072 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
21073 completely forgotten about it.
21075 2002-01-10 Ravi Pratap <ravi@ximian.com>
21077 * cs-parser.jay (pointer_type): Add. This begins our implementation
21078 of parsing rules for unsafe code.
21080 (unsafe_statement): Implement.
21082 (embedded_statement): Modify to include the above.
21084 * statement.cs (Unsafe): Implement new class for unsafe blocks.
21086 * codegen.cs (EmitContext.InUnsafe): Add. This determines
21087 if the current context is an unsafe one.
21089 * cs-parser.jay (local_variable_pointer_type): Since local variable types
21090 are handled differently, we need separate rules for them.
21092 (local_variable_declaration): Update to use local_variable_pointer_type
21093 to allow variable declarations of unmanaged pointer types.
21095 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
21096 in unsafe contexts.
21098 * ../errors/cs0214.cs : Add.
21100 2002-01-16 Nick Drochak <ndrochak@gol.com>
21102 * makefile: remove 'response' file when cleaning.
21104 2002-01-15 Miguel de Icaza <miguel@ximian.com>
21106 * cs-parser.jay: Report 1524.
21108 2002-01-14 Miguel de Icaza <miguel@ximian.com>
21110 * typemanager.cs (RegisterMethod): drop checking if we have
21111 registered this from here
21113 2002-01-12 Miguel de Icaza <miguel@ximian.com>
21115 * class.cs (Method.EmitDestructor): Implement calling our base
21118 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
21119 value of InFinally.
21121 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
21122 this routine and will wrap the call in a try/catch block. Deal
21125 2002-01-11 Miguel de Icaza <miguel@ximian.com>
21127 * ecore.cs (Expression.MemberLookup): instead of taking a
21128 parameter `same_type' that was used to tell whether we could
21129 access private members we compute our containing type from the
21132 (FieldExpr): Added partial support for volatile fields. This does
21133 not work for volatile fields exposed from assemblies, as I can not
21134 figure out how to extract the modreq from it.
21136 Updated all the source files to use this.
21138 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
21139 because it is referenced by MemberLookup very often.
21141 2002-01-09 Ravi Pratap <ravi@ximian.com>
21143 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
21144 TypeBuilder.GetCustomAttributes to retrieve what we need.
21146 Get rid of redundant default_member_attr_type as this is the same as
21147 default_member_type which already exists.
21149 * interface.cs, attribute.cs : Update accordingly.
21151 2002-01-08 Miguel de Icaza <miguel@ximian.com>
21153 * typemanager.cs: Enable IndexerPropertyName again. It does not
21154 work for TYpeBuilders though. Ravi, can you please fix this?
21156 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
21158 * expression.cs (Argument.Emit): Handle the case of ref objects
21159 being passed to ref functions;
21161 (ParameterReference.EmitLoad): Loads the content of the pointer
21162 without dereferencing.
21164 2002-01-07 Miguel de Icaza <miguel@ximian.com>
21166 * cs-tokenizer.cs: Implemented the pre-processing expressions.
21168 2002-01-08 Ravi Pratap <ravi@ximian.com>
21170 * class.cs (Indexer.DefineMethod): Incorporate the interface
21171 type in the name of the method if we are doing explicit interface
21174 * expression.cs (ConversionExists): Remove as it is completely obsolete.
21176 (BetterConversion): Fix extremely trivial bug where we were referring to
21177 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
21180 * ../errors/bug16.cs : Add although we have fixed it.
21182 2002-01-07 Miguel de Icaza <miguel@ximian.com>
21184 * expression.cs (BaseIndexer): Begin implementation.
21186 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
21188 * cs-parser.jay (indexer_declarator): Use qualified_identifier
21189 production directly to remove a shift/reduce, and implement
21190 explicit interface implementation.
21192 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
21193 after a floating point suffix.
21195 * expression.cs (DoNumericPromotions): Improved the conversion for
21196 uint/uint. If we have a constant, we avoid doing a typecast to a
21199 * class.cs (Indexer): Implement explicit interface implementation
21202 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
21204 * class.cs: make the default instance constructor public and hidebysig.
21206 2001-01-03 Ravi Pratap <ravi@ximian.com>
21208 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
21209 so we can call it from elsewhere.
21211 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
21212 we emit it internally if the class has a defined indexer; otherwise the user
21213 emits it by decorating the class definition with the DefaultMemberAttribute.
21215 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
21216 attribute is not used on a type which defines an indexer.
21218 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
21219 character when we skip whitespace.
21221 * ../errors/cs0646.cs : Add.
21223 2002-01-03 Miguel de Icaza <miguel@ximian.com>
21225 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
21228 * makefile: Add practical target `mcs3.exe' which builds the third
21229 generation compiler.
21231 * expression.cs (New): Fix structures constructor calling.
21233 * class.cs (Property, Method, Indexer): Emit Final flag on the
21234 method if we are an interface implementation and we are not
21237 * ecore.cs (PropertyExpr): New public field `IsBase', tells
21238 whether this property is referencing a `base' method.
21240 * expression.cs (Invocation.EmitCall): take an extra argument:
21241 is_base, this is used to determine whether the `call' or
21242 `callvirt' opcode should be used.
21245 * delegate.cs: update EmitCall.
21247 * class.cs (Method.Define): Set NewSlot for the cases where we are
21248 not implementing an interface method.
21250 (Property.Define): ditto.
21252 2002-01-02 Miguel de Icaza <miguel@ximian.com>
21254 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
21255 'r'. Allows mcs to parse itself fully.
21257 2002-01-02 Ravi Pratap <ravi@ximian.com>
21259 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
21260 of the number of initializers that require the InitializeArray method.
21262 (CheckIndices): Store the Expression in all cases - not the plain value. Also
21263 update the above field where necessary.
21265 (MakeByteBlob): Update accordingly.
21267 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
21270 (EmitDynamicInitializers): Update in accordance with the new optimization.
21272 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
21273 same OpCode applies.
21275 * cs-parser.jay : Fix some glaring errors I introduced.
21277 2002-01-01 Ravi Pratap <ravi@ximian.com>
21279 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
21280 so that we can check for name clashes there too.
21282 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
21283 for interface indexers.
21285 * interfaces.cs (Define): Emit the default member attribute.
21287 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
21288 variable was being referred to while setting the value ;-)
21290 2002-01-01 Miguel de Icaza <miguel@ximian.com>
21292 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
21293 byte-by-byte information when we know the data is zero.
21295 Make the block always a multiple of 4, because
21296 DefineInitializedData has a bug.
21298 * assign.cs: Fix, we should assign from the temporary, not from
21301 * expression.cs (MakeByteBlob): Fix my incorrect code.
21303 2001-12-31 Miguel de Icaza <miguel@ximian.com>
21305 * typemanager.cs (EnumToUnderlying): This function is used to get
21306 the underlying type from an enumeration, because it does not
21309 * constant.cs: Use the I4_S form for values between -128 and 127.
21311 * statement.cs (Block.LookupLabel): Looks up a label.
21312 (Block): Drop support for labeled blocks.
21314 (LabeledStatement): New kind of statement that represents a label
21317 (Goto): Finally implement this bad boy.
21319 * cs-parser.jay: Update to reflect new mechanism to implement
21322 2001-12-30 Miguel de Icaza <miguel@ximian.com>
21324 * codegen.cs (EmitContext.This): a codegen property that keeps the
21325 a single instance of this instead of creating many different this
21328 * delegate.cs (Delegate.DoResolve): Update to use the property;
21330 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
21332 * expression.cs (BaseAccess.DoResolve): Ditto.
21334 2001-12-29 Ravi Pratap <ravi@ximian.com>
21336 * typemanager.cs (methodimpl_attr_type): Add to hold the type
21337 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
21339 (InitCoreTypes): Update accordingly.
21341 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
21342 so we can quickly store the state.
21344 (ApplyAttributes): Set the correct implementation flags
21345 for InternalCall methods.
21347 2001-12-29 Miguel de Icaza <miguel@ximian.com>
21349 * expression.cs (EmitCall): if a method is not virtual, then do
21350 not use callvirt on it.
21352 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
21353 user defined stuff) requires the use of stobj, which takes an
21354 address on the stack instead of an array and an index. So emit
21355 the Ldelema operation for it.
21357 (EmitStoreOpcode): Use stobj for valuetypes.
21359 (UnaryMutator.EmitCode): Use the right 1 value depending on
21360 whether we are dealing with int64/uint64, float or doubles.
21362 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
21363 constructors that I implemented last night.
21365 (Constructor.IsDefault): Fix to work properly for static
21368 * cs-parser.jay (CheckDef): report method signature errors.
21369 Update error number 103 to be 132.
21371 * decl.cs: New AdditionResult enumeration value: MethodExists.
21372 Although we do this check for methods later on in the semantic
21373 analysis, catching repeated default constructors is so easy that
21374 we catch these here.
21376 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
21379 (ParameterReference.EmitAssign, Emit): handle
21382 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
21383 (ArrayAccess.EmitStoreOpcode): ditto.
21385 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
21387 * expression.cs (MakeByteBlob): Complete all the missing types
21388 (uint, short, ushort, byte, sbyte)
21390 * class.cs: Only init instance field initializers on instance
21393 Rename `constructors' to instance_constructors.
21395 (TypeContainer.AddConstructor): Only add constructors to the list
21396 if it is not static.
21398 Make sure that we handle default_static_constructor independently
21399 everywhere where we handle instance_constructors
21401 2001-12-28 Miguel de Icaza <miguel@ximian.com>
21403 * class.cs: Do not lookup or create a base initializer for a
21404 static constructor.
21406 (ConstructorInitializer.Resolve): use the proper type to lookup
21409 * cs-parser.jay: Report error 1585 (modifiers between type and name).
21411 * enum.cs, interface.cs: Remove CloseType, this is taken care by
21414 * decl.cs: CloseType is now an virtual method, the default
21415 implementation just closes this type.
21417 2001-12-28 Ravi Pratap <ravi@ximian.com>
21419 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
21420 to PreserveSig by default. Also emit HideBySig on such methods.
21422 Basically, set the defaults to standard values.
21424 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
21425 argument, if candidate is better, it can't be worse than the best !
21427 (Invocation): Re-write bits to differentiate between methods being
21428 applicable in their expanded form and their normal form - for params
21431 Get rid of use_standard everywhere as only standard conversions are allowed
21432 in overload resolution.
21434 More spec conformance.
21436 2001-12-27 Miguel de Icaza <miguel@ximian.com>
21438 * driver.cs: Add --timestamp, to see where the compiler spends
21441 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
21442 `this' in static code.
21444 (SimpleName.DoResolve): Implement in terms of a helper function
21445 that allows static-references to be passed upstream to
21448 (Expression.ResolveWithSimpleName): Resolve specially simple
21449 names when called by MemberAccess to implement the special
21452 (Expression.ImplicitReferenceConversion): Handle conversions from
21453 Null to reference types before others, as Null's type is
21456 * expression.cs (Invocation.EmitCall): Handle the special case of
21457 calling methods declared on a reference type from a ValueType
21458 (Base classes System.Object and System.Enum)
21460 (MemberAccess.Resolve): Only perform lookups on Enumerations if
21461 the left hand side is a TypeExpr, not on every enumeration.
21463 (Binary.Resolve): If types are reference types, then do a cast to
21464 object on operators != and == of both arguments.
21466 * typemanager.cs (FindMembers): Extract instance and static
21467 members if requested.
21469 * interface.cs (PopulateProperty): Use void_type instead of null
21470 as the return type for the setter method.
21472 (PopulateIndexer): ditto.
21474 2001-12-27 Ravi Pratap <ravi@ximian.com>
21476 * support.cs (ReflectionParameters): Fix minor bug where we
21477 were examining the wrong parameter for the ParamArray attribute.
21479 Cope with requests for the type of the parameter at position
21480 greater than the params parameter's. We now return the element
21481 type of the params array as that makes more sense.
21483 * expression.cs (Invocation.IsParamsMethodApplicable): Update
21484 accordingly as we no longer have to extract the element type
21487 (Invocation.OverloadResolve): Update.
21489 2001-12-27 Miguel de Icaza <miguel@ximian.com>
21491 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
21492 against IEnumerator, test whether the return value is a descendant
21493 of the IEnumerator interface.
21495 * class.cs (Indexer.Define): Use an auxiliary method to implement
21496 the other bits of the method definition. Begin support for
21497 explicit interface implementation.
21499 (Property.DefineMethod): Use TypeManager.void_type instead of null
21500 for an empty return value.
21502 2001-12-26 Miguel de Icaza <miguel@ximian.com>
21504 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
21505 dealing with a FieldExpr which is composed of a FieldBuilder, in
21506 the code path we did extract the constant, but we should have
21507 obtained the underlying value to be able to cast it (otherwise we
21508 end up in an infinite loop, this is what Ravi was running into).
21510 (ArrayCreation.UpdateIndices): Arrays might be empty.
21512 (MemberAccess.ResolveMemberAccess): Add support for section
21513 14.5.4.1 that deals with the special case of E.I when E is a type
21514 and something else, that I can be a reference to a static member.
21516 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
21517 handle a particular array type to create byte blobs, it is just
21518 something we dont generate byteblobs for.
21520 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
21523 * location.cs (Push): remove the key from the hashtable that we
21524 are about to add. This happens for empty files.
21526 * driver.cs: Dispose files after we have parsed them.
21528 (tokenize): new function that only runs the tokenizer on its
21529 input, for speed testing.
21531 2001-12-26 Ravi Pratap <ravi@ximian.com>
21533 * class.cs (Event.Define): Define the private field only if there
21534 are no accessors defined.
21536 * expression.cs (ResolveMemberAccess): If there is no associated
21537 field with the event, that means we have an event defined with its
21538 own accessors and we should flag error cs0070 since transforming
21539 ourselves into a field is not valid in that case.
21541 * ecore.cs (SimpleName.DoResolve): Same as above.
21543 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
21544 and charset to sane values.
21546 2001-12-25 Ravi Pratap <ravi@ximian.com>
21548 * assign.cs (DoResolve): Perform check on events only if they
21549 are being accessed outside the declaring type.
21551 * cs-parser.jay (event_declarations): Update rules to correctly
21552 set the type of the implicit parameter etc.
21554 (add_accessor, remove_accessor): Set current local parameters.
21556 * expression.cs (Binary): For delegate addition and subtraction,
21557 cast the return value from the method into the appropriate delegate
21560 2001-12-24 Ravi Pratap <ravi@ximian.com>
21562 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
21563 of these as the workaround is unnecessary.
21565 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
21566 delegate data - none of that is needed at all.
21568 Re-write bits to extract the instance expression and the delegate method
21571 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
21574 * attribute.cs (ApplyAttributes): New method to take care of common tasks
21575 of attaching attributes instead of duplicating code everywhere.
21577 * everywhere : Update code to do attribute emission using the above method.
21579 2001-12-23 Miguel de Icaza <miguel@ximian.com>
21581 * expression.cs (IsParamsMethodApplicable): if there are not
21582 parameters, return immediately.
21584 * ecore.cs: The 0 literal can be implicity converted to an enum
21587 (SimpleName.DoResolve): First lookup the type, then lookup the
21590 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
21591 want to get its address. If the InstanceExpression is not
21592 addressable, store the result in a temporary variable, then get
21595 * codegen.cs: Only display 219 errors on warning level or above.
21597 * expression.cs (ArrayAccess): Make it implement the
21598 IMemoryLocation interface.
21600 (Binary.DoResolve): handle the operator == (object a, object b)
21601 and operator != (object a, object b) without incurring into a
21602 BoxedCast (because 5 != o should never be performed).
21604 Handle binary enumerator operators.
21606 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
21607 value type, otherwise use Ldelem_ref.
21609 Use precomputed names;
21611 (AddressOf): Implement address of
21613 * cs-parser.jay (labeled_statement): Fix recursive block
21614 addition by reworking the production.
21616 * expression.cs (New.DoEmit): New has a special case:
21618 If we are dealing with a ValueType, we have a few
21619 situations to deal with:
21621 * The target of New is a ValueType variable, that is
21622 easy, we just pass this as the variable reference
21624 * The target of New is being passed as an argument,
21625 to a boxing operation or a function that takes a
21628 In this case, we need to create a temporary variable
21629 that is the argument of New.
21632 2001-12-23 Ravi Pratap <ravi@ximian.com>
21634 * rootcontext.cs (LookupType): Check that current_type is not null before
21635 going about looking at nested types.
21637 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
21638 not implement the IAssignMethod interface any more.
21640 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
21641 where we tranform them into FieldExprs if they are being resolved from within
21642 the declaring type.
21644 * ecore.cs (SimpleName.DoResolve): Do the same here.
21646 * assign.cs (DoResolve, Emit): Clean up code considerably.
21648 * ../errors/bug10.cs : Add.
21650 * ../errors/cs0070.cs : Add.
21652 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
21654 * assign.cs : Get rid of EventIsLocal everywhere.
21656 2001-12-23 Miguel de Icaza <miguel@ximian.com>
21658 * ecore.cs (ConvertIntLiteral): finished the implementation.
21660 * statement.cs (SwitchLabel): Convert the value we are using as a
21661 key before looking up the table.
21663 2001-12-22 Miguel de Icaza <miguel@ximian.com>
21665 * codegen.cs (EmitTopBlock): Require a Location argument now.
21667 * cs-parser.jay (constructor_declarator): We need to setup
21668 current_local_parameters before we parse the
21669 opt_constructor_initializer, to allow the variables to be bound
21670 to the constructor arguments.
21672 * rootcontext.cs (LookupType): First lookup nested classes in our
21673 class and our parents before we go looking outside our class.
21675 * expression.cs (ConstantFold): Extract/debox the values at the
21678 * rootcontext.cs (EmitCode): Resolve the constants first before we
21679 resolve the types. This is not really needed, but it helps debugging.
21681 * statement.cs: report location.
21683 * cs-parser.jay: pass location to throw statement.
21685 * driver.cs: Small bug fix.
21687 * report.cs: Updated format to be 4-zero filled digits.
21689 2001-12-22 Ravi Pratap <ravi@ximian.com>
21691 * expression.cs (CheckIndices): Fix minor bug where the wrong
21692 variable was being referred to ;-)
21694 (DoEmit): Do not call EmitStaticInitializers when the
21695 underlying type is System.Object.
21697 2001-12-21 Ravi Pratap <ravi@ximian.com>
21699 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
21700 and do the usual workaround for SRE.
21702 * class.cs (MyEventBuilder.EventType): New member to get at the type
21703 of the event, quickly.
21705 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
21707 * assign.cs (Assign.DoResolve): Handle the case when the target
21708 is an EventExpr and perform the necessary checks.
21710 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
21713 (SimpleName.MemberStaticCheck): Include check for EventExpr.
21715 (EventExpr): Set the type in the constructor itself since we
21716 are meant to be born fully resolved.
21718 (EventExpr.Define): Revert code I wrote earlier.
21720 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
21721 instance expression is null. The instance expression is a This in that case
21722 or a null, depending on whether it is a static method or not.
21724 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
21725 refers to more than one method.
21727 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
21728 and accordingly flag errors.
21730 2001-12-21 Miguel de Icaza <miguel@ximian.com>
21732 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
21734 2001-12-22 Miguel de Icaza <miguel@ximian.com>
21736 * location.cs (ToString): Provide useful rutine.
21738 2001-12-21 Miguel de Icaza <miguel@ximian.com>
21740 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21741 objects, return the actual integral boxed.
21743 * statement.cs (SwitchLabel): define an ILLabel for each
21746 (Switch.CheckSwitch): If the value is a Literal, extract
21747 the underlying literal.
21749 Also in the unused hashtable we had, add the SwitchLabel so we can
21750 quickly look this value up.
21752 * constant.cs: Implement a bunch of new constants. Rewrite
21753 Literal based on this. Made changes everywhere to adapt to this.
21755 * expression.cs (Expression.MakeByteBlob): Optimize routine by
21756 dereferencing array only once, and also copes with enumrations.
21758 bytes are two bytes wide, not one.
21760 (Cast): Perform constant conversions.
21762 * ecore.cs (TryImplicitIntConversion): Return literals instead of
21763 wrappers to the literals here.
21765 * expression.cs (DoNumericPromotions): long literals can converted
21766 to ulong implicity (this is taken care of elsewhere, but I was
21767 missing this spot).
21769 * ecore.cs (Expression.Literalize): Make the return type Literal,
21770 to improve type checking.
21772 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21774 2001-12-20 Miguel de Icaza <miguel@ximian.com>
21776 * literal.cs: Revert code from ravi that checked the bounds. The
21777 bounds are sane by the definition of the type itself.
21779 * typemanager.cs: Fix implementation of ImplementsInterface. We
21780 need to actually look up in our parent hierarchy for interfaces
21783 * const.cs: Use the underlying type for enumerations
21785 * delegate.cs: Compute the basename for the delegate creation,
21786 that should fix the delegate test case, and restore the correct
21787 Type Lookup semantics in rootcontext
21789 * rootcontext.cs: Revert Ravi's last patch. The correct way of
21790 referencing a nested type with the Reflection API is using the "+"
21793 * cs-parser.jay: Do not require EOF token at the end.
21795 2001-12-20 Ravi Pratap <ravi@ximian.com>
21797 * rootcontext.cs (LookupType): Concatenate type names with
21798 a '.' instead of a '+' The test suite passes again.
21800 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21801 field of the enumeration.
21803 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21804 the case when the member is an EventExpr.
21806 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21807 static has an associated instance expression.
21809 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21811 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21813 * class.cs (Event.Define): Register event and perform appropriate checks
21816 We define the Add and Remove methods even if the use provides none because
21817 in that case, we provide default implementations ourselves.
21819 Define a private field of the type of the event. This is done by the CSC compiler
21820 and we should be doing it too ;-)
21822 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
21823 More methods we use in code we generate.
21825 (multicast_delegate_type, delegate_type): Two separate types since the distinction
21828 (InitCoreTypes): Update accordingly for the above.
21830 * class.cs (Event.Emit): Generate code for default accessors that we provide
21832 (EmitDefaultMethod): Do the job in the above.
21834 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
21837 2001-12-20 Miguel de Icaza <miguel@ximian.com>
21839 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
21840 builders even if we were missing one.
21842 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
21843 pass the Basename as our class name instead of the Name. The
21844 basename will be correctly composed for us.
21846 * parameter.cs (Paramters): Now takes a Location argument.
21848 * decl.cs (DeclSpace.LookupType): Removed convenience function and
21849 make all the code call directly LookupType in RootContext and take
21850 this chance to pass the Location information everywhere.
21852 * Everywhere: pass Location information.
21854 2001-12-19 Miguel de Icaza <miguel@ximian.com>
21856 * class.cs (Constructor.Define): Updated way of detecting the
21857 length of the parameters.
21859 (TypeContainer.DefineType): Use basename as the type name for
21862 (TypeContainer.Define): Do not recursively define types here, as
21863 definition is taken care in order by the RootContext.
21865 * tree.cs: Keep track of namespaces in a per-file basis.
21867 * parameter.cs (Parameter.ComputeSignature): Update to use
21870 (Parameters.GetSignature): ditto.
21872 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21873 instead of a TypeContainer.
21875 (Interface.SemanticAnalysis): Use `this' instead of our parent to
21876 resolve names. Because we need to be resolve in our context, not
21879 * driver.cs: Implement response files.
21881 * class.cs (TypeContainer.DefineType): If we are defined, do not
21882 redefine ourselves.
21884 (Event.Emit): Emit the code for add/remove handlers.
21885 (Event.Define): Save the MethodBuilders for add/remove.
21887 * typemanager.cs: Use pair here too.
21889 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21890 DictionaryEntry requires the first argument to be non-null.
21892 (enum_declaration): Compute full name for registering the
21895 (delegate_declaration): Instead of using
21896 formal_parameter_list, use opt_formal_parameter_list as the list
21899 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21900 (EventParsing): New property that controls whether `add' and
21901 `remove' are returned as tokens or identifiers (for events);
21903 2001-12-19 Ravi Pratap <ravi@ximian.com>
21905 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21906 use MyEventBuilder only and let it wrap the real builder for us.
21908 (MyEventBuilder): Revamp constructor etc.
21910 Implement all operations that we perform on EventBuilder in precisely the same
21913 (FindMembers): Update to use the EventBuilder member.
21915 (Event.Emit): Update accordingly.
21917 2001-12-18 Ravi Pratap <ravi@ximian.com>
21919 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21920 by calling the appropriate methods.
21922 (GetCustomAttributes): Make stubs as they cannot possibly do anything
21925 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21927 2001-12-17 Ravi Pratap <ravi@ximian.com>
21929 * delegate.cs (Delegate.Populate): Check that the return type
21930 and various parameters types are indeed accessible.
21932 * class.cs (Constructor.Define): Same here.
21934 (Field.Define): Ditto.
21936 (Event.Define): Ditto.
21938 (Operator.Define): Check that the underlying Method defined itself
21939 correctly - so it's MethodBuilder should not be null.
21941 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21942 expression happens to be null.
21944 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21945 members but as of now we don't seem to be able to do anything really useful with it.
21947 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21948 not the EventBuilder.
21950 2001-12-18 Miguel de Icaza <miguel@ximian.com>
21952 * cs-tokenizer.cs: Add support for defines.
21953 Add support for #if, #elif, #else, #endif
21955 (eval_var): evaluates a variable.
21956 (eval): stubbed for evaluating functions.
21958 * cs-parser.jay: Pass the defines information
21960 * driver.cs: Add --define command line option.
21962 * decl.cs: Move MemberCore here.
21964 Make it the base class for DeclSpace. This allows us to catch and
21965 report 108 and 109 for everything now.
21967 * class.cs (TypeContainer.Define): Extract all the members
21968 before populating and emit the warning 108 (new keyword required
21969 to override) instead of having each member implement this.
21971 (MemberCore.Define): New abstract method, we will be using this in
21972 the warning reporting engine in Populate.
21974 (Operator.Define): Adjust to new MemberCore protocol.
21976 * const.cs (Const): This does not derive from Expression, it is a
21977 temporary object we use to create fields, it is a MemberCore.
21979 * class.cs (Method.Define): Allow the entry point to be in a
21982 * driver.cs: Rewrite the argument handler to clean it up a bit.
21984 * rootcontext.cs: Made it just an auxiliary namespace feature by
21985 making everything static.
21987 * driver.cs: Adapt code to use RootContext type name instead of
21990 * delegate.cs: Remove RootContext argument.
21992 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21995 * class.cs (Event.Define): The lookup can fail.
21997 * cs-tokenizer.cs: Begin implementation of pre-procesor.
21999 * expression.cs: Resolve the this instance before invoking the code.
22001 2001-12-17 Miguel de Icaza <miguel@ximian.com>
22003 * cs-parser.jay: Add a production in element_access that allows
22004 the thing to become a "type" reference. This way we can parse
22005 things like "(string [])" as a type.
22007 Note that this still does not handle the more complex rules of
22011 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
22013 * ecore.cs: (CopyNewMethods): new utility function used to
22014 assemble the list of methods from running FindMembers.
22016 (MemberLookup): Rework FindMembers so that
22018 2001-12-16 Miguel de Icaza <miguel@ximian.com>
22020 * class.cs (TypeContainer): Remove Delegates who fail to be
22023 * delegate.cs (Populate): Verify that we dont get null return
22024 values. TODO: Check for AsAccessible.
22026 * cs-parser.jay: Use basename to emit error 574 (destructor should
22027 have the same name as container class), not the full name.
22029 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
22030 possible representation.
22032 Also implements integer type suffixes U and L.
22034 2001-12-15 Miguel de Icaza <miguel@ximian.com>
22036 * expression.cs (ArrayCreation.DoResolve): We need to do the
22037 argument resolution *always*.
22039 * decl.cs: Make this hold the namespace. Hold the root context as
22041 (LookupType): Move here.
22043 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
22045 * location.cs (Row, Name): Fixed the code, it was always returning
22046 references to the first file.
22048 * interface.cs: Register properties defined through interfaces.
22050 * driver.cs: Add support for globbing on the command line
22052 * class.cs (Field): Make it derive from MemberCore as well.
22055 2001-12-15 Ravi Pratap <ravi@ximian.com>
22057 * class.cs (Event::Define): Check that the type of the event is a delegate
22058 type else flag error #66.
22060 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
22063 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
22064 values of EntryPoint, CharSet etc etc.
22066 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
22068 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
22069 be null and we should ignore this. I am not sure if this is really clean. Apparently,
22070 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
22071 which needs this to do its work.
22073 * ../errors/cs0066.cs : Add.
22075 2001-12-14 Miguel de Icaza <miguel@ximian.com>
22077 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
22080 * class.cs: (MethodSignature.MethodSignature): Removed hack that
22081 clears out the parameters field.
22082 (MemberSignatureCompare): Cleanup
22084 (MemberCore): New base class used to share code between MethodCore
22087 (RegisterRequiredImplementations) BindingFlags.Public requires
22088 either BindingFlags.Instace or Static. Use instance here.
22090 (Property): Refactored code to cope better with the full spec.
22092 * parameter.cs (GetParameterInfo): Return an empty array instead
22095 * class.cs (Property): Abstract or extern properties have no bodies.
22097 * parameter.cs (GetParameterInfo): return a zero-sized array.
22099 * class.cs (TypeContainer.MethodModifiersValid): Move all the
22100 method modifier validation to the typecontainer so we can reuse
22101 this on properties.
22103 (MethodCore.ParameterTypes): return an empty sized array of types.
22105 (Property.Define): Test property modifier validity.
22107 Add tests for sealed/override too.
22109 (Method.Emit): abstract or extern methods have no bodies.
22111 2001-12-14 Ravi Pratap <ravi@ximian.com>
22113 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
22116 (Method::Define, ::Emit): Modify accordingly.
22118 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
22120 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
22122 * makefile: Pass in /unsafe.
22124 2001-12-13 Miguel de Icaza <miguel@ximian.com>
22126 * class.cs (MakeKey): Kill routine.
22128 * class.cs (TypeContainer.Define): Correctly define explicit
22129 method implementations (they require the full interface name plus
22132 * typemanager.cs: Deply the PtrHashtable here and stop using the
22133 lame keys. Things work so much better.
22135 This of course broke everyone who depended on `RegisterMethod' to
22136 do the `test for existance' test. This has to be done elsewhere.
22138 * support.cs (PtrHashtable): A hashtable that avoid comparing with
22139 the object stupid Equals method (because, that like fails all over
22140 the place). We still do not use it.
22142 * class.cs (TypeContainer.SetRequiredInterface,
22143 TypeContainer.RequireMethods): Killed these two routines and moved
22144 all the functionality to RegisterRequiredImplementations.
22146 (TypeContainer.RegisterRequiredImplementations): This routine now
22147 registers all the implementations required in an array for the
22148 interfaces and abstract methods. We use an array of structures
22149 which can be computed ahead of time to reduce memory usage and we
22150 also assume that lookups are cheap as most classes will not
22151 implement too many interfaces.
22153 We also avoid creating too many MethodSignatures.
22155 (TypeContainer.IsInterfaceMethod): Update and optionally does not
22156 clear the "pending" bit if we find that there are problems with
22159 (TypeContainer.VerifyPendingMethods): Update to report errors of
22160 methods that look like implementations but are not.
22162 (TypeContainer.Define): Add support for explicit interface method
22165 2001-12-12 Miguel de Icaza <miguel@ximian.com>
22167 * typemanager.cs: Keep track of the parameters here instead of
22168 being a feature of the TypeContainer.
22170 * class.cs: Drop the registration of parameters here, as
22171 InterfaceMethods are also interface declarations.
22173 * delegate.cs: Register methods with the TypeManager not only with
22174 the TypeContainer. This code was buggy.
22176 * interface.cs: Full registation here.
22178 2001-12-11 Miguel de Icaza <miguel@ximian.com>
22180 * expression.cs: Remove reducer for binary expressions, it can not
22183 * const.cs: Put here the code that used to go into constant.cs
22185 * constant.cs: Put here the code for constants, this is a new base
22186 class for Literals.
22188 * literal.cs: Make Literal derive from Constant.
22190 2001-12-09 Miguel de Icaza <miguel@ximian.com>
22192 * statement.cs (Return.Emit): Report error 157 if the user
22193 attempts to return from a finally block.
22195 (Return.Emit): Instead of emitting a return, jump to the end of
22198 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
22199 LocalBuilder to store the result of the function. ReturnLabel is
22200 the target where we jump.
22203 2001-12-09 Radek Doulik <rodo@ximian.com>
22205 * cs-parser.jay: remember alias in current namespace
22207 * ecore.cs (SimpleName::DoResolve): use aliases for types or
22210 * class.cs (LookupAlias): lookup alias in my_namespace
22212 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
22214 (LookupAlias): lookup alias in this and if needed in parent
22217 2001-12-08 Miguel de Icaza <miguel@ximian.com>
22221 * rootcontext.cs: (ModuleBuilder) Made static, first step into
22222 making things static. I need this to avoid passing the
22223 TypeContainer when calling ParameterType.
22225 * support.cs (InternalParameters.ParameterType): Remove ugly hack
22226 that did string manipulation to compute the type and then call
22227 GetType. Use Parameter.ParameterType instead.
22229 * cs-tokenizer.cs: Consume the suffix for floating values.
22231 * expression.cs (ParameterReference): figure out whether this is a
22232 reference parameter or not. Kill an extra variable by computing
22233 the arg_idx during emission.
22235 * parameter.cs (Parameters.GetParameterInfo): New overloaded
22236 function that returns whether a parameter is an out/ref value or not.
22238 (Parameter.ParameterType): The type of the parameter (base,
22239 without ref/out applied).
22241 (Parameter.Resolve): Perform resolution here.
22242 (Parameter.ExternalType): The full type (with ref/out applied).
22244 * statement.cs (Using.Emit, Using.EmitExpression): Implement
22245 support for expressions on the using statement.
22247 2001-12-07 Miguel de Icaza <miguel@ximian.com>
22249 * statement.cs (Using.EmitLocalVariableDecls): Split the
22250 localvariable handling of the using statement.
22252 (Block.EmitMeta): Keep track of variable count across blocks. We
22253 were reusing slots on separate branches of blocks.
22255 (Try.Emit): Emit the general code block, we were not emitting it.
22257 Check the type of the declaration to be an IDisposable or
22258 something that can be implicity converted to it.
22260 Emit conversions if required.
22262 * ecore.cs (EmptyExpression): New utility class.
22263 (Expression.ImplicitConversionExists): New utility function.
22265 2001-12-06 Miguel de Icaza <miguel@ximian.com>
22267 * statement.cs (Using): Implement.
22269 * expression.cs (LocalVariableReference): Support read only variables.
22271 * statement.cs: Remove the explicit emit for the Leave opcode.
22272 (VariableInfo): Add a readonly field.
22274 2001-12-05 Miguel de Icaza <miguel@ximian.com>
22276 * ecore.cs (ConvCast): new class used to encapsulate the various
22277 explicit integer conversions that works in both checked and
22278 unchecked contexts.
22280 (Expression.ConvertNumericExplicit): Use new ConvCast class to
22281 properly generate the overflow opcodes.
22283 2001-12-04 Miguel de Icaza <miguel@ximian.com>
22285 * statement.cs: The correct type for the EmptyExpression is the
22286 element_type, not the variable type. Ravi pointed this out.
22288 2001-12-04 Ravi Pratap <ravi@ximian.com>
22290 * class.cs (Method::Define): Handle PInvoke methods specially
22291 by using DefinePInvokeMethod instead of the usual one.
22293 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
22294 above to do the task of extracting information and defining the method.
22296 2001-12-04 Ravi Pratap <ravi@ximian.com>
22298 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
22299 of the condition for string type.
22301 (Emit): Move that here.
22303 (ArrayCreation::CheckIndices): Keep string literals in their expression
22306 (EmitDynamicInitializers): Handle strings appropriately.
22308 2001-12-04 Miguel de Icaza <miguel@ximian.com>
22310 * codegen.cs (EmitContext): Replace multiple variables with a
22311 single pointer to the current Switch statement.
22313 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
22316 2001-12-03 Miguel de Icaza <miguel@ximian.com>
22320 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
22323 (Foreach.Emit): Foreach on arrays was not setting
22324 up the loop variables (for break/continue).
22326 (GotoCase): Semi-implented.
22328 2001-12-03 Ravi Pratap <ravi@ximian.com>
22330 * attribute.cs (CheckAttribute): Handle system attributes by using
22331 Attribute.GetAttributes to examine information we need.
22333 (GetValidPlaces): Same here.
22335 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
22337 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
22339 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
22341 (Method::Define): Set appropriate flags if we have a DllImport attribute.
22343 (Method::Emit): Handle the case when we are a PInvoke method.
22345 2001-12-03 Miguel de Icaza <miguel@ximian.com>
22347 * expression.cs: Use ResolveWithSimpleName on compound names.
22349 2001-12-02 Ravi Pratap <ravi@ximian.com>
22351 * constant.cs (EmitConstant): Make sure we resolve the associated expression
22352 before trying to reduce it.
22354 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
22356 * constant.cs (LookupConstantValue): Implement.
22358 (EmitConstant): Use the above in emitting the constant.
22360 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
22361 that are user-defined by doing a LookupConstantValue on them.
22363 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
22366 2001-11-29 Miguel de Icaza <miguel@ximian.com>
22368 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
22370 (BaseAccess.DoResolve): Implement.
22372 (MemberAccess.DoResolve): Split this routine into a
22373 ResolveMemberAccess routine that can be used independently
22375 2001-11-28 Miguel de Icaza <miguel@ximian.com>
22377 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
22378 As that share bits of the implementation. Is returns a boolean,
22379 while As returns the Type that is being probed.
22381 2001-12-01 Ravi Pratap <ravi@ximian.com>
22383 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
22384 instead of a Literal - much easier.
22386 (EnumInTransit): Remove - utterly useless :-)
22388 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
22390 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
22392 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
22393 chain when we have no associated expression.
22395 2001-11-30 Ravi Pratap <ravi@ximian.com>
22397 * constant.cs (Define): Use Location while reporting the errror.
22399 Also emit a warning when 'new' is used and there is no inherited
22402 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
22405 (LookupEnumValue): Implement to lookup an enum member's value and define it
22408 (Populate): Re-write accordingly to use the above routine.
22410 2001-11-27 Miguel de Icaza <miguel@ximian.com>
22412 * expression.cs (This): Fix prototype for DoResolveLValue to
22413 override the base class DoResolveLValue.
22415 * cs-parser.cs: Report errors cs574 and cs575 (destructor
22418 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
22419 (we need to load the address of the field here). This fixes
22422 (FieldExpr.DoResolveLValue): Call the DoResolve
22423 function to initialize the Instance expression.
22425 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
22426 correctly the GetEnumerator operation on a value type.
22428 * cs-parser.jay: Add more simple parsing error catches.
22430 * statement.cs (Switch): Add support for string switches.
22431 Handle null specially.
22433 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
22435 2001-11-28 Ravi Pratap <ravi@ximian.com>
22437 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
22439 (declare_local_constant): New helper function.
22441 * statement.cs (AddConstant): Keep a separate record of constants
22443 (IsConstant): Implement to determine if a variable is a constant.
22445 (GetConstantExpression): Implement.
22447 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
22449 * statement.cs (IsVariableDefined): Re-write.
22451 2001-11-27 Ravi Pratap <ravi@ximian.com>
22453 * class.cs (TypeContainer::FindMembers): Look for constants
22454 in the case when we are looking for MemberTypes.Field
22456 * expression.cs (MemberAccess::DoResolve): Check that in the
22457 case we are a FieldExpr and a Literal, we are not being accessed
22458 by an instance reference.
22460 * cs-parser.jay (local_constant_declaration): Implement.
22462 (declaration_statement): Implement for constant declarations.
22464 2001-11-26 Miguel de Icaza <miguel@ximian.com>
22466 * statement.cs (Switch): Catch double defaults.
22468 (Switch): More work on the switch() statement
22469 implementation. It works for integral values now, need to finish
22473 2001-11-24 Miguel de Icaza <miguel@ximian.com>
22475 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
22476 integer literals into other integer literals. To be used by
22479 2001-11-24 Ravi Pratap <ravi@ximian.com>
22481 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
22484 (EmitDynamicInitializers): Cope with the above since we extract data
22485 directly from ArrayData now.
22487 (ExpectInitializers): Keep track of whether initializers are mandatory
22490 (Bounds): Make it a hashtable to prevent the same dimension being
22491 recorded for every element in that dimension.
22493 (EmitDynamicInitializers): Fix bug which prevented the Set array method
22496 Also fix bug which was causing the indices to be emitted in the reverse
22499 2001-11-24 Miguel de Icaza <miguel@ximian.com>
22501 * expression.cs (ArrayCreation): Implement the bits that Ravi left
22502 unfinished. They do not work, because the underlying code is
22505 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22507 * cs-parser.jay: Remove bogus fixme.
22509 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
22510 on Switch statement.
22512 2001-11-23 Ravi Pratap <ravi@ximian.com>
22514 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
22517 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
22518 parameter. Apparently, any expression is allowed.
22520 (ValidateInitializers): Update accordingly.
22522 (CheckIndices): Fix some tricky bugs thanks to recursion.
22524 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
22525 I was being completely brain-dead.
22527 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
22528 and re-write acordingly.
22530 (DelegateInvocation): Re-write accordingly.
22532 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
22534 (MakeByteBlob): Handle types more correctly.
22536 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
22537 initialization from expressions but it is incomplete because I am a complete
22540 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22542 * statement.cs (If.Emit): Fix a bug that generated incorrect code
22543 on If. Basically, we have to return `true' (ie, we do return to
22544 our caller) only if both branches of the if return.
22546 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
22547 short-circuit operators, handle them as short circuit operators.
22549 (Cast.DoResolve): Resolve type.
22550 (Cast.Cast): Take an expression as the target type.
22552 * cs-parser.jay (cast_expression): Remove old hack that only
22553 allowed a limited set of types to be handled. Now we take a
22554 unary_expression and we resolve to a type during semantic
22557 Use the grammar productions from Rhys to handle casts (this is
22558 not complete like Rhys syntax yet, we fail to handle that corner
22559 case that C# has regarding (-x), but we will get there.
22561 2001-11-22 Ravi Pratap <ravi@ximian.com>
22563 * class.cs (EmitFieldInitializer): Take care of the case when we have a
22564 field which is an array type.
22566 * cs-parser.jay (declare_local_variables): Support array initialization too.
22568 * typemanager.cs (MakeKey): Implement.
22570 (everywhere): Use the above appropriately.
22572 * cs-parser.jay (for_statement): Update for array initialization while
22573 declaring variables.
22575 * ecore.cs : The error message was correct, it's the variable's names that
22576 were misleading ;-) Make the code more readable.
22578 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
22579 the correct type etc.
22581 (ConvertExplicit): Handle Enum types by examining the underlying type.
22583 2001-11-21 Ravi Pratap <ravi@ximian.com>
22585 * parameter.cs (GetCallingConvention): Always return
22586 CallingConventions.Standard for now.
22588 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22590 * expression.cs (Binary.ResolveOperator): Update the values of `l'
22591 and `r' after calling DoNumericPromotions.
22593 * ecore.cs: Fix error message (the types were in the wrong order).
22595 * statement.cs (Foreach.ProbeCollectionType): Need to pass
22596 BindingFlags.Instance as well
22598 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
22599 implicit int literal conversion in an empty cast so that we
22600 propagate the right type upstream.
22602 (UnboxCast): new class used to unbox value types.
22603 (Expression.ConvertExplicit): Add explicit type conversions done
22606 (Expression.ImplicitNumericConversion): Oops, forgot to test for
22607 the target type before applying the implicit LongLiterals to ULong
22610 2001-11-21 Miguel de Icaza <miguel@ximian.com>
22612 * cs-parser.jay (for_statement): Reworked the way For works: now
22613 we declare manually any variables that are introduced in
22614 for_initializer to solve the problem of having out-of-band code
22615 emition (that is what got for broken).
22617 (declaration_statement): Perform the actual variable declaration
22618 that used to be done in local_variable_declaration here.
22620 (local_variable_declaration): Do not declare anything, just pass
22621 the information on a DictionaryEntry
22623 2001-11-20 Ravi Pratap <ravi@ximian.com>
22625 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
22626 re-write of the logic to now make it recursive.
22628 (UpdateIndices): Re-write accordingly.
22630 Store element data in a separate ArrayData list in the above methods.
22632 (MakeByteBlob): Implement to dump the array data into a byte array.
22634 2001-11-19 Ravi Pratap <ravi@ximian.com>
22636 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
22639 * constant.cs (Define): Implement.
22641 (EmitConstant): Re-write fully.
22643 Pass in location info.
22645 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
22648 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
22649 DictionaryEntry since we need location info too.
22651 (constant_declaration): Update accordingly.
22653 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
22654 code into another method : UpdateIndices.
22656 2001-11-18 Ravi Pratap <ravi@ximian.com>
22658 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
22659 some type checking etc.
22661 2001-11-17 Ravi Pratap <ravi@ximian.com>
22663 * expression.cs (ArrayCreation::ValidateInitializers): Implement
22664 bits to provide dimension info if the user skips doing that.
22666 Update second constructor to store the rank correctly.
22668 2001-11-16 Ravi Pratap <ravi@ximian.com>
22670 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
22671 and try to implement.
22673 * ../errors/cs0150.cs : Add.
22675 * ../errors/cs0178.cs : Add.
22677 2001-11-16 Miguel de Icaza <miguel@ximian.com>
22679 * statement.cs: Implement foreach on multi-dimensional arrays.
22681 * parameter.cs (Parameters.GetParameterByName): Also lookup the
22682 name of the params argument.
22684 * expression.cs: Use EmitStoreOpcode to get the right opcode while
22685 initializing the array.
22687 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
22688 we can use this elsewhere.
22690 * statement.cs: Finish implementation of foreach for single
22693 * cs-parser.jay: Use an out-of-band stack to pass information
22694 around, I wonder why I need this.
22696 foreach_block: Make the new foreach_block the current_block.
22698 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
22699 function used to return a static Parameters structure. Used for
22700 empty parameters, as those are created very frequently.
22702 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
22704 2001-11-15 Ravi Pratap <ravi@ximian.com>
22706 * interface.cs : Default modifier is private, not public. The
22707 make verify test passes again.
22709 2001-11-15 Ravi Pratap <ravi@ximian.com>
22711 * support.cs (ReflectionParameters): Fix logic to determine
22712 whether the last parameter is a params one. Test 9 passes again.
22714 * delegate.cs (Populate): Register the builders we define with
22715 RegisterParameterForBuilder. Test 19 passes again.
22717 * cs-parser.jay (property_declaration): Reference $6 instead
22718 of $$ to get at the location.
22720 (indexer_declaration): Similar stuff.
22722 (attribute): Ditto.
22724 * class.cs (Property): Register parameters for the Get and Set methods
22725 if they exist. Test 23 passes again.
22727 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
22728 call to EmitArguments as we are sure there aren't any params arguments.
22729 Test 32 passes again.
22731 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
22732 IndexOutOfRangeException.
22734 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
22735 Test 33 now passes again.
22737 2001-11-15 Miguel de Icaza <miguel@ximian.com>
22739 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22740 broke a bunch of things. Will have to come up with a better way
22741 of tracking locations.
22743 * statement.cs: Implemented foreach for single dimension arrays.
22745 2001-11-09 Miguel de Icaza <miguel@ximian.com>
22747 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22748 an error. This removes the lookup from the critical path.
22750 * cs-parser.jay: Removed use of temporary_loc, which is completely
22753 2001-11-14 Miguel de Icaza <miguel@ximian.com>
22755 * support.cs (ReflectionParameters.ParameterModifier): Report
22756 whether the argument is a PARAMS argument or not.
22758 * class.cs: Set the attribute `ParamArrayAttribute' on the
22759 parameter argument.
22761 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22762 and cons_param_array_attribute (ConstructorInfo for
22763 ParamArrayAttribute).,
22765 * codegen.cs: Emit the return using the `Return' statement, that
22766 way we can report the error correctly for missing return values.
22768 * class.cs (Method.Emit): Clean up.
22770 * expression.cs (Argument.Resolve): Take another argument: the
22771 location where this argument is used. Notice that this is not
22772 part of the "Argument" class as to reduce the size of the
22773 structure (we know the approximate location anyways).
22775 Test if the argument is a variable-reference, if not, then
22776 complain with a 206.
22778 (Argument.Emit): Emit addresses of variables.
22780 (Argument.FullDesc): Simplify.
22782 (Invocation.DoResolve): Update for Argument.Resolve.
22784 (ElementAccess.DoResolve): ditto.
22786 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22787 method should be virtual, as this method is always virtual.
22789 (NewDelegate.DoResolve): Update for Argument.Resolve.
22791 * class.cs (ConstructorInitializer.DoResolve): ditto.
22793 * attribute.cs (Attribute.Resolve): ditto.
22795 2001-11-13 Miguel de Icaza <miguel@ximian.com>
22797 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22799 * expression.cs (ParameterReference): Drop IStackStorage and implement
22800 IAssignMethod instead.
22802 (LocalVariableReference): ditto.
22804 * ecore.cs (FieldExpr): Drop IStackStorage and implement
22805 IAssignMethod instead.
22807 2001-11-13 Miguel de Icaza <miguel@ximian.com>
22809 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22810 enumerations that are used in heavily used structures derive from
22811 byte in a laughable and pathetic attempt to reduce memory usage.
22812 This is the kind of pre-optimzations that you should not do at
22813 home without adult supervision.
22815 * expression.cs (UnaryMutator): New class, used to handle ++ and
22816 -- separatedly from the other unary operators. Cleans up the
22817 code, and kills the ExpressionStatement dependency in Unary.
22819 (Unary): Removed `method' and `Arguments' from this class, making
22820 it smaller, and moving it all to SimpleCall, so I can reuse this
22821 code in other locations and avoid creating a lot of transient data
22822 strucutres when not required.
22824 * cs-parser.jay: Adjust for new changes.
22826 2001-11-11 Miguel de Icaza <miguel@ximian.com>
22828 * enum.cs (Enum.Populate): If there is a failure during
22831 * cs-parser.jay (opt_enum_base): we used to catch type errors
22832 here, but this is really incorrect. The type error should be
22833 catched during semantic analysis.
22835 2001-12-11 Ravi Pratap <ravi@ximian.com>
22837 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
22838 current_local_parameters as expected since I, in my stupidity, had forgotten
22841 * attribute.cs (GetValidPlaces): Fix stupid bug.
22843 * class.cs (Method::Emit): Perform check on applicability of attributes.
22845 (Constructor::Emit): Ditto.
22847 (Field::Emit): Ditto.
22849 (Field.Location): Store location information.
22851 (Property, Event, Indexer, Operator): Ditto.
22853 * cs-parser.jay (field_declaration): Pass in location for each field.
22855 * ../errors/cs0592.cs : Add.
22857 2001-11-12 Ravi Pratap <ravi@ximian.com>
22859 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22861 (InitCoreTypes): Update accordingly.
22863 (RegisterAttrType, LookupAttr): Implement.
22865 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22866 info about the same.
22868 (Resolve): Update to populate the above as necessary.
22870 (Error592): Helper.
22872 (GetValidPlaces): Helper to the above.
22874 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22876 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22878 2001-11-12 Ravi Pratap <ravi@ximian.com>
22880 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22882 * ../errors/cs0617.cs : Add.
22884 2001-11-11 Ravi Pratap <ravi@ximian.com>
22886 * enum.cs (Emit): Rename to Populate to be more consistent with what
22887 we expect it to do and when exactly it is called.
22889 * class.cs, rootcontext.cs : Update accordingly.
22891 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22892 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22894 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22896 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22897 of a fieldinfo using the above, when dealing with a FieldBuilder.
22899 2001-11-10 Ravi Pratap <ravi@ximian.com>
22901 * ../errors/cs0031.cs : Add.
22903 * ../errors/cs1008.cs : Add.
22905 * ../errrors/cs0543.cs : Add.
22907 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22910 (FindMembers): Implement.
22912 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22913 enums and delegates too.
22915 (enum_types): Rename to builder_to_enum.
22917 (delegate_types): Rename to builder_to_delegate.
22919 * delegate.cs (FindMembers): Implement.
22921 2001-11-09 Ravi Pratap <ravi@ximian.com>
22923 * typemanager.cs (IsEnumType): Implement.
22925 * enum.cs (Emit): Re-write parts to account for the underlying type
22926 better and perform checking etc.
22928 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22929 of the underlying type.
22931 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22934 * enum.cs (error31): Helper to report error #31.
22936 * cs-parser.jay (enum_declaration): Store location of each member too.
22938 * enum.cs (member_to_location): New hashtable.
22940 (AddEnumMember): Update location hashtable.
22942 (Emit): Use the location of each member while reporting errors.
22944 2001-11-09 Miguel de Icaza <miguel@ximian.com>
22946 * cs-parser.jay: A for_initializer if is a
22947 local_variable_declaration really ammount to have an implicit
22948 block with the variable declaration and no initializer for for.
22950 * statement.cs (For.Emit): Cope with null initializers.
22952 This fixes the infinite loop on for initializers.
22954 2001-11-08 Miguel de Icaza <miguel@ximian.com>
22956 * enum.cs: More cleanup.
22958 * ecore.cs: Remove dead code.
22960 * class.cs (Property.Emit): More simplification.
22961 (Event.Emit): ditto.
22963 Reworked to have less levels of indentation.
22965 2001-11-08 Ravi Pratap <ravi@ximian.com>
22967 * class.cs (Property): Emit attributes.
22977 * enum.cs (Emit): Ditto.
22979 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22982 * class.cs (Field, Event, etc.): Move attribute generation into the
22983 Emit method everywhere.
22985 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22986 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22987 as we had no way of defining nested enums !
22989 * rootcontext.cs : Adjust code accordingly.
22991 * typemanager.cs (AddEnumType): To keep track of enum types separately.
22993 2001-11-07 Ravi Pratap <ravi@ximian.com>
22995 * expression.cs (EvalConstantExpression): Move into ecore.cs
22997 * enum.cs (Enum): Rename some members and make them public and readonly
22998 according to our convention.
23000 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
23003 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
23005 (Enum::Emit): Write a simple version for now which doesn't try to compute
23006 expressions. I shall modify this to be more robust in just a while.
23008 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
23010 (TypeContainer::CloseType): Create the Enum types too.
23012 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
23014 * expression.cs (EvalConstantExpression): Get rid of completely.
23016 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
23017 user-defined values and other cases.
23019 (IsValidEnumLiteral): Helper function.
23021 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
23022 out there in the case we had a literal FieldExpr.
23024 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
23026 (Literalize): Revamp a bit to take two arguments.
23028 (EnumLiteral): New class which derives from Literal to wrap enum literals.
23030 2001-11-06 Ravi Pratap <ravi@ximian.com>
23032 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
23034 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
23036 (Resolve): Use the above to ensure we have proper initializers.
23038 2001-11-05 Ravi Pratap <ravi@ximian.com>
23040 * expression.cs (Expression::EvalConstantExpression): New method to
23041 evaluate constant expressions.
23043 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
23045 2001-11-07 Miguel de Icaza <miguel@ximian.com>
23047 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
23050 (Binary.ResolveOperator): Handle operator != (object a, object b)
23051 and operator == (object a, object b);
23053 (Binary.DoNumericPromotions): Indicate whether the numeric
23054 promotion was possible.
23056 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
23059 Made the ArrayAccess implement interface IAssignMethod instead of
23060 IStackStore as the order in which arguments are passed reflects
23063 * assign.cs: Instead of using expr.ExprClass to select the way of
23064 assinging, probe for the IStackStore/IAssignMethod interfaces.
23066 * typemanager.cs: Load InitializeArray definition.
23068 * rootcontext.cs (RootContext.MakeStaticData): Used to define
23069 static data that can be used to initialize arrays.
23071 2001-11-05 Miguel de Icaza <miguel@ximian.com>
23073 * expression.cs: Handle operator== and operator!= for booleans.
23075 (Conditioal.Reduce): Implement reducer for the ?: operator.
23077 (Conditional.Resolve): Implement dead code elimination.
23079 (Binary.Resolve): Catch string literals and return a new
23080 concatenated string.
23082 (Unary.Reduce): Implement reduction of unary expressions.
23084 * ecore.cs: Split out the expression core handling here.
23086 (Expression.Reduce): New method used to perform constant folding
23087 and CSE. This is needed to support constant-expressions.
23089 * statement.cs (Statement.EmitBoolExpression): Pass true and false
23090 targets, and optimize for !x.
23092 2001-11-04 Ravi Pratap <ravi@ximian.com>
23094 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
23095 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
23096 set custom atttributes.
23098 * literal.cs (Literal::GetValue): New abstract method to return the actual
23099 value of the literal, cast as an object.
23101 (*Literal): Implement GetValue method.
23103 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
23104 expressions to the arraylist but objects of type Argument.
23106 * class.cs (TypeContainer::Emit): Emit our attributes too.
23108 (Method::Emit, Constructor::Emit): Ditto.
23110 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
23111 to be ignoring earlier.
23113 2001-11-03 Ravi Pratap <ravi@ximian.com>
23115 * attribute.cs (AttributeSection::Define): Implement to do the business
23116 of constructing a CustomAttributeBuilder.
23118 (Attribute): New trivial class. Increases readability of code.
23120 * cs-parser.jay : Update accordingly.
23122 (positional_argument_list, named_argument_list, named_argument): New rules
23124 (attribute_arguments): Use the above so that we are more correct.
23126 2001-11-02 Ravi Pratap <ravi@ximian.com>
23128 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
23129 to perform all checks for a method with a params parameter.
23131 (Invocation::OverloadResolve): Update to use the above method and therefore
23132 cope correctly with params method invocations.
23134 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
23137 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
23138 constructors in our parent too because we can't afford to miss out on
23141 * attribute.cs (AttributeSection): New name for the class Attribute
23143 Other trivial changes to improve readability.
23145 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
23146 use the new class names.
23148 2001-11-01 Ravi Pratap <ravi@ximian.com>
23150 * class.cs (Method::Define): Complete definition for params types too
23152 (Indexer::Define): Ditto.
23154 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
23155 Cope everywhere with a request for info about the array parameter.
23157 2001-11-01 Ravi Pratap <ravi@ximian.com>
23159 * tree.cs (RecordNamespace): Fix up to check for the correct key.
23161 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
23162 local_variable_type to extract the string corresponding to the type.
23164 (local_variable_type): Fixup the action to use the new helper method.
23166 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
23169 * expression.cs : Clean out code which uses the above.
23171 2001-10-31 Ravi Pratap <ravi@ximian.com>
23173 * typemanager.cs (RegisterMethod): Check if we already have an existing key
23174 and bale out if necessary by returning a false.
23176 (RegisterProperty): Ditto.
23178 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
23179 and print out appropriate error messages.
23181 * interface.cs (everywhere): Ditto.
23183 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
23184 location to constructor.
23186 * class.cs (Property, Event, Indexer): Update accordingly.
23188 * ../errors/cs111.cs : Added.
23190 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
23191 of a method, as laid down by the spec.
23193 (Invocation::OverloadResolve): Use the above method.
23195 2001-10-31 Ravi Pratap <ravi@ximian.com>
23197 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
23198 now take a TypeContainer and a Parameters object.
23200 (ParameterData): Modify return type of ParameterModifier method to be
23201 Parameter.Modifier and not a string.
23203 (ReflectionParameters, InternalParameters): Update accordingly.
23205 * expression.cs (Argument::GetParameterModifier): Same here.
23207 * support.cs (InternalParameters::ParameterType): Find a better way of determining
23208 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
23209 symbol in it at all so maybe this is only for now.
23211 2001-10-30 Ravi Pratap <ravi@ximian.com>
23213 * support.cs (InternalParameters): Constructor now takes an extra argument
23214 which is the actual Parameters class.
23216 (ParameterDesc): Update to provide info on ref/out modifiers.
23218 * class.cs (everywhere): Update call to InternalParameters to pass in
23219 the second argument too.
23221 * support.cs (ParameterData): Add ParameterModifier, which is a method
23222 to return the modifier info [ref/out etc]
23224 (InternalParameters, ReflectionParameters): Implement the above.
23226 * expression.cs (Argument::ParameterModifier): Similar function to return
23227 info about the argument's modifiers.
23229 (Invocation::OverloadResolve): Update to take into account matching modifiers
23232 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
23233 a new SetFormalParameters object which we pass to InternalParameters.
23235 2001-10-30 Ravi Pratap <ravi@ximian.com>
23237 * expression.cs (NewArray): Merge into the ArrayCreation class.
23239 2001-10-29 Ravi Pratap <ravi@ximian.com>
23241 * expression.cs (NewArray): Merge classes NewBuiltinArray and
23242 NewUserdefinedArray into one as there wasn't much of a use in having
23245 * expression.cs (Argument): Change field's name to ArgType from Type.
23247 (Type): New readonly property which returns the proper type, taking into
23248 account ref/out modifiers.
23250 (everywhere): Adjust code accordingly for the above.
23252 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
23253 whether we are emitting for a ref or out parameter.
23255 * expression.cs (Argument::Emit): Use the above field to set the state.
23257 (LocalVariableReference::Emit): Update to honour the flag and emit the
23260 * parameter.cs (Attributes): Set the correct flags for ref parameters.
23262 * expression.cs (Argument::FullDesc): New function to provide a full desc.
23264 * support.cs (ParameterData): Add method ParameterDesc to the interface.
23266 (ReflectionParameters, InternalParameters): Implement the above method.
23268 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
23271 (Invocation::FullMethodDesc): Ditto.
23273 2001-10-29 Miguel de Icaza <miguel@ximian.com>
23275 * cs-parser.jay: Add extra production for the second form of array
23278 * expression.cs (ArrayCreation): Update to reflect the above
23281 * Small changes to prepare for Array initialization.
23283 2001-10-28 Miguel de Icaza <miguel@ximian.com>
23285 * typemanager.cs (ImplementsInterface): interface might be null;
23286 Deal with this problem;
23288 Also, we do store negative hits on the cache (null values), so use
23289 this instead of calling t.GetInterfaces on the type everytime.
23291 2001-10-28 Ravi Pratap <ravi@ximian.com>
23293 * typemanager.cs (IsBuiltinType): New method to help determine the same.
23295 * expression.cs (New::DoResolve): Get rid of array creation code and instead
23296 split functionality out into different classes.
23298 (New::FormArrayType): Move into NewBuiltinArray.
23300 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
23303 (NewBuiltinArray): New class to handle creation of built-in arrays.
23305 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
23306 account creation of one-dimensional arrays.
23308 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
23310 (NewUserdefinedArray::DoResolve): Implement.
23312 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
23314 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
23315 we maintain inside the TypeManager. This is necessary to perform lookups on the
23318 (LookupType): Update to perform GetType on the module builders too.
23320 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
23322 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
23324 2001-10-23 Ravi Pratap <ravi@ximian.com>
23326 * expression.cs (New::DoResolve): Implement guts of array creation.
23328 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
23330 2001-10-27 Miguel de Icaza <miguel@ximian.com>
23332 * expression.cs: Fix bug I introduced lsat night that broke
23335 (Expression.Resolve): Report a 246 error (can not resolve name)
23336 if we find a SimpleName in the stream.
23338 (Expression.ResolveLValue): Ditto.
23340 (Expression.ResolveWithSimpleName): This function is a variant of
23341 ResolveName, this one allows SimpleNames to be returned without a
23342 warning. The only consumer of SimpleNames is MemberAccess
23344 2001-10-26 Miguel de Icaza <miguel@ximian.com>
23346 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
23347 might arrive here. I have my doubts that this is correct.
23349 * statement.cs (Lock): Implement lock statement.
23351 * cs-parser.jay: Small fixes to support `lock' and `using'
23353 * cs-tokenizer.cs: Remove extra space
23355 * driver.cs: New flag --checked, allows to turn on integer math
23358 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
23359 Threading.Monitor.Exit
23361 2001-10-23 Miguel de Icaza <miguel@ximian.com>
23363 * expression.cs (IndexerAccess::DoResolveLValue): Set the
23364 Expression Class to be IndexerAccess.
23366 Notice that Indexer::DoResolve sets the eclass to Value.
23368 2001-10-22 Miguel de Icaza <miguel@ximian.com>
23370 * class.cs (TypeContainer::Emit): Emit code for indexers.
23372 * assign.cs (IAssignMethod): New interface implemented by Indexers
23373 and Properties for handling assignment.
23375 (Assign::Emit): Simplify and reuse code.
23377 * expression.cs (IndexerAccess, PropertyExpr): Implement
23378 IAssignMethod, clean up old code.
23380 2001-10-22 Ravi Pratap <ravi@ximian.com>
23382 * typemanager.cs (ImplementsInterface): New method to determine if a type
23383 implements a given interface. Provides a nice cache too.
23385 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
23388 (ConvertReferenceExplicit): Ditto.
23390 * delegate.cs (Delegate::Populate): Update to define the parameters on the
23391 various methods, with correct names etc.
23393 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
23394 Operator.UnaryNegation.
23396 * cs-parser.jay (operator_declarator): Be a little clever in the case where
23397 we have a unary plus or minus operator.
23399 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
23402 * everywhere : update accordingly.
23404 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
23407 * class.cs (Method::Define): For the case where we are implementing a method
23408 inherited from an interface, we need to set the MethodAttributes.Final flag too.
23409 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
23411 2001-10-21 Ravi Pratap <ravi@ximian.com>
23413 * interface.cs (FindMembers): Implement to work around S.R.E
23416 * typemanager.cs (IsInterfaceType): Implement.
23418 (FindMembers): Update to handle interface types too.
23420 * expression.cs (ImplicitReferenceConversion): Re-write bits which
23421 use IsAssignableFrom as that is not correct - it doesn't work.
23423 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
23424 and accordingly override EmitStatement.
23426 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
23427 using the correct logic :-)
23429 2001-10-19 Ravi Pratap <ravi@ximian.com>
23431 * ../errors/cs-11.cs : Add to demonstrate error -11
23433 2001-10-17 Miguel de Icaza <miguel@ximian.com>
23435 * assign.cs (Assign::Resolve): Resolve right hand side first, and
23436 then pass this as a hint to ResolveLValue.
23438 * expression.cs (FieldExpr): Add Location information
23440 (FieldExpr::LValueResolve): Report assignment to readonly
23443 (Expression::ExprClassFromMemberInfo): Pass location information.
23445 (Expression::ResolveLValue): Add new method that resolves an
23448 (Expression::DoResolveLValue): Default invocation calls
23451 (Indexers): New class used to keep track of indexers in a given
23454 (IStackStore): Renamed from LValue, as it did not really describe
23455 what this did. Also ResolveLValue is gone from this interface and
23456 now is part of Expression.
23458 (ElementAccess): Depending on the element access type
23460 * typemanager.cs: Add `indexer_name_type' as a Core type
23461 (System.Runtime.CompilerServices.IndexerNameAttribute)
23463 * statement.cs (Goto): Take a location.
23465 2001-10-18 Ravi Pratap <ravi@ximian.com>
23467 * delegate.cs (Delegate::VerifyDelegate): New method to verify
23468 if two delegates are compatible.
23470 (NewDelegate::DoResolve): Update to take care of the case when
23471 we instantiate a delegate from another delegate.
23473 * typemanager.cs (FindMembers): Don't even try to look up members
23474 of Delegate types for now.
23476 2001-10-18 Ravi Pratap <ravi@ximian.com>
23478 * delegate.cs (NewDelegate): New class to take care of delegate
23481 * expression.cs (New): Split the delegate related code out into
23482 the NewDelegate class.
23484 * delegate.cs (DelegateInvocation): New class to handle delegate
23487 * expression.cs (Invocation): Split out delegate related code into
23488 the DelegateInvocation class.
23490 2001-10-17 Ravi Pratap <ravi@ximian.com>
23492 * expression.cs (New::DoResolve): Implement delegate creation fully
23493 and according to the spec.
23495 (New::DoEmit): Update to handle delegates differently.
23497 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
23498 because of which we were printing out arguments in reverse order !
23500 * delegate.cs (VerifyMethod): Implement to check if the given method
23501 matches the delegate.
23503 (FullDelegateDesc): Implement.
23505 (VerifyApplicability): Implement.
23507 * expression.cs (Invocation::DoResolve): Update to accordingly handle
23508 delegate invocations too.
23510 (Invocation::Emit): Ditto.
23512 * ../errors/cs1593.cs : Added.
23514 * ../errors/cs1594.cs : Added.
23516 * delegate.cs (InstanceExpression, TargetMethod): New properties.
23518 2001-10-16 Ravi Pratap <ravi@ximian.com>
23520 * typemanager.cs (intptr_type): Core type for System.IntPtr
23522 (InitCoreTypes): Update for the same.
23524 (iasyncresult_type, asynccallback_type): Ditto.
23526 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
23529 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
23532 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
23533 the builders for the 4 members of a delegate type :-)
23535 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
23538 * expression.cs (New::DoResolve): Implement guts for delegate creation.
23540 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
23542 2001-10-15 Miguel de Icaza <miguel@ximian.com>
23544 * statement.cs (Break::Emit): Implement.
23545 (Continue::Emit): Implement.
23547 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
23548 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
23549 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
23550 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
23553 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
23554 properties that track the label for the current loop (begin of the
23555 loop and end of the loop).
23557 2001-10-15 Ravi Pratap <ravi@ximian.com>
23559 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
23560 use of emitting anything at all.
23562 * class.cs, rootcontext.cs : Get rid of calls to the same.
23564 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
23566 (Populate): Define the constructor correctly and set the implementation
23569 * typemanager.cs (delegate_types): New hashtable to hold delegates that
23572 (AddDelegateType): Implement.
23574 (IsDelegateType): Implement helper method.
23576 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
23578 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
23579 and accordingly handle it.
23581 * delegate.cs (Populate): Take TypeContainer argument.
23582 Implement bits to define the Invoke method. However, I still haven't figured out
23583 how to take care of the native int bit :-(
23585 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
23586 Qualify the name of the delegate, not its return type !
23588 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
23591 (StandardConversionExists): Checking for array types turns out to be recursive.
23593 (ConvertReferenceExplicit): Implement array conversion.
23595 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
23597 2001-10-12 Ravi Pratap <ravi@ximian.com>
23599 * cs-parser.jay (delegate_declaration): Store the fully qualified
23600 name as it is a type declaration.
23602 * delegate.cs (ReturnType, Name): Rename members to these. Make them
23605 (DefineDelegate): Renamed from Define. Does the same thing essentially,
23606 as TypeContainer::DefineType.
23608 (Populate): Method in which all the definition of the various methods (Invoke)
23611 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
23614 (CloseDelegate): Finally creates the delegate.
23616 * class.cs (TypeContainer::DefineType): Update to define delegates.
23617 (Populate, Emit and CloseType): Do the same thing here too.
23619 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
23620 delegates in all these operations.
23622 2001-10-14 Miguel de Icaza <miguel@ximian.com>
23624 * expression.cs: LocalTemporary: a new expression used to
23625 reference a temporary that has been created.
23627 * assign.cs: Handle PropertyAccess back here, so that we can
23628 provide the proper semantic access to properties.
23630 * expression.cs (Expression::ConvertReferenceExplicit): Implement
23631 a few more explicit conversions.
23633 * modifiers.cs: `NEW' modifier maps to HideBySig.
23635 * expression.cs (PropertyExpr): Make this into an
23636 ExpressionStatement, and support the EmitStatement code path.
23638 Perform get/set error checking, clean up the interface.
23640 * assign.cs: recognize PropertyExprs as targets, and if so, turn
23641 them into toplevel access objects.
23643 2001-10-12 Miguel de Icaza <miguel@ximian.com>
23645 * expression.cs: PropertyExpr::PropertyExpr: use work around the
23648 * typemanager.cs: Keep track here of our PropertyBuilders again to
23649 work around lameness in SRE.
23651 2001-10-11 Miguel de Icaza <miguel@ximian.com>
23653 * expression.cs (LValue::LValueResolve): New method in the
23654 interface, used to perform a second resolution pass for LValues.
23656 (This::DoResolve): Catch the use of this in static methods.
23658 (This::LValueResolve): Implement.
23660 (This::Store): Remove warning, assigning to `this' in structures
23663 (Invocation::Emit): Deal with invocation of
23664 methods on value types. We need to pass the address to structure
23665 methods rather than the object itself. (The equivalent code to
23666 emit "this" for structures leaves the entire structure on the
23667 stack instead of a pointer to it).
23669 (ParameterReference::DoResolve): Compute the real index for the
23670 argument based on whether the method takes or not a `this' pointer
23671 (ie, the method is static).
23673 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
23674 value types returned from functions when we need to invoke a
23675 method on the sturcture.
23678 2001-10-11 Ravi Pratap <ravi@ximian.com>
23680 * class.cs (TypeContainer::DefineType): Method to actually do the business of
23681 defining the type in the Modulebuilder or Typebuilder. This is to take
23682 care of nested types which need to be defined on the TypeBuilder using
23683 DefineNestedMethod.
23685 (TypeContainer::GetClassBases): Implement. Essentially the code from the
23686 methods in RootContext, only ported to be part of TypeContainer.
23688 (TypeContainer::GetInterfaceOrClass): Ditto.
23690 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
23692 * interface.cs (Interface::DefineInterface): New method. Does exactly
23693 what RootContext.CreateInterface did earlier, only it takes care of nested types
23696 (Interface::GetInterfaces): Move from RootContext here and port.
23698 (Interface::GetInterfaceByName): Same here.
23700 * rootcontext.cs (ResolveTree): Re-write.
23702 (PopulateTypes): Re-write.
23704 * class.cs (TypeContainer::Populate): Populate nested types too.
23705 (TypeContainer::Emit): Emit nested members too.
23707 * typemanager.cs (AddUserType): Do not make use of the FullName property,
23708 instead just use the name argument passed in as it is already fully
23711 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
23712 to TypeContainer mapping to see if a type is user-defined.
23714 * class.cs (TypeContainer::CloseType): Implement.
23716 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
23717 the default constructor.
23719 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
23722 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
23724 * interface.cs (CloseType): Create the type here.
23726 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
23729 Remove all the methods which are now in TypeContainer.
23731 2001-10-10 Ravi Pratap <ravi@ximian.com>
23733 * delegate.cs (Define): Re-write bits to define the delegate
23736 2001-10-10 Miguel de Icaza <miguel@ximian.com>
23738 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23740 * expression.cs (ImplicitReferenceConversion): handle null as well
23741 as a source to convert to any reference type.
23743 * statement.cs (Return): Perform any implicit conversions to
23744 expected return type.
23746 Validate use of return statement.
23748 * codegen.cs (EmitContext): Pass the expected return type here.
23750 * class.cs (Method, Constructor, Property): Pass expected return
23751 type to EmitContext.
23753 2001-10-09 Miguel de Icaza <miguel@ximian.com>
23755 * expression.cs: Make DoResolve take an EmitContext instead of a
23758 Replaced `l' and `location' for `loc', for consistency.
23760 (Error, Warning): Remove unneeded Tc argument.
23762 * assign.cs, literal.cs, constant.cs: Update to new calling
23765 * codegen.cs: EmitContext now contains a flag indicating whether
23766 code is being generated in a static method or not.
23768 * cs-parser.jay: DecomposeQI, new function that replaces the old
23769 QualifiedIdentifier. Now we always decompose the assembled
23770 strings from qualified_identifier productions into a group of
23773 2001-10-08 Miguel de Icaza <miguel@ximian.com>
23775 * rootcontext.cs: Deal with field-less struct types correctly now
23776 by passing the size option to Define Type.
23778 * class.cs: Removed hack that created one static field.
23780 2001-10-07 Miguel de Icaza <miguel@ximian.com>
23782 * statement.cs: Moved most of the code generation here.
23784 2001-10-09 Ravi Pratap <ravi@ximian.com>
23786 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23789 (ElementAccess): Remove useless bits for now - keep checks as the spec
23792 2001-10-08 Ravi Pratap <ravi@ximian.com>
23794 * expression.cs (ElementAccess::DoResolve): Remove my crap code
23795 and start performing checks according to the spec.
23797 2001-10-07 Ravi Pratap <ravi@ximian.com>
23799 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23800 rank_specifiers instead.
23802 (rank_specifiers): Change the order in which the rank specifiers are stored
23804 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23806 * expression.cs (ElementAccess): Implement the LValue interface too.
23808 2001-10-06 Ravi Pratap <ravi@ximian.com>
23810 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23811 except that user defined conversions are not included.
23813 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
23814 perform the conversion of the return type, if necessary.
23816 (New::DoResolve): Check whether we are creating an array or an object
23817 and accordingly do the needful.
23819 (New::Emit): Same here.
23821 (New::DoResolve): Implement guts of array creation.
23823 (New::FormLookupType): Helper function.
23825 2001-10-07 Miguel de Icaza <miguel@ximian.com>
23827 * codegen.cs: Removed most of the code generation here, and move the
23828 corresponding code generation bits to the statement classes.
23830 Added support for try/catch/finalize and throw.
23832 * cs-parser.jay: Added support for try/catch/finalize.
23834 * class.cs: Catch static methods having the flags override,
23835 virtual or abstract.
23837 * expression.cs (UserCast): This user cast was not really doing
23838 what it was supposed to do. Which is to be born in fully resolved
23839 state. Parts of the resolution were being performed at Emit time!
23843 2001-10-05 Miguel de Icaza <miguel@ximian.com>
23845 * expression.cs: Implicity convert the result from UserCast.
23847 2001-10-05 Ravi Pratap <ravi@ximian.com>
23849 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23850 prevented it from working correctly.
23852 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23853 merely ConvertImplicit.
23855 2001-10-05 Miguel de Icaza <miguel@ximian.com>
23857 * typemanager.cs: Make the LookupTypeContainer function static,
23858 and not per-instance.
23860 * class.cs: Make static FindMembers (the one that takes a Type
23863 * codegen.cs: Add EmitForeach here.
23865 * cs-parser.jay: Make foreach a toplevel object instead of the
23866 inline expansion, as we need to perform semantic analysis on it.
23868 2001-10-05 Ravi Pratap <ravi@ximian.com>
23870 * expression.cs (Expression::ImplicitUserConversion): Rename to
23871 UserDefinedConversion.
23873 (Expression::UserDefinedConversion): Take an extra argument specifying
23874 whether we look for explicit user conversions too.
23876 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23878 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23880 (ExplicitUserConversion): Make it a call to UserDefinedConversion
23881 with the appropriate arguments.
23883 * cs-parser.jay (cast_expression): Record location too.
23885 * expression.cs (Cast): Record location info.
23887 (Expression::ConvertExplicit): Take location argument.
23889 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23890 to determine if we are doing explicit conversions.
23892 (UserCast::Emit): Update accordingly.
23894 (Expression::ConvertExplicit): Report an error if everything fails.
23896 * ../errors/cs0030.cs : Add.
23898 2001-10-04 Miguel de Icaza <miguel@ximian.com>
23900 * modifiers.cs: If the ABSTRACT keyword is present, also set the
23901 virtual and newslot bits.
23903 * class.cs (TypeContainer::RegisterRequiredImplementations):
23904 Record methods we need.
23906 (TypeContainer::MakeKey): Helper function to make keys for
23907 MethodBases, since the Methodbase key is useless.
23909 (TypeContainer::Populate): Call RegisterRequiredImplementations
23910 before defining the methods.
23912 Create a mapping for method_builders_to_methods ahead of time
23913 instead of inside a tight loop.
23915 (::RequireMethods): Accept an object as the data to set into the
23916 hashtable so we can report interface vs abstract method mismatch.
23918 2001-10-03 Miguel de Icaza <miguel@ximian.com>
23920 * report.cs: Make all of it static.
23922 * rootcontext.cs: Drop object_type and value_type computations, as
23923 we have those in the TypeManager anyways.
23925 Drop report instance variable too, now it is a global.
23927 * driver.cs: Use try/catch on command line handling.
23929 Add --probe option to debug the error reporting system with a test
23932 * report.cs: Add support for exiting program when a probe
23933 condition is reached.
23935 2001-10-03 Ravi Pratap <ravi@ximian.com>
23937 * expression.cs (Binary::DoNumericPromotions): Fix the case when
23938 we do a forcible conversion regardless of type, to check if
23939 ForceConversion returns a null.
23941 (Binary::error19): Use location to report error.
23943 (Unary::error23): Use location here too.
23945 * ../errors/cs0019.cs : Check in.
23947 * ../errors/cs0023.cs : Check in.
23949 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23950 case of a non-null MethodInfo object with a length of 0 !
23952 (Binary::ResolveOperator): Flag error if overload resolution fails to find
23953 an applicable member - according to the spec :-)
23954 Also fix logic to find members in base types.
23956 (Unary::ResolveOperator): Same here.
23958 (Unary::report23): Change name to error23 and make first argument a TypeContainer
23959 as I was getting thoroughly confused between this and error19 :-)
23961 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23962 (::FindMostEncompassedType): Implement.
23963 (::FindMostEncompassingType): Implement.
23964 (::StandardConversionExists): Implement.
23966 (UserImplicitCast): Re-vamp. We now need info about most specific
23967 source and target types so that we can do the necessary conversions.
23969 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23970 mathematical union with no duplicates.
23972 2001-10-03 Miguel de Icaza <miguel@ximian.com>
23974 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23975 in order from base classes to child classes, so that we can in
23976 child classes look up in our parent for method names and
23977 attributes (required for handling abstract, virtual, new, override
23978 constructs: we need to instrospect our base class, and if we dont
23979 populate the classes in order, the introspection might be
23980 incorrect. For example, a method could query its parent before
23981 the parent has any methods and would determine that the parent has
23982 no abstract methods (while it could have had them)).
23984 (RootContext::CreateType): Record the order in which we define the
23987 2001-10-02 Miguel de Icaza <miguel@ximian.com>
23989 * class.cs (TypeContainer::Populate): Also method definitions can
23990 fail now, keep track of this.
23992 (TypeContainer::FindMembers): Implement support for
23993 DeclaredOnly/noDeclaredOnly flag.
23995 (Constructor::Emit) Return the ConstructorBuilder.
23997 (Method::Emit) Return the MethodBuilder.
23998 Check for abstract or virtual methods to be public.
24000 * rootcontext.cs (RootContext::CreateType): Register all the
24001 abstract methods required for the class to be complete and the
24002 interface methods that must be implemented.
24004 * cs-parser.jay: Report error 501 (method requires body if it is
24005 not marked abstract or extern).
24007 * expression.cs (TypeOf::Emit): Implement.
24009 * typemanager.cs: runtime_handle_type, new global type.
24011 * class.cs (Property::Emit): Generate code for properties.
24013 2001-10-02 Ravi Pratap <ravi@ximian.com>
24015 * expression.cs (Unary::ResolveOperator): Find operators on base type
24016 too - we now conform exactly to the spec.
24018 (Binary::ResolveOperator): Same here.
24020 * class.cs (Operator::Define): Fix minor quirk in the tests.
24022 * ../errors/cs0215.cs : Added.
24024 * ../errors/cs0556.cs : Added.
24026 * ../errors/cs0555.cs : Added.
24028 2001-10-01 Miguel de Icaza <miguel@ximian.com>
24030 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
24031 single integer which is really efficient
24033 2001-10-01 Ravi Pratap <ravi@ximian.com>
24035 * expression.cs (Expression::ImplicitUserConversion): Use location
24036 even in the case when we are examining True operators.
24038 * class.cs (Operator::Define): Perform extensive checks to conform
24039 with the rules for operator overloading in the spec.
24041 * expression.cs (Expression::ImplicitReferenceConversion): Implement
24042 some of the other conversions mentioned in the spec.
24044 * typemanager.cs (array_type): New static member for the System.Array built-in
24047 (cloneable_interface): For System.ICloneable interface.
24049 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
24050 we start resolving the tree and populating types.
24052 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
24054 2001-10-01 Miguel de Icaza <miguel@ximian.com>
24056 * expression.cs (Expression::ExprClassFromMemberInfo,
24057 Expression::Literalize): Create literal expressions from
24058 FieldInfos which are literals.
24060 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
24061 type casts, because they were wrong. The test suite in tests
24064 (ImplicitNumericConversion): ushort to ulong requires a widening
24067 Int32 constant to long requires widening cast as well.
24069 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
24070 for integers because the type on the stack is not i4.
24072 2001-09-30 Miguel de Icaza <miguel@ximian.com>
24074 * expression.cs (report118): require location argument.
24076 * parameter.cs: Do not dereference potential null value.
24078 * class.cs: Catch methods that lack the `new' keyword when
24079 overriding a name. Report warnings when `new' is used without
24080 anything being there to override.
24082 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
24084 * class.cs: Only add constructor to hashtable if it is non-null
24085 (as now constructors can fail on define).
24087 (TypeManager, Class, Struct): Take location arguments.
24089 Catch field instance initialization in structs as errors.
24091 accepting_filter: a new filter for FindMembers that is static so
24092 that we dont create an instance per invocation.
24094 (Constructor::Define): Catch errors where a struct constructor is
24097 * cs-parser.jay: Pass location information for various new
24100 * delegate.cs (Delegate): take a location argument.
24102 * driver.cs: Do not call EmitCode if there were problesm in the
24103 Definition of the types, as many Builders wont be there.
24105 * decl.cs (Decl::Decl): Require a location argument.
24107 * cs-tokenizer.cs: Handle properly hex constants that can not fit
24108 into integers, and find the most appropiate integer for it.
24110 * literal.cs: Implement ULongLiteral.
24112 * rootcontext.cs: Provide better information about the location of
24113 failure when CreateType fails.
24115 2001-09-29 Miguel de Icaza <miguel@ximian.com>
24117 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
24120 * expression.cs (Binary::CheckShiftArguments): Add missing type
24122 (Binary::ResolveOperator): Add type to the logical and and logical
24123 or, Bitwise And/Or and Exclusive Or code paths, it was missing
24126 (Binary::DoNumericPromotions): In the case where either argument
24127 is ulong (and most signed types combined with ulong cause an
24128 error) perform implicit integer constant conversions as well.
24130 2001-09-28 Miguel de Icaza <miguel@ximian.com>
24132 * expression.cs (UserImplicitCast): Method should always be
24134 (Invocation::BetterConversion): Simplified test for IntLiteral.
24136 (Expression::ImplicitNumericConversion): Split this routine out.
24137 Put the code that performs implicit constant integer conversions
24140 (Expression::Resolve): Become a wrapper around DoResolve so we can
24141 check eclass and type being set after resolve.
24143 (Invocation::Badness): Remove this dead function
24145 (Binary::ResolveOperator): Do not compute the expensive argumnets
24146 unless we have a union for it.
24148 (Probe::Emit): Is needs to do an isinst and then
24149 compare against null.
24151 (::CanConvert): Added Location argument. If the Location argument
24152 is null (Location.Null), then we do not report errors. This is
24153 used by the `probe' mechanism of the Explicit conversion. We do
24154 not want to generate an error for something that the user
24155 explicitly requested to be casted. But the pipeline for an
24156 explicit cast first tests for potential implicit casts.
24158 So for now, if the Location is null, it means `Probe only' to
24159 avoid adding another argument. Might have to revise this
24162 (ClassCast): New class used to type cast objects into arbitrary
24163 classes (used in Explicit Reference Conversions).
24165 Implement `as' as well.
24167 Reverted all the patches from Ravi below: they were broken:
24169 * The use of `level' as a mechanism to stop recursive
24170 invocations is wrong. That was there just to catch the
24171 bug with a strack trace but not as a way of addressing
24174 To fix the problem we have to *understand* what is going
24175 on and the interactions and come up with a plan, not
24176 just get things going.
24178 * The use of the type conversion cache that I proposed
24179 last night had an open topic: How does this work across
24180 protection domains. A user defined conversion might not
24181 be public in the location where we are applying the
24182 conversion, a different conversion might be selected
24183 (ie, private A->B (better) but public B->A (worse),
24184 inside A, A->B applies, but outside it, B->A will
24187 * On top of that (ie, even if the above is solved),
24188 conversions in a cache need to be abstract. Ie, `To
24189 convert from an Int to a Short use an OpcodeCast', not
24190 `To convert from an Int to a Short use the OpcodeCast on
24191 the variable 5' (which is what this patch was doing).
24193 2001-09-28 Ravi Pratap <ravi@ximian.com>
24195 * expression.cs (Invocation::ConversionExists): Re-write to use
24196 the conversion cache
24198 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
24199 cache all conversions done, not just user-defined ones.
24201 (Invocation::BetterConversion): The real culprit. Use ConversionExists
24202 to determine if a conversion exists instead of acutually trying to
24203 perform the conversion. It's faster too.
24205 (Expression::ConvertExplicit): Modify to use ConversionExists to check
24206 and only then attempt the implicit conversion.
24208 2001-09-28 Ravi Pratap <ravi@ximian.com>
24210 * expression.cs (ConvertImplicit): Use a cache for conversions
24211 already found. Check level of recursion and bail out if necessary.
24213 2001-09-28 Miguel de Icaza <miguel@ximian.com>
24215 * typemanager.cs (string_concat_string_string, string_concat_object_object):
24216 Export standard methods that we expect for string operations.
24218 * statement.cs (Block::UsageWarning): Track usage of variables and
24219 report the errors for not used variables.
24221 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
24224 2001-09-27 Miguel de Icaza <miguel@ximian.com>
24226 * codegen.cs: remove unnneded code
24228 * expression.cs: Removed BuiltinTypeAccess class
24230 Fix the order in which implicit conversions are
24233 The previous fixed dropped support for boxed conversions (adding a
24234 test to the test suite now)
24236 (UserImplicitCast::CanConvert): Remove test for source being null,
24237 that code is broken. We should not feed a null to begin with, if
24238 we do, then we should track the bug where the problem originates
24239 and not try to cover it up here.
24241 Return a resolved expression of type UserImplicitCast on success
24242 rather than true/false. Ravi: this is what I was talking about,
24243 the pattern is to use a static method as a "constructor" for
24246 Also, do not create arguments until the very last minute,
24247 otherwise we always create the arguments even for lookups that
24248 will never be performed.
24250 (UserImplicitCast::Resolve): Eliminate, objects of type
24251 UserImplicitCast are born in a fully resolved state.
24253 * typemanager.cs (InitCoreTypes): Init also value_type
24254 (System.ValueType).
24256 * expression.cs (Cast::Resolve): First resolve the child expression.
24258 (LValue): Add new method AddressOf to be used by
24261 Change the argument of Store to take an EmitContext instead of an
24262 ILGenerator, because things like FieldExpr need to be able to call
24263 their children expression to generate the instance code.
24265 (Expression::Error, Expression::Warning): Sugar functions for
24268 (Expression::MemberLookup): Accept a TypeContainer instead of a
24269 Report as the first argument.
24271 (Expression::ResolvePrimary): Killed. I still want to improve
24272 this as currently the code is just not right.
24274 (Expression::ResolveMemberAccess): Simplify, but it is still
24277 (Unary::Resolve): Catch errors in AddressOf operators.
24279 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
24280 index to a byte for the short-version, or the compiler will choose
24281 the wrong Emit call, which generates the wrong data.
24283 (ParameterReference::Emit, ::Store): same.
24285 (FieldExpr::AddressOf): Implement.
24287 * typemanager.cs: TypeManager: made public variable instead of
24290 * driver.cs: document --fatal.
24292 * report.cs (ErrorMessage, WarningMessage): new names for the old
24293 Error and Warning classes.
24295 * cs-parser.jay (member_access): Turn built-in access to types
24296 into a normal simplename
24298 2001-09-27 Ravi Pratap <ravi@ximian.com>
24300 * expression.cs (Invocation::BetterConversion): Fix to cope
24301 with q being null, since this was introducing a bug.
24303 * expression.cs (ConvertImplicit): Do built-in conversions first.
24305 2001-09-27 Ravi Pratap <ravi@ximian.com>
24307 * expression.cs (UserImplicitCast::Resolve): Fix bug.
24309 2001-09-27 Ravi Pratap <ravi@ximian.com>
24311 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
24312 I had introduced long ago (what's new ?).
24314 * expression.cs (UserImplicitCast::CanConvert): Static method to do
24315 the work of all the checking.
24316 (ConvertImplicit): Call CanConvert and only then create object if necessary.
24317 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
24319 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
24320 that is the right way.
24322 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
24323 overloading resolution. Use everywhere instead of cutting and pasting code.
24325 (Binary::ResolveOperator): Use MakeUnionSet.
24327 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
24328 we have to convert to bool types. Not complete yet.
24330 2001-09-27 Miguel de Icaza <miguel@ximian.com>
24332 * typemanager.cs (TypeManager::CSharpName): support ushort.
24334 * expression.cs (Expression::TryImplicitIntConversion): Attempts
24335 to provide an expression that performsn an implicit constant int
24336 conversion (section 6.1.6).
24337 (Expression::ConvertImplicitRequired): Reworked to include
24338 implicit constant expression conversions.
24340 (Expression::ConvertNumericExplicit): Finished.
24342 (Invocation::Emit): If InstanceExpression is null, then it means
24343 that we perform a call on this.
24345 2001-09-26 Miguel de Icaza <miguel@ximian.com>
24347 * expression.cs (Unary::Emit): Remove some dead code.
24348 (Probe): Implement Resolve and Emit for `is'.
24349 (Expression::ConvertImplicitRequired): Attempt to do constant
24350 expression conversions here. Maybe should be moved to
24351 ConvertImplicit, but I am not sure.
24352 (Expression::ImplicitLongConstantConversionPossible,
24353 Expression::ImplicitIntConstantConversionPossible): New functions
24354 that tell whether is it possible to apply an implicit constant
24355 expression conversion.
24357 (ConvertNumericExplicit): Started work on explicit numeric
24360 * cs-parser.jay: Update operator constants.
24362 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
24363 (Parameters::GetSignature): Hook up VerifyArgs here.
24364 (Parameters::VerifyArgs): Verifies that no two arguments have the
24367 * class.cs (Operator): Update the operator names to reflect the
24368 ones that the spec expects (as we are just stringizing the
24371 * expression.cs (Unary::ResolveOperator): Fix bug: Use
24372 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
24373 previous usage did only work for our methods.
24374 (Expression::ConvertImplicit): Handle decimal implicit numeric
24375 conversions as well.
24376 (Expression::InternalTypeConstructor): Used to invoke constructors
24377 on internal types for default promotions.
24379 (Unary::Emit): Implement special handling for the pre/post
24380 increment/decrement for overloaded operators, as they need to have
24381 the same semantics as the other operators.
24383 (Binary::ResolveOperator): ditto.
24384 (Invocation::ConversionExists): ditto.
24385 (UserImplicitCast::Resolve): ditto.
24387 2001-09-26 Ravi Pratap <ravi@ximian.com>
24389 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
24390 operator, return after emitting body. Regression tests pass again !
24392 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
24393 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
24394 (Invocation::OverloadResolve): Ditto.
24395 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
24397 * everywhere : update calls to the above methods accordingly.
24399 2001-09-26 Miguel de Icaza <miguel@ximian.com>
24401 * assign.cs (Assign): Make it inherit from ExpressionStatement.
24403 * expression.cs (ExpressionStatement): New base class used for
24404 expressions that can appear in statements, so that we can provide
24405 an alternate path to generate expression that do not leave a value
24408 (Expression::Emit, and all the derivatives): We no longer return
24409 whether a value is left on the stack or not. Every expression
24410 after being emitted leaves a single value on the stack.
24412 * codegen.cs (EmitContext::EmitStatementExpression): Use the
24413 facilties of ExpressionStatement if possible.
24415 * cs-parser.jay: Update statement_expression.
24417 2001-09-25 Miguel de Icaza <miguel@ximian.com>
24419 * driver.cs: Change the wording of message
24421 2001-09-25 Ravi Pratap <ravi@ximian.com>
24423 * expression.cs (Binary::ResolveOperator): Had forgottten to set
24424 the type of the expression to the return type of the method if
24425 we have an overloaded operator match ! The regression tests pass again !
24426 (Unary::ResolveOperator): Ditto.
24428 * expression.cs (Invocation::ConversionExists): Correct the member lookup
24429 to find "op_Implicit", not "implicit" ;-)
24430 (UserImplicitCast): New class to take care of user-defined implicit conversions.
24431 (ConvertImplicit, ForceConversion): Take TypeContainer argument
24433 * everywhere : Correct calls to the above accordingly.
24435 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
24436 (ConvertImplicit): Do user-defined conversion if it exists.
24438 2001-09-24 Miguel de Icaza <miguel@ximian.com>
24440 * assign.cs: track location.
24441 (Resolve): Use implicit conversions on assignment.
24443 * literal.cs: Oops. Not good, Emit of short access values should
24444 pass (Bytes) or the wrong argument will be selected.
24446 * expression.cs (Unary::Emit): Emit code for -expr.
24448 (Unary::ResolveOperator): Handle `Substract' for non-constants
24449 (substract from zero from the non-constants).
24450 Deal with Doubles as well.
24452 (Expression::ConvertImplicitRequired): New routine that reports an
24453 error if no implicit conversion exists.
24455 (Invocation::OverloadResolve): Store the converted implicit
24456 expressions if we make them
24458 2001-09-24 Ravi Pratap <ravi@ximian.com>
24460 * class.cs (ConstructorInitializer): Take a Location argument.
24461 (ConstructorBaseInitializer): Same here.
24462 (ConstructorThisInitializer): Same here.
24464 * cs-parser.jay : Update all calls accordingly.
24466 * expression.cs (Unary, Binary, New): Take location argument.
24467 Update accordingly everywhere.
24469 * cs-parser.jay : Update all calls to the above to take a location
24472 * class.cs : Ditto.
24474 2001-09-24 Ravi Pratap <ravi@ximian.com>
24476 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
24477 (Invocation::BetterConversion): Same here
24478 (Invocation::ConversionExists): Ditto.
24480 (Invocation::ConversionExists): Implement.
24482 2001-09-22 Ravi Pratap <ravi@ximian.com>
24484 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
24485 Also take an additional TypeContainer argument.
24487 * All over : Pass in TypeContainer as argument to OverloadResolve.
24489 * typemanager.cs (CSharpName): Update to check for the string type and return
24492 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
24495 2001-09-21 Ravi Pratap <ravi@ximian.com>
24497 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
24498 (Invocation::BetterFunction): Implement.
24499 (Invocation::BetterConversion): Implement.
24500 (Invocation::ConversionExists): Skeleton, no implementation yet.
24502 Okay, things work fine !
24504 2001-09-21 Miguel de Icaza <miguel@ximian.com>
24506 * typemanager.cs: declare and load enum_type, delegate_type and
24509 * expression.cs (Expression::Emit): Now emit returns a value that
24510 tells whether a value is left on the stack or not. This strategy
24511 might be reveted tomorrow with a mechanism that would address
24512 multiple assignments.
24513 (Expression::report118): Utility routine to report mismatches on
24516 (Unary::Report23): Report impossible type/operator combination
24519 (Unary::IsIncrementableNumber): Whether the type can be
24520 incremented or decremented with add.
24521 (Unary::ResolveOperator): Also allow enumerations to be bitwise
24523 (Unary::ResolveOperator): Implement ++, !, ~,
24525 (Invocation::Emit): Deal with new Emit convetion.
24527 * All Expression derivatives: Updated their Emit method to return
24528 whether they leave values on the stack or not.
24530 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
24531 stack for expressions that are statements.
24533 2001-09-20 Miguel de Icaza <miguel@ximian.com>
24535 * expression.cs (LValue): New interface. Must be implemented by
24537 (LocalVariableReference, ParameterReference, FieldExpr): Implement
24540 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
24541 interface for generating code, simplifies the code.
24543 2001-09-20 Ravi Pratap <ravi@ximian.com>
24545 * expression.cs (everywhere): Comment out return statements in ::Resolve
24546 methods to avoid the warnings.
24548 2001-09-20 Miguel de Icaza <miguel@ximian.com>
24550 * driver.cs (parse): Report error 2001 if we can not open the
24553 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
24556 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
24559 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
24560 otherwise nested blocks end up with the same index.
24562 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
24564 * expression.cs: Instead of having FIXMEs in the Resolve
24565 functions, throw exceptions so it is obvious that we are facing a
24568 * cs-parser.jay (invocation_expression): Pass Location information.
24570 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
24571 Use a basename for those routines because .NET does not like paths
24574 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
24577 2001-09-19 Miguel de Icaza <miguel@ximian.com>
24579 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
24580 are loading the correct data types (throws an exception if not).
24581 (TypeManager::InitCoreTypes): Use CoreLookupType
24583 * expression.cs (Unary::ResolveOperator): return the child
24584 expression for expressions which are just +expr.
24585 (Unary::ResolveOperator): Return negative literals for -LITERAL
24586 expressions (otherwise they are Unary {Literal}).
24587 (Invocation::Badness): Take into account `Implicit constant
24588 expression conversions'.
24590 * literal.cs (LongLiteral): Implement long literal class.
24591 (IntLiteral): export the `Value' of the intliteral.
24593 2001-09-19 Ravi Pratap <ravi@ximian.com>
24595 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
24597 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
24598 instead of 'Operator'
24600 * expression.cs (Binary::ResolveOperator): Update accordingly.
24601 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
24604 * cs-parser.jay (unary_expression): Update to use the new names.
24606 * gen-treedump.cs (GetUnary): Same here.
24608 * expression.cs (Unary::Resolve): Implement.
24609 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
24610 operators are found instead of making noise ;-)
24611 (Unary::ResolveOperator): New method to do precisely the same thing which
24612 Binary::ResolveOperator does for Binary expressions.
24613 (Unary.method, .Arguments): Add.
24614 (Unary::OperName): Implement.
24615 (Unary::ForceConversion): Copy and Paste !
24617 * class.cs (Operator::Define): Fix a small bug for the case when we have
24620 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
24621 for the inbuilt operators. Only overloading works for now ;-)
24623 2001-09-18 Miguel de Icaza <miguel@ximian.com>
24625 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
24626 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
24628 * expression.cs (This::Emit): Implement.
24629 (This::Resolve): Implement.
24630 (TypeOf:Resolve): Implement.
24631 (Expression::ResolveSimpleName): Add an implicit this to instance
24633 (MemberAccess::Resolve): Deal with Parameters and Fields.
24634 Bind instance variable to Field expressions.
24635 (FieldExpr::Instance): New field used to track the expression that
24636 represents the object instance.
24637 (FieldExpr::Resolve): Track potential errors from MemberLookup not
24639 (FieldExpr::Emit): Implement.
24641 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
24642 the last instruction contains a return opcode to avoid generating
24643 the last `ret' instruction (this generates correct code, and it is
24644 nice to pass the peverify output).
24646 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
24647 initializer for static and instance variables.
24648 (Constructor::Emit): Allow initializer to be null in the case of
24649 static constructors. Only emit initializer for instance
24652 (TypeContainer::FindMembers): Return a null array if there are no
24655 Also fix the code for the MemberTypes.Method branch, as it was not
24656 scanning that for operators (or tried to access null variables before).
24658 * assign.cs (Assign::Emit): Handle instance and static fields.
24662 * driver.cs: Stop compilation if there are parse errors.
24664 * cs-parser.jay (constructor_declaration): Provide default base
24665 initializer for non-static constructors.
24666 (constructor_declarator): Do not provide a default base
24667 initializers if none was specified.
24668 Catch the fact that constructors should not have parameters.
24670 * class.cs: Do not emit parent class initializers for static
24671 constructors, that should be flagged as an error.
24673 2001-09-18 Ravi Pratap <ravi@ximian.com>
24675 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
24676 Move back code into TypeContainer::Populate.
24678 2001-09-18 Ravi Pratap <ravi@ximian.com>
24680 * class.cs (TypeContainer::AddConstructor): Fix the check to
24681 compare against Name, not Basename.
24682 (Operator::OpType): Change Plus and Minus to Add and Subtract.
24684 * cs-parser.jay : Update accordingly.
24686 * class.cs (TypeContainer::FindMembers): For the case where we are searching
24687 for methods, don't forget to look into the operators too.
24688 (RegisterMethodBuilder): Helper method to take care of this for
24689 methods, constructors and operators.
24690 (Operator::Define): Completely revamp.
24691 (Operator.OperatorMethod, MethodName): New fields.
24692 (TypeContainer::Populate): Move the registering of builders into
24693 RegisterMethodBuilder.
24694 (Operator::Emit): Re-write.
24696 * expression.cs (Binary::Emit): Comment out code path to emit method
24697 invocation stuff for the case when we have a user defined operator. I am
24698 just not able to get it right !
24700 2001-09-17 Miguel de Icaza <miguel@ximian.com>
24702 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
24705 (Expression::MemberLookup): Provide a version that allows to
24706 specify the MemberTypes and BindingFlags.
24708 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
24709 so it was not fetching variable information from outer blocks.
24711 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
24712 Beforefieldinit as it was buggy.
24714 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
24715 that Ravi put here.
24717 * class.cs (Constructor::Emit): Only emit if block is not null.
24718 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
24719 deal with this by semantically definining it as if the user had
24722 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
24723 constructors as we now "emit" them at a higher level.
24725 (TypeContainer::DefineDefaultConstructor): Used to define the
24726 default constructors if none was provided.
24728 (ConstructorInitializer): Add methods Resolve and Emit.
24730 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
24732 2001-09-17 Ravi Pratap <ravi@ximian.com>
24734 * class.cs (TypeContainer::EmitDefaultConstructor): Register
24735 the default constructor builder with our hashtable for methodbuilders
24738 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24739 and argument_count is 0 in which case we have a match.
24740 (Binary::ResolveOperator): More null checking and miscellaneous coding
24743 2001-09-17 Ravi Pratap <ravi@ximian.com>
24745 * rootcontext.cs (IsNameSpace): Compare against null.
24747 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24749 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24750 and Unary::Operator.
24752 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24755 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24756 we have overloaded operators.
24757 (Binary::ResolveOperator): Implement the part which does the operator overload
24760 * class.cs (Operator::Emit): Implement.
24761 (TypeContainer::Emit): Emit the operators we have too.
24763 * expression.cs (Binary::Emit): Update to emit the appropriate code for
24764 the case when we have a user-defined operator.
24766 2001-09-17 Miguel de Icaza <miguel@ximian.com>
24768 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24770 2001-09-16 Ravi Pratap <ravi@ximian.com>
24772 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24773 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24774 (Constructor::Emit): Implement.
24775 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24776 if we have no work to do.
24777 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
24780 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24781 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24783 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24786 2001-09-15 Ravi Pratap <ravi@ximian.com>
24788 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24790 (Tree::RecordNamespace): Method to do what the name says ;-)
24791 (Tree::Namespaces): Property to get at the namespaces hashtable.
24793 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
24796 * rootcontext.cs (IsNamespace): Fixed it :-)
24798 2001-09-14 Miguel de Icaza <miguel@ximian.com>
24800 * class.cs (TypeContainer::FindMembers): Add support for
24802 (MethodCore): New class that encapsulates both the shared aspects
24803 of a Constructor and a Method.
24804 (Method, Constructor): Factored pieces into MethodCore.
24806 * driver.cs: Added --fatal which makes errors throw exceptions.
24807 Load System assembly as well as part of the standard library.
24809 * report.cs: Allow throwing exceptions on errors for debugging.
24811 * modifiers.cs: Do not use `parent', instead use the real type
24812 container to evaluate permission settings.
24814 * class.cs: Put Ravi's patch back in. He is right, and we will
24815 have to cope with the
24817 2001-09-14 Ravi Pratap <ravi@ximian.com>
24819 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
24820 FamORAssem, not FamANDAssem.
24822 2001-09-14 Miguel de Icaza <miguel@ximian.com>
24824 * driver.cs: Added --parse option that only parses its input files
24827 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
24828 incorrect. IsTopLevel is not used to tell whether an object is
24829 root_types or not (that can be achieved by testing this ==
24830 root_types). But to see if this is a top-level *class* (not
24831 necessarly our "toplevel" container).
24833 2001-09-14 Ravi Pratap <ravi@ximian.com>
24835 * enum.cs (Enum::Define): Modify to call the Lookup method on the
24836 parent instead of a direct call to GetType.
24838 2001-09-14 Ravi Pratap <ravi@ximian.com>
24840 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
24841 Modifiers.TypeAttr. This should just be a call to that method.
24843 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
24844 object so that we can determine if we are top-level or not.
24846 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
24849 * enum.cs (Enum::Define): Ditto.
24851 * modifiers.cs (FieldAttr): Re-write.
24853 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24854 (TypeContainer::HaveStaticConstructor): New property to provide access
24855 to precisely that info.
24857 * modifiers.cs (MethodAttr): Re-write.
24858 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24860 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24861 of top-level types as claimed.
24863 2001-09-13 Miguel de Icaza <miguel@ximian.com>
24865 * expression.cs (MemberLookup): Fruitless attempt to lookup
24866 constructors. Maybe I need to emit default constructors? That
24867 might be it (currently .NET emits this for me automatically).
24868 (Invocation::OverloadResolve): Cope with Arguments == null.
24869 (Invocation::EmitArguments): new function, shared by the new
24870 constructor and us.
24871 (Invocation::Emit): Handle static and instance methods. Emit
24872 proper call instruction for virtual or non-virtual invocations.
24873 (New::Emit): Implement.
24874 (New::Resolve): Implement.
24875 (MemberAccess:Resolve): Implement.
24876 (MethodGroupExpr::InstanceExpression): used conforming to the spec
24877 to track instances.
24878 (FieldExpr::Resolve): Set type.
24880 * support.cs: Handle empty arguments.
24882 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24883 SimpleLookup): Auxiliary routines to help parse a qualifier
24886 Update qualifier_identifier rule.
24888 * codegen.cs: Removed debugging messages.
24890 * class.cs: Make this a global thing, this acts just as a "key" to
24891 objects that we might have around.
24893 (Populate): Only initialize method_builders_to_methods once.
24895 * expression.cs (PropertyExpr): Initialize type from the
24898 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24899 Resolve pattern. Attempt to implicitly convert value to boolean.
24902 * expression.cs: Set the type for the int32/int32 argument case.
24903 (Binary::ResolveOperator): Set the return type to boolean for
24904 comparission operators
24906 * typemanager.cs: Remove debugging print code.
24908 (Invocation::Resolve): resolve type.
24910 * class.cs: Allocate a MemberInfo of the correct size, as the code
24911 elsewhere depends on the test to reflect the correct contents.
24913 (Method::) Keep track of parameters, due to System.Reflection holes
24915 (TypeContainer::Populate): Keep track of MethodBuilders to Method
24918 (TypeContainer::FindMembers): Use ArrayList and then copy an array
24919 of the exact size and return that.
24921 (Class::LookupMethodByBuilder): New function that maps
24922 MethodBuilders to its methods. Required to locate the information
24923 on methods because System.Reflection bit us again.
24925 * support.cs: New file, contains an interface ParameterData and
24926 two implementations: ReflectionParameters and InternalParameters
24927 used to access Parameter information. We will need to grow this
24930 * expression.cs (Invocation::GetParameterData): implement a cache
24931 and a wrapper around the ParameterData creation for methods.
24932 (Invocation::OverloadResolve): Use new code.
24934 2001-09-13 Ravi Pratap <ravi@ximian.com>
24936 * class.cs (TypeContainer::EmitField): Remove and move into
24937 (Field::Define): here and modify accordingly.
24938 (Field.FieldBuilder): New member.
24939 (TypeContainer::Populate): Update accordingly.
24940 (TypeContainer::FindMembers): Implement.
24942 2001-09-13 Miguel de Icaza <miguel@ximian.com>
24944 * statement.cs: (VariableInfo::VariableType): New field to be
24945 initialized with the full type once it is resolved.
24947 2001-09-12 Miguel de Icaza <miguel@ximian.com>
24949 * parameter.cs (GetParameterInfo): Use a type cache to compute
24950 things only once, and to reuse this information
24952 * expression.cs (LocalVariableReference::Emit): Implement.
24953 (OpcodeCast::Emit): fix.
24955 (ParameterReference::Resolve): Implement.
24956 (ParameterReference::Emit): Implement.
24958 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24959 that are expressions need to stay as Expressions.
24961 * typemanager.cs (CSharpName): Returns the C# name of a type if
24964 * expression.cs (Expression::ConvertImplicit): New function that
24965 implements implicit type conversions.
24967 (Expression::ImplicitReferenceConversion): Implements implicit
24968 reference conversions.
24970 (EmptyCast): New type for transparent casts.
24972 (OpcodeCast): New type for casts of types that are performed with
24973 a sequence of bytecodes.
24975 (BoxedCast): New type used for casting value types into reference
24976 types. Emits a box opcode.
24978 (Binary::DoNumericPromotions): Implements numeric promotions of
24979 and computation of the Binary::Type.
24981 (Binary::EmitBranchable): Optimization.
24983 (Binary::Emit): Implement code emission for expressions.
24985 * typemanager.cs (TypeManager): Added two new core types: sbyte
24988 2001-09-12 Ravi Pratap <ravi@ximian.com>
24990 * class.cs (TypeContainer::FindMembers): Method which does exactly
24991 what Type.FindMembers does, only we don't have to use reflection. No
24992 implementation yet.
24994 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24995 typecontainer objects as we need to get at them.
24996 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24998 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24999 typecontainer object.
25001 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
25002 of just a Report object.
25004 2001-09-11 Ravi Pratap <ravi@ximian.com>
25006 * class.cs (Event::Define): Go back to using the prefixes "add_" and
25008 (TypeContainer::Populate): Now define the delegates of the type too.
25009 (TypeContainer.Delegates): Property to access the list of delegates defined
25012 * delegates.cs (Delegate::Define): Implement partially.
25014 * modifiers.cs (TypeAttr): Handle more flags.
25016 2001-09-11 Ravi Pratap <ravi@ximian.com>
25018 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
25020 (Operator::Define): Re-write logic to get types by using the LookupType method
25021 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
25022 (Indexer::Define): Ditto.
25023 (Event::Define): Ditto.
25024 (Property::Define): Ditto.
25026 2001-09-10 Ravi Pratap <ravi@ximian.com>
25028 * class.cs (TypeContainer::Populate): Now define operators too.
25029 (TypeContainer.Operators): New property to access the list of operators
25031 (Operator.OperatorMethodBuilder): New member to hold the method builder
25032 for the operator we are defining.
25033 (Operator::Define): Implement.
25035 2001-09-10 Ravi Pratap <ravi@ximian.com>
25037 * class.cs (Event::Define): Make the prefixes of the accessor methods
25038 addOn_ and removeOn_
25040 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
25041 of the location being passed in too. Ideally, this should go later since all
25042 error reporting should be done through the Report object.
25044 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
25045 (Populate): Iterate thru the indexers we have and define them too.
25046 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
25047 for the get and set accessors.
25048 (Indexer::Define): Implement.
25050 2001-09-09 Miguel de Icaza <miguel@ximian.com>
25052 * expression.cs (Binary::Resolve): Beginning of it. I scratched
25053 my previous implementation, did not work.
25055 * typemanager.cs: Add a couple of missing types (the longs).
25057 * literal.cs: Use TypeManager.bool_type instead of getting it.
25059 * expression.cs (EventExpr): New kind of expressions.
25060 (Expressio::ExprClassFromMemberInfo): finish
25062 2001-09-08 Miguel de Icaza <miguel@ximian.com>
25064 * assign.cs: Emit stores to static fields differently.
25066 2001-09-08 Ravi Pratap <ravi@ximian.com>
25068 * Merge in changes and adjust code to tackle conflicts. Backed out my
25069 code in Assign::Resolve ;-)
25071 2001-09-08 Ravi Pratap <ravi@ximian.com>
25073 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
25074 instead Report.Error and also pass in the location.
25075 (CSharpParser::Lexer): New readonly property to return the reference
25076 to the Tokenizer object.
25077 (declare_local_variables): Use Report.Error with location instead of plain
25081 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
25082 (Operator.CheckBinaryOperator): Ditto.
25084 * cs-parser.jay (operator_declarator): Update accordingly.
25086 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
25087 (CheckBinaryOperator): Same here.
25089 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
25090 on the name without any prefixes of namespace names etc. This is because we
25091 already might have something already fully qualified like
25092 'System.Console.WriteLine'
25094 * assign.cs (Resolve): Begin implementation. Stuck ;-)
25096 2001-09-07 Ravi Pratap <ravi@ximian.com>
25098 * cs-tokenizer.cs (location): Return a string which also contains
25101 * expression.cs (ElementAccess): New class for expressions of the
25102 type 'element access.'
25103 (BaseAccess): New class for expressions of the type 'base access.'
25104 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
25107 * cs-parser.jay (element_access): Implement action.
25108 (base_access): Implement actions.
25109 (checked_expression, unchecked_expression): Implement.
25111 * cs-parser.jay (local_variable_type): Correct and implement.
25112 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
25114 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
25116 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
25117 name and the specifiers.
25119 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
25121 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
25122 making them all public ;-)
25124 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
25127 2001-09-07 Miguel de Icaza <miguel@ximian.com>
25129 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
25131 (FieldExpr, PropertyExprs): New resolved expressions.
25132 (SimpleName::MemberStaticCheck): Perform static checks for access
25133 to non-static fields on static methods. Maybe this should be
25134 generalized for MemberAccesses.
25135 (SimpleName::ResolveSimpleName): More work on simple name
25138 * cs-parser.jay (primary_expression/qualified_identifier): track
25139 the parameter index.
25141 * codegen.cs (CodeGen::Save): Catch save exception, report error.
25142 (EmitContext::EmitBoolExpression): Chain to expression generation
25143 instead of temporary hack.
25144 (::EmitStatementExpression): Put generic expression code generation.
25146 * assign.cs (Assign::Emit): Implement variable assignments to
25147 local variables, parameters and fields.
25149 2001-09-06 Miguel de Icaza <miguel@ximian.com>
25151 * statement.cs (Block::GetVariableInfo): New method, returns the
25152 VariableInfo for a variable name in a block.
25153 (Block::GetVariableType): Implement in terms of GetVariableInfo
25155 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
25156 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
25158 2001-09-06 Ravi Pratap <ravi@ximian.com>
25160 * cs-parser.jay (operator_declaration): Continue on my quest : update
25161 to take attributes argument.
25162 (event_declaration): Ditto.
25163 (enum_declaration): Ditto.
25164 (indexer_declaration): Ditto.
25166 * class.cs (Operator::Operator): Update constructor accordingly.
25167 (Event::Event): Ditto.
25169 * delegate.cs (Delegate::Delegate): Same here.
25171 * enum.cs (Enum::Enum): Same here.
25173 2001-09-05 Ravi Pratap <ravi@ximian.com>
25175 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
25177 * ../tests/cs0658.cs : New file to demonstrate error 0658.
25179 * attribute.cs (Attributes): New class to encapsulate all attributes which were
25180 being passed around as an arraylist.
25181 (Attributes::AddAttribute): Method to add attribute sections.
25183 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
25184 (struct_declaration): Update accordingly.
25185 (constant_declaration): Update.
25186 (field_declaration): Update.
25187 (method_header): Update.
25188 (fixed_parameter): Update.
25189 (parameter_array): Ditto.
25190 (property_declaration): Ditto.
25191 (destructor_declaration): Ditto.
25193 * class.cs (Struct::Struct): Update constructors accordingly.
25194 (Class::Class): Ditto.
25195 (Field::Field): Ditto.
25196 (Method::Method): Ditto.
25197 (Property::Property): Ditto.
25198 (TypeContainer::OptAttribute): update property's return type.
25200 * interface.cs (Interface.opt_attributes): New member.
25201 (Interface::Interface): Update to take the extra Attributes argument.
25203 * parameter.cs (Parameter::Parameter): Ditto.
25205 * constant.cs (Constant::Constant): Ditto.
25207 * interface.cs (InterfaceMemberBase): New OptAttributes field.
25208 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
25209 the attributes as a parameter.
25210 (InterfaceProperty): Update constructor call.
25211 (InterfaceEvent): Ditto.
25212 (InterfaceMethod): Ditto.
25213 (InterfaceIndexer): Ditto.
25215 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
25216 pass the attributes too.
25217 (interface_event_declaration): Ditto.
25218 (interface_property_declaration): Ditto.
25219 (interface_method_declaration): Ditto.
25220 (interface_declaration): Ditto.
25222 2001-09-05 Miguel de Icaza <miguel@ximian.com>
25224 * class.cs (Method::Define): Track the "static Main" definition to
25225 create an entry point.
25227 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
25228 EntryPoint if we find it.
25230 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
25231 (EmitContext::ig): Make this variable public.
25233 * driver.cs: Make the default output file be the first file name
25234 with the .exe extension.
25236 Detect empty compilations
25238 Handle various kinds of output targets. Handle --target and
25239 rename -t to --dumper.
25241 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
25242 methods inherited from Expression return now an Expression. This
25243 will is used during the tree rewriting as we resolve them during
25246 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
25247 the spec. Missing entirely is the information about
25248 accessability of elements of it.
25250 (Expression::ExprClassFromMemberInfo): New constructor for
25251 Expressions that creates a fully initialized Expression based on
25252 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
25255 (Invocation::Resolve): Begin implementing resolution of invocations.
25257 * literal.cs (StringLiteral): Implement Emit.
25259 2001-09-05 Ravi Pratap <ravi@ximian.com>
25261 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
25264 2001-09-04 Ravi Pratap <ravi@ximian.com>
25266 * cs-parser.jay (attribute_arguments): Implement actions.
25267 (attribute): Fix bug in production. Implement action.
25268 (attribute_list): Implement.
25269 (attribute_target): Implement.
25270 (attribute_target_specifier, opt_target_specifier): Implement
25271 (CheckAttributeTarget): New method to check if the attribute target
25273 (attribute_section): Implement.
25274 (opt_attributes): Implement.
25276 * attribute.cs : New file to handle attributes.
25277 (Attribute): Class to hold attribute info.
25279 * cs-parser.jay (opt_attribute_target_specifier): Remove production
25280 (attribute_section): Modify production to use 2 different rules to
25281 achieve the same thing. 1 s/r conflict down !
25282 Clean out commented, useless, non-reducing dimension_separator rules.
25284 * class.cs (TypeContainer.attributes): New member to hold list
25285 of attributes for a type.
25286 (Struct::Struct): Modify to take one more argument, the attribute list.
25287 (Class::Class): Ditto.
25288 (Field::Field): Ditto.
25289 (Method::Method): Ditto.
25290 (Property::Property): Ditto.
25292 * cs-parser.jay (struct_declaration): Update constructor call to
25293 pass in the attributes too.
25294 (class_declaration): Ditto.
25295 (constant_declaration): Ditto.
25296 (field_declaration): Ditto.
25297 (method_header): Ditto.
25298 (fixed_parameter): Ditto.
25299 (parameter_array): Ditto.
25300 (property_declaration): Ditto.
25302 * constant.cs (Constant::Constant): Update constructor similarly.
25303 Use System.Collections.
25305 * parameter.cs (Parameter::Parameter): Update as above.
25307 2001-09-02 Ravi Pratap <ravi@ximian.com>
25309 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
25310 (TypeContainer.delegates): New member to hold list of delegates.
25312 * cs-parser.jay (delegate_declaration): Implement the action correctly
25313 this time as I seem to be on crack ;-)
25315 2001-09-02 Miguel de Icaza <miguel@ximian.com>
25317 * rootcontext.cs (RootContext::IsNamespace): new function, used to
25318 tell whether an identifier represents a namespace.
25320 * expression.cs (NamespaceExpr): A namespace expression, used only
25321 temporarly during expression resolution.
25322 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
25323 utility functions to resolve names on expressions.
25325 2001-09-01 Miguel de Icaza <miguel@ximian.com>
25327 * codegen.cs: Add hook for StatementExpressions.
25329 * class.cs: Fix inverted test for static flag in methods.
25331 2001-09-02 Ravi Pratap <ravi@ximian.com>
25333 * class.cs (Operator::CheckUnaryOperator): Correct error number used
25334 to make it coincide with MS' number.
25335 (Operator::CheckBinaryOperator): Ditto.
25337 * ../errors/errors.txt : Remove error numbers added earlier.
25339 * ../errors/cs1019.cs : Test case for error # 1019
25341 * ../errros/cs1020.cs : Test case for error # 1020
25343 * cs-parser.jay : Clean out commented cruft.
25344 (dimension_separators, dimension_separator): Comment out. Ostensibly not
25345 used anywhere - non-reducing rule.
25346 (namespace_declarations): Non-reducing rule - comment out.
25348 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
25349 with TypeContainer::AddEnum.
25351 * delegate.cs : New file for delegate handling classes.
25352 (Delegate): Class for declaring delegates.
25354 * makefile : Update.
25356 * cs-parser.jay (delegate_declaration): Implement.
25358 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
25360 * class.cs (Event::Define): Implement.
25361 (Event.EventBuilder): New member.
25363 * class.cs (TypeContainer::Populate): Update to define all enums and events
25365 (Events): New property for the events arraylist we hold. Shouldn't we move to using
25366 readonly fields for all these cases ?
25368 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
25370 * class.cs (Property): Revamp to use the convention of making fields readonly.
25371 Accordingly modify code elsewhere.
25373 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
25374 the Define method of the Property class.
25376 * class.cs : Clean up applied patch and update references to variables etc. Fix
25378 (TypeContainer::Populate): Update to define all the properties we have. Also
25379 define all enumerations.
25381 * enum.cs (Define): Implement.
25383 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
25385 * cs-parser.jay (overloadable_operator): The semantic value is an
25386 enum of the Operator class.
25387 (operator_declarator): Implement actions.
25388 (operator_declaration): Implement.
25390 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
25391 validity of definitions.
25392 (Operator::CheckBinaryOperator): Static method to check for binary operators
25393 (TypeContainer::AddOperator): New method to add an operator to a type.
25395 * cs-parser.jay (indexer_declaration): Added line to actually call the
25396 AddIndexer method so it gets added ;-)
25398 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
25399 already taken care of by the MS compiler ?
25401 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
25403 * class.cs (Operator): New class for operator declarations.
25404 (Operator::OpType): Enum for the various operators.
25406 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
25408 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
25409 ostensibly handle this in semantic analysis.
25411 * cs-parser.jay (general_catch_clause): Comment out
25412 (specific_catch_clauses, specific_catch_clause): Ditto.
25413 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
25414 (catch_args, opt_catch_args): New productions.
25415 (catch_clause): Rewrite to use the new productions above
25416 (catch_clauses): Modify accordingly.
25417 (opt_catch_clauses): New production to use in try_statement
25418 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
25419 and re-write the code in the actions to extract the specific and
25420 general catch clauses by being a little smart ;-)
25422 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
25423 Hooray, try and catch statements parse fine !
25425 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
25427 * statement.cs (Block::GetVariableType): Fix logic to extract the type
25428 string from the hashtable of variables.
25430 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
25431 I end up making that mistake ;-)
25432 (catch_clauses): Fixed gross error which made Key and Value of the
25433 DictionaryEntry the same : $1 !!
25435 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
25437 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
25439 * cs-parser.jay (event_declaration): Correct to remove the semicolon
25440 when the add and remove accessors are specified.
25442 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
25444 * cs-parser.jay (IndexerDeclaration): New helper class to hold
25445 information about indexer_declarator.
25446 (indexer_declarator): Implement actions.
25447 (parsing_indexer): New local boolean used to keep track of whether
25448 we are parsing indexers or properties. This is necessary because
25449 implicit_parameters come into picture even for the get accessor in the
25450 case of an indexer.
25451 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
25453 * class.cs (Indexer): New class for indexer declarations.
25454 (TypeContainer::AddIndexer): New method to add an indexer to a type.
25455 (TypeContainer::indexers): New member to hold list of indexers for the
25458 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
25460 * cs-parser.jay (add_accessor_declaration): Implement action.
25461 (remove_accessor_declaration): Implement action.
25462 (event_accessors_declaration): Implement
25463 (variable_declarators): swap statements for first rule - trivial.
25465 * class.cs (Event): New class to hold information about event
25467 (TypeContainer::AddEvent): New method to add an event to a type
25468 (TypeContainer::events): New member to hold list of events.
25470 * cs-parser.jay (event_declaration): Implement actions.
25472 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
25474 * cs-parser.jay (dim_separators): Implement. Make it a string
25475 concatenating all the commas together, just as they appear.
25476 (opt_dim_separators): Modify accordingly
25477 (rank_specifiers): Update accordingly. Basically do the same
25478 thing - instead, collect the brackets here.
25479 (opt_rank_sepcifiers): Modify accordingly.
25480 (array_type): Modify to actually return the complete type string
25481 instead of ignoring the rank_specifiers.
25482 (expression_list): Implement to collect the expressions
25483 (variable_initializer): Implement. We make it a list of expressions
25484 essentially so that we can handle the array_initializer case neatly too.
25485 (variable_initializer_list): Implement.
25486 (array_initializer): Make it a list of variable_initializers
25487 (opt_array_initializer): Modify accordingly.
25489 * expression.cs (New::NType): Add enumeration to help us
25490 keep track of whether we have an object/delegate creation
25491 or an array creation.
25492 (New:NewType, New::Rank, New::Indices, New::Initializers): New
25493 members to hold data about array creation.
25494 (New:New): Modify to update NewType
25495 (New:New): New Overloaded contructor for the array creation
25498 * cs-parser.jay (array_creation_expression): Implement to call
25499 the overloaded New constructor.
25501 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
25503 * class.cs (TypeContainer::Constructors): Return member
25504 constructors instead of returning null.
25506 2001-08-26 Miguel de Icaza <miguel@ximian.com>
25508 * typemanager.cs (InitCoreTypes): Initialize the various core
25509 types after we have populated the type manager with the user
25510 defined types (this distinction will be important later while
25511 compiling corlib.dll)
25513 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
25514 on Expression Classification. Now all expressions have a method
25515 `Resolve' and a method `Emit'.
25517 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
25518 generation from working. Also add some temporary debugging
25521 2001-08-24 Miguel de Icaza <miguel@ximian.com>
25523 * codegen.cs: Lots of code generation pieces. This is only the
25524 beginning, will continue tomorrow with more touches of polish. We
25525 handle the fundamentals of if, while, do, for, return. Others are
25526 trickier and I need to start working on invocations soon.
25528 * gen-treedump.cs: Bug fix, use s.Increment here instead of
25531 * codegen.cs (EmitContext): New struct, used during code
25532 emission to keep a context. Most of the code generation will be
25535 * cs-parser.jay: Add embedded blocks to the list of statements of
25536 this block. So code generation proceeds in a top down fashion.
25538 2001-08-23 Miguel de Icaza <miguel@ximian.com>
25540 * statement.cs: Add support for multiple child blocks.
25542 2001-08-22 Miguel de Icaza <miguel@ximian.com>
25544 * codegen.cs (EmitCode): New function, will emit the code for a
25545 Block of code given a TypeContainer and its ILGenerator.
25547 * statement.cs (Block): Standard public readonly optimization.
25548 (Block::Block constructors): Link children.
25549 (Block::Child): Child Linker.
25550 (Block::EmitVariables): Emits IL variable declarations.
25552 * class.cs: Drop support for MethodGroups here, delay until
25554 (Method::): Applied the same simplification that I did before, and
25555 move from Properties to public readonly fields.
25556 (Method::ParameterTypes): Returns the parameter types for the
25557 function, and implements a cache that will be useful later when I
25558 do error checking and the semantic analysis on the methods is
25560 (Constructor::GetCallingConvention): Renamed from CallingConvetion
25561 and made a method, optional argument tells whether this is a class
25562 or a structure to apply the `has-this' bit.
25563 (Method::GetCallingConvention): Implement, returns the calling
25565 (Method::Define): Defines the type, a second pass is performed
25566 later to populate the methods.
25568 (Constructor::ParameterTypes): implement a cache similar to the
25569 one on Method::ParameterTypes, useful later when we do semantic
25572 (TypeContainer::EmitMethod): New method. Emits methods.
25574 * expression.cs: Removed MethodGroup class from here.
25576 * parameter.cs (Parameters::GetCallingConvention): new method.
25578 2001-08-21 Miguel de Icaza <miguel@ximian.com>
25580 * class.cs (TypeContainer::Populate): Drop RootContext from the
25583 (Constructor::CallingConvention): Returns the calling convention.
25584 (Constructor::ParameterTypes): Returns the constructor parameter
25587 (TypeContainer::AddConstructor): Keep track of default constructor
25588 and the default static constructor.
25590 (Constructor::) Another class that starts using `public readonly'
25591 instead of properties.
25593 (Constructor::IsDefault): Whether this is a default constructor.
25595 (Field::) use readonly public fields instead of properties also.
25597 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
25598 track of static constructors; If none is used, turn on
25599 BeforeFieldInit in the TypeAttributes.
25601 * cs-parser.jay (opt_argument_list): now the return can be null
25602 for the cases where there are no arguments.
25604 (constructor_declarator): If there is no implicit `base' or
25605 `this', then invoke the default parent constructor.
25607 * modifiers.cs (MethodAttr): New static function maps a set of
25608 modifiers flags into a MethodAttributes enum
25609 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
25610 MethodAttr, TypeAttr to represent the various mappings where the
25611 modifiers are used.
25612 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
25614 2001-08-19 Miguel de Icaza <miguel@ximian.com>
25616 * parameter.cs (GetParameterInfo): Fix bug where there would be no
25619 * interface.cs (PopulateIndexer): Implemented the code generator
25620 for interface indexers.
25622 2001-08-17 Miguel de Icaza <miguel@ximian.com>
25624 * interface.cs (InterfaceMemberBase): Now we track the new status
25627 (PopulateProperty): Implement property population. Woohoo! Got
25628 Methods and Properties going today.
25630 Removed all the properties for interfaces, and replaced them with
25631 `public readonly' fields.
25633 2001-08-16 Miguel de Icaza <miguel@ximian.com>
25635 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
25636 initialize their hashtables/arraylists only when they are needed
25637 instead of doing this always.
25639 * parameter.cs: Handle refs and out parameters.
25641 * cs-parser.jay: Use an ArrayList to construct the arguments
25642 instead of the ParameterCollection, and then cast that to a
25645 * parameter.cs: Drop the use of ParameterCollection and use
25646 instead arrays of Parameters.
25648 (GetParameterInfo): Use the Type, not the Name when resolving
25651 2001-08-13 Miguel de Icaza <miguel@ximian.com>
25653 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
25654 and instead use public readonly fields.
25656 * class.cs: Put back walking code for type containers.
25658 2001-08-11 Miguel de Icaza <miguel@ximian.com>
25660 * class.cs (MakeConstant): Code to define constants.
25662 * rootcontext.cs (LookupType): New function. Used to locate types
25665 2001-08-08 Miguel de Icaza <miguel@ximian.com>
25667 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
25668 this System.Reflection code is. Kudos to Microsoft
25670 * typemanager.cs: Implement a type cache and avoid loading all
25671 types at boot time. Wrap in LookupType the internals. This made
25672 the compiler so much faster. Wow. I rule!
25674 * driver.cs: Make sure we always load mscorlib first (for
25675 debugging purposes, nothing really important).
25677 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
25678 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
25680 * rootcontext.cs: Lookup types on their namespace; Lookup types
25681 on namespaces that have been imported using the `using' keyword.
25683 * class.cs (TypeContainer::TypeAttr): Virtualize.
25684 (Class::TypeAttr): Return attributes suitable for this bad boy.
25685 (Struct::TypeAttr): ditto.
25686 Handle nested classes.
25687 (TypeContainer::) Remove all the type visiting code, it is now
25688 replaced with the rootcontext.cs code
25690 * rootcontext.cs (GetClassBases): Added support for structs.
25692 2001-08-06 Miguel de Icaza <miguel@ximian.com>
25694 * interface.cs, statement.cs, class.cs, parameter.cs,
25695 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
25696 Drop use of TypeRefs, and use strings instead.
25698 2001-08-04 Miguel de Icaza <miguel@ximian.com>
25702 * class.cs (Struct::Struct): set the SEALED flags after
25703 checking the modifiers.
25704 (TypeContainer::TypeAttr): new property, returns the
25705 TypeAttributes for a class.
25707 * cs-parser.jay (type_list): Oops, list production was creating a
25708 new list of base types.
25710 * rootcontext.cs (StdLib): New property.
25711 (GetInterfaceTypeByName): returns an interface by type name, and
25712 encapsulates error handling here.
25713 (GetInterfaces): simplified.
25714 (ResolveTree): Encapsulated all the tree resolution here.
25715 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
25718 * driver.cs: Add support for --nostdlib, to avoid loading the
25719 default assemblies.
25720 (Main): Do not put tree resolution here.
25722 * rootcontext.cs: Beginning of the class resolution.
25724 2001-08-03 Miguel de Icaza <miguel@ximian.com>
25726 * rootcontext.cs: Provide better error reporting.
25728 * cs-parser.jay (interface_base): set our $$ to be interfaces.
25730 * rootcontext.cs (CreateInterface): Handle the case where there
25731 are no parent interfaces.
25733 (CloseTypes): Routine to flush types at the end.
25734 (CreateInterface): Track types.
25735 (GetInterfaces): Returns an array of Types from the list of
25736 defined interfaces.
25738 * typemanager.c (AddUserType): Mechanism to track user types (puts
25739 the type on the global type hash, and allows us to close it at the
25742 2001-08-02 Miguel de Icaza <miguel@ximian.com>
25744 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25745 RecordInterface instead.
25747 * cs-parser.jay: Updated to reflect changes above.
25749 * decl.cs (Definition): Keep track of the TypeBuilder type that
25750 represents this type here. Not sure we will use it in the long
25751 run, but wont hurt for now.
25753 * driver.cs: Smaller changes to accomodate the new code.
25755 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25758 * rootcontext.cs (CreateInterface): New method, used to create
25759 the System.TypeBuilder type for interfaces.
25760 (ResolveInterfaces): new entry point to resolve the interface
25762 (CodeGen): Property, used to keep track of the code generator.
25764 2001-07-26 Miguel de Icaza <miguel@ximian.com>
25766 * cs-parser.jay: Add a second production for delegate_declaration
25769 (enum_body): Put an opt_comma here instead of putting it on
25770 enum_body or enum_member_declarations so we can handle trailing
25771 commas on enumeration members. Gets rid of a shift/reduce.
25773 (type_list): Need a COMMA in the middle.
25775 (indexer_declaration): Tell tokenizer to recognize get/set
25777 * Remove old targets.
25779 * Re-add the parser target.
25781 2001-07-13 Simon Cozens <simon@simon-cozens.org>
25783 * cs-parser.jay: Add precendence rules for a number of operators
25784 ot reduce the number of shift/reduce conflicts in the grammar.
25786 2001-07-17 Miguel de Icaza <miguel@ximian.com>
25788 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25791 Get rid of old crufty code.
25793 * rootcontext.cs: Use this to keep track of the parsed
25794 representation and the defined types available to the program.
25796 * gen-treedump.cs: adjust for new convention.
25798 * type.cs: Split out the type manager, and the assembly builder
25801 * typemanager.cs: the type manager will live here now.
25803 * cil-codegen.cs: And the code generator here.
25805 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
25807 * makefile: Fixed up for easy making.
25809 2001-07-13 Simon Cozens <simon@simon-cozens.org>
25811 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25814 (unary_expression): Expand pre_increment_expression and
25815 post_decrement_expression to reduce a shift/reduce.
25817 2001-07-11 Simon Cozens
25819 * cs-tokenizer.cs: Hex numbers should begin with a 0.
25821 Improve allow_keyword_as_indent name.
25823 2001-06-19 Miguel de Icaza <miguel@ximian.com>
25825 * Adjustments for Beta2.
25827 2001-06-13 Miguel de Icaza <miguel@ximian.com>
25829 * decl.cs: Added `Define' abstract method.
25830 (InTransit): new property, used to catch recursive definitions.
25832 * interface.cs: Implement `Define'.
25834 * modifiers.cs: Map Modifiers.constants to
25835 System.Reflection.TypeAttribute flags.
25837 * class.cs: Keep track of types and user-defined types.
25838 (BuilderInit): New method for creating an assembly
25839 (ResolveType): New function to launch the resolution process, only
25840 used by interfaces for now.
25842 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
25843 that are inserted into the name space.
25845 2001-06-08 Miguel de Icaza <miguel@ximian.com>
25847 * ARGH. I have screwed up my tree so many times due to the use of
25848 rsync rather than using CVS. Going to fix this at once.
25850 * driver.cs: Objetify driver. Load assemblies, use assemblies to
25853 2001-06-07 Miguel de Icaza <miguel@ximian.com>
25855 * Experiment successful: Use System.Type rather that our own
25858 2001-05-25 Miguel de Icaza <miguel@ximian.com>
25860 * cs-parser.jay: Removed nsAliases from here.
25862 Use new namespaces, handle `using XXX;'
25864 * namespace.cs: Reimplemented namespace handling, use a recursive
25865 definition of the class. Now we can keep track of using clauses
25866 and catch invalid using clauses.
25868 2001-05-24 Miguel de Icaza <miguel@ximian.com>
25870 * gen-treedump.cs: Adapted for all the renaming.
25872 * expression.cs (Expression): this class now has a Type property
25873 which returns an expression Type.
25875 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25876 `Type', as this has a different meaning now in the base
25878 2001-05-22 Miguel de Icaza <miguel@ximian.com>
25880 * interface.cs, class.cs: Removed from all the sources the
25881 references to signature computation, as we can not do method
25882 signature computation during the parsing time, as we are not
25883 trying to solve at that point distinguishing:
25887 void a (NS.Blah x) {}
25890 Which depending on the context might be valid or not, as we do not
25891 know if Blah is the same thing as NS.Blah at that point.
25893 * Redid everything so the code uses TypeRefs now instead of
25894 Types. TypeRefs are just temporary type placeholders, that need
25895 to be resolved. They initially have a pointer to a string and the
25896 current scope in which they are used. This is used later by the
25897 compiler to resolve the reference to an actual Type.
25899 * DeclSpace is no longer a CIR.Type, and neither are
25900 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
25901 are all DeclSpaces, but no Types.
25903 * type.cs (TypeRefManager): This implements the TypeRef manager,
25904 which keeps track of all the types that need to be resolved after
25905 the parsing has finished.
25907 2001-05-13 Miguel de Icaza <miguel@ximian.com>
25909 * ARGH. We are going to have to store `foreach' as a class rather
25910 than resolving it, as we need to verify error 1579 after name
25911 resolution. *OR* we could keep a flag that says `This request to
25912 IEnumerator comes from a foreach statement' which we can then use
25913 to generate the error.
25915 2001-05-10 Miguel de Icaza <miguel@ximian.com>
25917 * class.cs (TypeContainer.AddMethod): we now add methods to the
25918 MethodGroup instead of the method hashtable.
25920 * expression.cs: Add MethodGroup abstraction, which gets us one
25921 step closer to the specification in the way we handle method
25924 * cs-parser.jay (primary_expression): qualified_identifier now
25925 tried to match up an identifier to a local variable reference or
25926 to a parameter reference.
25928 current_local_parameters is now a parser global variable that
25929 points to the current parameters for the block, used during name
25932 (property_declaration): Now creates an implicit `value' argument to
25935 2001-05-09 Miguel de Icaza <miguel@ximian.com>
25937 * parameter.cs: Do not use `param' arguments as part of the
25938 signature, per the spec.
25940 2001-05-08 Miguel de Icaza <miguel@ximian.com>
25942 * decl.cs: Base class for classes, structs and interfaces. This
25943 is the "Declaration Space"
25945 * cs-parser.jay: Use CheckDef for checking declaration errors
25946 instead of having one on each function.
25948 * class.cs: Factor out some code for handling error handling in
25949 accordance to the "Declarations" section in the "Basic Concepts"
25950 chapter in the ECMA C# spec.
25952 * interface.cs: Make all interface member classes derive from
25953 InterfaceMemberBase.
25955 2001-05-07 Miguel de Icaza <miguel@ximian.com>
25957 * Many things: all interfaces are parsed and generated in
25958 gen-treedump. Support for member variables, constructors,
25959 destructors, properties, constants is there.
25961 Beginning of the IL backend, but very little done, just there for
25964 2001-04-29 Miguel de Icaza <miguel@ximian.com>
25966 * cs-parser.jay: Fix labeled statement.
25968 * cs-tokenizer.cs (escape): Escape " and ' always.
25969 ref_line, ref_name: keep track of the line/filename as instructed
25970 by #line by the compiler.
25973 2001-04-27 Miguel de Icaza <miguel@ximian.com>
25975 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25976 to match the values in System.CodeDOM.
25978 Divid renamed to Divide.
25980 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25982 (Statements.set): remove.
25984 * System.CodeDOM/CodeCatchClause.cs: always have a valid
25987 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25988 falseStatements always have valid values.
25990 * cs-parser.jay: Use System.CodeDOM now.