1 2006-05-16 Raja R Harinath <rharinath@novell.com>
3 * statement.cs (Goto.Resolve): Merge jump origins here ...
4 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
6 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
7 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
8 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
9 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
11 * statement.cs (Goto.Resolve): ... not here.
12 (Goto.Emit): Remove CS1632 check.
14 2006-05-14 Marek Safar <marek.safar@seznam.cz>
16 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
19 2006-05-11 Raja R Harinath <rharinath@novell.com>
21 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
22 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
23 (FlowBranchingException.Label): Likewise.
25 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
27 (MyBitVector.Or): Use it to avoid losing information (Count).
28 (FlowBranching.MergeOrigins): Likewise.
30 * flowanalysis.cs (UsageVector.IsDirty): Remove.
31 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
32 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
33 (UsageVector.ToString): Simplify.
34 (UsageVector.MergeSiblings): Move here from ...
35 (FlowBranching.Merge): ... here.
36 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
39 2006-05-10 Raja R Harinath <rharinath@novell.com>
41 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
42 null bitvector is treated as all-true.
44 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
45 (MyBitVector): Rationalize invariants. 'vector != null' implies
46 that we have our own copy of the bitvector. Otherwise,
47 'InheritsFrom == null' implies all inherited bits are true.
49 2006-05-09 Marek Safar <marek.safar@seznam.cz>
51 * statement.cs (LocalInfo): Add IsConstant.
52 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
53 local variable for constants.
55 2006-05-09 Raja R Harinath <rharinath@novell.com>
57 * flowanalysis.cs (MyBitVector.Empty): New.
58 (MyBitVector): Don't allow InheritedFrom to be null.
59 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
60 (UsageVector, FlowBranching): Update to changes.
62 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
63 recursion. The 'Parent == null' condition isn't sufficient for
65 (FlowBranching.AddBreakOrigin): Likewise.
66 (FlowBranching.AddContinueOrigin): Likewise.
67 (FlowBranching.AddReturnOrigin): Likewise.
68 (FlowBranching.StealFinallyClauses): Likewise.
69 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
70 (FlowBranching.CheckOutParameters): Likewise.
71 (FlowBranchingToplevel): Terminate all the above recursions here.
72 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
73 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
75 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
77 (FlowBranchingToplevel): New. Empty for now.
78 (FlowBranching.MergeTopBlock): Update.
79 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
80 branching for the anonymous delegate.
81 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
83 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
84 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
85 information at the start of the merge. Reorganize.
87 2006-05-07 Marek Safar <marek.safar@seznam.cz>
89 * class.cs (MethodData.Define): Method cannot implement interface accessor.
91 2006-05-07 Marek Safar <marek.safar@seznam.cz>
93 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
94 to newly introduced ctor.
96 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
98 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
101 2006-05-07 Marek Safar <marek.safar@seznam.cz>
103 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
105 * ecore.cs (Expression.ResolveAsConstant): Updated.
107 * statement.cs (ResolveMeta): Updated.
109 2006-05-06 Marek Safar <marek.safar@seznam.cz>
111 * cs-parser.jay: __arglist cannot be used in initializer.
113 2006-05-06 Marek Safar <marek.safar@seznam.cz>
116 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
119 2006-05-05 Raja R Harinath <rharinath@novell.com>
121 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
122 (LabeledStatement): Add 'name' parameter.
123 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
124 (Block.AddLabel): Update to changes.
125 * cs-parser.jay (labeled_statement): Likewise.
127 * flowanalysis.cs (BranchingType.Labeled): New.
128 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
129 (FlowBranchingLabeled): New. Does nothing for now, but will
130 eventually handle 'goto' flows.
131 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
132 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
133 that's terminated ...
134 (Block.Resolve): ... here.
136 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
137 (UsageVector.MergeFinallyOrigins): Likewise.
138 (FlowBranching.InTryOrCatch): Likewise.
139 (FlowBranching.AddFinallyVector): Likewise.
140 (FlowBranchingException): Update to changes.
143 * statement.cs (Return.Resolve): Move error checking to ...
144 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
145 (FlowBranchingException): Handle return origins like break and
147 (FlowBranching.UsageVector.CheckOutParameters): Remove.
149 2006-05-04 Marek Safar <marek.safar@seznam.cz>
152 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
155 2006-05-04 Marek Safar <marek.safar@seznam.cz>
158 * class.cs (MethodData.Define): Do public accessor check only when method
159 implements an interface.
161 2006-05-04 Raja R Harinath <rharinath@novell.com>
163 Remove special handling of 'break'
164 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
165 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
166 (UsageVector.Break): Remove.
167 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
169 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
171 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
172 UsageVector.Breaks (). Don't set NeedsReturnLabel.
174 2006-05-03 Marek Safar <marek.safar@seznam.cz>
177 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
178 be the interface member.
180 2006-05-03 Marek Safar <marek.safar@seznam.cz>
183 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
184 for emitting small (int) values.
186 2006-05-03 Raja R Harinath <rharinath@novell.com>
189 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
190 control-flow passes through the 'finally' after merging-in all the
191 control-flows from 'try' and the 'catch' clauses.
193 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
194 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
195 always true at the only non-recursive entry point.
196 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
197 FlowBranchingBreakable.
198 (FlowBranchingLoop): Remove.
199 * statement.cs (Return.DoResolve): Update to changes.
202 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
203 (FlowBranching.CreateBranching): Handle it: create a
204 FlowBranchingContinuable.
205 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
206 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
207 except that it handles the 'continue' command.
208 (FlowBranching.UsageVector.MergeOrigins): Rename from
210 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
211 except that it overrides AddContinueOrigin.
212 (FlowBranchingException): Override AddContinueOrigin, similar to
214 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
215 Create a new branching around the embedded statement.
216 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
217 control flow after the embedded statement.
218 (Continue.Resolve): Move all error checking to AddContinueOrigin.
220 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
221 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
222 FlowBranchingBreakable.
223 (FlowBranchingSwitch): Remove.
226 * statement.cs (Break.Resolve): Simplify. Move responsibility for
227 error reporting to ...
228 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
229 Rename from 'AddBreakVector'. Add new location argument. Return
230 a bool indicating whether the 'break' crosses an unwind-protect.
231 (FlowBranchingException.AddBreakOrigin): Add.
232 (FlowBranchingException.Merge): Propagate 'break's to surrounding
233 flowbranching after updating with the effects of the 'finally'
235 (FlowBranchingBreakable): New common base class for
236 FlowBranchingLoop and FlowBranchingSwitch.
238 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
240 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
242 2006-05-02 Raja R Harinath <rharinath@novell.com>
244 * statement.cs (Do.Resolve): If the loop is infinite, set the
246 (While.Resolve, For.Resolve): Set a barrier after the embedded
247 statement. There's no direct control flow that goes from the end
248 of the embedded statement to the end of the loop.
249 * flowanalysis.cs (FlowBranching.Infinite): Remove.
250 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
251 above ensure that the reachability is correctly computed.
253 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
254 (UsageVector.MergeBreakOrigins): If the current path is
255 unreachable, treat it as if all parameters/locals are initialized.
256 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
257 infinite loops before merging-in break origins.
259 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
260 (Reachability.Reachable): Split part into ...
261 (Reachability.Unreachable): ... this. Simplify.
262 (Reachability.IsUnreachable): Use 'Unreachable' instead.
264 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
265 (Reachability.SetThrowsSometimes): Likewise.
266 (FlowBranchingBlock.MergeTopBlock): Don't compare against
267 TriState.Always, use corresponding property.
268 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
269 (Block.Resolve): Likewise. Remove some redundant checks.
271 2006-05-02 Raja R Harinath <harinath@gmail.com>
273 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
274 (Reachability.Meet): Don't bother checking AlwaysThrows --
275 barrier is always set.
276 (FlowBranchingBlock.Merge): Likewise.
278 2006-05-01 Raja R Harinath <harinath@gmail.com>
280 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
281 checks for unreachable.
283 2006-05-01 Marek Safar <marek.safar@seznam.cz>
286 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
288 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
289 whether field is really assigned.
291 2006-04-30 Raja R Harinath <harinath@gmail.com>
293 * flowanalysis.cs (Reachability): Make 4-argument constructor
295 (Reachability.Meet): Rename from 'And'. Remove static variant.
296 (Reachability.Always): Rename from the highly misleading
297 'Reachability.Never'.
298 (FlowBranching.Merge): Update to changes. Mark an impossible
299 situation with a 'throw'.
300 (*): Update to changes.
302 2006-04-29 Raja R Harinath <harinath@gmail.com>
304 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
306 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
307 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
308 (*): Update to changes.
309 * statement.cs: Update to changes.
311 2006-04-28 Marek Safar <marek.safar@seznam.cz>
314 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
316 2006-04-28 Raja R Harinath <harinath@gmail.com>
318 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
321 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
322 argument to two arguments: an usage-vector and a bool. Move call
323 to FlowBranching.Merge () ...
324 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
326 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
327 handling of loop and switch reachability to ...
328 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
330 2006-04-27 Raja R Harinath <harinath@gmail.com>
332 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
333 handling to FlowBranchingLoop.InLoop.
334 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
336 2006-04-26 Marek Safar <marek.safar@seznam.cz>
339 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
340 anonymous method is allowed from AnonymousContainer here.
342 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
344 2006-04-24 Raja R Harinath <rharinath@novell.com>
347 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
349 2006-04-23 Marek Safar <marek.safar@seznam.cz>
352 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
353 (DoubleConstant.Reduce): Ditto.
355 2006-04-23 Raja R Harinath <rharinath@novell.com>
357 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
358 Remove 'lvalue_right_side' argument. Move parts to ...
359 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
360 (LocalVariable.DoResolveLValue): ... these.
362 2006-04-21 Raja R Harinath <rharinath@novell.com>
365 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
366 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
367 (LocalVariableReference.DoResolveBase): Use it to implement new
369 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
370 (Argument.Resolve): Simplify. Move CS1510 check ...
371 * ecore.cs (Expression.ResolveLValue): ... here.
372 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
373 (PropertyExpr.DoResolveLValue): Likewise.
374 (FieldExpr.Report_AssignToReadonly): Likewise.
375 (FieldExpr.DoResolve): Add 'out_access' argument. Use
376 LValueMemberAccess or LValueMemberOutAccess on instance depending
378 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
379 DoResolve as appropriate.
381 2006-04-20 Raja R Harinath <rharinath@novell.com>
384 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
385 implicit conversions on 'out' and 'ref' arguments.
387 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
388 improve clarity. Remove dead code.
391 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
392 (Catch.Resolve): Resolve VarBlock if it exists.
394 2006-04-19 Miguel de Icaza <miguel@novell.com>
396 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
397 twice, this was some residual code, the enumerator was emitted
398 properly in the two branche of if later.
400 2006-04-19 Raja R Harinath <rharinath@novell.com>
402 * expression.cs (Cast.ResolveLValue): Remove. The result of a
403 cast is never an lvalue.
404 (Cast.DoResolve, Cast.ResolveRest): Combine.
405 (Argument.Emit): Simplify slightly. Move 'Expr is
406 IMemoryLocation' check ...
407 (Argument.Resolve): ... here.
408 (Argument.Error_LValueRequired): Remove. Inline into only user.
410 Simplifications. Fix cs0191-2.cs
411 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
412 CS1649 and CS1651 to ...
413 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
414 the actual selection of the error code and message to a lookup
415 table. Add a dummy return value to simplify callsites.
416 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
417 readonly fields of other instances of the same type. Move CS0197
419 * expression.cs (Argument.Resolve): ... here. Simplify code.
420 Ensure that ec.InRefOutArgumentResolving is only set during LValue
421 resolution of an out or ref argument. The code simplification
422 above uses this invariant.
424 2006-04-18 Raja R Harinath <rharinath@novell.com>
426 Possibly fix #77752. Fix cs1690-[4-7].cs.
427 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
428 CheckMarshallByRefAccess. Drop parameter.
429 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
431 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
433 * report.cs (AllWarnings): Add CS1690.
434 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
436 (LocalVariableReference.DoResolveBase): Update.
438 2006-04-09 Marek Safar <marek.safar@seznam.cz>
440 * class.cs (MethodOrOperator): Moved common parts from method class.
441 detect obsolete attributes.
442 (Method.Define): Simplified as it reuses code from base.
443 (Constructor.ValidAttributeTargets): Fixed issue found during
445 (Destructor.ValidAttributeTargets): Fixed issue found during
447 (Operator): Finished refactoring set off by #78020. Operator class is now
448 ordinary method class.
450 * anonymous.cs: Updated.
452 * decl.cs (DeclSpace): Add IsGeneric
454 2006-04-09 Marek Safar <marek.safar@seznam.cz>
456 * class.cs (Constructor.Emit): Don't emit the attributes twice.
458 2006-04-09 Marek Safar <marek.safar@seznam.cz>
460 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
461 detect obsolete attributes.
462 (Method.CreateEmitContext): Moved to MethodOrOperator.
464 2006-04-09 Marek Safar <marek.safar@seznam.cz>
467 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
468 customized exception to make crash detection easier.
469 (MethodOrOperator): Started to work on new base class for methods and
471 (Method): Derives from MethodOrOperator.
472 (Constructor.Emit): Emits its own attributes.
473 (AbstractPropertyEventMethod.Emit): Ditto.
474 (Operator): Derives from MethodOrOperator, will refactor fully in extra
476 (Operator.Emit): It's temporary more tricky than should be.
478 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
480 * report.cs (InternalErrorException): Add ctor with inner exception.
482 2006-04-08 Marek Safar <marek.safar@seznam.cz>
485 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
488 2006-04-07 Marek Safar <marek.safar@seznam.cz>
491 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
494 2006-04-06 Marek Safar <marek.safar@seznam.cz>
496 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
497 attribute is present and Guid not.
498 (Interface.ApplyAttributeBuilder): Ditto.
500 * attribute.cs: Add error message.
502 2006-04-06 Marek Safar <marek.safar@seznam.cz>
506 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
507 sources (it's composite) so hold them in extra array as they are used in
508 Emit phase only. It worked in the previous versions by mistake.
509 (Attribute.Emit): Emit attribute for more owners when exist.
511 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
512 it has now different behaviour.
514 2006-04-04 Marek Safar <marek.safar@seznam.cz>
516 * constant.cs (Constant.IsDefaultInitializer): New method.
520 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
521 re-initialize default values. It saves KBs almost for every assembly.
522 Thanks Zoltan for the idea.
523 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
524 (ArrayCreation.DoResolve): Resolve only once.
525 (ArrayCreation.Emit): Emit static initializer only when it is faster.
526 (ArrayCreation.GetAttributableValue): Cope with optimized values.
528 2006-04-03 Zoltan Varga <vargaz@gmail.com>
530 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
533 2006-04-01 Marek Safar <marek.safar@seznam.cz>
535 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
536 in an embedded statement too.
538 2006-04-01 Raja R Harinath <rharinath@novell.com>
541 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
543 2006-04-01 Marek Safar <marek.safar@seznam.cz>
547 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
550 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
552 2006-03-31 Marek Safar <marek.safar@seznam.cz>
554 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
557 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
558 LocalTemporary change.
560 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
562 (ClassOrStruct.DefineFieldInitializers): Implemented static field
563 initializers optimization.
564 (ClassOrStruct.TypeAttr): Moved from modifiers.
565 (Constructor.CheckBase): Don't crash when static ctor has parameters.
566 (FieldBase.ResolveInitializer): Resolves initializer.
567 (FieldBase.HasDefaultInitializer): New property.
569 * cs-parser.jay: Removed message.
571 * expression.cs (CompilerGeneratedThis): New specialization.
573 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
575 2006-03-28 Marek Safar <marek.safar@seznam.cz>
577 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
579 2006-03-27 Marek Safar <marek.safar@seznam.cz>
581 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
582 be now EnumConstants only.
584 2006-03-27 Marek Safar <marek.safar@seznam.cz>
586 * attribute.cs, driver.cs: Reset more caches.
588 2006-03-26 Marek Safar <marek.safar@seznam.cz>
590 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
592 2006-03-26 Marek Safar <marek.safar@seznam.cz>
594 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
595 for easier reuse. Updated all overrides.
596 (IntegralConstant): New base class for all integral constants.
597 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
598 of the constant range, report custom error.
599 (UIntConstant.Reduce): Fixed uint conversion.
601 * ecore.cs, literal.cs: Reduce updates.
603 2006-03-26 Marek Safar <marek.safar@seznam.cz>
607 * class.cs (Constructor.Define): Removed extra if for default ctors.
608 A patch from Atsushi Enomoto.
610 2006-03-26 Marek Safar <marek.safar@seznam.cz>
612 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
613 GetAttributableValue.
615 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
618 * convert.cs (ImplicitConversionRequired): Error message moved to
621 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
622 automatic implicit conversion of an output value.
623 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
625 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
627 (TypeOf.GetAttributableValue): Add extra handling for object type.
629 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
630 special error message.
632 2006-03-25 Marek Safar <marek.safar@seznam.cz>
634 * class.cs (Constructor.Emit): Don't crash when struct ctor is
636 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
637 compatible with MS runtime.
639 2006-03-23 Marek Safar <marek.safar@seznam.cz>
641 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
642 attribute arguments here.
644 * class.cs (Indexer.Define): The check was moved to attribute class.
646 2006-03-22 Marek Safar <marek.safar@seznam.cz>
648 * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
649 expression.cs, typemanager.cs: Minor changes from gmcs to make merging
652 2006-03-22 Raja R Harinath <rharinath@novell.com>
654 Support ParameterDefaultValueAttribute in gmcs. Also applied to
655 mcs to keep code differences small.
656 * attribute.cs (Attribute.GetParameterDefaultValue): New.
657 * typemanager.cs (parameter_default_value_attribute_type): New.
658 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
661 2006-03-21 Marek Safar <marek.safar@seznam.cz>
663 * expression.cs (StringConcat.Append): Reverted back to no warning state.
665 2006-03-21 Marek Safar <marek.safar@seznam.cz>
667 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
669 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
672 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
674 * doc-bootstrap.cs : fix build.
676 2006-03-20 Marek Safar <marek.safar@seznam.cz>
678 * expression.cs (StringConcat.Append): Issue a warning when empty string
681 2006-03-20 Marek Safar <marek.safar@seznam.cz>
683 * assign.cs (CompoundAssign.ResolveSource): Removed.
685 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
688 * class.cs (TypeContainer.FindMethods): Removed.
689 (TypeContainer.CheckMemberUsage): Made static.
691 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
693 * constant.cs (CheckRange): Removed unused type argument.
694 (CheckUnsigned): Removed unused type argument.
696 * cs-parser.jay: Updated after MemberAccess clean up.
697 Uses Length for empty string test.
699 * cs-tokenizer.cs: Uses Length for empty string test.
700 (IsCastToken): Made static.
701 (is_hex): Made static.
702 (real_type_suffix): Made static.
704 * decl.cs (SetupCache): Made static.
705 (OnGenerateDocComment): Removed unused ds argument.
707 * delegate.cs (VerifyDelegate): Removed unused argument.
709 * doc.cs: Uses Length for empty string test.
711 * driver.cs: Uses Length for empty string test.
713 * enum.cs (IsValidEnumType): Made static
715 * expression.cs (EnumLiftUp): Removed unused argument.
716 (ResolveMethodGroup): Ditto.
717 (BetterConversion): Ditto.
718 (GetVarargsTypes): Ditto.
719 (UpdateIndices): Ditto.
720 (ValidateInitializers): Ditto.
721 (MemberAccess.ctor): Ditto.
722 (GetIndexersForType): Ditto.
724 * flowanalysis.cs: (MergeFinally): Removed unused argument.
726 * iterators.cs: Updated after MemberAccess clean up.
728 * location.cs: Uses Length for empty string test.
730 * namespace.cs: Uses Length for empty string test.
732 * report.cs (CheckWarningCode): Made static.
734 * statement.cs (LabeledStatement): Removed unused argument.
736 * typemanager.cs (FilterNone): Removed.
738 2006-03-18 Marek Safar <marek.safar@seznam.cz>
740 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
745 2006-03-18 Marek Safar <marek.safar@seznam.cz>
747 * cs-parser.jay.cs: __arglist is not allowed for delegates.
749 2006-03-18 Marek Safar <marek.safar@seznam.cz>
753 * expression.cs (VerifyArgumentsCompat): Reverted to double error
754 reporting, it's more tricky than I thought.
756 2006-03-18 Marek Safar <marek.safar@seznam.cz>
760 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
762 (AnonymousMethod.ImplicitStandardConversionExists): New method.
763 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
764 Add more error reporting; Fixed issue with params.
766 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
768 * cs-parser.jay: AnonymousMethod requires host container.
770 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
772 2006-03-18 Raja R Harinath <harinath@gmail.com>
774 * class.cs: Change 'TypeContainer ds' constructor argument to
775 'DeclSpace parent'. Some classes were missed below due to
776 different naming convention.
778 * class.cs (MemberCore.Parent): Delete. This makes the
779 ParentContainer changes below enforceable by the compiler.
781 Treat pointers to enclosing declaration space as 'DeclSpace', not
783 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
784 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
786 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
788 (Block.AddThisVariable): Likewise.
789 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
790 (AbstractPropertyEventMethod.Emit): Likewise.
791 (AbstractPropertyEventMethod.EmitMethod): Likewise.
792 (GetMethod.Define, SetMethod.Define): Likewise.
793 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
794 (DelegateMethod.EmitMethod): Likewise.
796 Fix regression test-partial-13.cs.
797 Rationalize use of PartialContainer. Ensure that the partial
798 class semantics can be tied to type-correctness, i.e., any
799 violation will cause a compile error.
800 * class.cs, const.cs: Access all fields that belong to class
801 TypeContainer via ParentContainer. Arguments of EmitContexts and
802 Resolve()-like functions still use 'Parent'.
804 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
805 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
806 (PropertyMethod.CheckModifiers): Remove unused argument.
807 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
810 2006-03-17 Raja R Harinath <harinath@gmail.com>
812 Make semantics of PartialContainer simpler.
813 * decl.cs (DeclSpace.IsPartial): Remove.
814 * class.cs (TypeContainer.IsPartial): Likewise.
815 (TypeContainer..ctor): Set PartialContainer to point to self.
816 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
817 (TypeContainer.FindNestedType): Likewise.
818 (MemberCore.ParentContainer): Simplify. Remove deprecation.
820 2006-03-17 Marek Safar <marek.safar@seznam.cz>
822 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
824 2006-03-15 Marek Safar <marek.safar@seznam.cz>
826 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
829 2006-03-15 Marek Safar <marek.safar@seznam.cz>
831 * class.cs (Operator.Define): An error for base conversion was not
834 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
836 * iterator.cs : yield break is allowed in try statement which has
837 catch clauses. Fixed bug #77767.
839 2006-03-13 Marek Safar <marek.safar@seznam.cz>
841 A fix for #77593, #77574.
843 * class.cs (MethodCore.CheckBase): Another if for operator.
845 2006-03-09 Marek Safar <marek.safar@seznam.cz>
847 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
850 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
851 (DelegateCreation.ImplicitStandardConversionExists): New method for just
854 *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
857 * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
858 Updated after another emitcontext usage was clean up. It should help us to
859 synchronize with gmcs easier.
861 2006-03-04 Marek Safar <marek.safar@seznam.cz>
865 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
866 (Event.Define): ditto
867 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
869 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
870 Removed redundant code and set NewSlot for Invoke method too.
872 * parameter.cs (Parameters.ctor): Add custom, type ctor.
873 (Parameters.MergeGenerated): New method. Use this method when you merge
874 compiler generated argument with user arguments.
876 2006-03-03 Marek Safar <marek.safar@seznam.cz>
878 * attribute.cs (ResolveAsTypeTerminal): Removed.
880 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
881 specialization for predefined types; 30% speed up.
882 Finally placed obsolete check to right place.
883 (Expression.ResolveType): Removed.
885 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
886 Updated after ResolveType was removed.
888 * expression.cs (Cast.ctor): Check void cast.
889 (Binary.ResolveAsTypeTerminal): Is never type.
890 (Conditional.ResolveAsTypeTerminal): Is never type.
892 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
894 2006-03-01 Raja R Harinath <rharinath@novell.com>
897 * expression.cs (ParameterReference.DoResolveBase): Change return
899 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
903 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
906 * typemanager.cs (GetFullNameSignature): Don't nullref on
909 2006-02-27 Marek Safar <marek.safar@seznam.cz>
911 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
912 these two separated members to simplify the code.
913 (Attribute.Resolve): Refactored to use new fields and methods.
914 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
915 implemented obsolete attribute checking.
916 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
917 implemented obsolete checking again. It look line never ending quest ;-)
918 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
920 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
922 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
924 *class.cs (Property.Define): Add RegisterProperty call.
926 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
927 argument groups (only 2).
929 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
930 encoding expression to arguments.
931 (Expression.ExprClassToResolveFlags): Just turned to property.
933 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
934 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
935 optimized as well as implemented support for zero-length attributes.
937 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
938 Add caching of PropertyInfo's.
940 2006-02-25 Marek Safar <marek.safar@seznam.cz>
942 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
943 error multiple times.
945 2006-02-25 Marek Safar <marek.safar@seznam.cz>
947 New partial class implementation.
948 A fix for #77027, #77029, #77403
950 * attribute.cs (Attributable): Made attributes protected.
952 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
953 the replacements of ClassPart and PartialContainer.
954 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
955 (TypeContainer.AddInterface): Ditto.
956 (TypeContainer.AddPartial): The main method for partial classes. It checks
957 for errors and merges ModFlags and attributes. At the end class is added to
959 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
961 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
962 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
963 from the rest of partial classes.
964 (TypeContainer.GetClassBases): Simplified.
965 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
967 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
968 (TypeContainer.HasExplicitLayout): Uses Flags now.
969 (PartialContainer): Removed.
970 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
971 (StaticClass): Was merged with Class.
972 (Class.GetClassBases): class and static class bases are verified here.
973 (Class.TypeAttr): Added static attributes when class is static.
974 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
975 (MemberBase): In some cases we need to call parent container for partial
976 class. It should be eliminated but it's not easy now.
978 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
980 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
981 partial classed to accumulate class comments.
982 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
984 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
986 * driver.cs (MainDriver): Tree.GetDecl was removed.
988 * modifiers.cs (Modifiers): Add partial modifier.
990 * tree.cs (Tree.decl): Removed.
991 (RootTypes): Started to use this class more often for root types
994 2006-02-22 Marek Safar <marek.safar@seznam.cz>
998 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
999 external interface does not have an attribute.
1001 2006-02-22 Marek Safar <marek.safar@seznam.cz>
1003 Another prerequisites for new partial classs implementation.
1005 * attribute.cs (Attribute.Equal): Implemented.
1006 (Attribute.Emit): Changed as attributes can be applied more than twice.
1007 (Attributes.Emit): Check for duplicate attributes here.
1009 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
1010 as a parameter, clean-up.
1012 2006-02-11 Marek Safar <marek.safar@seznam.cz>
1016 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
1017 contains obsolete attribute check which can in some cases look for base
1018 type of current class which is not initialized yet.
1019 (TypeContainer.BaseType): Replacement of ptype.
1021 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
1023 2006-02-11 Marek Safar <marek.safar@seznam.cz>
1025 First of prerequisites for new partial classs implemention.
1027 * attribute.cs (Attributable): Extended by ResolveContext;
1028 Attributes finally have correct context for resolving in all cases.
1029 (AttachTo): Attribute owner is assigned here.
1031 * codegen.cs (IResolveContext): Introduce new interface to hold
1032 all information needed in resolving phase.
1033 (EmitContext): Implements IResolveContext; more clean-up needed here.
1035 * decl.cs (MemberCore): Implemented IResolveContext.
1037 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
1038 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
1039 parameter.cs, statement.cs, tree.cs, typemanager.cs:
1040 Refactored to use new IResolveContext instead of EmitContext; cleanup
1042 2006-02-06 Miguel de Icaza <miguel@novell.com>
1044 * codegen.cs (EmitScopeInitFromBlock): check here the
1045 capture_context, there is no need to make two calls to the
1048 * anonymous.cs: Add some debugging messages that might help me
1049 track other instances of this problem in the future (the
1050 regression of test 467).
1052 * cs-parser.jay: track the variable block, as we need to initalize
1053 any captured variables declared in this block for the "catch"
1054 portion of the "Try" statement.
1056 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
1057 scope initialization for captured variables.
1059 Also, move the emit for the variables after the block location has
1062 2006-02-06 Marek Safar <marek.safar@seznam.cz>
1064 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
1066 2006-02-02 Miguel de Icaza <miguel@novell.com>
1068 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
1069 commit yesterday, the initialization for the roots is necessary.
1070 What is not necessary is the scope activation.
1072 2006-02-02 Raja R Harinath <rharinath@novell.com>
1074 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
1075 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
1077 (Argument.Resolve): Remove CS0206 checks.
1079 2006-02-01 Miguel de Icaza <miguel@novell.com>
1081 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
1082 scopes for all the roots, the scopes will now be emitted when the
1083 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
1085 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
1086 code. This reduces a lot of existing cruft.
1088 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
1089 that the ScopeInfo is generated as we enter the scope, not at the
1090 time of use, which is what we used to do before.
1092 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
1093 every time a Block is about to be emitted if we have a
1096 2006-02-01 Raja R Harinath <rharinath@novell.com>
1098 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
1100 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
1102 * typemanager.cs (cons_param_array_attribute): Make private.
1103 (Reset): Set it to null.
1104 (InitCoreHelpers): Don't initialize it.
1105 (ConsParamArrayAttribute): New. Initialize it as needed.
1106 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
1108 2006-01-31 Miguel de Icaza <miguel@novell.com>
1110 * expression.cs: There might be errors reported during the
1111 selection of applicable methods. If there are errors, do not
1112 continue execution as it will lead the compiler to crash.
1114 2006-01-30 Miguel de Icaza <miguel@novell.com>
1116 * expression.cs: Member access is not allowed on anonymous
1117 methods. Fixes #77402.
1119 2006-01-30 Raja R Harinath <rharinath@novell.com>
1122 * cs-parser.jay (VariableDeclaration): Don't set
1123 current_array_type to null.
1124 (field_declaration, event_declaration, declaration_statement):
1125 Set it to null here.
1127 2006-01-28 Raja R Harinath <harinath@gmail.com>
1129 * typemanager.cs (GenericParameterPosition): New.
1132 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
1134 * doc.cs : To process "include" elements, first we should create
1135 another list than XmlNodeList, because it could result in node
1136 removal, which could result in that the XmlNodeList gives up
1139 (Also made code identical to gmcs again.)
1141 2006-01-25 Miguel de Icaza <miguel@novell.com>
1143 * ecore.cs: Introduce an error report that we were not catching
1144 before, if not silent, we must report the error. Gonzalo ran into
1147 2006-01-23 Miguel de Icaza <miguel@novell.com>
1149 A fix for bug: #76957
1151 * iterators.cs (MoveNextMethod.CreateMethodHost): call
1152 ComputeMethodHost before creating the method, this is a new
1155 * anonymous.cs (AnonymousContainer): Now we track all the scopes
1156 that this method references (RegisterScope). The actual scope
1157 where the method is hosted is computed with the ComputeMethodHost
1158 before we create the method.
1160 Moved the Deepest routine here.
1162 (AnonymousContainer.ComputeMethodHost): New routine used to
1163 compute the proper ScopeInfo that will host the anonymous method.
1165 (ScopeInfo): Deal with multiple roots. The problem was that we
1166 did not have a unique root where all ScopeInfos could be hanged
1167 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
1170 Remove AdjustMethodScope which is now computed at the end. Remove
1171 LinkScope which did a partial link, instead link all ScopeInfos
1172 before code generation from the new "LinkScopes" routine.
1174 Simplify all the Add* routines as they no longer need to maintain
1175 the tree, they just need to record that they are using variables
1178 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1179 routines to produce the forest of ScopeInfo trees.
1181 * class.cs (TypeContainer.AppendMethod): This is just like
1182 AddMethod, but ensures that an interface implementation method
1183 (IEnumerable.XXX) is not inserted at the beginning of the queue of
1184 methods, but at the end.
1186 We use this functionality to ensure that the generated MoveNext
1187 method in the iterator class is resolved/emitted before the
1188 enumerator methods created.
1190 This is required because the MoveNext method computes the right
1191 ScopeInfo for the method. And the other methods will eventually
1192 need to resolve and fetch information computed from the anonymous
1195 2006-01-21 Raja R Harinath <harinath@gmail.com>
1196 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1199 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
1201 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
1202 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
1204 2006-01-18 Raja R Harinath <rharinath@novell.com>
1206 Fix #76656, cs0231-2.cs.
1207 * cs-parser.jay (formal_parameter_list): Make error case catch
1209 (parenthesized_expression_0): Add CS1026 check.
1210 (invocation_expression): Remove unused { $$ = lexer.Location }.
1212 2006-01-17 Raja R Harinath <rharinath@novell.com>
1215 * cs-parser.jay (statement_expression): Don't list out the
1216 individual statement-expressions. Convert syntax error into
1219 2006-01-16 Raja R Harinath <rharinath@novell.com>
1222 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
1223 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
1224 CheckIntermediateModification.
1225 (FieldExpr.DoResolve): Add new two-argument version that
1226 allows us to resolve the InstanceExpression as an lvalue.
1227 The one-argument variant is now just a wrapper.
1228 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
1229 Resolve the lhs as an lvalue if the it has a value type.
1230 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
1231 from Assign.DoResolve.
1232 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
1233 resolved as an lvalue.
1234 (PropertyExpr.DoResolve): Update.
1235 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
1236 has a value type. Move CS1612 check here from
1237 CheckIntermediateModification.
1238 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
1239 * expression.cs (EmptyExpression.OutAccess): New. Used as the
1240 'right_side' of a ResolveLValue on an 'out' argument.
1241 (EmptyExpression.LValueMemberAccess): New. Used as the
1242 'right_side' of a propagated ResolveLValue on a value type.
1243 (LocalVariableReference.DoResolveBase): Recognize
1244 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
1246 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
1247 EmptyExpression.Null.
1249 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
1251 * typemanager.cs : added IsGenericParameter(). In mcs it always
1253 * doc.cs : for generic parameters, use GenericParameterPosition,
1256 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
1258 * expression.cs: Fix Console.WriteLine ((this = x).foo);
1260 2006-01-12 Miguel de Icaza <miguel@novell.com>
1262 This fixes the problem where we used ldfld instead of ldflda to
1263 load the "THIS" pointer on captured parameters, when THIS is a
1264 value type. See bug #77205.
1266 * iterators.cs (CapturedThisReference.Emit): Pass false to
1267 EmitThis (we do not need the address).
1269 * codegen.cs (EmitThis): it needs to know whether we need the
1270 address of `this' or not. This is used by value types.
1272 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
1273 every other call passes false.
1275 2006-01-12 Raja R Harinath <rharinath@novell.com>
1278 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
1280 * expression.cs (Invocation.OverloadResolve): Update.
1281 (Invocation.DoResolve): Avoid double resolution of invocation.
1283 2006-01-11 Raja R Harinath <rharinath@novell.com>
1286 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
1287 unary negation of floating point types as 0-expr; negation cannot
1288 overflow in floating point types.
1291 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
1292 on operands of 'void' type.
1295 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
1296 and ExclusiveOr for boolean constants too.
1298 2006-01-09 Raja R Harinath <rharinath@novell.com>
1301 * expression.cs (Invocation.OverloadResolve): Replace reflected
1302 override methods with their base virtual methods, rather than
1304 * typemanager.cs (TypeManager.GetOverride): New.
1306 2006-01-05 Jb Evain <jbevain@gmail.com>
1308 * class.cs (Property.Define, Indexer.Define): do not tag the
1309 properties as SpecialName | RTSpecialName.
1311 2006-01-04 Miguel de Icaza <miguel@novell.com>
1313 * class.cs (MethodCore.IsDuplicateImplementation): This method was
1314 doing a low-level comparission of parameter types. It was lacking
1315 a check for __argslist.
1317 2005-12-30 Miguel de Icaza <miguel@novell.com>
1319 * expression.cs (ParameterReference.DoResolveBase): Allow
1320 reference parameters if they are local to this block.
1322 This allows the ref and out parameters of a delegate to be used in
1323 an anonymous method, for example:
1325 delegate void set (out int x);
1327 set s = delegate (out int x){
1331 This is used by functionality introduced late in the C# language.
1333 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1334 method that take ref and out parameters.
1336 Fixes #77119 which was a late change in the spec.
1338 2005-12-23 Miguel de Icaza <miguel@novell.com>
1340 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1341 parent if its the same scope. Fixes #77060.
1343 2005-12-21 Miguel de Icaza <miguel@novell.com>
1345 * driver.cs: Report the case of no source files and no -out:
1348 2005-12-20 Raja R Harinath <rharinath@novell.com>
1351 * expression.cs (ComposedCast.GetSignatureForError): Define.
1353 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1357 * namespace.cs (NamespaceEntry): Add extern_aliases as a
1358 ListDictionary, to contain the ExternAliasEntry entries (in
1359 addition to the NamespaceEntry.aliases hashtable). This field is
1360 shared between the original entry and its doppelganger (bodyless
1362 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1363 extern_aliases field.
1364 (NamespaceEntry.Lookup): Move the IsImplicit check after the
1365 lookup in extern_aliases.
1367 2005-12-16 Raja R Harinath <rharinath@novell.com>
1370 * class.cs (TypeContainer.Mark_HasEquals): New.
1371 (TypeContainer.Mark_HasGetHashCode): New.
1372 (ClassPart): Override them.
1373 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1376 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1377 'parent' argument to the base constructor.
1379 Remove all mention of TypeContainer from decl.cs.
1380 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1381 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1382 (DeclSpace.DeclSpace): Likewise.
1383 (DeclSpace.DefineMembers): Remove unused argument.
1384 * cs-parser.jay (pop_current_class): Update to changes. Simplify
1385 debugging check -- we don't care if the debug code throws an
1386 InvalidCastException instead of an InternalErrorException.
1387 * class.cs (TypeContainer.DefineMembers): Update to changes.
1388 (TypeContainer.DoDefineMembers): Likewise.
1389 (TypeContainer.GetMethods): Likewise.
1390 (PropertyMember.Define): Likewise.
1391 (MemberBase.Parent): New property that forwards to
1392 MemberCore.Parent, but ensures that we get a TypeContainer.
1393 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1394 (RootContext.PopulateTypes): Likewise. Remove special case code
1395 for !RootContext.StdLib: DefineMembers is idempotent.
1397 2005-12-14 Miguel de Icaza <miguel@novell.com>
1399 * convert.cs (ExplicitConversionCore): Check the return value from
1400 ExplicitConversionCore which can return null on failure. Fixes #76914
1402 2005-12-13 Marek Safar <marek.safar@seznam.cz>
1404 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1406 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
1408 * doc.cs : The search for referenced namespace was insufficient to
1409 get global one as it used to do. Fixed bug #76965.
1411 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
1413 * doc.cs : check name in cref in the last phase that whether it is
1416 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1418 * cs-tokenizer.cs : reverted the latest change: it somehow broke
1421 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1423 * doc.cs : so it turned out that we cannot skip override check for
1424 interface members. Fixed bug #76954.
1426 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1428 * cs-tokenizer.cs : fixed bug #75984:
1429 - #warning and #error should not be handled when the source line
1431 - #line is not checked strictly when the source line is disabled.
1432 - #define and #undef is on the other hand checked strictly at any
1435 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
1437 * cs-tokenizer.cs : missing Location (actually, filename) in one of
1440 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1442 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1444 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1446 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1447 (FieldBase.Initializer): Initializer is now optional.
1448 (EventField.Define): Only event field can have initializer.
1450 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1452 * const.cs (Const): Reuse initializer.
1454 * cs-parser.jay: Updated after FieldBase changes.
1455 Added current_array_type to simplify array initializers.
1457 * ecore.cs (NullCast.IsDefaultValue): Implemented.
1459 * expression.cs, iterators.cs: Updated.
1461 * namespace.cs (NamespaceEntry): Made UsingFound private.
1463 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1465 * parameterCollection.cs: Obsolete, removed.
1466 * parser.cs: Obsolete, removed.
1468 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1471 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1473 * enum.cs (Enum.Define): Set obsolete context here.
1475 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
1478 - FindDocumentedMember() now expects 1) paramList as null
1479 when "we don't have to check the number of parameters" and
1480 2) Type.EmptyTypes when "there is no arguments".
1481 - Introduced FoundMember struct to hold the exact type which was
1482 used to find the documented member (the above change broke
1483 test-xml-044; it might be better just to use DeclaringType than
1484 what MS does, like this change does, but it depends on usage.)
1486 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
1488 * doc.cs : documented member might be from DeclaringType for nested
1489 types. Fixed bug #76782.
1491 2005-12-03 Ben Maurer <bmaurer@ximian.com>
1493 * anonymous.cs: Have the param code handle leaving copies on the
1494 stack etc. Allows anonymous params to take part in the assignment
1495 code (++, +=, etc). Fixes bug #76550
1497 * expression.cs: Handle the prepare_for_load/leave_copy by passing
1498 it down to the anon code.
1500 * iterators.cs: Use dummy var here
1502 * codegen.cs: Handle new vars
1504 2005-12-01 Marek Safar <marek.safar@seznam.cz>
1507 * class.cs (MethodData.Define): Set proper Obsolete context.
1509 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1511 (FieldExpr.DoResolve): Ditto.
1513 2005-12-01 Marek Safar <marek.safar@seznam.cz>
1516 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1517 parent is not obsolete.
1519 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
1521 * doc.cs : (FindDocumentedMember) find parameterless members first
1522 and get CS0419 in the early stage. Fixed first case of bug #76727.
1524 2005-11-30 Marek Safar <marek.safar@seznam.cz>
1527 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1528 no error was reported.
1530 *expression.cs (Binary.DoResolve): left can be null.
1532 2005-11-22 Marek Safar <marek.safar@seznam.cz>
1535 * class.cs (MethodData.Emit): Parameters should be labeled first.
1537 2005-11-21 Marek Safar <marek.safar@seznam.cz>
1540 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1542 2005-11-18 Marek Safar <marek.safar@seznam.cz>
1544 * attribute.cs (AreParametersCompliant): Moved to Parameter.
1546 * class.cs (MethodCore): Parameter clean up.
1547 (IMethodData): Added ParameterInfo.
1548 (MethodData): Parameter clean up.
1549 (Indexer.Define): Parameter clean up.
1561 * typemanager.cs: Parameter clean up.
1563 * delegate.cs (Define): Get rid of duplicated code.
1565 * expression.cs (ParameterReference): Removed useless parameters
1567 (Invocation): Ditto.
1569 * parameter.cs (ParamsParameter): New class, params specialization.
1570 (ArglistParameter): Attemp to separate arglist.
1571 (Parameter): Refactored to be reusable and faster.
1572 (Parameter.Modifier): Made understandable.
1573 (Parameters): Changed to be used as a class for `this' assembly
1574 parameters. Refactored to use new specialized classes.
1576 * support.cs (ParameterData): Added Types property.
1577 (InternalParameters): Deleted.
1579 2005-08-20 Martin Baulig <martin@ximian.com>
1581 Merging this patch from GMCS to fix #75867.
1583 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
1584 scope if we don't already have it.
1586 2005-11-17 Martin Baulig <martin@ximian.com>
1589 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
1590 inherit the scope from our parent. Fixes #76653.
1592 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1594 * doc.cs : the previous patch does not actually fix the bug.
1595 PropertyInfo override check is now implemented and really fixed it.
1596 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
1598 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1600 * doc.cs : apply "override filter" also to properties.
1603 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1605 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
1606 no need to check overrides. For classes, omit those results from
1607 interfaces since they must exist in the class. Fixed bug #76726.
1609 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1611 * typemanager.cs : (GetFullNameSignature) differentiate indexers
1612 with different parameters. Fixed the second problem in #76685.
1614 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1616 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
1617 get expected 'protected' access in CheckValidFamilyAccess()).
1620 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1622 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
1623 Fixed bug #76705. CS1569 was incorrectly commented out.
1625 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
1627 * doc.cs : use Invocation.IsOverride() to do real override check.
1628 * expression.cs : made Invocation.IsOverride() internal.
1630 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
1632 * doc.cs : use TypeManager.FindMembers() instead of (possible)
1633 TypeBuilder.FindMembers() and filter overriden base members out.
1636 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1638 * doc.cs : ref/out parameters are represented as '@' (instead of
1639 '&' in type FullName). Fixed bug #76630 (additionally crefs).
1641 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1643 * doc.cs : when there was no '.' in cref to methods in doc comment,
1644 then parameters were missing in the output. Fixed bug #76691.
1646 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1648 * driver.cs : don't output docs when there is an error.
1651 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1654 Now it should detect indexers. Fixed primary concern in bug #76685.
1655 Fixed CS0419 message to not show the identical member signature in
1658 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1660 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
1661 instead of Type.FindMembers() since it does not handle events.
1664 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
1666 * codegen.cs: Fixed typo (speficied -> specified).
1668 2005-11-11 Marek Safar <marek.safar@seznam.cz>
1671 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
1673 2005-11-11 Marek Safar <marek.safar@seznam.cz>
1675 * attribute.cs: Changed error message.
1677 * cs-tokenizer.cs: One more check.
1679 2005-11-10 Marek Safar <marek.safar@seznam.cz>
1681 * statement.cs (Block.Resolve): Ignore empty statement.
1683 2005-11-10 Marek Safar <marek.safar@seznam.cz>
1685 * report.cs: Made error/warning methods more strict to avoid
1688 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
1689 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
1690 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
1691 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
1693 2005-11-08 Marek Safar <marek.safar@seznam.cz>
1695 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
1696 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
1698 * class.cs (TypeContainer.IsComImport): New property.
1699 (Constructor.Define): Create proper ctor for ComImport types.
1701 * expression.cs (New.CheckComImport): Fixed.
1703 2005-11-07 Miguel de Icaza <miguel@novell.com>
1705 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
1706 that a parameter has been captured does not mean that we do not
1707 have to do the rest of the processing. This fixes the second part
1708 of #76592. If there was another anonymous method capturing
1709 values in the past, the Scope would never be set for the second
1710 method that captured the same parameter.
1712 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
1713 properly manipulate the stack. Second part of fix for #76592.
1715 * expression.cs (New): Add support for invoking "new" on
1716 interfaces that have been flagged with the ComImport attribute and
1717 the CoClass. Fixes #76637
1719 * statement.cs (Try.DoEmit): When a variable is captured, do not
1720 try to emit the vi.LocalBuilder variable as it has been captured.
1721 Create a temporary variable and store the results on the
1722 FieldBuilder. Fixes #76642
1724 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1726 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
1728 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
1730 * expression.cs (Binary.DoResolve): Added && optimalization.
1732 * typemanager.cs (AddUserType): Removed useless argument.
1734 2005-11-04 Marek Safar <marek.safar@seznam.cz>
1736 * statement.cs (Block.variables): Uses ListDictionary.
1738 2005-11-03 Marek Safar <marek.safar@seznam.cz>
1741 * class.cs (PartialContainer.EmitType): Customized to emit
1742 security attributes.
1743 (ClassPart.ApplyAttributeBuilder): Transform security attribute
1744 for partial classes.
1746 2005-11-03 Marek Safar <marek.safar@seznam.cz>
1749 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
1750 access has to be fixed.
1752 * typemanager.cs (IsUnmanagedType): Wrong common field type.
1754 2005-11-01 Marek Safar <marek.safar@seznam.cz>
1757 * ecore.cs (NullCast.Reduce): Implemented.
1759 * expression.cs (ArrayCreation.CheckIndices): Correcly check
1762 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
1764 (Foreach.Resolve): Catch null properly.
1766 2005-10-29 Marek Safar <marek.safar@seznam.cz>
1768 * cs-tokenizer.cs: Warning text fix.
1770 * driver.cs: AllWarningNumbers exposed on public interface.
1772 * report.cs (): Reviewed warning numbers.
1773 (IsValidWarning): Use binary search.
1775 2005-10-29 Marek Safar <marek.safar@seznam.cz>
1777 * driver.cs: Implemeted resource visibility.
1778 (Resources): New class for code sharing between /res: and
1781 2005-10-28 Marek Safar <marek.safar@seznam.cz>
1784 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
1787 * convert (Convert.ImplicitReferenceConversion): NullCast holds
1790 * ecore.cs (NullCast): Child is contant only.
1792 * literal.cs (NullLiteral.Reduce): null can be converted to any
1795 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
1797 * driver.cs: Use Encoding.Default as default code page instead
1800 2005-10-27 Raja R Harinath <rharinath@novell.com>
1803 * expression.cs (Invocation.Error_InvalidArguments): Handle
1804 __arglist parameters.
1805 (Invocation.VerifyArgumentsCompat): Likewise.
1806 * support.cs (ReflectionParameters.GetSignatureForError): Print
1807 __arglist parameters.
1808 (InternalParamters.GetSignatureForError): Likewise.
1809 * parameter.cs (Parameters.GetSignatureForError): Likewise.
1811 2005-10-26 Marek Safar <marek.safar@seznam.cz>
1813 * attribute.cs (GetPropertyValue): Made public.
1815 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
1817 Add new property WrapNonExceptionThrows to handle 2.0 assembly
1819 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
1822 * driver.cs: Reflect method name change.
1824 * statement.cs (Try.Resolve): Warn when try has both general
1827 * typemanager.cs: runtime_compatibility_attr_type new predefined
1830 2005-10-26 Raja R Harinath <harinath@gmail.com>
1833 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
1834 treat it as an empty parameter list.
1836 2005-10-26 Raja R Harinath <rharinath@novell.com>
1839 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
1840 ResolveAsTypeStep silent.
1841 * statement.cs (Block.AddConstant): Mark block as used.
1842 (Block.ResolveMeta): Avoid piling on error messages
1843 if a constant initializer resolution fails.
1845 2005-10-25 Raja R Harinath <rharinath@novell.com>
1847 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
1849 (NamespaceEntry.VerifyAllUsing): New.
1850 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
1851 behaviour. Delegates actual resolution of alias to ...
1852 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
1853 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
1855 * driver.cs (Driver.MainDriver): Update.
1857 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
1858 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
1860 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
1862 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
1863 RootNamespace.DefineNamespacesForAll.
1865 2005-10-24 Raja R Harinath <harinath@gmail.com>
1867 * typemanager.cs (assemblies, external_aliases, modules)
1868 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
1869 (ComputeNamespaces, GetRootNamespace): Remove extra staging
1870 overhead. Move resposibility ...
1871 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
1872 * driver.cs, attribute.cs, codegen.cs: Update to changes.
1874 2005-10-23 Raja R Harinath <harinath@gmail.com>
1876 * namespace.cs (RootNamespace.all_namespaces): Renamed from
1877 cached_namespaces. Improve usage.
1878 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
1879 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
1880 Move from GlobalRootNamespace and simplify.
1881 (RootNamespace.Global): Make instance variable.
1882 (RootNamespace.RootNamespace): Add "alias name" parameter.
1883 (GlobalRootNamespace): Simplify drastically.
1884 (Namespace.Lookup): Don't use GetNamespace.
1885 * typemanager.cs (GetRootNamespace): Rename from
1886 ComputeNamespaceForAlias.
1887 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
1889 2005-10-23 Marek Safar <marek.safar@seznam.cz>
1891 * anonymous.cs (AnonymousContainer): Don't crash when container
1894 2005-10-23 Marek Safar <marek.safar@seznam.cz>
1896 * expression.cs (Binary.DoResolve): Warn when comparing same
1899 2005-10-23 Marek Safar <marek.safar@seznam.cz>
1902 * expression.cs (Binary.DoResolve): It looks like there are no
1903 convetsion rules in enum context.
1905 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1907 Add support for extern alias qualifiers.
1908 * typemanager.cs: Move some LookupTypeReflection code
1909 to namespace.cs, to have cleaner code. Added some methods
1910 to help us keep track of the extern aliased references.
1911 * driver.cs: Add suport for extern alias assemblies on command
1912 line and check for their warnings/errors. Also keep track of the
1913 extern aliased assemblies.
1914 * namespace.cs: Move the global functionality of Namespace
1915 to GlobalRootNamespace/RootNamespace. Now the global namespace
1916 is GlobalRootNamespace.Globa. Also the code moved from
1917 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
1918 Finally added LocalAliasEntry (AliasEntry before) and
1919 ExternAliasEntry, to handle alias statements.
1920 * cs-parser.jay: Add support in the grammar for extern alias
1922 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
1923 Update callings to Namespace (now in GlobalRootNamespace).
1925 2005-10-18 Raja R Harinath <rharinath@novell.com>
1928 * class.cs (TypeContainer.DefineType): Move updating of
1929 topological sort earlier in the code.
1930 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
1932 2005-10-18 Marek Safar <marek.safar@seznam.cz>
1935 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
1937 * constant.cs (Constant.TryReduce): Moved from Cast class.
1938 (Reduce): Made little bit more OO and fixed missing conversions.
1940 * ecore.cs (Reduce): Implemented.
1941 (Binary.EnumLiftUp): New method to upgrade values to enum values.
1943 * literal.cs (Reduce): Implemented.
1945 * class.cs: Reverted Miguel's wrong commit.
1947 2005-10-14 Miguel de Icaza <miguel@novell.com>
1949 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
1951 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
1953 * cs-parser.jay, expression.cs : CS0214 was missing error location
1954 for constants. Fixed bug #76404.
1956 2005-10-11 Marek Safar <marek.safar@seznam.cz>
1959 * convert.cs (ExplicitConversionCore): Fixed object->enum
1962 2005-10-10 Raja R Harinath <rharinath@novell.com>
1964 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
1966 (PropertyExpr.EmitCall): Likewise.
1967 * expression.cs (Invocation.EmitArguments): Handle case where
1969 (Invocation.EmitCall): Avoid allocating temporary variable if
1970 there are no arguments.
1972 2005-10-07 Raja R Harinath <rharinath@novell.com>
1975 * convert.cs (ImplicitConversionStandard): Move conversion of
1976 void* to arbitrary pointer types ...
1977 (ExplicitConversionStandard): .. here.
1978 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
1979 error to always print typenames.
1981 2005-10-07 Raja R Harinath <rharinath@novell.com>
1983 * convert.cs (GetConversionOperator): Rename from
1984 GetConversionOperators. Move operator selection code from ...
1985 (UserDefinedConversion): ... here.
1987 2005-10-06 Marek Safar <marek.safar@seznam.cz>
1989 * convert.cs (ExplicitConversionCore): Removed duplicate enum
1992 2005-10-05 Marek Safar <marek.safar@seznam.cz>
1994 * assign.cs (Assign.DoResolve): Error method changed.
1996 * cfold.cs (DoConstantNumericPromotions): Error method changed.
1998 * const.cs (ResolveValue): Reset in_transit immediately.
2000 * constant.cs: Error method changed.
2002 * convert.cs: Removed useless location parameter.
2003 (ExplicitNumericConversion): Don't do double enum check.
2004 (ExplicitConversionCore): Renamed from ExplicitConversion.
2005 (ExplicitUnsafe): Extracted from ExplicitConversion.
2006 (ExplicitConversion): Uses for error reporting.
2008 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2010 (ResolveBoolean): Uses common error method.
2011 (CastToDecimal): Get rid of ec.
2012 (CastFromDecimal): Optimized.
2013 (ConvCast): Get rid of ec.
2015 * enum.cs (ResolveValue): Reset in_transit immediately.
2016 (Emit): Return after first error.
2018 * expression.cs: Convert changes.
2020 * literal.cs: Error method changed.
2022 * statement.cs: Error method changed.
2024 2005-10-03 Raja R Harinath <rharinath@novell.com>
2026 * support.cs (SeekableStreamReader.Position): Don't error out when
2027 the requested position is just beyond the end of the current
2030 2005-09-28 Raja R Harinath <rharinath@novell.com>
2032 * support.cs (SeekableStreamReader): Simplify drastically. Don't
2033 try to keep in sync with the byte count of the underlying Stream.
2034 However, this limits us to a window size of 2048 characters: i.e.,
2035 the maximum lookahead of our lexer/parser can be 2048 characters.
2037 2005-09-28 Marek Safar <marek.safar@seznam.cz>
2040 * driver.cs: Fix compilation files with full root path.
2042 2005-09-25 Miguel de Icaza <miguel@novell.com>
2044 * report.cs (SymbolRelatedToPreviousError): Format the output so
2045 it does not use an open parenthesis that is never closed.
2047 * driver.cs: Follow coding guidelines
2049 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2052 * const.cs (Const.ResolveValue): Check for assigning non-null
2053 value to reference type.
2055 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2057 * anonymous.cs: Implemented ExprClassName.
2059 * assign.cs (Assign.DoResolve): Don't chrash when type is not
2062 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2065 * class.cs (StaticClass.DefineContainerMembers): Report protected
2068 * codegen.cs: if(ed) PRODUCTION.
2070 * convert.cs (Error_CannotImplicitConversion): Better error
2073 * cs-parser.jay: More error checks.
2075 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2077 * driver.cs (CSCParseOption): Enabled wrong option check.
2079 * ecore.cs (Expression.ExprClassName): Turned to property.
2080 (MemberExpr.CheckIntermediateModification): For checking boxed
2081 value types modification.
2083 * statement.cs (Fixed.Resolve): Expression type must be
2084 convertible to fixed type.
2085 (CollectionForeach.GetEnumeratorFilter,TryType):
2086 Small refactoring for easier error checking.
2088 2005-09-26 Marek Safar <marek.safar@seznam.cz>
2090 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2093 * class.cs (GeneratedBaseInitializer): New class for customization
2094 compiler generated initializers.
2095 (MemberBase.DoDefine): Check Obsolete attribute here.
2096 (FieldMember.DoDefine): Ditto.
2098 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2101 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2102 (MemberCore.GetObsoleteAttribute): Removed argument.
2103 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2104 (MemberCore.CheckObsoleteType): New helper.
2108 * statement.cs: Updates after MemberCore changes.
2110 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2111 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2113 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2114 obsolete attribute for compiler construct.
2115 (As.DoResolve): Cache result.
2117 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2119 2005-09-26 Raja R Harinath <rharinath@novell.com>
2122 * expression.cs (This.VerifyFixed): In a value type T, the type of
2123 'this' is T&, iow, 'this' is either an out or ref parameter. In a
2124 value type R, 'this' is treated as a value parameter.
2126 2005-09-22 Miguel de Icaza <miguel@novell.com>
2128 * statement.cs (Lock): Use the TemporaryVariable class instead of
2129 manually using local variables as those do not work when variables
2132 * ecore.cs: Moved the TemporaryVariable class from being a nested
2133 class inside Foreach to be a public class that can be employed in
2136 2005-09-19 Marek Safar <marek.safar@seznam.cz>
2138 * cs-parser.jay: interface_accessors replaced by
2139 accessor_declarations.
2141 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2144 * statement.cs (GotoCase.Resolve): Convert null constant to
2146 (SwitchLabel.ResolveAndReduce): Ditto.
2147 (SwitchLabel.NullStringCase): Custom null stamp.
2148 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2150 typemanager.cs (CSharpSignature): Don't skip first argument
2153 2005-09-18 Miguel de Icaza <miguel@novell.com>
2155 * driver.cs: Set InEmacs based on the environment variable EMACS.
2157 * location.cs (InEmacs): in this mode, do not report column
2158 location as it confuses Emacs.
2160 2005-09-16 Marek Safar <marek.safar@seznam.cz>
2162 * cfold.cs, constant.cs, convert.cs, ecore.cs,
2163 expression.cs, iterators.cs, literal.cs: Store constants and
2166 * class.cs (MemberBase.ShortName): Pass location.
2168 * cs-parser.jay: Some location fixes.
2170 * ecore.cs (Expression.Location): Made virtual.
2172 2005-09-05 Miguel de Icaza <miguel@novell.com>
2174 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2175 if the underlying types are the same, otherwise we need to produce
2176 code that will do the proper cast.
2178 This was exposed by Marek's constant rewrite which produced
2179 invalid code for the call site:
2182 void Method (X v) {}
2186 This fixes test-49.cs
2188 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2190 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2191 Type/Object should be allowed as well. Fixed bug #75968.
2193 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2195 * expression.cs : (Binary.DoResolve): when one is enum constant and
2196 another is constant 0, then return enum one *as enum type*.
2199 2005-09-02 Raja R Harinath <rharinath@novell.com>
2201 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2205 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2206 flow-branching for LocalVariableReferences in case we were invoked
2207 from a MemberAccess.
2208 * expression.cs (LocalVariableReference.VerifyAssigned): New.
2210 (LocalVariableReference.DoResolveBase): ... this.
2211 (MemberAccess.Resolve): Do the check that was disabled during
2214 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
2217 (PartialContainer.Create): check abstract/sealed/static strictly
2218 but abstract/sealed can exist only at one side. Fixed bug #75883.
2220 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
2223 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2224 specified, don't default to UnmanagedType.I4.
2226 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
2228 * expression.cs : conditional operator should check possibly
2229 incorrect assign expression. Fixed bug #75946.
2231 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
2233 * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
2234 Reverting the change. gmcs is much complex than mcs on this matter.
2236 2005-08-31 Atsushi Enomoto <atsushi@ximian.com>
2238 * cs-tokenizer.cs : To read another token ahead of the actual
2239 consumption, use new SavedToken and cache token instead of moving
2240 back the stream with SeekableStreamReader (it seemed problematic).
2242 driver.cs : Thus use StreamReader directly.
2243 * support.cs : Thus removed SeekableStreamReader.
2245 2005-08-30 Raja R Harinath <rharinath@novell.com>
2248 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2249 (ScopeInfo.EmitScopeType): Use it to construct field names from
2250 names of captured locals.
2253 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2254 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2255 Pass 'target_type' to BoxedCast. Don't default to 'object'.
2256 (ExplicitConversion): Remove enum cases already handled by
2257 implicit conversion. Move implicit conversion check to the beginning.
2258 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2259 * expression.cs (ArrayCreation.EmitDynamicInitializers):
2260 Don't treat System.Enum as a struct.
2262 2005-08-30 Jb Evain <jbevain@gmail.com>
2264 * attribute.cs: handles as expression in parameters.
2266 2005-08-30 Raja R Harinath <rharinath@novell.com>
2269 * class.cs (TypeContainer.VerifyClsName): Don't use a
2270 PartialContainer when verifying CLS compliance.
2271 (AbstractPropertyEventMethod): Set Parent here, ...
2272 (PropertyMethod): ... not here.
2274 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
2276 * attribute.cs : escaped attribute name should not be allowed to be
2277 resolved (e.g. @class as classAttribute). Fixed bug #75930.
2279 2005-08-29 Raja R Harinath <rharinath@novell.com>
2282 * convert.cs (ImplicitStandardConversionExists): Allow zero also
2283 when converting a long constant to unsigned long.
2284 * expression.cs (Invocation.OverloadResolve): Add sanity check to
2285 detect where IsApplicable and VerifyArgumentsCompat disagree.
2287 2005-08-29 Raja R Harinath <rharinath@novell.com>
2288 and Carlos Alberto Cortez <carlos@unixmexico.org>
2291 * class.cs (TypeContainer.CanElideInitializer): New helper.
2292 (TypeContainer.EmitFieldInitializers): Use it to determine if we
2293 can safely emitting the initializer of a field.
2295 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2297 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2298 allowed inside a switch (without loop). Fixed bug #75433.
2300 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
2302 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2303 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2305 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2307 * driver.cs : kinda reverting the default encoding changes (not exact
2308 revert since I noticed that "codepage:reset" might not work fine).
2310 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2312 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2313 Location. Now getter and setter store location correctly.
2314 (errors/cs0111-12.cs now reports the expected location.)
2316 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2318 * driver.cs : Use default encoding on the environment.
2319 Removed (now that) extra parameter for SeekableStreamReader.
2320 * support.cs : (SeekableStreamReader) third .ctor() argument for
2321 StreamReader is not required (always true). preamble size could
2322 be acquired in simpler and safe way.
2324 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
2326 * cs-parser.jay: report CS0642 at warning level 3
2327 and report CS0642 for an if else statement also
2328 fixes bug #74745. Patch by John Luke (and a bit
2330 Removed extra CS0642 warning check for "while",
2332 * statement.cs: In Block.Resolve(), CS0642 check
2333 is reimplemented to check a sequence of an empty
2334 statement and a block.
2336 Both fix bug #66777.
2338 2005-08-24 Marek Safar <marek.safar@seznam.cz>
2340 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2341 detection until I fix it.
2343 * cs-tokenizer.cs: Changed error message.
2345 * cs-parser.jay: Fixed 2 error locations.
2347 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2348 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2351 * enum.cs (GetSignatureForError): Fixed.
2353 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2357 * typemanager.cs (RegisterProperty): Removed.
2359 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2361 2005-08-24 Raja R Harinath <rharinath@novell.com>
2364 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2365 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2367 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2369 * expression.cs : tiny fix is required for not warning positive ulong.
2372 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2374 * expression.cs : add CS0652 check for constant and integral
2375 expression. Fixed bug #53974.
2377 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2379 * expression.cs : in DoNumericPromotions(), check if there is implicit
2380 conversion overload for string (to check CS0034). Fixed bug #52492.
2382 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2384 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2386 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2388 * ecore.cs : report location when it is *not* Null.
2390 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2396 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2397 correctly. Fixed bug #75721.
2399 2005-08-23 Raja R Harinath <rharinath@novell.com>
2401 * support.cs (SeekableStreamReader.Position): Avoid an expensive
2402 loop that performs 'min (pos, char_count)'.
2405 * expression.cs (Unary.ResolveOperator): Don't discard implicit
2406 converted value in Operator.OnesComplement.
2408 2005-08-22 Ben Maurer <bmaurer@ximian.com>
2410 * anonymous.cs: If the anon method is pulled into a helper class,
2411 it needs to be `internal' not `private'. Fixes runtime behavior on
2414 2005-08-20 Martin Baulig <martin@ximian.com>
2416 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2417 scope if we don't already have it.
2419 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2420 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2423 2005-08-17 Marek Safar <marek.safar@seznam.cz>
2426 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2429 2005-08-16 Marek Safar <marek.safar@seznam.cz>
2431 The big constants rewrite
2432 Fix #75746, #75685 and more
2433 As a side effect saved 1MB for MWF ;-)
2435 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2436 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2437 enum based for corlib compilation.
2439 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2442 * class.cs (FixedField.Define): Use ResolveAsConstant.
2444 * const.cs (IConstant): Interface constants and enums.
2445 (Const.ResolveValue): New method for constant resolvning.
2446 (ExternalConstant): Constants from imported assemblies.
2448 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2449 conversion; like enums.
2450 (Constant.ToType): Converts this constant to different type.
2451 (Constant.Increment): Adds 1.
2453 * convert.cs (ImplicitConversionRequired): Simplified.
2455 * cs-parser.jay: Create EnumMember directly.
2457 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
2459 * doc.cs (GenerateEnumDocComment): Removed.
2461 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
2462 (ConvertIntLiteral): Removed.
2463 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
2465 * enum.cs (EnumMember): Implement IConstant.
2466 (Enum.IsValidEnumConstant): Removed.
2467 (Enum.GetNextDefaultValue): Removed.
2468 (Enum.FindMembers): Updated.
2469 (Enum.GenerateDocComment): Iterate enum members.
2471 * expression.cs (Cast.TryReduce): Handle enums correctly.
2472 (New.Constantify): Made public.
2473 (MemberAccess.DoResolve): Removed contant specific if(s).
2475 * literal.cs (NullLiteral): Implement new abstract methods.
2477 * statement.cs (GotoCase.Resolve): Use new constant methods.
2478 (SwitchLabel.ResolveAndReduce): Use new constant methods.
2480 * typemanager.cs (LookupEnum): Removed.
2481 (IsEnumType): Fixed to work with corlib.
2482 (RegisterConstant): Removed.
2483 (LookupConstant): Removed.
2484 (GetConstant): Changed to work with IConstant.
2486 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
2488 * location.cs : Fixed overflown (>255) column number.
2490 2005-08-03 Raja R Harinath <rharinath@novell.com>
2492 First cut of the qualified-alias-member feature.
2493 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
2495 * cs-parser.jay (DOUBLE_COLON): New token.
2496 (namespace_or_type_name): Add rule for recognizing
2497 qualified-alias-members.
2498 (primary_expression): Likewise.
2499 (element_access): Allow QualifiedAliasMember as a possible
2500 type-bearing expression.
2501 (local_variable_type, local_variable_pointer_type): Likewise.
2502 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
2503 aliases in the current and enclosing namespace declarations.
2504 (NamespaceEntry.UsingAlias): Add CS0440 warning.
2505 * decl.cs (MemberName.is_double_colon): New.
2506 (MemberName.MemberName): Add new constructor for alias-member.
2507 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2508 * expression.cs (QualifiedAliasMember): New expression type.
2510 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2512 * location.cs : it borked when no argument was specified.
2514 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2516 * location.cs : tiny ToString() format fix.
2518 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2520 * statement.cs : oops, it was missing.
2522 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2524 A set of fixes for precise line/column location.
2527 "token" field now holds a file/line "delta", a line number offset
2528 from the segment, and a column number. See also:
2529 http://lists.ximian.com/pipermail/mono-devel-list/2004-
2530 December/009508.html
2531 Removed static IsNull. Use instance IsNull property instead.
2533 For some tokens it stores Location. For Identifier it stores
2534 LocatedToken which is a pair of string name and location.
2535 Column numbers are adjusted only at getChar().
2537 Use Location.ToString() for reporting (it now contains column).
2539 Largely modified to use LocatedToken instead of
2540 string (IDENTIFIER), and to acquire Location from some tokens.
2541 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2542 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2544 Now MemberName holds Location. DeclSpace.ctor() receives Location
2545 as a parameter. Removed extra parameters to all derived classes.
2546 Replaced Location.IsNull() with instance property.
2547 * assign.cs, expression.cs :
2548 Added .ctor() overload that omits Location.
2550 Added "nameEscaped" flag that indicates the identifier was escaped
2551 in the source file. This fixes bug #57047.
2553 2005-08-02 Marek Safar <marek.safar@seznam.cz>
2555 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2556 New method, looking for lo-case imported cls type.
2558 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2561 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2563 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2565 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2567 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2569 Optimized to save 3.5 MB for SWF compilation.
2571 2005-08-01 Marek Safar <marek.safar@seznam.cz>
2573 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2574 (PartialContainer.Create): Moved logic AddToContainer.
2575 (PartialContainer.MarkForDuplicationCheck): Shares name.
2577 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2580 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
2582 (Namespace.GetSignatureForError): New method.
2584 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
2585 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
2587 2005-08-01 Raja R Harinath <rharinath@novell.com>
2590 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
2591 member lookup rather than qualifier_type, since qualifier_type can
2594 2005-08-01 Marek Safar <marek.safar@seznam.cz>
2596 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
2599 2005-07-31 Miguel de Icaza <miguel@novell.com>
2601 * statement.cs: Copy the local exception into the exception
2602 captured local. Fixes 75674
2604 2005-07-31 Raja R Harinath <harinath@gmail.com>
2607 * expression.cs (Invocation.OverloadResolve): Don't report error
2608 CS1501 if error CS1502 has been reported.
2609 (New.DoResolve): Delegate CS1501 reporting to
2610 Invocation.OverloadResolve.
2613 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
2614 invariant-meaning-in-block property in an enclosing block if
2617 2005-07-29 Marek Safar <marek.safar@seznam.cz>
2619 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
2620 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
2621 (Switch.CheckSwitch): Just save 50kb for SWF.
2623 2005-07-27 Martin Baulig <martin@ximian.com>
2625 * anonymous.cs (CaptureContext.AddField): Added
2626 `AnonymousContainer am' argument; compute its toplevel scope if
2627 it's not already computed. Fixes #75649.
2629 2005-07-26 Raja R Harinath <rharinath@novell.com>
2632 * class.cs (Constructor.Emit): Reset block to null if the block
2635 2005-07-25 Marek Safar <marek.safar@seznam.cz>
2637 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
2639 2005-07-25 Marek Safar <marek.safar@seznam.cz>
2641 * class.cs (MethodData.Define): Check whether accessor implementing
2642 interface is public.
2644 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
2646 2005-07-22 Marek Safar <marek.safar@seznam.cz>
2649 * namespace.cs (LookupType): Moved same type check to...
2651 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
2654 2005-07-21 Raja R Harinath <rharinath@novell.com>
2656 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
2657 already found a typebuilder.
2658 * class.cs (MethodCore.IsDuplicateImplementation): Compare
2659 MemberNames, not strings.
2661 * const.cs (Error_ExpressionMustBeConst):
2662 Rename from Error_EpressionMustBeConst.
2663 * const.cs, class.cs, statement.cd: Update.
2665 2005-07-21 Marek Safar <marek.safar@seznam.cz>
2669 * const.cs (Const.LookupConstantValue): Report missing contant expression
2671 (Error_EpressionMustBeConstant): Only one error method.
2673 * class.cs, statement.c: Updated.
2675 2005-07-20 Raja R Harinath <rharinath@novell.com>
2677 * statement.cs (Block.Flags): Add back HasVarargs.
2678 (Block.flags): Make protected.
2679 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
2681 * typemanager.cs (types, typecontainers, user_types): Remove.
2682 (UserTypes, TypeContainers): Likewise.
2683 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
2684 (CleanUp, Reset): Update.
2685 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
2686 (GetNestedType): Use Type.GetNestedType.
2687 (CoreLookupType): Take two arguments, the namespace and the
2688 basename of the type. Update to use the Namespace.Lookup
2690 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
2691 (RealMemberLookup): Use IsNestedChildOf instead of playing with
2692 string concatenation and substring matches.
2693 * class.cs, enum.cs, delegate.cs: Update to changes.
2695 2005-07-20 Marek Safar <marek.safar@seznam.cz>
2697 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
2698 Expression and made virtual.
2700 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
2701 (ImplicitStandardConversionExists): Fixed `byte' typo ?
2703 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
2705 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
2708 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
2711 2005-07-18 Marek Safar <marek.safar@seznam.cz>
2714 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
2715 AssemblyCultureAttribute is not used on executable.
2718 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
2720 2005-07-16 Raja R Harinath <rharinath@novell.com>
2723 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
2724 New. Reports CS0252/CS0253.
2725 Mostly taken from preliminary patch by Duncak Mak.
2726 (Binary.DoResolveOperator): Store results of operator lookup.
2727 Use them to detect if we need to warn about unintended reference
2730 2005-07-15 Raja R Harinath <rharinath@novell.com>
2733 * namespace.cs (Namespace.Lookup): Add back location parameter.
2734 (Namespace.LookupType): Add CS0436 report. Add location parameter.
2735 * delegate.cs, ecore.cs, expression.cs: Update to changes.
2737 * codegen.cs (EmitContext.DeclSpace): Make readonly.
2738 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
2739 (Namespace.LookupType): ... this.
2740 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
2742 * typemanager.cs (LookupTypeReflection): Remove buggy code that
2743 purported to handle pointers.
2744 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
2747 2005-07-15 Marek Safar <marek.safar@seznam.cz>
2749 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2752 2005-07-15 Raja R Harinath <rharinath@novell.com>
2754 * namespace.cs (Namespace.Lookup): Drop location parameter.
2755 (NamespaceEntry.LookupAlias): Remove. Merge into ...
2756 (NamespaceEntry.Lookup): ... this.
2757 (NamespaceEntry.Error_AmbiguousTypeReference):
2758 Move here from DeclSpace.
2759 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
2761 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
2762 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
2763 Move to NamespaceEntry.
2764 * delegate.cs, expression.cs: Update to changes.
2766 2005-07-14 Marek Safar <marek.safar@seznam.cz>
2768 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
2769 CheckAttributeType and refactored.
2770 (Attribute.ResolvePossibleAttributeType): Changed to reuse
2771 ResolveAsTypeTerminal error handling.
2772 (ResolveAsTypeTerminal): Introduced because of global attributes extra
2774 (GetSignatureForError): Print errors in same way.
2777 * codegen.cs: Reflect attribute GetSignatureForError change.
2780 * expression.cs: Add silent parameter to ResolveAsTypeStep.
2782 * namespace.cs (UsingEntry): Refactored to make fields private.
2785 statement.cs: Error_UnexpectedKind has extra parameter.
2787 2005-07-14 Raja R Harinath <rharinath@novell.com>
2789 * ecore.cs (IAlias): Remove.
2790 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
2791 that implement the interface.
2792 * namespace.cs (Namespace): Likewise.
2793 (Namespace.declspaces): Renamed from 'defined_names'.
2794 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
2795 DeclSpace instead of an IAlias.
2796 * tree.cs (Tree.AddDecl): Update.
2798 2005-07-12 Raja R Harinath <rharinath@novell.com>
2800 * statement.cs (Block.Flags); Remove HasVarargs.
2801 (Block.HasVarargs): Move to ToplevelBlock.
2802 (Block.ThisVariable, Block.AddThisVariable): Likewise.
2803 (Block.Variables): Make protected. Initialize variable hashtable
2805 (Block.AddVariable): Update.
2806 (Block.Resolve): Update to changes.
2807 (ToplevelBlock.HasVarargs): New boolean.
2808 (ToplevelBlock.ThisVariable): Move here from Block.
2809 (ToplevelBlock.AddThisVariable): Likewise.
2810 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
2811 * expression.cs (This.ResolveBase): Update to changes.
2812 (ArglistAccess.DoResolve): Likewise.
2814 2005-07-11 Marek Safar <marek.safar@seznam.cz>
2817 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
2819 * class.cs (TypeContainer.VerifyMembers): Distinguish between
2820 not used and not used & assigned.
2821 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
2823 2005-07-11 Marek Safar <marek.safar@seznam.cz>
2826 * expression.cs (Is.DoResolve): null is never provided type.
2828 2005-07-08 Marek Safar <marek.safar@seznam.cz>
2831 * cs-parser.jay: Less strict event error rule to catch more errors.
2833 2005-07-08 Martin Baulig <martin@ximian.com>
2835 Fix test-iter-10.cs - distinguish whether we `yield' in a property
2836 gettter (allowed) or setter (not allowed).
2838 * class.cs (Accessor): Implement IIteratorContainer.
2839 (Accessor.Yields): New public field.
2840 (PropertyBase.PropertyMethod.Define): Handle iterators on a
2844 (get_accessor_declaration, set_accessor_declaration): Set the
2845 `yields' flag on the accessor, not the property.
2846 (property_declaration): Do the iterators check on a per-accessor
2847 basis and not for the whole property.
2849 2005-07-08 Martin Baulig <martin@ximian.com>
2851 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
2852 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
2854 2005-07-07 Marek Safar <marek.safar@seznam.cz>
2857 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
2858 (ExtractSecurityPermissionSet): Cope with self referencing security
2859 attributes properly.
2861 * driver.cs (SetOutputFile): Made public property OutputFile.
2863 2005-07-07 Raja R Harinath <rharinath@novell.com>
2866 * class.cs (TypeContainer.first_nonstatic_field): Rename from
2867 has_nonstatic_fields. Make into a FieldBase pointer.
2868 (TypeContainer.AddField): Add CS0282 check.
2869 (TypeContainer.EmitType): Update.
2871 2005-07-06 Miguel de Icaza <miguel@novell.com>
2873 * cs-tokenizer.cs (consume_identifier): Do not create strings to
2874 compare if they start with __.
2876 2005-07-06 Raja R Harinath <rharinath@novell.com>
2878 * statement.cs (Switch.SwitchGoverningType): Only look at
2879 UserCasts that don't need implicit standard conversions to one of
2880 the allowed switch types (Fixes test-322.cs).
2881 (LocalInfo.Resolve): Re-enable sanity-test.
2883 2005-07-06 Marek Safar <marek.safar@seznam.cz>
2885 * cs-tokenizer.cs (consume_identifier): Detect double undescores
2887 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
2889 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
2891 2005-07-06 Raja R Harinath <rharinath@novell.com>
2894 * ecore.cs (SimpleName.GetSignatureForError): Add.
2895 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
2896 (MemberAccess.GetSignatureForError): Add.
2898 2005-07-05 Marek Safar <marek.safar@seznam.cz>
2900 The big error and warning messages review.
2930 * typemanager.cs: Updated.
2932 * class.cs: (MethodCore.SetYields): Moved here to share.
2933 (PropertyMethod.Define): Moved iterator setup here.
2935 * iterators.cs: Add orig_method to have full access to parent
2938 2005-07-05 Raja R Harinath <rharinath@novell.com>
2940 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
2941 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
2942 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
2943 variable of struct type.
2944 * expression.cs (Unary.ResolveOperator): Update to change.
2945 (Indirection.VerifyFixed): Likewise.
2946 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
2947 (ParameterReference.VerifyFixed): Value parameters are fixed.
2948 (This.VerifyFixed): Treat 'this' as a value parameter.
2949 * statement.cs (LocalInfo.IsFixed): Remove.
2951 2005-07-01 Martin Baulig <martin@ximian.com>
2953 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
2954 `ec.EmitThis ()' to get the correct scope.
2956 2005-07-01 Martin Baulig <martin@ximian.com>
2958 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
2959 instance is a ParameterReference; fixes #75299.
2961 2005-07-01 Martin Baulig <martin@ximian.com>
2963 Reverted Marek's latest patch (r46725):
2964 - it contains structural changes which are neither mentioned in
2965 the ChangeLog nor explained anywhere; for example the additional
2966 argument of EmitContext's and Iterator's .ctor's and the
2967 TypeContainer.DefineMembers() change.
2968 - structural changes like this should go in in seperate patches
2969 and not be hidden in a huge patch which just seems to affect
2970 warnings and errors.
2971 a big and hard to understand patch.
2972 - it breaks iterators and causes regressions, for instance in
2975 2005-06-30 Raja R Harinath <rharinath@novell.com>
2978 * expression.cs (Indexers.map): Remove.
2979 (Indexers.Append): Filter out inaccessible setters and getters.
2980 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
2983 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
2985 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
2986 (FieldExpr.Emit, PropertyExpr.Emit): Update.
2987 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
2988 * expression.cs (Invocation.EmitCall): Add CS0120 check.
2990 2005-06-30 Marek Safar <marek.safar@seznam.cz>
2993 * class.cs (FieldBase.GetInitializerExpression): One more field
2996 2005-06-28 Miguel de Icaza <miguel@novell.com>
2998 * pending.cs: Do not define a proxy if the base method is virtual,
2999 it will be picked up by the runtime (bug 75270).
3001 2005-06-08 Martin Baulig <martin@ximian.com>
3003 The big Iterators rewrite :-)
3005 * iterators.cs: Rewrite this to use the anonymous methods framework.
3007 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3008 before the TypeContainers; see 2test-21.cs.
3011 (TypeContainer.DefineType): Don't create a new EmitContext if we
3012 already have one (this only happens if we're an Iterator).
3013 (TypeContainer.Define): Also call Define() on all our iterators.
3014 (Method.CreateEmitContext): Added support for iterators.
3017 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3018 (AnonymousContainer.CreateMethodHost): Moved here from
3019 AnonymousMethod and made abstract.
3020 (AnonymousContainer.CreateScopeType): New abstract method.
3021 (AnonymousContainer.IsIterator): New public property.
3022 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3023 get the ScopeTypeBuilder rather than manually defining it here.
3024 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3027 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3028 before RootContext.DefineTypes().
3030 * codegen.cs (EmitContext.RemapToProxy): Removed.
3031 (EmitContext.CurrentAnonymousMethod): Changed type from
3032 AnonymousMethod -> AnonymousContainer.
3033 (EmitContext.ResolveTopBlock): Protect from being called twice.
3034 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3035 (EmitContext.EmitThis): Removed the iterators hacks; use the
3036 anonymous methods framework for that.
3039 (ToplevelBlock.Container): Make this a property, not a field.
3040 (ToplevelBlock.ReParent): New public method; move the
3041 ToplevelBlock into a new container.
3042 (Foreach.TemporaryVariable): Simplify.
3044 2005-06-05 Martin Baulig <martin@ximian.com>
3046 * statement.cs (LocalInfo.CompilerGenerated): New flag.
3047 (Block.AddTemporaryVariable): New public method; creates a new
3048 `LocalInfo' for a temporary variable.
3049 (Block.EmitMeta): Create the LocalBuilders for all the temporary
3051 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3052 non-iterator variables.
3054 2005-06-05 Martin Baulig <martin@ximian.com>
3056 * statement.cs (Foreach.TemporaryVariable): Create the
3057 LocalBuilder in the Emit phase and not in Resolve since in some
3058 situations, we don't have an ILGenerator during Resolve; see
3059 2test-19.cs for an example.
3061 2005-06-04 Martin Baulig <martin@ximian.com>
3063 **** Merged r45395 from GCS ****
3065 The big Foreach rewrite - Part II.
3067 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3068 with `PropertyInfo ienumerator_getcurrent'.
3070 * codegen.cs (VariableStorage): Removed.
3073 (Foreach): Derive from Statement, not ExceptionStatement.
3074 (Foreach.CollectionForeach): New nested class. Moved all the code
3075 dealing with collection foreach here.
3076 (Foreach.ForeachHelperMethods): Removed.
3077 (Foreach.TemporaryVariable): Implement IMemoryLocation.
3079 2005-05-23 Martin Baulig <martin@ximian.com>
3081 * statement.cs (Try.DoResolve): Don't create a `finally' if we
3082 don't need to. Fix #75014.
3084 2005-05-20 Martin Baulig <martin@ximian.com>
3086 Merged r44808 from GMCS.
3088 * class.cs (TypeContainer.CircularDepException): Removed.
3089 (TypeContainer.DefineType): Removed the `InTransit' stuff.
3090 (TypeContainer.CheckRecursiveDefinition): Check for circular class
3091 (CS0146) and interface (CS0529) dependencies here.
3093 2005-06-21 Raja R Harinath <rharinath@novell.com>
3095 * expression.cs (Invocation.EmitCall): Fix initialization
3096 'this_call' to reflect current behaviour. Fix indentation.
3098 * convert.cs (FindMostEncompassedType): Add two trivial special
3099 cases (number_of_types == 0 || number_of_types == 1).
3100 (FindMostEncompasingType): Likewise.
3102 2005-06-17 Raja R Harinath <rharinath@novell.com>
3104 Some cleanups preparing for the fix of #75283.
3105 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3107 (EventExpr.InstanceResolve): Likewise.
3108 (EventExpr.DoResolve): Remove redundant checks.
3110 2005-06-10 Duncan Mak <duncan@novell.com>
3112 * cs-tokenizer.cs (process_directives): New flag for controlling
3113 the processing of preprocessor directives.
3114 (x_token): After seeing a '#', return Token.NONE instead of going
3115 to handle_preprocessing_directive() when not processing
3116 directives. This avoids unnecessary processing during the token peek in
3121 * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
3122 the existing error reporting methods instead of Report.Error.
3124 * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
3125 after Raja's rewrite.
3127 2005-06-08 Miguel de Icaza <miguel@novell.com>
3129 * class.cs: Small fix.
3131 2005-06-08 Raja R Harinath <rharinath@novell.com>
3134 * class.cs (GetPartialBases): Fix return value check of
3137 2005-06-07 Raja R Harinath <rharinath@novell.com>
3139 Ensure that partial classes are registered in their enclosing
3140 namespace. Initial part of fix of #75160.
3141 * tree.cs (Tree.RecordDecl): Add new namespace argument.
3142 Register declspace with namespace here, not in
3143 DeclSpace.RecordDecl.
3144 * cs-parser.jay: Pass namespace to RecordDecl.
3145 * class.cs (PartialContainer.Create): Likewise.
3146 (ClassPart.DefineType): New sanity-check. Throws an exception if
3148 * decl.cs (Declspace.RecordDecl): Remove.
3149 * namespace.cs (NamespaceEntry.DefineName): Remove.
3151 2005-06-06 Marek Safar <marek.safar@seznam.cz>
3153 * rootcontext.cs: Reset TargetExt as well.
3155 2005-06-03 Raja R Harinath <rharinath@novell.com>
3157 * ecore.cs (Expression.Resolve): Emit CS0654 error when
3160 2005-06-02 Raja R Harinath <rharinath@novell.com>
3162 Fix #75080, cs0119.cs.
3163 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
3165 (Expression.Resolve): ... this. Use it. Remove bogus code
3166 allowing ExprClass.Type and ExprClass.Namespace for
3167 ResolveFlags.VariableOrValue.
3168 (Expression.Resolve) [1-argument variant]: Change default resolve
3169 flags based on language version.
3170 (Expression.Error_UnexpectedKind): Use a simple string array
3171 rather than an ArrayList.
3172 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3174 (TypeOfVoid.DoResolve): Likewise.
3175 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
3176 flags argument -- it always has the same value.
3178 2005-05-31 Raja R Harinath <rharinath@novell.com>
3181 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3182 Use it in the error message.
3183 * assign.cs, expression.cs, statement.cs: Update.
3185 2005-05-30 Raja R Harinath <rharinath@novell.com>
3188 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3189 the "almostMatchedMember" case too.
3190 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3191 that failed the accessibility checks to 'almost_match'.
3193 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
3195 * attribute.cs: Use internal MethodBuilder methods to set
3196 ExactSpelling and SetLastError on PInvoke methods, instead
3197 of passing them via charset. Fixes #75060.
3199 2005-05-27 Raja R Harinath <rharinath@novell.com>
3201 * parameter.cs (Parameter): Remove TODO comment.
3202 (Parameter.DefineParameter): Remove Location parameter.
3203 (Parameters.LabelParameters): Likewise.
3204 * class.cs (Constructor.Emit): Update to change.
3205 (MethodData.Emit): Likewise.
3206 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
3207 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3209 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
3212 Removed Parameters.Location and added Parameter.Location instead.
3213 Removed Location parameter from Emit() and GetSignature().
3220 Modified all related calls.
3222 2005-05-26 Raja R Harinath <rharinath@novell.com>
3224 Improve user-defined conversion handling.
3225 * convert.cs (GetConversionOperators): Rewrite. Return only the
3226 applicable operators.
3227 (AddConversionOperators): New. Helper for GetConversionOperators.
3228 (FindMostEncompassedType, FindMostEncompassingType): Verify that
3229 there is only one most encompassed/encompassing type.
3230 (FindMostSpecificSource, FindMostSpecificTarget): Remove
3231 "applicable operator" handling.
3232 (UserConversion): Move cache here from GetConversionOperators.
3233 Directly cache the chosen operator, rather than the whole
3235 (ExplicitNumericConversion): Fix buggy implementation of Decimal
3236 case. Allow conversion of decimal to sbyte and byte too.
3237 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3238 New static methods. Used to avoid allocating EmptyExpressions in
3241 2005-05-24 Duncan Mak <duncan@novell.com>
3243 * ecore.cs (CastFromDecimal): New class for casting a decimal to
3244 another class, used in Convert.ExplicitNumericConversion.
3245 (CastToDecimal): New class, similar to above, but casts to
3246 System.Decimal, used in Convert.ImplicitNumericConversion and also
3247 in explicit convesion from double/float to decimal.
3249 * convert.cs (ImplicitNumericConversion): Handle implicit
3250 conversions to System.Decimal.
3251 (ExplicitNumericConversion): handle explicit conversions to
3256 2005-05-20 Miguel de Icaza <miguel@novell.com>
3258 * typemanager.cs (EnumToUnderlying): Do not throw if we do not
3259 know the type at this stage, just break through. Fixes #75008
3261 2005-05-19 Martin Baulig <martin@ximian.com>
3264 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3265 to disable error reporting.
3267 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3268 here since we don't want to report an error; see the new test-336.cs.
3270 2005-05-19 Raja R Harinath <rharinath@novell.com>
3272 * statement.cs (ToplevelBlock.GetParameterReference)
3273 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3274 Move here from class Block.
3275 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3276 * expression.cs (ParameterReference.DoResolveBase): Likewise.
3278 2005-05-18 Martin Baulig <martin@ximian.com>
3283 (FlowBranching.Reachability): Add non-static public And() and Or()
3285 (FlowBranchingSwitch): New class; do the `break_origins' thing
3286 like in FlowBranchingLoop.
3287 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3288 reachability, not just locals and parameters.
3289 (FlowBranching.MergeChild): Remove some of the hacks for loop and
3290 switch; MergeBreakOrigins() now takes care of that.
3292 2005-05-18 Martin Baulig <martin@ximian.com>
3294 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3295 a loop and may leave it, reset the barrier; fixes #74974.
3297 2005-05-17 Marek Safar <marek.safar@seznam.cz>
3299 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3302 * cs-parser.jay: Catch more lexical errors.
3304 * report.cs: Add one more Error method.
3307 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3309 2005-05-17 Martin Baulig <martin@ximian.com>
3311 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3314 2005-05-16 Raja R Harinath <rharinath@novell.com>
3316 Fix test-382.cs. Emit values of decimal constants.
3317 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3319 (TypeContainer.AddField): ... this.
3320 (TypeContainer.EmitFieldInitializers): Allow the list of fields
3321 with initializers to include 'Const's.
3322 (ClassPart.RegisterFieldForInitialization): Forward to
3324 * const.cs (Const.Const): Pass initializer to base class.
3325 (Const.Define): In case of decimal constants, register them for
3326 initialization in a static constructor.
3328 2005-05-14 Martin Baulig <martin@ximian.com>
3330 * statement.cs (Block.Resolve): Correctly handle unreachable code;
3331 do not call ResolveUnreachable() on unreachable statements in
3332 here, see the comment in the source code.
3334 2005-05-13 Raja R Harinath <rharinath@novell.com>
3337 * expression.cs (BinaryResolveOperator): If one of the operands of
3338 an equality comparison is 'null' and the other is a pointer type,
3339 convert the null to a NullPointer.
3340 * convert.cs (ImplicitReferenceConversion): If the expression is a
3341 NullLiteral and the target type is a pointer type, return a
3342 NullPointer instead.
3343 (ImplicitConversionStandard): Likewise.
3345 2005-05-13 Marek Safar <marek.safar@seznam.cz>
3347 * cs-parser.jay: Set readonly context based on special constructs.
3349 * expression.cs (LocalVariableReference.DoResolveBase): Improved
3350 readonly variable error handling.
3352 * rootcontext.cs (EmitCode): Don't verify members when error
3355 * statement.cs (LocalInfo): Add reaodnly context information.
3356 (SetReadOnlyContext, GetReadOnlyContext): New methods.
3358 2005-05-13 Raja R Harinath <rharinath@novell.com>
3360 * statement.cs (Block.Resolve): Revert change below. Modify fix
3361 for #74041 to initialize 'resolved' to false only for explicit
3362 blocks. Fixes #74873.
3364 2005-05-12 Raja R Harinath <harinath@gmail.com>
3367 * typemanager.cs (unmanaged_enclosing_types): New.
3368 (IsUnmanagedType): Avoid infloops by using
3369 'unmanaged_enclosing_types' to talk with recursive invocations.
3371 2005-05-13 Martin Baulig <martin@ximian.com>
3373 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3374 instance variable, not a local. Fix #74873.
3375 (Block.ResolveUnreachable): Set it to true here.
3377 2005-05-11 Duncan Mak <duncan@novell.com>
3379 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3380 continuing to process for 'arg'.
3381 (handle_preprocessing_directive): Check the argument of the #endif
3382 directive and report error CS1025 if there are any trailing
3385 According to the C# spec, having even whitespace after the #endif
3386 directive is illegal; however, because we call arg.TrimEnd ()
3387 beforehand, we have the same behavior as csc, allowing whitespace
3388 after the directive.
3392 2005-05-11 Marek Safar <marek.safar@seznam.cz>
3396 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3397 (Constructor.GetObsoleteAttribute): Implemented correctly.
3399 2005-05-10 Martin Baulig <martin@ximian.com>
3401 * support.cs (ReflectionParameters.ParameterModifier): Use
3402 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3403 and `ParameterAttributes.In'. Fixes #74884.
3405 2005-05-10 Marek Safar <marek.safar@seznam.cz>
3407 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3409 * expression.cs (Argument.GetParameterModifier): Turned to property.
3410 (Invocation.Error_InvalidArguments): Add more descriptive errors.
3412 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3415 2005-05-09 Raja R Harinath <rharinath@novell.com>
3418 * decl.cs (MemberCache.AddMethods): Register override methods,
3419 rather than non-override methods.
3420 * typemanager.cs (RegisterOverride): New.
3421 (IsOverride): Update.
3423 2005-05-09 Marek Safar <marek.safar@seznam.cz>
3427 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3428 recursive declaration.
3430 * statement.cs (Block.ResolveMeta): Report any error in resolving.
3432 2005-05-06 Marek Safar <marek.safar@seznam.cz>
3434 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3436 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3438 2005-05-05 Raja R Harinath <rharinath@novell.com>
3441 * decl.cs (DeclSpace.FamilyAccessible):
3442 Use TypeManager.IsNestedFamilyAccessible.
3444 Fix reopened #64812.
3445 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3448 2005-05-04 Raja R Harinath <rharinath@novell.com>
3449 Abin Thomas <projectmonokochi@rediffmail.com>
3450 Anoob V E <projectmonokochi@rediffmail.com>
3451 Harilal P R <projectmonokochi@rediffmail.com>
3454 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
3455 allow access to all static members.
3457 2005-05-04 Martin Baulig <martin@ximian.com>
3459 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
3461 2005-05-04 Martin Baulig <martin@ximian.com>
3465 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
3466 section at the end; make things work if `default' is not the last
3469 2005-05-04 Martin Baulig <martin@ximian.com>
3473 * statement.cs (Switch): Replaced the `got_default' field with a
3474 `default_section' one.
3475 (Switch.CheckSwitch): Set `default_section' here.
3476 (Switch.Resolve): If we're a constant switch and the constant is
3477 not found, use the default section.
3479 2005-05-03 Martin Baulig <martin@ximian.com>
3481 * expression.cs (ArrayAccess.EmitGetLength): New public method.
3483 * statement.cs (Foreach.ArrayForeach): New nested class.
3484 (Foreach.TemporaryVariable): New nested class.
3485 (Foreach.EmitArrayForeach): Removed; this is now in the new
3488 2005-05-03 Raja R Harinath <rharinath@novell.com>
3490 * pending.cs (BaseImplements): Move the #74773 fix here. This is
3492 (VerifyPendingMethods): Revert change below.
3494 * typemanager.cs (IsOverride, RegisterNonOverride): New.
3495 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
3496 that used to trigger warning -28. Remove warning -28.
3497 * expression.cs (Invocation.OverloadResolve): Use
3498 TypeManager.IsOverride to distinguish override methods.
3501 * pending.cs (VerifyPendingMethods): If a base type implements the
3502 requested interface, don't bother checking individual methods of
3503 the base type. As a side-effect, this prevents the creation of
3504 unnecessary proxies.
3506 2005-05-02 Martin Baulig <martin@ximian.com>
3510 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3511 Also `And' the locals if the old vector is null.
3512 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
3513 null; in this case we basically reset all the variables.
3515 2005-05-02 Martin Baulig <martin@ximian.com>
3519 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
3520 Added `FlowBranching branching' argument; always `and' the
3521 variables instead of `or'ing them unless we're an infinite loop.
3523 * statement.cs (While.Resolve): Create a new sibling unless we're
3526 2005-05-02 Martin Baulig <martin@ximian.com>
3530 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
3531 arguments; use it instead of creating a new TopLevelBlock.
3532 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
3533 our ConstructorInitializer.
3536 (TopLevelBlock.TopLevelBranching): New public property.
3537 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
3538 and create our `TopLevelBranching'.
3540 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
3541 anonymous method host, use `block.TopLevelBranching' rather than
3542 creating a new branching.
3544 2005-04-20 Miguel de Icaza <miguel@novell.com>
3546 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
3547 a ScopeInfo, if any of the current children is a child of the new
3548 entry, move those children there.
3550 2005-04-30 Martin Baulig <martin@ximian.com>
3552 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
3553 at the beginning of a SwitchSection. Fix #73335.
3555 2005-04-27 Marek Safar <marek.safar@seznam.cz>
3558 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
3560 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
3561 (FieldExpr.DoResolve): Obsolete members are ignored for field
3564 2005-04-26 Marek Safar <marek.safar@seznam.cz>
3566 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
3567 of arrays detection.
3569 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
3571 (Field.VerifyClsCompliance): Volatile fields are not compliant.
3573 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
3576 2005-04-25 Ben Maurer <bmaurer@ximian.com>
3578 * cs-parser.jay: Use the prefered version of -unsafe in error
3581 2005-04-22 Marek Safar <marek.safar@seznam.cz>
3583 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
3586 2005-04-20 John Luke <john.luke@gmail.com>
3588 * driver.cs: fix typo in error message, --outout to --output
3590 2005-04-20 Marek Safar <marek.safar@seznam.cz>
3592 * codegen.cs (InRefOutArgumentResolving): New field.
3594 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
3595 fields outside contructor.
3597 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
3599 2005-04-19 Miguel de Icaza <miguel@novell.com>
3601 * anonymous.cs (CaptureContext.EmitParameterInstance): The
3602 parameter code was not completed ever, so it was not as up-to-date
3603 as local variables. Must finish it.
3605 The bug fix was to compare the Toplevel of the block, not the
3606 current block. Thanks for Ben for pointing this out.
3608 2005-04-19 Raja R Harinath <rharinath@novell.com>
3610 * decl.cs (AddMethods): Use the declaring type of the problem
3611 method to determine if we want to squash a warning.
3613 2005-04-19 Marek Safar <marek.safar@seznam.cz>
3615 * attribute.cs: Removed debug output.
3617 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
3619 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
3622 2005-04-18 Raja R Harinath <rharinath@novell.com>
3625 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
3626 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
3627 all null comparisons against reference types.
3629 2005-04-18 Marek Safar <marek.safar@seznam.cz>
3632 * class.cs (TypeContainer.CircularDepException) New nested
3634 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
3635 (TypeContainer.DefineType): Removed error, reset InTransit before
3637 (Class.DefineType): Throw exception when is in Transit.
3638 Catch exception and report error.
3639 (Struct.DefineType): Throw exception when is in Transit.
3640 Catch exception and report error.
3641 (Interface.DefineType): Throw exception when is in Transit.
3642 Catch exception and report error.
3644 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
3645 handle nested exception handlers.
3647 * flowanalysis.cs (InTryWithCatch): New method, search for try with
3650 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
3651 InFinally and InCatch storage.
3653 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
3654 (Catch.Resolve): Set and Restore ec.InCatch.
3655 (Try.Resolve): Set and Restore ec.InFinally.
3656 (Try.HasCatch): True when try has catch.
3658 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
3660 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
3661 for the same event member, so exclude such cases from warning 419.
3664 2005-04-16 Miguel de Icaza <miguel@novell.com>
3666 * expression.cs (Binary.ResolveOperator): Apply patch from John
3667 Luke to fix bug 59864: operators &, | and ^ on enumerations
3668 require that the same enum type on both sides.
3670 * driver.cs: Add warnings to old flag usage, this is to assist
3671 people who produce Makefiles and hope that the Makefiles will be
3674 * class.cs (TypeContainer.EmitType): Moved the definition of the
3675 special $PRIVATE$ field from the resolve phase to the Emit phase.
3676 During resolve we do not know if we are a struct with
3677 HasExplicitLayout, we know this only after the attributes for the
3680 Set the FieldOffset to zero on the dummy field that we create for
3681 the class. Fixes 74590.
3683 2005-04-16 Raja R Harinath <rharinath@novell.com>
3686 * ecore.cs (PropertyExpr.resolved): New.
3687 (DoResolve): Use it to handle a case of double resolution here.
3688 Handle a case of identical-name-and-type-name.
3689 * expression.cs (ArrayCreation.CheckIndices): Avoid double
3690 resolution by storing the results of expression resolution back
3691 into the "probes" array.
3693 2005-04-15 Raja R Harinath <rharinath@novell.com>
3695 Fix cs0208-7.cs and cs0208-8.cs.
3696 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
3697 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
3698 error reporting to point out the reason a struct is not unmanaged.
3700 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
3702 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
3703 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
3705 2005-04-13 Raja R Harinath <rharinath@novell.com>
3708 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
3709 IdenticalNameAndTypeName here.
3710 (EventExpr.InstanceResolve): Likewise.
3712 2005-04-13 Marek Safar <marek.safar@seznam.cz>
3714 C# 2.0 DefaultCharSetAttribute implementation
3716 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
3717 which allows us to set GlobalNamespace for every resolve.
3718 (Attribute.ResolveArguments): Cut from Resolve.
3719 (Attribute.GetCharSetValue): Returns CharSet named argument.
3720 (Attribute.DefinePInvokeMethod): Gets default charset from
3722 (GlobalAttribute.ResolveAsTypeStep): Override.
3723 (GlobalAttribute.ResolveArguments): Override.
3725 * class.cs (TypeAttr): Is protected.
3727 * codegen.cs (ModuleClass.DefaultCharSet): New member.
3728 (ModuleClass.DefaultCharSetType): New memeber.
3729 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
3731 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
3732 charset from module.
3734 * delegate.cs (TypeAttr): Override.
3735 (Delegate.DefineType): Use this TypeAttr.
3737 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
3738 at very early stage (before types are defined) to resolve model
3739 module attributes. It will probably not work with corlib but it
3742 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
3743 charset from module.
3745 * typemanager.cs (default_charset_type): New type.
3747 2005-04-13 Raja R Harinath <rharinath@novell.com>
3749 * decl.cs (MemberCache.AddMethods): Don't warn if
3750 System.Object.Finalize has buggy MethodAttributes.
3752 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
3755 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
3757 * doc.cs : detect ambiguous reference to overloaded members.
3758 Fixed bug #71603. MS 1.1 csc does not detect it.
3760 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
3762 * doc.cs : delegates must not be referenced with parameters.
3765 2005-04-12 Miguel de Icaza <miguel@novell.com>
3767 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
3769 2005-04-10 Miguel de Icaza <miguel@novell.com>
3771 * driver.cs (MainDriver): Stop processing if the CLS stage found
3774 (CompilerCallableEntryPoint.InvokeCompiler): Always
3775 reset after execution; Take a TextWriter argument for the
3778 * report.cs: Use the error stream instead of hardcoding stderr.
3780 2005-04-09 Miguel de Icaza <miguel@novell.com>
3782 * class.cs: Reduce code paths to test, too small of an
3783 optimization to make it worth the extra testing. Always perform
3786 2005-04-08 Raja R Harinath <rharinath@novell.com>
3789 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
3790 operators that had errors reported on them.
3792 2005-04-08 Marek Safar <marek.safar@seznam.cz>
3794 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
3796 (Attribute.Resolve): Add named argument type checking.
3798 * class.cs (FixedField.Define): Use IsPrimitiveType
3800 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
3802 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
3803 unsafe parameter types.
3805 * statement.cs (Using.ResolveExpression): Add better error description.
3807 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
3809 2005-04-08 Raja R Harinath <rharinath@novell.com>
3812 * attribute.cs (Attribute.GetAttributeUsage): Resolve
3813 AttributeUsageAttribute in the emitcontext of the attribute class,
3814 not in the emitcontext of the attributable entity it was attached to.
3815 * cs-parser.jay: Use 'current_class', not 'current_container',
3816 when creating a GlobalAttribute.
3818 2005-04-08 Alp Toker <alp@atoker.com>
3820 * pending.cs: The fix to #58413 failed to compile methods implementing
3821 interfaces with/without params modifiers and vice versa, even though
3822 params modifiers aren't part of the signature. Make the modifier check
3823 less strict as in csc.
3825 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
3826 Anoob V E <projectmonokochi@rediffmail.com>
3827 Harilal P R <projectmonokochi@rediffmail.com>
3830 * pending.cs (TypeAndMethods.mods): New. Store the parameter
3831 modifiers of pending methods.
3832 (PendingImplementation.PendingImplementation): Initialize it.
3833 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
3834 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
3835 with ParameterData. Add check for modifiers.
3836 * class.cs (MethodData.Define): Update to changes.
3838 2005-04-07 Raja R Harinath <rharinath@novell.com>
3840 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
3842 2005-04-07 Marek Safar <marek.safar@seznam.cz>
3844 * class.cs (PropertyMethod.Define): Check private accessor in abstract
3847 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
3850 * typemanager.cs: Registered RequiredAttributeAttribute.
3852 2005-04-06 Marek Safar <marek.safar@seznam.cz>
3854 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
3855 Warning CS0169 is back at level 3.
3856 (IMethodData.SetMemberIsUsed): New method.
3858 * decl.cs (IsUsed): New value; moved from FieldBase.Status
3859 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
3861 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
3863 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
3865 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
3868 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
3871 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
3872 to avoid the problems with nested types.
3874 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
3875 Anoob V.E <projectmonokochi@rediffmail.com>
3876 Harilal P.R <projectmonokochi@rediffmail.com>
3877 Raja R Harinath <rharinath@novell.com>
3880 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
3882 * typemanager (GetConstructor): Make public.
3884 2005-04-05 John Luke <john.luke@gmail.com>
3885 Raja R Harinath <rharinath@novell.com>
3888 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
3889 struct too. Return false quicker in a few cases.
3890 (VerifyUnManaged): Use it.
3892 2005-04-05 Raja R Harinath <rharinath@novell.com>
3895 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
3896 not 'unreachable_seen'.
3898 2005-04-04 Marek Safar <marek.safar@seznam.cz>
3900 * attribute.cs (Attribute.GetValue): Removed unused.
3902 * codegen.cs (CodeGen.TrimExt): Removed unused.
3904 * cs-parser.jay (output): Removed unused.
3906 * cs-tokenizer.cs (hex_digits): Removed unused.
3908 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
3910 * expression.cs (Indirection.LoadExprValue): Removed unused.
3911 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
3913 * iterators.cs (Iterator.param_types): Removed unused.
3915 * statement.cs (Goto.block): Removed unused.
3916 (ToplevelBlock.did): Removed unused.
3917 (Switch.ResolveConstantSwitch): Removed unused.
3919 2005-04-01 Ben Maurer <bmaurer@ximian.com>
3921 * rootcontext.cs: Allow mcs to bootstrap with the compilation
3924 2005-04-01 Raja R Harinath <rharinath@novell.com>
3926 Fix #74232 and cs0208-3.cs.
3927 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
3928 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
3929 unmanaged type. Don't use FieldBuilders when 't' is a
3930 TypeBuilder. Use ModFlags and MemberType fields.
3931 * class.cs (MemberBase.member_type): Rename from MemberType.
3932 (MemberBase.MemberType): New property. Determines member_type on
3934 (MemberBase.DoDefine): Don't initialize MemberType here.
3935 (FieldMember.Define): Likewise.
3937 2005-04-01 Marek Safar <marek.safar@seznam.cz>
3940 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
3941 Attributes are emitted there.
3943 2005-04-01 Raja R Harinath <rharinath@novell.com>
3945 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
3946 keyword in 'partial enum' too.
3947 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
3949 Report from Kamil Skalski <nazgul@omega.pl>.
3952 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
3953 have partial containers too.
3955 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
3956 in block' checks to Block.CheckInvariantMeaningInBlock.
3957 * statement.cs (Block.GetKnownVariableInfo): Make private.
3958 (Block.IsVariableUsedInChildBlock): Remove.
3959 (Block.IsVariableUsedInBlock): Likewise.
3960 (Block.CheckInvariantMeaningInBlock): New. Show location of
3961 conflicting declaration.
3962 (Block.AddVariable): Make error messages less long-winded and more
3963 specific. Show location of conflicting declaration.
3964 * parameter.cs (Parameters.Location): New readonly property.
3966 2005-03-31 Raja R Harinath <rharinath@novell.com>
3968 Clean up semantics of invoking ResolveMemberAccess.
3969 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
3970 can have an instance, ensure that we pass in a non-TypeExpression
3971 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
3972 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
3973 argument. Update to changes and simplify.
3974 (FieldExpr.Emitinstance): Remove CS0120 check.
3975 (PropertyExpr.EmitInstance): Likewise.
3976 * expression.cs (Argument.Resolve): Likewise.
3977 (Invocation.DoResolve): Update to changes in semantics of
3980 2005-03-31 Marek Safar <marek.safar@seznam.cz>
3983 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
3986 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
3988 2005-03-31 Raja R Harinath <rharinath@novell.com>
3990 Fix difference in behaviour with commandline invocation.
3991 * driver.cs (Driver.Reset): New.
3992 (CompilerCallableEntryPoint): Call it.
3994 * statement.cs (If.Resolve): Avoid spurious "uninitialized
3995 variable" warnings if the boolean expression failed to resolve.
3997 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
3999 * attribute.cs: Fix the union of several permissions when some of them
4000 are unrestricted (so the result isn't an unrestricted permission set).
4003 2005-03-30 Raja R Harinath <rharinath@novell.com>
4005 * ecore.cs (MemberExpr): New class. Convert from interface
4007 (MemberExpr.ResolveMemberAccess): Refactor and move here from
4008 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
4010 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4011 (MethodGroupExpr.IsExplicitImpl): Remove.
4012 (Expression.GetFieldFromEvent): Remove.
4013 (SimpleName.MemberStaticCheck): Remove.
4014 (SimpleName.DoSimpleNameResolve): Update to changes.
4015 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4016 (MemberAccess.IdenticalNameAndTypeName): Remove.
4017 (MemberAccess.error176): Move to MemberExpr.
4018 (MemberAccess.DoResolve): Update to changes.
4019 (BaseAccess.DoResolve): Likewise.
4021 2005-03-30 Marek Safar <marek.safar@seznam.cz>
4023 C# 2.0 Conditional attribute class implementation
4025 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4026 Analyzes class whether it has attribute which has ConditionalAttribute
4027 and its condition is not defined.
4029 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4030 (Class.IsExcluded): New method. Search for at least one defined
4031 condition in ConditionalAttribute of attribute class.
4033 2005-03-30 Raja R Harinath <rharinath@novell.com>
4035 * ecore.cs (PropertyExpr): Derive from Expression, not
4036 ExpressionStatement.
4037 (PropertyExpr.EmitStatement): Remove.
4039 2005-03-29 Raja R Harinath <rharinath@novell.com>
4042 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4043 internal field "value__" of an enum be private. The examples for
4044 "value__" that I found on MSDN all used FieldAttributes.Private.
4046 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4047 Don't mention IL method attribute names.
4049 Fix #47991. Remove a TODO.
4050 * statement.cs (Block.Toplevel): Make into a field.
4051 (Block.Parameters): Move into ToplevelBlock.
4052 (Block.known_variables): Rename from child_variable_names.
4053 (Block.Block): Remove variants that take Parameters. Initialize
4054 'Toplevel' with the immediately surrounding toplevel block.
4055 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
4056 LocalInfo parameter.
4057 (Block.GetKnownVariableInfo): New.
4058 (Block.IsVariableNameUsedInChildBlock): Update.
4059 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
4060 the block, even though it may not be in scope.
4061 (Block.AddVariable): Remove Parameters parameter. Use
4062 Toplevel.Parameters instead.
4063 (Block.AddConstant): Remove Parameters parameter.
4064 (Block.GetParameterReference): Update to use Toplevel.Parameters.
4065 (Block.IsParamaterReference): Likewise.
4066 (Block.IsLocalParameter): Likewise. Simplify a lot.
4067 (ToplevelBlock.Parameters): New. Moved from Block.
4068 (ToplevelBlock.ToplevelBlock): Update to changes. Always
4069 initialize Parameters to a non-null value.
4070 * cs-parser.jay: Update to changes.
4071 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4072 simple names that mean different things in the same block. Use
4073 Block.IsVariableNameUsedInBlock.
4075 2005-03-28 Raja R Harinath <rharinath@novell.com>
4077 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
4078 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
4079 GetTypeHandle. It is possible for a reflected type to derive from
4080 a TypeBuilder (e.g., int[] derives from the TypeBuilder
4081 System.Array during mscorlib compilation).
4082 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
4083 contain a method_hash, don't create one either. Don't create a
4084 deep copy of the base cache's method_hash.
4085 (MemberCache.SetupCache): Rename back from DeepCopy.
4086 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
4087 already initialized. If we see an override function, add its
4088 underlying base virtual function to the member_hash too.
4090 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4092 2005-03-26 Raja R Harinath <harinath@acm.org>
4095 * assign.cs (Assign.DoResolve): When the RHS of an assignment
4096 fails to resolve, ensure that the LHS is still resolved as an
4099 2005-03-25 Raja R Harinath <harinath@acm.org>
4101 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4103 (Enum.current_ec): Remove.
4104 (Enum.LookupEnumValue): Remove EmitContext argument.
4105 Just uses the one created during DefineType.
4106 (Enum.FindMembers): Update.
4107 * expression.cs (MemberAccess.DoResolve): Update.
4109 2005-03-22 Marek Safar <marek.safar@seznam.cz>
4111 * assign.cs (Assign.DoResolve): Check for CS1717 when
4112 source and target are same (uses Equals).
4114 * expression.cs (LocalVariableReference, ParameterReference,
4115 This): Implemented Equals, GetHashCode.
4117 * statement.cs (Block.GetParameterReference): Removed useless
4120 2005-03-22 Raja R Harinath <rharinath@novell.com>
4123 * statement.cs (Block.AddVariable): Ensure that we skip implicit
4124 blocks before deciding whether the error is cs0136 or cs0128.
4126 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4127 (using_alias_directive, using_namespace_directive): Pass
4128 MemberName, not an expression to Namespace.UsingAlias and
4130 (MakeName): Use the MemberName of the namespace.
4131 * namespace.cs (Namespace.MemberName): New.
4132 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4133 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4135 * decl.cs (MemberName.Name): Make readonly.
4136 (MemberName.FromDotted): New "constructor".
4137 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4138 (MemberCore.Name): Compute from MemberName on demand.
4139 (MemberCore.SetMemberName): Provide a way to change the
4141 (MemberCore.AddToContainer): Don't take a fullname parameter.
4142 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4143 fully qualified name of the container to the member name.
4144 (TypeContainer.AddToTypeContainer): Use a fully qualified name
4145 only if the type is a member of the root container.
4146 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4147 MemberName.Left rather than searching for an embedded ".".
4148 (PartialContainer.CreatePart): Update to changes in RootContext.
4149 (MemberBase.ShortName): Turn into a property. Use
4150 MemberCore.SetMemberName.
4151 (MemberBase.ExplicitInterfaceName): Remove.
4152 (MemberBase.UpdateMemberName): Remove.
4153 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4154 (PropertyBase.SetMemberName): New override.
4155 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4156 (Tree.GetDecl): New.
4157 (Tree.AllDecls): Rename from Decls.
4158 * attribute.cs, enum.cs, report.cs: Update to changes.
4159 * driver.cs (MainDriver): Use MemberName.FromDotted on
4160 RootContext.MainClass.
4162 2005-03-21 Marek Safar <marek.safar@seznam.cz>
4164 * class.cs (FixedField.Define): Check for CS1664 and more sanity
4167 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4169 2005-03-18 Marek Safar <marek.safar@seznam.cz>
4171 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4172 property accessor modifiers.
4174 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4175 fixed buffer attribute (CS1716).
4176 (PropertyMethod.HasCustomAccessModifier): When property accessor
4177 has custom modifier.
4179 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4181 (PropertyExpr.DoResolveLValue): Add CS0272.
4183 2005-03-17 Miguel de Icaza <miguel@novell.com>
4185 * convert.cs: When converting to a pointer, use the proper Conv.U
4186 or Conv.I depending on the source data type.
4188 * cs-tokenizer.cs: Make the size for large decimal constants,
4191 2005-03-17 Martin Baulig <martin@ximian.com>
4193 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4194 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
4196 2005-03-17 Martin Baulig <martin@ximian.com>
4198 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4199 to bool so we can return an error condition.
4200 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4203 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
4205 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4208 2005-03-16 Raja R Harinath <rharinath@novell.com>
4210 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4211 Refactor to avoid traversing the list of assemblies, and to avoid
4212 string concatenation.
4213 * typemanager.cs (guid_attr_type): Remove.
4214 (negative_hits, pointers, references): Remove hashes.
4216 (GetConstructedType): New. Uses type_hash to handle constructed
4217 types (arrays, references, pointers).
4218 (GetReferenceType, GetPointerType): Use it.
4219 (GetNestedType): New. Uses type_hash to handle nested types of
4221 (LookupType, LookupTypeDirect): Remove.
4222 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
4223 'types' hash and LookupTypeReflection directly.
4224 (params_string, params_object): Use GetConstructedType.
4225 * namespace.cs (Namespace.cached_types): New. Cache of reflected
4227 (Namespace.Lookup): Use cached_types.
4228 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4229 provided by old TypeManager.LookupType.
4230 * rootcontext.cs (MakeFQN): Remove.
4231 * decl.cs (DeclSpace.MakeFQN): Likewise.
4232 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4233 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4234 TypeManager.GetConstructedType.
4235 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4237 2005-03-15 Marek Safar <marek.safar@seznam.cz>
4239 * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
4242 * cs-parser.jay: Reports CS1527 for any namespace element.
4244 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4247 * expression.cs (ParameterReference.IsAssigned): Changed error to
4249 (Error_WrongNumArguments): Moved CS0245 detection here.
4251 * statement.cs (Return.Resolve): Add CS1622 report.
4253 2005-03-11 Marek Safar <marek.safar@seznam.cz>
4255 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4257 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
4259 * attribute.cs expression.cs: Get rid of some allocations.
4261 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
4263 * doc.cs : just eliminate the latest change.
4265 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4267 * doc.cs : commented out the latest change. It breaks xml-030.cs
4269 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4271 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4272 fail. So invoke CreateType() in FindDocumentedType().
4274 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
4276 * cs-tokenizer.cs : added IsKeyword().
4277 * doc.cs : Detect keyword incorrectly used as identifier.
4278 Allow identifiers prefixed by @.
4280 2005-03-10 Marek Safar <marek.safar@seznam.cz>
4282 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4283 It caused exception in namespace resolving (again!).
4285 * class.cs (Class.ctor): Removed exit.
4286 (PropertyMethod.ctor): ditto.
4288 * codegen.cs (Codegen.Reset): Reset static data.
4289 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4291 * cs-tokenizer.cs (Cleanup): Removed.
4293 * driver.cs (GetSystemDir): Rewrote to one line command.
4294 It caused problem with unloaded dynamic modules.
4295 (UnixParseOption): Removed Exit.
4296 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4297 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4298 Now can be mcs used as library.
4300 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4303 * location.cs (Reset): Reset static data.
4305 * namespace.cs (Reset): Reset static data.
4307 * report.cs (Report.Reset): Reset static data.
4309 * rootcontext.cs (RootContext.Reset): Reset static data.
4311 * tree.cs (RootTypes.ctor): Use Location.Null
4313 * typemanager.cs (TypeManager.Reset): Reset static data.
4314 (CoreLookupType): Removed Exit.
4315 (TypeHandle.Reset): Reset static data.
4317 2005-03-10 Raja R Harinath <rharinath@novell.com>
4320 * typemanager.cs (ComputeNamespaces): Import namespaces from
4321 referenced modules too.
4323 2005-03-09 Raja R Harinath <rharinath@novell.com>
4325 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4328 2005-03-09 Raja R Harinath <rharinath@novell.com>
4330 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4331 enclosing DeclSpace. This ensures that a name-lookup populates
4332 more caches and there are fewer 'TypeExpression's. Carve out
4333 nested type lookup into ...
4334 (LookupNestedTypeInHierarchy): ... this.
4336 2005-03-09 Raja R Harinath <rharinath@novell.com>
4338 Clean up a few partial-class semantics.
4339 Fixes test-357.cs and cs1618-2.cs.
4340 * cs-parser.jay (struct_declaration): Use 'current_class' as
4341 parent of newly-created struct. Remove call to Register ().
4342 Use 'pop_current_class' to complete handing the current struct.
4343 (interface_declaration): Likewise.
4344 (class_declaration): Likewise.
4345 (enum_declaration): Use 'current_class' as parent of newly created
4347 (delegate_declaration): Likewise.
4348 (pop_current_class): New function. This is used to handle closing
4349 up the 'current_class' and 'current_container', and pointing them
4350 to the enclosing class/container.
4351 (CSharpParser): Initialize 'current_class' too.
4352 * decl.cs (MemberCore): Add check for invariant: a partial
4353 container is not a parsed entity, and thus does not enclose any
4355 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4356 (DeclSpace.BaseTypeExpr): Use it.
4357 (DeclSpace.LookupType): Add check for invariant.
4358 * class.cs (TypeContainer): Add check for invariant: a nested
4359 class should have the same NamespaceEntry as its enclosing class.
4360 (TypeContainer.EmitFieldInitializers): Make virtual.
4361 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4363 (TypeContainer.Register): Remove.
4364 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4365 null. Use TypeResolveEmitContext for resolving base types and
4366 interfaces. Move initialization of Parts.TypeBuilder here from
4368 (TypeContainer.DefineNestedTypes): ... here.
4369 (PartialContainer): Take a Namespace not a NamespaceEntry.
4370 (PartialContainer.Create): Don't use Register. Call the
4371 appropriate Add... function directly.
4372 (ClassPart): Take both the PartialContainer and the enclosing
4373 class as constructor arguments.
4374 (ClassPart.EmitFieldInitializers): Override.
4375 (ClassPart.PartFindNestedTypes): Remove.
4376 (FieldBase.GetInitializerExpression): Resolve the initializer
4377 expression in the emit context of the enclosing class.
4378 * tree.cs (RootTypes): Remove Register ().
4380 2005-03-08 Marek Safar <marek.safar@seznam.cz>
4382 * cs-parser.jay: Removed CS0134.
4384 * driver.cs: Removed CS1901.
4386 * expression.cs (SizeOf.DoResolve): Don't report CS0233
4387 for predefined types.
4389 2005-03-07 Duncan Mak <duncan@novell.com>
4391 * codegen.cs (Save): Catch UnauthorizedAccessException as
4392 well. Fixes bug #73454.
4394 2005-03-07 Marek Safar <marek.safar@seznam.cz>
4396 * cs-tokenizer.cs (xtoken): Add CS1035.
4398 * class.cs (MethodData.Define): Add CS0683.
4399 (FieldMember.ctor): Add CS0681.
4401 2005-03-07 Raja R Harinath <rharinath@novell.com>
4403 * ecore.cs (SimpleName.DoResolve): Rename from
4404 SimpleName.DoResolveAllowStatic.
4405 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4406 Pass 'intermediate' flag to MemberStaticCheck.
4407 (SimpleName.MemberStaticCheck): Skip "static check" only in case
4408 of "intermediate" lookups via MemberAccess.
4409 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
4410 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4412 2005-03-07 Raja R Harinath <rharinath@novell.com>
4415 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4416 slipped in because of variable names that are identical to a
4417 builtin type's BCL equivalent ('string String;', 'int Int32;').
4418 (PropertyExpr.EmitInstance): Likewise.
4420 2005-03-04 Marek Safar <marek.safar@seznam.cz>
4422 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4424 * report.cs (warning_ignore_table): Made public.
4426 2005-03-04 Raja R Harinath <rharinath@novell.com>
4429 * class.cs (MethodData.Emit): Pass 'container' to
4430 container.GetObsoleteAttribute instead of 'container.Parent'.
4432 2005-03-03 Marek Safar <marek.safar@seznam.cz>
4434 * cs-parser.jay: Add 1534 error test.
4436 * iterators.cs (Yield.CheckContext): Add error 1629.
4437 (Iterator.ctor): Save unsafe modifier.
4438 (MoveNextMethod.DoEmit): Restore unsafe context.
4440 * namespace.cs (UsingAlias): Better error message.
4442 2005-03-03 Dan Winship <danw@novell.com>
4444 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4445 the warning message [#73219]
4447 2005-03-03 Raja R Harinath <rharinath@novell.com>
4449 Fix compile with MCS 1.0.0.0.
4450 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4451 w_restore to not depend on string constant folding.
4453 2005-03-03 Raja R Harinath <rharinath@novell.com>
4455 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
4456 CS0246 check to users who passed 'silent = false'.
4457 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
4459 (SimpleName.SimpleNameResolve): Update.
4460 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
4461 (MemberAccess.IdenticalNameAndTypeName): Update.
4462 * doc.cs (FindDocumentedTypeNonArray): Update.
4464 2005-03-03 Raja R Harinath <rharinath@novell.com>
4466 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
4467 * parameters.cs (ComputeAndDefineParameters): Remove.
4468 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
4469 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
4470 Use GetParameterInfo.
4472 2005-03-02 Marek Safar <marek.safar@seznam.cz>
4474 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
4476 2005-03-02 Raja R Harinath <rharinath@novell.com>
4478 Unify DeclSpace.LookupType and DeclSpace.FindType.
4479 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
4480 is in charge of defining nested types on demand.
4481 (DeclSpace.LookupType): Use it when the current_type is a
4482 TypeBuilder. Use LookupTypeDirect for reflected types.
4483 (DeclSpace.FindType): Remove.
4484 (DeclSpace.LookupInterfaceOrClass): Likewise.
4485 (DeclSpace.DefineTypeAndParents): Likewise.
4486 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
4487 DeclSpace.LookupType.
4488 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
4489 * typemanager.cs (LookupType): Simplify.
4490 (AddUserType): Remove type from negative_hits.
4491 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
4492 * class.cs (TypeContainer.FindMembers): Move handling of nested
4494 (TypeContainer.FindMembers_NestedTypes): ... here.
4495 (TypeContainer.FindNestedType): Implement override.
4496 (ClassPart.FindNestedType): Delegate to PartialContainer.
4497 (ClassPart.PartFindNestedType): Looks up the nested types of the
4500 2005-03-02 Martin Baulig <martin@ximian.com>
4502 * class.cs (TypeContainer.DoDefineMembers): We also need a default
4503 static constructor in static classes.
4505 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
4507 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
4508 sizeParamIndex is not specified.
4510 2005-03-01 Marek Safar <marek.safar@seznam.cz>
4513 * report.cs (WarningMessage.IsEnabled): Missing null check.
4515 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4517 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
4518 in the fields and not in the properties.
4520 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
4522 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
4525 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4527 * attribute.cs: Small refactoring (improved robustness).
4528 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
4529 (ValidateGuid): Removed.
4530 (Resolve): Removed referenced to above mentioned.
4531 (GetAttributeUsage): Made private and changed to work without
4533 (GetIndexerAttributeValue): Don't crash.
4534 (GetConditionalAttributeValue): Ditto.
4535 (GetClsCompliantAttributeValue): Ditto.
4536 (ExtractSecurityPermissionSet): All attributes exceptions are
4538 (GetPropertyValue): New helper.
4539 (GetMethodImplOptions): New method.
4540 (DefinePInvokeMethod): Reuse common code. Implemented handling of
4541 some missing properties.
4543 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
4544 (Method.ApplyAttributeBuilder): Updated.
4546 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
4549 2005-02-28 Raja R Harinath <rharinath@novell.com>
4552 * report.cs (Report.SymbolRelatedToPreviousError): Handle
4553 non-simple types (array, pointer, reference).
4555 2005-02-28 Marek Safar <marek.safar@seznam.cz>
4557 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
4559 * class.cs (MethodCore.IsDuplicateImplementation): Special error
4561 (Method.CheckBase): Catch wrong destructor here.
4562 (MethodData.Define): Add errors 550, 668.
4564 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
4566 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
4568 * pending.cs (VerifyPendingMethods): Add error 551.
4570 * typemanager.cs (CSharpName): Next error report helper.
4572 2005-02-25 Marek Safar <marek.safar@seznam.cz>
4574 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
4575 attributes. Removed useless attribute double check.
4576 It saves almost 2MBs for corlib.
4578 2005-02-25 Raja R Harinath <rharinath@novell.com>
4581 * statement.cs (ExpressionStatement.Resolve): Make robust to being
4582 called twice in case of error.
4584 2005-02-23 Chris Toshok <toshok@ximian.com>
4586 Fix compiler portions of #72827.
4587 * statement.cs (Block.Emit): call Begin/EndScope on the
4588 EmitContext instead of the ILGenerator.
4590 * codegen.cs (EmitContext.BeginScope): new method, call
4591 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
4593 (EmitContext.BeginScope): same, but EndScope and CloseScope
4595 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
4596 offset and call the superclass's OpenScope(int) with it.
4597 (SymbolWriter.CloseScope): get the current il
4598 offset and call superclass's CloseScope(int) with it.
4600 2005-02-23 Marek Safar <marek.safar@seznam.cz>
4602 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
4603 CS1677 for out and ref as well.
4605 * class.cs (Method.Define): Add error CS1599 detection.
4607 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
4609 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
4611 * delegate.cs (Delegate.Define): Add error CS1599 detection.
4613 * support.cs.cs (ModifierDesc): New helper method.
4615 2005-02-23 Raja R Harinath <rharinath@novell.com>
4616 Abin Thomas <projectmonokochi@rediffmail.com>
4617 Anoob V E <projectmonokochi@rediffmail.com>
4618 Harilal P R <projectmonokochi@rediffmail.com>
4621 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
4622 MemberLookup (used for error reporting) actually returns a result.
4623 Fix error report number (122, not 112).
4625 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
4626 Anoob V E <projectmonokochi@rediffmail.com>
4627 Harilal P R <projectmonokochi@rediffmail.com>
4630 * pending.cs (PendingImplementation.GetAbstractMethods):
4631 Find NonPublic members too.
4633 2005-02-22 Marek Safar <marek.safar@seznam.cz>
4635 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
4638 * class.cs (MethodCore.CheckMethodAgainstBase):
4639 Add error 239 report.
4641 2005-02-21 Raja R Harinath <rharinath@novell.com>
4644 * expression.cs (Invocation.IsApplicable): Make public.
4645 (Invocation.IsParamsMethodApplicable): Likewise.
4646 * delegate.cs (Delegate.VerifyApplicability): Don't use
4647 Invocation.VerifyArgumentCompat for parameter applicability
4648 testing. Use Invocation.IsApplicable and
4649 Invocation.IsParamsMethodApplicable.
4651 2005-02-21 Marek Safar <marek.safar@seznam.cz>
4653 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
4655 * class.cs (Operator.Define): Add error 217 report.
4657 2005-02-21 Raja R Harinath <rharinath@novell.com>
4659 * namespace.cs (UsingEntry.Resolve): Undo change below.
4661 2005-02-21 Raja R Harinath <rharinath@novell.com>
4664 * ecore.cs (Expression.MemberLookupFailed): Add argument to
4665 disable the error message when the extended MemberLookup also
4667 (Expression.MemberLookupFinal): Update.
4668 (SimpleName.DoSimpleNameResolve): Update.
4669 * expression.cs (MemberAccess.ResolveNamespaceOrType):
4670 Don't use MemberLookupFinal.
4671 (New.DoResolve): Update.
4672 (BaseAccess.CommonResolve): Update.
4674 2005-02-21 Raja R Harinath <rharinath@novell.com>
4677 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
4678 occured previously, don't resolve again.
4680 2005-02-21 Marek Safar <marek.safar@seznam.cz>
4683 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
4684 argument. Call ResolveAttributeUsage for unresolved.
4685 when types doesn't match ctor arguments.
4687 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
4688 for nested attribute classes.
4689 (Class.attribute_usage): Removed.
4690 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
4691 for attribute class.
4693 * ecore.cs (IsAttribute): Removed.
4695 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
4697 * rootcontext.cs (RegisterAttribute): Removed, attributes are
4699 (attribute_types): Removed.
4700 (EmitCode): Global attributes are emited as the latest.
4702 2005-02-18 Marek Safar <marek.safar@seznam.cz>
4704 * class.cs (EmitFieldInitializers): Don't emit field initializer
4705 for default values when optimilization is on.
4707 * constant.cs (Constant.IsDefaultValue): New property.
4709 * driver.cs: Add /optimize handling.
4713 * literal.cs: Implement new IsDefaultValue property.
4715 * rootcontext.cs (Optimize): New field, holds /optimize option.
4717 2005-02-18 Raja R Harinath <rharinath@novell.com>
4719 Fix crasher in re-opened #72347.
4720 * namespace.cs (Namespace.Lookup): Return null if
4721 DeclSpace.DefineType returns null.
4724 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
4726 2005-02-18 Raja R Harinath <rharinath@novell.com>
4728 Fix remainder of #63202. Change semantics of DoResolveLValue: it
4729 now returns null if it cannot resolve to an lvalue.
4730 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
4731 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
4732 returned null. Remove check for SimpleName.
4733 (EventExpr.DoResolveLValue): New.
4734 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
4735 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
4737 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
4739 (Unary.ResolveOperator): Move CS0211 check ...
4740 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
4742 (Unary.DoResolveLValue): Simplify.
4743 (AddressOf.DoResolveLValue): New.
4744 (ArrayAccess.DoResolveLValue): New.
4746 2005-02-16 Marek Safar <marek.safar@seznam.cz>
4748 * attribute.cs (Attribute.Resolve): Add arguments casting for
4749 when types doesn't match ctor arguments.
4751 2005-02-16 Raja R Harinath <rharinath@novell.com>
4753 Fix parts of #63202.
4754 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
4755 lookup of operator in base type. Ensure that all checks happen
4756 when the operator resolves to an "op_..." method.
4758 2005-02-15 Raja R Harinath <rharinath@novell.com>
4761 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
4762 'ignore_cs0104' parameter. Pass it to ...
4763 (NamespaceEntry.Lookup): ... this.
4764 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
4765 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
4766 (TypeLookupExpression.DoResolveAsTypeStep): Update.
4767 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
4768 Update. Request that cs0104 errors be ignored.
4769 (ComposedCast.ResolveAsTypeStep): Update.
4771 2005-02-14 Raja R Harinath <rharinath@novell.com>
4774 * expression.cs (Invocation.BetterFunction): Remove support for
4775 comparing virtual functions and their overrides.
4776 (Invocation.IsOverride): New.
4777 (Invocation.OverloadResolve): Don't consider 'override' functions
4778 during candidate selection. Store them in a lookaside list.
4779 If the selected method is a 'virtual' function, use the list to
4780 find any overrides that are closer to the LHS type.
4782 2005-02-14 Marek Safar <marek.safar@seznam.cz>
4784 * expression.cs (New.DoResolve): Add complex core type reduction.
4785 (New.Constantify): Converts complex core type syntax like 'new int ()'
4788 2005-02-14 Raja R Harinath <rharinath@novell.com>
4790 * decl.cs (EntryType.EntryType): New constructor to create an
4791 updated copy of a cache entry.
4792 (MemberCache.AddMethods): Use it.
4793 (MemberCache.ClearDeclaredOnly): Remove.
4794 (MemberCache.MemberCache): Update.
4796 2005-02-11 Miguel de Icaza <miguel@novell.com>
4798 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
4799 variable. This one is represents the actual low-level declaration
4800 of the method, as opposed to the semantic level `IsStatic'.
4802 An anonymous method which is hosted into a static method might be
4803 actually an instance method. IsStatic would reflect the
4804 container, while MethodIsStatic represents the actual code
4807 * expression.cs (ParameterReference): Use the new MethodIsStatic
4808 instead of IsStatic.
4810 * anonymous.cs (AnonymousMethod.Compatible): Pass the
4811 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
4812 set on the current EmitContext.
4814 * expression.cs (Cast): Overload DoResolveLValue so we can pass
4815 resolve our casted expression as an LValue. This triggers the
4816 proper LValue processing that is later required by Assign.
4820 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
4822 2005-02-11 Marek Safar <marek.safar@seznam.cz>
4824 C# 2.0 Fixed buffer implementation
4826 * anonymous.cs: Update after RegisterHelperClass renaming.
4828 * attribute.cs (AttributeTester.fixed_buffer_cache):
4829 Cache of external fixed buffers.
4830 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
4831 implementation if field is fixed buffer else null.
4834 (TypeContainer.AddField): Accept FieldMember instead of Field.
4835 (FieldBase.IsFieldClsCompliant): Extracted code from
4836 VerifyClsCompliance descendant customization.
4837 (FixedField): New class handles fixed buffer fields.
4838 (FixedFieldExternal): Keeps information about imported fixed
4840 (IFixedField): Make access to internal or external fixed buffer
4843 * cs-parser.jay: Add fixed buffer parsing.
4845 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
4848 * expression.cs (Indirection): Extended implementation to accept
4850 (PointerArithmetic.Emit): Get element from fixed buffer as well.
4851 (ElementAccess.MakePointerAccess): Get type as parameter.
4852 (DoResolve): Add fixed buffer field expression conversion.
4853 (DoResolveLValue): Ditto.
4854 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
4855 (ArrayPtr): Derives from FixedBufferPtr.
4856 (ArrayPtr.Emit): Add extra emit for array elements.
4858 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
4860 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
4861 for compiler generated types.
4862 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
4864 * statement.cs (Fixed): Refactored to be easier add fixed buffer
4865 and consume less memory.
4866 (Fixed.Resolve): Add fixed buffer case.
4868 * typemanager.cs (compiler_generated_attr_ctor,
4869 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
4870 (HasElementType): Add our own implementation to work on every
4873 2005-02-11 Miguel de Icaza <miguel@novell.com>
4875 * anonymous.cs (CaptureContext): Track whether `this' has been
4878 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
4879 only captured `this' if it was implicitly done (instance
4880 methods/variables were used).
4882 * codegen.cs (EmitContext.CaptureThis): New method to flag that
4883 `this' must be captured.
4885 2005-01-30 Miguel de Icaza <miguel@novell.com>
4887 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
4888 is null it means that there has been no need to capture anything,
4889 so we just create a sibling.
4891 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
4893 Just a partial fix. The other half is fairly elusive.
4895 2005-02-10 Raja R Harinath <rharinath@novell.com>
4897 Fix #52586, cs0121-4.cs.
4898 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
4899 and return a hashtable.
4900 (MemberCache.ClearDeclaredOnly): New.
4901 (MemberCache.MemberCache): Update to change. Make a deep copy of
4902 the method_hash of a base type too.
4903 (MemberCache.AddMethods): Adapt to having a deep copy of the base
4904 type methods. Overwrite entries with the same MethodHandle so
4905 that the ReflectedType is correct. The process leaves in base
4906 virtual functions and their overrides as distinct entries.
4907 (CacheEntry): Now a class instead of a struct. It shouldn't alter
4908 matters since it was boxed in a ArrayList before.
4909 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
4911 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
4912 case of a virtual function and its override (choose the overload
4914 (Invocation.OverloadResolve): Avoid 'override' members during
4915 'applicable_type' calculation.
4917 2005-02-09 Raja R Harinath <rharinath@novell.com>
4919 Combine two near-redundant caches.
4920 * typemanager.cs (method_params): Rename from method_internal_params.
4921 (TypeManager.GetParameterData): New. Replace
4922 Invocation.GetParameterData.
4923 (TypeManager.LookupParametersByBuilder): Remove.
4924 * expression.cs (Invocation.method_parameter_cache): Remove.
4925 (Invocation.GetParameterData): Remove.
4927 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
4930 2005-02-08 Raja R Harinath <rharinath@novell.com>
4933 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
4934 TypeManager.multicast_delegate_type is null, resolve it by looking
4935 up "System.MulticastDelegate".
4936 * rootcontext.cs (RootContext.ResolveCore): Simplify.
4938 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
4939 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
4940 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
4943 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
4944 (LabeledStatement.AddReference): New. Set 'referenced'.
4945 (Goto.Resolve): Use it.
4947 2005-02-05 John Luke <john.luke@gmail.com>
4949 * driver.cs: remove duplicate -doc line in Usage ()
4951 2005-02-04 Raja R Harinath <rharinath@novell.com>
4953 * location.cs (Location.AddFile): Fix CS2002 error report.
4955 2005-02-02 Martin Baulig <martin@ximian.com>
4957 * delegate.cs (Delegate.DefineType): Report an internal error if
4958 TypeManager.multicast_delegate_type is null. See bug #72015 for
4961 2005-02-02 Raja R Harinath <rharinath@novell.com>
4963 Fix a crasher in a variant of #31984.
4964 * const.cs (Constant.CheckBase): New override that defers the
4965 new-or-override check in case the base type hasn't been populated
4967 (Constant.Define): Ensure the new-or-override check is performed.
4969 2005-02-01 Duncan Mak <duncan@ximian.com>
4971 * const.cs (LookupConstantValue): Check that `ce' is not null
4972 before calling GetValue ().
4974 2005-02-01 Raja R Harinath <rharinath@novell.com>
4976 Fix test-334.cs (#69519).
4977 * cs-parser.jay (using_alias_directive): Pass in an expression to
4978 NamespaceEntry.UsingAlias.
4979 (using_namespace_directive): Pass in an expression to
4980 NamespaceEntry.Using.
4981 (namespace_name): Don't flatten to a string.
4982 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
4983 (NamespaceEntry.AliasEntry.Resolve): Lookup using
4985 (NamespaceEntry.UsingEntry): Likewise.
4986 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
4988 (NamespaceEntry.LookupForUsing): Remove.
4989 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
4991 (NamespaceEntry.Lookup): Remove support for dotted names.
4993 2005-02-01 Raja R Harinath <rharinath@novell.com>
4995 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
4997 (NamespaceEntry.ImplicitParent): Compute on demand.
4998 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
4999 parallels the current.
5000 (NamespaceEntry.LookupForUsing): Use it.
5001 (NamespaceEntry.Lookup): If the current namespace-entry is
5002 implicit, don't search aliases and using tables.
5004 2005-02-01 Raja R Harinath <rharinath@novell.com>
5007 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5009 (TypeContainer.BaseCache): Compute on demand.
5010 (TypeContainer.FindMembers): Define constants and types if they're
5011 not already created.
5012 (FieldMember.Define): Move resetting of ec.InUnsafe before error
5014 * const.cs (Constant.Define): Make idempotent.
5016 2005-01-29 Miguel de Icaza <miguel@novell.com>
5018 * pending.cs: Produce better code (no nops produced by using Ldarg
5021 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5022 i - 1' it should be arg + 1.
5026 2005-01-28 Raja R Harinath <rharinath@novell.com>
5028 * attribute.cs (Attribute.CheckAttributeType): Make private
5030 (Attribute.ResolveType): Make virtual.
5031 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5032 handling of RootContext.Tree.Types.
5034 2005-01-27 Raja R Harinath <rharinath@novell.com>
5036 Update attribute-handling to use the SimpleName/MemberAccess
5038 * cs-parser.jay (attribute): Pass in an expression to the
5039 constructors of Attribute and GlobalAttribute.
5040 * attribute.cs (Attribute): Take an expression for the name.
5041 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
5042 passed in attribute name expression.
5043 (Attribute.CheckAttributeType): Use it.
5044 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5045 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5046 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
5047 argument to prevent error messages if the lookup fails.
5049 2005-01-27 Marek Safar <marek.safar@seznam.cz>
5051 * expression.cs (Indirection): Implemented IVariable interface
5052 to support indirection in AddressOf operator.
5053 (PointerArithmetic.Emit): Add optimalization for case where
5054 result can be precomputed.
5056 2005-01-26 Martin Baulig <martin@ximian.com>
5058 * class.cs (TypeContainer.AttributeTargets): Return the correct
5059 AttributeTargets depending on our `Kind' instead of throwing an
5060 exception; fixes #71632.
5062 2005-01-26 Marek Safar <marek.safar@seznam.cz>
5065 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5068 2005-01-25 Raja R Harinath <rharinath@novell.com>
5071 * expression.cs (MemberAccess.DoResolve): Don't complain with
5072 cs0572 when the LHS of a member access has identical name and type
5075 2005-01-25 Marek Safar <marek.safar@seznam.cz>
5078 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5080 Create custom PermissionSet only for PermissionSetAttribute.
5082 2005-01-24 Marek Safar <marek.safar@seznam.cz>
5085 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5086 delegates in static class.
5088 2005-01-24 Martin Baulig <martin@ximian.com>
5090 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5091 merging an implicit block, just use its reachability.
5093 * statement.cs (Block.Resolve): Make the unreachable code check
5094 work wrt. implicit blocks; see test-337 from #63842.
5096 2005-01-21 Alp Toker <alp@atoker.com>
5098 * cs-parser.jay: destructor_declaration's container is PartialContainer
5099 not Class when partial types are used, so use Kind prop instead of
5102 2005-01-22 Miguel de Icaza <miguel@ximian.com>
5104 * cs-parser.jay: Improve error reporting when an interface
5107 2005-01-20 Dick Porter <dick@ximian.com>
5109 * support.cs: SeekableStreamReader fix from Sandor Dobos
5110 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5111 chars are read. Fixes bug 70369.
5113 2005-01-20 Raja R Harinath <rharinath@novell.com>
5115 * cs-parser.jay (catch_clause): Simplify current_block handling
5118 2005-01-17 Miguel de Icaza <miguel@ximian.com>
5120 * convert.cs (ImplicitStandardConversionExists): Synchronize the
5121 code with ImplicitStandardConversion to handle the implicit
5122 conversion of method groups into valid delegate invocations.
5124 The problem is that in parameter handling we were using this code
5125 path. Fixes bug #64698
5127 2005-01-19 Raja R Harinath <rharinath@novell.com>
5129 * cs-parser.jay: Fix several infelicities.
5130 - Avoid assigning to the parser value stack. Code like
5131 '$3 = null' is unclean. Synthesize a value for the code block
5133 - Avoid using oob_stack for storing location information. Use ...
5134 (_mark_): ... this. New (empty) rule. Saves the current location
5136 (foreach_statement): Avoid using oob_stack for current_block
5137 handling. Use technique used in for_statement and
5138 using_statement. Synthesize a value for the code block to store
5139 additional intermediate information.
5141 2005-01-13 Miguel de Icaza <miguel@ximian.com>
5143 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5144 of a different type is only allowed to private fields of a
5145 containing type, not on fields of a base class.
5147 See test-174.cs and error cs0122-9.cs
5149 2005-01-13 Raja R Harinath <rharinath@novell.com>
5151 Fix test-335.cs (bug #58126).
5152 * cs-parser.jay (argument): Split out non-expression parts of the
5153 rule into 'non_simple_argument'.
5154 (invocation_expression): Support parenthesized invocations with
5155 multiple arguments, and with single non-simple arguments.
5157 2005-01-13 Raja R Harinath <rharinath@novell.com>
5159 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5162 2005-01-12 Raja R Harinath <rharinath@novell.com>
5164 Fix cs0038-1.cs, cs1640-6.cs.
5165 * ecore.cs (Expression.Resolve): Remove special-case for
5166 SimpleName in error-handling.
5167 (Expression.almostMatchedMembers): Relax access permission to
5169 (Expression.MemberLookupFailed): Handle duplicates in
5170 almostMatchedMembers list.
5171 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5172 * expression.cs (New.DoResolve): Report CS1540 for more cases.
5173 * typemanager.cs (GetFullNameSignature): Use the MethodBase
5174 overload if the passed in MemberInfo is a MethodBase.
5176 2005-01-12 Marek Safar <marek.safar@seznam.cz>
5179 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5180 for non-CAS & merge permission sets properly.
5182 2005-01-11 Raja R Harinath <rharinath@novell.com>
5184 Improve standard-compliance of simple name and member access
5185 resolution. Fixes bugs #52697, #57200, #67520, #69519.
5186 * ecore.cs (FullNamedExpression): New abstract base class
5187 for Namespaces and TypeExpressions.
5188 (ResolveFlags.SimpleName): Remove.
5189 (SimpleName): Remove support for dotted names.
5190 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
5191 DeclSpace.FindType and DeclSpace.LookupType.
5192 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5193 (Expression.ExprClassName): Make member function.
5194 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5195 a namespace. Remove creation of dotted "SimpleName"s.
5196 (MemberAccess.DoResolve): Likewise.
5197 * decl.cs (DeclSpace.Cache): Make private.
5198 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5199 (DeclSpace.FindType): Update.
5200 (DeclSpace.LookupType): Move here from RootContext. Return a
5201 FullNamedExpression.
5202 * namespace.cs (Namespace): Derive from FullNamedExpression
5203 so that it can be part of expression resolution.
5204 (Namespace.Lookup): Return an FullNamedExpression.
5205 (NamespaceEntry.LookupAlias): Lookup aliases only in current
5207 * rootcontext.cs (NamespaceLookup): Remove.
5208 (LookupType): Move to DeclSpace.
5209 * attribute.cs (CheckAttributeType): Update.
5210 * doc.cs (FindDocumentedType): Remove allowAlias argument.
5211 (FindDocumentedTypeNonArray): Likewise.
5213 2005-01-11 Raja R Harinath <rharinath@novell.com>
5215 Fix cs0509.cs, cs1632.cs.
5216 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5217 is the same as IsInterface.
5218 (TypeContainer.GetClassBases): Likewise.
5219 * statement.cs (LabeledStatement.ig): New field.
5220 (LabeledStatement.LabelTarget): Save ILGenerator which created the
5222 (LabeledStatement.DoEmit): Check that the label was created with
5223 the same ILGenerator.
5225 2005-01-10 Marek Safar <marek.safar@seznam.cz>
5228 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5229 accessors to its properties.
5231 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5232 from accessors to property.
5234 2005-01-10 Marek Safar <marek.safar@seznam.cz>
5237 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5240 2005-01-08 Miguel de Icaza <miguel@ximian.com>
5242 * attribute.cs: Check for null and empty strings.
5244 I have lost another battle to Paolo.
5246 2005-01-07 Marek Safar <marek.safar@seznam.cz>
5249 * class.cs (PropertyMethod): Set Parent field in ctors.
5250 (SetMethod.InternalParameters): Add unsafe switch hack.
5251 Override MarkForDuplicationCheck where it is appropriate.
5253 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5254 It says whether container allows members with the same name.
5256 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5257 Removed is_method parameter.
5259 2005-01-06 Duncan Mak <duncan@ximian.com>
5261 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
5262 because the previous change led to incorrect reporting of CS1032
5263 ("Cannot define/undefine preprocessor symbols after first token in
5264 file"). Instead of using `tokens_seen' as the only flag that
5265 triggers CS1040, introduce `comments_seen'. This new flag is used
5266 to signify having seen comments on the current line, so it is
5267 unset after a newline.
5269 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
5271 * doc.cs : When searching for a type, find nested type too.
5272 This fixes bug #71040.
5274 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
5277 - Warn missing member comment on those classes which also does not
5278 have doc comments. Fixed bug #71041.
5279 - Don't warn missing doc comment on default constructor.
5282 2005-01-06 Duncan Mak <duncan@ximian.com>
5284 * cs-tokenizer.cs (xtoken): After handling traditional C-style
5285 comments, set `tokens_seen' to true. This allows us to detect
5286 misplaced preprocessor directives (i.e. not at the beginning of
5287 the a line, nor after whitespaces). In that case, report error
5288 CS1040. This fixes bug #56460.
5290 * cs-parser.jay (interface_member_declaration): Add checks for
5291 IsExplicitImpl, and report CS0541 error if an interface member is
5292 defined as an explicit interface declaration.
5294 2005-01-06 Marek Safar <marek.safar@seznam.cz>
5297 * class.cs (PropertyMethod): Set Parent field in ctors.
5298 (SetMethod.InternalParameters): Add unsafe switch hack.
5300 * decl.cs (MemberCore.Parent): Cannot be readonly.
5302 2005-01-06 Raja R Harinath <rharinath@novell.com>
5304 * decl.cs (DeclSpace.ResolveType): Remove.
5305 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5306 Merge in code from ...
5307 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
5308 * class.cs, enum.cs: Update to changes.
5310 2005-01-06 Miguel de Icaza <miguel@ximian.com>
5312 * anonymous.cs: Ensure that we init the scope of our parent if it
5313 has not been initialized yet.
5315 2004-12-30 Duncan Mak <duncan@ximian.com>
5317 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
5318 if field.FieldBuilder is null. Fixes #70758.
5320 * convert.cs: Fixed some typos and updated some of the comments.
5321 (ImplicitStandardConversionExists):
5322 (TryImplicitIntConversion): If `target_type' is an interface and
5323 the type of `ic' implements this interface, return true or a new
5324 BoxedCast instead of null. This fixes #70468.
5326 2004-12-29 Duncan Mak <duncan@ximian.com>
5328 * expression.cs (Argument.Emit): Check that Expr is
5329 IMemoryLocation before casting to it, and report CS1510 otherwise.
5333 2004-12-21 Ben Maurer <bmaurer@ximian.com>
5335 * statement.cs (Block.ThisVariable): remove the recursion here, to
5336 make the --profile more sane.
5338 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
5340 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
5341 assembly, by JB Evain.
5343 2004-12-17 Raja R Harinath <rharinath@novell.com>
5345 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
5346 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
5347 "parent" refers to enclosing type/class. "base" refers to superclass.
5349 2004-12-17 Raja R Harinath <rharinath@novell.com>
5351 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5352 Ensure that we only have GlobalAttributes.
5353 * attribute.cs (Attribute.Emit): Make non-virtual.
5354 (GlobalAttribute.Emit): Remove.
5355 (Attribute.Resolve): Make virtual.
5356 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
5357 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
5358 the argument. Don't create one.
5359 (Attribute.GetObsoleteAttribute): Likewise.
5360 (Attribute.GetClsCompliantAttributeValue): Likewise.
5361 * class.cs, decl.cs: Update to changes.
5363 2004-12-17 Marek Safar <marek.safar@seznam.cz>
5365 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
5367 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
5369 * statement.cs (Foreach.Resolve): Add error 186 report.
5371 2004-12-16 Marek Safar <marek.safar@seznam.cz>
5373 * expression.cs (Conditional.DoResolve): Add warning 429.
5375 * statement.cs (If.Resolve): Add warning 665.
5377 2004-12-16 Raja R Harinath <rharinath@novell.com>
5379 New invariant: RootContext.Tree.Types.NamespaceEntry == null
5380 except when in the parser, and in GlobalAttribute.
5381 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
5382 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
5383 RootContext.Tree.Types.NamespaceEntry once work is done.
5384 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
5385 and resets RootContext.Tree.Types.NamespaceEntry.
5387 2004-12-15 Marek Safar <marek.safar@seznam.cz>
5389 * cs-parser.jay: Don't create a block for every variable.
5391 2004-12-14 Miguel de Icaza <miguel@ximian.com>
5393 * location.cs: Provide extra information.
5395 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
5396 variables from the captured environment, it is the ldarg_0.
5398 2004-12-14 Marek Safar <marek.safar@seznam.cz>
5400 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
5403 * class.cs: Changed warning level for 169 to avoid developer
5404 displeasure from warning flooding. It will be changed back when they
5405 fix most of current BCL warnings.
5407 * RootContext.cs: Pushed default WarningLevel to 3.
5409 * statement.cs: Removed unused variable.
5411 2004-12-14 Marek Safar <marek.safar@seznam.cz>
5413 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
5414 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
5415 Add error 502 report.
5416 (StaticClass.DefineType): Add error 441 report.
5417 (Class.AllowedModifiersProp): New virtual property as temporary
5418 extension to AllowedModifiers.
5419 (Class.DefineType): Add error 418 report. Moved ModFlags check here
5420 to share implementation with StaticClass and don't call virtual
5423 * driver.cs (MainDriver): Add error 1558 test.
5425 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
5426 report. Moved error 36 test here.
5428 * statement.cs (Throw.Resolve): Add error 724 report.
5430 * typemanager.cs: Add out_attribute_type core type.
5432 2004-12-13 Marek Safar <marek.safar@seznam.cz>
5434 * class.cs (TypeContainer.VerifyClsCompliance): Add error
5436 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
5438 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
5441 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
5443 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
5444 Add error 3023 report.
5445 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
5447 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
5450 2004-12-12 John Luke <john.luke@gmail.com>
5452 * driver.cs (AddArgs): take -- into account when
5453 adding arguments, fixes bug 65710
5455 2004-12-12 Martin Baulig <martin@ximian.com>
5457 * expression.cs (Unary.TryReduceNegative): Added support for
5458 SByteConstant and ByteConstant.
5459 (Unary.Reduce): Check error values from TryReduceNegative().
5461 2004-12-10 Marek Safar <marek.safar@seznam.cz>
5463 * attributes.cs (Attribute.Resolve): Avoid multiple error report
5464 and report exception as error 182.
5466 2004-12-10 Raja R Harinath <rharinath@novell.com>
5468 * driver.cs (Main): Fix message when there are warnings.
5470 2004-12-09 Miguel de Icaza <miguel@ximian.com>
5472 * delegate.cs: Fixed my fix from yesterday, sorry about that.
5474 2004-12-09 Marek Safar <marek.safar@seznam.cz>
5476 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
5477 Reduced number of warnings.
5479 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
5481 2004-12-08 Miguel de Icaza <miguel@ximian.com>
5483 * driver.cs: Removed message.
5485 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
5487 2004-12-08 <vargaz@freemail.hu>
5489 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
5491 2004-12-08 Martin Baulig <martin@ximian.com>
5493 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5494 instead of a CS3002 for properties and indexer.
5496 2004-12-08 Martin Baulig <martin@ximian.com>
5498 * decl.cs (MemberName.ToString): Make this work again.
5500 2004-12-08 Marek Safar <marek.safar@seznam.cz>
5502 * attribute.cs (Resolve): Add error 591 detection.
5504 * class.cs (FieldMember.Define): Add error 1547 detection.
5505 (Indexer.Define): Add error 620 detection.
5506 (Operator.Define): Add error 590 detection.
5508 * ecore.cs: Missing argument for error 79.
5510 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
5513 2004-12-07 Marek Safar <marek.safar@seznam.cz>
5516 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
5519 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
5521 * cs-parser.jay : handle doc comments on implicit/explicit operators.
5522 Some operator comments were suppressed.
5523 * doc.cs : Implicit/explicit operator name in doc comments are like
5524 "op_Explicit(type)~returnType", so added suffix handling.
5526 2004-12-07 Martin Baulig <martin@ximian.com>
5529 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
5530 (MemberCore.GetClsCompliantAttributeValue): Likewise.
5531 (DeclSpace.ec): New protected field; store the EmitContext here.
5532 (DeclSpace.EmitContext): New public property; moved here from
5534 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
5537 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
5538 (Enum.Emit): Don't create a new EmitContext.
5540 * delegate.cs (Delegate.DefineType): Always create the
5543 * iterators.cs (Iterators.DefineIterator): Create a new
5544 EmitContext and store it in `ec'.
5546 2004-08-24 Martin Baulig <martin@ximian.com>
5549 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
5550 this for accessibility checks.
5551 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
5552 IsNestedFamilyAccessible.
5553 (TypeManager.IsSubclassOf): New method, do what the name actually
5556 2004-12-06 Raja R Harinath <rharinath@novell.com>
5558 Fix crash on cs0657-17.cs.
5559 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5560 Use RootContext.Tree.Types, not 'new RootTypes ()'.
5561 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
5562 the case where the NamespaceEntry gets overwritten.
5564 2004-12-06 Marek Safar <marek.safar@seznam.cz>
5566 Fixed #69195, #56821
5567 * ecore.cs (ResolveBoolean): Tiny refactoring.
5569 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
5570 of right expression resolving when left is false constant and
5571 operator is LogicalAnd OR true constant and operator is LogicalOr.
5573 * statement.cs (ResolveUnreachable): Always reports warning.
5575 2004-12-05 Miguel de Icaza <miguel@ximian.com>
5577 * class.cs: Distinguish between 1721 and 1722 (just a little help
5578 for the programmer).
5580 2004-12-03 Miguel de Icaza <miguel@ximian.com>
5582 * delegate.cs: Only allow this on new versions of the language.
5584 2004-12-02 Duncan Mak <duncan@ximian.com>
5586 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
5588 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
5589 here as a static method. Take an additional bool out parameter
5590 `must_do_cs1540_check' for signaling to InstanceResolve.
5591 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
5592 member field from PropertyExpr class and made it an argument of
5594 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
5595 check for MarshalByRefObject, and report CS0122 instead of CS1540.
5596 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
5597 and `remove_accessor' as well as InstanceResolve: report CS0122
5602 2004-12-03 Raja R Harinath <rharinath@novell.com>
5604 Fix test-327.cs, test-328.cs, and put in early infrastructure
5605 for eventually fixing #52697.
5606 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
5607 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
5609 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
5610 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
5611 (VerifyUsing, error246): Update.
5612 * rootcontext.cs (RootContext.NamespaceLookup): Just use
5613 'NamespaceEntry.LookupNamespaceOrType'.
5615 2004-12-03 Martin Baulig <martin@ximian.com>
5617 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
5618 method as our child, call AnonymousMethod.Compatible() on it.
5620 2004-12-03 Raja R Harinath <rharinath@novell.com>
5622 Disable XML documentation support in 'basic' profile.
5623 * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
5624 Redirect XmlElement to System.Object.
5625 * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
5626 * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
5627 * mcs.exe.sources: Add doc-bootstrap.cs.
5628 * doc-bootstrap.cs: New file. Contains empty stub implementation
5631 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
5633 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
5634 comments are allowed.
5636 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
5638 * delegate.cs: Add checks for subtypes in paramaters and return values
5639 in VerifyMethod () to add support for Covariance/Contravariance
5642 2004-12-02 Miguel de Icaza <miguel@ximian.com>
5644 * report.cs: Remove extra closing parenthesis.
5646 * convert.cs (Error_CannotImplicitConversion): If the name of the
5647 types are the same, provide some extra information.
5649 * class.cs (FieldBase): Use an unused bit field from the field to
5650 encode the `has_offset' property from the FieldMember. This saves
5651 a couple of Ks on bootstrap compilation.
5653 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
5654 method as our child, return the AnonymousMethod resolved
5657 * expression.cs (New.DoResolve): Allow return values from
5658 NewDelegate to also include AnonymousMethods.
5662 2004-12-02 Marek Safar <marek.safar@seznam.cz>
5665 * attribute.cs (Resolve): Improved implementation of params
5666 attribute arguments.
5668 * support.cs (ParameterData): Add HasParams to be faster.
5670 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
5672 all things are for /doc support:
5674 * doc.cs: new file that supports XML documentation generation.
5675 * mcs.exe.sources: added doc.cs.
5677 Handle /doc command line option.
5678 Report error 2006 instead of 5 for missing file name for /doc.
5679 Generate XML documentation when required, after type resolution.
5681 Added support for picking up documentation (/// and /** ... */),
5682 including a new XmlCommentState enumeration.
5684 Added lines to fill Documentation element for field, constant,
5685 property, indexer, method, constructor, destructor, operator, event
5686 and class, struct, interface, delegate, enum.
5687 Added lines to warn incorrect comment.
5689 Added Documentation field (passed only when /doc was specified).
5691 Added DocComment, DocCommentHeader, GenerateDocComment() and
5692 OnGenerateDocComment() and some supporting private members for
5693 /doc feature to MemberCore.
5695 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
5697 Added overriden DocCommentHeader.
5699 Added overriden DocCommentHeader and GenerateDocComment().
5701 2004-12-01 Miguel de Icaza <miguel@ximian.com>
5703 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
5704 unwrapping the enumeration values, chain to
5705 DoConstantNumericPromotions again, so we can promote things to the
5706 fundamental types (takes care of enums that are bytes, sbytes).
5710 2004-12-01 Raja R Harinath <rharinath@novell.com>
5712 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
5713 Fix long-standing bug in type-lookup. Use FindType instead of
5714 LookupType when ec.ResolvingTypeTree.
5715 (Attribute.ResolveType, Attribute.Resolve)
5716 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
5718 (Attributes.Search): Remove internal version. Update.
5719 (Attributes.SearchMulti): Update.
5720 (Attributes.GetClsCompliantAttribute): Remove.
5721 (Attributes.GetIndexerNameAttribute): Remove.
5722 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
5723 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
5724 * class.cs (Indexer.Define): Likewise.
5726 2004-12-01 Marek Safar <marek.safar@seznam.cz>
5729 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
5730 MarshallByReference members access.
5732 * expression.cs: Use CheckMarshallByRefAccess;
5733 Better error CS0197 message.
5735 * report.cs: Print whole related error message.
5737 2004-11-30 Raja R Harinath <rharinath@novell.com>
5739 * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
5740 the current directory to help debugging.
5742 2004-11-29 Marek Safar <marek.safar@seznam.cz>
5744 * class (GetClassBases): Better error 60 report.
5745 (EventProperty): Disabled warning 67 detection.
5747 2004-11-29 Marek Safar <marek.safar@seznam.cz>
5750 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
5752 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
5755 2004-11-29 Marek Safar <marek.safar@seznam.cz>
5758 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
5760 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
5762 2004-11-26 Miguel de Icaza <miguel@ximian.com>
5764 * attribute.cs (Attribute.Resolve): Refine error reporting and
5765 report a cs0117 if the identifier does not exist, to distinguish
5766 from 0617 which is a miss-use of the actual identifier.
5768 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
5769 between cs0070 and cs0079.
5771 * class.cs (MemberBase.DoDefine): When reporting a wrong
5772 accessibility level, we use MethodCore to compare instead of
5773 Method (this was a regression in some refactoring effort).
5775 So now we correctly report cs0056 again.
5777 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
5778 testing the target_type (which was known to be object_type) and
5779 not the source type (which is anonymous_method).
5781 Fixed reporting of error cs1660.
5783 * expression.cs (UserCast.Source): Expose the underlying cast.
5785 * statement.cs (Switch.SwitchGoverningType): Sort the list of
5786 allowed types to find a match to int32 first (most common).
5788 In addition, it ignores any ImplicitUserConversions that did an
5789 internal implicit conversion (as the switch statement allows only
5790 one integral conversion to exist).
5792 * class.cs (PartialContainer.Create): rename `name' to
5793 `member_name' for clarity. Then replace the string calls with a
5794 call to MemberName.GetPartialName, as now using
5795 MemberName.ToString is an error (this is due to the side effects
5796 it had, that were fixed in the past).
5798 This will restore the error reporting on a number of partial class
5799 errors that were missusing this (and getting an exception as a
5800 results, which is now just a plain textual warning, because
5801 yyparse debug output would crash otherwise).
5803 2004-11-26 Raja R Harinath <rharinath@novell.com>
5805 * Makefile (PROGRAM_INSTALL_DIR): Remove.
5807 2004-11-25 Ben Maurer <bmaurer@ximian.com>
5809 * rootcontext.cs (LookupType): Make sure to cache lookups that
5810 don't give us a negative result. This saves about 5% of corlib
5813 2004-11-25 Miguel de Icaza <miguel@ximian.com>
5815 * report.cs (AbstractMessage.Print): messages are sent to stderr
5817 * class.cs (TypeContainer.GetClassBases): It is an error to have a
5818 non-interface in the list of interfaces (at this point, either
5819 parent was properly set, or a base class is being listed in the
5820 interfaces section).
5822 This flags error 1722, and resolves the crash from bug 69259.
5824 2004-11-25 Ben Maurer <bmaurer@ximian.com>
5826 * statement.cs (Using.EmitExpressionFinally): make this work right
5827 for valuetypes. Fixes 69926.
5829 2004-11-25 Miguel de Icaza <miguel@ximian.com>
5831 * const.cs (Const.ChangeType): Cope with the "0 literal can be
5832 converted to an enum" here, before we try to change the underlying
5833 type. This code exists, but it is a different code path than the
5834 one used while encoding constants.
5836 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
5837 old bug: when converting from the null literal to a pointer,
5838 return an EmptyCast, not the NullLiteral.
5840 This fixes #69921, the recent null_type changes probably made this
5843 (ImplicitReferenceConversionExists): In addition, resynchronized
5844 the code here, so it matches the same code in
5845 ImplicitReferenceConversionExists for the `from any class-type S
5846 to any interface-type T'.
5849 2004-11-25 Marek Safar <marek.safar@seznam.cz>
5851 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
5853 2004-11-24 Miguel de Icaza <miguel@ximian.com>
5855 * cs-parser.jay: Use verbosity accordingly.
5857 2004-11-24 Marek Safar <marek.safar@seznam.cz>
5859 * expression.cs (Unary.ResolveOperator): Do not report warning;
5860 AddressOf reads from variable.
5862 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
5864 2004-11-24 Marek Safar <marek.safar@seznam.cz>
5868 * attribute.cs (Attributable): Removed CheckTargets.
5869 (Attributes.Emit): Explicit attribute targets are tested here.
5871 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
5872 not enabled for interfaces.
5874 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
5875 (GetAssemblyName): Ouch next bug there.
5877 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
5879 * expression.cs: Error 275 added.
5881 2004-11-23 Marek Safar <marek.safar@seznam.cz>
5883 Fix bug #69177 (Implemented decimal constant support)
5885 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
5886 (BinaryFold): Add DecimalConstant.
5888 * const.cs (Define): Decimal constant
5890 (ChangeType): Add decimal type handling.
5891 (LookupConstantValue): Don't set value for decimal type but
5892 emit DecimalConstantAttribute. Needed for constant optimization.
5894 * constant.cs (ToDecimal): New method.
5895 (ConvertToDecimal): New method.
5896 (IntConstant): Implemented ConvertToDecimal.
5897 (DecimalConstant.Emit): Emit optimized version for decimals in
5900 * expression.cs (ResolveOperator): Changed order of constant
5901 reduction to work correctly with native types which have
5902 overloaded operators.
5903 (ResolveMemberAccess): Extract constant value from attribute
5906 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
5908 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
5909 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
5910 (ChangeType): Decimal is special.
5911 (TypeToCoreType): Add decimal type.
5913 2004-11-22 Marek Safar <marek.safar@seznam.cz>
5915 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
5918 2004-11-22 Marek Safar <marek.safar@seznam.cz>
5920 * class.cs (EventField.ApplyAttributeBuilder): Fix error
5923 2004-11-19 Marek Safar <marek.safar@seznam.cz>
5925 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
5927 * pending.cs (PendingImplementation): Grab only interfaces.
5929 2004-11-19 Marek Safar <marek.safar@seznam.cz>
5931 * statement.cs (ForeachHelperMethods): Add location member and
5932 error 202 detection.
5934 2004-11-19 Raja R Harinath <rharinath@novell.com>
5936 * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config. It's
5937 automatically handled by executable.make.
5938 (PROGRAM): Make profile-specific.
5940 2004-11-18 Marek Safar <marek.safar@seznam.cz>
5942 * expression.cs (DoResolveBase): Fixed wrong warning for out
5945 2004-11-18 Martin Baulig <martin@ximian.com>
5947 Merged latest changes into gmcs. Please keep this comment in
5948 here, it makes it easier for me to see what changed in MCS since
5949 the last time I merged.
5951 2004-11-17 Raja R Harinath <rharinath@novell.com>
5953 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
5954 (TypeHandle.GetMemberCache): New.
5955 (TypeHandle.TypeHandle): Update.
5956 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
5957 (TypeManager.LookupParentInterfacesCache):
5958 Rename from LookupInterfaceCache. Optimize slightly.
5959 (TypeManager.MemberLookup_FindMembers): Update.
5960 * decl.cs (MemberCache.MemberCache): Set Container to null in the
5962 (AddCacheContents): Rename from AddHashtable.
5963 * class.cs (TypeContainer.parent_container): Remove.
5964 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
5965 (TypeContainer.DoDefineMembers): Don't initialize it.
5966 Update to name changes.
5968 2004-11-17 Miguel de Icaza <miguel@ximian.com>
5970 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
5971 that factors the code to check access modifiers on override.
5973 (PropertyBase): Use the code here.
5975 Patch from Lluis S'anchez, fixes bug #69361.
5977 2004-11-15 Miguel de Icaza <miguel@ximian.com>
5979 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
5980 routine that is used to report the use of a captured variable
5981 whose address has been taken.
5983 There are two checks: one when variables are being captured and
5984 the other check is when the address of a variable is taken.
5986 (because an anonymous methods might be resolved before *or* after
5987 the address has been taken) and
5989 * expression.cs (Conditional.DoResolve): Remove the special
5990 casing that Martin added to trueExpr and falseExpr being both
5991 NullLiteral. We get the right behavior now just by introducing
5992 the null_type into the compiler.
5994 * convert.cs (ExplicitConversion): Change the code to use
5995 null_type instead of testing `expr is NullLiteral'.
5996 (ImplicitConversionStandard): use null_type too.
5997 (ImplicitReferenceConversionExists): use null_type too.
5998 (ImplicitReferenceConversion): use null_type too.
6000 * literal.cs: The type of `NullLiteral' is now null_type instead
6002 (Resolve): Set the type here.
6004 * typemanager.cs: Introduce null_type.
6006 2004-11-17 Martin Baulig <martin@ximian.com>
6008 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6009 direction, like FindMembers() does. Fixes #69546, testcase is in
6012 2004-11-16 Martin Baulig <martin@ximian.com>
6014 This is based on a patch from Marek Safar, see bug #69082.
6015 Fixes bugs #63705 and #67130.
6017 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6018 method; create a MemberCache for an interface type and cache the
6021 * decl.cs (IMemberContainer.ParentContainer): Removed.
6022 (IMemberContainer.ParentCache): New property.
6023 (MemberCache.SetupCacheForInterface): Removed.
6024 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6025 to create a cache for an interface's "parent".
6027 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6030 2004-11-16 Martin Baulig <martin@ximian.com>
6032 Merged back from gmcs; these changes already went into gmcs a
6033 couple of weeks ago.
6036 (TypeManager.AddUserType): Removed the `ifaces' argument.
6037 (TypeManager.RegisterBuilder): Take a `Type []' instead of a
6039 (TypeManager.AddUserInterface): Removed.
6040 (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
6042 (TypeManager.GetInterfaces): Likewise.
6043 (TypeManager.GetExplicitInterfaces): Likewise.
6045 * ecore.cs (TypeExpr.GetInterfaces): Removed.
6047 * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
6048 (TypeContainer.base_inteface_types): Replaced with `ifaces'.
6050 2004-11-14 Ben Maurer <bmaurer@ximian.com>
6052 * statement.cs: Avoid adding bools to a hashtable.
6054 2004-11-07 Miguel de Icaza <miguel@ximian.com>
6056 * expression.cs (Invocation.OverloadResolve): Flag error if we are
6057 calling an unsafe method from a safe location.
6059 2004-11-06 Marek Safar <marek.safar@seznam.cz>
6062 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6064 2004-11-06 Miguel de Icaza <miguel@ximian.com>
6066 * namespace.cs (VerifyUsing): use GetPartialName instead of
6069 2004-11-05 Miguel de Icaza <miguel@ximian.com>
6071 * statement.cs (Return.Resolve): Fix regression in typo: if
6072 `in_exc', we have to request a NeedReturnLabel, this was a typo
6073 introduced in the anonymous method check-in. Fixes #69131.
6075 * Indexers were using the ShortName when defining themselves,
6076 causing a regression in the compiler bootstrap when applying the
6077 patch from 2004-11-02 (first part), now they use their full name
6078 and the bug is gone.
6080 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
6082 * driver.cs: Strip the path from the names of embedded resources. Fixes
6085 2004-11-04 Raja R Harinath <rharinath@novell.com>
6087 Fix error message regression: cs0104-2.cs.
6088 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6089 (AliasEntry.Resolve): Update.
6090 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
6092 (RootContext.LookupType): Update.
6094 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
6096 * cs-parser.jay: Add support for handling accessor modifiers
6097 * class: Add support port accessor modifiers and error checking,
6098 define PropertyMethod.Define as virtual (not abstract anymore)
6099 * ecore.cs: Add checking for proeprties access with access modifiers
6100 * iterators.cs: Modify Accessor constructor call based in the modified
6102 2004-11-02 Ben Maurer <bmaurer@ximian.com>
6104 * expression.cs (StringConcat): Handle being called twice,
6105 as when we have a concat in a field init with more than two
6108 2004-11-02 Miguel de Icaza <miguel@ximian.com>
6110 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6111 special case explicit implementations, we should always produce
6112 the .property or .event declaration.
6114 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6115 since it will not return correct data if people use this
6116 unresolved in the presence of using statements (see test-313).
6118 * class.cs (MethodData.Define): If we are an explicit interface
6119 implementation, set the method name to the full name of the
6120 interface plus the name of the method.
6122 Notice that using the method.MethodName.GetFullName() does not
6123 work, as it will only contain the name as declared on the source
6124 file (it can be a shorthand in the presence of using statements)
6125 and not the fully qualifed type name, for example:
6129 class D : ICloneable {
6130 object ICloneable.Clone () {
6134 Would produce a method called `ICloneable.Clone' instead of
6135 `System.ICloneable.Clone'.
6137 * namespace.cs (Alias.Resolve): Use GetPartialName.
6139 2004-11-01 Marek Safar <marek.safar@seznam.cz>
6141 * cs-parser.jay: Add error 1055 report.
6143 2004-11-01 Miguel de Icaza <miguel@ximian.com>
6145 * assign.cs (Assign.DoResolve): Only do the transform of
6146 assignment into a New if the types are compatible, if not, fall
6147 through and let the implicit code deal with the errors and with
6148 the necessary conversions.
6150 2004-11-01 Marek Safar <marek.safar@seznam.cz>
6152 * cs-parser.jay: Add error 1031 report.
6154 * cs-tokenizer.cs: Add location for error 1038.
6156 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6158 * cs-parser.jay: Add error 1016 report.
6160 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6162 * cs-parser.jay: Add errors 1575,1611 report.
6164 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6166 * cs-parser.jay: Add error 1001 report.
6168 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6171 * attribute.cs (GetMarshal): Add method argument for
6172 caller identification.
6174 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
6175 agument for GetMarshal and RuntimeMissingSupport.
6177 2004-10-31 Marek Safar <marek.safar@seznam.cz>
6179 * attribute.cs (ExtractSecurityPermissionSet): Removed
6180 TypeManager.code_access_permission_type.
6182 * typemanager.cs: Removed TypeManager.code_access_permission_type.
6184 2004-10-27 Miguel de Icaza <miguel@ximian.com>
6186 * expression.cs (LocalVariableReference.DoResolveLValue): Check
6187 for obsolete use of a variable here. Fixes regression on errors
6188 cs0619-25 and cs0619-26.
6190 2004-10-27 Marek Safar <marek.safar@seznam.cz>
6192 Fix #62358, implemented security attribute encoding.
6194 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
6195 Tests permitted SecurityAction for assembly or other types.
6196 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
6197 data from SecurityPermissionAttribute to PermisionSet class.
6199 * class.cs (ApplyAttributeBuilder): Added special handling
6200 for System.Security.Permissions.SecurityAttribute based types.
6202 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
6203 special handling for System.Security.Permissions.SecurityAttribute
6206 * enum.cs (ApplyAttributeBuilder): Added special handling
6207 for System.Security.Permissions.SecurityAttribute based types.
6209 * parameter.cs (ApplyAttributeBuilder): Added special handling
6210 for System.Security.Permissions.SecurityAttribute based types.
6212 * rootcontext.cs: Next 2 core types.
6214 * typemanager.cs (TypeManager.security_permission_attr_type):
6215 Built in type for the SecurityPermission Attribute.
6216 (code_access_permission_type): Build in type.
6218 2004-10-17 Miguel de Icaza <miguel@ximian.com>
6220 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
6221 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
6222 all of this information into
6223 EmitContext.EmitCapturedVariableInstance.
6225 * codegen.cs (EmitCapturedVariableInstance): move here the
6226 funcionality of emitting an ldarg.0 in the presence of a
6227 remapping. This centralizes the instance emit code.
6229 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
6230 then emit a load of this: it means that we have reached the
6231 topmost ScopeInfo: the one that contains the pointer to the
6232 instance of the class hosting the anonymous method.
6234 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
6235 captures to the topmost CaptureContext.
6237 2004-10-12 Miguel de Icaza <miguel@ximian.com>
6239 * expression.cs (LocalVariableReference): Move the knowledge about
6240 the iterators into codegen's EmitCapturedVariableInstance.
6242 2004-10-11 Miguel de Icaza <miguel@ximian.com>
6244 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
6245 all code paths return a value from an anonymous method (it is the
6246 same as the 161 error, but for anonymous methods).
6248 2004-10-08 Miguel de Icaza <miguel@ximian.com>
6250 The introduction of anonymous methods in the compiler changed
6251 various ways of doing things in the compiler. The most
6252 significant one is the hard split between the resolution phase
6253 and the emission phases of the compiler.
6255 For instance, routines that referenced local variables no
6256 longer can safely create temporary variables during the
6257 resolution phase: they must do so from the emission phase,
6258 since the variable might have been "captured", hence access to
6259 it can not be done with the local-variable operations from the runtime.
6263 (Block.Flags): New flag `IsTopLevel' to indicate that this block
6264 is a toplevel block.
6266 (ToplevelBlock): A new kind of Block, these are the blocks that
6267 are created by the parser for all toplevel method bodies. These
6268 include methods, accessors and anonymous methods.
6270 These contain some extra information not found in regular blocks:
6271 A pointer to an optional CaptureContext (for tracking captured
6272 local variables and parameters). A pointer to the parent
6275 (Return.Resolve): Catch missmatches when returning a value from an
6276 anonymous method (error 1662).
6277 Invoke NeedReturnLabel from the Resolve phase instead of the emit
6280 (Break.Resolve): ditto.
6282 (SwitchLabel): instead of defining the labels during the
6283 resolution phase, we now turned the public ILLabel and ILLabelCode
6284 labels into methods called GetILLabelCode() and GetILLabel() that
6285 only define the label during the Emit phase.
6287 (GotoCase): Track the SwitchLabel instead of the computed label
6288 (its contained therein). Emit the code by using
6289 SwitchLabel.GetILLabelCode ().
6291 (LocalInfo.Flags.Captured): A new flag has been introduce to track
6292 whether the Local has been captured or not.
6294 (LocalInfo.IsCaptured): New property, used to tell whether the
6295 local has been captured.
6297 * anonymous.cs: Vastly updated to contain the anonymous method
6300 The main classes here are: CaptureContext which tracks any
6301 captured information for a toplevel block and ScopeInfo used to
6302 track the activation frames for various local variables.
6304 Each toplevel block has an optional capture context associated
6305 with it. When a method contains an anonymous method both the
6306 toplevel method and the anonymous method will create a capture
6307 context. When variables or parameters are captured, they are
6308 recorded on the CaptureContext that owns them, for example:
6312 MyDelegate d = delegate {
6317 Here `a' will be recorded as captured on the toplevel
6318 CapturedContext, the inner captured context will not have anything
6319 (it will only have data if local variables or parameters from it
6320 are captured in a nested anonymous method.
6322 The ScopeInfo is used to track the activation frames for local
6323 variables, for example:
6325 for (int i = 0; i < 10; i++)
6326 for (int j = 0; j < 10; j++){
6327 MyDelegate d = delegate {
6332 At runtime this captures a single captured variable `i', but it
6333 captures 10 different versions of the variable `j'. The variable
6334 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
6335 recorded on a child.
6337 The toplevel ScopeInfo will also track information like the `this'
6338 pointer if instance variables were referenced (this is necessary
6339 as the anonymous method lives inside a nested class in the host
6340 type of the method).
6342 (AnonymousMethod): Expanded to track the Toplevel, implement
6343 `AnonymousMethod.Compatible' to tell whether an anonymous method
6344 can be converted to a target delegate type.
6346 The routine now also produces the anonymous method content
6348 (AnonymousDelegate): A helper class that derives from
6349 DelegateCreation, this is used to generate the code necessary to
6350 produce the delegate for the anonymous method that was created.
6352 * assign.cs: API adjustments for new changes in
6353 Convert.ImplicitStandardConversionExists.
6355 * class.cs: Adjustments to cope with the fact that now toplevel
6356 blocks are of type `ToplevelBlock'.
6358 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
6359 insteda of standard blocks.
6361 Flag errors if params arguments are passed to anonymous methods.
6363 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
6364 `CurrentAnonymousMethod' which points to the current Anonymous
6365 Method. The variable points to the AnonymousMethod class that
6366 holds the code being compiled. It is set in the new EmitContext
6367 created for the anonymous method.
6369 (EmitContext.Phase): Introduce a variable and an enumeration to
6370 assist in enforcing some rules about when and where we are allowed
6371 to invoke certain methods (EmitContext.NeedsReturnLabel is the
6372 only one that enfonces this right now).
6374 (EmitContext.HaveCaptureInfo): new helper method that returns
6375 whether we have a CapturedContext initialized.
6377 (EmitContext.CaptureVariable): New method used to register that a
6378 LocalInfo must be flagged for capturing.
6380 (EmitContext.CapturedParameter): New method used to register that a
6381 parameters must be flagged for capturing.
6383 (EmitContext.CapturedField): New method used to register that a
6384 field must be flagged for capturing.
6386 (EmitContext.HaveCapturedVariables,
6387 EmitContext.HaveCapturedFields): Return whether there are captured
6388 variables or fields.
6390 (EmitContext.EmitMethodHostInstance): This is used to emit the
6391 instance for the anonymous method. The instance might be null
6392 (static methods), this (for anonymous methods that capture nothing
6393 and happen to live side-by-side with the current method body) or a
6394 more complicated expression if the method has a CaptureContext.
6396 (EmitContext.EmitTopBlock): Routine that drives the emission of
6397 code: it will first resolve the top block, then emit any metadata
6398 and then emit the code. The split is done so that we can extract
6399 any anonymous methods and flag any captured variables/parameters.
6401 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
6402 during this phase, the ILGenerator should not be used as labels
6403 and local variables declared here might not be accessible to any
6404 code that is part of an anonymous method.
6406 Exceptions to this include the temporary variables that are
6407 created by some statements internally for holding temporary
6410 (EmitContext.EmitMeta): New routine, in charge of emitting all the
6413 (EmitContext.TemporaryReturn): This method is typically called
6414 from the Emit phase, and its the only place where we allow the
6415 ReturnLabel to be defined other than the EmitMeta. The reason is
6416 that otherwise we would have to duplicate a lot of logic in the
6417 Resolve phases of various methods that today is on the Emit
6420 (EmitContext.NeedReturnLabel): This no longer creates the label,
6421 as the ILGenerator is not valid during the resolve phase.
6423 (EmitContext.EmitThis): Extended the knowledge in this class to
6424 work in anonymous methods in addition to iterators.
6426 (EmitContext.EmitCapturedVariableInstance): This emits whatever
6427 code is necessary on the stack to access the instance to a local
6428 variable (the variable will be accessed as a field).
6430 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
6431 EmitContext.EmitAddressOfParameter): Routines to support
6432 parameters (not completed at this point).
6434 Removals: Removed RemapLocal and RemapLocalLValue. We probably
6435 will also remove the parameters.
6437 * convert.cs (Convert): Define a `ConstantEC' which points to a
6438 null. This is just to prefity some code that uses
6439 ImplicitStandardConversion code and do not have an EmitContext
6442 The idea is to flag explicitly that at that point in time, it is
6443 known that the conversion will not trigger the delegate checking
6444 code in implicit conversions (which requires a valid
6447 Everywhere: pass new EmitContext parameter since
6448 ImplicitStandardConversionExists now requires it to check for
6449 anonymous method conversions.
6451 (Convert.ImplicitStandardConversionExists): If the type of an
6452 expression is the anonymous_method_type, and the type is a
6453 delegate, we invoke the AnonymousMethod.Compatible method to check
6454 whether an implicit conversion is possible.
6456 (Convert.ImplicitConversionStandard): Only do implicit method
6457 group conversions if the language level is not ISO_1.
6459 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
6460 MethodInfo for the Invoke method. used by Delegate and
6463 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
6464 method conversions if the target type is a delegate.
6466 Removed extra debugging nops.
6468 (LocalVariableReference): Turn the `local_info' into a public
6471 Add `prepared' field, the same hack used for FieldExprs to cope
6472 with composed assignments, as Local variables do not necessarily
6473 operate purely on the stack as they used to: they can be captured
6476 Add `temp' for a temporary result, like fields.
6478 Refactor DoResolve and DoResolveLValue into DoResolveBase.
6480 It now copes with Local variables that are captured and emits the
6481 proper instance variable to load it from a field in the captured
6484 (ParameterReference.DoResolveBase): During the resolve phase,
6485 capture parameters if we are in an anonymous method.
6487 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
6488 anonymous method, use the EmitContext helper routines to emit the
6489 parameter reference.
6491 * iterators.cs: Set RemapToProxy to true/false during the
6494 * parameters.cs (GetParameterByName): New helper method.
6496 * typemanager.cs (anonymous_method_type) a new type that
6497 represents an anonyous method. This is always an internal type,
6498 used as a fencepost to test against the anonymous-methodness of an
6501 2004-10-20 Marek Safar <marek.safar@seznam.cz>
6503 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
6505 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
6507 2004-10-18 Martin Baulig <martin@ximian.com>
6509 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
6510 `Type' directly, but call ResolveType() on it.
6511 (Catch.Resolve): Likewise.
6512 (Foreach.Resolve): Likewise.
6514 2004-10-18 Martin Baulig <martin@ximian.com>
6516 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
6517 `Type' directly, but call ResolveType() on it.
6518 (Probe.DoResolve): Likewise.
6519 (ArrayCreation.LookupType): Likewise.
6520 (TypeOf.DoResolve): Likewise.
6521 (SizeOf.DoResolve): Likewise.
6523 2004-10-18 Martin Baulig <martin@ximian.com>
6525 * expression.cs (Invocation.BetterFunction): Put back
6526 TypeManager.TypeToCoreType().
6528 2004-10-18 Raja R Harinath <rharinath@novell.com>
6530 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
6533 2004-10-18 Martin Baulig <martin@ximian.com>
6535 * parameter.cs (Parameter.Resolve): Don't access the TypeExpr's
6536 `Type' directly, but call ResolveType() on it.
6538 2004-10-18 Martin Baulig <martin@ximian.com>
6540 * class.cs (FieldMember.Define): Don't access the TypeExpr's
6541 `Type' directly, but call ResolveType() on it.
6542 (MemberBase.DoDefine): Likewise.
6544 * expression.cs (New.DoResolve): Don't access the TypeExpr's
6545 `Type' directly, but call ResolveType() on it.
6546 (ComposedCast.DoResolveAsTypeStep): Likewise.
6548 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
6549 `Type' directly, but call ResolveType() on it.
6551 2004-10-17 John Luke <john.luke@gmail.com>
6553 * class.cs (Operator.GetSignatureForError): use CSharpName
6555 * parameter.cs (Parameter.GetSignatureForError): Returns
6556 correct name even if was not defined.
6558 2004-10-13 Raja R Harinath <rharinath@novell.com>
6561 * class.cs (TypeContainer.EmitContext): New property.
6562 (DefineNestedTypes): Create an emitcontext for each part.
6563 (MethodCore.DoDefineParameters): Use container's emitcontext.
6564 Pass type array to InternalParameters.
6565 (MemberBase.DoDefine): Use container's emitcontext.
6566 (FieldMember.Define): Likewise.
6567 (Event.Define): Likewise.
6568 (SetMethod.GetParameterInfo): Change argument to EmitContext.
6569 Pass type array to InternalParameters.
6570 (SetIndexerMethod.GetParameterInfo): Likewise.
6571 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
6572 * delegate.cs (Define): Pass emitcontext to
6573 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
6574 array to InternalParameters.
6575 * expression.cs (ParameterReference.DoResolveBase): Pass
6576 emitcontext to GetParameterInfo.
6577 (ComposedCast.DoResolveAsTypeStep): Remove check on
6578 ec.ResolvingTypeTree.
6579 * parameter.cs (Parameter.Resolve): Change argument to
6580 EmitContext. Use ResolveAsTypeTerminal.
6581 (Parameter.GetSignature): Change argument to EmitContext.
6582 (Parameters.ComputeSignature): Likewise.
6583 (Parameters.ComputeParameterTypes): Likewise.
6584 (Parameters.GetParameterInfo): Likewise.
6585 (Parameters.ComputeAndDefineParameterTypes): Likewise.
6586 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
6587 * support.cs (InternalParameters..ctor): Remove variant that takes
6589 * typemanager.cs (system_intptr_expr): New.
6590 (InitExpressionTypes): Initialize it.
6592 2004-10-12 Chris Toshok <toshok@ximian.com>
6594 * cs-parser.jay: fix location for try_statement and catch_clause.
6596 2004-10-11 Martin Baulig <martin@ximian.com>
6598 * report.cs: Don't make --fatal abort on warnings, we have
6599 -warnaserror for that.
6601 2004-10-07 Raja R Harinath <rharinath@novell.com>
6603 More DeclSpace.ResolveType avoidance.
6604 * decl.cs (MemberCore.InUnsafe): New property.
6605 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
6606 with newly created EmitContext.
6607 (FieldMember.Define): Likewise.
6608 * delegate.cs (Delegate.Define): Likewise.
6609 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
6610 only if normal name-lookup fails.
6611 (TypeExpr.DoResolve): Enable error-checking.
6612 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
6613 (SizeOf.DoResolve): Likewise.
6614 (ComposedCast.DoResolveAsTypeStep): Likewise.
6615 (StackAlloc.DoResolve): Likewise.
6616 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
6617 (Block.Unsafe): New property.
6618 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
6619 (Unsafe): Set 'unsafe' flag of contained block.
6620 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
6621 (Fixed.Resolve): Likewise.
6622 (Catch.Resolve): Likewise.
6623 (Using.ResolveLocalVariableDecls): Likewise.
6624 (Foreach.Resolve): Likewise.
6626 2004-10-05 John Luke <john.luke@gmail.com>
6628 * cs-parser.jay: add location to error CS0175
6630 2004-10-04 Miguel de Icaza <miguel@ximian.com>
6632 * ecore.cs (Expression.Constantity): Add support for turning null
6635 * const.cs (Const.Define): Allow constants to be reference types
6636 as long as the value is Null.
6638 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
6640 * namespace.cs (NamespaceEntry.Using): No matter which warning
6641 level is set, check if this namespace name has already been added.
6643 2004-10-03 Ben Maurer <bmaurer@ximian.com>
6645 * expression.cs: reftype [!=]= null should always use br[true,false].
6648 2004-10-03 Marek Safar <marek.safar@seznam.cz>
6651 * attribute.cs: Enum conversion moved to
6652 GetAttributeArgumentExpression to be applied to the all
6655 2004-10-01 Raja R Harinath <rharinath@novell.com>
6657 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
6658 * class.c (TypeContainer.DefineType): Flag error if
6659 base types aren't accessible due to access permissions.
6660 * decl.cs (DeclSpace.ResolveType): Move logic to
6661 Expression.ResolveAsTypeTerminal.
6662 (DeclSpace.ResolveTypeExpr): Thin layer over
6663 Expression.ResolveAsTypeTerminal.
6664 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
6665 Refactor code into NestedAccess. Use it.
6666 (DeclSpace.NestedAccess): New.
6667 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
6668 argument to silence errors. Check access permissions.
6669 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
6670 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
6671 (Cast.DoResolve): Likewise.
6672 (New.DoResolve): Likewise.
6673 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
6674 (TypeOf.DoResolve): Likewise.
6676 * expression.cs (Invocation.BetterConversion): Return the Type of
6677 the better conversion. Implement section 14.4.2.3 more faithfully.
6678 (Invocation.BetterFunction): Make boolean. Make correspondence to
6679 section 14.4.2.2 explicit.
6680 (Invocation.OverloadResolve): Update.
6681 (Invocation): Remove is_base field.
6682 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
6683 (Invocation.Emit): Likewise.
6685 2004-09-27 Raja R Harinath <rharinath@novell.com>
6687 * README: Update to changes.
6689 2004-09-24 Marek Safar <marek.safar@seznam.cz>
6691 * cs-parser.jay: Reverted 642 warning fix.
6693 2004-09-23 Marek Safar <marek.safar@seznam.cz>
6696 * decl.cs (FindMemberWithSameName): Indexer can have more than
6699 2004-09-23 Marek Safar <marek.safar@seznam.cz>
6701 * expression.cs (LocalVariableReference.DoResolveLValue):
6702 Do not report warning 219 for out values.
6703 (EmptyExpression.Null): New member to avoid extra allocations.
6705 2004-09-23 Marek Safar <marek.safar@seznam.cz>
6707 * cs-parser.jay: Fix wrong warning 642 report.
6709 * cs-tokenizer.cs (CheckNextToken): New helper;
6710 Inspect next character if is same as expected.
6712 2004-09-23 Martin Baulig <martin@ximian.com>
6714 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
6715 (Convert.ImplicitReferenceConversionExists): Likewise.
6717 2004-09-23 Marek Safar <marek.safar@seznam.cz>
6719 * class.cs (Operator.Define): Add error 448 and 559 report.
6721 2004-09-22 Marek Safar <marek.safar@seznam.cz>
6723 * class.cs (MemberBase.IsTypePermitted): New protected
6724 method for checking error CS0610.
6726 2004-09-22 Marek Safar <marek.safar@seznam.cz>
6728 * class.cs (TypeContainer.HasExplicitLayout): New property
6729 Returns whether container has StructLayout attribute set Explicit.
6730 (FieldMember): New abstract class for consts and fields.
6731 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
6732 (Field): Reuse FieldMember.
6734 * const.cs (Const): Reuse FieldMember.
6736 * rootcontext.cs: EmitConstants call moved to class.
6738 2004-09-22 Martin Baulig <martin@ximian.com>
6740 Thanks to Peter Sestoft for this bug report.
6742 * expression.cs (Conditional): If both the `trueExpr' and the
6743 `falseExpr' is a NullLiteral, return a NullLiteral.
6745 2004-09-22 Martin Baulig <martin@ximian.com>
6747 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
6748 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
6749 for the "get_Current" call.
6751 2004-09-22 Martin Baulig <martin@ximian.com>
6753 Marek and me just fixed one of our oldest bugs: #28562 :-)
6755 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
6757 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
6758 we're an EnumConstant, just return that.
6759 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
6760 an EnumConstant. In this case, we need to use GetValueAsEnumType()
6761 to get the value which'll actually be written into the attribute.
6762 However, we have to use GetValue() to access the attribute's value
6765 2004-09-22 Marek Safar <marek.safar@seznam.cz>
6767 * constant.cs (Constant.IsNegative): New abstract property
6770 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
6771 (StackAlloc.DoResolve): Reused IsNegative.
6773 2004-09-21 Martin Baulig <martin@ximian.com>
6775 * codegen.cs (VariableStorage): Don't store the ILGenerator here;
6776 if we're used in an iterator, we may be called from different
6779 * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
6780 we actually have an exception block.
6782 2004-09-20 John Luke <jluke@cfl.rr.com>
6784 * class.cs, cs-parser.jay: Improve the error report for 1520:
6785 report the actual line where the error happens, not where the
6788 * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
6789 Pass location information that was available elsewhere.
6791 2004-09-19 Sebastien Pouliot <sebastien@ximian.com>
6793 * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
6794 runtime to delay sign assemblies.
6796 2004-09-19 Miguel de Icaza <miguel@ximian.com>
6798 * cs-parser.jay: Do not report the stack trace, this is barely
6801 2004-08-22 John Luke <john.luke@gmail.com>
6803 * driver.cs : check that a resource id is not already used
6804 before adding it, report CS1508 if it is, bug #63637
6806 2004-09-19 Miguel de Icaza <miguel@ximian.com>
6808 * ecore.cs: Removed dead code.
6810 2004-09-18 Marek Safar <marek.safar@seznam.cz>
6812 * class.cs: Do not report warning CS0067 on the interfaces.
6814 2004-09-16 Marek Safar <marek.safar@seznam.cz>
6816 * cs-parser.jay: Add error 504 report.
6818 2004-09-16 Marek Safar <marek.safar@seznam.cz>
6820 * rootcontext.cs: WarningLevel is 4 by default now.
6822 * statement.cs (Fixed.Resolve): Do not null
6825 2004-09-16 Marek Safar <marek.safar@seznam.cz>
6828 * ecore.cs (PropertyExpr.FindAccessors): Do not perform
6829 deep search when property is not virtual.
6830 (PropertyExpr.ResolveAccessors): Make one call for both
6833 2004-09-15 Marek Safar <marek.safar@seznam.cz>
6836 * statement.cs: Error 152 report constains also location.
6838 2004-09-15 Marek Safar <marek.safar@seznam.cz>
6841 * const.cs: Explicitly set constant as static.
6843 2004-09-15 Marek Safar <marek.safar@seznam.cz>
6846 * cs-parser.jay: Add error 1017 report.
6848 2004-09-15 Marek Safar <marek.safar@seznam.cz>
6850 Fixed bug #59980, #64224
6851 * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
6853 * typemanager.cs (IsSpecialMethod): Simplified
6855 2004-09-14 Marek Safar <marek.safar@seznam.cz>
6857 * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
6858 condition with better params.
6860 2004-09-14 Marek Safar <marek.safar@seznam.cz>
6863 * attribute.cs (Resolve): Property has to have both
6866 2004-09-14 Martin Baulig <martin@ximian.com>
6868 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
6870 2004-09-14 Marek Safar <marek.safar@seznam.cz>
6873 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
6874 called and is obsolete then this member suppress message
6875 when call is inside next [Obsolete] method or type.
6877 * expression.cs: Use TestObsoleteMethodUsage member.
6879 2004-09-14 Martin Baulig <martin@ximian.com>
6881 * cs-parser.jay: Sync a bit with the GMCS version.
6883 2004-09-14 Martin Baulig <martin@ximian.com>
6885 * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
6886 (CSharpParser.yacc_verbose_flag): New public field.
6888 * genericparser.cs: Removed.
6890 2004-09-14 Raja R Harinath <rharinath@novell.com>
6892 * cs-parser.jay (event_declaration): Re-enable cs0071 error.
6894 2004-09-13 Marek Safar <marek.safar@seznam.cz>
6896 * class.cs (MethodCore.CheckBase): Fix bug #65757.
6898 2004-09-10 Martin Baulig <martin@ximian.com>
6900 Backported my MemberName changes from GMCS into MCS.
6902 - we are now using a special `MemberName' class instead of using
6903 strings; in GMCS, the `MemberName' also contains the type
6906 - changed the grammar rules a bit:
6907 * the old `member_name' is now a `namespace_or_type_name':
6908 The rule is that we use `namespace_or_type_name' everywhere
6909 where we expect either a "member name" (GetEnumerator) or a
6910 "member name" with an explicit interface name
6911 (IEnumerable.GetEnumerator).
6912 In GMCS, the explicit interface name may include type arguments
6913 (IEnumerable<T>.GetEnumerator).
6914 * we use `member_name' instead of just `IDENTIFIER' for
6916 The rule is that we use `member_name' wherever a member may
6917 have type parameters in GMCS.
6919 * decl.cs (MemberName): New public class.
6920 (MemberCore.MemberName): New public readonly field.
6921 (MemberCore.ctor): Take a `MemberName' argument, not a string.
6922 (DeclSpace): Likewise.
6924 * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
6925 * enum.cs (Enum.ctor): Likewise.
6927 * namespace.cs (AliasEntry.Alias): Changed type from Expression to
6929 (AliasEntry.ctor): Take a MemberName, not an Expression.
6930 (AliasEntry.UsingAlias): Likewise.
6932 * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
6933 (IMethodData.MemberName): Changed type from string to MemberName.
6934 (MemberBase.ExplicitInterfaceName): Likewise.
6935 (AbstractPropertyEventMethod.SetupName): Make this private.
6936 (AbstractPropertyEventMethod.ctor): Added `string prefix'
6937 argument; compute the member name here.
6938 (AbstractPropertyEventMethod.UpdateName): Recompute the name based
6939 on the `member.MemberName' and the `prefix'.
6941 * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
6943 (struct_declaration): Use `member_name' instead of `IDENTIFIER';
6944 thus, we get a `MemberName' instead of a `string'. These
6945 declarations may have type parameters in GMCS.
6946 (interface_method_declaration, delegate_declaration): Likewise.
6947 (class_declaration, interface_declaration): Likewise.
6948 (method_header): Use `namespace_or_type_name' instead of
6949 `member_name'. We may be an explicit interface implementation.
6950 (property_declaration, event_declaration): Likewise.
6951 (member_name): This is now just an `IDENTIFIER', not a
6952 `namespace_or_type_name'.
6953 (type_name, interface_type): Removed.
6954 (namespace_or_type_name): Return a MemberName, not an Expression.
6955 (primary_expression): Use `member_name' instead of `IDENTIFIER';
6956 call GetTypeExpression() on the MemberName to get an expression.
6957 (IndexerDeclaration.interface_type): Changed type from string to
6959 (MakeName): Operate on MemberName's instead of string's.
6961 2004-09-13 Raja R Harinath <rharinath@novell.com>
6964 * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
6965 (NamespaceEntry.Lookup): Add new argument to flag if we want the
6966 lookup to avoid symbols introduced by 'using'.
6967 * rootcontext.cs (NamespaceLookup): Update.
6969 2004-09-12 Marek Safar <marek.safar@seznam.cz>
6971 * class.cs (TypeContainer.DoDefineMembers): Do not call
6972 DefineDefaultConstructor for static classes.
6974 2004-09-12 Marek Safar <marek.safar@seznam.cz>
6976 * attribute.cs (Attribute.Resolve): Add error 653 report.
6978 * class.cs (Class.ApplyAttributeBuilder): Add error 641
6980 (Method.ApplyAttributeBuilder): Add error 685 report.
6981 (Operator.Define): Add error 564 report.
6983 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
6985 * expression.cs (Invocation.DoResolve): Add error
6988 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
6991 2004-09-11 Marek Safar <marek.safar@seznam.cz>
6993 * class.cs (ConstructorInitializer.Resolve):
6994 Wrong error number (515->516).
6996 2004-09-11 Marek Safar <marek.safar@seznam.cz>
6998 * class.cs (Indexer.Define): Add error 631 report.
7000 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7002 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7004 2004-09-11 Marek Safar <marek.safar@seznam.cz>
7006 * expression.cs (Probe.DoResolve): Add error CS0241 report.
7008 2004-09-10 Marek Safar <marek.safar@seznam.cz>
7010 * cs-parser.jay: Added error CS0241 report.
7012 2004-09-10 Raja R Harinath <rharinath@novell.com>
7014 * cs-parser.jay (fixed_statement): Introduce a scope for the
7015 declaration in the 'fixed' statement.
7017 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7019 * cs-parser.jay: Added CS0230 error report.
7021 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7023 * cs-parser.jay: Added errors CS0231 and CS0257 report.
7025 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7027 * expression.cs (Argument.Resolve): Added error CS0192 and
7030 2004-09-09 Marek Safar <marek.safar@seznam.cz>
7032 C# 2.0 #pragma warning feature
7034 * cs-tokenizer.cs (PreProcessPragma): New method;
7035 Handles #pragma directive.
7037 * report.cs (WarningRegions): New class; Support
7038 class for #pragma warning directive. It tests whether
7039 warning is enabled for a given line.
7041 2004-09-08 Miguel de Icaza <miguel@ximian.com>
7043 * const.cs: Add more descriptive error report, tahnks to
7046 2004-09-08 Marek Safar <marek.safar@seznam.cz>
7048 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7050 2004-09-07 Miguel de Icaza <miguel@ximian.com>
7052 * expression.cs: Apply patch from Ben: Remove dead code from
7053 ArrayCreation, and remove the TurnintoConstant call in const.cs,
7054 as that code just threw an exception anwyays.
7056 * const.cs: Remove the call to the turnintoconstant, for details
7059 * literal.cs: The type of the null-literal is the null type; So
7060 we use a placeholder type (literal.cs:System.Null, defined here)
7063 * expression.cs (Conditional.DoResolve): Remove some old code that
7064 is no longer needed, conversions have been fixed.
7066 (ArrayCreationExpression.DoResolve): Return false if we fail to
7067 resolve the inner expression.
7069 2004-09-07 Raja R Harinath <rharinath@novell.com>
7072 * cs-parser.jay (delegate_declaration): Record a delegate
7073 declaration as a type declaration.
7074 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7076 2004-09-06 Miguel de Icaza <miguel@ximian.com>
7078 * parameter.cs: Do not crash if the type can not be resolved.
7080 * expression.cs: Report errors with unsafe pointers, fixes #64896
7082 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
7084 * expression.cs: Pointer arith always needs to do a conv.i
7085 if the operand is a long. fix 65320
7087 2004-09-04 Marek Safar <marek.safar@seznam.cz>
7089 Fixed cs0619-37.cs, cs0619-38.cs
7091 * enum.cs (GetObsoleteAttribute): Removed.
7093 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7094 on Enum member is double staged. The first is tested member
7097 2004-09-04 Marek Safar <marek.safar@seznam.cz>
7099 Fixed #56986, #63631, #65231
7101 * class.cs: (TypeContainer.AddToMemberContainer): New method,
7102 adds member to name container.
7103 (TypeContainer.AddToTypeContainer): New method, adds type to
7105 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
7106 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
7107 AddOperator): Simplified by reusing AddToMemberContainer.
7108 (TypeContainer.UserDefinedStaticConstructor): Changed to property
7110 (Method.CheckForDuplications): Fixed implementation to test all
7112 (MemberBase): Detection whether member is explicit interface
7113 implementation is now in constructor.
7114 (MemberBase.UpdateMemberName): Handles IndexerName.
7115 (Accessor): Changed to keep also location information.
7116 (AbstractPropertyEventMethod): Is derived from MemberCore.
7117 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
7118 will be emited or not.
7119 (PropertyBase.AreAccessorsDuplicateImplementation):
7120 Tests whether accessors are not in collision with some method.
7121 (Operator): Is derived from MethodCore to simplify common
7124 * decl.cs (Flags.TestMethodDuplication): Test for duplication
7126 (DeclSpace.AddToContainer): Adds the member to defined_names
7127 table. It tests for duplications and enclosing name conflicts.
7129 * enum.cs (EnumMember): Clean up to reuse the base structures
7131 2004-09-03 Martin Baulig <martin@ximian.com>
7133 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7134 into TypeContainer, to make partial classes work again.
7136 2004-09-03 Martin Baulig <martin@ximian.com>
7138 * rootcontext.cs (RootContext.V2): Removed.
7140 2004-03-23 Martin Baulig <martin@ximian.com>
7142 * expression.cs (Invocation.OverloadResolve): Added `bool
7143 may_fail' argument and use it instead of the Location.IsNull() hack.
7145 2004-09-03 Martin Baulig <martin@ximian.com>
7147 Merged latest changes into gmcs. Please keep this comment in
7148 here, it makes it easier for me to see what changed in MCS since
7149 the last time I merged.
7151 2004-09-03 Raja R Harinath <rharinath@novell.com>
7154 * expression.cs (BetterConversion): Don't allow either conversion
7155 to be null. Remove redundant implicit conversion test when 'q ==
7156 null' -- when this function is invoked, we already know that the
7157 implicit conversion exists.
7158 (BetterFunction): Assume that 'best' is non-null. Remove
7159 redundant reimplementation of IsApplicable when 'best' is null.
7160 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
7161 number of arguments.
7162 (IsAncestralType): Extract from OverloadResolve.
7163 (OverloadResolve): Make robust to the MethodGroupExpr being
7164 unsorted. Implement all the logic of Section 14.5.5.1, and
7165 support overloading of methods from multiple applicable types.
7166 Clean up logic somewhat. Don't pass null methods to BetterFunction.
7168 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
7169 (RealError, Warning): Append type of report to related symbol.
7171 2004-09-03 Marek Safar <marek.safar@seznam.cz>
7173 * enum.cs: Fixed CLS-Compliance checks for enum members.
7174 Error tests cs3008-8.cs, cs3014-8.cs
7176 2004-09-02 Marek Safar <marek.safar@seznam.cz>
7178 Fixed bug #62342, #63102
7179 * class.cs: ImplementIndexer uses member.IsExplicitImpl
7180 like ImplementMethod.
7182 2004-09-02 Marek Safar <marek.safar@seznam.cz>
7184 * attribute.cs (Attribute.GetAttributeArgumentExpression):
7187 2004-09-02 Martin Baulig <martin@ximian.com>
7189 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7190 TypeManager.GetArgumentTypes() rather than calling GetParameters()
7193 2004-09-01 Marek Safar <marek.safar@seznam.cz>
7195 C# 2.0 Static classes implemented
7197 * class.cs (TypeContainer): instance_constructors,
7198 initialized_fields, initialized_static_fields,
7199 default_constructor, base_inteface_types are protected to be
7200 accessible from StaticClass.
7201 (TypeContainer.DefineDefaultConstructor): New virtual method
7202 for custom default constructor generating
7203 (StaticClass): New class to handle "Static classes" feature.
7205 * cs-parser.jay: Handle static keyword on class like instance
7208 * driver.cs: Added "/langversion" command line switch with two
7209 options (iso-1, default).
7211 2004-08-31 Marek Safar <marek.safar@seznam.cz>
7213 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
7215 2004-08-31 Miguel de Icaza <miguel@ximian.com>
7217 * delegate.cs: Style.
7219 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
7221 * delegate.cs: Add seperate instance expr field for miguel.
7223 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
7225 * PointerArithmetic (Resolve): make sure we are not doing
7226 pointer arith on void*. Also, make sure we are resolved
7227 by not setting eclass until resolve.
7229 All callers: Make sure that PointerArithmetic gets resolved.
7231 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
7233 * ArrayCreation (LookupType): If the type does not resolve
7234 to an array, give an error.
7236 2004-08-27 Marek Safar <marek.safar@seznam.cz>
7238 * statement.cs (Try.Resolve): Fixed bug #64222
7240 2004-08-27 Martin Baulig <martin@ximian.com>
7243 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7246 2004-08-26 Marek Safar <marek.safar@seznam.cz>
7248 * ecore.cs (Constantify): Get underlying type via
7249 System.Enum.GetUnderlyingType to avoid StackOverflow on the
7250 Windows in special cases.
7252 2004-08-26 Marek Safar <marek.safar@seznam.cz>
7254 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
7255 for obtaining also private methods.
7256 (GetRemoveMethod): Used GetRemoveMethod (true)
7257 for obtaining also private methods.
7259 2004-08-24 Martin Baulig <martin@ximian.com>
7261 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
7262 MethodAttributes.HideBySig for operators.
7264 2004-08-23 Martin Baulig <martin@ximian.com>
7266 Back to the old error reporting system :-)
7268 * report.cs (Message): Removed.
7269 (Report.MessageData, ErrorData, WarningData): Removed.
7270 (Report.Error, Warning): Back to the old system.
7272 2004-08-23 Martin Baulig <martin@ximian.com>
7274 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
7276 * class.cs (TypeContainer.ParentContainer): New public virtual
7277 method; replaces the explicit interface implementation.
7278 (ClassPart.ParentContainer): Override.
7280 2004-08-23 Martin Baulig <martin@ximian.com>
7282 * statement.cs (Switch): Added support for constant switches; see
7283 #59428 or test-285.cs.
7285 2004-08-22 Marek Safar <marek.safar@seznam.cz>
7288 * statement.cs (GetEnumeratorFilter): Removed useless
7289 logic because C# specs is strict. GetEnumerator must be
7292 2004-08-22 Martin Baulig <martin@ximian.com>
7294 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7295 a switch and may break, reset the barrier. Fixes #59867.
7297 2004-08-22 Marek Safar <marek.safar@seznam.cz>
7299 CLS-Compliance speed up (~5% for corlib)
7301 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
7302 New method. Tests container for CLS-Compliant names
7304 * class.cs (TypeContainer.VerifyClsName): New method.
7305 Checks whether container name is CLS Compliant.
7306 (Constructor): Implements IMethodData.
7308 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
7309 low-case table for CLS Compliance test.
7310 (MemberCache.VerifyClsParameterConflict): New method.
7311 Checks method parameters for CS3006 error.
7313 * enum.cs (EnumMember): Is derived from MemberCore.
7314 (Enum.VerifyClsName): Optimized for better performance.
7316 2004-08-06 Marek Safar <marek.safar@seznam.cz>
7318 * report.cs: Renamed Error_T to Error and changed all
7321 2004-08-06 Marek Safar <marek.safar@seznam.cz>
7323 * class.cs (TypeContainer.IndexerArrayList): New inner class
7324 container for indexers.
7325 (TypeContainer.DefaultIndexerName): New constant for default
7326 indexer name. Replaced all "Item" with this constant.
7327 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
7329 * typemanager.cs (TypeManager.default_member_ctor): Cache here
7330 DefaultMemberAttribute constructor.
7332 2004-08-05 Martin Baulig <martin@ximian.com>
7334 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
7337 2004-08-05 Marek Safar <marek.safar@seznam.cz>
7339 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
7340 multi platforms problem.
7342 * compiler.csproj: Included shared files.
7344 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7346 Fix bug 60333, 55971 in the more general way
7347 * attribute.cs (Attribute.GetAttributeArgumentExpression):
7348 Added arg_type argument for constant conversion.
7349 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
7351 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7354 * class.cs (TypeContainer ): New inner classes MethodArrayList,
7355 OperatorArrayList, MethodCoreArrayList for typecontainer
7356 containers. Changed class member types to these new types.
7357 (MethodArrayList.DefineMembers): Added test for CS0659.
7359 2004-08-04 Miguel de Icaza <miguel@ximian.com>
7361 * cfold.cs: Synchronize the folding with the code in expression.cs
7362 Binary.DoNumericPromotions for uint operands.
7364 * attribute.cs: Revert patch from Raja, it introduced a regression
7365 while building Blam-1.2.1 (hard to isolate a test case).
7367 2004-08-04 Marek Safar <marek.safar@seznam.cz>
7371 (TypeContainer.Define): Renamed to DefineContainerMembers because of
7373 (MethodCore.parent_method): New member. The method we're overriding
7374 if this is an override method.
7375 (MethodCore.CheckBase): Moved from Method class and made common.
7376 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
7378 (MethodCore.CheckForDuplications): New abstract method. For custom
7379 member duplication search in a container
7380 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
7381 method and its return type.
7382 (Event.conflict_symbol): New member. Symbol with same name in the
7386 (MemberCache.FindMemberWithSameName): New method. The method
7387 is looking for conflict with inherited symbols.
7389 2004-08-04 Martin Baulig <martin@ximian.com>
7391 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7393 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7395 2004-08-03 Marek Safar <marek.safar@seznam.cz>
7397 * report.cs (Message): New enum for better error, warning reference in
7399 (MessageData): New inner abstract class. It generally handles printing of
7400 error and warning messages.
7401 Removed unused Error, Warning, Message methods.
7403 2004-08-03 Marek Safar <marek.safar@seznam.cz>
7405 Fix for cs0592-8.cs test
7407 (Attributable.ValidAttributeTargets): Made public.
7408 (Attribute.ExplicitTarget): New member for explicit target value.
7409 (Attribute.CheckTargets): Now we translate explicit attribute
7410 target to Target here.
7412 2004-08-03 Ben Maurer <bmaurer@ximian.com>
7414 * ecore.cs (MethodGroupExpr): new IsBase property.
7416 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
7418 * delegate.cs (DelegateCreation): store a MethodGroupExpr
7419 rather than an instance expr.
7421 (DelegateCreation.Emit): Use the method group rather than
7422 the instance expression. Also, if you have base.Foo as the
7423 method for a delegate, make sure to emit ldftn, not ldftnvirt.
7425 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
7427 (NewDelegate.DoResolve): Only check for the existance of Invoke
7428 if the method is going to be needed. Use MethodGroupExpr.
7430 (NewDelegate.Emit): Remove, DelegateCreation implements this.
7432 * expression.cs: For pointer arith., make sure to use
7433 the size of the type, not the size of the pointer to
7436 2004-08-03 Marek Safar <marek.safar@seznam.cz>
7439 * class.cs (Class): Added error CS0502 test.
7441 2004-08-03 John Luke <jluke@cfl.rr.com>
7442 Raja R Harinath <rharinath@novell.com>
7445 * attribute.cs (Attribute.complained_before): New flag.
7446 (Attribute.ResolveType, Attribute.Resolve),
7447 (Attribute.DefinePInvokeMethod): Set it.
7448 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
7450 2004-08-03 Martin Baulig <martin@ximian.com>
7452 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
7453 use a user-defined operator; we still need to do numeric
7454 promotions in case one argument is a builtin type and the other
7455 one has an implicit conversion to that type. Fixes #62322.
7457 2004-08-02 Martin Baulig <martin@ximian.com>
7459 * statement.cs (LocalInfo.Flags): Added `IsThis'.
7460 (LocalInfo.IsThis): New public property.
7461 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
7463 2004-08-01 Martin Baulig <martin@ximian.com>
7465 * class.cs (TypeContainer.GetClassBases): Don't set the default
7466 here since we may get called from GetPartialBases().
7467 (TypeContainer.DefineType): If GetClassBases() didn't return a
7468 parent, use the default one.
7470 2004-07-30 Duncan Mak <duncan@ximian.com>
7472 * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
7474 2004-07-30 Martin Baulig <martin@ximian.com>
7476 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
7478 * class.cs (SourceMethod): New public class, derive from the
7479 symbol writer's ISourceMethod.
7480 (Method): Use the new symbol writer API.
7482 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
7483 as argument and use the new symbol writer.
7486 (SourceFile): Implement the symbol writer's ISourceFile.
7487 (Location.SymbolDocument): Removed.
7488 (Location.SourceFile): New public property.
7490 * symbolwriter.cs: Use the new symbol writer API.
7492 2004-07-30 Raja R Harinath <rharinath@novell.com>
7494 * Makefile (install-local): Remove. Functionality moved to
7497 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
7499 * Makefile: Install mcs.exe.config file together with mcs.exe.
7500 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
7501 correct runtime version.
7503 2004-07-25 Martin Baulig <martin@ximian.com>
7506 (TypeContainer.RegisterOrder): Removed, this was unused.
7507 (TypeContainer, interface_order): Removed.
7508 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
7509 TypeContainer as argument since we can also be called with a
7510 `PartialContainer' for a partial class/struct/interface.
7511 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
7512 of checking whether we're an `Interface' - we could be a
7514 (PartialContainer.Register): Override; call
7515 AddClass()/AddStruct()/AddInterface() on our parent.
7517 * cs-parser.jay (interface_member_declaration): Add things to the
7518 `current_container', not the `current_class'.
7520 * rootcontext.cs (RegisterOrder): The overloaded version which
7521 takes an `Interface' was unused, removed.
7523 * typemanager.cs (TypeManager.LookupInterface): Return a
7524 `TypeContainer', not an `Interface'.
7525 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
7526 contain a `PartialContainer' for an interface, so check it's
7527 `Kind' to figure out what it is.
7529 2004-07-25 Martin Baulig <martin@ximian.com>
7531 * class.cs (Class.DefaultTypeAttributes): New public constant.
7532 (Struct.DefaultTypeAttributes): Likewise.
7533 (Interface.DefaultTypeAttributes): Likewise.
7534 (PartialContainer.TypeAttr): Override this and add the
7535 DefaultTypeAttributes.
7537 2004-07-25 Martin Baulig <martin@ximian.com>
7539 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
7540 we can just use the `Parent' field instead.
7542 2004-07-25 Martin Baulig <martin@ximian.com>
7544 * class.cs (TypeContainer.Emit): Renamed to EmitType().
7546 2004-07-25 Martin Baulig <martin@ximian.com>
7548 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
7549 our parts before defining any methods.
7550 (TypeContainer.VerifyImplements): Make this virtual.
7551 (ClassPart.VerifyImplements): Override and call VerifyImplements()
7552 on our PartialContainer.
7554 2004-07-25 Martin Baulig <martin@ximian.com>
7556 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
7558 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
7559 argument, we can just use the `Parent' field instead.
7562 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
7563 (MemberBase.DoDefine): Likewise.
7565 2004-07-24 Martin Baulig <martin@ximian.com>
7567 * decl.cs (MemberCore.Parent): New public field.
7568 (DeclSpace.Parent): Moved to MemberCore.
7570 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
7571 (MemberBase.ctor): Added TypeContainer argument, pass it to our
7573 (FieldBase, Field, Operator): Likewise.
7574 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
7575 (EventField, Event): Likewise.
7577 2004-07-23 Martin Baulig <martin@ximian.com>
7579 * class.cs (PartialContainer): New public class.
7580 (ClassPart): New public class.
7581 (TypeContainer): Added support for partial classes.
7582 (TypeContainer.GetClassBases): Splitted some of the functionality
7583 out into GetNormalBases() and GetPartialBases().
7585 * cs-tokenizer.cs (Token.PARTIAL): New token.
7586 (Tokenizer.consume_identifier): Added some hacks to recognize
7587 `partial', but only if it's immediately followed by `class',
7588 `struct' or `interface'.
7590 * cs-parser.jay: Added support for partial clases.
7592 2004-07-23 Martin Baulig <martin@ximian.com>
7594 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
7595 a `DeclSpace' and also made it readonly.
7596 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
7597 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
7598 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
7600 * cs-parser.jay: Pass the `current_class', not the
7601 `current_container' (at the moment, this is still the same thing)
7602 to a new Method, Property, Event, Indexer or Constructor.
7604 2004-07-23 Martin Baulig <martin@ximian.com>
7606 * cs-parser.jay (CSharpParser): Added a new `current_class' field
7607 and removed the `current_interface' one.
7608 (struct_declaration, class_declaration, interface_declaration):
7609 Set `current_class' to the newly created class/struct/interface;
7610 set their `Bases' and call Register() before parsing their body.
7612 2004-07-23 Martin Baulig <martin@ximian.com>
7614 * class.cs (Kind): New public enum.
7615 (TypeContainer): Made this class abstract.
7616 (TypeContainer.Kind): New public readonly field.
7617 (TypeContainer.CheckDef): New public method; moved here from
7619 (TypeContainer.Register): New public abstract method.
7620 (TypeContainer.GetPendingImplementations): New public abstract
7622 (TypeContainer.GetClassBases): Removed the `is_class' and
7623 `is_iface' parameters.
7624 (TypeContainer.DefineNestedTypes): Formerly known as
7626 (ClassOrStruct): Made this class abstract.
7628 * tree.cs (RootTypes): New public type.
7630 2004-07-20 Martin Baulig <martin@ximian.com>
7632 * tree.cs (Tree.RecordNamespace): Removed.
7633 (Tree.Namespaces): Removed.
7635 * rootcontext.cs (RootContext.IsNamespace): Removed.
7637 * cs-parser.jay (namespace_declaration): Just create a new
7638 NamespaceEntry here.
7640 2004-07-20 Martin Baulig <martin@ximian.com>
7642 * statement.cs (ExceptionStatement): New abstract class. This is
7643 now used as a base class for everyone who's using `finally'.
7644 (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
7645 our local variables before using them.
7647 * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
7648 virtual method. This is used by Yield.Resolve() to "steal" an
7649 outer block's `finally' clauses.
7650 (FlowBranchingException): The .ctor now takes an ExceptionStatement
7653 * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
7654 version which takes an ExceptionStatement. This version must be
7655 used to create exception branchings.
7658 (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
7659 (Iterator.EmitMoveNext): Added exception support; protect the
7660 block with a `fault' clause, properly handle 'finally' clauses.
7661 (Iterator.EmitDispose): Run all the `finally' clauses here.
7663 2004-07-20 Martin Baulig <martin@ximian.com>
7665 * iterator.cs: This is the first of a set of changes in the
7666 iterator code. Match the spec more closely: if we're an
7667 IEnumerable, then GetEnumerator() must be called. The first time
7668 GetEnumerator() is called, it returns the current instance; all
7669 subsequent invocations (if any) must create a copy.
7671 2004-07-19 Miguel de Icaza <miguel@ximian.com>
7673 * expression.cs: Resolve the constant expression before returning
7676 2004-07-19 Martin Baulig <martin@ximian.com>
7678 * iterators.cs (Iterator.MapVariable): Don't define fields twice.
7679 (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
7680 the return type of the new EmitContext.
7682 2004-07-18 Martin Baulig <martin@ximian.com>
7684 * class.cs (Property.Define): Fix iterators.
7686 * iterators.cs (Iterator.Define): Moved the
7687 `container.AddInterator (this)' call here from the .ctor; only do
7688 it if we resolved successfully.
7690 2004-07-17 Miguel de Icaza <miguel@ximian.com>
7692 * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
7693 `true' for preprocessing directives that we parse. The return
7694 value indicates whether we should return to regular tokenizing or
7695 not, not whether it was parsed successfully.
7697 In the past if we were in: #if false ... #line #endif, we would
7698 resume parsing after `#line'. See bug 61604.
7700 * typemanager.cs: Removed an old hack from Gonzalo to get corlib
7701 building: IsEnumType should return true only for enums, not for
7702 enums or System.Enum itself. This fixes #61593.
7704 Likely what happened is that corlib was wrong: mcs depended on
7705 this bug in some places. The bug got fixed, we had to add the
7706 hack, which caused bug 61593.
7708 * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
7709 that was a workaround for the older conditions.
7711 2004-07-16 Ben Maurer <bmaurer@ximian.com>
7713 * assign.cs: IAssignMethod has a new interface, as documented
7714 inline. All assignment code now uses this new api.
7716 * ecore.cs, expression.cs: All classes which implement
7717 IAssignMethod now use the new interface.
7719 * expression.cs (Invocation): add a hack to EmitCall so that
7720 IndexerAccess can be the target of a compound assignment without
7721 evaluating its arguments twice.
7723 * statement.cs: Handle changes in Invocation api.
7725 2004-07-16 Martin Baulig <martin@ximian.com>
7727 * iterators.cs: Rewrote this. We're now using one single Proxy
7728 class for both the IEnumerable and the IEnumerator interface and
7729 `Iterator' derives from Class so we can use the high-level API.
7731 * class.cs (TypeContainer.AddIterator): New method.
7732 (TypeContainer.DoDefineType): New protected virtual method, which
7733 is called from DefineType().
7734 (TypeContainer.DoDefineMembers): Call DefineType() and
7735 DefineMembers() on all our iterators.
7736 (TypeContainer.Emit): Call Emit() on all our iterators.
7737 (TypeContainer.CloseType): Call CloseType() on all our iterators.
7739 * codegen.cs (EmitContext.CurrentIterator): New public field.
7741 2004-07-15 Martin Baulig <martin@ximian.com>
7744 (TypeManager.not_supported_exception_type): New type.
7746 2004-07-14 Martin Baulig <martin@ximian.com>
7748 * iterators.cs: Use real error numbers.
7750 2004-07-14 Martin Baulig <martin@ximian.com>
7752 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
7753 requires this to be a System.Collection.IEnumerable and not a
7754 class implementing that interface.
7755 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
7757 2004-07-13 Marek Safar <marek.safar@seznam.cz>
7759 * class.cs: Fixed previous fix, it broke some error tests.
7761 2004-07-12 Martin Baulig <martin@ximian.com>
7763 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
7766 2004-07-09 Miguel de Icaza <miguel@ximian.com>
7768 * assign.cs (LocalTemporary): Add new argument: is_address,If
7769 `is_address' is true, then the value that we store is the address
7770 to the real value, and not the value itself.
7772 * ecore.cs (PropertyExpr): use the new local temporary
7773 stuff to allow us to handle X.Y += z (where X is a struct)
7775 2004-07-08 Martin Baulig <martin@ximian.com>
7777 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
7778 not always return, just like we're doing in Using.Resolve().
7780 2004-07-07 Miguel de Icaza <miguel@ximian.com>
7782 * cs-parser.jay (fixed_statement): flag this as Pinned.
7784 2004-07-06 Miguel de Icaza <miguel@ximian.com>
7786 * typemanager.cs (TypeManager): Removed MakePinned method, this
7787 mechanism is replaced with the .NET 2.x compatible mechanism of
7788 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
7790 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
7791 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
7792 `IsFixed' property which has a different meaning.
7794 2004-07-02 Raja R Harinath <rharinath@novell.com>
7796 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
7797 visible from inside a nested class, not just the names of the
7798 immediately enclosing class.
7801 2004-06-24 Raja R Harinath <rharinath@novell.com>
7803 * expression.cs (BetterConversion): Remove buggy special-case
7804 handling of "implicit constant expression conversions". At this
7805 point, we already know that the conversion is possible -- we're
7806 only checking to see which is better.
7808 2004-06-24 Marek Safar <marek.safar@seznam.cz>
7810 * cs-parser.jay: Added error CS0210 test.
7812 2004-06-24 Marek Safar <marek.safar@seznam.cz>
7814 * cs-parser.jay: Added error CS0134 test.
7816 2004-06-24 Marek Safar <marek.safar@seznam.cz>
7819 * cs-parser.jay: Added error CS0145 test.
7821 2004-06-24 Marek Safar <marek.safar@seznam.cz>
7823 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
7825 2004-06-23 Ben Maurer <bmaurer@ximian.com>
7827 * expression.cs (StackAlloc.Resolve): The argument may not
7828 be a constant; deal with this case.
7830 2004-06-23 Marek Safar <marek.safar@seznam.cz>
7832 * attribute.cs (IndexerName_GetIndexerName): Renamed to
7833 GetIndexerAttributeValue.
7834 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
7836 * class.cs (Indexer.Define): Added error tests for CS0415,
7839 2004-06-23 Miguel de Icaza <miguel@ximian.com>
7841 * attribute.cs (Attribute.Resolve): Keep field code in sync with
7844 2004-06-23 Martin Baulig <martin@ximian.com>
7846 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
7847 neither return nor throw, reset the barrier as well. Fixes #60457.
7849 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
7851 * class.cs : EventAttributes is now set to None by default.
7852 This fixes bug #60459.
7854 2004-06-18 Marek Safar <marek.safar@seznam.cz>
7857 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
7858 Don't throw exception but return null (it's sufficient now).
7860 2004-06-18 Marek Safar <marek.safar@seznam.cz>
7862 * typemanager.cs (GetArgumentTypes): Faster implementation.
7864 2004-06-18 Martin Baulig <martin@ximian.com>
7866 * attribute.cs (Attribute.Resolve): Check whether we're an
7867 EmptyCast which a Constant child. Fixes #60333.
7869 2004-06-17 Ben Maurer <bmaurer@ximian.com>
7871 * statement.cs (EmitCollectionForeach): Account for the fact that
7872 not all valuetypes are in areas which we can take the address of.
7873 For these variables, we store to a temporary variable. Also, make
7874 sure that we dont emit a `callvirt' on a valuetype method.
7876 2004-06-15 Marek Safar <marek.safar@seznam.cz>
7878 * expression.cs (StackAlloc.DoReSolve): Added test for
7879 negative parameter (CS0247).
7881 2004-06-15 Marek Safar <marek.safar@seznam.cz>
7884 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
7886 2004-06-15 Marek Safar <marek.safar@seznam.cz>
7889 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
7892 2004-06-14 Marek Safar <marek.safar@seznam.cz>
7894 Fix bug #58254 & cs1555.cs, cs1556.cs
7895 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
7897 2004-06-14 Marek Safar <marek.safar@seznam.cz>
7899 * cs-parser.jay: Added error CS1669 test for indexers.
7901 2004-06-11 Martin Baulig <martin@ximian.com>
7903 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
7904 call this twice: for params and varargs methods.
7906 2004-06-11 Marek Safar <marek.safar@seznam.cz>
7909 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
7911 2004-06-11 Marek Safar <marek.safar@seznam.cz>
7913 * attribute.cs (Attribute.GetValidTargets): Made public.
7916 (AbstractPropertyEventMethod): New class for better code sharing.
7917 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
7919 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
7921 2004-06-11 Raja R Harinath <rharinath@novell.com>
7924 * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
7925 that the call to Resolve is part of a MemberAccess.
7926 (Expression.Resolve): Use it for SimpleName resolution.
7927 (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
7928 Add 'intermediate' boolean argument.
7929 (SimpleName.DoSimpleNameResolve): Likewise. Use it to disable an
7930 error message when the SimpleName can be resolved ambiguously
7931 between an expression and a type.
7932 * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
7934 (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
7935 call on the left-side.
7937 2004-06-11 Marek Safar <marek.safar@seznam.cz>
7940 (MethodCore.VerifyClsCompliance): Added test for error CS3000.
7942 2004-06-11 Marek Safar <marek.safar@seznam.cz>
7944 * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
7946 2004-06-11 Martin Baulig <martin@ximian.com>
7948 * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
7949 varargs methods if applicable.
7951 2004-06-11 Martin Baulig <martin@ximian.com>
7953 * expression.cs (Invocation.EmitCall): Don't use
7954 `method.CallingConvention == CallingConventions.VarArgs' since the
7955 method could also have `CallingConventions.HasThis'.
7957 2004-06-11 Marek Safar <marek.safar@seznam.cz>
7959 * class.cs (Event.GetSignatureForError): Implemented.
7960 Fixed crash in error test cs3010.cs
7962 2004-06-10 Miguel de Icaza <miguel@ximian.com>
7964 * cs-tokenizer.cs: Change the way we track __arglist to be
7965 consistent with the other keywords.
7967 2004-06-09 Miguel de Icaza <miguel@ximian.com>
7969 * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
7972 2004-06-09 Sebastien Pouliot <sebastien@ximian.com>
7974 * codegen.cs: Check that all referenced assemblies have a strongname
7975 before strongnaming the compiled assembly. If not report error CS1577.
7976 Fix bug #56563. Patch by Jackson Harper.
7977 * typemanager.cs: Added a method to return all referenced assemblies.
7978 Fix bug #56563. Patch by Jackson Harper.
7980 2004-06-08 Marek Safar <marek.safar@seznam.cz>
7983 (Method.ApplyAttributeBuilder): Moved and added conditional
7984 attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
7987 (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
7989 2004-06-08 Marek Safar <marek.safar@seznam.cz>
7992 * class.cs: (EventField.attribute_targets): Changed default target.
7994 2004-06-08 Martin Baulig <martin@ximian.com>
7996 * expression.cs (Invocation.EmitCall): Enable varargs methods.
7998 2004-06-08 Martin Baulig <martin@ximian.com>
8000 * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
8002 2004-06-07 Martin Baulig <martin@ximian.com>
8004 Added support for varargs methods.
8006 * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
8009 * cs-parser.jay: Added support for `__arglist'.
8011 * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
8013 * expression.cs (Argument.AType): Added `ArgList'.
8014 (Invocation): Added support for varargs methods.
8015 (ArglistAccess): New public class.
8016 (Arglist): New public class.
8018 * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
8020 * statement.cs (Block.Flags): Added `HasVarargs'. We set this on
8021 a method's top-level block if the method has varargs.
8023 * support.cs (ReflectionParameters, InternalParameters): Added
8024 support for varargs methods.
8026 2004-06-07 Miguel de Icaza <miguel@ximian.com>
8028 * class.cs: Provide location in indexer error report.
8030 * driver.cs: Use standard names.
8032 * namespace.cs: Catch the use of using after a namespace has been
8033 declared also on using aliases.
8035 2004-06-03 Raja R Harinath <rharinath@novell.com>
8038 * typemanager.cs (closure_private_ok, closure_invocation_type)
8039 (closure_qualifier_type, closure_invocation_assembly)
8040 (FilterWithClosure): Move to ...
8041 (Closure): New internal nested class.
8042 (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
8043 (MemberLookup, RealMemberLookup): Add new almost_match parameter.
8044 * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
8045 (MemberLookup, MemberLookupFailed): Use it.
8046 * expression.cs (New.DoResolve): Treat the lookup for the
8047 constructor as being qualified by the 'new'ed type.
8048 (Indexers.GetIndexersForTypeOrInterface): Update.
8050 2004-06-03 Marek Safar <marek.safar@seznam.cz>
8053 (GetConditionalAttributeValue): New method. Returns
8054 condition of ConditionalAttribute.
8055 (SearchMulti): New method. Returns all attributes of type 't'.
8056 Use it when attribute is AllowMultiple = true.
8057 (IsConditionalMethodExcluded): New method.
8060 (Method.IsExcluded): Implemented. Returns true if method has conditional
8061 attribute and the conditions is not defined (method is excluded).
8062 (IMethodData): Extended interface for ConditionalAttribute support.
8063 (PropertyMethod.IsExcluded): Implemented.
8066 (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
8069 (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
8072 2004-06-02 Ben Maurer <bmaurer@users.sourceforge.net>
8074 * expression.cs (ArrayCreationExpression): Make this just an
8075 `expression'. It can't be a statement, so the code here was
8078 2004-06-02 Marek Safar <marek.safar@seznam.cz>
8081 * typemanager.cs (GetFullNameSignature): New method for
8084 2004-06-02 Marek Safar <marek.safar@seznam.cz>
8087 * class.cs (MemberBase.GetSignatureForError): New virtual method.
8088 Use this method when MethodBuilder is null.
8089 (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
8090 Added test for error CS0626 (MONO reports error for this situation).
8091 (IMethodData.GetSignatureForError): Extended interface.
8093 2004-06-01 Marek Safar <marek.safar@seznam.cz>
8096 (AttributeTester.GetObsoleteAttribute): Returns instance of
8097 ObsoleteAttribute when type is obsolete.
8100 (TypeContainer.VerifyObsoleteAttribute): Override.
8101 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
8102 (MethodCode.VerifyObsoleteAttribute): Override.
8103 (MemberBase.VerifyObsoleteAttribute): Override.
8106 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
8107 and report proper error.
8110 Delegate.VerifyObsoleteAttribute): Override.
8113 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
8114 and report proper error.
8115 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
8118 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
8122 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
8123 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
8124 Added test for ObsoleteAttribute.
8127 (Catch): Derived from Statement.
8129 2004-06-01 Marek Safar <marek.safar@seznam.cz>
8131 Fixed bug #59071 & cs0160.cs
8133 * statement.cs (Try.Resolve): Check here whether order of catch
8134 clauses matches their dependencies.
8136 2004-05-31 Miguel de Icaza <miguel@ximian.com>
8138 * Reverted patch to namespace.cs (Use lookuptypedirect). This
8139 caused a regression: #59343. Referencing nested classes from an
8140 assembly stopped working.
8142 2004-05-31 Martin Baulig <martin@ximian.com>
8144 MCS is now frozen for beta 2.
8146 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8148 * convert.cs: add a trivial cache for overload operator resolution.
8150 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8152 * decl.cs: If possible, use lookuptypedirect here. We can only do
8153 this if there is no `.' after the namespace. Avoids using
8154 LookupType, which does lots of slow processing.
8155 (FindNestedType) New method, does what it says :-).
8156 * namespace.cs: use LookupTypeDirect.
8157 * rootcontext.cs: use membercache, if possible.
8158 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8160 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8163 According to the spec,
8165 In a member access of the form E.I, if E is a single identifier,
8166 and if the meaning of E as a simple-name (§7.5.2) is a constant,
8167 field, property, localvariable, or parameter with the same type as
8168 the meaning of E as a type-name (§3.8), then both possible
8169 meanings of E are permitted.
8171 We did not check that E as a simple-name had the same type as E as
8174 This trivial check gives us 5-7% on bootstrap time.
8176 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
8178 * expression.cs (Invocation.OverloadResolve): Avoid the
8179 use of hashtables and boxing here by allocating on demand.
8181 2004-05-30 Martin Baulig <martin@ximian.com>
8183 * rootcontext.cs (RootContext.LookupType): Don't cache things if
8184 we're doing a silent lookup. Don't try to lookup nested types in
8185 TypeManager.object_type (thanks to Ben Maurer).
8187 2004-05-30 Martin Baulig <martin@ximian.com>
8189 Committing a patch from Ben Maurer.
8191 * rootcontext.cs (RootContext.LookupType): Cache negative results.
8193 2004-05-29 Martin Baulig <martin@ximian.com>
8195 * class.cs (IMethodData.ShouldIgnore): New method.
8197 * typemanager.cs (TypeManager.MethodFlags): Don't take a
8198 `Location' argument, we don't need it anywhere. Use
8199 `IMethodData.ShouldIgnore ()' instead of
8200 `MethodData.GetMethodFlags ()'.
8201 (TypeManager.AddMethod): Removed.
8202 (TypeManager.AddMethod2): Renamed to AddMethod.
8204 2004-05-29 Martin Baulig <martin@ximian.com>
8206 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
8208 * convert.cs (Convert.ImplicitReferenceConversion): If we're
8209 converting from a class type S to an interface type and we already
8210 have an object on the stack, don't box it again. Fixes #52578.
8212 2004-05-29 Martin Baulig <martin@ximian.com>
8214 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8215 Added support for `params' parameters. Fixes #59267.
8217 2004-05-29 Martin Baulig <martin@ximian.com>
8219 * literal.cs (NullPointer): Provide a private .ctor which sets
8220 `type' to TypeManager.object_type. Fixes #59048.
8222 2004-05-29 Martin Baulig <martin@ximian.com>
8224 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
8225 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
8227 * ecore.cs (EventExpr.instance_expr): Make the field private.
8229 2004-05-26 Marek Safar <marek.safar@seznam.cz>
8231 Fixed bug #50080 & cs0214-2.cs
8232 * expression.cs (Cast.DoResolve): Check unsafe context here.
8234 * statement.cs (Resolve.DoResolve): Likewise.
8236 2004-05-26 Martin Baulig <martin@ximian.com>
8238 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
8240 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
8241 (RootContext.LookupType): Pass down the `silent' flag.
8243 2004-05-25 Martin Baulig <martin@ximian.com>
8246 (MethodGroupExpr.IdenticalTypeName): New public property.
8247 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
8248 expression actually refers to a type.
8250 2004-05-25 Martin Baulig <martin@ximian.com>
8252 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
8253 for #56176 and made it actually work.
8255 2004-05-25 Martin Baulig <martin@ximian.com>
8257 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
8258 (FieldExpr, PropertyExpr): Override and implement
8259 CacheTemporaries. Fixes #52279.
8261 2004-05-25 Miguel de Icaza <miguel@ximian.com>
8263 * location.cs: In the new compiler listing a file twice is a
8264 warning, not an error.
8266 2004-05-24 Martin Baulig <martin@ximian.com>
8268 * enum.cs (Enum.DefineType): For the `BaseType' to be a
8269 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
8271 2004-05-24 Martin Baulig <martin@ximian.com>
8273 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
8274 walking the `using' list. Fixes #53921.
8276 2004-05-24 Martin Baulig <martin@ximian.com>
8278 * const.cs (Const.LookupConstantValue): Added support for
8279 EmptyCast's; fixes #55251.
8281 2004-05-24 Martin Baulig <martin@ximian.com>
8283 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
8284 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
8285 which does the CS0135 check. The reason is that we first need to
8286 check whether the variable actually exists.
8288 2004-05-24 Martin Baulig <martin@ximian.com>
8290 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
8291 than RootContext.LookupType() to find the explicit interface
8294 2004-05-24 Raja R Harinath <rharinath@novell.com>
8296 * Makefile: Simplify. Use executable.make.
8297 * mcs.exe.sources: New file. List of sources of mcs.exe.
8299 2004-05-24 Anders Carlsson <andersca@gnome.org>
8303 Use the invariant culture when doing String.Compare for CLS case
8306 2004-05-23 Martin Baulig <martin@ximian.com>
8308 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
8309 don't have any dots. Fixes #52622, added cs0246-8.cs.
8311 * namespace.cs (NamespaceEntry.Lookup): Likewise.
8313 2004-05-23 Marek Safar <marek.safar@seznam.cz>
8315 * class.cs (MemberBase.Define): Reuse MemberType member for
8316 resolved type. Other methods can use it too.
8318 2004-05-23 Martin Baulig <martin@ximian.com>
8320 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
8321 the variable also exists in the current block (otherwise, we need
8322 to report a CS0103). Fixes #58670.
8324 2004-05-23 Martin Baulig <martin@ximian.com>
8326 * flowanalysis.cs (Reachability.Reachable): Compute this
8327 on-the-fly rather than storing it as a field.
8329 2004-05-23 Martin Baulig <martin@ximian.com>
8331 * flowanalysis.cs (Reachability.And): Manually compute the
8332 resulting `barrier' from the reachability.
8334 2004-05-23 Marek Safar <marek.safar@seznam.cz>
8337 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
8338 instance of ObsoleteAttribute when symbol is obsolete.
8341 (IMethodData): Extended interface for ObsoleteAttribute support.
8343 2004-05-22 Marek Safar <marek.safar@seznam.cz>
8345 * attribute.cs: Fix bug #55970
8347 2004-05-22 Marek Safar <marek.safar@seznam.cz>
8351 (GetObsoleteAttribute): New method. Creates the instance of
8353 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
8354 ObsoleteAttribute when member is obsolete.
8355 (AttributeTester.Report_ObsoleteMessage): Common method for
8356 Obsolete error/warning reporting.
8359 (TypeContainer.base_classs_type): New member for storing parent type.
8362 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
8363 for this MemberCore.
8365 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8367 * attribute.cs, const.cs: Fix bug #58590
8369 2004-05-21 Martin Baulig <martin@ximian.com>
8371 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
8372 out parameters if the end of the method is unreachable. Fixes
8375 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8377 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
8378 Hari was right, why extra method.
8380 2004-05-21 Marek Safar <marek.safar@seznam.cz>
8382 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
8384 2004-05-20 Martin Baulig <martin@ximian.com>
8386 Merged this back from gmcs to keep the differences to a minumum.
8388 * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
8389 instead of a Declspace.
8390 (Attribute.ResolveType): Likewise.
8391 (Attributes.Search): Likewise.
8392 (Attributes.Contains): Likewise.
8393 (Attributes.GetClsCompliantAttribute): Likewise.
8395 * class.cs (TypeContainer.VerifyMembers): Added EmitContext
8397 (MethodData.ApplyAttributes): Take an EmitContext instead of a
8400 2004-05-19 Marek Safar <marek.safar@seznam.cz>
8402 Fix bug #58688 (MCS does not report error when the same attribute
8405 * attribute.cs (Attribute.Emit): Distinction between null and default.
8407 2004-05-19 Raja R Harinath <rharinath@novell.com>
8409 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
8410 of a top-level attribute without an attribute target.
8411 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
8413 (Attribute.Conditional_GetConditionName),
8414 (Attribute.Obsolete_GetObsoleteMessage): Update.
8415 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
8416 part of ScanForIndexerName.
8417 (Attribute.CanIgnoreInvalidAttribute): New function.
8418 (Attribute.ScanForIndexerName): Move to ...
8419 (Attributes.ScanForIndexerName): ... here.
8420 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
8421 (Attributes.Search): New internal variant that can choose not to
8422 complain if types aren't resolved. The original signature now
8424 (Attributes.GetClsCompliantAttribute): Use internal variant, with
8425 complaints suppressed.
8426 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
8427 only if it not useful.
8428 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
8429 top-level for attributes that are shared between the assembly
8430 and a top-level class.
8431 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
8432 * class.cs: Update to reflect changes.
8433 (DefineIndexers): Fuse loops.
8434 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
8435 a couple more variants of attribute names.
8437 2004-05-18 Marek Safar <marek.safar@seznam.cz>
8439 Fix bug #52585 (Implemented explicit attribute declaration)
8442 (Attributable.ValidAttributeTargets): New abstract method. It gets
8443 list of valid attribute targets for explicit target declaration.
8444 (Attribute.Target): It holds target itself.
8445 (AttributeSection): Removed.
8446 (Attribute.CheckTargets): New method. It checks whether attribute
8447 target is valid for the current element.
8450 (EventProperty): New class. For events that are declared like
8451 property (with add and remove accessors).
8452 (EventField): New class. For events that are declared like field.
8455 * cs-parser.jay: Implemented explicit attribute target declaration.
8457 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
8458 Override ValidAttributeTargets.
8461 (ReturnParameter): Class for applying custom attributes on
8463 (ParameterAtribute): New class. Class for applying custom
8464 attributes on the parameter type.
8466 2004-05-17 Miguel de Icaza <miguel@ximian.com>
8468 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
8471 (Method): Allow UNSAFE here.
8473 * modifiers.cs: Support unsafe reporting.
8475 2004-05-17 Marek Safar <marek.safar@seznam.cz>
8477 * decl.cs: Fix bug #58478.
8479 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8481 * statement.cs: When checking for unreachable code on an EmptyStatement,
8482 set the location. Fixes bug #58488.
8484 2004-05-13 Miguel de Icaza <miguel@ximian.com>
8486 * driver.cs: Add -pkg handling.
8488 From Gonzalo: UseShelLExecute=false
8490 2004-05-12 Marek Safar <marek.safar@seznam.cz>
8493 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
8495 (Attribute.IsClsCompliaceRequired): Moved to base for better
8497 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
8498 when attribute is AttributeUsageAttribute.
8499 (Attribute.GetValidTargets): Simplified.
8500 (Attribute.GetAttributeUsage): New method returns AttributeUsage
8501 attribute for this type.
8502 (Attribute.ApplyAttributes): Method renamed to Emit and make
8504 (GlobalAttributeSection): New class for special handling of global
8505 attributes (assembly, module).
8506 (AttributeSection.Emit): New method.
8508 * class.cs: Implemented Attributable abstract methods.
8509 (MethodCore.LabelParameters): Moved to Parameter class.
8510 (Accessor): Is back simple class.
8511 (PropertyMethod): Implemented Attributable abstract class.
8512 (DelegateMethod): Implemented Attributable abstract class.
8513 (Event): New constructor for disctintion between normal Event
8514 and Event with accessors.
8516 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
8518 * codegen.cs, const.cs, decl.cs, delegate.cs:
8519 (CommonAssemblyModulClass): Implemented Attributable abstract class
8522 * enum.cs: Implement IAttributeSupport interface.
8523 (EnumMember): New class for emum members. Implemented Attributable
8527 (ParameterBase): Is abstract.
8528 (ReturnParameter): New class for easier [return:] attribute handling.
8530 * typemanager.cs: Removed builder_to_attr.
8532 2004-05-11 Raja R Harinath <rharinath@novell.com>
8535 * attribute.cs (Attribute.GetPositionalValue): New function.
8536 * class.cs (TypeContainer.VerifyMembers): New function.
8537 (TypeContainer.Emit): Use it.
8538 (ClassOrStruct): New base class for Class and Struct.
8539 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
8540 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
8542 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
8543 then each non-static field should have a FieldOffset attribute.
8544 Otherwise, none of the fields should have a FieldOffset attribute.
8545 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
8546 and FieldOffset attributes.
8547 * typemanager.cs (TypeManager.struct_layout_attribute_type)
8548 (TypeManager.field_offset_attribute_type): New core types.
8549 (TypeManager.InitCoreTypes): Initialize them.
8551 2004-05-11 Michal Moskal <malekith@pld-linux.org>
8553 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
8554 Return correct type.
8557 2004-05-09 Miguel de Icaza <miguel@ximian.com>
8559 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
8560 be implicitly converted to ulong.
8562 * expression.cs: The logic for allowing operator &, | and ^ worked
8563 was wrong, it worked before because we did not report an error in
8564 an else branch. Fixes 57895.
8566 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
8567 allow volatile fields to be reference types.
8569 2004-05-07 Miguel de Icaza <miguel@ximian.com>
8571 * driver.cs: Add support for /debug-
8573 2004-05-07 Raja R Harinath <rharinath@novell.com>
8575 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
8576 Add a 'complain' parameter to silence errors.
8577 (Attribute.Resolve): Update to changes. Put in sanity check to catch
8578 silently overlooked type-resolutions.
8579 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
8581 (Attributes.Search): New function.
8582 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
8583 (Attributes.GetAttributeFullName): Remove hack.
8584 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
8585 Update to reflect changes.
8586 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8587 Use Attributes.Search instead of nested loops.
8589 2004-05-07 Marek Safar <marek.safar@seznam.cz>
8592 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
8593 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
8594 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
8596 * report.cs: (Report.Warning): Renamed to Warning_T because of
8597 parameter collision.
8599 2004-05-05 Raja R Harinath <rharinath@novell.com>
8601 * expression.cs (MemberAccess.ResolveMemberAccess):
8602 Exit with non-zero status after Report.Error.
8603 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
8605 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
8607 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
8609 * support.cs: Don't hang when the file is empty.
8611 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
8613 * support.cs: In SeekableStreamReader, compute the preamble size of the
8614 underlying stream. Position changes should take into account that initial
8617 2004-05-03 Todd Berman <tberman@sevenl.net>
8619 * driver.cs: remove unused GetSysVersion function.
8621 2004-05-03 Todd Berman <tberman@sevenl.net>
8623 * driver.cs: Remove the hack from saturday, as well as the hack
8624 from jackson (LoadAssemblyFromGac), also adds the CWD to the
8625 link_paths to get that bit proper.
8627 2004-05-01 Todd Berman <tberman@sevenl.net>
8629 * driver.cs: Try a LoadFrom before a Load, this checks the current
8630 path. This is currently a bug in mono that is be fixed, however, this
8631 provides a workaround for now. This will be removed when the bug
8634 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
8636 * CryptoConvert.cs: Updated to latest version. Fix issue with
8637 incomplete key pairs (#57941).
8639 2004-05-01 Todd Berman <tberman@sevenl.net>
8641 * driver.cs: Remove '.' from path_chars, now System.* loads properly
8644 2004-04-30 Jackson Harper <jackson@ximian.com>
8646 * codegen.cs: Open keys readonly.
8648 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8650 * typemanager.cs: don't report cyclic struct layout when a struct
8651 contains 2 or more fields of the same type. Failed for Pango.AttrShape
8652 which has 2 Pango.Rectangle fields.
8654 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
8656 * expression.cs: Handle IntPtr comparisons with IL code
8657 rather than a method call.
8659 2004-04-29 Martin Baulig <martin@ximian.com>
8661 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
8662 the list of PropertyInfo's in class hierarchy and find the
8663 accessor. Fixes #56013.
8665 2004-04-29 Martin Baulig <martin@ximian.com>
8667 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
8669 2004-04-29 Martin Baulig <martin@ximian.com>
8671 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
8673 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
8675 2004-04-29 Martin Baulig <martin@ximian.com>
8677 * class.cs (ConstructorInitializer.Resolve): Check whether the
8678 parent .ctor is accessible. Fixes #52146.
8680 2004-04-29 Martin Baulig <martin@ximian.com>
8682 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
8684 * statement.cs (Using.EmitLocalVariableDecls): Use
8685 TypeManager.idisposable_type, not typeof (IDisposable).
8686 (Foreach.EmitCollectionForeach): Added support for valuetypes.
8688 2004-04-29 Martin Baulig <martin@ximian.com>
8690 * class.cs (Event.Define): Don't emit the field and don't set
8691 RTSpecialName and SpecialName for events on interfaces. Fixes
8694 2004-04-29 Raja R Harinath <rharinath@novell.com>
8696 Refactor Attribute.ApplyAttributes.
8697 * attribute.cs (Attributable): New base class for objects that can
8698 have Attributes applied on them.
8699 (Attribute): Make AttributeUsage fields public.
8700 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
8701 (Attribute.IsInternalCall): New property.
8702 (Attribute.UsageAttr): Convert to a public read-only property.
8703 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
8704 (Attribute.ResolveType, Attribute.Resolve)
8705 (Attribute.ScanForIndexerName): Update to reflect changes.
8706 (Attribute.CheckAttributeTarget): Re-format.
8707 (Attribute.ApplyAttributes): Refactor, to various
8708 Attributable.ApplyAttributeBuilder methods.
8709 * decl.cs (MemberCore): Make Attributable.
8710 * class.cs (Accessor): Make Attributable.
8711 (MethodData.ApplyAttributes): Use proper attribute types, not
8713 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
8714 (TypeContainer.ApplyAttributeBuilder)
8715 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
8716 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
8717 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
8718 (Operator.ApplyAttributeBuilder): New factored-out methods.
8719 * const.cs (Const.ApplyAttributeBuilder): Likewise.
8720 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
8721 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
8722 * parameter.cs (ParameterBase): New Attributable base class
8723 that can also represent Return types.
8724 (Parameter): Update to the changes.
8726 2004-04-29 Jackson Harper <jackson@ximian.com>
8728 * driver.cs: Prefer the corlib system version when looking for
8729 assemblies in the GAC. This is still a hack, but its a better hack
8732 2004-04-29 Marek Safar <marek.safar@seznam.cz>
8734 * decl.cs, enum.cs: Improved error 3005 reporting.
8736 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
8737 (related_symbols): New private member for list of symbols
8738 related to reported error/warning.
8740 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
8742 2004-04-29 Martin Baulig <martin@ximian.com>
8744 * ecore.cs (Expression.Constantify): If we're an enum and
8745 TypeManager.TypeToCoreType() doesn't give us another type, use
8746 t.UnderlyingSystemType. Fixes #56178.
8748 2004-04-29 Martin Baulig <martin@ximian.com>
8750 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
8751 interfaces and for each interface, only add members directly
8752 declared in that interface. Fixes #53255.
8754 2004-04-28 Martin Baulig <martin@ximian.com>
8756 * expression.cs (ConditionalLogicalOperator): Use a temporary
8757 variable for `left' to avoid that we evaluate it more than once;
8760 2004-04-28 Martin Baulig <martin@ximian.com>
8762 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
8765 2004-04-28 Martin Baulig <martin@ximian.com>
8767 * statement.cs (LocalInfo.Resolve): Check whether the type is not
8770 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
8771 whether the type is not void (CS1547).
8773 2004-04-28 Martin Baulig <martin@ximian.com>
8775 * expression.cs (Unary.DoResolveLValue): Override this and report
8776 CS0131 for anything but Operator.Indirection.
8778 2004-04-28 Martin Baulig <martin@ximian.com>
8780 Committing a patch from Ben Maurer; see bug #50820.
8782 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
8785 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
8788 2004-04-28 Martin Baulig <martin@ximian.com>
8790 Committing a patch from Ben Maurer; see bug #50820.
8792 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
8795 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
8798 2004-04-28 Martin Baulig <martin@ximian.com>
8800 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
8801 (Block.AddLabel): Call DoLookupLabel() to only search in the
8804 2004-04-28 Martin Baulig <martin@ximian.com>
8806 * cfold.cs (ConstantFold.BinaryFold): Added special support for
8807 comparing StringConstants and NullLiterals in Equality and Inequality.
8809 2004-04-28 Jackson Harper <jackson@ximian.com>
8811 * driver.cs: Attempt to load referenced assemblies from the
8812 GAC. This is the quick and dirty version of this method that
8813 doesnt take into account versions and just takes the first
8814 canidate found. Will be good enough for now as we will not have more
8815 then one version installed into the GAC until I update this method.
8817 2004-04-28 Martin Baulig <martin@ximian.com>
8819 * typemanager.cs (TypeManager.CheckStructCycles): New public
8820 static method to check for cycles in the struct layout.
8822 * rootcontext.cs (RootContext.PopulateTypes): Call
8823 TypeManager.CheckStructCycles() for each TypeContainer.
8824 [Note: We only need to visit each type once.]
8826 2004-04-28 Martin Baulig <martin@ximian.com>
8828 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
8830 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
8831 success and added `out object value'. Use a `bool resolved' field
8832 to check whether we've already been called rather than
8833 `ConstantValue != null' since this breaks for NullLiterals.
8835 2004-04-28 Raja R Harinath <rharinath@novell.com>
8837 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
8838 setting of this flag, since the 'set' method may be non-public.
8840 2004-04-28 Raja R Harinath <rharinath@novell.com>
8842 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
8843 check on current_vector.Block.
8845 2004-04-27 Martin Baulig <martin@ximian.com>
8847 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
8848 a field initializer. Fixes #56459.
8850 2004-04-27 Martin Baulig <martin@ximian.com>
8852 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
8853 we're not attempting to use an indexer. Fixes #52154.
8855 2004-04-27 Martin Baulig <martin@ximian.com>
8857 * statement.cs (Return): Don't create a return label if we don't
8858 need it; reverts my change from January 20th. Thanks to Ben
8861 2004-04-27 Martin Baulig <martin@ximian.com>
8863 According to the spec, `goto' can only leave a nested scope, but
8866 * statement.cs (Block.LookupLabel): Only lookup in the current
8867 block, don't recurse into parent or child blocks.
8868 (Block.AddLabel): Check in parent and child blocks, report
8869 CS0140/CS0158 if we find a duplicate.
8870 (Block): Removed this indexer for label lookups.
8871 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
8872 this already does the error reporting for us.
8875 (FlowBranching.UsageVector.Block): New public variable; may be null.
8876 (FlowBranching.CreateSibling): Added `Block' argument.
8877 (FlowBranching.LookupLabel): New public virtual method. Lookup a
8878 label for the target of a `goto' and check whether we're not
8879 leaving a `finally'.
8881 2004-04-27 Martin Baulig <martin@ximian.com>
8883 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8884 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
8887 2004-04-27 Martin Baulig <martin@ximian.com>
8889 * statement.cs (Block.AddLabel): Also check for implicit blocks
8890 and added a CS0158 check.
8892 2004-04-27 Martin Baulig <martin@ximian.com>
8894 * flowanalysis.cs (FlowBranchingLoop): New class.
8895 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
8896 UsageVector's instead of an ArrayList.
8897 (FlowBranching.Label): Likewise.
8898 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
8899 (FlowBranching.AddBreakVector): New method.
8901 2004-04-27 Miguel de Icaza <miguel@ximian.com>
8903 * attribute.cs: Small regression fix: only convert the type if we
8904 the type is different, fixes System.Drawing build.
8906 2004-04-27 Martin Baulig <martin@ximian.com>
8908 * attribute.cs (Attribute.Resolve): If we have a constant value
8909 for a named field or property, implicity convert it to the correct
8912 2004-04-27 Raja R Harinath <rharinath@novell.com>
8914 * statement.cs (Block.Block): Implicit blocks share
8915 'child_variable_names' fields with parent blocks.
8916 (Block.AddChildVariableNames): Remove.
8917 (Block.AddVariable): Mark variable as "used by a child block" in
8918 every surrounding block.
8919 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
8920 been used in a child block, complain about violation of "Invariant
8921 meaning in blocks" rule.
8922 * cs-parser.jay (declare_local_variables): Don't use
8923 AddChildVariableNames.
8924 (foreach_statement): Don't create an implicit block: 'foreach'
8927 2004-04-23 Miguel de Icaza <miguel@ximian.com>
8929 * convert.cs (ImplicitNumericConversion): 0 is also positive when
8930 converting from 0L to ulong. Fixes 57522.
8932 2004-04-22 Marek Safar <marek.safar@seznam.cz>
8934 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
8935 derived class hides via 'new' keyword field from base class (test-242.cs).
8936 TODO: Handle this in the more general way.
8938 * class.cs (CheckBase): Ditto.
8940 2004-04-22 Marek Safar <marek.safar@seznam.cz>
8942 * decl.cs (caching_flags): New member for storing cached values
8944 (MemberCore.Flags): New enum where bit flags for caching_flags
8946 (MemberCore.cls_compliance): Moved to caching_flags.
8947 (DeclSpace.Created): Moved to caching_flags.
8949 * class.cs: Use caching_flags instead of DeclSpace.Created
8951 2004-04-21 Miguel de Icaza <miguel@ximian.com>
8953 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
8954 if we are only a derived class, not a nested class.
8956 * typemanager.cs: Same as above, but do this at the MemberLookup
8957 level (used by field and methods, properties are handled in
8958 PropertyExpr). Allow for the qualified access if we are a nested
8961 2004-04-21 Marek Safar <marek.safar@seznam.cz>
8963 * class.cs: Refactoring.
8964 (IMethodData): New inteface; Holds links to parent members
8965 to avoid member duplication (reduced memory allocation).
8966 (Method): Implemented IMethodData interface.
8967 (PropertyBase): New inner classes for get/set methods.
8968 (PropertyBase.PropertyMethod): Implemented IMethodData interface
8969 (Event): New inner classes for add/remove methods.
8970 (Event.DelegateMethod): Implemented IMethodData interface.
8972 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
8973 EmitContext (related to class.cs refactoring).
8975 2004-04-21 Raja R Harinath <rharinath@novell.com>
8977 * delegate.cs (Delegate.VerifyApplicability): If the number of
8978 arguments are the same as the number of parameters, first try to
8979 verify applicability ignoring any 'params' modifier on the last
8983 2004-04-16 Raja R Harinath <rharinath@novell.com>
8985 * class.cs (TypeContainer.AddIndexer): Use
8986 'ExplicitInterfaceName' to determine if interface name was
8987 explicitly specified. 'InterfaceType' is not initialized at this time.
8988 (TypeContainer.DefineIndexers): Remove use of temporary list. The
8989 Indexers array is already in the required order. Initialize
8990 'IndexerName' only if there are normal indexers.
8991 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
8992 (TypeContainer.Emit): Emit DefaultMember attribute only if
8993 IndexerName is initialized.
8996 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
8998 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
9001 2004-04-15 Raja R Harinath <rharinath@novell.com>
9003 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
9007 * attribute.cs (Attribute.Resolve): Check for duplicate named
9011 2004-04-15 Miguel de Icaza <miguel@ximian.com>
9013 * iterators.cs (MarkYield): track whether we are in an exception,
9014 and generate code accordingly. Use a temporary value to store the
9015 result for our state.
9017 I had ignored a bit the interaction of try/catch with iterators
9018 since their behavior was not entirely obvious, but now it is
9019 possible to verify that our behavior is the same as MS .NET 2.0
9023 2004-04-14 Miguel de Icaza <miguel@ximian.com>
9025 * iterators.cs: Avoid creating temporaries if there is no work to
9028 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
9029 Enumerations, use TypeManager.EnumToUnderlying and call
9032 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
9035 (This.Emit): Use EmitContext.EmitThis to emit our
9038 (This.EmitAssign): Ditto.
9040 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
9041 codepaths, we will move all the functionality into
9044 (FieldExpr.EmitAssign): Ditto.
9046 This fixes several hidden bugs that I uncovered while doing a code
9047 review of this today.
9049 * codegen.cs (EmitThis): reworked so the semantics are more clear
9050 and also support value types "this" instances.
9052 * iterators.cs: Changed so that for iterators in value types, we
9053 do not pass the value type as a parameter.
9055 Initialization of the enumerator helpers is now done in the caller
9056 instead of passing the parameters to the constructors and having
9057 the constructor set the fields.
9059 The fields have now `assembly' visibility instead of private.
9061 2004-04-11 Miguel de Icaza <miguel@ximian.com>
9063 * expression.cs (Argument.Resolve): Check if fields passed as ref
9064 or out are contained in a MarshalByRefObject.
9066 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
9067 another compiler type.
9069 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
9071 * class.cs (Indexer.Define): use the new name checking method.
9072 Also, return false on an error.
9073 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
9074 (is_identifier_[start/part]_character): make static.
9076 2004-04-10 Miguel de Icaza <miguel@ximian.com>
9078 * expression.cs (Binary.ResolveOperator): Do no append strings
9079 twice: since we can be invoked more than once (array evaluation)
9080 on the same concatenation, take care of this here. Based on a fix
9081 from Ben (bug #56454)
9083 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
9085 * codegen.cs: Fix another case where CS1548 must be reported (when
9086 delay-sign isn't specified and no private is available #56564). Fix
9087 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
9088 error when MCS is used on the MS runtime and we need to delay-sign
9089 (which seems unsupported by AssemblyBuilder - see #56621).
9091 2004-04-08 Marek Safar <marek.safar@seznam.cz>
9093 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
9094 (TypeManager.ComputeNamespaces): Faster implementation for
9097 * compiler.csproj: Updated AssemblyName to mcs.
9099 2004-04-07 Miguel de Icaza <miguel@ximian.com>
9101 * rootcontext.cs: Add new types to the boot resolution.
9103 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
9104 MulticastDelegate is not allowed.
9106 * typemanager.cs: Add new types to lookup: System.TypedReference
9109 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
9110 check for TypedReference or ArgIterator, they are not allowed.
9112 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
9113 makes us properly catch 1510 in some conditions (see bug 56016 for
9116 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
9118 * CryptoConvert.cs: update from corlib version
9121 2004-04-05 Miguel de Icaza <miguel@ximian.com>
9123 * class.cs (Indexer.Define): Check indexername declaration
9125 2004-04-05 Marek Safar <marek.safar@seznam.cz>
9127 * attribute.cs (IsClsCompliant): Fixed problem with handling
9128 all three states (compliant, not-compliant, undetected).
9130 2004-03-30 Marek Safar <marek.safar@seznam.cz>
9132 * attribute.cs (Attribute): Location is now public.
9133 (Resolve): Store resolved arguments (pos_values) in attribute class.
9134 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
9135 (GetClsCompliantAttributeValue): New method that gets
9136 CLSCompliantAttribute value.
9137 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
9138 if exists else null.
9139 (AttributeTester): New class for CLS-Compliant verification routines.
9141 * class.cs (Emit): Add CLS-Compliant verification.
9142 (Method.GetSignatureForError): Implemented.
9143 (Constructor.GetSignatureForError): Implemented
9144 (Constructor.HasCompliantArgs): Returns if constructor has
9145 CLS-Compliant arguments.
9146 (Constructor.Emit): Override.
9147 (Construcor.IsIdentifierClsCompliant): New method; For constructors
9148 is needed to test only parameters.
9149 (FieldBase.GetSignatureForError): Implemented.
9150 (TypeContainer): New member for storing base interfaces.
9151 (TypeContainer.FindMembers): Search in base interfaces too.
9153 * codegen.cs (GetClsComplianceAttribute): New method that gets
9154 assembly or module CLSCompliantAttribute value.
9155 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
9157 (ModuleClass.Emit): Add error 3012 test.
9159 * const.cs (Emit): Override and call base for CLS-Compliant tests.
9161 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
9162 state for all decl types.
9163 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
9164 if CLS-Compliant tests are required.
9165 (IsClsCompliaceRequired): New method. Analyze whether code
9166 must be CLS-Compliant.
9167 (IsExposedFromAssembly): New method. Returns true when MemberCore
9168 is exposed from assembly.
9169 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
9170 value or gets cached value.
9171 (HasClsCompliantAttribute): New method. Returns true if MemberCore
9172 is explicitly marked with CLSCompliantAttribute.
9173 (IsIdentifierClsCompliant): New abstract method. This method is
9174 used to testing error 3005.
9175 (IsIdentifierAndParamClsCompliant): New method. Common helper method
9176 for identifier and parameters CLS-Compliant testing.
9177 (VerifyClsCompliance): New method. The main virtual method for
9178 CLS-Compliant verifications.
9179 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
9180 null. I don't know why is null (too many public members !).
9181 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
9182 and get value of first CLSCompliantAttribute that found.
9184 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
9185 (VerifyClsCompliance): Override and add extra tests.
9187 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
9188 clscheck- disable CLS-Compliant verification event if assembly is has
9189 CLSCompliantAttribute(true).
9191 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
9192 ApllyAttribute is now called in emit section as in the other cases.
9193 Possible future Emit integration.
9194 (IsIdentifierClsCompliant): New override.
9195 (VerifyClsCompliance): New override.
9196 (GetEnumeratorName): Returns full enum name.
9198 * parameter.cs (GetSignatureForError): Implemented.
9200 * report.cs (WarningData): New struct for Warning message information.
9201 (LocationOfPreviousError): New method.
9202 (Warning): New method. Reports warning based on the warning table.
9203 (Error_T): New method. Reports error based on the error table.
9205 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
9206 verifications are done here.
9208 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
9210 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
9211 CLSCompliantAttribute.
9212 (all_imported_types): New member holds all imported types from other
9214 (LoadAllImportedTypes): New method fills static table with exported types
9215 from all referenced assemblies.
9216 (Modules): New property returns all assembly modules.
9218 2004-03-30 Miguel de Icaza <miguel@ximian.com>
9220 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
9221 throwing a parser error.
9223 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
9224 which removes the hardcoded get_/set_ prefixes for properties, as
9225 IL allows for the properties to be named something else.
9229 * expression.cs: Do not override operand before we know if it is
9232 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
9234 * typemanager.cs: support for pinned variables.
9236 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
9238 * decl.cs, typemanager.cs: Avoid using an arraylist
9239 as a buffer if there is only one result set.
9241 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
9243 * expression.cs: Make sure you cant call a static method
9244 with an instance expression, bug #56174.
9246 2004-03-29 Miguel de Icaza <miguel@ximian.com>
9248 * class.cs (IsDuplicateImplementation): Improve error reporting to
9249 flag 663 (method only differs in parameter modifier).
9251 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
9252 in preprocessor directives.
9254 * location.cs (LookupFile): Allow for the empty path.
9256 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
9257 better approach for some of that patch, but its failing with the
9258 CharSet enumeration. For now try/catch will do.
9260 * typemanager.cs: Do not crash if a struct does not have fields.
9263 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
9265 * expression.cs: cs0213, cant fix a fixed expression.
9268 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
9270 * cs-parser.jay: detect invalid embeded statements gracefully.
9273 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
9275 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
9278 the invocation type may not be a subclass of the tye of the item/
9279 The type of the item must be a subclass of the invocation item.
9284 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
9286 * attribute.cs: Added methods to get a string and a bool from an
9287 attribute. Required to information from AssemblyKeyFileAttribute,
9288 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
9289 * codegen.cs: Modified AssemblyName creation to include support for
9290 strongnames. Catch additional exceptions to report them as CS1548.
9291 * compiler.csproj: Updated include CryptoConvert.cs.
9292 * compiler.csproj.user: Removed file - user specific configuration.
9293 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
9294 Mono.Security assembly. The original class is maintained and tested in
9295 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
9296 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
9297 like CSC 8.0 (C# v2) supports.
9298 * Makefile: Added CryptoConvert.cs to mcs sources.
9299 * rootcontext.cs: Added new options for strongnames.
9301 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
9303 * driver.cs: For --expect-error, report error code `2'
9304 if the program compiled with no errors, error code `1' if
9305 it compiled with an error other than the one expected.
9307 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
9309 * compiler.csproj: Updated for Visual Studio .NET 2003.
9310 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
9311 * compiler.sln: Updated for Visual Studio .NET 2003.
9313 2004-03-24 Ravi Pratap M <ravi@ximian.com>
9315 * expression.cs: Fix bug #47234. We basically need to apply the
9316 rule that we prefer the conversion of null to a reference type
9317 when faced with a conversion to 'object' (csc behaviour).
9319 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9321 * statement.cs: Shorter form for foreach, eliminates
9322 a local variable. r=Martin.
9324 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9326 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
9327 checks if we can use brtrue/brfalse to test for 0.
9328 * expression.cs: use the above in the test for using brtrue/brfalse.
9331 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9333 * expression.cs: Rewrite string concat stuff. Benefits:
9335 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
9336 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
9337 rather than a concat chain.
9339 * typemanager.cs: Add lookups for more concat overloads.
9341 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
9343 * expression.cs: Emit shorter il code for array init.
9360 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
9362 * statement.cs: Before, two switch blocks would be merged if the
9363 total size of the blocks (end_item - begin_item + 1) was less than
9364 two times the combined sizes of the blocks.
9366 Now, it will only merge if after the merge at least half of the
9371 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
9373 * class.cs : csc build fix for GetMethods(). See bug #52503.
9375 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
9377 * expression.cs: Make sure fp comparisons work with NaN.
9378 This fixes bug #54303. Mig approved this patch a long
9379 time ago, but we were not able to test b/c the runtime
9382 2004-03-19 Miguel de Icaza <miguel@ximian.com>
9384 * ecore.cs (TypExpr.GetHashCode): implement this overload.
9386 2004-03-19 Martin Baulig <martin@ximian.com>
9388 * class.cs (MemberCore.IsDuplicateImplementation): Report the
9389 error here and not in our caller.
9391 2004-03-19 Martin Baulig <martin@ximian.com>
9393 * interface.cs: Completely killed this file.
9394 (Interface): We're now a TypeContainer and live in class.cs.
9396 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
9397 argument; we're now also called for interfaces.
9398 (TypeContainer.DefineMembers): Allow this method being called
9400 (TypeContainer.GetMethods): New public method; formerly known as
9401 Interface.GetMethod(). This is used by PendingImplementation.
9402 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
9403 it's now private and non-static.
9404 (Interface): Moved this here; it's now implemented similar to
9406 (Method, Property, Event, Indexer): Added `bool is_interface'
9407 argument to their .ctor's.
9408 (MemberBase.IsInterface): New public field.
9410 * cs-parser.jay: Create normal Method, Property, Event, Indexer
9411 instances instead of InterfaceMethod, InterfaceProperty, etc.
9412 (opt_interface_base): Removed; we now use `opt_class_base' instead.
9413 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
9415 2004-03-19 Martin Baulig <martin@ximian.com>
9417 * class.cs (MethodCore.IsDuplicateImplementation): New private
9418 method which does the CS0111 checking.
9419 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
9420 Use IsDuplicateImplementation().
9422 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
9424 * decl.cs (FindMemberToOverride): New method to find the correct
9425 method or property to override in the base class.
9427 - Make Method/Property use the above method to find the
9428 version in the base class.
9429 - Remove the InheritableMemberSignatureCompare as it is now
9432 This patch makes large code bases much faster to compile, as it is
9433 O(n) rather than O(n^2) to do this validation.
9435 Also, it fixes bug 52458 which is that nested classes are not
9436 taken into account when finding the base class member.
9438 Reviewed/Approved by Martin.
9440 2004-03-17 Marek Safar <marek.safar@seznam.cz>
9442 * interface.cs: In all interface classes removed redundant
9443 member initialization.
9445 2004-03-16 Martin Baulig <martin@ximian.com>
9447 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9449 2004-03-15 Miguel de Icaza <miguel@ximian.com>
9451 * decl.cs (DefineTypeAndParents): New helper method to define a
9452 type's containers before the type itself is defined; This is a
9453 bug exposed by the recent changes to Windows.Forms when an
9454 implemented interface was defined inside a class that had not been
9457 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
9459 (Check): Loop correctly to report errors modifiers
9460 (UNSAFE was not in the loop, since it was the same as TOP).
9462 * interface.cs: Every interface member now takes a ModFlags,
9463 instead of a "is_new" bool, which we set on the base MemberCore.
9465 Every place where we called "UnsafeOk" in the interface, now we
9466 call the proper member (InterfaceMethod.UnsafeOK) instead to get
9467 the unsafe settings from the member declaration instead of the
9468 container interface.
9470 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
9472 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
9473 `set_indexer_name' to the pending bits (one per type).
9475 We fixed a bug today that was picking the wrong method to
9476 override, since for properties the existing InterfaceMethod code
9477 basically ignored the method name. Now we make sure that the
9478 method name is one of the valid indexer names.
9480 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
9482 * support.cs (SeekableStreamReader): Keep track of stream byte
9483 positions and don't mix them with character offsets to the buffer.
9485 Patch from Gustavo Giráldez
9487 2004-03-15 Marek Safar <marek.safar@seznam.cz>
9489 * interface.cs (InterfaceSetGetBase): Removed double member
9490 initialization, base class does it as well.
9492 2004-03-13 Martin Baulig <martin@ximian.com>
9494 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
9495 when compiling corlib.
9497 2004-03-13 Miguel de Icaza <miguel@ximian.com>
9499 * convert.cs (ExplicitConversion): We were reporting an error on
9500 certain conversions (object_type source to a value type, when the
9501 expression was `null') before we had a chance to pass it through
9502 the user defined conversions.
9504 * driver.cs: Replace / and \ in resource specifications to dots.
9507 * class.cs: Add check for duplicate operators. Fixes 52477
9509 2004-03-11 Miguel de Icaza <miguel@ximian.com>
9511 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
9512 that are in the middle of the statements, not only at the end.
9515 * class.cs (TypeContainer.AddField): No longer set the
9516 `HaveStaticConstructor' flag, now we call it
9517 `UserDefineStaticConstructor' to diferentiate the slightly
9518 semantic difference.
9520 The situation is that we were not adding BeforeFieldInit (from
9521 Modifiers.TypeAttr) to classes that could have it.
9522 BeforeFieldInit should be set to classes that have no static
9527 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
9529 And most importantly Zoltan's comment:
9531 http://bugzilla.ximian.com/show_bug.cgi?id=44229
9533 "I think beforefieldinit means 'it's ok to initialize the type sometime
9534 before its static fields are used', i.e. initialization does not need
9535 to be triggered by the first access to the type. Setting this flag
9536 helps the JIT to compile better code, since it can run the static
9537 constructor at JIT time, and does not need to generate code to call it
9538 (possibly lots of times) at runtime. Unfortunately, mcs does not set
9539 this flag for lots of classes like String.
9541 csc sets this flag if the type does not have an explicit static
9542 constructor. The reasoning seems to be that if there are only static
9543 initalizers for a type, and no static constructor, then the programmer
9544 does not care when this initialization happens, so beforefieldinit
9547 This bug prevents the AOT compiler from being usable, since it
9548 generates so many calls to mono_runtime_class_init that the AOT code
9549 is much slower than the JITted code. The JITted code is faster,
9550 because it does not generate these calls if the vtable is type is
9551 already initialized, which is true in the majority of cases. But the
9552 AOT compiler can't do this."
9554 2004-03-10 Miguel de Icaza <miguel@ximian.com>
9556 * class.cs (MethodData.Emit): Refactor the code so symbolic
9557 information is generated for destructors; For some reasons we
9558 were taking a code path that did not generate symbolic information
9561 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
9563 * class.cs: Create a Constructor.CheckBase method that
9564 takes care of all validation type code. The method
9565 contains some code that was moved from Define.
9567 It also includes new code that checks for duplicate ctors.
9568 This fixes bug #55148.
9570 2004-03-09 Joshua Tauberer <tauberer@for.net>
9572 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
9573 a { ... }-style array creation invokes EmitStaticInitializers
9574 which is not good for reference-type arrays. String, decimal
9575 and now null constants (NullCast) are not counted toward
9576 static initializers.
9578 2004-03-05 Martin Baulig <martin@ximian.com>
9580 * location.cs (SourceFile.HasLineDirective): New public field;
9581 specifies whether the file contains or is referenced by a "#line"
9583 (Location.DefineSymbolDocuments): Ignore source files which
9584 either contain or are referenced by a "#line" directive.
9586 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
9588 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
9589 direct access to our parent, so check the method inline there.
9591 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
9593 * expression.cs (Invocation.EmitCall): Miguel's last commit
9594 caused a regression. If you had:
9599 In Foo the implict this would be null.
9601 2004-02-27 Miguel de Icaza <miguel@ximian.com>
9603 * expression.cs (Invocation.EmitCall): If the method is not
9604 virtual, do not emit a CallVirt to it, use Call.
9606 * typemanager.cs (GetFullNameSignature): Improve the method to
9607 cope with ".ctor" and replace it with the type name.
9609 * class.cs (ConstructorInitializer.Resolve): Now the method takes
9610 as an argument the ConstructorBuilder where it is being defined,
9611 to catch the recursive constructor invocations.
9613 2004-02-26 Miguel de Icaza <miguel@ximian.com>
9615 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
9616 routines to check if a type is an enumerable/enumerator allow
9617 classes that implement the IEnumerable or IEnumerator interfaces.
9619 * class.cs (Property, Operator): Implement IIteratorContainer, and
9620 implement SetYields.
9622 (Property.Define): Do the block swapping for get_methods in the
9623 context of iterators. We need to check if Properties also
9624 include indexers or not.
9626 (Operator): Assign the Block before invoking the
9627 OperatorMethod.Define, so we can trigger the Iterator code
9630 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
9631 Property and Operator classes are not created when we parse the
9632 declarator but until we have the block completed, so we use a
9633 singleton SimpleIteratorContainer.Simple to flag whether the
9634 SetYields has been invoked.
9636 We propagate this setting then to the Property or the Operator to
9637 allow the `yield' to function.
9639 2004-02-25 Marek Safar <marek.safar@seznam.cz>
9641 * codegen.cs: Implemented attribute support for modules.
9642 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
9643 Assembly/Module functionality.
9645 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
9646 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
9647 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
9649 2004-02-16 Marek Safar <marek.safar@seznam.cz>
9651 * interface.cs (FindMembers): The operation is performed on all base
9652 interfaces and not only on the first. It is required for future CLS Compliance patch.
9654 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
9656 * statement.cs, codegen.cs:
9657 This patch deals with patterns such as:
9659 public class List : IEnumerable {
9661 public MyEnumerator GetEnumerator () {
9662 return new MyEnumerator(this);
9665 IEnumerator IEnumerable.GetEnumerator () {
9669 public struct MyEnumerator : IEnumerator {
9674 Before, there were a few things we did wrong:
9675 1) we would emit callvirt on a struct, which is illegal
9676 2) we emited ldarg when we needed to emit ldarga
9677 3) we would mistakenly call the interface methods on an enumerator
9678 type that derived from IEnumerator and was in another assembly. For example:
9680 public class MyEnumerator : IEnumerator
9682 Would have the interface methods called, even if there were public impls of the
9683 method. In a struct, this lead to invalid IL code.
9685 2004-02-11 Marek Safar <marek.safar@seznam.cz>
9687 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
9690 * delegate.cs (Define): Fixed crash when delegate type is undefined.
9692 2004-02-11 Miguel de Icaza <miguel@ximian.com>
9694 * cs-parser.jay: Fix small regression: we were not testing V2
9695 compiler features correctly.
9697 * interface.cs: If the emit context is null, then create one
9699 2004-02-09 Marek Safar <marek.safar@seznam.cz>
9701 * decl.cs (GetSignatureForError): New virtual method to get full name
9704 * attribute.cs (IAttributeSupport): New interface for attribute setting.
9705 Now it is possible to rewrite ApplyAttributes method to be less if/else.
9707 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
9708 Duplicated members and code in these classes has been removed.
9709 Better encapsulation in these classes.
9711 2004-02-07 Miguel de Icaza <miguel@ximian.com>
9713 * assign.cs (Assign.DoResolve): When dealing with compound
9714 assignments, there is a new rule in ECMA C# 2.4 (might have been
9715 there before, but it is documented here) that states that in:
9719 If b is of type int, and the `op' is a shift-operator, then the
9720 above is evaluated as:
9724 * expression.cs (Binary.ResolveOperator): Instead of testing for
9725 int/uint/long/ulong, try to implicitly convert to any of those
9726 types and use that in pointer arithmetic.
9728 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
9729 method to print information for from the type, not from the
9730 null-method we were given.
9732 2004-02-01 Duncan Mak <duncan@ximian.com>
9734 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
9735 parsing for cmd, fixes bug #53694.
9737 2004-02-04 Marek Safar <marek.safar@seznam.cz>
9739 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
9740 in the member name duplication tests. Property and operator name duplication
9741 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
9743 2004-02-03 Marek Safar <marek.safar@seznam.cz>
9745 * interface.cs (PopulateMethod): Fixed crash when interface method
9746 returns not existing type (error test cs0246-3.cs).
9748 2004-02-02 Ravi Pratap M <ravi@ximian.com>
9750 * cs-parser.jay (interface_accessors): Re-write actions to also
9751 store attributes attached to get and set methods. Fix spelling
9754 (inteface_property_declaration): Modify accordingly.
9756 (InterfaceAccessorInfo): New helper class to store information to pass
9757 around between rules that use interface_accessors.
9759 * interface.cs (Emit): Apply attributes on the get and set
9760 accessors of properties and indexers too.
9762 * attribute.cs (ApplyAttributes): Modify accordingly to use the
9763 right MethodBuilder when applying attributes to the get and set accessors.
9765 2004-01-31 Miguel de Icaza <miguel@ximian.com>
9767 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
9769 2004-01-26 Miguel de Icaza <miguel@ximian.com>
9771 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
9773 2004-01-25 Miguel de Icaza <miguel@ximian.com>
9775 * cs-parser.jay: Remove YIELD token, instead use the new grammar
9776 changes that treat `yield' specially when present before `break'
9779 * cs-tokenizer.cs: yield is no longer a keyword.
9781 2004-01-23 Marek Safar <marek.safar@seznam.cz>
9783 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
9784 setting for default constructors.
9785 For default constructors are almost every time set wrong Modifier. The
9786 generated IL code has been alright. But inside mcs this values was
9787 wrong and this was reason why several of my CLS Compliance tests
9790 2004-01-22 Martin Baulig <martin@ximian.com>
9792 * cs-parser.jay (namespace_or_type_name): Return an Expression,
9793 not a QualifiedIdentifier. This is what `type_name_expression'
9794 was previously doing.
9795 (type_name_expression): Removed; the code is now in
9796 `namespace_or_type_name'.
9797 (qualified_identifier): Removed, use `namespace_or_type_name'
9799 (QualifiedIdentifier): Removed this class.
9801 2004-01-22 Martin Baulig <martin@ximian.com>
9803 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
9804 not a string as alias name.
9806 2004-01-21 Miguel de Icaza <miguel@ximian.com>
9808 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
9809 #52730 bug, and instead compute correctly the need to use a
9810 temporary variable when requesting an address based on the
9811 static/instace modified of the field and the constructor.
9813 2004-01-21 Martin Baulig <martin@ximian.com>
9815 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
9816 class and namespace before looking up aliases. Fixes #52517.
9818 2004-01-21 Martin Baulig <martin@ximian.com>
9820 * flowanalysis.cs (UsageVector.Merge): Allow variables being
9821 assinged in a 'try'; fixes exception4.cs.
9823 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9824 * class.cs : Implemented parameter-less constructor for TypeContainer
9826 * decl.cs: Attributes are now stored here. New property OptAttributes
9828 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
9830 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
9832 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9834 * typemanager.cs (CSharpSignature): Now reports also inner class name.
9835 (CSharpSignature): New method for indexer and property signature.
9837 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9839 * pending.cs (IsVirtualFilter): Faster implementation.
9841 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9843 * typemanager.cs: Avoid inclusion of same assembly more than once.
9845 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9847 * cs-parser.jay: Fixed problem where the last assembly attribute
9848 has been applied also to following declaration (class, struct, etc.)
9850 2004-01-21 Marek Safar <marek.safar@seznam.cz>
9852 * class.cs: Added error CS0538, CS0539 reporting.
9853 Fixed crash on Microsoft runtime when field type is void.
9855 * cs-parser.jay: Added error CS0537 reporting.
9857 * pending.cs: Added error CS0535 reporting.
9858 Improved error report for errors CS0536, CS0534.
9860 2004-01-20 Miguel de Icaza <miguel@ximian.com>
9862 Merge a few bits from the Anonymous Method MCS tree.
9864 * statement.cs (ToplevelBlock): New class for toplevel methods,
9865 will hold anonymous methods, lifted variables.
9867 * cs-parser.jay: Create toplevel blocks for delegates and for
9868 regular blocks of code.
9870 2004-01-20 Martin Baulig <martin@ximian.com>
9872 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
9873 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
9874 and `NeedExplicitReturn'; added `IsLastStatement'.
9875 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
9876 have a `ReturnLabel' or we're not unreachable.
9878 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
9879 child's reachability; don't just override ours with it. Fixes
9880 #58058 (lluis's example).
9881 (FlowBranching): Added public InTryOrCatch(), InCatch(),
9882 InFinally(), InLoop(), InSwitch() and
9883 BreakCrossesTryCatchBoundary() methods.
9885 * statement.cs (Return): Do all error checking in Resolve().
9886 Unless we are the last statement in a top-level block, always
9887 create a return label and jump to it.
9888 (Break, Continue): Do all error checking in Resolve(); also make
9889 sure we aren't leaving a `finally'.
9890 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
9891 statement in a top-level block.
9892 (Block.Flags): Added `IsDestructor'.
9893 (Block.IsDestructor): New public property.
9895 2004-01-20 Martin Baulig <martin@ximian.com>
9897 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
9899 2004-01-20 Martin Baulig <martin@ximian.com>
9901 * statement.cs (Statement.ResolveUnreachable): New public method.
9902 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
9903 (Block.Resolve): Resolve unreachable statements.
9905 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
9907 * expression.cs: We need to fix the case where we do
9908 not have a temp variable here.
9910 * assign.cs: Only expression compound assignments need
9911 temporary variables.
9913 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
9915 * flowanalysis.cs: Reduce memory allocation in a few ways:
9916 - A block with no variables should not allocate a bit
9918 - A method with no out parameters does not need any tracking
9919 for assignment of the parameters, so we need not allocate
9922 public readonly Type[] VariableTypes;
9923 public readonly string[] VariableNames;
9924 Are redundant. The data is already stored in the variable
9925 map, so we need not allocate another array for it.
9926 - We need to add alot of checks for if (params | locals) == null
9927 due to the first two changes.
9929 2004-01-18 Miguel de Icaza <miguel@ximian.com>
9931 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
9932 implement IMemoryLocation, we store a copy on a local variable and
9933 take the address of it. Patch from Benjamin Jemlich
9935 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
9936 to use a special "type_name_expression" rule which reduces the
9937 number of "QualifiedIdentifier" classes created, and instead
9938 directly creates MemberAccess expressions.
9940 2004-01-17 Miguel de Icaza <miguel@ximian.com>
9942 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
9943 that fixes #52853. Null literal assignment to ValueType
9945 * class.cs (MethodData.Emit): Instead of checking the name of the
9946 method to determine if its a destructor, create a new derived
9947 class from Method called Destructor, and test for that.
9949 * cs-parser.jay: Create a Destructor object instead of a Method.
9951 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
9955 2004-01-16 Miguel de Icaza <miguel@ximian.com>
9957 * expression.cs (Binary.ResolveOperator): Perform an implicit
9958 conversion from MethodGroups to their delegate types on the
9961 * delegate.cs: Introduce a new class DelegateCreation that is the
9962 base class for `NewDelegate' and `ImplicitDelegateCreation',
9963 factor some code in here.
9965 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
9966 conversion from MethodGroups to compatible delegate types.
9968 * ecore.cs (Expression.Resolve): Do not flag error 654
9969 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
9970 we allow conversions from MethodGroups to delegate types now.
9972 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
9973 assignments in v2 either.
9975 2004-01-10 Miguel de Icaza <miguel@ximian.com>
9977 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
9978 static read-only fields in ctors.
9980 Applied patch from Benjamin Jemlich
9982 * expression.cs (UnaryMutator): Avoid leaking local variables.
9984 2004-01-09 Miguel de Icaza <miguel@ximian.com>
9986 * cs-tokenizer.cs (IsCastToken): Allow the various native types
9987 here to return true, as they can be used like this:
9991 Fixed 49836 and all the other dups
9993 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
9995 * driver.cs: Implement /win32res and /win32icon.
9997 2004-01-08 Miguel de Icaza <miguel@ximian.com>
9999 * cs-parser.jay: Add a rule to improve error handling for the
10000 common mistake of placing modifiers after the type.
10002 2004-01-07 Miguel de Icaza <miguel@ximian.com>
10004 * cs-parser.jay (interface_event_declaration): Catch
10005 initialization of events on interfaces, and report cs0068
10007 * cs-parser.jay (interface_event_declaration): Catch
10008 initialization of events.
10010 * ecore.cs: Better report missing constructors.
10012 * expression.cs (Binary.ResolveOperator): My previous bug fix had
10013 the error reporting done in the wrong place. Fix.
10015 * expression.cs (Binary.ResolveOperator): Catch the
10016 operator + (E x, E y) error earlier, and later allow for implicit
10017 conversions in operator +/- (E e, U x) from U to the underlying
10020 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
10021 52596, if the container class is abstract, the default constructor
10022 is protected otherwise its public (before, we were always public).
10024 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
10027 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
10028 Jemlich that fixes bug #52597, MCS was generating invalid code for
10029 idisposable structs. Thanks to Ben for following up with this
10032 2004-01-06 Miguel de Icaza <miguel@ximian.com>
10034 * driver.cs: Allow assemblies without code to be generated, fixes
10037 2004-01-07 Nick Drochak <ndrochak@gol.com>
10039 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
10041 2004-01-05 Miguel de Icaza <miguel@ximian.com>
10043 * cs-parser.jay: Add rules to improve error reporting if fields or
10044 methods are declared at the namespace level (error 116)
10046 * Add rules to catch event add/remove
10048 2004-01-04 David Sheldon <dave-mono@earth.li>
10050 * expression.cs: Added matching ")" to error message for
10053 2004-01-03 Todd Berman <tberman@gentoo.org>
10055 * ecore.cs, attribute.cs:
10056 Applying fix from #52429.
10058 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10060 * ecore.cs, expression.cs, statement.cs:
10061 Total rewrite of how we handle branching. We
10062 now handle complex boolean expressions with fewer
10063 jumps. As well if (x == 0) no longer emits a ceq.
10065 if (x is Foo) is much faster now, because we generate
10068 Overall, we get a pretty big improvement on our benchmark
10069 tests. The code we generate is smaller and more readable.
10071 I did a full two-stage bootstrap. The patch was reviewed
10072 by Martin and Miguel.
10074 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10076 * cs-parser.jay: Make primary_expression not take a QI.
10077 we dont need this because the member_access rule covers
10078 us here. So we replace the rule with just IDENTIFIER.
10080 This has two good effects. First, we remove a s/r conflict.
10081 Second, we allocate many fewer QualifiedIdentifier objects.
10083 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10085 * attribute.cs: Handle MarshalAs attributes as pseudo, and
10086 set the correct information via SRE. This prevents
10087 hanging on the MS runtime. Fixes #29374.
10089 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
10091 * convert.cs: correctly handle conversions to value types
10092 from Enum and ValueType as unboxing conversions.
10094 Fixes bug #52569. Patch by Benjamin Jemlich.
10096 2004-01-02 Ravi Pratap <ravi@ximian.com>
10098 * expression.cs (BetterConversion): Prefer int -> uint
10099 over int -> ulong (csc's behaviour). This fixed bug #52046.
10101 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
10103 * decl.cs (MemberCache.FindMembers): now returns a
10106 * typemanager.cs: In general, go with with ^^.
10107 (CopyNewMethods): take an IList.
10108 (RealMemberLookup): Only allocate an arraylist
10109 if we copy from two sets of methods.
10111 This change basically does two things:
10112 1) Fewer array lists allocated due to CopyNewMethods.
10113 2) the explicit cast in MemberList costed ALOT.
10115 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
10117 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
10118 a hashtable to avoid needless string allocations when an identifier is
10119 used more than once (the common case).
10121 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
10123 * pending.cs: MS's TypeBuilder.GetInterfaces ()
10124 is broken, it will not return anything. So, we
10125 have to use the information we have in mcs to
10128 * typemanager.cs: Add a cache for GetInterfaces,
10129 since this will now be used more often (due to ^^)
10131 (GetExplicitInterfaces) New method that gets the
10132 declared, not effective, interfaces on a type
10133 builder (eg, if you have interface IFoo, interface
10134 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
10137 This patch makes MCS able to bootstrap itself on
10140 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
10142 * expression.cs: Remove the Nop's that Miguel put
10145 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10147 * report.cs, codegen.cs: Give the real stack trace to
10148 the error when an exception is thrown.
10150 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10152 * decl.cs: only allocate hashtables for ifaces if
10155 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
10157 * expression.cs: fix the error from cs0121-2.cs
10158 (a parent interface has two child interfaces that
10159 have a function with the same name and 0 params
10160 and the function is called through the parent).
10162 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
10164 * class.cs, rootcontext.cs, typmanager.cs: do not
10167 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
10169 * codegen.cs: remove stack for the ec flow branching.
10170 It is already a linked list, so no need.
10172 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
10174 * Makefile: Allow custom profiler here.
10176 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
10178 * typemanager.cs (LookupType):
10179 - Use a static char [], because split takes
10180 a param array for args, so it was allocating
10182 - Do not store true in a hashtable, it boxes.
10184 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
10186 * flowanalysis.cs: bytify common enums.
10188 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10190 * modifiers.cs: Add a new set of flags for the
10191 flags allowed on explicit interface impls.
10192 * cs-parser.jay: catch the use of modifiers in
10193 interfaces correctly.
10194 * class.cs: catch private void IFoo.Blah ().
10196 All related to bug #50572.
10198 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10200 * decl.cs: Rewrite the consistant accessability checking.
10201 Accessability is not linear, it must be implemented in
10202 a tableish way. Fixes #49704.
10204 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
10206 * expression.cs: Handle negation in a checked context.
10207 We must use subtraction from zero. Fixes #38674.
10209 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
10211 * class.cs: Ignore static void main in DLLs.
10212 * rootcontext.cs: Handle the target type here,
10213 since we are have to access it from class.cs
10214 * driver.cs: account for the above.
10216 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
10218 * report.cs: Give line numbers and files if available.
10220 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
10222 * driver.cs: Implement /addmodule.
10224 * typemanager.cs: Change 'modules' field so it now contains Modules not
10227 2003-12-20 Martin Baulig <martin@ximian.com>
10229 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
10230 (FieldBase.IsAssigned): Removed this field.
10231 (FieldBase.SetAssigned): New public method.
10232 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
10234 2003-12-20 Martin Baulig <martin@ximian.com>
10236 * expression.cs (LocalVariableReference.DoResolve): Don't set
10237 `vi.Used' if we're called from DoResolveLValue().
10239 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
10240 returns the usage vector it just merged into the current one -
10241 pass this one to UsageWarning().
10242 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
10243 of the `EmitContext', don't call this recursively on our children.
10245 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
10247 * driver.cs: Implement /target:module.
10249 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
10251 * support.cs (CharArrayHashtable): New helper class.
10253 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
10254 char arrays, not strings, so we can avoid creating a string in
10255 consume_identifier if the identifier is a keyword.
10257 2003-12-16 Martin Baulig <martin@ximian.com>
10259 * statement.cs (LocalInfo.Assigned): Removed this property.
10260 (LocalInfo.Flags): Removed `Assigned'.
10261 (LocalInfo.IsAssigned): New public method; takes the EmitContext
10262 and uses flow analysis.
10263 (Block.UsageWarning): Made this method private.
10264 (Block.Resolve): Call UsageWarning() if appropriate.
10266 * expression.cs (LocalVariableReference.DoResolve): Always set
10267 LocalInfo.Used here.
10269 2003-12-13 Martin Baulig <martin@ximian.com>
10271 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
10272 any value here; we're now using flow analysis to figure out
10273 whether a statement/block returns a value.
10275 2003-12-13 Martin Baulig <martin@ximian.com>
10277 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
10279 (FlowBranching.MergeFinally): Don't call
10280 `branching.CheckOutParameters()' here, this is called in
10282 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
10283 when adding the `finally' vector.
10285 2003-12-13 Martin Baulig <martin@ximian.com>
10288 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
10289 actually work and also fix #48962.
10291 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
10293 * decl.cs: Do not check System.Object for nested types,
10294 since we know it does not have any. Big bang for buck:
10297 Run 1: 8.35 seconds
10298 Run 2: 8.32 seconds
10299 corlib: 17.99 seconds
10301 Run 1: 8.17 seconds
10302 Run 2: 8.17 seconds
10303 corlib: 17.39 seconds
10305 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
10307 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
10308 time we are returning 0 members, so we save alot here.
10310 2003-12-11 Martin Baulig <martin@ximian.com>
10312 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
10313 `MergeChild()', also just take the `FlowBranching' as argument;
10314 call Merge() on it and return the result.
10315 (FlowBranching.Merge): We don't need to do anything if we just
10318 2003-12-11 Martin Baulig <martin@ximian.com>
10320 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
10321 them in an `ArrayList' to reduce memory usage. Thanks to Ben
10322 Maurer for this idea.
10324 2003-12-11 Martin Baulig <martin@ximian.com>
10326 * flowanalysis.cs (MergeResult): This class is now gone; we now
10327 use the `UsageVector' for this. The reason for this is that if a
10328 branching just has one sibling, we don't need to "merge" them at
10329 all - that's the next step to do.
10330 (FlowBranching.Merge): We now return a `UsageVector' instead of a
10333 2003-12-11 Martin Baulig <martin@ximian.com>
10335 Reworked flow analyis and made it more precise and bug-free. The
10336 most important change is that we're now using a special `Reachability'
10337 class instead of having "magic" meanings of `FlowReturns'. I'll
10338 do some more cleanups and optimizations and also add some more
10339 documentation this week.
10341 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
10342 largely reworked this class.
10343 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
10344 the new `Reachability' class instead of having "magic" values here.
10345 (FlowBranching): We're now using an instance of `Reachability'
10346 instead of having separate `Returns', `Breaks' etc. fields.
10348 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
10349 based on flow analysis; ignore the return value of block.Emit ().
10351 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
10353 * driver.cs typemanager.cs: Find the mono extensions to corlib even
10354 if they are private.
10356 2003-12-09 Martin Baulig <martin@ximian.com>
10358 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
10359 call them directly on the UsageVector.
10361 2003-12-09 Martin Baulig <martin@ximian.com>
10363 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
10364 Changed return type from `FlowReturns' to `Reachability'.
10366 2003-12-09 Martin Baulig <martin@ximian.com>
10368 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
10369 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
10370 `Reachable' fields with a single `Reachability' one.
10372 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10374 * class.cs (FindMembers): Remove foreach's.
10379 Run 1: 8.74 seconds
10380 Run 2: 8.71 seconds
10383 Run 1: 8.64 seconds
10384 Run 2: 8.58 seconds
10387 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10392 This patch does a few things:
10393 1. EmptyStatement is now a singleton, so it is never reallocated.
10394 2. All blah is EmptyStatement constructs have been changed to
10395 blah == EmptyStatement.Value, which is much faster and valid
10396 now that EmptyStatement is a singleton.
10397 3. When resolving a block, rather than allocating a new array for
10398 the non-empty statements, empty statements are replaced with
10399 EmptyStatement.Value
10400 4. Some recursive functions have been made non-recursive.
10401 Mainly the performance impact is from (3), however (1) and (2) are needed for
10402 this to work. (4) does not make a big difference in normal situations, however
10403 it makes the profile look saner.
10408 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10409 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10410 Total memory allocated: 56397 KB
10413 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
10414 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
10415 Total memory allocated: 55666 KB
10417 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10419 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
10420 than the hashtable in a hashtable version
10422 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
10423 we always end up concating a string. This results in a huge perf
10424 loss, because many strings have to be tracked by the GC. In this
10425 patch, we first use a hashtable that works with two keys, so that
10426 the strings do not need to be concat'ed.
10430 Run 1: 8.74 seconds
10431 Run 2: 8.71 seconds
10434 Run 1: 8.65 seconds
10435 Run 2: 8.56 seconds
10437 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
10439 * Makefile: Add a new target `do-time' that does a quick and simple
10440 profile, leaving easy to parse output.
10442 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
10444 * codegen.cs (Init): Create the dynamic assembly with
10445 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
10447 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
10449 * support.cs: Make the PtrHashtable use only one
10450 instance of its comparer.
10452 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
10454 * typemanager.cs: Fix lookup of GetNamespaces.
10456 2003-11-29 Miguel de Icaza <miguel@ximian.com>
10458 * expression.cs: Removed redundant line.
10460 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
10461 ArrayLists, use for loops with bounds.
10463 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
10466 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
10467 arraylists, use for loop with bounds.
10469 The above three changes give us a 0.071 second performance
10470 improvement out of 3.294 seconds down to 3.223. On my machine
10471 the above changes reduced the memory usage by 1,387 KB during
10472 compiler bootstrap.
10474 * cs-parser.jay (QualifiedIdentifier): New class used to represent
10475 QualifiedIdentifiers. Before we created a new string through
10476 concatenation, and mostly later on, the result would be
10477 manipulated by DecomposeQI through string manipulation.
10479 This reduced the compiler memory usage for bootstrapping from
10480 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
10481 compile times in 0.05 seconds.
10483 2003-11-28 Dick Porter <dick@ximian.com>
10485 * support.cs: Do string compares with the Invariant culture.
10493 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
10494 the comparison is done with the Invariant culture.
10496 2003-11-27 Miguel de Icaza <miguel@ximian.com>
10498 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
10499 GetEnumerator method.
10501 (ProbeCollectionType): Iterate starting at the most specific type
10502 upwards looking for a GetEnumerator
10504 * expression.cs: Shift count can be up to 31 for int/uint and 63
10507 2003-11-26 Miguel de Icaza <miguel@ximian.com>
10509 * statement.cs (Block.LookupLabel): Also look for the label on the
10510 children blocks. Use a hash table to keep track of visited
10513 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
10514 we actually did transform the other operand, otherwise fall back
10515 to the common codepath that casts to long.
10517 * cs-tokenizer.cs: Use the same code pattern as the int case.
10518 Maybe I should do the parsing myself, and avoid depending on the
10519 Parse routines to get this done.
10521 2003-11-25 Miguel de Icaza <miguel@ximian.com>
10523 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
10524 which fixes bug 51347. This time test it.
10526 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
10527 attributes for example can not tell the difference between these.
10528 The difference was only a syntax feature of the language.
10530 * attribute.cs: Apply attributes to delegates.
10532 * delegate.cs: Call the apply attributes method.
10534 2003-11-24 Miguel de Icaza <miguel@ximian.com>
10536 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
10537 comparing 0 vs Byte.MinValue, not the value
10539 (ImplicitConversionRequired): When reporting a conversion error,
10540 use error 31 to print out the constant error instead of the
10543 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
10544 which fixes bug 51347.
10546 2003-11-22 Miguel de Icaza <miguel@ximian.com>
10548 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
10549 which fixes the -warnaserror command line option.
10551 2003-11-21 Miguel de Icaza <miguel@ximian.com>
10553 * cfold.cs (DoNumericPromotions): During constant folding of
10554 additions on UIntConstant, special case intconstants with
10555 IntConstants like we do on the expression binary operator.
10557 2003-11-12 Miguel de Icaza <miguel@ximian.com>
10559 * convert.cs (ImplicitReferenceConversion): We were missing a case
10560 (System.Enum are not value types or class types, so we need to
10561 classify them separatedly).
10563 * driver.cs: We do not support error 2007.
10565 2003-11-12 Jackson Harper <jackson@ximian.com>
10567 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
10568 system directory. Also use the full file name so users can
10569 libraries names mscorlib-o-tron.dll in a non system dir.
10571 2003-11-10 Martin Baulig <martin@ximian.com>
10573 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
10574 (TypeManager.InitCoreTypes): Initialize them here, but instead of
10575 calling `ResolveType()' on them, directly assign their `Type'.
10577 2003-11-08 Martin Baulig <martin@ximian.com>
10579 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
10580 return value and the `out parent' parameter.
10581 (TypeContainer.DefineType): Moved the CS0644 check into
10582 GetClassBases(). Don't pass the interface types to the
10583 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
10584 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
10586 * ecore.cs (TypeExpr.IsAttribute): New property.
10587 (TypeExpr.GetInterfaces): New method.
10589 * interface.cs (Interface.GetInterfaceTypeByName): Return a
10590 TypeExpr instead of a Type.
10591 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
10592 (Interface.DefineType): Don't pass the interface types to the
10593 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
10594 them later and then call `TypeBulider.AddInterfaceImplementation()'.
10596 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
10597 instead of a `Type[]'.
10598 (TypeManager.RegisterBuilder): Likewise.
10599 (TypeManager.AddUserInterface): Likewise.
10600 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
10601 `Type[]' and also return a `TypeExpr[]'.
10602 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
10604 2003-11-08 Martin Baulig <martin@ximian.com>
10606 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
10609 2003-11-08 Martin Baulig <martin@ximian.com>
10611 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
10612 TypeManager.ResolveExpressionTypes().
10614 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
10615 instead of an Expression.
10616 (TypeExpr): This is now an abstract base class for `TypeExpression'.
10617 (TypeExpression): New public class; formerly known as `TypeExpr'.
10619 * expression.cs (ComposedCast): Derive from TypeExpr.
10621 * typemanager.cs (TypeManager.system_*_expr): These are now
10622 TypExpr's instead of Expression's.
10623 (TypeManager.ResolveExpressionTypes): New public static function;
10624 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
10627 2003-11-06 Miguel de Icaza <miguel@ximian.com>
10629 * expression.cs (New.DoResolve): Do not dereference value that
10630 might be a null return.
10632 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
10633 sure that the constant value has the right type. Fixes an
10634 unreported bug, similar to 50425.
10636 * const.cs (Const.LookupConstantValue): Call
10637 ImplicitStandardConversionExists before doing a conversion to
10638 avoid havng the TypeManager.ChangeType do conversions.
10640 Reduced the number of casts used
10642 (Const.ChangeType): New routine to enable reuse of the constant
10643 type changing code from statement.
10645 * typemanager.cs (ChangeType): Move common initialization to
10646 static global variables.
10650 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
10651 every value type to go through, even if it was void. Fix that.
10653 * cs-tokenizer.cs: Use is_identifier_start_character on the start
10654 character of the define, and the is_identifier_part_character for
10655 the rest of the string.
10657 2003-11-05 Miguel de Icaza <miguel@ximian.com>
10659 * expression.cs (UnaryMutator.EmitCode): When I updated
10660 LocalVariableReference.DoResolve, I overdid it, and dropped an
10661 optimization done on local variable references.
10663 2003-11-04 Miguel de Icaza <miguel@ximian.com>
10665 * ecore.cs: Convert the return from Ldlen into an int.
10667 2003-10-20 Miguel de Icaza <miguel@ximian.com>
10669 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
10670 the accessibility, this is a special case for toplevel non-public
10671 classes (internal for instance).
10673 2003-10-20 Nick Drochak <ndrochak@gol.com>
10675 * ecore.cs: Fix typo and build. Needed another right paren.
10677 2003-10-19 Miguel de Icaza <miguel@ximian.com>
10679 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
10680 `internal' case regular and protected, but not allowing protected
10681 to be evaluated later. Bug 49840
10683 2003-10-15 Miguel de Icaza <miguel@ximian.com>
10685 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
10686 to kb.Nlast, and not the kb.nFirst to isolate the switch
10689 Extract the underlying type, so enumerations of long/ulong are
10690 treated like long/ulong.
10692 2003-10-14 Miguel de Icaza <miguel@ximian.com>
10694 * expression.cs (New): Overload the meaning of RequestedType to
10695 track the possible creation of the NewDelegate type, since
10696 DoResolve is invoked more than once for new constructors on field
10699 See bugs: #48800 and #37014
10701 * cs-parser.jay (declare_local_constants): Take an arraylist
10702 instead of a single constant.
10704 (local_constant_declaration): It should take a
10705 constant_declarators, not a constant_declarator. Fixes 49487
10707 * convert.cs: Fix error report.
10709 2003-10-13 Jackson Harper <jackson@ximian.com>
10711 * typemanager.cs (TypeToCoreType): Add float and double this fixes
10714 2003-10-09 Martin Baulig <martin@ximian.com>
10716 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
10718 (MethodCore.DoDefineParameters): Removed the TypeContainer
10719 argument; use the DeclSpace which was passed to the .ctor instead.
10720 (MethodCore.CheckParameter): Take a DeclSpace instead of a
10721 TypeContainer; we only need a DeclSpace here.
10723 2003-10-09 Martin Baulig <martin@ximian.com>
10725 * class.cs (MethodData): Added additional `DeclSpace ds' argument
10727 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
10728 EmitContext's .ctor.
10730 2003-10-09 Martin Baulig <martin@ximian.com>
10732 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
10733 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
10734 AsAccessible(), moved them as well.
10736 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
10738 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
10740 * cs-parser.jay : Renamed yyName to yyNames related to jay.
10742 2003-10-07 Miguel de Icaza <miguel@ximian.com>
10744 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
10745 generation for >=, as spotted by Paolo, bug 48679.
10746 Patch from David Waite.
10748 * cs-tokenizer.cs: Add handling for #pragma.
10750 * cs-parser.jay: Allow for both yield and yield return in the
10751 syntax. The anti-cobolization of C# fight will go on!
10753 * class.cs (TypeBuilder.DefineType): Catch error condition here
10754 (Parent.DefineType erroring out and returning null).
10756 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10757 coping with enumerations variables, we were mistakenly processing
10758 them as a regular value type instead of built-in types. Fixes the
10761 * typemanager.cs (IsBuiltinOrEnum): New method.
10763 2003-09-30 Miguel de Icaza <miguel@ximian.com>
10765 * cs-parser.jay: Upgrade: yield now needs the return clause.
10767 2003-09-19 Martin Baulig <martin@ximian.com>
10769 * decl.cs (MemberCache.SetupCacheForInterface): Take a
10770 `MemberCache parent' argument. Normally, an interface doesn't
10771 have a parent type except System.Object, but we use this in gmcs
10772 for generic type parameters.
10774 2003-09-18 Martin Baulig <martin@ximian.com>
10776 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
10777 on `type.IsInterface'; don't check whether the type has a parent
10778 to determine whether it's an interface.
10780 2003-09-15 Martin Baulig <martin@ximian.com>
10782 * class.cs (TypeContainer.DefineType): Added an error flag to
10783 avoid reporting duplicate CS0146's ("class definition is
10786 * driver.cs (Driver.MainDriver): Abort if
10787 RootContext.ResolveTree() reported any errors.
10789 2003-09-07 Martin Baulig <martin@ximian.com>
10791 * report.cs (Error, Warning): Added overloaded versions which take
10792 a `params object[] args' and call String.Format().
10794 2003-09-07 Martin Baulig <martin@ximian.com>
10796 * decl.cs (DeclSpace..ctor): Don't call
10797 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
10798 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
10799 (DeclSpace.RecordDecl): New method.
10801 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
10803 2003-09-02 Ravi Pratap <ravi@ximian.com>
10805 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
10806 value attributes to be applied to ParameterBuilders.
10808 * class.cs (MethodCore.LabelParameters): Make static and more
10809 generic so that it can be used from other places - like interface
10810 methods, for instance.
10812 * interface.cs (Interface.Emit): Call LabelParameters before
10813 emitting attributes on the InterfaceMethod.
10815 2003-08-26 Martin Baulig <martin@ximian.com>
10817 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
10818 resolving aliases; fixes #47927.
10820 2003-08-26 Martin Baulig <martin@ximian.com>
10822 * statement.cs (Using.DoResolve): This is internally emitting a
10823 try/finally clause, so we need to set ec.NeedExplicitReturn if we
10824 do not always return. Fixes #47681.
10826 2003-08-26 Martin Baulig <martin@ximian.com>
10828 * decl.cs (MemberCore): Moved WarningNotHiding(),
10829 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
10831 (AdditionResult): Make this nested in DeclSpace.
10832 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
10833 argument; call NamespaceEntry.Define() unless we're nested in a
10836 * namespace.cs (Namespace.DefineName): New public function. This
10837 is called from DeclSpace's .ctor to add
10838 (Namespace.Lookup): Include DeclSpaces in the lookup.
10840 * class.cs (Operator): Derive from MemberBase, not MemberCore.
10842 * const.cs (Const): Derive from MemberBase, not MemberCore.
10844 2003-08-25 Martin Baulig <martin@ximian.com>
10846 * convert.cs (Convert.ExplicitReferenceConversion): When
10847 converting from an interface type to a class, unbox if the target
10848 type is a struct type. Fixes #47822.
10850 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10852 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
10855 2003-08-22 Martin Baulig <martin@ximian.com>
10857 * class.cs (TypeManager.DefineType): When defining a nested type,
10858 call DefineType() on our parent; fixes #47801.
10860 2003-08-22 Martin Baulig <martin@ximian.com>
10862 * class.cs (MethodData.Define): While checking if a method is an
10863 interface implementation, improve the test a bit more to fix #47654.
10865 2003-08-22 Martin Baulig <martin@ximian.com>
10867 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
10868 correctly; fixes #47722.
10870 2003-08-22 Martin Baulig <martin@ximian.com>
10872 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
10873 LocalVariableReference, ensure it's not read-only. Fixes #47536.
10875 * statement.cs (Fixed.DoResolve): Make all variables read-only.
10877 2003-08-22 Martin Baulig <martin@ximian.com>
10879 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
10880 can only be assigned in static constructors. Fixes #47161.
10882 2003-08-22 Martin Baulig <martin@ximian.com>
10884 Rewrote and improved the flow analysis code.
10886 * flowbranching.cs (FlowBranching): Make this class abstract.
10887 (FlowBranching.CreateBranching): New static function to create a
10888 new flow branching.
10889 (FlowBranchingBlock, FlowBranchingException): New classes.
10890 (FlowBranching.UsageVector.Type): New public readonly field.
10891 (FlowBranching.UsageVector.Breaks): Removed the setter.
10892 (FlowBranching.UsageVector.Returns): Removed the setter.
10893 (FlowBranching.UsageVector): Added Break(), Return(),
10894 NeverReachable() and Throw() methods to modify the reachability.
10895 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
10896 done by FlowBranching.Merge().
10897 (FlowBranching.UsageVector.MergeChild): New method; merges the
10898 merge result into the current vector.
10899 (FlowBranching.Merge): New abstract method to merge a branching.
10901 2003-08-12 Martin Baulig <martin@ximian.com>
10903 * expression.cs (Indirection.CacheTemporaries): Create the
10904 LocalTemporary with the pointer type, not its element type.
10906 2003-08-10 Miguel de Icaza <miguel@ximian.com>
10908 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
10909 token was a keyword or not.
10911 Add `error' options where an IDENTIFIER was expected; Provide
10912 CheckToken and CheckIdentifierToken convenience error reporting
10915 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
10917 * decl.cs: Rename `NamespaceEntry Namespace' public field into
10918 NameSpaceEntry NameSpaceEntry.
10920 (LookupInterfaceOrClass): Avoid creating a full qualified name
10921 from namespace and name: avoid doing lookups when we know the
10922 namespace is non-existant. Use new Tree.LookupByNamespace which
10923 looks up DeclSpaces based on their namespace, name pair.
10925 * driver.cs: Provide a new `parser verbose' to display the
10926 exception thrown during parsing. This is turned off by default
10927 now, so the output of a failure from mcs is more graceful.
10929 * namespace.cs: Track all the namespaces defined in a hashtable
10932 (IsNamespace): New method
10934 2003-08-09 Miguel de Icaza <miguel@ximian.com>
10936 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
10937 we know that we need to concatenate (full typename can never be
10942 * statement.cs: Use a bitfield; Do not initialize to null things
10943 which are done by the constructor by default.
10945 * cs-parser.jay: bug fix, parameter was 4, not 3.
10947 * expression.cs: Just use the property;
10949 * statement.cs: No need for GetVariableInfo method.
10951 2003-08-08 Martin Baulig <martin@ximian.com>
10953 * flowanalysis.cs (FlowReturns): This is now nested in the
10954 `FlowBranching' class.
10955 (MyBitVector): Moved this here from statement.cs.
10956 (FlowBranching.SiblingType): New enum type.
10957 (FlowBranching.CreateSibling): Added `SiblingType' argument.
10959 2003-08-07 Martin Baulig <martin@ximian.com>
10961 * flowanalysis.cs (FlowBranchingType): This is now nested in the
10962 `FlowBranching' class and called `BranchingType'.
10964 2003-08-07 Martin Baulig <martin@ximian.com>
10966 * flowanalysis.cs: Moved all the control flow analysis code into
10969 2003-08-07 Martin Baulig <martin@ximian.com>
10971 * assign.cs (Assign.DoResolve): `target' must either be an
10972 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
10975 2003-08-07 Miguel de Icaza <miguel@ximian.com>
10977 * expression.cs (BinaryMethod): This kind of expression is created by the
10978 Binary class if it determines that the operator has to be handled
10981 (BinaryDelegate): This kind of expression is created if we are
10982 dealing with a + or - operator on delegates.
10984 (Binary): remove method, argumetns, and DelegateOperator: when
10985 dealing with methods,
10987 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
10989 * statement.cs (Block): use bitfields for the three extra booleans
10990 we had in use. Remove unused topblock parameter.
10992 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
10994 * assign.cs: Drop extra unneeded tests.
10996 2003-08-06 Miguel de Icaza <miguel@ximian.com>
10998 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
11000 * statement.cs (Foreach): Use VariableStorage instead of
11003 * codegen.cs (VariableStorage): New class used by clients that
11004 require a variable stored: locals or fields for variables that
11005 need to live across yield.
11007 Maybe provide a convenience api for EmitThis+EmitLoad?
11009 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
11012 2003-08-05 Miguel de Icaza <miguel@ximian.com>
11014 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
11015 RemapParameterLValue): New methods that are used to turn a
11016 precomputed FieldInfo into an expression like this:
11020 The idea is to use this instead of making LocalVariableReference
11021 have more than one meaning.
11023 * cs-parser.jay: Add error production to BASE.
11025 * ecore.cs: Deal with TypeManager.GetField returning null, which
11026 is now a valid return value.
11028 (FieldExprNoAddress): New expression for Fields whose address can
11031 * expression.cs (LocalVariableReference): During the resolve
11032 phases, create new expressions if we are in a remapping context.
11033 Remove code that dealt with remapping here.
11035 (ParameterReference): same.
11037 (ProxyInstance): New expression, like the `This' expression, but
11038 it is born fully resolved. We know what we are doing, so remove
11039 the errors that are targeted to user-provided uses of `this'.
11041 * statement.cs (Foreach): our variable is now stored as an
11042 Expression; During resolution, follow the protocol, dont just
11043 assume it will return this.
11045 2003-08-06 Martin Baulig <martin@ximian.com>
11047 * support.cs (SeekableStreamReader.cs): New public class.
11049 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
11050 SeekableStreamReader instead of the normal StreamReader.
11052 2003-08-04 Martin Baulig <martin@ximian.com>
11054 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
11055 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
11056 deambiguate casts and delegate invocations.
11057 (parenthesized_expression): Use the new tokens to ensure this is
11058 not a cast of method invocation.
11060 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
11061 when reading a `)' and Deambiguate_CloseParens () was previously
11064 * expression.cs (ParenthesizedExpression): New class. This is
11065 just used for the CS0075 test.
11066 (Binary.DoResolve): Check for CS0075.
11068 2003-07-29 Ravi Pratap <ravi@ximian.com>
11070 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
11071 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
11072 reference comparison.
11074 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
11075 examine the ReturnType for equality - this is necessary in the
11076 cases of implicit and explicit operators whose signature also
11077 includes the return type.
11079 2003-07-26 Miguel de Icaza <miguel@ximian.com>
11081 * namespace.cs: Cache the result of the namespace computation,
11082 instead of computing it every time.
11084 2003-07-24 Miguel de Icaza <miguel@ximian.com>
11086 * decl.cs: Use a global arraylist that we reuse over invocations
11087 to avoid excesive memory consumption. Reduces memory usage on an
11088 mcs compile by one meg (45 average).
11090 * typemanager.cs (LookupTypeReflection): In .NET pointers are
11091 private, work around that.
11093 2003-07-23 Miguel de Icaza <miguel@ximian.com>
11095 * literal.cs (IntLiteral): Define Zero and One static literals.
11097 * cs-parser.jay (integer_literal): use static literals to reduce
11098 memory usage for the most used literals (0, 1 and -1). 211kb
11099 reduced in memory usage.
11101 Replace all calls to `new ArrayList' with `new
11102 ArrayList(4)' which is a good average number for most allocations,
11103 and also requires only 16 bytes of memory for its buffer by
11106 This reduced MCS memory usage in seven megabytes for the RSS after
11109 2003-07-28 Ravi Pratap <ravi@ximian.com>
11111 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
11112 handle params methods the correct way by forming only one
11113 applicable set with params and normal methods in them. Earlier we
11114 were looking at params methods only if we found no normal methods
11115 which was not the correct thing to do.
11117 (Invocation.BetterFunction): Take separate arguments indicating
11118 when candidate and the best method are params methods in their
11121 This fixes bugs #43367 and #46199.
11123 * attribute.cs: Documentation updates.
11125 (CheckAttribute): Rename to CheckAttributeTarget.
11126 (GetValidPlaces): Rename to GetValidTargets.
11128 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
11129 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
11133 2003-07-28 Martin Baulig <martin@ximian.com>
11135 * class.cs (TypeContainer.DefineMembers): Use the base type's full
11136 name when looking up the base class of a nested class. Fixes #46977.
11138 2003-07-26 Martin Baulig <martin@ximian.com>
11140 * expression.cs (Indexers.Indexer): New nested struct; contains
11141 getter, setter and the indexer's type.
11142 (Indexers.Properties): This is now an ArrayList of
11143 Indexers.Indexer's.
11144 (IndexerAccess.DoResolveLValue): Correctly set the type if the
11145 indexer doesn't have any getters.
11147 * assign.cs (Assign.DoResolve): Also do the implicit conversions
11148 for embedded property and indexer assignments.
11150 2003-07-26 Martin Baulig <martin@ximian.com>
11152 * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
11153 preprocessor directive is not the first non-whitespace character
11156 2003-07-26 Martin Baulig <martin@ximian.com>
11158 * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
11159 namespace parsing, follow the spec more closely.
11161 * rootcontext.cs (RootContext.NamespaceLookup): Use the new
11162 NamespaceEntry.Lookup().
11164 2003-07-25 Martin Baulig <martin@ximian.com>
11166 * MethodCore.cs (OverridesSomething): New public field; it's set
11167 from TypeContainer.DefineMembers if this method overrides
11168 something (which doesn't need to be a method). Fix #39462.
11170 2003-07-25 Ravi Pratap <ravi@ximian.com>
11172 * typemanager.cs (GetMembers): Ensure that the list of members is
11173 reversed. This keeps things in sync.
11175 * attribute.cs (Attribute.CheckAttribute): Break as soon as we
11176 find an AttributeUsage attribute.
11178 * expression.cs (Invocation.OverloadResolve): Perform the check
11179 which disallows Invoke to be directly called on a Delegate.
11181 (Error_InvokeOnDelegate): Report error cs1533.
11183 2003-07-25 Martin Baulig <martin@ximian.com>
11185 * expression.cs (Indexers.GetIndexersForType): Only look in the
11186 interface hierarchy if the requested type is already an
11187 interface. Fixes #46788 while keeping #46502 fixed.
11189 2003-07-25 Martin Baulig <martin@ximian.com>
11191 * class.cs (TypeContainer.DefineMembers): Check whether all
11192 readonly fields have been assigned and report warning CS0649 if
11195 * statement.cs (LocalInfo.IsFixed): Always return true if this is
11198 2003-07-24 Ravi Pratap <ravi@ximian.com>
11200 * decl.cs (MemberCache.AddMethods): Reverse the order of the array
11201 returned from GetMethods to make things consistent with the
11202 assumptions MCS makes about ordering of methods.
11204 This should comprehensively fix bug #45127 and it does :-)
11206 * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
11207 ordering is actually reverse.
11209 * Clean up some debug messages I left lying around.
11211 * interface.cs (Populate*): Get rid of code which emits attributes
11212 since the stage in which we emit attributes is the 'Emit' stage,
11213 not the define stage.
11215 (Emit): Move attribute emission for interface members here.
11217 2003-07-22 Ravi Pratap <ravi@ximian.com>
11219 * expression.cs (Invocation.OverloadResolve): Follow the spec more
11220 closely: we eliminate methods in base types when we have an
11221 applicable method in a top-level type.
11223 Please see section 14.5.5.1 for an exact description of what goes
11226 This fixes bug #45127 and a host of other related to corlib compilation.
11228 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
11229 array is the method corresponding to the top-level type (this is
11230 because of the changes made to icall.c) so we change this
11233 (MethodGroupExpr.Name): This too.
11235 * typemanager.cs (GetElementType): New method which does the right
11236 thing when compiling corlib.
11238 * everywhere: Make use of the above in the relevant places.
11240 2003-07-22 Martin Baulig <martin@ximian.com>
11242 * cs-parser.jay (invocation_expression): Moved
11243 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
11244 `cast_expression', but create a InvocationOrCast which later
11245 resolves to either an Invocation or a Cast.
11247 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
11248 method; call this before EmitStatement() to make sure that this
11249 expression can be used as a statement.
11251 * expression.cs (InvocationOrCast): New class; resolves to either
11252 an Invocation or a Cast.
11254 * statement.cs (StatementExpression): Call ResolveStatement() on
11255 the ExpressionStatement before emitting it.
11257 2003-07-21 Martin Baulig <martin@ximian.com>
11259 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
11260 `ref' and `out' attributes match; fixes #46220.
11261 (MemberAccess.ResolveMemberAccess): You can't reference a type
11262 through an expression; fixes #33180.
11263 (Indexers.GetIndexersForType): Don't return the indexers from
11264 interfaces the class implements; fixes #46502.
11266 2003-07-21 Martin Baulig <martin@ximian.com>
11268 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
11269 CS0661 checks; fixes bug #30442.
11271 2003-07-21 Martin Baulig <martin@ximian.com>
11273 * decl.cs (AdditionResult): Added `Error'.
11275 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
11277 * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
11278 makes cs0031.cs actually work.
11280 2003-07-20 Martin Baulig <martin@ximian.com>
11282 * namespace.cs: Fixed that bug which caused a crash when compiling
11283 the debugger's GUI.
11285 2003-07-20 Miguel de Icaza <miguel@ximian.com>
11287 * typemanager.cs (LookupTypeReflection): Never expose types which
11288 are NotPublic, NestedPrivate, NestedAssembly, or
11289 NestedFamANDAssem. We used to return these, and later do a check
11290 that would report a meaningful error, but the problem is that we
11291 would not get the real match, if there was a name override.
11293 2003-07-18 Miguel de Icaza <miguel@ximian.com>
11295 * namespace.cs (Namespace, Name): Do not compute the namespace
11296 name dynamically, compute it in the constructor. This reduced
11297 memory usage by 1697 KB.
11299 * driver.cs: Use --pause to pause at the end.
11301 2003-07-17 Peter Williams <peter@newton.cx>
11303 * Makefile: Change the name of the test target so that it doesn't
11304 conflict with the recursive test target.
11306 2003-07-17 Miguel de Icaza <miguel@ximian.com>
11308 * expression.cs (LocalVariableReference.Emit, EmitAssign,
11309 AddressOf): Do not use EmitThis, that was wrong, use the actual
11312 2003-07-15 Miguel de Icaza <miguel@ximian.com>
11314 * class.cs (MethodData.Define): While checking if a method is an
11315 interface implementation, improve the test: If we are not public
11316 (use new test here: use the computed MethodAttributes directly,
11317 instead of the parsed modifier flags) check if the `implementing'
11318 method comes from an interface or not.
11320 * pending.cs (VerifyPendingMethods): Slightly better error
11323 * makefile: add test target that does the mcs bootstrap.
11325 2003-07-16 Ravi Pratap <ravi@ximian.com>
11327 * interface.cs (Define): Do nothing here since there are no
11328 members to populate etc. Move the attribute emission out of here
11329 since this was just totally the wrong place to put it. Attribute
11330 application happens during the 'Emit' phase, not in the 'Define'
11333 (Emit): Add this method and move the attribute emission here
11335 * rootcontext.cs (EmitCode): Call the Emit method on interface
11338 2003-07-14 Ravi Pratap M <ravi@ximian.com>
11340 * expression.cs (OverloadResolve): Report error only if Location
11341 is not 'Null' which means that there was a probe going on.
11343 2003-07-14 Martin Baulig <martin@ximian.com>
11345 * expression.cs (ConditionalLogicalOperator): New public class to
11346 implement user defined conditional logical operators.
11347 This is section 14.11.2 in the spec and bug #40505.
11349 2003-07-14 Martin Baulig <martin@ximian.com>
11351 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
11353 2003-07-14 Martin Baulig <martin@ximian.com>
11355 * codegen.cs (EmitContext.InFixedInitializer): New public field.
11357 * ecore.cs (IVariable.VerifyFixed): New interface method.
11359 * expression.cs (Unary.ResolveOperator): When resolving the `&'
11360 operator, check whether the variable is actually fixed. Fixes bug
11361 #36055. Set a variable definitely assigned when taking its
11362 address as required by the spec.
11364 * statement.cs (LocalInfo.IsFixed): New field.
11365 (LocalInfo.MakePinned): Set `IsFixed' to true.
11367 2003-07-14 Ravi Pratap M <ravi@ximian.com>
11369 * attribute.cs (Attribute.Resolve): While doing a Member lookup
11370 for .ctors, ensure that we only ask for members declared in the
11371 attribute type (BindingFlags.DeclaredOnly).
11375 * expression.cs (Error_WrongNumArguments): Report error 1501
11376 correctly the way CSC does.
11378 2003-07-13 Martin Baulig <martin@ximian.com>
11380 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
11381 lookup on the fully qualified name, to make things like "X.X" work
11382 where "X.X" is a fully qualified type name, but we also have a
11383 namespace "X" in the using list. Fixes #41975.
11385 2003-07-13 Martin Baulig <martin@ximian.com>
11387 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
11388 function. If we're a CompoundAssign, we need to create an embedded
11389 CompoundAssign, not an embedded Assign.
11390 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
11393 2003-07-13 Martin Baulig <martin@ximian.com>
11395 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
11396 work to fix bug #46088.
11398 2003-07-13 Ravi Pratap <ravi@ximian.com>
11400 * class.cs (Operator.Emit): Do not emit attributes here - it is
11401 taken care of by the Method class that we delegate too. This takes
11402 care of bug #45876.
11404 2003-07-10 Martin Baulig <martin@ximian.com>
11406 * expression.cs (TypeOfVoid): New class.
11407 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
11409 2003-07-10 Martin Baulig <martin@ximian.com>
11411 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
11414 2003-07-10 Martin Baulig <martin@ximian.com>
11416 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
11417 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
11419 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
11421 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
11423 2003-07-10 Martin Baulig <martin@ximian.com>
11425 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
11426 of decimal. Fixes #42850.
11428 NOTE: I also fixed the created byte blob, but this doesn't work on
11429 the MS runtime and csc never produces any byte blobs for decimal
11432 2003-07-10 Martin Baulig <martin@ximian.com>
11434 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
11435 structs; fixes #32068.
11436 (Block.AddChildVariableNames): Fixed #44302.
11438 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11440 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
11442 2003-07-07 Miguel de Icaza <miguel@ximian.com>
11444 * attribute.cs: And this test is onger needed.
11446 2003-07-08 Martin Baulig <martin@ximian.com>
11448 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
11449 inaccessible types. Fixes #36313.
11451 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
11453 * namespace.cs (NamespaceEntry): Create implicit entries for all
11454 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
11455 implicit entries for N1.N2 and N1.
11457 2003-07-08 Martin Baulig <martin@ximian.com>
11459 Rewrote the handling of namespaces to fix a lot of the issues
11460 wrt. `using' aliases etc.
11462 * namespace.cs (Namespace): Splitted this class into a
11463 per-assembly `Namespace' and a per-file `NamespaceEntry'.
11465 * typemanager.cs (TypeManager.IsNamespace): Removed.
11466 (TypeManager.ComputeNamespaces): Only compute namespaces from
11467 loaded assemblies here, not the namespaces from the assembly we're
11468 currently compiling.
11470 2003-07-08 Martin Baulig <martin@ximian.com>
11472 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
11474 2003-07-07 Miguel de Icaza <miguel@ximian.com>
11476 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
11479 I thought about the memory savings here, but LookupTypeReflection
11480 is used under already very constrained scenarios. Compiling
11481 corlib or mcs only exposes one hit, so it would not really reduce
11482 any memory consumption.
11484 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
11486 * typemanager.cs: fixes bug #45889 by only adding public types from
11487 other assemblies to the list of known types.
11489 2003-07-07 Miguel de Icaza <miguel@ximian.com>
11491 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
11492 on the type we resolved.
11494 2003-07-05 Martin Baulig <martin@ximian.com>
11496 * pending.cs (PendingImplementation.ParentImplements): Don't
11497 create the proxy if the parent is abstract.
11499 * class.cs (TypeContainer.DefineIndexers): Process explicit
11500 interface implementations first. Fixes #37714.
11502 2003-07-04 Miguel de Icaza <miguel@ximian.com>
11504 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
11505 defined recursively; but since we modify the input parameters
11506 (left is set to `this' temporarily), we reset this value if the
11507 left_is_explicit is false, which gives the original semantics to
11510 * literal.cs (NullPointer): new class used to represent a null
11511 literal in a pointer context.
11513 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
11514 type is a pointer, use a NullPointer object instead of a
11515 NullLiteral. Closes 43687
11517 (ExplicitConversion): Convert pointer values using
11518 the conv opcode to the proper type.
11520 * ecore.cs (New): change ValueTypeVariable property into a method,
11521 that returns whether the valuetype is suitable for being used.
11523 * expression.cs (Binary.DoNumericPromotions): Only return if we
11524 the int constant was a valid uint, and we can return both left and
11525 right as uints. If not, we continue processing, to trigger the
11526 type conversion. This fixes 39018.
11528 * statement.cs (Block.EmitMeta): During constant resolution, set
11529 the CurrentBlock property on the emitcontext, so that we resolve
11530 constants propertly.
11532 2003-07-02 Martin Baulig <martin@ximian.com>
11534 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
11535 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
11537 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
11538 than emitting it here.
11540 * statement.cs: Fixed some more flow analysis bugs.
11542 2003-07-02 Martin Baulig <martin@ximian.com>
11544 * class.cs (MethodData.Define): When implementing interface
11545 methods, set Final unless we're Virtual.
11547 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
11548 check work for interface methods.
11550 2003-07-01 Martin Baulig <martin@ximian.com>
11552 * ecore.cs (EmitContext.This): Replaced this property with a
11553 GetThis() method which takes a Location argument. This ensures
11554 that we get the correct error location for a CS0188.
11556 2003-07-01 Miguel de Icaza <miguel@ximian.com>
11558 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
11559 ImplicitStandardConversion.
11561 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
11563 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
11565 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
11568 2003-06-30 Miguel de Icaza <miguel@ximian.com>
11570 * class.cs (Constructor.Define): Turn off initlocals for unsafe
11573 (MethodData.Define): Turn off initlocals for unsafe methods.
11575 2003-06-29 Miguel de Icaza <miguel@ximian.com>
11577 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
11578 complete; Fixes #37521.
11580 * delegate.cs: Use Modifiers.TypeAttr to compute the
11581 TypeAttributes, instead of rolling our own. This makes the flags
11582 correct for the delegates.
11584 2003-06-28 Miguel de Icaza <miguel@ximian.com>
11586 * class.cs (Constructor.Define): Set the private flag for static
11587 constructors as well.
11589 * cs-parser.jay (statement_expression): Set the return value to
11590 null, to avoid a crash when we catch an error.
11592 2003-06-24 Miguel de Icaza <miguel@ximian.com>
11594 * cs-parser.jay: Applied patch from Jackson that adds support for
11595 extern and unsafe modifiers to destructor declarations.
11597 * expression.cs: Report error 21 if the user is trying to index a
11600 * driver.cs: Add an error message, suggested by the bug report.
11602 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
11603 if we do not have a ": this ()" constructor initializer. Fixes 45149
11605 2003-06-14 Miguel de Icaza <miguel@ximian.com>
11607 * namespace.cs: Add some information to reduce FAQs.
11609 2003-06-13 Miguel de Icaza <miguel@ximian.com>
11611 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
11612 underlying enumeration types. Fixes #43915.
11614 * expression.cs: Treat ushort/short as legal values to be used in
11615 bitwise operations.
11617 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
11619 * delegate.cs: transfer custom attributes for paramenters from
11620 the delegate declaration to Invoke and BeginInvoke.
11622 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
11624 * attribute.cs: handle custom marshalers and emit marshal info
11627 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
11629 * makefile.gnu: Added anonymous.cs to the compiler sources.
11631 2003-05-28 Miguel de Icaza <miguel@ximian.com>
11633 * iterators.cs: Change the name of the proxy class to include two
11636 * cs-parser.jay: Update grammar to include anonymous methods.
11638 * anonymous.cs: new file.
11640 2003-05-27 Miguel de Icaza <miguel@ximian.com>
11642 * class.cs (Field.Define): Add missing test for pointers and
11645 2003-05-27 Ravi Pratap <ravi@ximian.com>
11647 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
11648 we use the stobj opcode.
11650 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
11651 since it wasn't the correct fix.
11653 It still is puzzling that we are required to use stobj for IntPtr
11654 which seems to be a ValueType.
11656 2003-05-26 Miguel de Icaza <miguel@ximian.com>
11658 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
11659 during regular simple name resolution. Now, the trick is that
11660 instead of returning for processing the simplename, we do a
11661 TypeManager.LookupType (ie, a rooted lookup as opposed to a
11662 contextual lookup type). If a match is found, return that, if
11663 not, return for further composition.
11665 This fixes long-standing 30485.
11667 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11668 using the address to initialize an object, do an Stobj instead of
11669 using the regular Stelem.
11671 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
11672 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
11673 Because if we are a BaseIndexerAccess that value will be true.
11676 * statement.cs (GotoCase.Resolve): Return after reporting an
11677 error, do not attempt to continue.
11679 * expression.cs (PointerArithmetic.Emit): If our operand is a
11680 long, convert our constants to match the operand before
11681 multiplying. Convert to I type before adding. Fixes 43670.
11683 2003-05-14 Ravi Pratap <ravi@ximian.com>
11685 * enum.cs (ImplicitConversionExists) : Rename to
11686 ImplicitEnumConversionExists to remove ambiguity.
11688 * ecore.cs (NullCast): New type of cast expression class which
11689 basically is very similar to EmptyCast with the difference being
11690 it still is a constant since it is used only to cast a null to
11692 (eg. (string) null)
11694 * convert.cs (ImplicitReferenceConversion): When casting a null
11695 literal, we return a NullCast.
11697 * literal.cs (NullLiteralTyped): Remove - I don't see why this
11698 should be around anymore.
11700 The renaming (reported was slightly wrong). Corrections:
11702 ConvertImplicitStandard -> ImplicitConversionStandard
11703 ConvertExplicitStandard -> ExplicitConversionStandard
11705 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
11706 before passing them in !
11708 * convert.cs (ImplicitConversionStandard): When comparing for
11709 equal expr and target types, ensure that expr is not a
11712 In general, we must not be checking (expr_type ==
11713 target_type) in the top level conversion methods
11714 (ImplicitConversion, ExplicitConversion etc). This checking is
11715 done in the methods that they delegate to.
11717 2003-05-20 Miguel de Icaza <miguel@ximian.com>
11719 * convert.cs: Move Error_CannotConvertType,
11720 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
11721 ImplicitNumericConversion, ImplicitConversionExists,
11722 ImplicitUserConversionExists, StandardConversionExists,
11723 FindMostEncompassedType, FindMostSpecificSource,
11724 FindMostSpecificTarget, ImplicitUserConversion,
11725 ExplicitUserConversion, GetConversionOperators,
11726 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
11727 TryImplicitIntConversion, Error_CannotConvertImplicit,
11728 ConvertImplicitRequired, ConvertNumericExplicit,
11729 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
11730 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
11733 Perform the following renames:
11735 StandardConversionExists -> ImplicitStandardConversionExists
11736 ConvertImplicit -> ImplicitConversion
11737 ConvertImplicitStandard -> ImplicitStandardConversion
11738 TryImplicitIntConversion -> ImplicitIntConversion
11739 ConvertImplicitRequired -> ImplicitConversionRequired
11740 ConvertNumericExplicit -> ExplicitNumericConversion
11741 ConvertReferenceExplicit -> ExplicitReferenceConversion
11742 ConvertExplicit -> ExplicitConversion
11743 ConvertExplicitStandard -> ExplicitStandardConversion
11745 2003-05-19 Martin Baulig <martin@ximian.com>
11747 * statement.cs (TypeInfo.StructInfo): Made this type protected.
11748 (TypeInfo): Added support for structs having structs as fields.
11750 * ecore.cs (FieldExpr): Implement IVariable.
11751 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
11752 VariableInfo for the field.
11754 2003-05-18 Martin Baulig <martin@ximian.com>
11756 * expression.cs (This.DoResolve): Report a CS0027 if we're
11757 emitting a field initializer.
11759 2003-05-18 Martin Baulig <martin@ximian.com>
11761 * expression.cs (This.ResolveBase): New public function.
11762 (This.DoResolve): Check for CS0188.
11764 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
11767 * ecore.cs (MethodGroupExpr.DoResolve): Set the
11768 `instance_expression' to null if we don't have any non-static
11771 2003-05-18 Martin Baulig <martin@ximian.com>
11773 Reworked the way how local variables and parameters are handled by
11774 the flow analysis code.
11776 * statement.cs (TypeInfo, VariableMap): New public classes.
11777 (VariableInfo): New public class. This is now responsible for
11778 checking whether a variable has been assigned. It is used for
11779 parameters and local variables.
11780 (Block.EmitMeta): Take the InternalParameters as argument; compute
11781 the layout of the flow vectors here.
11782 (Block.LocalMap, Block.ParameterMap): New public properties.
11783 (FlowBranching): The .ctor doesn't get the InternalParameters
11784 anymore since Block.EmitMeta() now computes the layout of the flow
11786 (MyStructInfo): This class is now known as `StructInfo' and nested
11787 in `TypeInfo'; we don't access this directly anymore.
11789 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
11790 property and removed IsAssigned(), IsFieldAssigned(),
11791 SetAssigned() and SetFieldAssigned(); we now call them on the
11792 VariableInfo so we don't need to duplicate this code everywhere.
11794 * expression.cs (ParameterReference): Added `Block block' argument
11796 (LocalVariableReference, ParameterReference, This): The new
11797 VariableInfo class is now responsible for all the definite
11800 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
11801 IsParameterAssigned, SetParameterAssigned): Removed.
11803 2003-05-18 Martin Baulig <martin@ximian.com>
11805 * typemanager.cs (InitCoreTypes): Try calling
11806 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
11807 the 3-args-version. Corlib now also needs our `void_type'.
11808 (GetMethod): Added overloaded version which takes an optional
11809 `bool report_errors' to allow lookups of optional methods.
11811 2003-05-12 Martin Baulig <martin@ximian.com>
11813 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
11814 only used for locals and not for parameters.
11816 2003-05-12 Miguel de Icaza <miguel@ximian.com>
11818 * support.cs (InternalParameters.ParameterType): Return the
11819 ExternalType of the parameter.
11821 * parameter.cs (Parameter.ExternalType): drop the two arguments,
11824 2003-05-11 Miguel de Icaza <miguel@ximian.com>
11826 * class.cs (MethodData.Define): Do not set the `newslot' on
11827 interface members, if they are also flagged as "override".
11829 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
11830 better code for ++i and i++. This only works for static fields
11831 and local variables.
11833 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
11834 want to pull the DeclSpace out of the builder_to_declspace instead
11835 of the TypeBuilder (like in TypeContainer.FindMembers).
11837 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
11838 instead of LookupTypeContainer. Fixes the crash on .NET for
11839 looking up interface members.
11841 * const.cs: Create our own emit context during the Definition
11842 stage, so that constants are evaluated in the proper context, when
11843 a recursive definition happens.
11845 2003-05-11 Martin Baulig <martin@ximian.com>
11847 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
11848 new block for a switch section.
11849 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
11850 the adding/lookup in the switch block. Fixes #39828.
11852 2003-05-09 Miguel de Icaza <miguel@ximian.com>
11854 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
11855 functionality: I needed to convert the data after I had performed
11856 the add/sub operation into the operands type size.
11858 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
11859 pass the type for the box operation, otherwise the resulting
11860 object would have been of type object.
11862 (BoxedCast): Add constructor to specify the type to box as.
11864 2003-05-07 Miguel de Icaza <miguel@ximian.com>
11866 * iterators.cs: I was reusing the `count' variable inadvertently,
11867 take steps to not allow this to happen.
11869 2003-05-06 Miguel de Icaza <miguel@ximian.com>
11871 * attribute.cs (Attribute.Resolve): Params attributes are encoded
11872 by creating an array at the point where the params starts and
11873 putting all those arguments there, then adjusting the size of the
11876 2003-05-05 Miguel de Icaza <miguel@ximian.com>
11878 * expression.cs (New.AddressOf): Implement interface
11879 IMemoryLocation. This is used when the `new' operator is used in
11880 the context of an invocation to a method on a value type.
11882 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
11885 * namespace.cs: Also check the using aliases here.
11887 * driver.cs: Move the test for using validity after the types have
11888 been entered, so we do a single pass that also includes the using
11891 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
11892 in the regular case. CreateSiblingForFinally is doing extra
11895 * attribute.cs (GetAttributeArgumentExpression): Store the result
11896 on an out value, and use the return value to indicate failure
11897 instead of using null (which is a valid return for Constant.GetValue).
11899 * statement.cs: Perform the analysis flow for the increment
11900 portion after the statement, because this will be the real flow of
11901 execution. Fixes #42385
11903 * codegen.cs (EmitContext.EmitArgument,
11904 EmitContext.EmitStoreArgument): New helper functions when the
11905 RemapToProxy flag is set.
11907 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
11910 Add support for remapping parameters.
11912 * iterators.cs: Propagate parameter values; Store parameter
11913 values in the proxy classes.
11915 2003-05-04 Miguel de Icaza <miguel@ximian.com>
11917 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
11918 need a proxy reference; I do not know what I was thinking
11920 * cs-parser.jay (constructor_initializer): catch another error,
11921 and display nice message.
11923 (field_declaration): catch void field declaration
11924 to flag a better error.
11926 * class.cs (MemberBase.CheckBase): Report an error instead of a
11927 warning if a new protected member is declared in a struct.
11928 (Field.Define): catch the error of readonly/volatile.
11930 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
11932 (FieldExpr.AddressOf): ditto. Catch error where the address of a
11933 volatile variable is taken
11935 2003-05-02 Miguel de Icaza <miguel@ximian.com>
11937 * statement.cs (Fixed.Resolve): Report an error if we are not in
11940 2003-05-01 Miguel de Icaza <miguel@ximian.com>
11942 * typemanager.cs: reuse the code that handles type clashes for
11943 delegates and enumerations.
11945 * class.cs (Report28): Always report.
11947 * expression.cs (EncodeAsAttribute): Allow nulls here.
11949 2003-04-28 Miguel de Icaza <miguel@ximian.com>
11951 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
11952 the functionality for testing whether an expression is valid for
11953 an attribute here. Also handle the case of arrays of elements
11956 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
11957 encoding a linear array into an array of objects that are suitable
11958 to be passed to an CustomAttributeBuilder.
11960 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
11962 * ecore.cs: (FieldExpr): Handle field remapping here.
11964 * iteratators.cs: Pass the instance variable (if the method is an
11965 instance method) to the constructors, so we can access the field
11966 variables on the class.
11968 TODO: Test this with structs. I think the THIS variable on
11969 structs might have to be a pointer, and not a refenrece
11971 2003-04-27 Miguel de Icaza <miguel@ximian.com>
11973 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
11974 local variables to fields in a proxy class.
11976 * iterators.cs (PopulateProxy): Rename our internal fields to
11978 Create a <THIS> field if we are an instance method, so we can
11979 reference our parent container variables.
11980 (MapVariable): Called back from the EmitContext code to enter a
11981 new variable to field mapping into the proxy class (we just create
11985 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
11986 for using the remapped locals to fields.
11988 I placed the code here, because that gives the same semantics to
11989 local variables, and only changes the Emit code.
11991 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
11992 statements inside iterators.
11993 (VariableInfo): Add a FieldBuilder for the cases when we are
11994 remapping local variables to fields in a proxy class
11996 * ecore.cs (SimpleNameResolve): Avoid testing two times for
11997 current_block != null.
11999 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
12000 not cope with strings, as it has been moved to the
12001 TableSwitchEmit. Fixed bug in switch generation.
12003 * expression.cs (New.DoResolve): Provide more context for the user
12004 when reporting an error.
12006 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
12009 * expression.cs (MemberAccess.DoResolve): When we get a type back,
12010 check the permissions for it. Note than in a type-resolution
12011 context the check was already present in DeclSpace.ResolveType,
12012 but was missing from the MemberAccess.
12014 (ArrayCreation.CheckIndices): warn if the user has
12015 more nested levels of expressions, but there are no more
12016 dimensions specified. Avoids crash on bug 41906.
12018 2003-04-26 Miguel de Icaza <miguel@ximian.com>
12020 * statement.cs (Block): replace Implicit bool, for a generic
12022 New flag: `Unchecked'. This is used during the EmitMeta phase
12023 (which is out-of-line with the regular Resolve/Emit process for a
12024 statement, as this is done ahead of time, but still gets a chance
12025 to call constant resolve).
12027 (Block.Flags): new enum for adding a new flag.
12029 (Block.EmitMeta): track the state of unchecked.
12031 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
12032 to enable constant resolution to work there as well.
12034 2003-04-22 Miguel de Icaza <miguel@ximian.com>
12036 * typemanager.cs (ienumerable_type): Also look up
12037 System.Collections.IEnumerable.
12039 2003-04-21 Miguel de Icaza <miguel@ximian.com>
12041 TODO: Test more than one conditional per method.
12043 * class.cs (Indexer.Define): Report the location where the user is
12044 referencing the unsupported feature.
12046 (MethodData): Overload the use of `conditionals' to
12047 minimize the creation of needless ArrayLists. This saves roughly
12048 212kb on my machine.
12050 (Method): Implement the new IIteratorContainer interface.
12051 (Method.SetYields): Implement the method by setting the ModFlags
12052 to contain METHOD_YIELDS.
12054 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
12055 which just got set to null.
12057 * iterators.cs: New file.
12059 (Yield, YieldBreak): New statements.
12061 * statement.cs (Return.Resolve): Flag an error if we are used in
12062 an iterator method.
12064 * codegen.cs (InIterator): New flag set if the code is being
12065 compiled in an iterator method.
12067 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
12068 internal modifier, and we just use it to avoid adding extra
12069 fields, as this is seldom used.
12071 * cs-parser.jay: Add yield_statement (yield and yield break).
12073 * driver.cs: New flag -v2 to turn on version 2 features.
12075 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
12076 hashtable when v2 is enabled.
12078 2003-04-20 Miguel de Icaza <miguel@ximian.com>
12080 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
12081 there is already a namespace defined with this name.
12083 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
12084 people upgraded their corlibs.
12086 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
12087 always use fully qualified types, no need to use the compiler
12090 (TypeManager.IsNamespace): Use binarysearch.
12092 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
12093 AddDelegate): I did not quite use the new IsValid API properly: I
12094 have to pass the short-name and the fullname. I was passing only
12095 the basename instead of the fullname sometimes.
12097 (TypeContainer.DefineType): call NamespaceClash.
12099 * interface.cs (Interface.DefineType): use NamespaceClash before
12102 * delegate.cs (Delegate.DefineType): use NamespaceClash before
12105 * enum.cs: (Enum.DefineType): use NamespaceClash before
12108 * typemanager.cs (: 3-line patch that gives us some tasty 11%
12109 speed increase. First, use the negative_hits cache when we get a
12110 negative. Second, add the type with its full original name
12111 instead of the new . and + encoded name (reflection uses + to
12112 separate type from a nested type). Use LookupTypeReflection
12113 directly which bypasses the type->name hashtable (that we already
12114 know does not contain the type.
12116 * decl.cs (DeclSpace.ResolveTypeExpr): track the
12117 location/container type.
12119 * driver.cs: When passing utf8, use directly the UTF8Encoding.
12121 2003-04-19 Miguel de Icaza <miguel@ximian.com>
12123 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
12125 * delegate.cs (NewDelegate.Resolve): Test whether an instance
12126 method is being referenced in the method group from a static
12127 context, and report error 120 if so.
12129 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
12132 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
12133 is created, we create the A namespace).
12135 * cs-parser.jay: A namespace also introduces a DeclarationFound.
12138 2003-04-18 Miguel de Icaza <miguel@ximian.com>
12140 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
12141 invocation to ModuleBuilder.GetType with the same values will
12142 return a new type instance, so we need to cache its return
12145 * expression.cs (Binary.ResolveOperator): Only allow the compare
12146 operators on enums if they are of the same type.
12148 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
12149 types of ValueType on their own case. Before we were giving them
12150 the same treatment as objects.
12152 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
12153 fullname. Short name is used to compare against container name.
12154 Fullname is used to check against defined namespace names.
12156 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
12157 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
12159 (Method.CheckBase): Call parent.
12160 (MemberBase.CheckBase): Check for protected members on sealed
12162 (PropertyBase.CheckBase): Call parent.
12163 (Field.Define): Call parent.
12165 * report.cs: Negative error codes are now mapped to 8000 - code,
12166 so that the display is render more nicely.
12168 * typemanager.cs: Do not use try/catch, instead report a regular
12171 (GetPointerType, GetReferenceType): These methods provide
12172 mechanisms to obtain the T* and T& from a T. We had the code
12173 previously scattered around the code base, and it also used
12174 TypeManager.LookupType that would go through plenty of caches.
12175 This one goes directly to the type source.
12177 In some places we did the Type.GetType followed by
12178 ModuleBuilder.GetType, but not in others, so this unifies the
12179 processing as well.
12181 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
12182 statements now that we have namespace information.
12184 * typemanager.cs (IsNamespace): New method, returns whether the
12185 string presented is a namespace or not.
12187 (ComputeNamespaces): New public entry point, computes the list of
12188 available namespaces, using the GetNamespaces API call in Mono, or
12189 the slower version in MS.NET.
12191 Now before we start the semantic analysis phase, we have a
12192 complete list of namespaces including everything that the user has
12195 Deleted old code to cache namespaces in .nsc files.
12197 2003-04-17 Miguel de Icaza <miguel@ximian.com>
12199 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
12200 class/struct location definition Location for the implicit
12201 constructor location.
12203 (Operator.Define): Use the location of the operator for the
12204 implicit Method definition.
12206 (Constructor.Emit): use the constructor location for the implicit
12207 base initializer constructor.
12209 * ecore.cs: Remove ITypeExpression. This interface is now gone,
12210 and the Expression class now contains two new methods:
12212 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
12213 isolate type lookup from the rest of the resolution process.
12215 Since we use Expressions to hold type definitions due to the way
12216 we parse the input we have historically overloaded Resolve to
12217 perform the Type lookups if a special flag is passed. Now this is
12218 eliminated and two methods take their place.
12220 The differences in the two methods between xStep and xTerminal is
12221 that xStep is involved in our current lookup system that uses
12222 SimpleNames to compose a name, while xTerminal is used just to
12223 catch the case where the simplename lookup failed.
12225 2003-04-16 Miguel de Icaza <miguel@ximian.com>
12227 * expression.cs (ResolveMemberAccess): Remove redundant code.
12228 TypeExpr expressions are always born fully resolved.
12230 * interface.cs (PopulateMethod): Do not lookup the types twice.
12231 We were doing it once during SemanticAnalysis and once during
12234 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
12235 in local variable type definitions, were being returned as a
12236 SimpleName (we decomposed everything into a string), that is
12237 because primary_expression was being used instead of a type in the
12238 grammar (reduce/reduce conflicts).
12240 The part that was wrong is that we converted the expression into a
12241 string (an oversimplification in one hand, compounded with primary
12242 expressions doing string concatenation).
12248 Would return "A.B.C[]" as a SimpleName. This stopped things like
12249 using clauses from working on this particular context. And a type
12250 was being matched directly against "A.B.C[]".
12252 We now use the correct approach, and allow for ComposedCast to be
12253 part of the unary expression. So the "A.B.C []" become a composed
12254 cast of "A.B.C" (as a nested group of MemberAccess with a
12255 SimpleName at the end) plus the rank composition "[]".
12259 2003-04-10 Miguel de Icaza <miguel@ximian.com>
12261 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
12262 for the access level checking.
12264 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
12265 `TypeContainer container', because I kept getting confused when I
12266 was debugging this code.
12268 * expression.cs (Indexers): Instead of tracking getters/setters,
12269 we now track them in parallel. We create one arraylist less, but
12270 most importantly it is possible now for the LValue code to find a
12271 matching get for a set.
12273 (IndexerAccess.DoResolveLValue): Update the code.
12274 GetIndexersForType has been modified already to extract all the
12275 indexers from a type. The code assumed it did not.
12277 Also make the code set the correct return type for the indexer.
12278 This was fixed a long time ago for properties, but was missing for
12279 indexers. It used to be void_type.
12281 (Binary.Emit): Test first for doubles instead of
12282 floats, as they are more common.
12284 (Binary.EmitBranchable): Use the .un version of the branch opcodes
12285 when dealing with floats and the <=, >= operators. This fixes bug
12288 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
12289 to load the array value by emitting a load on the foreach variable
12290 type. This was incorrect.
12292 We now emit the code to load an element using the the array
12293 variable type, and then we emit the conversion operator.
12297 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
12299 * attribute.cs: Avoid allocation of ArrayLists in the common case.
12301 2003-04-09 Miguel de Icaza <miguel@ximian.com>
12303 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
12304 test for protection before we test for signatures.
12306 (MethodSignature.ToString): implement.
12308 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
12309 to the case where we reduced into a LongConstant.
12311 * decl.cs (CheckAccessLevel): If the type is an array, we can not
12312 depend on whether the information is acurrate, because the
12313 Microsoft runtime will always claim that the array type is public,
12314 regardless of the real state.
12316 If the type is a pointer, another problem happens: the type is
12317 reported as non-public in Microsoft.
12319 In both cases we have to call CheckAccessLevel recursively with
12320 the underlying type as the argument to be tested.
12322 2003-04-08 Miguel de Icaza <miguel@ximian.com>
12324 * assign.cs (Assign.Emit): If we are dealing with a compound
12325 assignment expression, we should use the code path that stores the
12326 intermediate result in a temporary value. This fixes #40903.
12328 *expression.cs (Indirection.ToString): Provide ToString method for
12331 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
12333 * class.cs: Null out fields holding references to Block objects so
12334 they can be garbage collected.
12336 * expression.cs (OverloadResolve): Remove unused local.
12338 2003-04-07 Martin Baulig <martin@ximian.com>
12340 * codegen.cs (EmitContext.CurrentFile): New public field.
12341 (EmitContext.Mark): Use the CurrentFile to check whether the
12342 location is in the correct file.
12343 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
12345 2003-04-07 Martin Baulig <martin@ximian.com>
12347 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
12349 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
12350 location. [FIXME: The location argument which gets passed to this
12351 method is sometimes wrong!]
12353 2003-04-07 Nick Drochak <ndrochak@gol.com>
12355 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
12357 2003-04-07 Miguel de Icaza <miguel@ximian.com>
12359 * expression.cs (Indirection.EmitAssign): We were using the
12360 temporary, but returning immediately instead of continuing the
12363 2003-04-06 Martin Baulig <martin@ximian.com>
12365 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
12366 if it's a nested child, but also deriving from the outer class.
12369 * typemanager.cs (IsNestedChildOf): Make this work if it's a
12370 nested child, but also deriving from the outer class. See
12372 (FilterWithClosure): We may access private members of the outer
12373 class if we're a nested child and deriving from the outer class.
12374 (RealMemberLookup): Only set `closure_private_ok' if the
12375 `original_bf' contained BindingFlags.NonPublic.
12377 2003-04-05 Martin Baulig <martin@ximian.com>
12379 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
12381 2003-04-02 Miguel de Icaza <miguel@ximian.com>
12383 * class.cs (Event.Define): Do not allow abstract events to have
12386 2003-04-01 Miguel de Icaza <miguel@ximian.com>
12388 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
12389 block in event declarations.
12391 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
12392 value type, get its address.
12394 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
12395 leaving a class on the stack instead of a boolean value (int
12396 0/1). Change the code so we compare against null, and then the
12397 result against zero.
12399 * class.cs (TypeContainer.GetClassBases): We were checking for the
12400 parent class being sealed too late.
12402 * expression.cs (Binary.Emit): For <= and >= when dealing with
12403 floating point values, use cgt.un and clt.un instead of cgt and
12406 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
12408 * statement.cs: Apply the same optimization as MS: skip the
12409 GetEnumerator returning an IEnumerator, and use the one returning a
12410 CharEnumerator instead. This allows us to avoid the try-finally block
12413 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
12415 * cs-parser.jay: Attributes cannot be applied to
12416 namespaces. Fixes #40473
12418 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12421 (Add*): check if the name is valid using the full name for constants,
12422 fields, properties and events.
12424 2003-03-28 Miguel de Icaza <miguel@ximian.com>
12426 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
12427 char constants to be part of the enumeration.
12429 * expression.cs (Conditional.DoResolve): Add support for operator
12430 true. Implements the missing functionality from 14.12
12432 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
12433 operator true/false as required by the spec.
12435 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
12436 implicit conversion to boolean.
12438 * statement.cs (Statement.ResolveBoolean): A boolean expression is
12439 also one where the type implements `operator true'.
12441 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
12442 get an expression that will invoke operator true based on an
12445 (GetConversionOperators): Removed the hack that called op_True
12448 (Expression.ResolveBoolean): Move this from Statement.
12450 2003-03-17 Miguel de Icaza <miguel@ximian.com>
12452 * ecore.cs (FieldExpr): do not allow initialization of initonly
12453 fields on derived classes
12455 2003-03-13 Martin Baulig <martin@ximian.com>
12457 * statement.cs (Block.Emit): Call ig.BeginScope() and
12458 ig.EndScope() when compiling with debugging info; call
12459 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
12461 2003-03-08 Miguel de Icaza <miguel@ximian.com>
12463 * expression.cs (Indexers): Do not construct immediately, allow
12464 for new members to be appended as we go. Fixes 38143
12466 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12468 * expression.cs: save/restore context when resolving an unchecked
12471 2003-03-05 Miguel de Icaza <miguel@ximian.com>
12473 * cfold.cs: Catch division by zero in modulus operator during
12476 2003-03-03 Miguel de Icaza <miguel@ximian.com>
12478 * interface.cs (Interface.DefineMembers): Avoid defining members
12481 2003-02-27 Miguel de Icaza <miguel@ximian.com>
12483 * driver.cs: handle the +/- options for -noconfig
12485 * statement.cs (Unckeched.Resolve): Also track the state of
12486 unchecked in the Resolve phase.
12488 2003-02-27 Martin Baulig <martin@ximian.com>
12490 * ecore.cs (Expression.MemberLookup): Don't create a
12491 MethodGroupExpr for something which is not a method. Fixes #38291.
12493 2003-02-25 Miguel de Icaza <miguel@ximian.com>
12495 * class.cs (MemberBase.CheckParameters): Also check that the type
12496 is unmanaged if it is a pointer.
12498 * expression.cs (SizeOf.Resolve): Add location information.
12500 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
12501 a managed type is declared.
12503 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
12504 parameter modifiers as well. Fixes bug 38606
12506 * class.cs: Very sad. Am backing out the speed up changes
12507 introduced by the ArrayList -> Array in the TypeContainer, as they
12508 were not actually that much faster, and introduced a bug (no error
12509 reports on duplicated methods).
12511 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
12512 source first, this will guarantee that we have a valid expression
12513 before calling in lower levels functions that will require a
12514 resolved object. Then use this original_source in the
12515 target.ResolveLValue instead of the original source that was
12518 Another change. Use target.Resolve instead of LValueResolve.
12519 Although we are resolving for LValues, we will let the Assign code
12520 take care of that (it will be called again from Resolve). This
12521 basically allows code like this:
12523 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
12524 class Y { void A (X x) { x [0] += o; }
12526 The problem was that the indexer was trying to resolve for
12527 set_Item (idx, object o) and never finding one. The real set_Item
12528 was set_Item (idx, X). By delaying the process we get the right
12533 2003-02-23 Martin Baulig <martin@ximian.com>
12535 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
12536 while calling DoEmit ().
12538 * codegen.cs (EmitContext.Mark): Don't mark locations in other
12539 source files; if you use the #line directive inside a method, the
12540 compiler stops emitting line numbers for the debugger until it
12541 reaches the end of the method or another #line directive which
12542 restores the original file.
12544 2003-02-23 Martin Baulig <martin@ximian.com>
12546 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
12548 2003-02-23 Martin Baulig <martin@ximian.com>
12550 * statement.cs (Block.AddChildVariableNames): We need to call this
12551 recursively, not just for our immediate children.
12553 2003-02-23 Martin Baulig <martin@ximian.com>
12555 * class.cs (Event.Define): Always make the field private, like csc does.
12557 * typemanager.cs (TypeManager.RealMemberLookup): Make events
12558 actually work, fixes bug #37521.
12560 2003-02-23 Miguel de Icaza <miguel@ximian.com>
12562 * delegate.cs: When creating the various temporary "Parameters"
12563 classes, make sure that we call the ComputeAndDefineParameterTypes
12564 on those new parameters (just like we do with the formal ones), to
12565 allow them to be resolved in the context of the DeclSpace.
12567 This fixes the bug that Dick observed in Bugzilla #38530.
12569 2003-02-22 Miguel de Icaza <miguel@ximian.com>
12571 * expression.cs (ResolveMemberAccess): When resolving a constant,
12572 do not attempt to pull a constant if the value was not able to
12573 generate a valid constant.
12575 * const.cs (LookupConstantValue): Do not report more errors than required.
12577 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12579 * expression.cs: fixes bug #38328.
12581 2003-02-18 Miguel de Icaza <miguel@ximian.com>
12583 * class.cs: Changed all the various members that can be part of a
12584 class from being an ArrayList to be an Array of the right type.
12585 During the DefineType type_list, interface_list, delegate_list and
12586 enum_list are turned into types, interfaces, delegates and enums
12589 And during the member population, indexer_list, event_list,
12590 constant_list, field_list, instance_constructor_list, method_list,
12591 operator_list and property_list are turned into their real arrays.
12593 Although we could probably perform this operation earlier, for
12594 good error reporting we need to keep the lists and remove the
12595 lists for longer than required.
12597 This optimization was triggered by Paolo profiling the compiler
12598 speed on the output of `gen-sample-program.pl' perl script.
12600 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
12601 not crash in methods like MemberLookupFailed that use this field.
12603 This problem arises when the compiler fails to resolve a type
12604 during interface type definition for example.
12606 2003-02-18 Miguel de Icaza <miguel@ximian.com>
12608 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
12609 inherit from System.Object, so we have to stop at null, not only
12610 when reaching System.Object.
12612 2003-02-17 Miguel de Icaza <miguel@ximian.com>
12614 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
12615 DeclaredOnly because the parent indexer might have had a different
12616 name, but did not loop until the top of the hierarchy was reached.
12618 The problem this one fixes is 35492: when a class implemented an
12619 indexer from an interface, we were getting the interface method
12620 (which was abstract) and we were flagging an error (can not invoke
12623 This also keeps bug 33089 functioning, and test-148 functioning.
12625 * typemanager.cs (IsSpecialMethod): The correct way of figuring
12626 out if a method is special is to see if it is declared in a
12627 property or event, or whether it is one of the predefined operator
12628 names. This should fix correctly #36804.
12630 2003-02-15 Miguel de Icaza <miguel@ximian.com>
12632 The goal here is to remove the dependency on EmptyCast.Peel ().
12633 Killing it completely.
12635 The problem is that currently in a number of places where
12636 constants are expected, we have to "probe" for an EmptyCast, and
12637 Peel, which is not the correct thing to do, as this will be
12638 repetitive and will likely lead to errors.
12640 The idea is to remove any EmptyCasts that are used in casts that
12641 can be reduced to constants, so we only have to cope with
12644 This bug hunt was triggered by Bug 37363 and the desire to remove
12645 the duplicate pattern where we were "peeling" emptycasts to check
12646 whether they were constants. Now constants will always be
12649 * ecore.cs: Use an enumconstant here instead of wrapping with
12652 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
12653 throwing me off. By handling this we can get rid of a few hacks.
12655 * statement.cs (Switch): Removed Peel() code.
12657 2003-02-14 Miguel de Icaza <miguel@ximian.com>
12659 * class.cs: Location information for error 508
12661 * expression.cs (New.DoResolve): Add a guard against double
12662 resolution of an expression.
12664 The New DoResolve might be called twice when initializing field
12665 expressions (see EmitFieldInitializers, the call to
12666 GetInitializerExpression will perform a resolve on the expression,
12667 and later the assign will trigger another resolution
12669 This leads to bugs (#37014)
12671 * delegate.cs: The signature for EndInvoke should contain any ref
12672 or out parameters as well. We were not doing this in the past.
12674 * class.cs (Field.Define): Do not overwrite the type definition
12675 inside the `volatile' group. Turns out that volatile enumerations
12676 were changing the type here to perform a validity test, which
12679 2003-02-12 Miguel de Icaza <miguel@ximian.com>
12681 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
12682 and structs, we do not want to load the instance variable
12684 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
12685 enum_type has to be handled like an object reference (implicit
12686 conversions exists from this to object), but the regular IsClass
12687 and IsValueType tests will never return true for this one.
12689 Also we use TypeManager.IsValueType instead of type.IsValueType,
12690 just for consistency with the rest of the code (this is only
12691 needed if we ever use the construct exposed by test-180.cs inside
12692 corlib, which we dont today).
12694 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
12696 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
12699 2003-02-09 Martin Baulig <martin@ximian.com>
12701 * namespace.cs (Namespace..ctor): Added SourceFile argument.
12702 (Namespace.DefineNamespaces): New static public method; this is
12703 called when we're compiling with debugging to add all namespaces
12704 to the symbol file.
12706 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
12707 pass it to the Namespace's .ctor.
12709 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
12710 and MethodBase arguments; pass the namespace ID to the symwriter;
12711 pass the MethodBase instead of the token to the symwriter.
12712 (SymbolWriter.DefineNamespace): New method to add a namespace to
12715 2003-02-09 Martin Baulig <martin@ximian.com>
12717 * symbolwriter.cs: New file. This is a wrapper around
12718 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
12719 methods here in near future.
12721 2003-02-09 Martin Baulig <martin@ximian.com>
12723 * codegen.cs (EmitContext.Mark): Just pass the arguments to
12724 ILGenerator.MarkSequencePoint() which are actually used by the
12727 2003-02-09 Martin Baulig <martin@ximian.com>
12729 * location.cs (SourceFile): New public sealed class. This
12730 contains the name and an index which is used in the location's token.
12731 (Location): Reserve an appropriate number of bits in the token for
12732 the source file instead of walking over that list, this gives us a
12733 really huge performance improvement when compiling with debugging.
12735 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
12736 `SourceFile' argument instead of a string.
12737 (Driver.ProcessFile): Add all the files via Location.AddFile(),
12738 but don't parse/tokenize here, we need to generate the list of all
12739 source files before we do that.
12740 (Driver.ProcessFiles): New static function. Parses/tokenizes all
12743 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
12744 instead of a string.
12746 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
12749 2003-02-09 Martin Baulig <martin@ximian.com>
12751 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
12752 filename on `#line default'.
12754 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
12756 * statement.cs: don't clear the pinned var when the fixed statement
12757 returns from the method (fixes bug#37752).
12759 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
12761 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
12764 2003-02-07 Martin Baulig <martin@ximian.com>
12766 * driver.cs: Removed the `--debug-args' command line argument.
12768 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
12769 automatically by the AsssemblyBuilder.
12770 (CodeGen.InitializeSymbolWriter): We don't need to call any
12771 initialization function on the symbol writer anymore. This method
12772 doesn't take any arguments.
12774 2003-02-03 Miguel de Icaza <miguel@ximian.com>
12776 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
12777 from referenced assemblies as well.
12779 2003-02-02 Martin Baulig <martin@ximian.com>
12781 * class.cs (MethodData.Emit): Generate debugging info for external methods.
12783 2003-02-02 Martin Baulig <martin@ximian.com>
12785 * class.cs (Constructor.Emit): Open the symbol writer before
12786 emitting the constructor initializer.
12787 (ConstructorInitializer.Emit): Call ec.Mark() to allow
12788 single-stepping through constructor initializers.
12790 2003-01-30 Miguel de Icaza <miguel@ximian.com>
12792 * class.cs: Handle error 549: do not allow virtual methods in
12795 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
12797 * decl.cs: Check access levels when resolving types
12799 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
12801 * statement.cs: Add parameters and locals set in catch blocks that might
12802 return to set vector
12804 2003-01-29 Miguel de Icaza <miguel@ximian.com>
12806 * class.cs (Operator): Set the SpecialName flags for operators.
12808 * expression.cs (Invocation.DoResolve): Only block calls to
12809 accessors and operators on SpecialName methods.
12811 (Cast.TryReduce): Handle conversions from char constants.
12814 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
12816 * statement.cs: small memory and time optimization in FlowBranching.
12818 2003-01-28 Pedro Mart <yoros@wanadoo.es>
12820 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
12821 problem that the last fix but in the other sid (Set).
12823 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
12824 access when there is no indexer in the hierarchy.
12826 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
12828 * class.cs: Combine some if statements.
12830 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12832 * driver.cs: fixed bug #37187.
12834 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
12836 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
12837 any indexer, it's needed to build a list with all the indexers in the
12838 hierarchy (AllGetters), else we have problems. Fixes #35653.
12840 2003-01-23 Miguel de Icaza <miguel@ximian.com>
12842 * class.cs (MethodData.Define): It is wrong for an interface
12843 implementation to be static in both cases: explicit and implicit.
12844 We were only handling this in one case.
12846 Improve the if situation there to not have negations.
12848 * class.cs (Field.Define): Turns out that we do not need to check
12849 the unsafe bit on field definition, only on usage. Remove the test.
12851 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12853 * driver.cs: use assembly.Location instead of Codebase (the latest
12854 patch made mcs fail when using MS assemblies).
12856 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
12858 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
12859 get the path to *corlib.dll.
12861 2003-01-21 Nick Drochak <ndrochak@gol.com>
12865 * typemanager.cs: Remove compiler warnings
12867 2003-01-20 Duncan Mak <duncan@ximian.com>
12869 * AssemblyInfo.cs: Bump the version number to 0.19.
12871 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12873 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
12875 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
12877 * class.cs (Constructor::Emit): Emit debugging info for constructors.
12879 2003-01-17 Miguel de Icaza <miguel@ximian.com>
12881 * cs-parser.jay: Small fix: we were not comparing the constructor
12882 name correctly. Thanks to Zoltan for the initial pointer.
12884 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
12886 * cs-tokenizer.cs: Set file name when specified with #line
12888 2003-01-15 Miguel de Icaza <miguel@ximian.com>
12890 * cs-parser.jay: Only perform the constructor checks here if we
12891 are named like the class; This will help provider a better
12892 error. The constructor path is taken when a type definition is
12893 not found, but most likely the user forgot to add the type, so
12894 report that rather than the constructor error.
12896 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
12898 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
12901 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
12903 * cs-parser.jay: Add cleanup call.
12905 2003-01-13 Duncan Mak <duncan@ximian.com>
12907 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
12908 consistent with other methods.
12910 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
12912 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
12914 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
12916 * attribute.cs: only set GuidAttr to true when we have a
12919 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
12923 * typemanager.cs: fixes to allow mcs compile corlib with the new
12924 Type.IsSubclassOf fix.
12926 2003-01-08 Miguel de Icaza <miguel@ximian.com>
12928 * expression.cs (LocalVariableReference.DoResolve): Classify a
12929 constant as a value, not as a variable. Also, set the type for
12932 * cs-parser.jay (fixed_statement): take a type instead of a
12933 pointer_type, so we can produce a better error message later.
12935 * statement.cs (Fixed.Resolve): Flag types that are not pointers
12938 (For.DoEmit): Make inifinite loops have a
12939 non-conditional branch back.
12941 (Fixed.DoEmit): First populate the pinned variables, then emit the
12942 statement, then clear the variables. Before I was emitting the
12943 code once for each fixed piece.
12946 2003-01-08 Martin Baulig <martin@ximian.com>
12948 * statement.cs (FlowBranching.MergeChild): A break in a
12949 SWITCH_SECTION does not leave a loop. Fixes #36155.
12951 2003-01-08 Martin Baulig <martin@ximian.com>
12953 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
12954 lives in the same number space than `param_map'. Fixes #36154.
12956 2003-01-07 Miguel de Icaza <miguel@ximian.com>
12958 * cs-parser.jay (constructor_declaration): Set the
12959 Constructor.ModFlags before probing for it. This makes the
12960 compiler report 514, 515 and 132 (the code was there, but got
12963 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
12964 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
12965 (GotoCase.Resolve): Set `Returns' to ALWAYS.
12967 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
12969 * enum.cs: create the enum static fields using the enum type.
12971 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
12973 * class.cs: don't try to create the ParamBuilder for the return
12974 type if it's not needed (and handle it breaking for the ms runtime
12977 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
12979 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
12981 2002-12-29 Miguel de Icaza <miguel@ximian.com>
12983 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
12984 the command. This showed up while compiling the JANET source
12985 code, which used \r as its only newline separator.
12987 2002-12-28 Miguel de Icaza <miguel@ximian.com>
12989 * class.cs (Method.Define): If we are an operator (because it
12990 reuses our code), then set the SpecialName and HideBySig. #36128
12992 2002-12-22 Miguel de Icaza <miguel@ximian.com>
12994 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
12995 exception, report error 120 `object reference required'.
12997 * driver.cs: Add --pause option, used during to measure the size
12998 of the process as it goes with --timestamp.
13000 * expression.cs (Invocation.DoResolve): Do not allow methods with
13001 SpecialName to be invoked.
13003 2002-12-21 Miguel de Icaza <miguel@ximian.com>
13005 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
13006 number before adding it.
13008 2002-12-21 Ravi Pratap <ravi@ximian.com>
13010 * ecore.cs (StandardImplicitConversion): When in an unsafe
13011 context, we allow conversion between void * to any other pointer
13012 type. This fixes bug #35973.
13014 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
13016 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
13017 is not thrown when extensionless outputs are used
13019 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13021 * rootcontext.cs: fixed compilation of corlib.
13023 2002-12-19 Miguel de Icaza <miguel@ximian.com>
13025 * attribute.cs (Attributes.Contains): Add new method.
13027 * class.cs (MethodCore.LabelParameters): if the parameter is an
13028 `out' parameter, check that no attribute `[In]' has been passed.
13030 * enum.cs: Handle the `value__' name in an enumeration.
13032 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
13034 * decl.cs: Added special case to allow overrides on "protected
13037 2002-12-18 Ravi Pratap <ravi@ximian.com>
13039 * attribute.cs (Attributes.AddAttributeSection): Rename to this
13040 since it makes much more sense.
13042 (Attributes.ctor): Don't require a Location parameter.
13044 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
13046 * attribute.cs (ApplyAttributes): Remove extra Location parameters
13047 since we already have that information per attribute.
13049 * everywhere : make appropriate changes.
13051 * class.cs (LabelParameters): Write the code which actually
13052 applies attributes to the return type. We can't do this on the MS
13053 .NET runtime so we flag a warning in the case an exception is
13056 2002-12-18 Miguel de Icaza <miguel@ximian.com>
13058 * const.cs: Handle implicit null conversions here too.
13060 2002-12-17 Ravi Pratap <ravi@ximian.com>
13062 * class.cs (MethodCore.LabelParameters): Remove the extra
13063 Type [] parameter since it is completely unnecessary. Instead
13064 pass in the method's attributes so that we can extract
13065 the "return" attribute.
13067 2002-12-17 Miguel de Icaza <miguel@ximian.com>
13069 * cs-parser.jay (parse): Use Report.Error to flag errors instead
13070 of ignoring it and letting the compile continue.
13072 * typemanager.cs (ChangeType): use an extra argument to return an
13073 error condition instead of throwing an exception.
13075 2002-12-15 Miguel de Icaza <miguel@ximian.com>
13077 * expression.cs (Unary.TryReduce): mimic the code for the regular
13078 code path. Perform an implicit cast in the cases where we can
13079 implicitly convert to one of the integral types, and then reduce
13080 based on that constant. This fixes bug #35483.
13082 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13084 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
13086 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13088 * namespace.cs: fixed bug #35489.
13090 2002-12-12 Miguel de Icaza <miguel@ximian.com>
13092 * class.cs: Remove some dead code.
13094 * cs-parser.jay: Estimate the number of methods needed
13095 (RootContext.MethodCount);
13097 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
13098 numbers instead of StringBuilders.
13100 * support.cs (PtrHashtable): Add constructor with initial size;
13101 We can now reduce reallocations of the method table.
13103 2002-12-10 Ravi Pratap <ravi@ximian.com>
13105 * attribute.cs (ApplyAttributes): Keep track of the emitted
13106 attributes on a per-target basis. This fixes bug #35413.
13108 2002-12-10 Miguel de Icaza <miguel@ximian.com>
13110 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
13111 default to the Windows 1252 encoding.
13113 (UnixParseOption): Support version, thanks to Alp for the missing
13116 * AssemblyInfo.cs: Add nice assembly information.
13118 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
13121 * cs-parser.jay: Allow a trailing comma before the close bracked
13122 in the attribute_section production.
13124 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
13125 address of the instance was being taken, I will take this out,
13126 because we take the address of the object immediately here.
13128 2002-12-09 Ravi Pratap <ravi@ximian.com>
13130 * typemanager.cs (AreMultipleAllowed): Take care of the most
13131 obvious case where attribute type is not in the current assembly -
13134 2002-12-08 Miguel de Icaza <miguel@ximian.com>
13136 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
13137 definitions, instead of doing that afterwards.
13139 Also we use a nice little hack, depending on the constructor, we
13140 know if we are a "composed" name or a simple name. Hence, we
13141 avoid the IndexOf test, and we avoid
13143 * codegen.cs: Add code to assist in a bug reporter to track down
13144 the source of a compiler crash.
13146 2002-12-07 Ravi Pratap <ravi@ximian.com>
13148 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
13149 types have been emitted for a given element and flag an error
13150 if something which does not have AllowMultiple set is used more
13153 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
13154 attribute types and their corresponding AllowMultiple properties
13156 (AreMultipleAllowed): Check the property for a given type.
13158 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
13159 property in the case we have a TypeContainer.
13161 (Attributes.AddAttribute): Detect duplicates and just skip on
13162 adding them. This trivial fix catches a pretty gross error in our
13163 attribute emission - global attributes were being emitted twice!
13165 Bugzilla bug #33187 is now fixed.
13167 2002-12-06 Miguel de Icaza <miguel@ximian.com>
13169 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
13170 instead of pp_and).
13172 * expression.cs (Binary.ResolveOperator): I can only use the
13173 Concat (string, string, string) and Concat (string, string,
13174 string, string) if the child is actually a concatenation of
13177 2002-12-04 Miguel de Icaza <miguel@ximian.com>
13179 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
13180 context where we need a 2-character lookahead.
13182 * pending.cs (PendingImplementation): Rework so we can keep track
13183 of interface types all the time, and flag those which were
13184 implemented by parents as optional.
13186 2002-12-03 Miguel de Icaza <miguel@ximian.com>
13188 * expression.cs (Binary.ResolveOperator): Use
13189 String.Concat(string,string,string) or
13190 String.Concat(string,string,string,string) when possible.
13192 * typemanager: More helper methods.
13195 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
13197 * pending.cs: remove the bogus return from GetMissingInterfaces()
13198 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
13200 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13202 * namespace.cs: avoid duplicated 'using xxx' being added to
13203 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
13204 when we get more than one 'using' statement for the same namespace.
13205 Report a CS0105 warning for it.
13207 2002-11-30 Miguel de Icaza <miguel@ximian.com>
13209 * cs-tokenizer.cs (consume_identifier): use read directly, instead
13210 of calling getChar/putback, uses internal knowledge of it.
13212 (xtoken): Reorder tokenizer so most common patterns are checked
13213 first. This reduces the compilation time in another 5% (from 8.11s
13214 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
13216 The parsing time is 22% of the compilation in mcs, and from that
13217 64% is spent on the tokenization process.
13219 I tried using a binary search for keywords, but this is slower
13220 than the hashtable. Another option would be to do a couple of
13223 * Not use a StringBuilder, instead use an array of chars,
13224 with a set value. Notice that this way we could catch
13225 the 645 error without having to do it *afterwards*.
13227 * We could write a hand-parser to avoid the hashtable
13228 compares altogether.
13230 The identifier consumption process takes 37% of the tokenization
13231 time. Another 15% is spent on is_number. 56% of the time spent
13232 on is_number is spent on Int64.Parse:
13234 * We could probably choose based on the string length to
13235 use Int32.Parse or Int64.Parse and avoid all the 64-bit
13238 Another 3% is spend on wrapping `xtoken' in the `token' function.
13240 Handle 0xa0 as whitespace (#34752)
13242 2002-11-26 Miguel de Icaza <miguel@ximian.com>
13244 * typemanager.cs (IsCLRType): New routine to tell whether a type
13245 is one of the builtin types.
13247 Maybe it needs to use TypeCodes to be faster. Maybe we could use
13248 typecode in more places instead of doing pointer comparissions.
13249 We could leverage some knowledge about the way the typecodes are
13252 New code to cache namespaces in assemblies, it is currently not
13253 invoked, to be used soon.
13255 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
13257 * expression.cs (Binary.ResolveOperator): specially handle
13258 strings, and do not perform user-defined operator overloading for
13261 2002-11-24 Miguel de Icaza <miguel@ximian.com>
13263 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
13264 internalcall as it is a pretty simple operation; Avoid whenever
13265 possible to call Char.IsLetter.
13267 (consume_identifier): Cut by half the number of
13268 hashtable calls by merging the is_keyword and GetKeyword behavior.
13270 Do not short-circuit, because if we do, we
13271 report errors (ie, #if false && true would produce an invalid
13275 2002-11-24 Martin Baulig <martin@ximian.com>
13277 * expression.cs (Cast.TryReduce): If we're in checked syntax,
13278 check constant ranges and report a CS0221. Fixes #33186.
13280 2002-11-24 Martin Baulig <martin@ximian.com>
13282 * cs-parser.jay: Make this work for uninitialized variable
13283 declarations in the `for' initializer. Fixes #32416.
13285 2002-11-24 Martin Baulig <martin@ximian.com>
13287 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
13288 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
13290 2002-11-24 Martin Baulig <martin@ximian.com>
13292 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
13293 argument; if true, we also check for user-defined conversions.
13294 This is only needed if both arguments are of a user-defined type.
13295 Fixes #30443, added test-175.cs.
13296 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
13298 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
13300 2002-11-24 Martin Baulig <martin@ximian.com>
13302 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
13303 function to get the store opcode.
13304 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
13305 only emit the Ldelema if the store opcode is Stobj. You must run
13306 both test-34 and test-167 to test this. Fixes #34529.
13308 2002-11-23 Martin Baulig <martin@ximian.com>
13310 * ecore.cs (Expression.MemberLookup): Added additional
13311 `qualifier_type' argument which is used when we're being called
13312 from MemberAccess.DoResolve() and null if we're called from a
13314 (Expression.MemberLookupFailed): New method to report errors; this
13315 does the CS1540 check and reports the correct error message.
13317 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
13318 argument for the CS1540 check and redone the way how we're dealing
13319 with private members. See the comment in the source code for details.
13320 (FilterWithClosure): Reverted this back to revision 1.197; renamed
13321 `closure_start_type' to `closure_qualifier_type' and check whether
13322 it's not null. It was not this filter being broken, it was just
13323 being called with the wrong arguments.
13325 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
13326 and pass it the correct `qualifier_type'; this also does the error
13329 2002-11-22 Miguel de Icaza <miguel@ximian.com>
13331 * expression.cs (Invocation.EmitParams): If the we are dealing
13332 with a non-built-in value type, load its address as well.
13334 (ArrayCreation): Use a a pretty constant instead
13335 of the hardcoded value 2. Use 6 instead of 2 for the number of
13336 static initializers.
13338 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
13339 because they are not really value types, just glorified integers.
13341 * driver.cs: Do not append .exe, the CSC compiler does not do it.
13343 * ecore.cs: Remove redundant code for enumerations, make them use
13344 the same code path as everything else, fixes the casting issue
13345 with enumerations in Windows.Forms.
13347 * attribute.cs: Do only cast to string if it is a string, the
13348 validation happens later.
13350 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
13351 people upgrade their corlibs.
13353 * ecore.cs: Oops, enumerations were not following the entire code path
13355 2002-11-21 Miguel de Icaza <miguel@ximian.com>
13357 * typemanager.cs (FilterWithClosure): Commented out the test for
13358 1540 in typemanager.cs, as it has problems when accessing
13359 protected methods from a parent class (see test-174.cs).
13361 * attribute.cs (Attribute.ValidateGuid): new method.
13362 (Attribute.Resolve): Use above.
13364 2002-11-19 Miguel de Icaza <miguel@ximian.com>
13366 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
13368 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
13369 handling for enumerations, as we only needed the TypeContainer
13370 functionality to begin with (this is required for the fix below to
13371 work for enums that reference constants in a container class for
13374 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
13376 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
13377 a valid TypeBuilder to perform lookups on.o
13379 * class.cs (InheritableMemberSignatureCompare): Use true in the
13380 call to GetGetMethod and GetSetMethod, because we are comparing
13381 the signature, and we need to get the methods *even* if they are
13384 (PropertyBase.CheckBase): ditto.
13386 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
13387 GotoCase.Resolve): Use Peel on EmpytCasts.
13389 * ecore.cs (EmptyCast): drop child, add Peel method.
13391 2002-11-17 Martin Baulig <martin@ximian.com>
13393 * ecore.cs (EmptyCast.Child): New public property.
13395 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
13396 label resolved to an EmptyCast. Fixes #34162.
13397 (GotoCase.Resolve): Likewise.
13398 (Block.EmitMeta): Likewise.
13400 2002-11-17 Martin Baulig <martin@ximian.com>
13402 * expression.cs (Invocation.BetterConversion): Prefer int over
13403 uint; short over ushort; long over ulong for integer literals.
13404 Use ImplicitConversionExists instead of StandardConversionExists
13405 since we also need to check for user-defined implicit conversions.
13406 Fixes #34165. Added test-173.cs.
13408 2002-11-16 Martin Baulig <martin@ximian.com>
13410 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
13411 with the `true' and `false' literals. Fixes #33151.
13413 2002-11-16 Martin Baulig <martin@ximian.com>
13415 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
13416 October 22nd; don't do the cs1540 check for static members.
13418 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
13419 now using our own filter here and doing the cs1540 check again.
13421 2002-11-16 Martin Baulig <martin@ximian.com>
13423 * support.cs (InternalParameters): Don't crash if we don't have
13424 any fixed parameters. Fixes #33532.
13426 2002-11-16 Martin Baulig <martin@ximian.com>
13428 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
13429 when looking up static methods to make this work on Windows.
13432 2002-11-16 Martin Baulig <martin@ximian.com>
13434 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
13435 a setter rather than using PropertyInfo.CanWrite.
13437 2002-11-15 Nick Drochak <ndrochak@gol.com>
13439 * class.cs: Allow acces to block member by subclasses. Fixes build
13442 2002-11-14 Martin Baulig <martin@ximian.com>
13444 * class.cs (Constructor.Emit): Added the extern/block check.
13447 2002-11-14 Martin Baulig <martin@ximian.com>
13449 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
13450 iteration while looking for indexers, this is needed because the
13451 indexer may have a different name in our base classes. Fixed the
13452 error reporting (no indexers at all, not get accessor, no
13453 overloaded match). Fixes bug #33089.
13454 (IndexerAccess.DoResolveLValue): Likewise.
13456 2002-11-14 Martin Baulig <martin@ximian.com>
13458 * class.cs (PropertyBase.CheckBase): Make this work for multiple
13459 indexers. Fixes the first part of bug #33089.
13460 (MethodSignature.InheritableMemberSignatureCompare): Added support
13463 2002-11-13 Ravi Pratap <ravi@ximian.com>
13465 * attribute.cs (Attribute.Resolve): Catch the
13466 NullReferenceException and report it since it isn't supposed to
13469 2002-11-12 Miguel de Icaza <miguel@ximian.com>
13471 * expression.cs (Binary.EmitBranchable): Also handle the cases for
13472 LogicalOr and LogicalAnd that can benefit from recursively
13473 handling EmitBranchable. The code now should be nice for Paolo.
13475 2002-11-08 Miguel de Icaza <miguel@ximian.com>
13477 * typemanager.cs (LookupType): Added a negative-hit hashtable for
13478 the Type lookups, as we perform quite a number of lookups on
13479 non-Types. This can be removed once we can deterministically tell
13480 whether we have a type or a namespace in advance.
13482 But this might require special hacks from our corlib.
13486 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
13487 and double which avoids a conversion from an integer to a double.
13489 * expression.cs: tiny optimization, avoid calling IsConstant,
13490 because it effectively performs the lookup twice.
13492 2002-11-06 Miguel de Icaza <miguel@ximian.com>
13494 But a bogus return here to keep the semantics of the old code
13495 until the Mono runtime is fixed.
13497 * pending.cs (GetMissingInterfaces): New method used to remove all
13498 the interfaces that are already implemented by our parent
13499 classes from the list of pending methods.
13501 * interface.cs: Add checks for calls after ResolveTypeExpr.
13503 2002-11-05 Miguel de Icaza <miguel@ximian.com>
13505 * class.cs (Class.Emit): Report warning 67: event not used if the
13506 warning level is beyond 3.
13508 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
13509 being a NullLiteral.
13511 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
13514 * class.cs (TypeContainer.GetClassBases): Cover a missing code
13515 path that might fail if a type can not be resolved.
13517 * expression.cs (Binary.Emit): Emit unsigned versions of the
13520 * driver.cs: use error 5.
13522 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
13524 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
13526 2002-11-01 Miguel de Icaza <miguel@ximian.com>
13528 * cs-parser.jay (switch_section): A beautiful patch from Martin
13529 Baulig that fixed 33094.
13531 2002-10-31 Miguel de Icaza <miguel@ximian.com>
13533 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
13534 Check whether the base is abstract and report an error if so.
13536 * expression.cs (IndexerAccess.DoResolveLValue,
13537 IndexerAccess.DoResolve): ditto.
13539 (Invocation.DoResolve): ditto.
13541 (Invocation.FullMethodDesc): Improve the report string.
13543 * statement.cs (Block): Eliminate IsVariableDefined as it is
13544 basically just a wrapper for GetVariableInfo.
13546 * ecore.cs (SimpleName): Use new
13548 * support.cs (ReflectionParamter.ParameterType): We unwrap the
13549 type, as we return the actual parameter ref/unref state on a
13552 2002-10-30 Miguel de Icaza <miguel@ximian.com>
13554 * support.cs: Return proper flags REF/OUT fixing the previous
13557 * expression.cs: Reverted last patch, that was wrong. Is_ref is
13558 not used to mean `ref' but `ref or out' in ParameterReference
13560 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
13561 full type signature instead of calling TypeManger.CSharpName
13564 * support.cs (InternalParameters.ParameterDesc): Do not compare
13565 directly to the modflags, because REF/OUT will actually be bitsets
13568 * delegate.cs (VerifyMethod): Check also the modifiers.
13570 * cs-tokenizer.cs: Fix bug where floating point values with an
13571 exponent where a sign was missing was ignored.
13573 * driver.cs: Allow multiple assemblies to be specified in a single
13576 2002-10-28 Miguel de Icaza <miguel@ximian.com>
13578 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
13579 because identifiers after a parenthesis would end up in this kind
13580 of production, and we needed to desamiguate it for having casts
13583 (UserDefinedType *) xxx
13585 2002-10-24 Miguel de Icaza <miguel@ximian.com>
13587 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
13588 we should set on the Bindingflags.NonPublic, but not turn on
13589 private_ok. private_ok controls whether a Private member is
13590 returned (this is chekced on the filter routine), while the
13591 BindingFlags.NonPublic just controls whether private/protected
13592 will be allowed. This fixes the problem part of the problem of
13593 private properties being allowed to be used in derived classes.
13595 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
13596 so we can call the children DoResolveLValue method (this will
13597 properly signal errors on lvalue assignments to base properties)
13599 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
13600 getter are null, and we have a property info, we know that this
13601 happened because the lookup failed, so we report an error 122 for
13602 protection level violation.
13604 We also silently return if setter and getter are null in the
13605 resolve functions, this condition only happens if we have flagged
13606 the error before. This is the other half of the problem.
13608 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
13609 not have accessibility information, that is why we were returning
13610 true in the filter function in typemanager.cs.
13612 To properly report 122 (property is inaccessible because of its
13613 protection level) correctly, we report this error in ResolveAccess
13614 by failing if both the setter and the getter are lacking (ie, the
13617 DoResolve and DoLResolve have been modified to check for both
13618 setter/getter being null and returning silently, the reason being
13619 that I did not want to put the knowledge about this error in upper
13622 int old = Report.Errors;
13623 x = new PropertyExpr (...);
13624 if (old != Report.Errors)
13629 So the property expr is returned, but it is invalid, so the error
13630 will be flagged during the resolve process.
13632 * class.cs: Remove InheritablePropertySignatureCompare from the
13633 class, as we no longer depend on the property signature to compute
13634 whether it is possible to implement a method or not.
13636 The reason is that calling PropertyInfo.GetGetMethod will return
13637 null (in .NET, in Mono it works, and we should change this), in
13638 cases where the Get Method does not exist in that particular
13643 class X { public virtual int A { get { return 1; } } }
13645 class Z : Y { public override int A { get { return 2; } } }
13647 Would fail in Z because the parent (Y) would not have the property
13648 defined. So we avoid this completely now (because the alternative
13649 fix was ugly and slow), and we now depend exclusively on the
13652 (PropertyBase.CheckBase): Use a method-base mechanism to find our
13653 reference method, instead of using the property.
13655 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
13656 routines are gone now.
13658 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
13659 names, they were incorrectly named.
13661 * cs-tokenizer.cs: Return are more gentle token on failure.
13663 * pending.cs (PendingImplementation.InterfaceMethod): This routine
13664 had an out-of-sync index variable, which caused it to remove from
13665 the list of pending methods the wrong method sometimes.
13667 2002-10-22 Miguel de Icaza <miguel@ximian.com>
13669 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
13670 CanWrite, because those refer to this particular instance of the
13671 property, and do not take into account the fact that we can
13672 override single members of a property.
13674 Constructor requires an EmitContext. The resolution process does
13675 not happen here, but we need to compute the accessors before,
13676 because the resolution does not always happen for properties.
13678 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
13679 subclass, before we did not update this flag, but we did update
13682 (GetAccessors): Drop this routine, as it did not work in the
13683 presence of partially overwritten set/get methods.
13685 Notice that this broke the cs1540 detection, but that will require
13688 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13692 * driver.cs: issue a warning instead of an error if we don't support
13693 debugging for the platform. Also ignore a couple of errors that may
13694 arise when trying to write the symbols. Undo my previous patch.
13696 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13698 * driver.cs: ignore /debug switch except for Unix platforms.
13700 2002-10-23 Nick Drochak <ndrochak@gol.com>
13702 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
13704 2002-10-21 Miguel de Icaza <miguel@ximian.com>
13706 * driver.cs: Do not make mcs-debug conditional, so we do not break
13707 builds that use it.
13709 * statement.cs (UsageVector.MergeChildren): I would like Martin to
13710 review this patch. But basically after all the children variables
13711 have been merged, the value of "Breaks" was not being set to
13712 new_breaks for Switch blocks. I think that it should be set after
13713 it has executed. Currently I set this to the value of new_breaks,
13714 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
13715 conservative, but I do not understand this code very well.
13717 I did not break anything in the build, so that is good ;-)
13719 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
13721 2002-10-20 Mark Crichton <crichton@gimp.org>
13723 * cfold.cs: Fixed compile blocker. Really fixed it this time.
13725 2002-10-20 Nick Drochak <ndrochak@gol.com>
13727 * cfold.cs: Fixed compile blocker.
13729 2002-10-20 Miguel de Icaza <miguel@ximian.com>
13731 * driver.cs: I was chekcing the key, not the file.
13733 2002-10-19 Ravi Pratap <ravi@ximian.com>
13735 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
13736 message that we were generating - we just need to silently return
13739 2002-10-19 Miguel de Icaza <miguel@ximian.com>
13741 * class.cs (Event.Define): Change my previous commit, as this
13742 breaks the debugger. This is a temporary hack, as it seems like
13743 the compiler is generating events incorrectly to begin with.
13745 * expression.cs (Binary.ResolveOperator): Added support for
13746 "U operator - (E x, E y)"
13748 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
13751 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
13752 init-only variables, but this path did not take into account that
13753 there might be also instance readonly variables. Correct this
13756 This fixes bug 32253
13758 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
13761 * driver.cs: Change the extension for modules to `netmodule'
13763 * cs-parser.jay: Improved slightly the location tracking for
13764 the debugger symbols.
13766 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
13767 modifiers that were specified instead of the hardcoded value
13768 (FamAndAssem). This was basically ignoring the static modifier,
13769 and others. Fixes 32429.
13771 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
13772 fixed a bug in the process (32476)
13774 * expression.cs (ArrayAccess.EmitAssign): Patch from
13775 hwang_rob@yahoo.ca that fixes bug 31834.3
13777 2002-10-18 Miguel de Icaza <miguel@ximian.com>
13779 * driver.cs: Make the module extension .netmodule.
13781 2002-10-16 Miguel de Icaza <miguel@ximian.com>
13783 * driver.cs: Report an error if the resource file is not found
13784 instead of crashing.
13786 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
13787 false, like Emit does.
13789 2002-10-16 Nick Drochak <ndrochak@gol.com>
13791 * typemanager.cs: Remove unused private member. Also reported mcs
13792 bug to report this as a warning like csc.
13794 2002-10-15 Martin Baulig <martin@gnome.org>
13796 * statement.cs (Statement.Emit): Made this a virtual method; emits
13797 the line number info and calls DoEmit().
13798 (Statement.DoEmit): New protected abstract method, formerly knows
13799 as Statement.Emit().
13801 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
13803 2002-10-11 Miguel de Icaza <miguel@ximian.com>
13805 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
13806 have fixed a remaining problem: not every AddXXXX was adding a
13807 fully qualified name.
13809 Now everyone registers a fully qualified name in the DeclSpace as
13810 being defined instead of the partial name.
13812 Downsides: we are slower than we need to be due to the excess
13813 copies and the names being registered this way.
13815 The reason for this is that we currently depend (on the corlib
13816 bootstrap for instance) that types are fully qualified, because
13817 we dump all the types in the namespace, and we should really have
13818 types inserted into the proper namespace, so we can only store the
13819 basenames in the defined_names array.
13821 2002-10-10 Martin Baulig <martin@gnome.org>
13823 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
13824 from bug #31834, see the bug report for a testcase which is
13827 2002-10-10 Martin Baulig <martin@gnome.org>
13829 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
13830 flow analysis code for this.
13832 * statement.cs (Do, While, For): Tell the flow analysis code about
13834 (FlowBranching.UsageVector): Added support for infinite loops.
13835 (Block.Resolve): Moved the dead code elimination here and use flow
13838 2002-10-09 Miguel de Icaza <miguel@ximian.com>
13840 * class.cs (Field.Define): Catch cycles on struct type
13843 * typemanager.cs (IsUnmanagedtype): Do not recursively check
13844 fields if the fields are static. We only need to check instance
13847 * expression.cs (As.DoResolve): Test for reference type.
13849 * statement.cs (Using.ResolveExpression): Use
13850 ConvertImplicitRequired, not ConvertImplicit which reports an
13852 (Using.ResolveLocalVariableDecls): ditto.
13854 * expression.cs (Binary.ResolveOperator): Report errors in a few
13855 places where we had to.
13857 * typemanager.cs (IsUnmanagedtype): Finish implementation.
13859 2002-10-08 Miguel de Icaza <miguel@ximian.com>
13861 * expression.cs: Use StoreFromPtr instead of extracting the type
13862 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
13864 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
13865 an enumeration value to a System.Enum, but System.Enum is not a
13866 value type, but an class type, so we need to box.
13868 (Expression.ConvertExplicit): One codepath could return
13869 errors but not flag them. Fix this. Fixes #31853
13871 * parameter.cs (Resolve): Do not allow void as a parameter type.
13873 2002-10-06 Martin Baulig <martin@gnome.org>
13875 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
13876 if it's a class type and not a struct. Fixes #31815.
13878 2002-10-06 Martin Baulig <martin@gnome.org>
13880 * statement.cs: Reworked the flow analysis code a bit to make it
13881 usable for dead code elimination.
13883 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13885 * cs-parser.jay: allow empty source files. Fixes bug #31781.
13887 2002-10-04 Miguel de Icaza <miguel@ximian.com>
13889 * expression.cs (ComposedCast.DoResolveType): A quick workaround
13890 to fix the test 165, will investigate deeper.
13892 2002-10-04 Martin Baulig <martin@gnome.org>
13894 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
13895 finally blocks actually work.
13896 (Try.Resolve): We don't need to create a sibling for `finally' if
13897 there is no finally block.
13899 2002-10-04 Martin Baulig <martin@gnome.org>
13901 * class.cs (Constructor.Define): The default accessibility for a
13902 non-default constructor is private, not public.
13904 2002-10-04 Miguel de Icaza <miguel@ximian.com>
13906 * class.cs (Constructor): Make AllowedModifiers public, add
13909 * cs-parser.jay: Perform the modifiers test here, as the
13910 constructor for the Constructor class usually receives a zero
13911 because of the way we create it (first we create, later we
13912 customize, and we were never checking the modifiers).
13914 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
13915 is a version of LookupTypeReflection that includes the type-name
13916 cache. This can be used as a fast path for functions that know
13917 the fully qualified name and are only calling into *.GetType() to
13918 obtain a composed type.
13920 This is also used by TypeManager.LookupType during its type
13923 (LookupType): We now also track the real type name, as sometimes
13924 we can get a quey for the real type name from things like
13925 ComposedCast. This fixes bug 31422.
13927 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
13928 complete type fullname, it does not have to go through the type
13929 resolution system to obtain the composed version of the type (for
13930 obtaining arrays or pointers).
13932 (Conditional.Emit): Use the EmitBoolExpression to
13933 generate nicer code, as requested by Paolo.
13935 (ArrayCreation.CheckIndices): Use the patch from
13936 hwang_rob@yahoo.ca to validate the array initializers.
13938 2002-10-03 Miguel de Icaza <miguel@ximian.com>
13940 * class.cs (ConstructorInitializer.Emit): simplify code by using
13941 Invocation.EmitCall, and at the same time, fix the bugs in calling
13942 parent constructors that took variable arguments.
13944 * ecore.cs (Expression.ConvertNumericExplicit,
13945 Expression.ImplicitNumericConversion): Remove the code that
13946 manually wrapped decimal (InternalTypeConstructor call is now gone
13949 * expression.cs (Cast.TryReduce): Also handle decimal types when
13950 trying to perform a constant fold on the type.
13952 * typemanager.cs (IsUnmanagedtype): Partially implemented.
13954 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
13955 that only turned off an error report, and did nothing else.
13957 2002-10-02 Miguel de Icaza <miguel@ximian.com>
13959 * driver.cs: Handle and ignore /fullpaths
13961 2002-10-01 Miguel de Icaza <miguel@ximian.com>
13963 * expression.cs (Binary.ResolveOperator): Catch the case where
13964 DoNumericPromotions returns true,
13966 (Binary.DoNumericPromotions): Simplify the code, and the tests.
13968 2002-09-27 Miguel de Icaza <miguel@ximian.com>
13970 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
13973 2002-09-26 Miguel de Icaza <miguel@ximian.com>
13975 * ecore.cs (ConvertNumericExplicit): It is not enough that the
13976 conversion exists, but it is also required that the conversion be
13977 performed. This manifested in "(Type64Enum) 2".
13979 * class.cs (TypeManager.AddMethod): The fix is not to change
13980 AddEnum, because that one was using a fully qualified name (every
13981 DeclSpace derivative does), but to change the AddMethod routine
13982 that was using an un-namespaced name. This now correctly reports
13983 the duplicated name.
13985 Revert patch until I can properly fix it. The issue
13986 is that we have a shared Type space across all namespaces
13987 currently, which is wrong.
13989 Options include making the Namespace a DeclSpace, and merge
13990 current_namespace/current_container in the parser.
13992 2002-09-25 Miguel de Icaza <miguel@ximian.com>
13994 * cs-parser.jay: Improve error reporting when we get a different
13995 kind of expression in local_variable_type and
13996 local_variable_pointer_type.
13998 Propagate this to avoid missleading errors being reported.
14000 * ecore.cs (ImplicitReferenceConversion): treat
14001 TypeManager.value_type as a target just like object_type. As
14006 Is valid, and needs to result in the int 1 being boxed before it
14007 is assigned to the value type v.
14009 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
14010 to validate the enumeration name.
14012 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
14013 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
14014 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
14016 * ecore.cs (TryImplicitIntConversion): When doing an
14017 implicit-enumeration-conversion, check if the type is 64-bits and
14018 perform a conversion before passing to EnumConstant.
14020 2002-09-23 Miguel de Icaza <miguel@ximian.com>
14022 * decl.cs (Error_AmbiguousTypeReference); New routine used to
14023 report ambiguous type references. Unlike the MS version, we
14024 report what the ambiguity is. Innovation at work ;-)
14026 (DeclSpace.FindType): Require a location argument to
14027 display when we display an ambiguous error.
14029 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
14031 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
14033 * expression.cs (EmitDynamicInitializers): Apply patch from
14034 hwang_rob@yahoo.ca that fixes the order in which we emit our
14037 2002-09-21 Martin Baulig <martin@gnome.org>
14039 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
14040 delegate takes no arguments.
14042 2002-09-20 Miguel de Icaza <miguel@ximian.com>
14044 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
14047 * expression.cs: Extract the underlying type.
14049 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
14051 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
14053 2002-09-19 Miguel de Icaza <miguel@ximian.com>
14055 * class.cs (TypeContainer.DefineType): We can not use the nice
14056 PackingSize with the size set to 1 DefineType method, because it
14057 will not allow us to define the interfaces that the struct
14060 This completes the fixing of bug 27287
14062 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
14063 means also structs. This fixes part of the problem.
14064 (Expresion.ImplicitReferenceConversionExists): ditto.
14066 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
14067 error if there were no errors reported during the type lookup
14068 process, to avoid duplicates or redundant errors. Without this
14069 you would get an ambiguous errors plus a type not found. We have
14070 beaten the user enough with the first error.
14072 (DeclSparce.FindType): Emit a warning if we have an ambiguous
14075 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
14076 during the resolution process, stop the lookup, this avoids
14077 repeated error reports (same error twice).
14079 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
14081 * typemanager.cs (LookupType): Redo the type lookup code to match
14082 the needs of System.Reflection.
14084 The issue is that System.Reflection requires references to nested
14085 types to begin with a "+" sign instead of a dot. So toplevel
14086 types look like: "NameSpace.TopLevelClass", and nested ones look
14087 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
14090 2002-09-19 Martin Baulig <martin@gnome.org>
14092 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
14093 says that a method always returns or always throws an exception,
14094 don't report the CS0161.
14096 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
14097 set `Returns = new_returns'.
14099 2002-09-19 Martin Baulig <martin@gnome.org>
14101 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
14102 to an enum constant, check for a CS0176.
14104 2002-09-18 Miguel de Icaza <miguel@ximian.com>
14106 * class.cs (TypeContainer.CheckPairedOperators): Now we check
14107 for operators that must be in pairs and report errors.
14109 * ecore.cs (SimpleName.DoResolveType): During the initial type
14110 resolution process, when we define types recursively, we must
14111 check first for types in our current scope before we perform
14112 lookups in the enclosing scopes.
14114 * expression.cs (MakeByteBlob): Handle Decimal blobs.
14116 (Invocation.VerifyArgumentsCompat): Call
14117 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
14118 I thought we were supposed to always call this, but there are a
14119 few places in the code where we dont do it.
14121 2002-09-17 Miguel de Icaza <miguel@ximian.com>
14123 * driver.cs: Add support in -linkres and -resource to specify the
14124 name of the identifier.
14126 2002-09-16 Miguel de Icaza <miguel@ximian.com>
14128 * ecore.cs (StandardConversionExists): Sync with the conversion
14129 code: allow anything-* to void* conversions.
14131 (FindMostSpecificSource): Use an Expression argument
14132 instead of a Type, because we might be handed over a Literal which
14133 gets a few more implicit conversions that plain types do not. So
14134 this information was being lost.
14136 Also, we drop the temporary type-holder expression when not
14139 2002-09-17 Martin Baulig <martin@gnome.org>
14141 * class.cs (PropertyBase.CheckBase): Don't check the base class if
14142 this is an explicit interface implementation.
14144 2002-09-17 Martin Baulig <martin@gnome.org>
14146 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
14147 different `IndexerName' attributes.
14149 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
14150 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
14151 virtual CommonResolve().
14153 2002-09-16 Miguel de Icaza <miguel@ximian.com>
14155 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
14156 and convert that to the UnderlyingType.
14158 * statement.cs (Foreach.Resolve): Indexers are just like variables
14159 or PropertyAccesses.
14161 * cs-tokenizer.cs (consume_string): Track line numbers and columns
14162 inside quoted strings, we were not doing this before.
14164 2002-09-16 Martin Baulig <martin@gnome.org>
14166 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
14167 resolve it. This is needed for the definite assignment check of the
14168 instance expression, fixes bug #29846.
14169 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
14171 2002-09-16 Nick Drochak <ndrochak@gol.com>
14173 * parameter.cs: Fix compile error. Cannot reference static member
14174 from an instance object. Is this an mcs bug?
14176 2002-09-14 Martin Baulig <martin@gnome.org>
14178 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
14179 multiple times. Fixes bug #30295, added test-166.cs.
14181 2002-09-14 Martin Baulig <martin@gnome.org>
14183 * statement.cs (Block.Emit): Don't emit unreachable code.
14184 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
14185 `break' statements.
14186 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
14188 2002-09-14 Martin Baulig <martin@gnome.org>
14190 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
14193 2002-09-14 Martin Baulig <martin@gnome.org>
14195 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
14196 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
14197 be false on the ms runtime.
14199 2002-09-13 Martin Baulig <martin@gnome.org>
14201 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
14202 the CS0038 error message.
14204 2002-09-12 Miguel de Icaza <miguel@ximian.com>
14206 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
14207 constant inside, return it.
14209 2002-09-12 Martin Baulig <martin@gnome.org>
14211 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
14212 implicit conversion can be done between enum types.
14214 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
14215 check whether an implicit conversion to the current enum's UnderlyingType
14216 exists and report an error if not.
14218 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
14219 without debugging support.
14221 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
14222 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
14224 2002-09-12 Martin Baulig <martin@gnome.org>
14226 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
14228 * ecore.cs (IMemberExpr.DeclaringType): New property.
14229 (SimpleName.SimpleNameResolve): Check whether we're accessing a
14230 nonstatic member of an outer type (CS0038).
14232 2002-09-11 Miguel de Icaza <miguel@ximian.com>
14234 * driver.cs: Activate the using-error detector at warning level
14235 4 (at least for MS-compatible APIs).
14237 * namespace.cs (VerifyUsing): Small buglett fix.
14239 * pending.cs (PendingImplementation): pass the container pointer.
14241 * interface.cs (GetMethods): Allow for recursive definition. Long
14242 term, I would like to move every type to support recursive
14243 definitions, not the current ordering mechanism that we have right
14246 The situation is this: Attributes are handled before interfaces,
14247 so we can apply attributes to interfaces. But some attributes
14248 implement interfaces, we will now handle the simple cases
14249 (recursive definitions will just get an error).
14251 * parameter.cs: Only invalidate types at the end if we fail to
14254 2002-09-09 Martin Baulig <martin@gnome.org>
14256 * ecore.cs (PropertyExpr.Emit): Also check for
14257 TypeManager.system_int_array_get_length so this'll also work when
14258 compiling corlib. Fixes #30003.
14260 2002-09-09 Martin Baulig <martin@gnome.org>
14262 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
14263 and throw an exception if we can't get the type's size. Fixed #30040,
14266 2002-09-09 Martin Baulig <martin@gnome.org>
14268 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
14270 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
14271 context. Fixes bug #30027.
14273 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
14274 virtual functions. Fixes bug #30043, added test-164.cs.
14276 2002-09-08 Ravi Pratap <ravi@ximian.com>
14278 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
14280 2002-09-08 Nick Drochak <ndrochak@gol.com>
14282 * driver.cs: Use an object to get the windows codepage since it's not a
14285 2002-09-08 Miguel de Icaza <miguel@ximian.com>
14287 * statement.cs (For.Emit): for infinite loops (test == null)
14288 return whether there is a break inside, not always "true".
14290 * namespace.cs (UsingEntry): New struct to hold the name of the
14291 using definition, the location where it is defined, and whether it
14292 has been used in a successful type lookup.
14294 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
14299 2002-09-06 Ravi Pratap <ravi@ximian.com>
14301 * attribute.cs : Fix incorrect code which relied on catching
14302 a NullReferenceException to detect a null being passed in
14303 where an object was expected.
14305 2002-09-06 Miguel de Icaza <miguel@ximian.com>
14307 * statement.cs (Try): flag the catch variable as assigned
14309 * expression.cs (Cast): Simplified by using ResolveType instead of
14310 manually resolving.
14312 * statement.cs (Catch): Fix bug by using ResolveType.
14314 2002-09-06 Ravi Pratap <ravi@ximian.com>
14316 * expression.cs (BetterConversion): Special case for when we have
14317 a NullLiteral as the argument and we have to choose between string
14318 and object types - we choose string the way csc does.
14320 * attribute.cs (Attribute.Resolve): Catch the
14321 NullReferenceException and report error #182 since the Mono
14322 runtime no more has the bug and having this exception raised means
14323 we tried to select a constructor which takes an object and is
14326 2002-09-05 Ravi Pratap <ravi@ximian.com>
14328 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
14329 message (1502, 1503) when we can't locate a method after overload
14330 resolution. This is much more informative and closes the bug
14333 * interface.cs (PopulateMethod): Return if there are no argument
14334 types. Fixes a NullReferenceException bug.
14336 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
14337 expressions too. Previously we were checking only in one place for
14338 positional arguments leaving out named arguments.
14340 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
14341 type to the enum type is not allowed. Remove code corresponding to
14344 (ConvertNumericExplicit): Allow explicit conversions from
14345 the underlying type to enum type. This precisely follows the spec
14346 and closes a bug filed by Gonzalo.
14348 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14351 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
14353 2002-09-03 Miguel de Icaza <miguel@ximian.com>
14355 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
14356 it was important that we stored the right value after the
14357 reduction in `converted'.
14359 2002-09-04 Martin Baulig <martin@gnome.org>
14361 * location.cs (Location.SymbolDocument): Use full pathnames for the
14364 2002-08-30 Miguel de Icaza <miguel@ximian.com>
14366 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
14367 of the expression resolve mechanism, because that will catch the
14368 SimpleName error failures.
14370 (Conditional): If we can not resolve the
14371 expression, return, do not crash.
14373 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14376 (location): display token name instead of its number.
14378 2002-08-28 Martin Baulig <martin@gnome.org>
14380 * expression.cs (Binary.ResolveOperator): Don't silently return
14381 but return an error if an operator cannot be applied between two
14384 2002-08-28 Martin Baulig <martin@gnome.org>
14386 * class.cs (Constructor.Define): Set the permission attributes
14387 correctly instead of making all constructors public.
14389 2002-08-28 Martin Baulig <martin@gnome.org>
14391 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
14392 for private members before reporting a CS0103; if we find anything,
14395 2002-08-28 Martin Baulig <martin@gnome.org>
14397 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
14398 to check whether `closure_start_type == closure_invocation_type',
14399 we also need to check whether `m.DeclaringType == closure_invocation_type'
14400 before bypassing the permission checks. We might be accessing
14401 protected/private members from the base class.
14402 (TypeManager.RealMemberLookup): Only set private_ok if private
14403 members were requested via BindingFlags.NonPublic.
14405 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
14407 * expression.cs (MemberAccess.ResolveMemberAccess): Set
14408 MethodGroupExpr.IsExplicitImpl if appropriate.
14409 (Invocation.DoResolve): Don't report the CS0120 for explicit
14410 interface implementations.
14412 2002-08-27 Martin Baulig <martin@gnome.org>
14414 * expression.cs (Invocation.DoResolve): If this is a static
14415 method and we don't have an InstanceExpression, we must report
14418 2002-08-25 Martin Baulig <martin@gnome.org>
14420 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
14421 `==' between a valuetype and an object.
14423 2002-08-25 Miguel de Icaza <miguel@ximian.com>
14425 * ecore.cs (TypeExpr): Provide a ToString method.
14427 2002-08-24 Martin Baulig <martin@gnome.org>
14429 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
14430 now called proggie.dbg and it's a binary file.
14432 2002-08-23 Martin Baulig <martin@gnome.org>
14434 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
14436 2002-08-23 Martin Baulig <martin@gnome.org>
14438 * struct.cs (MyStructInfo.ctor): Make this work with empty
14439 structs; it's not allowed to use foreach() on null.
14441 2002-08-23 Martin Baulig <martin@gnome.org>
14443 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
14444 writer the full pathname of the generated assembly.
14446 2002-08-23 Martin Baulig <martin@gnome.org>
14448 * statements.cs (FlowBranching.UsageVector.MergeChildren):
14449 A `finally' block never returns or breaks; improved handling of
14452 2002-08-23 Martin Baulig <martin@gnome.org>
14454 * statement.cs (Throw.Resolve): Allow `throw null'.
14456 2002-08-23 Martin Baulig <martin@gnome.org>
14458 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
14459 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
14460 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
14461 MemberLookup would return a wrong event if this is an explicit
14462 interface implementation and the class has an event with the same
14465 2002-08-23 Martin Baulig <martin@gnome.org>
14467 * statement.cs (Block.AddChildVariableNames): New public method.
14468 (Block.AddChildVariableName): Likewise.
14469 (Block.IsVariableNameUsedInChildBlock): Likewise.
14470 (Block.AddVariable): Check whether a variable name has already
14471 been used in a child block.
14473 * cs-parser.jay (declare_local_variables): Mark all variable names
14474 from the current block as being used in a child block in the
14477 2002-08-23 Martin Baulig <martin@gnome.org>
14479 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
14480 find the symbol writer.
14482 * driver.cs: csc also allows the arguments to /define being
14483 separated by commas, not only by semicolons.
14485 2002-08-23 Martin Baulig <martin@gnome.org>
14487 * interface.cs (Interface.GetMembers): Added static check for events.
14489 2002-08-15 Martin Baulig <martin@gnome.org>
14491 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
14492 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
14494 * ecore.cs (Expression.MemberLookup): Added documentation and explained
14495 why the MethodData.EmitDestructor() change was necessary.
14497 2002-08-20 Martin Baulig <martin@gnome.org>
14499 * class.cs (TypeContainer.FindMembers): Added static check for events.
14501 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
14503 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
14504 use Type.GetEvents(), not Type.FindMembers().
14506 2002-08-20 Martin Baulig <martin@gnome.org>
14508 * decl.cs (MemberCache): Added a special method cache which will
14509 be used for method-only searched. This ensures that a method
14510 search will return a MethodInfo with the correct ReflectedType for
14513 2002-08-20 Martin Baulig <martin@gnome.org>
14515 * decl.cs (DeclSpace.FindMembers): Made this public.
14517 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14519 * delegate.cs: fixed build on windows.
14520 [FIXME: Filed as bug #29150: MCS must report these errors.]
14522 2002-08-19 Ravi Pratap <ravi@ximian.com>
14524 * ecore.cs (StandardConversionExists): Return a false
14525 if we are trying to convert the void type to anything else
14526 since that is not allowed.
14528 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
14529 we flag error 70 in the event an event is trying to be accessed
14530 directly from outside the declaring type.
14532 2002-08-20 Martin Baulig <martin@gnome.org>
14534 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
14535 MemberCache from typemanager.cs to decl.cs.
14537 2002-08-19 Martin Baulig <martin@gnome.org>
14539 * class.cs (TypeContainer): Implement IMemberContainer.
14540 (TypeContainer.DefineMembers): Create the MemberCache.
14541 (TypeContainer.FindMembers): Do better BindingFlags checking; only
14542 return public members if BindingFlags.Public was given, check
14543 whether members are static.
14545 2002-08-16 Martin Baulig <martin@gnome.org>
14547 * decl.cs (DeclSpace.Define): Splitted this in Define and
14548 DefineMembers. DefineMembers is called first and initializes the
14551 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
14552 DefineMembers() on all our DeclSpaces.
14554 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
14555 but call DefineMembers() on all nested interfaces. We call their
14556 Define() in our new Define() function.
14558 * interface.cs (Interface): Implement IMemberContainer.
14559 (Interface.Define): Moved all code except the attribute stuf to
14561 (Interface.DefineMembers): Initialize the member cache.
14563 * typemanager.cs (IMemberFinder): Removed this interface, we don't
14564 need this anymore since we can use MemberCache.FindMembers directly.
14566 2002-08-19 Martin Baulig <martin@gnome.org>
14568 * typemanager.cs (MemberCache): When creating the cache for an
14569 interface type, add all inherited members.
14570 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
14571 to `out bool used_cache' and documented it.
14572 (TypeManager.MemberLookup): If we already used the cache in the first
14573 iteration, we don't need to do the interfaces check.
14575 2002-08-19 Martin Baulig <martin@gnome.org>
14577 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
14578 here from IMemberFinder and don't implement this interface anymore.
14579 (DeclSpace.MemberCache): Moved here from IMemberFinder.
14581 * typemanager.cs (IMemberFinder): This interface is now only used by
14582 classes which actually support the member cache.
14583 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
14584 since we only put DeclSpaces into this Hashtable.
14585 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
14586 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
14588 2002-08-16 Martin Baulig <martin@gnome.org>
14590 * typemanager.cs (ICachingMemberFinder): Removed.
14591 (IMemberFinder.MemberCache): New property.
14592 (TypeManager.FindMembers): Merged this with RealFindMembers().
14593 This function will never be called from TypeManager.MemberLookup()
14594 so we can't use the cache here, just the IMemberFinder.
14595 (TypeManager.MemberLookup_FindMembers): Check whether the
14596 IMemberFinder has a MemberCache and call the cache's FindMembers
14598 (MemberCache): Rewrote larger parts of this yet another time and
14599 cleaned it up a bit.
14601 2002-08-15 Miguel de Icaza <miguel@ximian.com>
14603 * driver.cs (LoadArgs): Support quoting.
14605 (Usage): Show the CSC-like command line arguments.
14607 Improved a few error messages.
14609 2002-08-15 Martin Baulig <martin@gnome.org>
14611 * typemanager.cs (IMemberContainer.Type): New property.
14612 (IMemberContainer.IsInterface): New property.
14614 The following changes are conditional to BROKEN_RUNTIME, which is
14615 defined at the top of the file.
14617 * typemanager.cs (MemberCache.MemberCache): Don't add the base
14618 class'es members, but add all members from TypeHandle.ObjectType
14619 if we're an interface.
14620 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
14621 is the current type.
14622 (MemberCache.CacheEntry.Container): Removed this field.
14623 (TypeHandle.GetMembers): Include inherited members.
14625 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14627 * typemanager.cs: fixed compilation and added a comment on a field that
14630 2002-08-15 Martin Baulig <martin@gnome.org>
14632 * class.cs (ConstructorInitializer.Resolve): In the
14633 Expression.MemberLookup call, use the queried_type as
14636 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
14637 declared' attribute, it's always true.
14638 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
14639 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
14640 temporary wrapper for FindMembers which tells MemberLookup whether
14641 members from the base classes are included in the return value.
14642 This will go away soon.
14643 (TypeManager.MemberLookup): Use this temporary hack here; once the
14644 new MemberCache is completed, we don't need to do the DeclaredOnly
14645 looping here anymore since the MemberCache will take care of this.
14646 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
14647 (MemberCache): When creating the MemberCache for a class, get
14648 members from the current class and all its base classes.
14649 (MemberCache.CacheEntry.Container): New field. This is a
14650 temporary hack until the Mono runtime is fixed to distinguish
14651 between ReflectedType and DeclaringType. It allows us to use MCS
14652 with both the MS runtime and the unfixed Mono runtime without
14653 problems and without accecting performance.
14654 (MemberCache.SearchMembers): The DeclaredOnly looping from
14655 TypeManager.MemberLookup is now done here.
14657 2002-08-14 Martin Baulig <martin@gnome.org>
14659 * statement.cs (MyStructInfo.MyStructInfo): Don't call
14660 Type.GetFields on dynamic types but get the fields from the
14661 corresponding TypeContainer.
14662 (MyStructInfo.GetStructInfo): Added check for enum types.
14664 * typemanager.cs (MemberList.IsSynchronized): Implemented.
14665 (MemberList.SyncRoot): Implemented.
14666 (TypeManager.FilterWithClosure): No need to check permissions if
14667 closure_start_type == closure_invocation_type, don't crash if
14668 closure_invocation_type is null.
14670 2002-08-13 Martin Baulig <martin@gnome.org>
14672 Rewrote TypeContainer.FindMembers to use a member cache. This
14673 gives us a speed increase of about 35% for the self-hosting MCS
14674 build and of about 15-20% for the class libs (both on GNU/Linux).
14676 * report.cs (Timer): New class to get enhanced profiling. This
14677 whole class is "TIMER" conditional since it remarkably slows down
14680 * class.cs (MemberList): New class. This is an IList wrapper
14681 which we're now using instead of passing MemberInfo[]'s around to
14682 avoid copying this array unnecessarily.
14683 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
14684 (ICachingMemberFinder, IMemberContainer): New interface.
14685 (TypeManager.FilterWithClosure): If `criteria' is null, the name
14686 has already been checked, otherwise use it for the name comparision.
14687 (TypeManager.FindMembers): Renamed to RealMemberFinder and
14688 provided wrapper which tries to use ICachingMemberFinder.FindMembers
14689 if possible. Returns a MemberList, not a MemberInfo [].
14690 (TypeHandle): New class, implements IMemberContainer. We create
14691 one instance of this class per type, it contains a MemberCache
14692 which is used to do the member lookups.
14693 (MemberCache): New class. Each instance of this class contains
14694 all members of a type and a name-based hash table.
14695 (MemberCache.FindMembers): This is our new member lookup
14696 function. First, it looks up all members of the requested name in
14697 the hash table. Then, it walks this list and sorts out all
14698 applicable members and returns them.
14700 2002-08-13 Martin Baulig <martin@gnome.org>
14702 In addition to a nice code cleanup, this gives us a performance
14703 increase of about 1.4% on GNU/Linux - not much, but it's already
14704 half a second for the self-hosting MCS compilation.
14706 * typemanager.cs (IMemberFinder): New interface. It is used by
14707 TypeManager.FindMembers to call FindMembers on a TypeContainer,
14708 Enum, Delegate or Interface.
14709 (TypeManager.finder_to_member_finder): New PtrHashtable.
14710 (TypeManager.finder_to_container): Removed.
14711 (TypeManager.finder_to_delegate): Removed.
14712 (TypeManager.finder_to_interface): Removed.
14713 (TypeManager.finder_to_enum): Removed.
14715 * interface.cs (Interface): Implement IMemberFinder.
14717 * delegate.cs (Delegate): Implement IMemberFinder.
14719 * enum.cs (Enum): Implement IMemberFinder.
14721 * class.cs (TypeContainer): Implement IMemberFinder.
14723 2002-08-12 Martin Baulig <martin@gnome.org>
14725 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
14727 2002-08-12 Martin Baulig <martin@gnome.org>
14729 * ecore.cs (ITypeExpression): New interface for expressions which
14731 (TypeExpression): Renamed to TypeLookupExpression.
14732 (Expression.DoResolve): If we're doing a types-only lookup, the
14733 expression must implement the ITypeExpression interface and we
14734 call DoResolveType() on it.
14735 (SimpleName): Implement the new ITypeExpression interface.
14736 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
14737 hack, the situation that we're only looking up types can't happen
14738 anymore when this method is called. Moved the type lookup code to
14739 DoResolveType() and call it.
14740 (SimpleName.DoResolveType): This ITypeExpression interface method
14741 is now doing the types-only lookup.
14742 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
14743 (ResolveFlags): Added MaskExprClass.
14745 * expression.cs (MemberAccess): Implement the ITypeExpression
14747 (MemberAccess.DoResolve): Added support for a types-only lookup
14748 when we're called via ITypeExpression.DoResolveType().
14749 (ComposedCast): Implement the ITypeExpression interface.
14751 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
14752 Expression.Resolve() with ResolveFlags.Type instead.
14754 2002-08-12 Martin Baulig <martin@gnome.org>
14756 * interface.cs (Interface.Define): Apply attributes.
14758 * attribute.cs (Attribute.ApplyAttributes): Added support for
14759 interface attributes.
14761 2002-08-11 Martin Baulig <martin@gnome.org>
14763 * statement.cs (Block.Emit): Only check the "this" variable if we
14764 do not always throw an exception.
14766 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
14767 whether the property has a set accessor.
14769 2002-08-11 Martin Baulig <martin@gnome.org>
14771 Added control flow analysis support for structs.
14773 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
14774 with control flow analysis turned off.
14775 (IVariable): New interface.
14776 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
14777 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
14778 (FieldExpr.DoResolve): Resolve the instance expression with flow
14779 analysis turned off and do the definite assignment check after the
14780 resolving when we know what the expression will resolve to.
14782 * expression.cs (LocalVariableReference, ParameterReference):
14783 Implement the new IVariable interface, only call the flow analysis
14784 code if ec.DoFlowAnalysis is true.
14785 (This): Added constructor which takes a Block argument. Implement
14786 the new IVariable interface.
14787 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
14788 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
14789 This does the definite assignment checks for struct members.
14791 * class.cs (Constructor.Emit): If this is a non-static `struct'
14792 constructor which doesn't have any initializer, call
14793 Block.AddThisVariable() to tell the flow analysis code that all
14794 struct elements must be initialized before control returns from
14797 * statement.cs (MyStructInfo): New public class.
14798 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
14799 argument to this indexer. If non-zero, check an individual struct
14800 member, not the whole struct.
14801 (FlowBranching.CheckOutParameters): Check struct members.
14802 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
14803 overloaded versions of these methods which take an additional
14804 `int field_idx' argument to check struct members.
14805 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
14806 overloaded versions of these methods which take an additional
14807 `string field_name' argument to check struct member.s
14808 (VariableInfo): Implement the IVariable interface.
14809 (VariableInfo.StructInfo): New public property. Returns the
14810 MyStructInfo instance of the variable if it's a struct or null.
14811 (Block.AddThisVariable): New public method. This is called from
14812 Constructor.Emit() for non-static `struct' constructor which do
14813 not have any initializer. It creates a special variable for the
14814 "this" instance variable which will be checked by the flow
14815 analysis code to ensure that all of the struct's fields are
14816 initialized before control returns from the constructor.
14817 (UsageVector): Added support for struct members. If a
14818 variable/parameter is a struct with N members, we reserve a slot
14819 in the usage vector for each member. A struct is considered fully
14820 initialized if either the struct itself (slot 0) or all its
14821 members are initialized.
14823 2002-08-08 Martin Baulig <martin@gnome.org>
14825 * driver.cs (Driver.MainDriver): Only report an error CS5001
14826 if there were no compilation errors.
14828 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
14829 `UnsafeContext' property to determine whether the parent is in
14830 unsafe context rather than checking the parent's ModFlags:
14831 classes nested in an unsafe class are unsafe as well.
14833 2002-08-08 Martin Baulig <martin@gnome.org>
14835 * statement.cs (UsageVector.MergeChildren): Distinguish between
14836 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
14837 we return. Added test17() and test18() to test-154.cs.
14839 2002-08-08 Martin Baulig <martin@gnome.org>
14841 * typemanager.cs (TypeManager.FilterWithClosure): If we have
14842 Family access, make sure the invoking type isn't a subclass of the
14843 queried type (that'd be a CS1540).
14845 * ecore.cs (Expression.MemberLookup): Added overloaded version of
14846 this method which takes an additional `Type invocation_type'.
14848 * expression.cs (BaseAccess.DoResolve): Use the base type as
14849 invocation and query type.
14850 (MemberAccess.DoResolve): If the lookup failed and we're about to
14851 report a CS0122, try a lookup with the ec.ContainerType - if this
14852 succeeds, we must report a CS1540.
14854 2002-08-08 Martin Baulig <martin@gnome.org>
14856 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
14857 (MethodGroupExpr): Implement the IMemberExpr interface.
14859 * expression (MemberAccess.ResolveMemberAccess): No need to have
14860 any special code for MethodGroupExprs anymore, they're now
14863 2002-08-08 Martin Baulig <martin@gnome.org>
14865 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
14866 Family, FamANDAssem and FamORAssem permissions.
14867 (TypeManager.IsSubclassOrNestedChildOf): New public method.
14869 2002-08-08 Martin Baulig <martin@gnome.org>
14871 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
14872 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
14875 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
14877 * driver.cs: implemented /resource option to embed managed resources.
14879 2002-08-07 Martin Baulig <martin@gnome.org>
14881 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
14882 (FieldBase.HasFieldInitializer): New public property.
14883 (FieldBase.GetInitializerExpression): New public method. Resolves and
14884 returns the field initializer and makes sure it is only resolved once.
14885 (TypeContainer.EmitFieldInitializers): Call
14886 FieldBase.GetInitializerExpression to get the initializer, this ensures
14887 that it isn't resolved multiple times.
14889 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
14890 the resolving process (SimpleName/MemberLookup) that we're currently
14891 emitting a field initializer (which must not access any instance members,
14892 this is an error CS0236).
14894 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
14895 argument, if the `IsFieldInitializer' flag is set, we must report and
14896 error CS0236 and not an error CS0120.
14898 2002-08-07 Martin Baulig <martin@gnome.org>
14900 * ecore.cs (IMemberExpr): New public interface.
14901 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
14902 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
14903 if the expression is an IMemberExpr.
14905 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
14906 to be null, implicitly default to `this' if we're non-static in
14907 this case. Simplified the code a lot by using the new IMemberExpr
14908 interface. Also fixed bug #28176 here.
14910 2002-08-06 Martin Baulig <martin@gnome.org>
14912 * cs-parser.jay (SimpleLookup): Removed. We need to create
14913 ParameterReferences during semantic analysis so that we can do a
14914 type-only search when resolving Cast, TypeOf and SizeOf.
14915 (block): Pass the `current_local_parameters' to the Block's
14918 * class.cs (ConstructorInitializer): Added `Parameters parameters'
14919 argument to the constructor.
14920 (ConstructorInitializer.Resolve): Create a temporary implicit
14921 block with the parameters.
14923 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
14924 references here if we aren't doing a type-only search.
14926 * statement.cs (Block): Added constructor which takes a
14927 `Parameters parameters' argument.
14928 (Block.Parameters): New public property.
14930 * support.cs (InternalParameters.Parameters): Renamed `parameters'
14931 to `Parameters' and made it public readonly.
14933 2002-08-06 Martin Baulig <martin@gnome.org>
14935 * ecore.cs (Expression.Warning): Made this public as well.
14937 * report.cs (Report.Debug): Print the contents of collections.
14939 2002-08-06 Martin Baulig <martin@gnome.org>
14941 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
14942 used to tell Resolve() which kinds of expressions it may return.
14943 (Expression.Resolve): Added overloaded version of this method which
14944 takes a `ResolveFlags flags' argument. This can be used to tell
14945 Resolve() which kinds of expressions it may return. Reports a
14947 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
14948 ResolveFlags.SimpleName.
14949 (Expression.Error118): Added overloaded version of this method which
14950 takes a `ResolveFlags flags' argument. It uses the flags to determine
14951 which kinds of expressions are allowed.
14953 * expression.cs (Argument.ResolveMethodGroup): New public method.
14954 Resolves an argument, but allows a MethodGroup to be returned.
14955 This is used when invoking a delegate.
14957 * TODO: Updated a bit.
14959 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14961 Fixed compilation with csc.
14963 * ecore.cs: Expression.Error made public. Is this correct? Should
14964 Warning be made public too?
14966 * expression.cs: use ea.Location instead of ea.loc.
14967 [FIXME: Filed as bug #28607: MCS must report these errors.]
14969 2002-08-06 Martin Baulig <martin@gnome.org>
14971 * ecore.cs (Expression.loc): Moved the location here instead of
14972 duplicating it in all derived classes.
14973 (Expression.Location): New public property.
14974 (Expression.Error, Expression.Warning): Made them non-static and
14975 removed the location argument.
14976 (Expression.Warning): Added overloaded version which takes an
14977 `int level' argument.
14978 (Expression.Error118): Make this non-static and removed the
14979 expression and location arguments.
14980 (TypeExpr): Added location argument to the constructor.
14982 * expression.cs (StaticCallExpr): Added location argument to
14984 (Indirection, PointerArithmetic): Likewise.
14985 (CheckedExpr, UnCheckedExpr): Likewise.
14986 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
14987 (StringPtr): Likewise.
14990 2002-08-05 Martin Baulig <martin@gnome.org>
14992 * expression.cs (BaseAccess.DoResolve): Actually report errors.
14994 * assign.cs (Assign.DoResolve): Check whether the source
14995 expression is a value or variable.
14997 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
14998 while resolving the corresponding blocks.
15000 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
15001 an error, don't silently return null.
15003 * statement.cs (Block.AddVariable): Do the error reporting here
15004 and distinguish between CS0128 and CS0136.
15005 (Block.DoResolve): Report all unused labels (warning CS0164).
15006 (LabeledStatement): Pass the location to the constructor.
15007 (LabeledStatement.HasBeenReferenced): New property.
15008 (LabeledStatement.Resolve): Set it to true here.
15010 * statement.cs (Return.Emit): Return success even after reporting
15011 a type mismatch error (CS0126 or CS0127), this is what csc does and
15012 it avoids confusing the users with any consecutive errors.
15014 2002-08-05 Martin Baulig <martin@gnome.org>
15016 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
15018 * const.cs (Const.LookupConstantValue): Catch circular definitions.
15020 * expression.cs (MemberAccess.DoResolve): Silently return if an
15021 error has already been reported.
15023 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
15024 error has already been reported.
15026 2002-08-05 Martin Baulig <martin@gnome.org>
15028 * statement.cs (UsageVector): Only initialize the `parameters'
15029 vector if we actually have any "out" parameters.
15031 2002-08-05 Martin Baulig <martin@gnome.org>
15033 * expression.cs (Binary.ResolveOperator): When combining delegates,
15034 they must have the same type.
15036 2002-08-05 Martin Baulig <martin@gnome.org>
15038 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
15039 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
15040 work with the ms runtime and we also don't need it: if we're a
15041 PropertyBuilder and not in the `indexer_arguments' hash, then we
15042 are a property and not an indexer.
15044 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
15045 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
15046 since the latter one doesn't work with the ms runtime.
15048 2002-08-03 Martin Baulig <martin@gnome.org>
15050 Fixed bugs #27998 and #22735.
15052 * class.cs (Method.IsOperator): New public field.
15053 (Method.CheckBase): Report CS0111 if there's already a method
15054 with the same parameters in the current class. Report CS0508 when
15055 attempting to change the return type of an inherited method.
15056 (MethodData.Emit): Report CS0179 if a method doesn't have a body
15057 and it's not marked abstract or extern.
15058 (PropertyBase): New abstract base class for Property and Indexer.
15059 (PropertyBase.CheckBase): Moved here from Property and made it work
15061 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
15062 the same so we can reuse it there.
15063 (Property, Indexer): Derive from PropertyBase.
15064 (MethodSignature.inheritable_property_signature_filter): New delegate
15065 to find properties and indexers.
15067 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
15068 argument and improved error reporting.
15070 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
15071 EmptyReadOnlyParameters and made it a property.
15073 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
15074 version of this method which takes a `PropertyInfo indexer'.
15075 (TypeManager.RegisterIndexer): New method.
15077 * class.cs: Added myself as author of this file :-)
15079 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15081 * class.cs: fixed compilation on windoze.
15083 2002-08-03 Martin Baulig <martin@gnome.org>
15085 * interface.cs (Interface.GetInterfaceBases): Check whether all
15086 base interfaces are at least as accessible than the current one.
15088 * class.cs (TypeContainer.GetClassBases): Check whether base types
15089 are at least as accessible than the current type.
15090 (TypeContainer.AsAccessible): Implemented and made non-static.
15091 (MemberBase.CheckParameters): Report errors if the accessibility
15094 * delegate.cs (Delegate.Delegate): The default visibility is
15095 internal for top-level types and private for nested types.
15096 (Delegate.Define): Report errors if the accessibility checks fail.
15098 * enum.cs (Enum.Enum): The default visibility is internal for
15099 top-level types and private for nested types.
15100 (Enum.DefineType): Compute the correct visibility.
15102 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
15103 function which takes a `bool is_toplevel' instead of a TypeContainer.
15105 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
15108 2002-08-02 Martin Baulig <martin@gnome.org>
15110 * expression.cs (LocalVariableReferenc): Added constructor which
15111 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
15112 (LocalVariableReference.IsReadOnly): New property.
15113 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
15114 variable is readonly, use our own readonly flag to do this; you can
15115 use the new constructor to get a writable reference to a read-only
15118 * cs-parser.jay (foreach_statement, using_statement): Get a writable
15119 reference to the local variable.
15121 2002-08-01 Miguel de Icaza <miguel@ximian.com>
15123 * rootcontext.cs (ResolveCore): Also include System.Exception
15125 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
15126 we reach an EmptyStatement.
15128 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
15131 * expression.cs (Binary.ResolveOperator): Check error result in
15134 use brtrue/brfalse directly and avoid compares to null.
15136 2002-08-02 Martin Baulig <martin@gnome.org>
15138 * class.cs (TypeContainer.Define): Define all nested interfaces here.
15139 Fixes bug #28407, added test-155.cs.
15141 2002-08-01 Martin Baulig <martin@gnome.org>
15143 * class.cs (Event.EmitDefaultMethod): Make this work with static
15144 events. Fixes #28311, added verify-3.cs.
15146 2002-08-01 Martin Baulig <martin@gnome.org>
15148 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
15149 `is_disposable' fields.
15150 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
15151 `hm.is_disposable' if we're using the collection pattern.
15152 (Foreach.EmitCollectionForeach): Use the correct type for the
15153 enumerator's local variable, only emit the try/finally block if
15154 necessary (fixes #27713).
15156 2002-08-01 Martin Baulig <martin@gnome.org>
15158 * ecore.cs (Expression.report118): Renamed to Error118 and made
15161 * statement.cs (Throw.Resolve): Check whether the expression is of
15162 the correct type (CS0118) and whether the type derives from
15163 System.Exception (CS0155).
15164 (Catch.Resolve): New method. Do the type lookup here and check
15165 whether it derives from System.Exception (CS0155).
15166 (Catch.CatchType, Catch.IsGeneral): New public properties.
15168 * typemanager.cs (TypeManager.exception_type): Added.
15170 2002-07-31 Miguel de Icaza <miguel@ximian.com>
15172 * driver.cs: Updated About function.
15174 2002-07-31 Martin Baulig <martin@gnome.org>
15176 Implemented Control Flow Analysis.
15178 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
15179 (EmitContext.CurrentBranching): Added.
15180 (EmitContext.StartFlowBranching): Added.
15181 (EmitContext.EndFlowBranching): Added.
15182 (EmitContext.KillFlowBranching): Added.
15183 (EmitContext.IsVariableAssigned): Added.
15184 (EmitContext.SetVariableAssigned): Added.
15185 (EmitContext.IsParameterAssigned): Added.
15186 (EmitContext.SetParameterAssigned): Added.
15187 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
15188 Added control flow analysis stuff here.
15190 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
15191 resolve the expression as lvalue.
15192 (LocalVariableReference.DoResolve): Check whether the variable has
15193 already been assigned.
15194 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
15195 the parameter as assigned here.
15196 (ParameterReference.DoResolve): Check whether the parameter has already
15198 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
15199 expression as lvalue.
15201 * statement.cs (FlowBranching): New class for the flow analysis code.
15202 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
15203 (LabeledStatement.IsDefined): New public property.
15204 (LabeledStatement.AddUsageVector): New public method to tell flow
15205 analyis that the label may be reached via a forward jump.
15206 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
15208 (VariableInfo.Number): New public field. This is used by flow analysis
15209 to number all locals of a block.
15210 (Block.CountVariables): New public property. This is the number of
15211 local variables in this block (including the locals from all parent
15213 (Block.EmitMeta): Number all the variables.
15215 * statement.cs: Added flow analysis support to all classes.
15217 2002-07-31 Martin Baulig <martin@gnome.org>
15219 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
15220 To get debugging messages, compile mcs with /define:MCS_DEBUG and
15221 then use this argument.
15223 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
15225 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
15226 use this to specify /define options.
15228 2002-07-29 Martin Baulig <martin@gnome.org>
15230 * statement.cs (Fixed): Moved all code that does variable lookups
15231 and resolvings from Emit to Resolve.
15233 * statement.cs (For): Moved all code that does variable lookups
15234 and resolvings from Emit to Resolve.
15236 * statement.cs (Using): Moved all code that does variable lookups
15237 and resolvings from Emit to Resolve.
15239 2002-07-29 Martin Baulig <martin@gnome.org>
15241 * attribute.cs (Attribute.Resolve): Explicitly catch a
15242 System.NullReferenceException when creating the
15243 CustromAttributeBuilder and report a different warning message.
15245 2002-07-29 Martin Baulig <martin@gnome.org>
15247 * support.cs (ParameterData.ParameterName): Added method to
15248 get the name of a parameter.
15250 * typemanager.cs (TypeManager.IsValueType): New public method.
15252 2002-07-29 Martin Baulig <martin@gnome.org>
15254 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
15255 is a flag which specifies that it's either ref or out.
15256 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
15257 the out parameter to `out Parameter.Modifier mod', also set the
15258 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
15260 * support.cs (InternalParameters.ParameterModifier): Distinguish
15261 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15262 Parameter.Modifier.ISBYREF flag if it's either ref or out.
15264 * expression.cs (Argument.GetParameterModifier): Distinguish
15265 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15266 Parameter.Modifier.ISBYREF flag if it's either ref or out.
15268 2002-07-29 Martin Baulig <martin@gnome.org>
15270 * expression.cs (ParameterReference.ParameterReference): Added
15271 `Location loc' argument to the constructor.
15273 * cs-parser.jay: Pass location to ParameterReference.
15275 2002-07-28 Miguel de Icaza <miguel@ximian.com>
15277 * statement.cs (Try): Initialize the location.
15279 * cs-parser.jay: pass location to Try.
15281 * expression.cs (Unary.Reduce): Change the prototype to return
15282 whether a constant fold could be performed or not. The result is
15283 returned in an out parameters. In the case of Indirection and
15284 AddressOf, we want to perform the full tests.
15286 2002-07-26 Miguel de Icaza <miguel@ximian.com>
15288 * statement.cs (Statement.Emit): Flag dead code.
15290 2002-07-27 Andrew Birkett <andy@nobugs.org>
15292 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
15294 2002-07-27 Martin Baulig <martin@gnome.org>
15296 * class.cs (MethodData.Define): Put back call to
15297 TypeManager.AddMethod(), accidentally commented this out.
15299 * report.cs (Debug): New public method to print debugging information,
15300 this is `[Conditional ("DEBUG")]'.
15302 2002-07-26 Martin Baulig <martin@gnome.org>
15304 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
15305 (switch_statement): Push the current_block to the switch_stack and
15306 pop it again when we're done with the switch.
15307 (switch_section): The new block is a child of the current_block.
15308 Fixes bug #24007, added test-152.cs.
15310 2002-07-27 Martin Baulig <martin@gnome.org>
15312 * expression.cs (Invocation.EmitArguments): When calling a varargs
15313 function with only its fixed arguments, we need to pass an empty
15316 2002-07-27 Martin Baulig <martin@gnome.org>
15318 Mono 0.13 has been released.
15320 2002-07-25 Miguel de Icaza <miguel@ximian.com>
15322 * driver.cs: Rename --resource to --linkres, because that is what
15323 we do currently, we dont support --resource yet.
15325 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
15327 2002-07-25 Martin Baulig <martin@gnome.org>
15329 * class.cs (MethodData): New public class. This is a `method builder'
15330 class for a method or one accessor of a Property/Indexer/Event.
15331 (MethodData.GetMethodFlags): Moved here from MemberBase.
15332 (MethodData.ApplyAttributes): Likewise.
15333 (MethodData.ApplyObsoleteAttribute): Likewise.
15334 (MethodData.ApplyConditionalAttribute): Likewise.
15335 (MethodData.ApplyDllImportAttribute): Likewise.
15336 (MethodData.CheckAbstractAndExternal): Likewise.
15337 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
15338 (MethodData.Emit): Formerly known as Method.Emit().
15339 (MemberBase): Moved everything which was specific to a single
15340 accessor/method to MethodData.
15341 (Method): Create a new MethodData and call Define() and Emit() on it.
15342 (Property, Indexer, Event): Create a new MethodData objects for each
15343 accessor and call Define() and Emit() on them.
15345 2002-07-25 Martin Baulig <martin@gnome.org>
15347 Made MethodCore derive from MemberBase to reuse the code from there.
15348 MemberBase now also checks for attributes.
15350 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
15351 (MemberBase.GetMethodFlags): Moved here from class Method and marked
15353 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
15354 `CallingConventions cc' and `Attributes opt_attrs' arguments.
15355 (MemberBase.ApplyAttributes): New virtual method; applies the
15356 attributes to a method or accessor.
15357 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
15358 (MemberBase.ApplyConditionalAttribute): Likewise.
15359 (MemberBase.ApplyDllImportAttribute): Likewise.
15360 (MemberBase.CheckAbstractAndExternal): Likewise.
15361 (MethodCore.ParameterTypes): This is now a property instead of a
15362 method, it's initialized from DoDefineParameters().
15363 (MethodCore.ParameterInfo): Removed the set accessor.
15364 (MethodCore.DoDefineParameters): New protected virtual method to
15365 initialize ParameterTypes and ParameterInfo.
15366 (Method.GetReturnType): We can now simply return the MemberType.
15367 (Method.GetMethodFlags): Override the MemberBase version and add
15368 the conditional flags.
15369 (Method.CheckBase): Moved some code from Define() here, call
15370 DoDefineParameters() here.
15371 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
15372 here to avoid some larger code duplication.
15373 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
15374 ensure that abstract and external accessors don't declare a body.
15376 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
15377 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
15378 lookup in the attribute's parent classes, so we need to abort as soon
15379 as we found the first match.
15380 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
15381 the attribute has no arguments.
15383 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
15386 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15388 * cs-parser.jay: reverted previous patch.
15390 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15392 * cs-parser.jay: fixed bug #22119.
15394 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15396 * attribute.cs: fixed compilation. The error was:
15397 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
15398 be assigned to before control leaves the current method."
15399 [FIXME: Filed as bug #28186: MCS must report this error.]
15401 2002-07-25 Martin Baulig <martin@gnome.org>
15403 * attribute.cs (Attribute.Conditional_GetConditionName): New static
15404 method to pull the condition name ouf of a Conditional attribute.
15405 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
15406 the obsolete message and error flag out of an Obsolete attribute.
15408 * class.cs (Method.GetMethodFlags): New public method to get the
15409 TypeManager.MethodFlags for this method.
15410 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
15412 (Method.Define): Get and apply the Obsolete and Conditional attributes;
15413 if we're overriding a virtual function, set the new private variable
15414 `parent_method'; call the new TypeManager.AddMethod().
15416 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
15417 the MethodBuilder and the Method in a PtrHashtable.
15418 (TypeManager.builder_to_method): Added for this purpose.
15419 (TypeManager.MethodFlags): Added IsObsoleteError.
15420 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
15421 Obsolete and Conditional arguments in MethodBuilders. If we discover
15422 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
15423 the message from the attribute.
15425 2002-07-24 Martin Baulig <martin@gnome.org>
15427 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
15428 preprocessor directives, ensure that the argument to #define/#undef is
15429 exactly one identifier and that it's actually an identifier.
15431 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
15434 2002-07-24 Martin Baulig <martin@gnome.org>
15436 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
15437 initialize it to TypeManager.object_type in the constructor.
15438 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
15439 of the `hm.get_current' method if we're using the collection pattern.
15440 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
15441 for the explicit conversion to make it work when we're using the collection
15442 pattern and the `Current' property has a different return type than `object'.
15445 2002-07-24 Martin Baulig <martin@gnome.org>
15447 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
15448 does not match, but don't report any errors. This method is called in
15449 order for all methods in a MethodGroupExpr until a matching method is
15450 found, so we don't want to bail out if the first method doesn't match.
15451 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
15452 matches, report the 123. Fixes #28070.
15454 2002-07-24 Martin Baulig <martin@gnome.org>
15456 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
15457 TypeManager.TypeToCoreType() to the top of the method so the
15458 following equality checks will work. Fixes #28107.
15460 2002-07-24 Martin Baulig <martin@gnome.org>
15462 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
15463 operand is of type uint, and the other operand is of type sbyte,
15464 short or int, the operands are converted to type long." -
15465 Actually do what this comment already told us. Fixes bug #28106,
15468 2002-07-24 Martin Baulig <martin@gnome.org>
15470 * class.cs (MethodBase): New abstract class. This is now a base
15471 class for Property, Indexer and Event to avoid some code duplication
15472 in their Define() and DefineMethods() methods.
15473 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
15474 generic methods for Define() and DefineMethods().
15475 (FieldBase): Derive from MemberBase, not MemberCore.
15476 (Property): Derive from MemberBase, not MemberCore.
15477 (Property.DefineMethod): Moved all the code from this method to the
15478 new MethodBase.DefineAccessor(), just call it with appropriate
15480 (Property.Define): Call the new Property.DoDefine(), this does some
15481 sanity checks and we don't need to duplicate the code everywhere.
15482 (Event): Derive from MemberBase, not MemberCore.
15483 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
15484 accessors, this will also make them work with interface events.
15485 (Indexer): Derive from MemberBase, not MemberCore.
15486 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
15487 (Indexer.Define): Use the new MethodBase functions.
15489 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
15490 argument to the constructor.
15491 (Interface.FindMembers): Added support for interface events.
15492 (Interface.PopluateEvent): Implemented.
15494 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
15496 2002-07-22 Miguel de Icaza <miguel@ximian.com>
15498 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
15499 but this is required to check for a method name being the same as
15500 the containing class.
15504 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15506 * interface.cs: initialize variable.
15508 2002-07-23 Martin Baulig <martin@gnome.org>
15510 Implemented the IndexerName attribute in interfaces.
15512 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
15513 name if this is an explicit interface implementation.
15514 (Indexer.InterfaceIndexerName): New public variable. If we're
15515 implementing an interface indexer, this is the IndexerName in that
15516 interface. Otherwise, it's the IndexerName.
15517 (Indexer.DefineMethod): If we're implementing interface indexer,
15518 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
15519 and Pending.ImplementIndexer methods.
15520 (Indexer.Define): Also define the PropertyBuilder if we're
15521 implementing an interface indexer and this is neither an explicit
15522 interface implementation nor do the IndexerName match the one in
15525 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
15526 If a method is defined here, then we always need to create a proxy
15527 for it. This is used when implementing interface indexers.
15528 (Pending.IsInterfaceIndexer): New public method.
15529 (Pending.ImplementIndexer): New public method.
15530 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
15531 This is used when implementing interface indexers to define a proxy
15533 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
15534 define a proxy if necessary.
15536 * interface.cs (Interface.IndexerName): New public variable.
15537 (Interface.PopulateIndexer): Set the IndexerName.
15538 (Interface.DefineIndexers): New private method. Populate all the
15539 indexers and make sure their IndexerNames match.
15541 * typemanager.cs (IndexerPropertyName): Added support for interface
15544 2002-07-22 Martin Baulig <martin@gnome.org>
15546 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
15547 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
15548 ret if HasReturnLabel.
15549 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
15552 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
15553 and set the ec.LoopBeginTryCatchLevel.
15554 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
15555 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
15556 the current ec.TryCatchLevel, the branch goes out of an exception
15557 block. In this case, we need to use Leave and not Br.
15559 2002-07-22 Martin Baulig <martin@gnome.org>
15561 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
15562 block unless the block does not always return or it is contained in
15563 another try { ... } catch { ... } block. Fixes bug #26506.
15564 Added verify-1.cs to the test suite.
15566 2002-07-22 Martin Baulig <martin@gnome.org>
15568 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
15569 then we do not always return. Fixes bug #24985.
15571 2002-07-22 Martin Baulig <martin@gnome.org>
15573 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
15574 lookup on a per-class level; ie. walk up the class hierarchy until we
15575 found at least one applicable method, then choose the best among them.
15576 Fixes bug #24463 and test-29.cs.
15578 2002-07-22 Martin Baulig <martin@gnome.org>
15580 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
15581 return types of the methods. The return type is not part of the
15582 signature and we must not check it to make the `new' modifier work.
15583 Fixes bug #27999, also added test-147.cs.
15584 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
15586 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
15587 on the method's return type.
15589 2002-07-21 Martin Baulig <martin@gnome.org>
15591 * assign.cs: Make this work if the rightmost source is a constant and
15592 we need to do an implicit type conversion. Also adding a few more tests
15593 to test-38.cs which should have caught this.
15595 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
15596 target in the makefile for this. The makefile.gnu is primarily intended
15597 for end-users who don't want to debug the compiler.
15599 2002-07-21 Martin Baulig <martin@gnome.org>
15601 * assign.cs: Improved the Assign class so it can now handle embedded
15602 assignments (X = Y = Z = something). As a side-effect this'll now also
15603 consume less local variables. test-38.cs now passes with MCS, added
15604 a few new test cases to that test.
15606 2002-07-20 Martin Baulig <martin@gnome.org>
15608 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
15609 instructions. Fixes bug #27977, also added test-146.cs.
15611 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15613 * cs-tokenizer.cs: fixed getHex ().
15615 2002-07-19 Martin Baulig <martin@gnome.org>
15617 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
15618 not Type.GetType() to lookup the array type. This is needed when
15619 we're constructing an array of a user-defined type.
15620 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
15621 single-dimensional arrays, but also for single-dimensial arrays of
15624 2002-07-19 Martin Baulig <martin@gnome.org>
15626 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
15627 this function is called, it's not allowed to share LocalBuilders
15628 among ILGenerators.
15630 2002-07-19 Martin Baulig <martin@gnome.org>
15632 * expression.cs (Argument.Resolve): Report an error 118 when trying
15633 to pass a type as argument.
15635 2002-07-18 Martin Baulig <martin@gnome.org>
15637 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
15638 Conv_R_Un for the signed `long' type.
15640 2002-07-15 Miguel de Icaza <miguel@ximian.com>
15642 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
15643 `expr' for the temporary result, as that will fail if we do
15644 multiple resolves on the same expression.
15646 2002-07-05 Miguel de Icaza <miguel@ximian.com>
15648 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
15649 ec.TypeContainer for looking up aliases.
15651 * class.cs (TypeContainer): Remove LookupAlias from here.
15653 * decl.cs (DeclSpace); Move here.
15655 2002-07-01 Miguel de Icaza <miguel@ximian.com>
15657 * class.cs (FindMembers): Only call filter if the constructor
15658 bulider is not null.
15660 Also handle delegates in `NestedTypes' now. Now we will perform
15661 type lookups using the standard resolution process. This also
15664 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
15665 This uses Expressions (the limited kind that can be parsed by the
15666 tree) instead of strings.
15668 * expression.cs (ComposedCast.ToString): Implement, used to flag
15669 errors since now we have to render expressions.
15671 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
15674 * ecore.cs (SimpleName.ToString): ditto.
15676 * cs-parser.jay: Instead of using strings to assemble types, use
15677 Expressions to assemble the type (using SimpleName, ComposedCast,
15678 MemberAccess). This should fix the type lookups in declarations,
15679 because we were using a different code path for this.
15681 * statement.cs (Block.Resolve): Continue processing statements
15682 even when there is an error.
15684 2002-07-17 Miguel de Icaza <miguel@ximian.com>
15686 * class.cs (Event.Define): Also remove the `remove' method from
15687 the list of pending items.
15689 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
15690 generate more compact code.
15692 2002-07-17 Martin Baulig <martin@gnome.org>
15694 * const.cs (Const.LookupConstantValue): Add support for constant
15695 `unchecked' and `checked' expressions.
15696 Also adding test case test-140.cs for this.
15698 2002-07-17 Martin Baulig <martin@gnome.org>
15700 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
15701 check whether mi.ReturnType implements the IEnumerator interface; the
15702 `==' and the IsAssignableFrom() will fail in this situation.
15704 2002-07-16 Ravi Pratap <ravi@ximian.com>
15706 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
15709 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15711 * expression.cs: fixed bug #27811.
15713 2002-07-14 Miguel de Icaza <miguel@ximian.com>
15715 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
15716 Molaro: when we are a ref, the value already contains a pointer
15717 value, do not take the address of it.
15719 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
15720 * removed mb-parser.jay and mb-tokenizer.cs
15722 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15724 * expression.cs: check against the building corlib void type.
15726 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
15728 * ecore.cs: fix for valuetype static readonly fields: when
15729 initializing them, we need their address, not the address of a copy.
15731 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
15733 * typemanager.cs: register also enum_type in corlib.
15735 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
15737 * class.cs: allow calling this (but not base) initializers in structs.
15739 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
15741 * ecore.cs: make sure we compare against the building base types
15744 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
15746 * typemanager.cs: fix TypeToCoreType() to handle void and object
15747 (corlib gets no more typerefs after this change).
15749 2002-07-12 Miguel de Icaza <miguel@ximian.com>
15751 * expression.cs (ArrayCreation.EmitArrayArguments): use
15752 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
15754 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
15755 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
15756 array indexes, the runtime actually forbids them.
15758 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
15759 for array arguments here.
15761 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
15762 instead of the default for ValueTypes.
15764 (New.DoEmit): Use IsValueType instead of
15765 IsSubclassOf (value_type)
15766 (New.DoResolve): ditto.
15767 (Invocation.EmitCall): ditto.
15769 * assign.cs (Assign): ditto.
15771 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
15772 Statements *are* currently doing part of their resolution during
15775 Expressions do always resolve during resolve, but statements are
15776 only required to propagate resolution to their children.
15778 2002-07-11 Miguel de Icaza <miguel@ximian.com>
15780 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
15782 (LoadAssembly): Do not add the dll if it is already specified
15784 (MainDriver): Add the System directory to the link path at the end,
15785 after all the other -L arguments.
15787 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
15788 wrong opcode for loading bytes and bools (ldelem.i1 instead of
15789 ldelem.u1) and using the opposite for sbytes.
15791 This fixes Digger, and we can finally run it.
15793 * driver.cs (UnixParseOption): Move the option parsing here.
15794 (CSCParseOption): Implement CSC-like parsing of options.
15796 We now support both modes of operation, the old Unix way, and the
15797 new CSC-like way. This should help those who wanted to make cross
15798 platform makefiles.
15800 The only thing broken is that /r:, /reference: and /lib: are not
15801 implemented, because I want to make those have the same semantics
15802 as the CSC compiler has, and kill once and for all the confussion
15803 around this. Will be doing this tomorrow.
15805 * statement.cs (Unsafe.Resolve): The state is checked during
15806 resolve, not emit, so we have to set the flags for IsUnsfe here.
15808 2002-07-10 Miguel de Icaza <miguel@ximian.com>
15810 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
15811 not catch the Error_ObjectRefRequired in SimpleName (as it is
15812 possible to have a class/instance variable name that later gets
15813 deambiguated), we have to check this here.
15815 2002-07-10 Ravi Pratap <ravi@ximian.com>
15817 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
15818 make static and put into Expression.
15820 (Event.Define): Register the private field of the event with the
15821 TypeManager so that GetFieldFromEvent can get at it.
15823 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
15824 keep track of the private field associated with an event which
15827 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
15830 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
15832 2002-07-10 Miguel de Icaza <miguel@ximian.com>
15834 * expression.cs (Binary.EmitBranchable): this routine emits the
15835 Binary expression in a branchable context. This basically means:
15836 we need to branch somewhere, not just get the value on the stack.
15838 This works together with Statement.EmitBoolExpression.
15840 * statement.cs (Statement.EmitBoolExpression): Use
15843 2002-07-09 Miguel de Icaza <miguel@ximian.com>
15845 * statement.cs (For): Reduce the number of jumps in loops.
15847 (For): Implement loop inversion for the For statement.
15849 (Break): We can be breaking out of a Try/Catch controlled section
15850 (foreach might have an implicit try/catch clause), so we need to
15851 use Leave instead of Br.
15853 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
15854 now). If the instace expression supports IMemoryLocation, we use
15855 the AddressOf method from the IMemoryLocation to extract the
15856 address instead of emitting the instance.
15858 This showed up with `This', as we were emitting the instance
15859 always (Emit) instead of the Address of This. Particularly
15860 interesting when This is a value type, as we dont want the Emit
15861 effect (which was to load the object).
15863 2002-07-08 Miguel de Icaza <miguel@ximian.com>
15865 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
15867 * statement.cs (Checked): Set the CheckedState during the resolve
15868 process too, as the ConvCast operations track the checked state on
15869 the resolve process, and not emit.
15871 * cs-parser.jay (namespace_member_declaration): Flag that we have
15872 found a declaration when we do. This is used to flag error 1529
15874 * driver.cs: Report ok when we display the help only.
15876 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
15878 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
15880 2002-07-04 Miguel de Icaza <miguel@ximian.com>
15882 * cs-tokenizer.cs (define): We also have to track locally the
15883 defines. AllDefines is just used for the Conditional Attribute,
15884 but we also need the local defines for the current source code.
15886 2002-07-03 Miguel de Icaza <miguel@ximian.com>
15888 * statement.cs (While, For, Do): These loops can exit through a
15889 Break statement, use this information to tell whether the
15890 statement is the last piece of code.
15892 (Break): Flag that we break.
15894 * codegen.cs (EmitContexts): New `Breaks' state variable.
15896 2002-07-03 Martin Baulig <martin@gnome.org>
15898 * class.cs (TypeContainer.MethodModifiersValid): Allow override
15899 modifiers in method declarations in structs. Otherwise, you won't
15900 be able to override things like Object.Equals().
15902 2002-07-02 Miguel de Icaza <miguel@ximian.com>
15904 * class.cs (Method, Property, Indexer): Do not allow the public
15905 modifier to be used in explicit interface implementations.
15907 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
15908 override modifiers in method declarations in structs
15910 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
15912 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
15913 integer or real overflow, report an error
15915 2002-07-02 Martin Baulig <martin@gnome.org>
15917 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
15918 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
15919 to tell the runtime about our newly created System.Object and
15920 System.ValueType types.
15922 2002-07-02 Miguel de Icaza <miguel@ximian.com>
15924 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
15925 struct instead of Ldarg/Starg.
15927 2002-07-02 Martin Baulig <martin@gnome.org>
15929 * expression.cs (Indirection.Indirection): Call
15930 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
15932 2002-07-02 Martin Baulig <martin@gnome.org>
15934 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
15935 ValueType, call TypeManager.TypeToCoreType() on it.
15936 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
15937 the OpCodes.Newarr argument.
15939 2002-07-02 Martin Baulig <martin@gnome.org>
15941 * expression.cs (Invocation.EmitCall): When compiling corlib,
15942 replace all calls to the system's System.Array type to calls to
15943 the newly created one.
15945 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
15946 System.Array methods.
15947 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
15948 from the system's System.Array type which must be replaced.
15950 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
15952 * typemanager.cs: load unverifiable_code_ctor so we can build
15953 corlib using the correct type. Avoid using GetTypeCode() with
15955 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
15956 TypeManager.object_type to allow building corlib.
15958 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
15960 * ecore.cs: handle System.Enum separately in LoadFromPtr().
15962 2002-07-01 Martin Baulig <martin@gnome.org>
15964 * class.cs: Make the last change actually work, we need to check
15965 whether `ifaces != null' to avoid a crash.
15967 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15969 * class.cs: when we build structs without fields that implement
15970 interfaces, we need to add the interfaces separately, since there is
15971 no API to both set the size and add the interfaces at type creation
15974 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
15976 * expression.cs: the dimension arguments to the array constructors
15977 need to be converted if they are a long.
15979 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
15981 * class.cs: don't emit ldarg.0 if there is no parent constructor
15982 (fixes showstopper for corlib).
15984 2002-06-29 Martin Baulig <martin@gnome.org>
15986 MCS now compiles corlib on GNU/Linux :-)
15988 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
15989 ie. check for MethodImplOptions.InternalCall.
15991 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
15992 and TypeManager.attribute_type are null, so we must explicitly check
15993 whether parent is not null to find out whether it's an attribute type.
15994 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
15995 and SetBuilder, not only if the property is neither abstract nor external.
15996 This is necessary to set the MethodImplOptions on the accessor methods.
15997 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
15998 SetBuilder, see Property.Emit().
16000 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
16001 populate "System.Object", "System.ValueType" and "System.Attribute" since
16002 they've already been populated from BootCorlib_PopulateCoreTypes().
16004 2002-06-29 Martin Baulig <martin@gnome.org>
16006 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
16007 is the NullLiteral, we also need to make sure that target_type is not
16010 2002-06-29 Martin Baulig <martin@gnome.org>
16012 * rootcontext.cs (RootContext.ResolveCore): We must initialize
16013 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
16014 before calling BootstrapCorlib_ResolveDelegate ().
16016 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16018 * statement.cs: fixed build-breaker. All tests passed ok.
16020 2002-06-27 Martin Baulig <martin@gnome.org>
16022 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
16023 for System.Decimal when compiling corlib.
16025 2002-06-27 Martin Baulig <martin@gnome.org>
16027 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
16028 switch blocks which contain nothing but a default clause.
16030 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
16032 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
16034 2002-06-27 Martin Baulig <martin@gnome.org>
16036 * ecore.cs (PropertyExpr.PropertyExpr): Call
16037 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
16039 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
16040 is already a TypeBuilder.
16042 2002-06-27 Martin Baulig <martin@gnome.org>
16044 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
16045 `target_type == TypeManager.array_type', not IsAssignableFrom() in
16046 the "from an array-type to System.Array" case. This makes it work
16047 when compiling corlib.
16049 2002-06-27 Martin Baulig <martin@gnome.org>
16051 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
16052 non-static PropertyExpr, set its InstanceExpression. This makes
16053 the `ICollection.Count' property work in System/Array.cs.
16055 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
16057 * driver.cs: Made error handling more consistent. Errors now
16058 tracked by Report class, so many methods which used to return int
16059 now return void. Main() now prints success/failure and
16060 errors/warnings message.
16062 Renamed '--probe' compiler argument to '--expect-error'. Removed
16063 the magic number return values (123 and 124). Now, if the
16064 expected error occurs, the compiler exits with success (exit value
16065 0). If the compilation completes without seeing that particular
16066 error, the compiler exits with failure (exit value 1). The
16067 makefile in mcs/errors has been changed to handle the new behaviour.
16069 * report.cs: Made 'expected error' number a property and renamed
16070 it from 'Probe' to 'ExpectedError'.
16072 * genericparser.cs: Removed error handling support, since it is
16073 now all done by Report class.
16075 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
16076 class, so parse() no longer returns an int.
16078 * namespace.cs: Use Report.Error instead of GenericParser.error
16080 2002-06-22 Miguel de Icaza <miguel@ximian.com>
16082 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
16083 TypeContainer.AddOperator): At the front of the list put the
16084 explicit implementations, so they get resolved/defined first.
16086 2002-06-21 Miguel de Icaza <miguel@ximian.com>
16088 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
16089 interface type is implemented by this TypeContainer. Used during
16090 explicit interface implementation.
16092 (Property.Define, Indexer.Define, Method.Define): Validate that
16093 the given interface in the explicit implementation is one of the
16094 base classes for the containing type.
16096 Also if we are explicitly implementing an interface, but there is
16097 no match in the pending implementation table, report an error.
16099 (Property.Define): Only define the property if we are
16100 not explicitly implementing a property from an interface. Use the
16101 correct name also for those properties (the same CSC uses,
16102 although that is really not needed).
16104 (Property.Emit): Do not emit attributes for explicitly implemented
16105 properties, as there is no TypeBuilder.
16107 (Indexer.Emit): ditto.
16109 Hiding then means that we do not really *implement* a pending
16110 implementation, which makes code fail.
16112 2002-06-22 Martin Baulig <martin@gnome.org>
16114 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
16115 the return value of Object.GetType(). [FIXME: we need to do this whenever
16116 we get a type back from the reflection library].
16118 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
16120 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
16122 2002-06-20 Miguel de Icaza <miguel@ximian.com>
16124 * attribute.cs: Return null if we can not look up the type.
16126 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
16127 the interface types found.
16129 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
16130 interface types found.
16132 * typemanager.cs (GetInterfaces): Make this routine returns alll
16133 the interfaces and work around the lame differences between
16134 System.Type and System.Reflection.Emit.TypeBuilder in the results
16135 result for GetInterfaces.
16137 (ExpandInterfaces): Given an array of interface types, expand and
16138 eliminate repeated ocurrences of an interface. This expands in
16139 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
16142 2002-06-21 Martin Baulig <martin@gnome.org>
16144 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
16147 2002-06-21 Martin Baulig <martin@gnome.org>
16149 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
16150 and called with one of the core types, return the corresponding typebuilder for
16153 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
16156 2002-06-21 Martin Baulig <martin@gnome.org>
16158 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
16159 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
16160 (Expression.ConvertReferenceExplicit): Likewise.
16162 * expression.cs (ElementAccess.DoResolve): Likewise.
16163 (ElementAccess.DoResolveLValue): Likewise.
16165 2002-06-10 Martin Baulig <martin@gnome.org>
16167 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
16168 add the "value" parameter to the parameter list.
16170 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
16173 2002-06-19 Miguel de Icaza <miguel@ximian.com>
16175 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
16176 the argument to an int, uint, long or ulong, per the spec. Also
16177 catch negative constants in array creation.
16179 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
16181 * class.cs: do not allow the same interface to appear twice in
16182 the definition list.
16184 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
16186 * ecore.cs: don't use ldlen with System.Array.
16188 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
16190 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
16192 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
16194 * modifiers.cs: produce correct field attributes for protected
16195 internal. Easy fix so miguel can work on ther harder stuff:-)
16197 2002-06-18 Miguel de Icaza <miguel@ximian.com>
16199 * pending.cs: New file. Move the code from class.cs here.
16200 Support clearning the pending flag for all methods (when not doing
16201 explicit interface implementation).
16203 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
16205 * rootcontext.cs: added a couple more types needed to bootstrap.
16207 2002-06-17 Miguel de Icaza <miguel@ximian.com>
16209 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
16210 constructor in the type, instead of any constructor in the type
16211 hierarchy. Thanks to Paolo for finding this bug (it showed up as
16212 a bug in the Mono runtime when applying the params attribute).
16214 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16215 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
16217 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
16219 * expression.cs (Unary.ResolveOperator): Use TypeManager
16220 to resolve the type.
16222 2002-06-13 Ravi Pratap <ravi@ximian.com>
16224 * cs-parser.jay (enum_member_declaration): Pass in the attributes
16227 * enum.cs (AddEnumMember): Add support to store the attributes associated
16228 with each member too.
16230 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
16231 field builders too - this takes care of the enum member case.
16233 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
16235 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
16236 address-of operator on both value types and pointers.
16238 2002-06-10 Martin Baulig <martin@gnome.org>
16240 * interface.cs (Interface.PopulateIndexer): Add the indexer's
16241 PropertyBuilder to the `property_builders' list.
16243 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
16244 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
16245 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
16246 find any indexers which are inherited from an interface.
16248 2002-06-09 Martin Baulig <martin@gnome.org>
16250 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
16251 the same type as the constant if necessary. There's also a test-130.cs
16254 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
16256 * typemanager.cs (TypeManager.ChangeType): Previously known as
16257 Enum.ChangeEnumType().
16259 2002-06-09 Martin Baulig <martin@gnome.org>
16261 * expression.cs (Cast.TryReduce): Added support for consts.
16263 2002-06-08 Ravi Pratap <ravi@ximian.com>
16265 * class.cs (Accessor): Hold attributes information so we can pass
16268 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
16269 Modify to pass in attributes attached to the methods.
16271 (add_accessor_declaration, remove_accessor_declaration): Ditto.
16273 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
16274 to handle the Accessor kind :-)
16276 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
16278 2002-06-08 Martin Baulig <martin@gnome.org>
16280 * expression.cs (Unary.TryReduceNegative): Added support for
16283 2002-06-08 Martin Baulig <martin@gnome.org>
16285 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
16286 name can't be found in the `defined_names' - the caller will do a
16287 MemberLookup in this case and thus find methods in System.Enum
16288 such as Enum.IsDefined().
16290 2002-06-08 Martin Baulig <martin@gnome.org>
16292 * enum.cs (Enum.ChangeEnumType): This is a custom version of
16293 Convert.ChangeType() which works with TypeBuilder created types.
16294 (Enum.LookupEnumValue, Enum.Define): Use it here.
16296 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
16297 `TypeBuilder.BaseType != null' check.
16298 (TypeContainer.FindMembers): Only lookup parent members if we
16299 actually have a parent.
16300 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
16301 (ConstructorInitializer.Resolve): Likewise.
16303 * interface.cs (Interface.FindMembers): Added
16304 `TypeBuilder.BaseType != null' check.
16306 * rootcontext.cs (RootContext.ResolveCore): Added
16307 "System.Runtime.CompilerServices.IndexerNameAttribute" to
16308 classes_second_stage.
16310 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
16311 debug_type and trace_type when compiling with --nostdlib.
16313 2002-06-07 Martin Baulig <martin@gnome.org>
16315 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
16316 (AddField): Set it to true when adding a non-static field.
16317 (DefineType): Use `have_nonstatic_fields' to find out whether we
16318 have non-static fields, not `Fields != null'.
16320 2002-06-02 Miguel de Icaza <miguel@ximian.com>
16322 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
16323 dereferencing a null on the static-field code path)
16325 2002-05-30 Martin Baulig <martin@gnome.org>
16327 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
16328 to take command line arguments. Use reflection to call the new
16329 custom `Initialize' function on the symbol writer and pass it the
16330 command line arguments.
16332 * driver.cs (--debug-args): New command line argument to pass command
16333 line arguments to the symbol writer.
16335 2002-05-28 Miguel de Icaza <miguel@ximian.com>
16337 * assign.cs (DoResolve): Forgot to do the implicit conversion to
16338 the target type for indexers and properties. Thanks to Joe for
16341 2002-05-27 Miguel de Icaza <miguel@ximian.com>
16343 * typemanager.cs (MethodFlags): returns the method flags
16344 (Obsolete/ShouldIgnore) that control warning emission and whether
16345 the invocation should be made, or ignored.
16347 * expression.cs (Invocation.Emit): Remove previous hack, we should
16348 not do this on matching a base type, we should do this based on an attribute
16350 Only emit calls to System.Diagnostics.Debug and
16351 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
16352 on the command line.
16354 * rootcontext.cs: Global settings for tracing and debugging.
16356 * cs-tokenizer.cs (define): New utility function to track
16357 defines. Set the global settings for TRACE and DEBUG if found.
16359 2002-05-25 Ravi Pratap <ravi@ximian.com>
16361 * interface.cs (Populate*): Pass in the TypeContainer as well as
16362 the DeclSpace as parameters so that we can create EmitContexts and
16363 then use that to apply attributes etc.
16365 (PopulateMethod, PopulateEvent, PopulateProperty)
16366 (PopulateIndexer): Apply attributes everywhere.
16368 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
16371 (ApplyAttributes): Update accordingly.
16373 We now apply interface attributes for all members too.
16375 2002-05-26 Miguel de Icaza <miguel@ximian.com>
16377 * class.cs (Indexer.Define); Correctly check if we are explicit
16378 implementation (instead of checking the Name for a ".", we
16379 directly look up if the InterfaceType was specified).
16381 Delay the creation of the PropertyBuilder.
16383 Only create the PropertyBuilder if we are not an explicit
16384 interface implementation. This means that explicit interface
16385 implementation members do not participate in regular function
16386 lookups, and hence fixes another major ambiguity problem in
16387 overload resolution (that was the visible effect).
16389 (DefineMethod): Return whether we are doing an interface
16392 * typemanager.cs: Temporary hack until we get attributes in
16393 interfaces (Ravi is working on that) and we get IndexerName
16394 support in interfaces.
16396 * interface.cs: Register the indexers as properties.
16398 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
16399 warning, I have verified that this is a bug in the .NET runtime
16400 (JavaScript suffers of the same problem).
16402 * typemanager.cs (MemberLookup): When looking up members for
16403 interfaces, the parent of an interface is the implicit
16404 System.Object (so we succeed in searches of Object methods in an
16405 interface method invocation. Example: IEnumerable x; x.ToString
16408 2002-05-25 Miguel de Icaza <miguel@ximian.com>
16410 * class.cs (Event): Events should also register if they do
16411 implement the methods that an interface requires.
16413 * typemanager.cs (MemberLookup); use the new GetInterfaces
16416 (GetInterfaces): The code used to lookup interfaces for a type is
16417 used in more than one place, factor it here.
16419 * driver.cs: Track the errors at the bottom of the file, we kept
16422 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
16423 instance if the method we are calling is static!
16425 2002-05-24 Miguel de Icaza <miguel@ximian.com>
16427 * attribute.cs (ApplyAttributes): Make this function filter out
16428 the IndexerName attribute (as that attribute in reality is never
16429 applied) and return the string constant for the IndexerName
16432 * class.cs (TypeContainer.Emit): Validate that all the indexers
16433 have the same IndexerName attribute, and if so, set the
16434 DefaultName attribute on the class.
16436 * typemanager.cs: The return value might contain other stuff (not
16437 only methods). For instance, consider a method with an "Item"
16438 property and an Item method.
16440 * class.cs: If there is a problem with the parameter types,
16443 2002-05-24 Ravi Pratap <ravi@ximian.com>
16445 * ecore.cs (ImplicitConversionExists): Wrapper function which also
16446 looks at user defined conversion after making a call to
16447 StandardConversionExists - we need this for overload resolution.
16449 * expression.cs : Update accordingly the various method calls.
16451 This fixes 2 bugs filed against implicit user defined conversions
16453 2002-05-22 Miguel de Icaza <miguel@ximian.com>
16455 * statement.cs: Track the result of the assignment.
16457 2002-05-21 Miguel de Icaza <miguel@ximian.com>
16459 * expression.cs (MemberAccess): Improved error reporting for
16460 inaccessible members.
16462 2002-05-22 Martin Baulig <martin@gnome.org>
16464 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
16465 itself with debugging support.
16467 2002-05-22 Martin Baulig <martin@gnome.org>
16469 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
16470 Removed, this isn't needed anymore.
16472 2002-05-20 Martin Baulig <martin@gnome.org>
16474 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
16475 be underlying type for an enum.
16477 2002-05-20 Miguel de Icaza <miguel@ximian.com>
16479 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
16480 that splits out the loading of just the core types.
16482 * rootcontext.cs (ResolveCore): Split the struct resolution in
16483 two, so we can load the enumeration underlying types before any
16486 * expression.cs (Is): Bandaid until we fix properly Switch (see
16487 bug #24985 for details).
16489 * typemanager.cs (ImplementsInterface): The hashtable will contain
16490 a null if there are no interfaces implemented.
16492 2002-05-18 Miguel de Icaza <miguel@ximian.com>
16494 * cs-parser.jay (indexer_declarator): It is fine to have array
16497 2002-05-17 Miguel de Icaza <miguel@ximian.com>
16499 * typemanager.cs: (RegisterBuilder): New function used to register
16500 TypeBuilders that implement interfaces. Since
16501 TypeBuilder.GetInterfaces (as usual) does not work with lame
16503 (AddUserType): register interfaces.
16505 (ImplementsInterface): Use the builder_to_ifaces hash if we are
16506 dealing with TypeBuilder. Also, arrays are showing up as
16507 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
16508 methods can not be invoked on them!
16510 * ecore.cs (ExplicitReferenceConversionExists): Made public.
16511 (ImplicitReferenceConversionExists): Split out from
16512 StandardConversionExists.
16514 * expression.cs (As): We were only implementing one of the three
16515 cases for the as operator. We now implement them all.
16516 (Is): Implement the various other cases for Is as well.
16518 * typemanager.cs (CACHE): New define used to control if we want or
16519 not the FindMembers cache. Seems to have a negative impact on
16520 performance currently
16522 (MemberLookup): Nested types have full acess to
16523 enclosing type members
16525 Remove code that coped with instance/static returns for events, we
16526 now catch this in RealFindMembers.
16528 (RealFindMembers): only perform static lookup if the instance
16529 lookup did not return a type or an event.
16531 2002-05-17 Miguel de Icaza <miguel@ximian.com>
16533 * assign.cs (CompoundAssign): We pass more semantic information
16534 now to Compound Assignments than we did before: now we have all
16535 the information at hand, and now we resolve the target *before* we
16536 do the expression expansion, which allows the "CacheValue" method
16537 to have the effect we intended (before, a [x] += 1 would generate
16538 two differen ArrayAccess expressions from the ElementAccess,
16539 during the resolution process).
16541 (CompoundAssign.DoResolve): Resolve target and original_source here.
16543 2002-05-16 Miguel de Icaza <miguel@ximian.com>
16545 * expression.cs (ArrayAccess): dropped debugging information.
16547 * typemanager.cs: Small bug fix: I was always returning i_members,
16548 instead of one of i_members or s_members (depending on which had
16551 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
16552 method is invoked before any code generation takes place, and it
16553 is a mechanism to inform that the expression will be invoked more
16554 than once, and that the method should use temporary values to
16555 avoid having side effects
16557 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
16559 * ecore.cs (Expression.CacheTemporaries): Provide empty default
16562 * expression.cs (Indirection, ArrayAccess): Add support for
16563 CacheTemporaries in these two bad boys.
16565 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
16566 ldobj or ldind_ref.
16567 (StoreFromPtr): Handle stobj as well.
16569 * expression.cs (UnaryMutator): Share more code.
16571 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
16572 down: I was not tracking the Filter function as well, which
16573 was affecting the results of the cache.
16575 2002-05-15 Miguel de Icaza <miguel@ximian.com>
16577 * attribute.cs: Remove the hack to handle the CharSet property on
16580 2002-05-14 Miguel de Icaza <miguel@ximian.com>
16582 * attribute.cs (DoResolve): More uglyness, we now only try to
16583 resolve the attribute partially, to extract the CharSet
16584 information (only if we are a StructLayout attribute). Otherwise
16586 (GetExtraTypeInfo): Add some code to conditionally kill in the
16587 future this. I am more and more convinced that the .NET
16588 framework has special code to handle the attribute setting on
16591 * expression.cs (IsParamsMethodApplicable): Revert my previous
16592 foreach change here, it was wrong.
16594 2002-05-13 Miguel de Icaza <miguel@ximian.com>
16596 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
16597 (pp_expr): do not abort on unknown input, just return.
16598 (eval): abort if there are pending chars.
16600 * attribute.cs (Attribute.Resolve): Positional parameters are
16601 optional. Deal with that case.
16603 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
16604 the Ansi/Unicode/Auto information for the type.
16606 (TypeContainer.DefineType): instantiate the EmitContext here, as
16607 we will be using it during the type definition (to resolve
16608 attributes) and during the emit phase.
16610 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
16611 to pull type information out of the attributes
16613 (Attribute.Resolve): track the constructor builder, and allow for
16614 multiple invocations (structs and classes will use this).
16616 * ecore.cs (MemberLookupFinal): new version with all the
16617 parameters customizable.
16619 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
16620 constructors. Return if the result value is null (as the error
16621 would have been flagged already by MemberLookupFinal)
16623 Do not allow instances of abstract classes or interfaces to be
16626 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
16627 We have to compare the assembly property here when dealing with
16628 FamANDAssem and Assembly access modifiers, because we might be
16629 creating an assembly from *modules* (that means that we are not
16630 getting TypeBuilders for types defined in other modules that are
16631 part of this assembly).
16633 (Method.Emit): If the method is marked abstract and has a body,
16636 (TypeContainer.DefineMembers): If both the defined member and the
16637 parent name match are methods, then do not emit any warnings: let
16638 the Method.Define routine take care of flagging warnings. But if
16639 there is a mismatch (method overrides something else, or method is
16640 overriwritten by something, then emit warning).
16642 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
16643 set to null, this means `do not check for the return type on the
16646 (Method.Define): set the return type for the method signature to
16647 null, so that we get methods with the same name and parameters and
16648 different return types. This is used to flag warning 114 (you are
16649 hiding a method, and you probably want to use the new/override
16652 * typemanager.cs (MemberLookup): Implemented proper access
16653 control, closing a long standing set of bug reports. The problem
16654 was that the Framework only has two bits: Public and NonPublic,
16655 and NonPublic includes private and protected methods, but we need
16656 to enforce the FamANDAssem, FamOrAssem and Family.
16658 2002-05-11 Miguel de Icaza <miguel@ximian.com>
16660 * statement.cs (GotoCase): Return true: Ammounts to giving up
16661 knowledge on whether we return or not, and letting the other case
16662 be responsible for it.
16664 2002-05-10 Miguel de Icaza <miguel@ximian.com>
16666 * driver.cs: Do not load directories for each file processed, only
16667 do it if there is a pattern.
16669 * ecore.cs: Report readonly assigns here as well, as we might have
16670 been resolved only by MemberAccess.
16672 (SimpleName.SimpleNameResolve): Also be useful for LValue
16673 resolution. We need this to propagate assign to local readonly variables
16675 * typemanager.cs: Use a ptrhashtable for the criteria, because we
16676 do not want to reuse potential criteria memory.
16678 * class.cs (MyEventBuilder): Set reflected_type;
16680 * ecore.cs (Constantify): Added support for constifying bools.
16682 (RootContext.LookupType): Added a cache for values looked up in
16683 the declaration space.
16685 * typemanager.cs (FindMembers): Now is a front-end to
16686 RealFindMembers, and provides a two-level hashtable-based cache to
16689 15% performance improvement: from 22.5 to 19.2 seconds.
16691 * expression.cs (IsParamsMethodApplicable): use foreach.
16692 (Invocation.DoResolve): ditto.
16693 (New.DoResolve): ditto.
16694 (ArrayCreation.DoResolve): ditto.
16696 * ecore.cs (FindMostEncompassingType): use foreach.
16698 * delegate.cs (NewDelegate.DoResolve): Use foreach
16700 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
16701 (RemoveMethods): use foreach.
16703 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
16704 nested foreach statements instead of for, and also break out of
16705 the inner loop once a match is found.
16707 (Invocation.OverloadResolve): Use foreach, simplify the code.
16709 2002-05-08 Miguel de Icaza <miguel@ximian.com>
16711 * cfold.cs (BinaryFold): During an enumeration evaluation context,
16712 we actually unwrap the expression to allow for extra information
16715 * expression.cs: Use Shr_Un on unsigned operations.
16717 2002-05-08 Ravi Pratap <ravi@ximian.com>
16719 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
16720 applicable operators was not being considered correctly. This closes
16721 the bug Miguel reported.
16723 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
16725 * attribute.cs: check that the type derives from System.Attribute
16726 and report the correct error in that case (moved the duplicate code to
16727 its own method, too).
16729 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
16731 * attribute.cs: lookup attribute type name as the spec says: first the
16732 bare attribute name and then name + "Attribute" (nant compiles with
16733 mcs after this fix).
16735 2002-05-07 Miguel de Icaza <miguel@ximian.com>
16737 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
16738 Because of the way we parse things, we should try to see if a
16739 UIntConstant can fit in an integer.
16741 2002-05-07 Ravi Pratap <ravi@ximian.com>
16743 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
16744 when we are in an explicit context.
16746 (ConvertReferenceExplicit): When converting from Iface type S to Class
16747 T make sure the rules are implemented as an OR.
16749 * parameter.cs (ParameterType): Make it a property for now although the
16750 purpose really isn't anything immediate.
16752 * expression.cs (Is*Applicable): Do better checking on the parameter type
16753 of a ref/out parameter. The ones from the system assemblies are already
16754 marked with the correct type so we don't need to do any correction.
16756 * ecore.cs (StandardConversionExists): Conversion from Interface types to
16757 the object type is standard too so include that.
16759 2002-05-06 Miguel de Icaza <miguel@ximian.com>
16761 * ecore.cs (StandardConversionExists): Augment with missing code:
16762 deal with IntConstant, LongConstants and Enumerations.
16764 * assign.cs: Report the error, instead of failing silently
16766 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
16767 typecontainer that they are declared, because the
16768 typecontainer/namespace will have the list of using clauses that
16769 need to be applied.
16771 Assembly Attributes were escaping the normal registration
16774 (EmitCode): Apply attributes within an EmitContext that represents
16775 the container they were declared on.
16777 * cs-parser.jay: Track bases for structs. How did I get this wrong?
16779 2002-05-06 Ravi Pratap <ravi@ximian.com>
16781 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
16782 Revamp completely - make much cleaner as we now operate only
16785 (FindMostSpecificSource, FindMostSpecificTarget): New methods
16786 to implement the logic detailed in the spec more correctly.
16788 (UserDefinedConversion): Update accordingly.
16790 2002-05-06 Miguel de Icaza <miguel@ximian.com>
16792 * statement.cs: Return flow analysis information up.
16794 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
16797 (token): Do not consume an extra character before calling
16800 2002-05-06 Piers Haken <piersh@friskit.com>
16802 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
16804 2002-05-06 Miguel de Icaza <miguel@ximian.com>
16806 * class.cs (Constructor.Emit): Set the IsStatic flag in the
16807 EmitContext during the instance constructor initializer
16808 resolution, to stop access to instance variables.
16810 This is mandated by the spec, last paragraph of the `constructor
16811 initializers' section.
16813 2002-05-05 Miguel de Icaza <miguel@ximian.com>
16815 * cs-parser.jay, class.cs (Accessor): new class used to represent
16816 an accessor (get or set). In the past we used `null' to represent
16817 a missing accessor. But this is ambiguous because there was no
16818 way to tell in abstract indexers/properties if one of them was
16821 Now there is a way of addressing that.
16823 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
16824 instead of FindMembers.
16826 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
16827 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
16829 * attribute.cs: Treat indexers and properties as the same in terms
16830 of applying attributes
16832 * ecore.cs (FindMostEncompassedType): Use statically initialized
16833 EmptyExpressions()s like we do elsewhere to avoid creating useless
16834 objects (and we take this out of the tight loop).
16836 (GetConversionOperators): Move the code to extract the actual
16837 operators to a separate routine to clean things up.
16839 2002-05-04 Miguel de Icaza <miguel@ximian.com>
16841 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
16842 events are always registered FieldBuilders.
16844 * class.cs (FieldBase): New class shared by Fields
16846 * delegate.cs: If we are a toplevel delegate, use our full name.
16847 If we are a nested delegate, then only use our tail name.
16849 2002-05-02 Ravi Pratap <ravi@ximian.com>
16851 * expression.cs (IsApplicable): Ensure that we add the "&" to
16852 ref/out types before comparing it with the type of the argument.
16854 (IsParamsMethodApplicable): Ditto.
16856 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
16859 * delegate.cs : Handle the case when we have more than one applicable
16860 method. Flag an error only when we finish checking all.
16862 2002-05-02 Miguel de Icaza <miguel@ximian.com>
16864 * expression.cs: Add support for boolean static initializers.
16866 2002-05-01 Miguel de Icaza <miguel@ximian.com>
16868 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
16870 * parameter.cs (ComputeParameterTypes,
16871 ComputeAndDefineParameterTypes): Better error handling: now we
16872 clear the `types' cache if we fail during any of the type lookups.
16873 We also return the status code correctly to our caller
16875 * delegate.cs: If we fail to define a delegate, abort the extra
16878 * expression.cs (Binary.ResolveOperator): for
16879 operator==(object,object) and operator !=(object, object) we also
16880 have to verify that there is an implicit conversion from one to
16883 (ArrayAccess.DoResolve): Array Access can operate on
16886 2002-04-30 Miguel de Icaza <miguel@ximian.com>
16888 * assign.cs (CompoundAssign): A new class used as a "flag" that
16889 the assignment actually is happening as part of a compound
16890 assignment operator.
16892 During compound assignment, a few new rules exist to enable things
16899 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
16900 to the type of x) if y is implicitly convertible to the type of x,
16901 and the operator is a builtin operator and the return type of the
16902 operator is explicitly convertible to the type of x.
16904 * rootcontext.cs: Reset warning level to 2. 4 catches various
16905 "interesting" features in mcs, we must clean this up at some
16906 point, but currently am trying to kill other bugs ;-)
16908 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
16909 in container classes as well.
16911 * expression.cs (Binary.ResolveOperator): Handle string case
16912 before anything else (as operator overloading does emit an error
16913 before doing anything else).
16915 This code could go away when we move to a table driven model, but
16916 i could not come up with a good plan last night.
16918 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
16920 * typemanager.cs (CSharpName): reimplementation using regex.
16921 * class.cs: added null check for fields in Emit
16922 * rootcontext.cs: set warninglevel to 4
16924 2002-04-29 Miguel de Icaza <miguel@ximian.com>
16926 * typemanager.cs (CSharpName): reimplemented with Lupus
16929 2002-04-28 Miguel de Icaza <miguel@ximian.com>
16931 * statement.cs (If): correclty implement Resolve, because we were
16932 not catching sem errors in there. The same process is needed
16934 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
16937 (Statement.Warning_DeadCodeFound): Factorize code.
16938 (While): Report dead code here too.
16940 (Statement): Added Resolve virtual method to allow
16941 for resolution split from the emit code.
16943 2002-04-26 Miguel de Icaza <miguel@ximian.com>
16945 * statement.cs (EmitBoolExpression): No longer try to resolve the
16947 (MakeBoolean): New utility function that resolve, implicitly
16948 converts to boolean and tags the expression.
16951 (If, Do): Implement dead code elimination.
16952 (While): Implement loop inversion
16954 (Do, While, For, If): Resolve the expression prior to calling our
16957 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
16960 - added method Report28 (warning: program has more than one entry point)
16961 - added method IsEntryPoint, implements paragraph 10.1 of the spec
16962 - modified method Method.Define, the part at the end of the method
16964 * rootcontext.cs: added static public Location EntryPointLocation;
16966 * ../errors/cs0028.cs : Add test case for the above warning.
16969 - modified method CSharpName to allow arrays of primitive type to
16970 be printed nicely (e.g. instead of System.Int32[][] it now prints
16972 - added method CSharpSignature: returns the signature of a method
16973 in string format to be used in reporting errors, warnings, etc.
16975 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
16978 2002-04-26 Ravi Pratap <ravi@ximian.com>
16980 * delegate.cs (Define): Fix extremely silly bug where I was
16981 setting the type of the 'object' parameter of the BeginInvoke
16982 method to System.IAsyncResult instead of System.Object ;-)
16984 2002-04-26 Miguel de Icaza <miguel@ximian.com>
16986 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
16989 (Constructor.Emit): return if we fail to initialize the
16990 constructor. Another door closed!
16992 * expression.cs (New.DoResolve): Improve error message (from -6 to
16993 1501). Use DeclaredOnly lookup to find the exact constructor.
16995 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
16996 loop. This is useful.
16998 * cs-parser.jay: Adjust the default parameters so that destructors
16999 have the proper signature.
17001 2002-04-26 Martin Baulig <martin@gnome.org>
17003 * driver.cs (LoadAssembly): If `assembly' contains any characters
17004 which are only valid in path names and not in assembly names
17005 (currently slash, backslash and point), use Assembly.LoadFrom ()
17006 instead of Assembly.Load () on the `assembly' (before iteration
17007 over the link_paths).
17009 2002-04-26 Martin Baulig <martin@gnome.org>
17011 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
17013 2002-04-25 Miguel de Icaza <miguel@ximian.com>
17015 * class.cs (Property): use the new typemanager.MemberLookup
17017 (TypeContainer.MemberLookup): Implement using the
17018 TypeManager.MemberLookup now.
17020 * typemanager.cs: Make MemberLookup a function of the TypeManager,
17021 and return MemberInfos, so that these can be used without an
17022 EmitContext (what we had before).
17024 2002-04-24 Miguel de Icaza <miguel@ximian.com>
17026 * expression.cs: Fix the case where the argument to params if the
17027 type of the params. I omitted handling this before. Fixed
17029 2002-04-22 Miguel de Icaza <miguel@ximian.com>
17031 * driver.cs: Call BootCorlib_PopulateCoreType
17033 * class.cs (Property.CheckBase): Check for properties only, not
17036 * interface.cs: Temporary hack: try/catch around the
17037 CustomAttributeBuilder, because I am getting an exception that I
17040 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
17041 types whose definitions are required to be there (attributes are
17042 defined before standard types).
17044 Compute definitions as we boot the various types, as they are used
17045 immediately (value_type class will need object_type, but if we do
17046 not initialize object_type, we will pass a null, which will let
17047 the runtime pick the System.Object from the existing corlib, which
17048 is not what we want).
17050 2002-04-22 Patrik Torstensson <totte@labs2.com>
17052 * cs-tokenizer.cs: fixed a number of trim() issues.
17054 2002-04-22 Ravi Pratap <ravi@ximian.com>
17056 * expression.cs (Argument.Type): Ensure that we return the correct
17057 type when we have out or ref parameters [in which case we
17060 2002-04-22 Miguel de Icaza <miguel@ximian.com>
17062 * class.cs (Property, Indexer): Allow extern modifier in there.
17064 * typemanager.cs (InitBaseTypes): Initializes object_type and
17065 value_type, since those will be used early on during the bootstrap
17066 process to compile corlib.
17068 (InitCoreTypes): Move code from here to InitBaseTypes.
17070 2002-04-21 Miguel de Icaza <miguel@ximian.com>
17072 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
17073 single-dimension arrays as using the ldlen opcode.
17075 Daniel Lewis discovered this optimization.
17077 * typemanager.cs: Add signature for System.Array::get_Length
17079 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17081 * statement.cs: report the error when the foreach does not apply to an
17082 array nor a collection.
17084 2002-04-19 Miguel de Icaza <miguel@ximian.com>
17086 * expression.cs: Add implicit conversions to the operator ~.
17088 * constant.cs (DecimalConstant.Emit): Emit decimal value.
17090 * typemanager.cs: Locate the decimal constructor.
17092 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17094 * attribute.cs: use the new property of TypeOf.
17095 * expression.cs: added 'get' property around typearg.
17097 These changes fix a build breaker reported by NickD. Is this the
17098 correct way to fix? If not, please, revert my changes and make it
17101 2002-04-17 Miguel de Icaza <miguel@ximian.com>
17103 * attribute.cs: Add support for typeof in attribute invocations.
17104 I am not sure that this is right though.
17106 2002-04-14 Duncan Mak <duncan@ximian.com>
17108 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
17109 Binary.Operator.Division case.
17111 2002-04-13 Ravi Pratap <ravi@ximian.com>
17113 * class.cs (DefineType): Ensure that we do a proper check on
17114 attribute types and also register it with the TypeManager.
17116 (TypeContainer.Targets): The default for attribute types is
17117 AttributeTargets.All.
17119 * attribute.cs (ApplyAttributes): Registering the attribute type
17120 is done elsewhere, not when we discover we have a Usage attribute.
17122 2002-04-12 Ravi Pratap <ravi@ximian.com>
17124 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
17125 and get rid of is_delegate parameter.
17127 * everywhere : update.
17129 2002-04-12 Ravi Pratap <ravi@ximian.com>
17131 * cs-parser.jay (compilation_unit): Revamp completely to use
17132 some new ideas that I got from Rhys' grammar to solve the problems
17133 with assembly level attributes.
17135 (outer_declaration): New grammar production.
17137 (attribute_sections): Add.
17139 (opt_attributes): Base on attribute_sections
17141 (namespace_declaration): Allow opt_attributes to tackle the case
17142 when we have assembly level attributes - we are clever in this
17145 * attribute.cs (ApplyAttributes): Do not worry about assembly
17146 attributes in the non-global context.
17148 * rootcontext.cs (AddGlobalAttributes): Go back to using this
17149 instead of SetGlobalAttributes.
17151 * class.cs, rootcontext.cs : Ensure we define and generate
17152 attribute types before anything else.
17154 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
17155 and flag the new error -20 for the case when the attribute type
17156 does not have valid targets specified. csc does not catch this.
17158 * ../errors/errors.txt : update for error # -20
17160 2002-04-11 Ravi Pratap <ravi@ximian.com>
17162 * support.cs (InternalParameters.ParameterModifier): Do some null
17163 checking and return sane values.
17165 * class.cs (Method.Define): If we are a PInvoke method, ensure
17166 that we are static and extern. Report error # 601
17168 * ../errors/cs0601.cs : Add test case for the above error.
17170 2002-04-07 Ravi Pratap <ravi@ximian.com>
17172 * rootcontext.cs (attribute_types): We need to keep type of
17173 all attribute types separately and emit code for them first.
17175 (RegisterAttribute) : Implement.
17177 * class.cs (DefineType): Check if the current Type is a custom
17178 attribute type and register it accordingly.
17180 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
17181 adding the first attribute twice and rename to
17183 (SetGlobalAttributes): this.
17185 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
17188 * attribute.cs (ApplyAttributes): Take an additional argument telling us
17189 if we are processing global arguments. Hmm, I am unsure of this.
17191 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17193 * expression.cs: added static array of strings to avoid calling
17194 Enum.ToString () for Operator in Binary. Significant recover of
17197 2002-04-10 Miguel de Icaza <miguel@ximian.com>
17199 * class.cs (FindMembers): Allow the Builders of the various
17200 members to be null. If they are skip them. This only happens
17201 during the PInvoke declaration.
17203 2002-04-09 Miguel de Icaza <miguel@ximian.com>
17205 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
17206 failure, so we do not keep going afterwards.
17208 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
17209 wanted to pass `false' as the `is_delegate' argument. If this is
17210 the case, why not use delegate_type == null to mean `is_delegate =
17211 false' and anything else as is_delegate = true.
17213 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
17215 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
17216 code for the section, not the beginning of the tests.
17218 2002-04-08 Miguel de Icaza <miguel@ximian.com>
17220 * cfold.cs: Handle operator + (Enum x, Underlying x)
17222 * expression.cs (Binary): same. Warn about errors where we have
17223 Enum/Enum in operator + as well.
17225 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
17228 - added support for switch(bool)
17229 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
17230 - add TableSwitchEmit() to handle table-based switch statements
17232 2002-04-05 Ravi Pratap <ravi@ximian.com>
17234 * expression.cs (Invocation.OverloadResolve): Factor out code which
17235 does parameter compatibility checking with arguments so that we can
17236 re-use the code even from Delegate.VerifyApplicability
17238 (VerifyArgumentsCompat): Move above code here.
17240 * delegate.cs (VerifyApplicability): Get rid of duplicate code
17241 and instead make a call to the above method.
17243 2002-03-31 Ravi Pratap <ravi@ximian.com>
17245 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
17246 We use it to keep track of classes which are attribute types.
17248 2002-04-02 Miguel de Icaza <miguel@ximian.com>
17250 * delegate.cs (Delegate.Define): Correctly define the types in the
17251 presence of fixed and array parameters.
17253 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
17256 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
17257 include NonPublic after the first iteration.
17259 * class.cs (Indexer.CheckBase): Only check if both parents are
17262 * cs-parser.jay (accessor_body): If empty, set to null.
17264 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
17265 same code path here to resolve constants names that we did have in
17266 MemberAccess.DoResolve. There is too much code duplicated here.
17268 2002-04-01 Miguel de Icaza <miguel@ximian.com>
17270 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
17272 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
17275 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
17276 tokens, numbers and strings.
17278 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
17281 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
17282 asyncronous parameters and the regular parameters.
17284 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
17285 specify the target directory.
17287 * expression.cs: (This.DoResolve): Simplify
17288 (As.Emit): Optimize, do not generate IsInst if the expression is
17289 always of the given type.
17291 (Is.DoResolve): Bug fix, we were reporting both always/never for
17294 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
17295 creating too many unnecessary arrays.
17297 2002-03-31 Miguel de Icaza <miguel@ximian.com>
17299 * class.cs (EmitFieldInitializer): Use Assign expression to assign
17300 fields instead of rolling our own initializer. Takes care of all
17301 implicit conversions, and drops unnecessary static checks/argument.
17303 2002-03-31 Dick Porter <dick@ximian.com>
17305 * driver.cs: use the GetDirectories() return values properly, and
17306 use "/" as path separator.
17308 2002-03-30 Miguel de Icaza <miguel@ximian.com>
17310 * expression.cs (Unary): Optimize - - expr into expr.
17311 (Binary): Optimize a + (-b) into a -b.
17313 * codegen.cs (CodeGen): Made all methods static.
17315 2002-03-29 Miguel de Icaza <miguel@ximian.com>
17319 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
17320 TypeBuilder property.
17322 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
17325 * tree.cs: Removed the various RecordXXXX, and replaced with a
17326 single RecordDecl. Removed all the accessor methods, and just
17327 left a single access point Type
17329 * enum.cs: Rename DefineEnum to DefineType.
17331 * decl.cs: New abstract method `DefineType' used to unify the
17332 Defines for Enumerations, Interfaces, TypeContainers and
17335 (FindType): Moved LookupInterfaceOrClass here. Moved the
17336 LookupBaseClasses method that used to live in class.cs and
17337 interface.cs here, and renamed to FindType.
17339 * delegate.cs: Implement DefineType. Take advantage of the
17340 refactored pattern for locating the parent builder without taking
17341 the parent_builder argument (which we know does not work if we are
17342 nested, and triggering a toplevel definition).
17344 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17346 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
17347 accessibility of a member has changed during override and report
17350 * class.cs (Method.Define, Property.Define): Only complain on
17351 overrides if the method is private, any other accessibility is
17352 fine (and since we just checked the permission is the same, we are
17355 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
17356 and elif are processed always. The other pre-processing
17357 directives are only processed if we are "taking" the path
17359 2002-03-29 Martin Baulig <martin@gnome.org>
17361 * class.cs (Method.Emit): Only emit symbolic debugging info if the
17362 current location is not Null.
17364 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
17365 a separate method so we can profile it.
17367 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
17368 `span.Seconds' are just seconds, but no minutes or hours.
17369 (MainDriver): Profile the CodeGen.SaveSymbols calls.
17371 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17373 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
17374 Remove the gratuitous set of Final:
17376 // If an interface implementation, then we can set Final.
17377 if (((flags & MethodAttributes.Abstract) == 0) &&
17378 implementing.DeclaringType.IsInterface)
17379 flags |= MethodAttributes.Final;
17381 I do not know what I was smoking when I used that.
17384 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
17385 step into fixing the name resolution issues for delegates and
17386 unifying the toplevel name resolution.
17388 2002-03-28 Martin Baulig <martin@gnome.org>
17390 * class.cs (Method.Emit): If we have a symbol writer, call its
17391 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
17392 tell it about the current method.
17394 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
17395 writer that we're going to emit the first byte of IL code for a new
17396 statement (a new source line).
17397 (EmitContext.EmitTopBlock): If we have a symbol writer, call
17398 EmitContext.Mark() before emitting any code.
17400 * location.cs (SymbolDocument): Return null when we're Null.
17402 * statement.cs (Statement): Moved the `Location loc' variable here.
17403 (Statement.EmitBoolExpression): If we have a symbol writer, call
17404 ec.Mark() before emitting any code to tell it that we're at the
17405 beginning of a new statement.
17406 (StatementExpression): Added `Location' argument to the constructor.
17407 (Block): Added public readonly variable `StartLocation' and public
17408 variable `EndLocation'. The latter is to be set using SetEndLocation().
17409 (Block): Added constructor which takes a start and end location.
17410 (Block.SetEndLocation): New method. This sets the end location.
17411 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
17412 local variables we create.
17413 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
17414 each statement and do also mark the begin and end of the block.
17416 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
17417 tell it the current lexer.Location, use Location.Null for the end of the
17419 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
17420 current block, set its end location using SetEndLocation().
17421 (statement_expression): StatementExpression constructor now takes the
17422 lexer.Location as additional argument.
17423 (for_statement, declare_local_variables): Likewise.
17424 (declare_local_variables): When creating a new implicit block, use the
17425 new Block constructor and pass it the lexer.Location.
17427 2002-03-28 Miguel de Icaza <miguel@ximian.com>
17429 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
17430 members also on the parent interfaces recursively.
17432 2002-03-27 Miguel de Icaza <miguel@ximian.com>
17434 * report.cs: Use new formats, since Gonzalo finished the missing
17437 * expression.cs (Binary.ResolveOperator): added missing operator|
17438 operator& and operator^ for bool/bool.
17440 * cs-parser.jay: CheckDef now takes a Location argument that is
17441 used to report errors more precisly (instead of reporting the end
17442 of a definition, we try to track something which is a lot closer
17443 to the source of the problem).
17445 * cs-tokenizer.cs: Track global token use, so we can properly flag
17446 the use of #define/#undef after the first token has been seen.
17448 Also, rename the reportXXXX to Error_DescriptiveName
17450 * decl.cs (DeclSpace.IsTopLevel): Move property here from
17451 TypeContainer, so that Enum and Interface can use this too.
17453 * class.cs (TypeContainer.LookupInterfaceOrClass,
17454 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
17455 `builder' argument. Typically this was used to pass the parent
17456 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
17459 The problem is that a nested class could trigger the definition of
17460 a toplevel class, and the builder would be obviously wrong in that
17463 So we drop this argument, and we compute dynamically the
17464 TypeBuilder/ModuleBuilder (the correct information was available
17465 to us anyways from DeclSpace.Parent)
17467 * interface.cs (Interface.DefineInterface): Drop builder
17468 parameter cleanup like class.cs
17470 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
17473 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
17476 (Try.Emit): Propagate the returns value from the statement.
17478 (Return.Emit): Even if we are leavning
17480 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
17482 * modifiers.cs: Fix the computation of MethodAttributes flags.
17484 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
17486 * driver.cs: allow compilation of files that start with '/'.
17487 Add a default case when checking the argument of --target.
17489 2002-03-25 Miguel de Icaza <miguel@ximian.com>
17491 * interface.cs: Implement the same search algorithm for types in
17492 the interface code.
17494 * delegate.cs: Do not allow multiple definition.
17496 * Recovered ChangeLog that got accidentally amputated
17498 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
17500 * rootcontext.cs: Load manually enum to allow core classes to
17501 contain enumerations.
17503 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
17504 Update to new static methods in TypeManager.
17506 * typemanager.cs (GetMethod, GetConstructor): Use our
17507 implementation of FindMembers to find the members, since during
17508 corlib compilation, the types are TypeBuilders and GetMethod and
17509 GetConstructor do not work.
17511 Make all methods in TypeManager static.
17513 (InitCodeHelpers): Split the functionality from
17514 the InitCodeTypes function.
17516 * driver.cs: Call InitCodeHelpers after we have populated the
17519 * cs-parser.jay (delegate_declaration): we did not used to compute
17520 the delegate name correctly for void delegates.
17522 2002-03-24 Miguel de Icaza <miguel@ximian.com>
17524 * rootcontext.cs (RootContext): Init the interface_resolve_order
17525 and type_container_resolve_order always.
17527 (ResolveCore, BootstrapCorlib_ResolveClass,
17528 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
17529 compiler when compiling with --nostdlib
17531 * class.cs (TypeContainer.DefineType): Check that our parent is
17532 not null. This test is most important when we are bootstraping
17535 * codegen.cs: Split out the symbol writing code.
17537 2002-03-25 Martin Baulig <martin@gnome.org>
17539 * driver.cs (-g): Made -g an alias for --debug.
17541 2002-03-24 Martin Baulig <martin@gnome.org>
17543 * codegen.cs (SymbolWriter): New public variable. Returns the
17544 current symbol writer.
17545 (CodeGen): Added `bool want_debugging_support' argument to the
17546 constructor. If true, tell the ModuleBuild that we want debugging
17547 support and ask it for the ISymbolWriter.
17548 (Save): If we have a symbol writer, call it's Close() method after
17549 saving the assembly.
17551 * driver.c (--debug): New command line argument to create a
17552 debugger information file.
17554 * location.cs (SymbolDocument): New public property. Returns an
17555 ISymbolDocumentWriter object for the current source file or null
17556 if we don't have a symbol writer.
17558 2002-03-21 Miguel de Icaza <miguel@ximian.com>
17560 * driver.cs (LoadAssembly): Correctly return when all the paths
17561 have been tried and not before.
17563 * statement.cs (Switch.Emit): return the actual coverage for this
17564 statement (returns/not-returns)
17566 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
17567 switch of the statement if we are the last switch section. That
17568 kills two problems: try/catch problems (we used to emit an empty
17569 nop at the end) and switch statements where all branches would
17572 2002-03-19 Miguel de Icaza <miguel@ximian.com>
17574 * driver.cs: Add default assemblies (the equivalent to the
17575 Microsoft CSC.RSP file)
17577 * cs-tokenizer.cs: When updating `cols and setting it to zero,
17578 also update tokens_seen and set it to false.
17580 * driver.cs: Implement --recurse for Mike.
17582 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
17583 correctly splitting out the paths.
17585 2002-03-18 Miguel de Icaza <miguel@ximian.com>
17587 * interface.cs (Interface.PopulateProperty): Instead of using
17588 `parent' as the declaration space for the set parameters, use
17591 * support.cs (InternalParameters): InternalParameters constructor
17592 takes a DeclSpace instead of a TypeContainer.
17594 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
17595 types are being initialized, load the address of it before calling
17598 (New): Provide a mechanism to disable the generation of local
17599 value type temporaries when the caller will be providing us with
17600 an address to store it.
17602 (ArrayCreation.EmitDynamicInitializers): Use it.
17604 2002-03-17 Miguel de Icaza <miguel@ximian.com>
17606 * expression.cs (Invocation.EmitArguments): Only probe for array
17607 property if there is more than one argument. Sorry about that.
17609 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
17610 empty param arrays.
17612 * class.cs (Method.LabelParameters): Fix incorrect code path that
17613 prevented the `ParamArrayAttribute' from being applied to the
17616 2002-03-16 Miguel de Icaza <miguel@ximian.com>
17618 * support.cs (ReflectionParameters): Correctly compute whether the
17619 last argument is a params array. Fixes the problem with
17622 * typemanager.cs: Make the assemblies array always be non-null
17623 (empty, but non-null)
17625 * tree.cs (RecordDecl): New function that abstracts the recording
17626 of names. This reports error 101, and provides a pointer to the
17627 previous declaration. Fixes a crash in the compiler.
17629 * cs-parser.jay (constructor_declaration): Update to new grammar,
17630 and provide a constructor_body that can be empty.
17632 2002-03-15 Miguel de Icaza <miguel@ximian.com>
17634 * driver.cs: Add support for --resources.
17636 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
17637 Make all types for the various array helper methods be integer.
17639 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
17640 CheckState to ConvCast.
17642 (ConvCast): Now it takes a `checked' state argument, to avoid
17643 depending on the emit context for the conversion, and just using
17644 the resolve time setting.
17646 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
17647 instead of Invocation.EmitArguments. We do not emit the original
17648 arguments, instead we emit those which have been converted to
17649 unsigned int expressions.
17651 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
17653 * codegen.cs: ditto.
17655 * expression.cs (LocalVariableReference): Drop the use of the
17656 Store function that depended on the variable index.
17658 * statement.cs (VariableInfo): Drop the `Idx' property from this
17659 class, as this is not taking into account the indexes for
17660 temporaries tat we generate during the execution, getting the
17663 * class.cs: First emit class initializers, then call the parent
17666 * expression.cs (Binary): Fix opcode emision.
17667 (UnaryMutator.EmitCode): Support checked code generation
17669 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
17670 matches for events for both the Static and Instance scans,
17671 pointing to the same element. Fix that.
17673 2002-03-14 Miguel de Icaza <miguel@ximian.com>
17675 * rootcontext.cs (ResolveTree): Always set the
17676 interface_resolve_order, because nested interfaces will be calling
17679 * class.cs (GetInterfaceOrClass): Track the same resolution
17680 process used by TypeManager.LookupType. This fixes the nested
17681 type lookups in class declarations (separate path from
17684 (TypeContainer.DefineType): Also define nested interfaces.
17685 (TypeContainer.RegisterOrder): New public function used to
17686 register the order in which child interfaces need to be closed.
17688 Nested interfaces need to be closed after their parents have been
17691 * interface.cs (InterfaceAttr): Put all the logic for computing
17692 the interface attribute here.
17694 (DefineInterface): Register our interface order with the
17695 RootContext or with the TypeContainer depending on the case.
17697 2002-03-12 Miguel de Icaza <miguel@ximian.com>
17699 * cs-parser.jay: rework foreach statement to work with the new
17700 changes to the policy on SimpleNames.
17702 * report.cs: support Stacktrace on warnings as well.
17704 * makefile: drop --unsafe and /unsafe from the compile.
17706 2002-03-13 Ravi Pratap <ravi@ximian.com>
17708 * ecore.cs (StandardConversionExists): Modify to take an Expression
17709 as the first parameter. Ensure we do null -> reference type conversion
17712 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
17713 temporary Expression objects.
17715 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
17717 * interface.cs: workaround bug in method overloading resolution
17718 (there is already a bugzilla bug for it).
17720 2002-03-12 Miguel de Icaza <miguel@ximian.com>
17722 We could also solve this problem by having a separate path for
17723 performing type lookups, instead of DoResolve, we could have a
17724 ResolveType entry point, and only participating pieces of the
17725 production (simplename, deref, array) would implement this.
17727 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
17728 signal SimpleName to only resolve type names and not attempt to
17729 resolve anything else.
17731 * expression.cs (Cast): Set the flag.
17733 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
17735 * class.cs: Only report 108 if there is no `new' modifier.
17737 * cs-parser.jay: rework foreach statement to work with the new
17738 changes to the policy on SimpleNames.
17740 * report.cs: support Stacktrace on warnings as well.
17742 * makefile: drop --unsafe and /unsafe from the compile.
17744 2002-03-11 Miguel de Icaza <miguel@ximian.com>
17746 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
17747 lookups here, instead of doing that at parse time. This means
17748 that our grammar will not introduce `LocalVariableReferences' as
17749 expressions at this point. That solves the problem of code like
17753 static void Main ()
17757 This is only half the fix. The full fix requires parameters to
17758 also be handled in this way.
17760 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
17761 makes the use more obvious of the DeclSpace. The
17762 ec.TypeContainer.TypeBuilder is now only used to pull the
17763 TypeBuilder for it.
17765 My theory is that I can get rid of the TypeBuilder completely from
17766 the EmitContext, and have typecasts where it is used (from
17767 DeclSpace to where it matters).
17769 The only pending problem is that the code that implements Aliases
17770 is on TypeContainer, and probably should go in DeclSpace.
17772 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
17773 lookups here, instead of doing that at parse time. This means
17774 that our grammar will not introduce `LocalVariableReferences' as
17775 expressions at this point. That solves the problem of code like
17779 static void Main ()
17783 This is only half the fix. The full fix requires parameters to
17784 also be handled in this way.
17786 * class.cs (Property.DefineMethod): When implementing an interface
17787 method, set newslot, when implementing an abstract method, do not
17788 set the flag (before we tried never setting it, or always setting
17789 it, which is the difference).
17790 (Indexer.DefineMethod): same.
17791 (Method.DefineMethod): same.
17793 * ecore.cs: Only set the status used flag if we get back a Field.
17795 * attribute.cs: Temporary hack, so Paolo can keep working.
17797 2002-03-08 Ravi Pratap <ravi@ximian.com>
17799 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
17800 the unmanaged type in the case we have a MarshalAs attribute.
17802 (Resolve): Handle the case when we are parsing the special MarshalAs
17803 attribute [we need to store the unmanaged type to use later]
17805 * typemanager.cs (marshal_as_attr_type): Built in type for the
17806 MarshalAs Attribute.
17808 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
17809 on parameters and accordingly set the marshalling info.
17811 2002-03-09 Miguel de Icaza <miguel@ximian.com>
17813 * class.cs: Optimizing slightly by removing redundant code after
17814 we switched to the `NoTypes' return value.
17815 (Property.DefineMethod): use NoTypes here too.
17817 This fixes the bug I introduced in my last batch of changes.
17819 2002-03-05 Ravi Pratap <ravi@ximian.com>
17821 * tree.cs (RecordEnum): Add. We now keep track of enums too.
17823 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
17824 Enums since those are types too.
17826 * cs-parser.jay (enum_declaration): Record enums as we parse them.
17828 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
17829 thanks to a call during the lookup process.
17831 2002-03-07 Miguel de Icaza <miguel@ximian.com>
17833 * statement.cs (Foreach): Lots of work to accomodate a particular
17834 kind of foreach statement that I had not kept in mind. It is
17835 possible to have foreachs on classes that provide a GetEnumerator
17836 method that return objects that implement the "pattern" for using
17837 a foreach, there is no need to support GetEnumerator
17840 This is needed to compile nant.
17842 * decl.cs: Only report 114 if the member is not `Finalize' and if
17843 the warning level is at least 2.
17845 * class.cs: Moved the compare function from Method to
17848 (MethodSignature.InheritableMemberSignatureCompare): Add new
17849 filter function that is used to extract inheritable methods from a
17852 (Method.Define): Use the new `inheritable_method_signature_filter'
17855 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
17858 2002-03-06 Miguel de Icaza <miguel@ximian.com>
17860 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
17862 * cs-parser.jay: Add opt_semicolon to the interface declaration.
17864 * expression.cs: Pass location information to
17865 ConvertImplicitStandard.
17867 * class.cs: Added debugging code to track return values from
17870 2002-03-05 Miguel de Icaza <miguel@ximian.com>
17872 * expression.cs (Is.DoResolve): If either side of the `is' is an
17873 interface, do not flag the warning.
17875 * ecore.cs (ImplicitReferenceConversion): We need a separate test
17878 * report.cs: Allow for --fatal to be used with --probe.
17880 * typemanager.cs (NoTypes): Move the definition for the empty Type
17883 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
17885 (TypeContainer.DefineProxy): New function used to proxy to parent
17886 implementations when implementing interfaces.
17887 (TypeContainer.ParentImplements): used to lookup if our parent
17888 implements a public function that is required by an interface.
17889 (TypeContainer.VerifyPendingMethods): Hook this up.
17891 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
17892 `modules' and `assemblies' arraylists into arrays. We only grow
17893 these are the very early start up of the program, so this improves
17894 the speedof LookupType (nicely measured).
17896 * expression.cs (MakeByteBlob): Replaced unsafe code with
17897 BitConverter, as suggested by Paolo.
17899 * cfold.cs (ConstantFold.Binary): Special case: perform constant
17900 folding of string concatenation, but if either side is a string,
17901 and the other is not, then return null, and let the runtime use
17902 the concatenation on the string plus the object (using
17903 `Object.ToString').
17905 2002-03-04 Miguel de Icaza <miguel@ximian.com>
17907 Constant Folding has been implemented now.
17909 * expression.cs (Unary.Reduce): Do not throw an exception, catch
17910 the error instead on types that are not supported in one's
17913 * constant.cs (Constant and all children): New set of functions to
17914 perform implict and explicit conversions.
17916 * ecore.cs (EnumConstant): Implement the new functions to perform
17917 conversion by proxying to the child expression.
17919 * codegen.cs: (ConstantCheckState): Constant evaluation has its
17920 own separate setting that can not be turned off from the command
17921 line using --unchecked or --checked and is only controlled using
17922 the checked/unchecked statements and expressions. This setting is
17923 used by the constant folder to flag errors.
17925 * expression.cs (CheckedExpr, UncheckedExpr): Set the
17926 ConstantCheckState as well.
17928 During Resolve, they also have to flag the state, because the
17929 constant folder runs completely in the Resolve phase.
17931 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
17934 2002-03-01 Miguel de Icaza <miguel@ximian.com>
17936 * cfold.cs: New file, this file contains the constant folder.
17938 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
17939 argument to track whether we are using the resulting address to
17940 load or store a value and provide better error messages.
17942 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
17943 new AddressOf arguments.
17945 * statement.cs (Foreach.EmitCollectionForeach): Update
17947 * expression.cs (Argument.Emit): Call AddressOf with proper
17948 arguments to track usage.
17950 (New.DoEmit): Call AddressOf with new arguments.
17952 (Unary.Emit): Adjust AddressOf call.
17954 2002-03-01 Ravi Pratap <ravi@ximian.com>
17956 * cs-parser.jay (member_access): Change the case for pre-defined types
17957 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
17960 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
17963 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
17964 essentially like methods and apply attributes like MethodImplOptions to them too.
17966 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
17969 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
17970 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
17973 * Update code everywhere accordingly.
17975 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
17977 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
17979 2002-02-28 Ravi Pratap <ravi@ximian.com>
17981 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
17982 try performing lookups against those instead of jumping straight into using
17983 the 'using' clauses.
17985 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
17987 (LookupType): Perform lookups in implicit parents too.
17989 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
17990 sequence as RootContext.LookupType.
17992 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
17993 the various cases of namespace lookups into this method.
17995 2002-03-01 Miguel de Icaza <miguel@ximian.com>
17997 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
17998 in positional arguments)
18000 * class.cs (Operator): Update the AllowedModifiers to contain
18003 * cs-parser.jay: Update operator declaration to allow for the
18004 operator body to be empty.
18006 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
18009 2002-02-27 Miguel de Icaza <miguel@ximian.com>
18011 * class.cs (Method.Emit): Label parameters.
18013 * driver.cs: Return 1 or 0 as the program exit code.
18015 2002-02-26 Miguel de Icaza <miguel@ximian.com>
18017 * expression.cs: Special case the `null' object when trying to
18018 auto-compute the type, as anything can be explicitly converted to
18021 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
18022 spotting this Paolo.
18024 (Expression.ImplicitNumericConversion): Perform comparissions of
18025 the type using the underlying type in the case of an enumeration
18026 rather than using the enumeration type for the compare.
18028 Cope with the underlying == type case, which is not possible to
18031 (Expression.ConvertNumericExplicit): Perform comparissions of
18032 the type using the underlying type in the case of an enumeration
18033 rather than using the enumeration type for the compare.
18035 * driver.cs: If the user does not supply an extension, assume .exe
18037 * cs-parser.jay (if_statement): Rewrote so that we can track the
18038 location for the if statement.
18040 * expression.cs (Binary.ConstantFold): Only concat strings when
18041 the operation is "+", not everything ;-)
18043 * statement.cs (Statement.EmitBoolExpression): Take a location
18045 (If, While, Do): Track location.
18047 * expression.cs (Binary.ResolveOperator): In the object + string
18048 case, I was missing a call to ConvertImplicit
18050 2002-02-25 Ravi Pratap <ravi@ximian.com>
18052 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
18053 Location arguments. Ensure we use RootContext.LookupType to do our work
18054 and not try to do a direct Type.GetType and ModuleBuilder.GetType
18056 * interface.cs (PopulateMethod): Handle the type of the parameter being
18059 * expression.cs (Invocation.BetterFunction): Handle the case when we
18060 have a params method with no fixed arguments and a call is made with no
18063 2002-02-25 Miguel de Icaza <miguel@ximian.com>
18065 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
18066 the verbatim-string-literal
18068 * support.cs (InternalParameters.ParameterModifier): handle null
18070 (InternalParameters.ParameterType): ditto.
18072 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
18073 duplicating the name of the variable parameter.
18074 (GetParameterByName): Fix bug where we were not looking up array
18075 paramters if they were the only present (thanks Paolo!).
18076 (GetParameterInfo): We only have an empty set of types if both
18077 fixed and array are set to null.
18078 (GetParameterInfo-idx): Handle FixedParameter == null
18080 * cs-parser.jay: Handle the case where there is no catch
18081 statements (missing null test).
18083 2002-02-22 Miguel de Icaza <miguel@ximian.com>
18085 * driver.cs (MainDriver): Be conservative on our command line
18088 Catch DirectoryNotFoundException when calling GetFiles.
18090 (SplitPathAndPattern): Used to split the input specification into
18091 a path and a pattern that we can feed to Directory.GetFiles.
18093 2002-02-21 Miguel de Icaza <miguel@ximian.com>
18095 * statement.cs (Fixed): Implement the last case of the Fixed
18096 statement (string handling).
18098 * expression.cs (StringPtr): New class used to return a char * to
18099 a string; Used by the Fixed statement.
18101 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
18103 * expression.cs (Binary.ResolveOperator): Remove redundant
18104 MemberLookup pn parent type.
18105 Optimize union call, we do not need a union if the types are the same.
18106 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
18109 Specialize the use of MemberLookup everywhere, instead of using
18110 the default settings.
18112 (StackAlloc): Implement stackalloc keyword.
18114 * cs-parser.jay: Add rule to parse stackalloc.
18116 * driver.cs: Handle /h, /help, /?
18118 * expression.cs (MakeByteBlob): Removed the hacks we had in place
18119 before we supported unsafe code.
18121 * makefile: add --unsafe to the self compilation of mcs.
18123 2002-02-20 Miguel de Icaza <miguel@ximian.com>
18125 * expression.cs (PointerArithmetic): New class that is used to
18126 perform pointer arithmetic.
18127 (Binary.Resolve): Handle pointer arithmetic
18128 Handle pointer comparission.
18129 (ArrayPtr): Utility expression class that is used to take the
18130 address of an array.
18132 (ElementAccess): Implement array access for pointers
18134 * statement.cs (Fixed): Implement fixed statement for arrays, we
18135 are missing one more case before we are done.
18137 * expression.cs (Indirection): Implement EmitAssign and set the
18138 ExprClass to Variable. This allows pointer dereferences to be
18139 treated as variables, and to have values assigned to them.
18141 * ecore.cs (Expression.StoreFromPtr): New utility function to
18142 store values dereferencing.
18144 2002-02-20 Ravi Pratap <ravi@ximian.com>
18146 * expression.cs (Binary.ResolveOperator): Ensure that we are
18147 not trying to operate on a void type - this fixes the reported
18150 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
18151 the parent implementation is sealed.
18153 * ../errors/cs0239.cs : Add.
18155 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
18157 * typemanager.cs (unverifiable_code_type): Corresponds to
18158 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
18159 which have unsafe code in them.
18161 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
18164 2002-02-19 Miguel de Icaza <miguel@ximian.com>
18166 * cs-tokenizer.cs: Add support for @"litreal strings"
18168 Make tokenizer accept pre-processor directives
18169 on any column (remove the old C-like limitation).
18171 * rootcontext.cs (EmitCode): Emit any global attributes.
18172 (AddGlobalAttributes): Used to keep track of assembly attributes.
18174 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
18176 * cs-parser.jay: Add support for global attributes.
18178 2002-02-17 Miguel de Icaza <miguel@ximian.com>
18180 * expression.cs (Indirection): New helper class. Unary will
18181 create Indirection classes to be able to implement the
18182 IMemoryLocation interface on it.
18184 2002-02-16 Miguel de Icaza <miguel@ximian.com>
18186 * cs-parser.jay (fixed_statement): reference the right statement.
18188 * statement.cs (Fixed.Emit): Finish implementing the fixed
18189 statement for the &x case.
18191 2002-02-14 Miguel de Icaza <miguel@ximian.com>
18193 * class.cs (Property.Define, Method.Define): Remove newslot when
18196 * modifiers.cs: My use of NewSlot when `Abstract' was set was
18197 wrong. NewSlot should only be used if the `new' keyword is present.
18199 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
18200 locating our system dir. Sorry about this.
18202 2002-02-13 Miguel de Icaza <miguel@ximian.com>
18204 * driver.cs (GetSystemDir): Compute correctly the location of our
18205 system assemblies. I was using the compiler directory instead of
18206 the library directory.
18208 2002-02-13 Ravi Pratap <ravi@ximian.com>
18210 * expression.cs (BetterFunction): Put back in what Miguel commented out
18211 since it is the correct fix. The problem is elsewhere ;-)
18213 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
18214 parameters of the parms method are themselves compatible or not !
18216 (StandardConversionExists): Fix very dangerous bug where we were forgetting
18217 to check that a class implements an interface before saying that an implicit
18218 conversion was allowed. Use ImplementsInterface to do the checking.
18220 2002-02-13 Miguel de Icaza <miguel@ximian.com>
18222 * class.cs (Method.Define): Track whether we are an explicit
18223 implementation or not. And only call DefineMethodOverride if we
18224 are an explicit implementation.
18226 (Property.DefineMethod): Ditto.
18228 2002-02-11 Ravi Pratap <ravi@ximian.com>
18230 * expression.cs (BetterFunction): Catch hideous bug which was
18231 preventing us from detecting ambiguous calls due to implicit casts i.e
18234 2002-01-29 Miguel de Icaza <miguel@ximian.com>
18236 * support.cs (Pair): Remove un-needed method. I figured why I was
18237 getting the error in cs-parser.jay, the variable in a foreach loop
18238 is readonly, and the compiler does not really treat this as a variable.
18240 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
18241 instead of EQUALS in grammar.
18243 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
18245 * expression.cs (Unary.DoResolve): Check whether the argument is
18248 2002-01-28 Miguel de Icaza <miguel@ximian.com>
18250 * support.cs: Api for Pair to set a value. Despite the fact that
18251 the variables are public the MS C# compiler refuses to compile
18252 code that accesses the field if the variable is part of a foreach
18255 * statement.cs (Fixed): Begin implementation of the fixed
18258 (Block.AddVariable): Return the VariableInfo on success and null
18259 on failure instead of true/false.
18261 * cs-parser.jay (foreach): Catch errors on variables already
18262 defined (we were ignoring this value before) and properly unwind
18263 the block hierarchy
18265 (fixed_statement): grammar for the fixed statement.
18267 2002-01-25 Miguel de Icaza <miguel@ximian.com>
18269 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
18270 pointer types to be incretemented.
18272 (SizeOf): Implement.
18274 * cs-parser.jay (pointer_member_access): Implement
18275 expr->IDENTIFIER production.
18277 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
18278 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
18281 (Unary): Implement indirection.
18283 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
18284 use in non-unsafe context).
18286 (SimpleName.DoResolve): Check for pointers in field access on safe
18289 (Expression.LoadFromPtr): Factor the load-indirect code in this
18290 function. This was duplicated in UnboxCast and ParameterReference
18292 2002-01-24 Miguel de Icaza <miguel@ximian.com>
18294 * expression.cs (ComposedCast): report an error if a pointer cast
18295 is used in a safe region.
18297 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
18298 pointer type casts in unsafe context.
18300 * codegen.cs (EmitContext): Set up IsUnsafe.
18302 * cs-parser.jay (non_expression_type): Add productions for pointer
18305 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
18306 code. We should not use force into static mode if the method is
18307 not virtual. Fixes bug in MIS
18309 * statement.cs (Do.Emit, While.Emit, For.Emit,
18310 Statement.EmitBoolExpression): Add support to Do and While to
18311 propagate infinite loop as `I do return' semantics.
18313 Improve the For case to also test for boolean constants.
18315 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
18316 to the list of attributes we can add.
18318 Remove `EmitContext' argument.
18320 * class.cs (Method.Define): Apply parameter attributes.
18321 (Constructor.Define): Apply parameter attributes.
18322 (MethodCore.LabelParameters): Move here the core of labeling
18325 * support.cs (ReflectionParameters.ParameterModifier,
18326 InternalParameters.ParameterModifier): Use IsByRef on the type and
18327 only return the OUT bit for these parameters instead of in/out/ref
18330 This is because I miss-understood things. The ParameterInfo.IsIn
18331 and IsOut represent whether the parameter has the [In] and [Out]
18334 2002-01-22 Miguel de Icaza <miguel@ximian.com>
18336 * ecore.cs (FieldExpr.Emit): Release temporaries.
18338 * assign.cs (LocalTemporary.Release): new function.
18340 * codegen.cs (EmitContext.GetTemporaryStorage,
18341 EmitContext.FreeTemporaryStorage): Rework the way we deal with
18342 temporary storage. Now we can "put back" localbuilders when we
18345 2002-01-21 Miguel de Icaza <miguel@ximian.com>
18347 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
18348 need to make a copy of the variable to generate verifiable code.
18350 2002-01-19 Miguel de Icaza <miguel@ximian.com>
18352 * driver.cs: Compute dynamically the system directory.
18354 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
18355 Slower, but more generally useful. Used by the abstract
18356 registering implementation.
18358 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
18359 the rules for the special rule on Type/instances. First check if
18360 we have the same name, and if so, try that special static path
18361 rather than the instance path.
18363 2002-01-18 Miguel de Icaza <miguel@ximian.com>
18365 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
18368 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
18369 Enum, ValueType, Delegate or Array for non-corlib compiles.
18371 * cs-tokenizer.cs: Catch long identifiers (645)
18373 * typemanager.cs (IndexerPropetyName): Ravi never tested this
18376 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
18377 fix, we were returning too early, so we were not registering
18378 pending methods from abstract classes.
18380 Do not register pending methods if the class is abstract.
18382 * expression.cs (Conditional.DoResolve): Report circular implicit
18383 conversions when we neecd to compute it for conditional
18386 (Is.DoResolve): If the expression is always of the provided type,
18387 flag warning 183. If the expression can not ever be of the
18388 provided type flag warning 184.
18390 * class.cs: Catch 169 as well.
18392 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
18395 2002-01-18 Nick Drochak <ndrochak@gol.com>
18397 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
18399 2002-01-17 Miguel de Icaza <miguel@ximian.com>
18401 * interface.cs: (PopulateMethod): Check for pointers being defined
18402 only if the unsafe context is active.
18403 (PopulateProperty): ditto.
18404 (PopulateIndexer): ditto.
18406 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
18407 specified. If pointers are present, make sure that they are
18408 present in an unsafe context.
18409 (Constructor, Constructor.Define): ditto.
18410 (Field, Field.Define): ditto.
18411 (Property, Property.Define): ditto.
18412 (Event, Event.Define): ditto.
18414 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
18415 hashtable if there are classes or structs defined.
18417 * expression.cs (LocalVariableReference.DoResolve): Simplify this
18418 code, as the constant resolution moved.
18420 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
18421 the metadata, so we can flag error 133.
18423 * decl.cs (MemberCore.UnsafeOK): New function to test that a
18424 pointer is being declared in an unsafe context.
18426 2002-01-16 Miguel de Icaza <miguel@ximian.com>
18428 * modifiers.cs (Modifiers.Check): Require a Location argument.
18429 Report error 227 for Unsafe use.
18431 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
18433 * statement.cs (For.Emit): If the test is null, then report that
18434 we do `return', as we wont reach anything afterwards.
18436 (Switch.SwitchGoverningType): Track the expression that matched
18439 * driver.cs: Allow negative numbers as an error code to flag.
18441 * cs-parser.jay: Handle 1551.
18443 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
18445 2002-01-15 Miguel de Icaza <miguel@ximian.com>
18447 * cs-parser.jay: Report 1518 (type declaration can only contain
18448 class, struct, interface, enum or delegate)
18450 (switch_label): Report 1523 (keywords `case' or `default' must
18453 (opt_switch_sections): Report 1522 (empty switch)
18455 * driver.cs: Report 1515 (response file specified multiple times)
18456 Report 1516 (Source file specified multiple times).
18458 * expression.cs (Argument.Resolve): Signal 1510
18460 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
18461 access not allowed in static code)
18463 2002-01-11 Ravi Pratap <ravi@ximian.com>
18465 * typemanager.cs (IsPointerType): Utility method which we are going
18468 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
18469 the object type, so we take care of that.
18471 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
18473 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
18474 added to non-params parameters :-)
18476 * typemanager.cs (CSharpName): Include 'void' type too.
18478 (void_ptr_type): Include in the set of core types.
18480 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
18483 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
18486 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
18487 completely forgotten about it.
18489 2002-01-10 Ravi Pratap <ravi@ximian.com>
18491 * cs-parser.jay (pointer_type): Add. This begins our implementation
18492 of parsing rules for unsafe code.
18494 (unsafe_statement): Implement.
18496 (embedded_statement): Modify to include the above.
18498 * statement.cs (Unsafe): Implement new class for unsafe blocks.
18500 * codegen.cs (EmitContext.InUnsafe): Add. This determines
18501 if the current context is an unsafe one.
18503 * cs-parser.jay (local_variable_pointer_type): Since local variable types
18504 are handled differently, we need separate rules for them.
18506 (local_variable_declaration): Update to use local_variable_pointer_type
18507 to allow variable declarations of unmanaged pointer types.
18509 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
18510 in unsafe contexts.
18512 * ../errors/cs0214.cs : Add.
18514 2002-01-16 Nick Drochak <ndrochak@gol.com>
18516 * makefile: remove 'response' file when cleaning.
18518 2002-01-15 Miguel de Icaza <miguel@ximian.com>
18520 * cs-parser.jay: Report 1524.
18522 2002-01-14 Miguel de Icaza <miguel@ximian.com>
18524 * typemanager.cs (RegisterMethod): drop checking if we have
18525 registered this from here
18527 2002-01-12 Miguel de Icaza <miguel@ximian.com>
18529 * class.cs (Method.EmitDestructor): Implement calling our base
18532 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
18533 value of InFinally.
18535 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
18536 this routine and will wrap the call in a try/catch block. Deal
18539 2002-01-11 Miguel de Icaza <miguel@ximian.com>
18541 * ecore.cs (Expression.MemberLookup): instead of taking a
18542 parameter `same_type' that was used to tell whether we could
18543 access private members we compute our containing type from the
18546 (FieldExpr): Added partial support for volatile fields. This does
18547 not work for volatile fields exposed from assemblies, as I can not
18548 figure out how to extract the modreq from it.
18550 Updated all the source files to use this.
18552 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
18553 because it is referenced by MemberLookup very often.
18555 2002-01-09 Ravi Pratap <ravi@ximian.com>
18557 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
18558 TypeBuilder.GetCustomAttributes to retrieve what we need.
18560 Get rid of redundant default_member_attr_type as this is the same as
18561 default_member_type which already exists.
18563 * interface.cs, attribute.cs : Update accordingly.
18565 2002-01-08 Miguel de Icaza <miguel@ximian.com>
18567 * typemanager.cs: Enable IndexerPropertyName again. It does not
18568 work for TYpeBuilders though. Ravi, can you please fix this?
18570 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
18572 * expression.cs (Argument.Emit): Handle the case of ref objects
18573 being passed to ref functions;
18575 (ParameterReference.EmitLoad): Loads the content of the pointer
18576 without dereferencing.
18578 2002-01-07 Miguel de Icaza <miguel@ximian.com>
18580 * cs-tokenizer.cs: Implemented the pre-processing expressions.
18582 2002-01-08 Ravi Pratap <ravi@ximian.com>
18584 * class.cs (Indexer.DefineMethod): Incorporate the interface
18585 type in the name of the method if we are doing explicit interface
18588 * expression.cs (ConversionExists): Remove as it is completely obsolete.
18590 (BetterConversion): Fix extremely trivial bug where we were referring to
18591 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
18594 * ../errors/bug16.cs : Add although we have fixed it.
18596 2002-01-07 Miguel de Icaza <miguel@ximian.com>
18598 * expression.cs (BaseIndexer): Begin implementation.
18600 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
18602 * cs-parser.jay (indexer_declarator): Use qualified_identifier
18603 production directly to remove a shift/reduce, and implement
18604 explicit interface implementation.
18606 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
18607 after a floating point suffix.
18609 * expression.cs (DoNumericPromotions): Improved the conversion for
18610 uint/uint. If we have a constant, we avoid doing a typecast to a
18613 * class.cs (Indexer): Implement explicit interface implementation
18616 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
18618 * class.cs: make the default instance constructor public and hidebysig.
18620 2001-01-03 Ravi Pratap <ravi@ximian.com>
18622 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
18623 so we can call it from elsewhere.
18625 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
18626 we emit it internally if the class has a defined indexer; otherwise the user
18627 emits it by decorating the class definition with the DefaultMemberAttribute.
18629 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
18630 attribute is not used on a type which defines an indexer.
18632 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
18633 character when we skip whitespace.
18635 * ../errors/cs0646.cs : Add.
18637 2002-01-03 Miguel de Icaza <miguel@ximian.com>
18639 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
18642 * makefile: Add practical target `mcs3.exe' which builds the third
18643 generation compiler.
18645 * expression.cs (New): Fix structures constructor calling.
18647 * class.cs (Property, Method, Indexer): Emit Final flag on the
18648 method if we are an interface implementation and we are not
18651 * ecore.cs (PropertyExpr): New public field `IsBase', tells
18652 whether this property is referencing a `base' method.
18654 * expression.cs (Invocation.EmitCall): take an extra argument:
18655 is_base, this is used to determine whether the `call' or
18656 `callvirt' opcode should be used.
18659 * delegate.cs: update EmitCall.
18661 * class.cs (Method.Define): Set NewSlot for the cases where we are
18662 not implementing an interface method.
18664 (Property.Define): ditto.
18666 2002-01-02 Miguel de Icaza <miguel@ximian.com>
18668 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
18669 'r'. Allows mcs to parse itself fully.
18671 2002-01-02 Ravi Pratap <ravi@ximian.com>
18673 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
18674 of the number of initializers that require the InitializeArray method.
18676 (CheckIndices): Store the Expression in all cases - not the plain value. Also
18677 update the above field where necessary.
18679 (MakeByteBlob): Update accordingly.
18681 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
18684 (EmitDynamicInitializers): Update in accordance with the new optimization.
18686 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
18687 same OpCode applies.
18689 * cs-parser.jay : Fix some glaring errors I introduced.
18691 2002-01-01 Ravi Pratap <ravi@ximian.com>
18693 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
18694 so that we can check for name clashes there too.
18696 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
18697 for interface indexers.
18699 * interfaces.cs (Define): Emit the default member attribute.
18701 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
18702 variable was being referred to while setting the value ;-)
18704 2002-01-01 Miguel de Icaza <miguel@ximian.com>
18706 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
18707 byte-by-byte information when we know the data is zero.
18709 Make the block always a multiple of 4, because
18710 DefineInitializedData has a bug.
18712 * assign.cs: Fix, we should assign from the temporary, not from
18715 * expression.cs (MakeByteBlob): Fix my incorrect code.
18717 2001-12-31 Miguel de Icaza <miguel@ximian.com>
18719 * typemanager.cs (EnumToUnderlying): This function is used to get
18720 the underlying type from an enumeration, because it does not
18723 * constant.cs: Use the I4_S form for values between -128 and 127.
18725 * statement.cs (Block.LookupLabel): Looks up a label.
18726 (Block): Drop support for labeled blocks.
18728 (LabeledStatement): New kind of statement that represents a label
18731 (Goto): Finally implement this bad boy.
18733 * cs-parser.jay: Update to reflect new mechanism to implement
18736 2001-12-30 Miguel de Icaza <miguel@ximian.com>
18738 * codegen.cs (EmitContext.This): a codegen property that keeps the
18739 a single instance of this instead of creating many different this
18742 * delegate.cs (Delegate.DoResolve): Update to use the property;
18744 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
18746 * expression.cs (BaseAccess.DoResolve): Ditto.
18748 2001-12-29 Ravi Pratap <ravi@ximian.com>
18750 * typemanager.cs (methodimpl_attr_type): Add to hold the type
18751 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
18753 (InitCoreTypes): Update accordingly.
18755 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
18756 so we can quickly store the state.
18758 (ApplyAttributes): Set the correct implementation flags
18759 for InternalCall methods.
18761 2001-12-29 Miguel de Icaza <miguel@ximian.com>
18763 * expression.cs (EmitCall): if a method is not virtual, then do
18764 not use callvirt on it.
18766 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
18767 user defined stuff) requires the use of stobj, which takes an
18768 address on the stack instead of an array and an index. So emit
18769 the Ldelema operation for it.
18771 (EmitStoreOpcode): Use stobj for valuetypes.
18773 (UnaryMutator.EmitCode): Use the right 1 value depending on
18774 whether we are dealing with int64/uint64, float or doubles.
18776 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
18777 constructors that I implemented last night.
18779 (Constructor.IsDefault): Fix to work properly for static
18782 * cs-parser.jay (CheckDef): report method signature errors.
18783 Update error number 103 to be 132.
18785 * decl.cs: New AdditionResult enumeration value: MethodExists.
18786 Although we do this check for methods later on in the semantic
18787 analysis, catching repeated default constructors is so easy that
18788 we catch these here.
18790 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
18793 (ParameterReference.EmitAssign, Emit): handle
18796 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
18797 (ArrayAccess.EmitStoreOpcode): ditto.
18799 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
18801 * expression.cs (MakeByteBlob): Complete all the missing types
18802 (uint, short, ushort, byte, sbyte)
18804 * class.cs: Only init instance field initializers on instance
18807 Rename `constructors' to instance_constructors.
18809 (TypeContainer.AddConstructor): Only add constructors to the list
18810 if it is not static.
18812 Make sure that we handle default_static_constructor independently
18813 everywhere where we handle instance_constructors
18815 2001-12-28 Miguel de Icaza <miguel@ximian.com>
18817 * class.cs: Do not lookup or create a base initializer for a
18818 static constructor.
18820 (ConstructorInitializer.Resolve): use the proper type to lookup
18823 * cs-parser.jay: Report error 1585 (modifiers between type and name).
18825 * enum.cs, interface.cs: Remove CloseType, this is taken care by
18828 * decl.cs: CloseType is now an virtual method, the default
18829 implementation just closes this type.
18831 2001-12-28 Ravi Pratap <ravi@ximian.com>
18833 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
18834 to PreserveSig by default. Also emit HideBySig on such methods.
18836 Basically, set the defaults to standard values.
18838 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
18839 argument, if candidate is better, it can't be worse than the best !
18841 (Invocation): Re-write bits to differentiate between methods being
18842 applicable in their expanded form and their normal form - for params
18845 Get rid of use_standard everywhere as only standard conversions are allowed
18846 in overload resolution.
18848 More spec conformance.
18850 2001-12-27 Miguel de Icaza <miguel@ximian.com>
18852 * driver.cs: Add --timestamp, to see where the compiler spends
18855 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
18856 `this' in static code.
18858 (SimpleName.DoResolve): Implement in terms of a helper function
18859 that allows static-references to be passed upstream to
18862 (Expression.ResolveWithSimpleName): Resolve specially simple
18863 names when called by MemberAccess to implement the special
18866 (Expression.ImplicitReferenceConversion): Handle conversions from
18867 Null to reference types before others, as Null's type is
18870 * expression.cs (Invocation.EmitCall): Handle the special case of
18871 calling methods declared on a reference type from a ValueType
18872 (Base classes System.Object and System.Enum)
18874 (MemberAccess.Resolve): Only perform lookups on Enumerations if
18875 the left hand side is a TypeExpr, not on every enumeration.
18877 (Binary.Resolve): If types are reference types, then do a cast to
18878 object on operators != and == of both arguments.
18880 * typemanager.cs (FindMembers): Extract instance and static
18881 members if requested.
18883 * interface.cs (PopulateProperty): Use void_type instead of null
18884 as the return type for the setter method.
18886 (PopulateIndexer): ditto.
18888 2001-12-27 Ravi Pratap <ravi@ximian.com>
18890 * support.cs (ReflectionParameters): Fix minor bug where we
18891 were examining the wrong parameter for the ParamArray attribute.
18893 Cope with requests for the type of the parameter at position
18894 greater than the params parameter's. We now return the element
18895 type of the params array as that makes more sense.
18897 * expression.cs (Invocation.IsParamsMethodApplicable): Update
18898 accordingly as we no longer have to extract the element type
18901 (Invocation.OverloadResolve): Update.
18903 2001-12-27 Miguel de Icaza <miguel@ximian.com>
18905 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
18906 against IEnumerator, test whether the return value is a descendant
18907 of the IEnumerator interface.
18909 * class.cs (Indexer.Define): Use an auxiliary method to implement
18910 the other bits of the method definition. Begin support for
18911 explicit interface implementation.
18913 (Property.DefineMethod): Use TypeManager.void_type instead of null
18914 for an empty return value.
18916 2001-12-26 Miguel de Icaza <miguel@ximian.com>
18918 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
18919 dealing with a FieldExpr which is composed of a FieldBuilder, in
18920 the code path we did extract the constant, but we should have
18921 obtained the underlying value to be able to cast it (otherwise we
18922 end up in an infinite loop, this is what Ravi was running into).
18924 (ArrayCreation.UpdateIndices): Arrays might be empty.
18926 (MemberAccess.ResolveMemberAccess): Add support for section
18927 14.5.4.1 that deals with the special case of E.I when E is a type
18928 and something else, that I can be a reference to a static member.
18930 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
18931 handle a particular array type to create byte blobs, it is just
18932 something we dont generate byteblobs for.
18934 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
18937 * location.cs (Push): remove the key from the hashtable that we
18938 are about to add. This happens for empty files.
18940 * driver.cs: Dispose files after we have parsed them.
18942 (tokenize): new function that only runs the tokenizer on its
18943 input, for speed testing.
18945 2001-12-26 Ravi Pratap <ravi@ximian.com>
18947 * class.cs (Event.Define): Define the private field only if there
18948 are no accessors defined.
18950 * expression.cs (ResolveMemberAccess): If there is no associated
18951 field with the event, that means we have an event defined with its
18952 own accessors and we should flag error cs0070 since transforming
18953 ourselves into a field is not valid in that case.
18955 * ecore.cs (SimpleName.DoResolve): Same as above.
18957 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
18958 and charset to sane values.
18960 2001-12-25 Ravi Pratap <ravi@ximian.com>
18962 * assign.cs (DoResolve): Perform check on events only if they
18963 are being accessed outside the declaring type.
18965 * cs-parser.jay (event_declarations): Update rules to correctly
18966 set the type of the implicit parameter etc.
18968 (add_accessor, remove_accessor): Set current local parameters.
18970 * expression.cs (Binary): For delegate addition and subtraction,
18971 cast the return value from the method into the appropriate delegate
18974 2001-12-24 Ravi Pratap <ravi@ximian.com>
18976 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
18977 of these as the workaround is unnecessary.
18979 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
18980 delegate data - none of that is needed at all.
18982 Re-write bits to extract the instance expression and the delegate method
18985 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
18988 * attribute.cs (ApplyAttributes): New method to take care of common tasks
18989 of attaching attributes instead of duplicating code everywhere.
18991 * everywhere : Update code to do attribute emission using the above method.
18993 2001-12-23 Miguel de Icaza <miguel@ximian.com>
18995 * expression.cs (IsParamsMethodApplicable): if there are not
18996 parameters, return immediately.
18998 * ecore.cs: The 0 literal can be implicity converted to an enum
19001 (SimpleName.DoResolve): First lookup the type, then lookup the
19004 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
19005 want to get its address. If the InstanceExpression is not
19006 addressable, store the result in a temporary variable, then get
19009 * codegen.cs: Only display 219 errors on warning level or above.
19011 * expression.cs (ArrayAccess): Make it implement the
19012 IMemoryLocation interface.
19014 (Binary.DoResolve): handle the operator == (object a, object b)
19015 and operator != (object a, object b) without incurring into a
19016 BoxedCast (because 5 != o should never be performed).
19018 Handle binary enumerator operators.
19020 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
19021 value type, otherwise use Ldelem_ref.
19023 Use precomputed names;
19025 (AddressOf): Implement address of
19027 * cs-parser.jay (labeled_statement): Fix recursive block
19028 addition by reworking the production.
19030 * expression.cs (New.DoEmit): New has a special case:
19032 If we are dealing with a ValueType, we have a few
19033 situations to deal with:
19035 * The target of New is a ValueType variable, that is
19036 easy, we just pass this as the variable reference
19038 * The target of New is being passed as an argument,
19039 to a boxing operation or a function that takes a
19042 In this case, we need to create a temporary variable
19043 that is the argument of New.
19046 2001-12-23 Ravi Pratap <ravi@ximian.com>
19048 * rootcontext.cs (LookupType): Check that current_type is not null before
19049 going about looking at nested types.
19051 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
19052 not implement the IAssignMethod interface any more.
19054 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
19055 where we tranform them into FieldExprs if they are being resolved from within
19056 the declaring type.
19058 * ecore.cs (SimpleName.DoResolve): Do the same here.
19060 * assign.cs (DoResolve, Emit): Clean up code considerably.
19062 * ../errors/bug10.cs : Add.
19064 * ../errors/cs0070.cs : Add.
19066 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
19068 * assign.cs : Get rid of EventIsLocal everywhere.
19070 2001-12-23 Miguel de Icaza <miguel@ximian.com>
19072 * ecore.cs (ConvertIntLiteral): finished the implementation.
19074 * statement.cs (SwitchLabel): Convert the value we are using as a
19075 key before looking up the table.
19077 2001-12-22 Miguel de Icaza <miguel@ximian.com>
19079 * codegen.cs (EmitTopBlock): Require a Location argument now.
19081 * cs-parser.jay (constructor_declarator): We need to setup
19082 current_local_parameters before we parse the
19083 opt_constructor_initializer, to allow the variables to be bound
19084 to the constructor arguments.
19086 * rootcontext.cs (LookupType): First lookup nested classes in our
19087 class and our parents before we go looking outside our class.
19089 * expression.cs (ConstantFold): Extract/debox the values at the
19092 * rootcontext.cs (EmitCode): Resolve the constants first before we
19093 resolve the types. This is not really needed, but it helps debugging.
19095 * statement.cs: report location.
19097 * cs-parser.jay: pass location to throw statement.
19099 * driver.cs: Small bug fix.
19101 * report.cs: Updated format to be 4-zero filled digits.
19103 2001-12-22 Ravi Pratap <ravi@ximian.com>
19105 * expression.cs (CheckIndices): Fix minor bug where the wrong
19106 variable was being referred to ;-)
19108 (DoEmit): Do not call EmitStaticInitializers when the
19109 underlying type is System.Object.
19111 2001-12-21 Ravi Pratap <ravi@ximian.com>
19113 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
19114 and do the usual workaround for SRE.
19116 * class.cs (MyEventBuilder.EventType): New member to get at the type
19117 of the event, quickly.
19119 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
19121 * assign.cs (Assign.DoResolve): Handle the case when the target
19122 is an EventExpr and perform the necessary checks.
19124 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
19127 (SimpleName.MemberStaticCheck): Include check for EventExpr.
19129 (EventExpr): Set the type in the constructor itself since we
19130 are meant to be born fully resolved.
19132 (EventExpr.Define): Revert code I wrote earlier.
19134 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
19135 instance expression is null. The instance expression is a This in that case
19136 or a null, depending on whether it is a static method or not.
19138 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
19139 refers to more than one method.
19141 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
19142 and accordingly flag errors.
19144 2001-12-21 Miguel de Icaza <miguel@ximian.com>
19146 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
19148 2001-12-22 Miguel de Icaza <miguel@ximian.com>
19150 * location.cs (ToString): Provide useful rutine.
19152 2001-12-21 Miguel de Icaza <miguel@ximian.com>
19154 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
19155 objects, return the actual integral boxed.
19157 * statement.cs (SwitchLabel): define an ILLabel for each
19160 (Switch.CheckSwitch): If the value is a Literal, extract
19161 the underlying literal.
19163 Also in the unused hashtable we had, add the SwitchLabel so we can
19164 quickly look this value up.
19166 * constant.cs: Implement a bunch of new constants. Rewrite
19167 Literal based on this. Made changes everywhere to adapt to this.
19169 * expression.cs (Expression.MakeByteBlob): Optimize routine by
19170 dereferencing array only once, and also copes with enumrations.
19172 bytes are two bytes wide, not one.
19174 (Cast): Perform constant conversions.
19176 * ecore.cs (TryImplicitIntConversion): Return literals instead of
19177 wrappers to the literals here.
19179 * expression.cs (DoNumericPromotions): long literals can converted
19180 to ulong implicity (this is taken care of elsewhere, but I was
19181 missing this spot).
19183 * ecore.cs (Expression.Literalize): Make the return type Literal,
19184 to improve type checking.
19186 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
19188 2001-12-20 Miguel de Icaza <miguel@ximian.com>
19190 * literal.cs: Revert code from ravi that checked the bounds. The
19191 bounds are sane by the definition of the type itself.
19193 * typemanager.cs: Fix implementation of ImplementsInterface. We
19194 need to actually look up in our parent hierarchy for interfaces
19197 * const.cs: Use the underlying type for enumerations
19199 * delegate.cs: Compute the basename for the delegate creation,
19200 that should fix the delegate test case, and restore the correct
19201 Type Lookup semantics in rootcontext
19203 * rootcontext.cs: Revert Ravi's last patch. The correct way of
19204 referencing a nested type with the Reflection API is using the "+"
19207 * cs-parser.jay: Do not require EOF token at the end.
19209 2001-12-20 Ravi Pratap <ravi@ximian.com>
19211 * rootcontext.cs (LookupType): Concatenate type names with
19212 a '.' instead of a '+' The test suite passes again.
19214 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
19215 field of the enumeration.
19217 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
19218 the case when the member is an EventExpr.
19220 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
19221 static has an associated instance expression.
19223 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
19225 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
19227 * class.cs (Event.Define): Register event and perform appropriate checks
19230 We define the Add and Remove methods even if the use provides none because
19231 in that case, we provide default implementations ourselves.
19233 Define a private field of the type of the event. This is done by the CSC compiler
19234 and we should be doing it too ;-)
19236 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
19237 More methods we use in code we generate.
19239 (multicast_delegate_type, delegate_type): Two separate types since the distinction
19242 (InitCoreTypes): Update accordingly for the above.
19244 * class.cs (Event.Emit): Generate code for default accessors that we provide
19246 (EmitDefaultMethod): Do the job in the above.
19248 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
19251 2001-12-20 Miguel de Icaza <miguel@ximian.com>
19253 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
19254 builders even if we were missing one.
19256 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
19257 pass the Basename as our class name instead of the Name. The
19258 basename will be correctly composed for us.
19260 * parameter.cs (Paramters): Now takes a Location argument.
19262 * decl.cs (DeclSpace.LookupType): Removed convenience function and
19263 make all the code call directly LookupType in RootContext and take
19264 this chance to pass the Location information everywhere.
19266 * Everywhere: pass Location information.
19268 2001-12-19 Miguel de Icaza <miguel@ximian.com>
19270 * class.cs (Constructor.Define): Updated way of detecting the
19271 length of the parameters.
19273 (TypeContainer.DefineType): Use basename as the type name for
19276 (TypeContainer.Define): Do not recursively define types here, as
19277 definition is taken care in order by the RootContext.
19279 * tree.cs: Keep track of namespaces in a per-file basis.
19281 * parameter.cs (Parameter.ComputeSignature): Update to use
19284 (Parameters.GetSignature): ditto.
19286 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
19287 instead of a TypeContainer.
19289 (Interface.SemanticAnalysis): Use `this' instead of our parent to
19290 resolve names. Because we need to be resolve in our context, not
19293 * driver.cs: Implement response files.
19295 * class.cs (TypeContainer.DefineType): If we are defined, do not
19296 redefine ourselves.
19298 (Event.Emit): Emit the code for add/remove handlers.
19299 (Event.Define): Save the MethodBuilders for add/remove.
19301 * typemanager.cs: Use pair here too.
19303 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
19304 DictionaryEntry requires the first argument to be non-null.
19306 (enum_declaration): Compute full name for registering the
19309 (delegate_declaration): Instead of using
19310 formal_parameter_list, use opt_formal_parameter_list as the list
19313 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
19314 (EventParsing): New property that controls whether `add' and
19315 `remove' are returned as tokens or identifiers (for events);
19317 2001-12-19 Ravi Pratap <ravi@ximian.com>
19319 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
19320 use MyEventBuilder only and let it wrap the real builder for us.
19322 (MyEventBuilder): Revamp constructor etc.
19324 Implement all operations that we perform on EventBuilder in precisely the same
19327 (FindMembers): Update to use the EventBuilder member.
19329 (Event.Emit): Update accordingly.
19331 2001-12-18 Ravi Pratap <ravi@ximian.com>
19333 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
19334 by calling the appropriate methods.
19336 (GetCustomAttributes): Make stubs as they cannot possibly do anything
19339 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
19341 2001-12-17 Ravi Pratap <ravi@ximian.com>
19343 * delegate.cs (Delegate.Populate): Check that the return type
19344 and various parameters types are indeed accessible.
19346 * class.cs (Constructor.Define): Same here.
19348 (Field.Define): Ditto.
19350 (Event.Define): Ditto.
19352 (Operator.Define): Check that the underlying Method defined itself
19353 correctly - so it's MethodBuilder should not be null.
19355 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
19356 expression happens to be null.
19358 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
19359 members but as of now we don't seem to be able to do anything really useful with it.
19361 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
19362 not the EventBuilder.
19364 2001-12-18 Miguel de Icaza <miguel@ximian.com>
19366 * cs-tokenizer.cs: Add support for defines.
19367 Add support for #if, #elif, #else, #endif
19369 (eval_var): evaluates a variable.
19370 (eval): stubbed for evaluating functions.
19372 * cs-parser.jay: Pass the defines information
19374 * driver.cs: Add --define command line option.
19376 * decl.cs: Move MemberCore here.
19378 Make it the base class for DeclSpace. This allows us to catch and
19379 report 108 and 109 for everything now.
19381 * class.cs (TypeContainer.Define): Extract all the members
19382 before populating and emit the warning 108 (new keyword required
19383 to override) instead of having each member implement this.
19385 (MemberCore.Define): New abstract method, we will be using this in
19386 the warning reporting engine in Populate.
19388 (Operator.Define): Adjust to new MemberCore protocol.
19390 * const.cs (Const): This does not derive from Expression, it is a
19391 temporary object we use to create fields, it is a MemberCore.
19393 * class.cs (Method.Define): Allow the entry point to be in a
19396 * driver.cs: Rewrite the argument handler to clean it up a bit.
19398 * rootcontext.cs: Made it just an auxiliary namespace feature by
19399 making everything static.
19401 * driver.cs: Adapt code to use RootContext type name instead of
19404 * delegate.cs: Remove RootContext argument.
19406 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
19409 * class.cs (Event.Define): The lookup can fail.
19411 * cs-tokenizer.cs: Begin implementation of pre-procesor.
19413 * expression.cs: Resolve the this instance before invoking the code.
19415 2001-12-17 Miguel de Icaza <miguel@ximian.com>
19417 * cs-parser.jay: Add a production in element_access that allows
19418 the thing to become a "type" reference. This way we can parse
19419 things like "(string [])" as a type.
19421 Note that this still does not handle the more complex rules of
19425 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
19427 * ecore.cs: (CopyNewMethods): new utility function used to
19428 assemble the list of methods from running FindMembers.
19430 (MemberLookup): Rework FindMembers so that
19432 2001-12-16 Miguel de Icaza <miguel@ximian.com>
19434 * class.cs (TypeContainer): Remove Delegates who fail to be
19437 * delegate.cs (Populate): Verify that we dont get null return
19438 values. TODO: Check for AsAccessible.
19440 * cs-parser.jay: Use basename to emit error 574 (destructor should
19441 have the same name as container class), not the full name.
19443 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
19444 possible representation.
19446 Also implements integer type suffixes U and L.
19448 2001-12-15 Miguel de Icaza <miguel@ximian.com>
19450 * expression.cs (ArrayCreation.DoResolve): We need to do the
19451 argument resolution *always*.
19453 * decl.cs: Make this hold the namespace. Hold the root context as
19455 (LookupType): Move here.
19457 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
19459 * location.cs (Row, Name): Fixed the code, it was always returning
19460 references to the first file.
19462 * interface.cs: Register properties defined through interfaces.
19464 * driver.cs: Add support for globbing on the command line
19466 * class.cs (Field): Make it derive from MemberCore as well.
19469 2001-12-15 Ravi Pratap <ravi@ximian.com>
19471 * class.cs (Event::Define): Check that the type of the event is a delegate
19472 type else flag error #66.
19474 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
19477 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
19478 values of EntryPoint, CharSet etc etc.
19480 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
19482 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
19483 be null and we should ignore this. I am not sure if this is really clean. Apparently,
19484 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
19485 which needs this to do its work.
19487 * ../errors/cs0066.cs : Add.
19489 2001-12-14 Miguel de Icaza <miguel@ximian.com>
19491 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
19494 * class.cs: (MethodSignature.MethodSignature): Removed hack that
19495 clears out the parameters field.
19496 (MemberSignatureCompare): Cleanup
19498 (MemberCore): New base class used to share code between MethodCore
19501 (RegisterRequiredImplementations) BindingFlags.Public requires
19502 either BindingFlags.Instace or Static. Use instance here.
19504 (Property): Refactored code to cope better with the full spec.
19506 * parameter.cs (GetParameterInfo): Return an empty array instead
19509 * class.cs (Property): Abstract or extern properties have no bodies.
19511 * parameter.cs (GetParameterInfo): return a zero-sized array.
19513 * class.cs (TypeContainer.MethodModifiersValid): Move all the
19514 method modifier validation to the typecontainer so we can reuse
19515 this on properties.
19517 (MethodCore.ParameterTypes): return an empty sized array of types.
19519 (Property.Define): Test property modifier validity.
19521 Add tests for sealed/override too.
19523 (Method.Emit): abstract or extern methods have no bodies.
19525 2001-12-14 Ravi Pratap <ravi@ximian.com>
19527 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
19530 (Method::Define, ::Emit): Modify accordingly.
19532 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
19534 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
19536 * makefile: Pass in /unsafe.
19538 2001-12-13 Miguel de Icaza <miguel@ximian.com>
19540 * class.cs (MakeKey): Kill routine.
19542 * class.cs (TypeContainer.Define): Correctly define explicit
19543 method implementations (they require the full interface name plus
19546 * typemanager.cs: Deply the PtrHashtable here and stop using the
19547 lame keys. Things work so much better.
19549 This of course broke everyone who depended on `RegisterMethod' to
19550 do the `test for existance' test. This has to be done elsewhere.
19552 * support.cs (PtrHashtable): A hashtable that avoid comparing with
19553 the object stupid Equals method (because, that like fails all over
19554 the place). We still do not use it.
19556 * class.cs (TypeContainer.SetRequiredInterface,
19557 TypeContainer.RequireMethods): Killed these two routines and moved
19558 all the functionality to RegisterRequiredImplementations.
19560 (TypeContainer.RegisterRequiredImplementations): This routine now
19561 registers all the implementations required in an array for the
19562 interfaces and abstract methods. We use an array of structures
19563 which can be computed ahead of time to reduce memory usage and we
19564 also assume that lookups are cheap as most classes will not
19565 implement too many interfaces.
19567 We also avoid creating too many MethodSignatures.
19569 (TypeContainer.IsInterfaceMethod): Update and optionally does not
19570 clear the "pending" bit if we find that there are problems with
19573 (TypeContainer.VerifyPendingMethods): Update to report errors of
19574 methods that look like implementations but are not.
19576 (TypeContainer.Define): Add support for explicit interface method
19579 2001-12-12 Miguel de Icaza <miguel@ximian.com>
19581 * typemanager.cs: Keep track of the parameters here instead of
19582 being a feature of the TypeContainer.
19584 * class.cs: Drop the registration of parameters here, as
19585 InterfaceMethods are also interface declarations.
19587 * delegate.cs: Register methods with the TypeManager not only with
19588 the TypeContainer. This code was buggy.
19590 * interface.cs: Full registation here.
19592 2001-12-11 Miguel de Icaza <miguel@ximian.com>
19594 * expression.cs: Remove reducer for binary expressions, it can not
19597 * const.cs: Put here the code that used to go into constant.cs
19599 * constant.cs: Put here the code for constants, this is a new base
19600 class for Literals.
19602 * literal.cs: Make Literal derive from Constant.
19604 2001-12-09 Miguel de Icaza <miguel@ximian.com>
19606 * statement.cs (Return.Emit): Report error 157 if the user
19607 attempts to return from a finally block.
19609 (Return.Emit): Instead of emitting a return, jump to the end of
19612 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
19613 LocalBuilder to store the result of the function. ReturnLabel is
19614 the target where we jump.
19617 2001-12-09 Radek Doulik <rodo@ximian.com>
19619 * cs-parser.jay: remember alias in current namespace
19621 * ecore.cs (SimpleName::DoResolve): use aliases for types or
19624 * class.cs (LookupAlias): lookup alias in my_namespace
19626 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
19628 (LookupAlias): lookup alias in this and if needed in parent
19631 2001-12-08 Miguel de Icaza <miguel@ximian.com>
19635 * rootcontext.cs: (ModuleBuilder) Made static, first step into
19636 making things static. I need this to avoid passing the
19637 TypeContainer when calling ParameterType.
19639 * support.cs (InternalParameters.ParameterType): Remove ugly hack
19640 that did string manipulation to compute the type and then call
19641 GetType. Use Parameter.ParameterType instead.
19643 * cs-tokenizer.cs: Consume the suffix for floating values.
19645 * expression.cs (ParameterReference): figure out whether this is a
19646 reference parameter or not. Kill an extra variable by computing
19647 the arg_idx during emission.
19649 * parameter.cs (Parameters.GetParameterInfo): New overloaded
19650 function that returns whether a parameter is an out/ref value or not.
19652 (Parameter.ParameterType): The type of the parameter (base,
19653 without ref/out applied).
19655 (Parameter.Resolve): Perform resolution here.
19656 (Parameter.ExternalType): The full type (with ref/out applied).
19658 * statement.cs (Using.Emit, Using.EmitExpression): Implement
19659 support for expressions on the using statement.
19661 2001-12-07 Miguel de Icaza <miguel@ximian.com>
19663 * statement.cs (Using.EmitLocalVariableDecls): Split the
19664 localvariable handling of the using statement.
19666 (Block.EmitMeta): Keep track of variable count across blocks. We
19667 were reusing slots on separate branches of blocks.
19669 (Try.Emit): Emit the general code block, we were not emitting it.
19671 Check the type of the declaration to be an IDisposable or
19672 something that can be implicity converted to it.
19674 Emit conversions if required.
19676 * ecore.cs (EmptyExpression): New utility class.
19677 (Expression.ImplicitConversionExists): New utility function.
19679 2001-12-06 Miguel de Icaza <miguel@ximian.com>
19681 * statement.cs (Using): Implement.
19683 * expression.cs (LocalVariableReference): Support read only variables.
19685 * statement.cs: Remove the explicit emit for the Leave opcode.
19686 (VariableInfo): Add a readonly field.
19688 2001-12-05 Miguel de Icaza <miguel@ximian.com>
19690 * ecore.cs (ConvCast): new class used to encapsulate the various
19691 explicit integer conversions that works in both checked and
19692 unchecked contexts.
19694 (Expression.ConvertNumericExplicit): Use new ConvCast class to
19695 properly generate the overflow opcodes.
19697 2001-12-04 Miguel de Icaza <miguel@ximian.com>
19699 * statement.cs: The correct type for the EmptyExpression is the
19700 element_type, not the variable type. Ravi pointed this out.
19702 2001-12-04 Ravi Pratap <ravi@ximian.com>
19704 * class.cs (Method::Define): Handle PInvoke methods specially
19705 by using DefinePInvokeMethod instead of the usual one.
19707 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
19708 above to do the task of extracting information and defining the method.
19710 2001-12-04 Ravi Pratap <ravi@ximian.com>
19712 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
19713 of the condition for string type.
19715 (Emit): Move that here.
19717 (ArrayCreation::CheckIndices): Keep string literals in their expression
19720 (EmitDynamicInitializers): Handle strings appropriately.
19722 2001-12-04 Miguel de Icaza <miguel@ximian.com>
19724 * codegen.cs (EmitContext): Replace multiple variables with a
19725 single pointer to the current Switch statement.
19727 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
19730 2001-12-03 Miguel de Icaza <miguel@ximian.com>
19734 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
19737 (Foreach.Emit): Foreach on arrays was not setting
19738 up the loop variables (for break/continue).
19740 (GotoCase): Semi-implented.
19742 2001-12-03 Ravi Pratap <ravi@ximian.com>
19744 * attribute.cs (CheckAttribute): Handle system attributes by using
19745 Attribute.GetAttributes to examine information we need.
19747 (GetValidPlaces): Same here.
19749 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
19751 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
19753 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
19755 (Method::Define): Set appropriate flags if we have a DllImport attribute.
19757 (Method::Emit): Handle the case when we are a PInvoke method.
19759 2001-12-03 Miguel de Icaza <miguel@ximian.com>
19761 * expression.cs: Use ResolveWithSimpleName on compound names.
19763 2001-12-02 Ravi Pratap <ravi@ximian.com>
19765 * constant.cs (EmitConstant): Make sure we resolve the associated expression
19766 before trying to reduce it.
19768 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
19770 * constant.cs (LookupConstantValue): Implement.
19772 (EmitConstant): Use the above in emitting the constant.
19774 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
19775 that are user-defined by doing a LookupConstantValue on them.
19777 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
19780 2001-11-29 Miguel de Icaza <miguel@ximian.com>
19782 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
19784 (BaseAccess.DoResolve): Implement.
19786 (MemberAccess.DoResolve): Split this routine into a
19787 ResolveMemberAccess routine that can be used independently
19789 2001-11-28 Miguel de Icaza <miguel@ximian.com>
19791 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
19792 As that share bits of the implementation. Is returns a boolean,
19793 while As returns the Type that is being probed.
19795 2001-12-01 Ravi Pratap <ravi@ximian.com>
19797 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
19798 instead of a Literal - much easier.
19800 (EnumInTransit): Remove - utterly useless :-)
19802 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
19804 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
19806 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
19807 chain when we have no associated expression.
19809 2001-11-30 Ravi Pratap <ravi@ximian.com>
19811 * constant.cs (Define): Use Location while reporting the errror.
19813 Also emit a warning when 'new' is used and there is no inherited
19816 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
19819 (LookupEnumValue): Implement to lookup an enum member's value and define it
19822 (Populate): Re-write accordingly to use the above routine.
19824 2001-11-27 Miguel de Icaza <miguel@ximian.com>
19826 * expression.cs (This): Fix prototype for DoResolveLValue to
19827 override the base class DoResolveLValue.
19829 * cs-parser.cs: Report errors cs574 and cs575 (destructor
19832 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
19833 (we need to load the address of the field here). This fixes
19836 (FieldExpr.DoResolveLValue): Call the DoResolve
19837 function to initialize the Instance expression.
19839 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
19840 correctly the GetEnumerator operation on a value type.
19842 * cs-parser.jay: Add more simple parsing error catches.
19844 * statement.cs (Switch): Add support for string switches.
19845 Handle null specially.
19847 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
19849 2001-11-28 Ravi Pratap <ravi@ximian.com>
19851 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
19853 (declare_local_constant): New helper function.
19855 * statement.cs (AddConstant): Keep a separate record of constants
19857 (IsConstant): Implement to determine if a variable is a constant.
19859 (GetConstantExpression): Implement.
19861 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
19863 * statement.cs (IsVariableDefined): Re-write.
19865 2001-11-27 Ravi Pratap <ravi@ximian.com>
19867 * class.cs (TypeContainer::FindMembers): Look for constants
19868 in the case when we are looking for MemberTypes.Field
19870 * expression.cs (MemberAccess::DoResolve): Check that in the
19871 case we are a FieldExpr and a Literal, we are not being accessed
19872 by an instance reference.
19874 * cs-parser.jay (local_constant_declaration): Implement.
19876 (declaration_statement): Implement for constant declarations.
19878 2001-11-26 Miguel de Icaza <miguel@ximian.com>
19880 * statement.cs (Switch): Catch double defaults.
19882 (Switch): More work on the switch() statement
19883 implementation. It works for integral values now, need to finish
19887 2001-11-24 Miguel de Icaza <miguel@ximian.com>
19889 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
19890 integer literals into other integer literals. To be used by
19893 2001-11-24 Ravi Pratap <ravi@ximian.com>
19895 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
19898 (EmitDynamicInitializers): Cope with the above since we extract data
19899 directly from ArrayData now.
19901 (ExpectInitializers): Keep track of whether initializers are mandatory
19904 (Bounds): Make it a hashtable to prevent the same dimension being
19905 recorded for every element in that dimension.
19907 (EmitDynamicInitializers): Fix bug which prevented the Set array method
19910 Also fix bug which was causing the indices to be emitted in the reverse
19913 2001-11-24 Miguel de Icaza <miguel@ximian.com>
19915 * expression.cs (ArrayCreation): Implement the bits that Ravi left
19916 unfinished. They do not work, because the underlying code is
19919 2001-11-22 Miguel de Icaza <miguel@ximian.com>
19921 * cs-parser.jay: Remove bogus fixme.
19923 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
19924 on Switch statement.
19926 2001-11-23 Ravi Pratap <ravi@ximian.com>
19928 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
19931 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
19932 parameter. Apparently, any expression is allowed.
19934 (ValidateInitializers): Update accordingly.
19936 (CheckIndices): Fix some tricky bugs thanks to recursion.
19938 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
19939 I was being completely brain-dead.
19941 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
19942 and re-write acordingly.
19944 (DelegateInvocation): Re-write accordingly.
19946 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
19948 (MakeByteBlob): Handle types more correctly.
19950 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
19951 initialization from expressions but it is incomplete because I am a complete
19954 2001-11-22 Miguel de Icaza <miguel@ximian.com>
19956 * statement.cs (If.Emit): Fix a bug that generated incorrect code
19957 on If. Basically, we have to return `true' (ie, we do return to
19958 our caller) only if both branches of the if return.
19960 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
19961 short-circuit operators, handle them as short circuit operators.
19963 (Cast.DoResolve): Resolve type.
19964 (Cast.Cast): Take an expression as the target type.
19966 * cs-parser.jay (cast_expression): Remove old hack that only
19967 allowed a limited set of types to be handled. Now we take a
19968 unary_expression and we resolve to a type during semantic
19971 Use the grammar productions from Rhys to handle casts (this is
19972 not complete like Rhys syntax yet, we fail to handle that corner
19973 case that C# has regarding (-x), but we will get there.
19975 2001-11-22 Ravi Pratap <ravi@ximian.com>
19977 * class.cs (EmitFieldInitializer): Take care of the case when we have a
19978 field which is an array type.
19980 * cs-parser.jay (declare_local_variables): Support array initialization too.
19982 * typemanager.cs (MakeKey): Implement.
19984 (everywhere): Use the above appropriately.
19986 * cs-parser.jay (for_statement): Update for array initialization while
19987 declaring variables.
19989 * ecore.cs : The error message was correct, it's the variable's names that
19990 were misleading ;-) Make the code more readable.
19992 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
19993 the correct type etc.
19995 (ConvertExplicit): Handle Enum types by examining the underlying type.
19997 2001-11-21 Ravi Pratap <ravi@ximian.com>
19999 * parameter.cs (GetCallingConvention): Always return
20000 CallingConventions.Standard for now.
20002 2001-11-22 Miguel de Icaza <miguel@ximian.com>
20004 * expression.cs (Binary.ResolveOperator): Update the values of `l'
20005 and `r' after calling DoNumericPromotions.
20007 * ecore.cs: Fix error message (the types were in the wrong order).
20009 * statement.cs (Foreach.ProbeCollectionType): Need to pass
20010 BindingFlags.Instance as well
20012 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
20013 implicit int literal conversion in an empty cast so that we
20014 propagate the right type upstream.
20016 (UnboxCast): new class used to unbox value types.
20017 (Expression.ConvertExplicit): Add explicit type conversions done
20020 (Expression.ImplicitNumericConversion): Oops, forgot to test for
20021 the target type before applying the implicit LongLiterals to ULong
20024 2001-11-21 Miguel de Icaza <miguel@ximian.com>
20026 * cs-parser.jay (for_statement): Reworked the way For works: now
20027 we declare manually any variables that are introduced in
20028 for_initializer to solve the problem of having out-of-band code
20029 emition (that is what got for broken).
20031 (declaration_statement): Perform the actual variable declaration
20032 that used to be done in local_variable_declaration here.
20034 (local_variable_declaration): Do not declare anything, just pass
20035 the information on a DictionaryEntry
20037 2001-11-20 Ravi Pratap <ravi@ximian.com>
20039 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
20040 re-write of the logic to now make it recursive.
20042 (UpdateIndices): Re-write accordingly.
20044 Store element data in a separate ArrayData list in the above methods.
20046 (MakeByteBlob): Implement to dump the array data into a byte array.
20048 2001-11-19 Ravi Pratap <ravi@ximian.com>
20050 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
20053 * constant.cs (Define): Implement.
20055 (EmitConstant): Re-write fully.
20057 Pass in location info.
20059 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
20062 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
20063 DictionaryEntry since we need location info too.
20065 (constant_declaration): Update accordingly.
20067 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
20068 code into another method : UpdateIndices.
20070 2001-11-18 Ravi Pratap <ravi@ximian.com>
20072 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
20073 some type checking etc.
20075 2001-11-17 Ravi Pratap <ravi@ximian.com>
20077 * expression.cs (ArrayCreation::ValidateInitializers): Implement
20078 bits to provide dimension info if the user skips doing that.
20080 Update second constructor to store the rank correctly.
20082 2001-11-16 Ravi Pratap <ravi@ximian.com>
20084 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
20085 and try to implement.
20087 * ../errors/cs0150.cs : Add.
20089 * ../errors/cs0178.cs : Add.
20091 2001-11-16 Miguel de Icaza <miguel@ximian.com>
20093 * statement.cs: Implement foreach on multi-dimensional arrays.
20095 * parameter.cs (Parameters.GetParameterByName): Also lookup the
20096 name of the params argument.
20098 * expression.cs: Use EmitStoreOpcode to get the right opcode while
20099 initializing the array.
20101 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
20102 we can use this elsewhere.
20104 * statement.cs: Finish implementation of foreach for single
20107 * cs-parser.jay: Use an out-of-band stack to pass information
20108 around, I wonder why I need this.
20110 foreach_block: Make the new foreach_block the current_block.
20112 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
20113 function used to return a static Parameters structure. Used for
20114 empty parameters, as those are created very frequently.
20116 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
20118 2001-11-15 Ravi Pratap <ravi@ximian.com>
20120 * interface.cs : Default modifier is private, not public. The
20121 make verify test passes again.
20123 2001-11-15 Ravi Pratap <ravi@ximian.com>
20125 * support.cs (ReflectionParameters): Fix logic to determine
20126 whether the last parameter is a params one. Test 9 passes again.
20128 * delegate.cs (Populate): Register the builders we define with
20129 RegisterParameterForBuilder. Test 19 passes again.
20131 * cs-parser.jay (property_declaration): Reference $6 instead
20132 of $$ to get at the location.
20134 (indexer_declaration): Similar stuff.
20136 (attribute): Ditto.
20138 * class.cs (Property): Register parameters for the Get and Set methods
20139 if they exist. Test 23 passes again.
20141 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
20142 call to EmitArguments as we are sure there aren't any params arguments.
20143 Test 32 passes again.
20145 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
20146 IndexOutOfRangeException.
20148 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
20149 Test 33 now passes again.
20151 2001-11-15 Miguel de Icaza <miguel@ximian.com>
20153 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
20154 broke a bunch of things. Will have to come up with a better way
20155 of tracking locations.
20157 * statement.cs: Implemented foreach for single dimension arrays.
20159 2001-11-09 Miguel de Icaza <miguel@ximian.com>
20161 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
20162 an error. This removes the lookup from the critical path.
20164 * cs-parser.jay: Removed use of temporary_loc, which is completely
20167 2001-11-14 Miguel de Icaza <miguel@ximian.com>
20169 * support.cs (ReflectionParameters.ParameterModifier): Report
20170 whether the argument is a PARAMS argument or not.
20172 * class.cs: Set the attribute `ParamArrayAttribute' on the
20173 parameter argument.
20175 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
20176 and cons_param_array_attribute (ConstructorInfo for
20177 ParamArrayAttribute).,
20179 * codegen.cs: Emit the return using the `Return' statement, that
20180 way we can report the error correctly for missing return values.
20182 * class.cs (Method.Emit): Clean up.
20184 * expression.cs (Argument.Resolve): Take another argument: the
20185 location where this argument is used. Notice that this is not
20186 part of the "Argument" class as to reduce the size of the
20187 structure (we know the approximate location anyways).
20189 Test if the argument is a variable-reference, if not, then
20190 complain with a 206.
20192 (Argument.Emit): Emit addresses of variables.
20194 (Argument.FullDesc): Simplify.
20196 (Invocation.DoResolve): Update for Argument.Resolve.
20198 (ElementAccess.DoResolve): ditto.
20200 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
20201 method should be virtual, as this method is always virtual.
20203 (NewDelegate.DoResolve): Update for Argument.Resolve.
20205 * class.cs (ConstructorInitializer.DoResolve): ditto.
20207 * attribute.cs (Attribute.Resolve): ditto.
20209 2001-11-13 Miguel de Icaza <miguel@ximian.com>
20211 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
20213 * expression.cs (ParameterReference): Drop IStackStorage and implement
20214 IAssignMethod instead.
20216 (LocalVariableReference): ditto.
20218 * ecore.cs (FieldExpr): Drop IStackStorage and implement
20219 IAssignMethod instead.
20221 2001-11-13 Miguel de Icaza <miguel@ximian.com>
20223 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
20224 enumerations that are used in heavily used structures derive from
20225 byte in a laughable and pathetic attempt to reduce memory usage.
20226 This is the kind of pre-optimzations that you should not do at
20227 home without adult supervision.
20229 * expression.cs (UnaryMutator): New class, used to handle ++ and
20230 -- separatedly from the other unary operators. Cleans up the
20231 code, and kills the ExpressionStatement dependency in Unary.
20233 (Unary): Removed `method' and `Arguments' from this class, making
20234 it smaller, and moving it all to SimpleCall, so I can reuse this
20235 code in other locations and avoid creating a lot of transient data
20236 strucutres when not required.
20238 * cs-parser.jay: Adjust for new changes.
20240 2001-11-11 Miguel de Icaza <miguel@ximian.com>
20242 * enum.cs (Enum.Populate): If there is a failure during
20245 * cs-parser.jay (opt_enum_base): we used to catch type errors
20246 here, but this is really incorrect. The type error should be
20247 catched during semantic analysis.
20249 2001-12-11 Ravi Pratap <ravi@ximian.com>
20251 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
20252 current_local_parameters as expected since I, in my stupidity, had forgotten
20255 * attribute.cs (GetValidPlaces): Fix stupid bug.
20257 * class.cs (Method::Emit): Perform check on applicability of attributes.
20259 (Constructor::Emit): Ditto.
20261 (Field::Emit): Ditto.
20263 (Field.Location): Store location information.
20265 (Property, Event, Indexer, Operator): Ditto.
20267 * cs-parser.jay (field_declaration): Pass in location for each field.
20269 * ../errors/cs0592.cs : Add.
20271 2001-11-12 Ravi Pratap <ravi@ximian.com>
20273 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
20275 (InitCoreTypes): Update accordingly.
20277 (RegisterAttrType, LookupAttr): Implement.
20279 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
20280 info about the same.
20282 (Resolve): Update to populate the above as necessary.
20284 (Error592): Helper.
20286 (GetValidPlaces): Helper to the above.
20288 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
20290 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
20292 2001-11-12 Ravi Pratap <ravi@ximian.com>
20294 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
20296 * ../errors/cs0617.cs : Add.
20298 2001-11-11 Ravi Pratap <ravi@ximian.com>
20300 * enum.cs (Emit): Rename to Populate to be more consistent with what
20301 we expect it to do and when exactly it is called.
20303 * class.cs, rootcontext.cs : Update accordingly.
20305 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
20306 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
20308 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
20310 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
20311 of a fieldinfo using the above, when dealing with a FieldBuilder.
20313 2001-11-10 Ravi Pratap <ravi@ximian.com>
20315 * ../errors/cs0031.cs : Add.
20317 * ../errors/cs1008.cs : Add.
20319 * ../errrors/cs0543.cs : Add.
20321 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
20324 (FindMembers): Implement.
20326 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
20327 enums and delegates too.
20329 (enum_types): Rename to builder_to_enum.
20331 (delegate_types): Rename to builder_to_delegate.
20333 * delegate.cs (FindMembers): Implement.
20335 2001-11-09 Ravi Pratap <ravi@ximian.com>
20337 * typemanager.cs (IsEnumType): Implement.
20339 * enum.cs (Emit): Re-write parts to account for the underlying type
20340 better and perform checking etc.
20342 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
20343 of the underlying type.
20345 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
20348 * enum.cs (error31): Helper to report error #31.
20350 * cs-parser.jay (enum_declaration): Store location of each member too.
20352 * enum.cs (member_to_location): New hashtable.
20354 (AddEnumMember): Update location hashtable.
20356 (Emit): Use the location of each member while reporting errors.
20358 2001-11-09 Miguel de Icaza <miguel@ximian.com>
20360 * cs-parser.jay: A for_initializer if is a
20361 local_variable_declaration really ammount to have an implicit
20362 block with the variable declaration and no initializer for for.
20364 * statement.cs (For.Emit): Cope with null initializers.
20366 This fixes the infinite loop on for initializers.
20368 2001-11-08 Miguel de Icaza <miguel@ximian.com>
20370 * enum.cs: More cleanup.
20372 * ecore.cs: Remove dead code.
20374 * class.cs (Property.Emit): More simplification.
20375 (Event.Emit): ditto.
20377 Reworked to have less levels of indentation.
20379 2001-11-08 Ravi Pratap <ravi@ximian.com>
20381 * class.cs (Property): Emit attributes.
20391 * enum.cs (Emit): Ditto.
20393 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
20396 * class.cs (Field, Event, etc.): Move attribute generation into the
20397 Emit method everywhere.
20399 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
20400 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
20401 as we had no way of defining nested enums !
20403 * rootcontext.cs : Adjust code accordingly.
20405 * typemanager.cs (AddEnumType): To keep track of enum types separately.
20407 2001-11-07 Ravi Pratap <ravi@ximian.com>
20409 * expression.cs (EvalConstantExpression): Move into ecore.cs
20411 * enum.cs (Enum): Rename some members and make them public and readonly
20412 according to our convention.
20414 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
20417 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
20419 (Enum::Emit): Write a simple version for now which doesn't try to compute
20420 expressions. I shall modify this to be more robust in just a while.
20422 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
20424 (TypeContainer::CloseType): Create the Enum types too.
20426 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
20428 * expression.cs (EvalConstantExpression): Get rid of completely.
20430 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
20431 user-defined values and other cases.
20433 (IsValidEnumLiteral): Helper function.
20435 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
20436 out there in the case we had a literal FieldExpr.
20438 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
20440 (Literalize): Revamp a bit to take two arguments.
20442 (EnumLiteral): New class which derives from Literal to wrap enum literals.
20444 2001-11-06 Ravi Pratap <ravi@ximian.com>
20446 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
20448 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
20450 (Resolve): Use the above to ensure we have proper initializers.
20452 2001-11-05 Ravi Pratap <ravi@ximian.com>
20454 * expression.cs (Expression::EvalConstantExpression): New method to
20455 evaluate constant expressions.
20457 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
20459 2001-11-07 Miguel de Icaza <miguel@ximian.com>
20461 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
20464 (Binary.ResolveOperator): Handle operator != (object a, object b)
20465 and operator == (object a, object b);
20467 (Binary.DoNumericPromotions): Indicate whether the numeric
20468 promotion was possible.
20470 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
20473 Made the ArrayAccess implement interface IAssignMethod instead of
20474 IStackStore as the order in which arguments are passed reflects
20477 * assign.cs: Instead of using expr.ExprClass to select the way of
20478 assinging, probe for the IStackStore/IAssignMethod interfaces.
20480 * typemanager.cs: Load InitializeArray definition.
20482 * rootcontext.cs (RootContext.MakeStaticData): Used to define
20483 static data that can be used to initialize arrays.
20485 2001-11-05 Miguel de Icaza <miguel@ximian.com>
20487 * expression.cs: Handle operator== and operator!= for booleans.
20489 (Conditioal.Reduce): Implement reducer for the ?: operator.
20491 (Conditional.Resolve): Implement dead code elimination.
20493 (Binary.Resolve): Catch string literals and return a new
20494 concatenated string.
20496 (Unary.Reduce): Implement reduction of unary expressions.
20498 * ecore.cs: Split out the expression core handling here.
20500 (Expression.Reduce): New method used to perform constant folding
20501 and CSE. This is needed to support constant-expressions.
20503 * statement.cs (Statement.EmitBoolExpression): Pass true and false
20504 targets, and optimize for !x.
20506 2001-11-04 Ravi Pratap <ravi@ximian.com>
20508 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
20509 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
20510 set custom atttributes.
20512 * literal.cs (Literal::GetValue): New abstract method to return the actual
20513 value of the literal, cast as an object.
20515 (*Literal): Implement GetValue method.
20517 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
20518 expressions to the arraylist but objects of type Argument.
20520 * class.cs (TypeContainer::Emit): Emit our attributes too.
20522 (Method::Emit, Constructor::Emit): Ditto.
20524 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
20525 to be ignoring earlier.
20527 2001-11-03 Ravi Pratap <ravi@ximian.com>
20529 * attribute.cs (AttributeSection::Define): Implement to do the business
20530 of constructing a CustomAttributeBuilder.
20532 (Attribute): New trivial class. Increases readability of code.
20534 * cs-parser.jay : Update accordingly.
20536 (positional_argument_list, named_argument_list, named_argument): New rules
20538 (attribute_arguments): Use the above so that we are more correct.
20540 2001-11-02 Ravi Pratap <ravi@ximian.com>
20542 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
20543 to perform all checks for a method with a params parameter.
20545 (Invocation::OverloadResolve): Update to use the above method and therefore
20546 cope correctly with params method invocations.
20548 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
20551 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
20552 constructors in our parent too because we can't afford to miss out on
20555 * attribute.cs (AttributeSection): New name for the class Attribute
20557 Other trivial changes to improve readability.
20559 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
20560 use the new class names.
20562 2001-11-01 Ravi Pratap <ravi@ximian.com>
20564 * class.cs (Method::Define): Complete definition for params types too
20566 (Indexer::Define): Ditto.
20568 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
20569 Cope everywhere with a request for info about the array parameter.
20571 2001-11-01 Ravi Pratap <ravi@ximian.com>
20573 * tree.cs (RecordNamespace): Fix up to check for the correct key.
20575 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
20576 local_variable_type to extract the string corresponding to the type.
20578 (local_variable_type): Fixup the action to use the new helper method.
20580 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
20583 * expression.cs : Clean out code which uses the above.
20585 2001-10-31 Ravi Pratap <ravi@ximian.com>
20587 * typemanager.cs (RegisterMethod): Check if we already have an existing key
20588 and bale out if necessary by returning a false.
20590 (RegisterProperty): Ditto.
20592 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
20593 and print out appropriate error messages.
20595 * interface.cs (everywhere): Ditto.
20597 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
20598 location to constructor.
20600 * class.cs (Property, Event, Indexer): Update accordingly.
20602 * ../errors/cs111.cs : Added.
20604 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
20605 of a method, as laid down by the spec.
20607 (Invocation::OverloadResolve): Use the above method.
20609 2001-10-31 Ravi Pratap <ravi@ximian.com>
20611 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
20612 now take a TypeContainer and a Parameters object.
20614 (ParameterData): Modify return type of ParameterModifier method to be
20615 Parameter.Modifier and not a string.
20617 (ReflectionParameters, InternalParameters): Update accordingly.
20619 * expression.cs (Argument::GetParameterModifier): Same here.
20621 * support.cs (InternalParameters::ParameterType): Find a better way of determining
20622 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
20623 symbol in it at all so maybe this is only for now.
20625 2001-10-30 Ravi Pratap <ravi@ximian.com>
20627 * support.cs (InternalParameters): Constructor now takes an extra argument
20628 which is the actual Parameters class.
20630 (ParameterDesc): Update to provide info on ref/out modifiers.
20632 * class.cs (everywhere): Update call to InternalParameters to pass in
20633 the second argument too.
20635 * support.cs (ParameterData): Add ParameterModifier, which is a method
20636 to return the modifier info [ref/out etc]
20638 (InternalParameters, ReflectionParameters): Implement the above.
20640 * expression.cs (Argument::ParameterModifier): Similar function to return
20641 info about the argument's modifiers.
20643 (Invocation::OverloadResolve): Update to take into account matching modifiers
20646 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
20647 a new SetFormalParameters object which we pass to InternalParameters.
20649 2001-10-30 Ravi Pratap <ravi@ximian.com>
20651 * expression.cs (NewArray): Merge into the ArrayCreation class.
20653 2001-10-29 Ravi Pratap <ravi@ximian.com>
20655 * expression.cs (NewArray): Merge classes NewBuiltinArray and
20656 NewUserdefinedArray into one as there wasn't much of a use in having
20659 * expression.cs (Argument): Change field's name to ArgType from Type.
20661 (Type): New readonly property which returns the proper type, taking into
20662 account ref/out modifiers.
20664 (everywhere): Adjust code accordingly for the above.
20666 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
20667 whether we are emitting for a ref or out parameter.
20669 * expression.cs (Argument::Emit): Use the above field to set the state.
20671 (LocalVariableReference::Emit): Update to honour the flag and emit the
20674 * parameter.cs (Attributes): Set the correct flags for ref parameters.
20676 * expression.cs (Argument::FullDesc): New function to provide a full desc.
20678 * support.cs (ParameterData): Add method ParameterDesc to the interface.
20680 (ReflectionParameters, InternalParameters): Implement the above method.
20682 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
20685 (Invocation::FullMethodDesc): Ditto.
20687 2001-10-29 Miguel de Icaza <miguel@ximian.com>
20689 * cs-parser.jay: Add extra production for the second form of array
20692 * expression.cs (ArrayCreation): Update to reflect the above
20695 * Small changes to prepare for Array initialization.
20697 2001-10-28 Miguel de Icaza <miguel@ximian.com>
20699 * typemanager.cs (ImplementsInterface): interface might be null;
20700 Deal with this problem;
20702 Also, we do store negative hits on the cache (null values), so use
20703 this instead of calling t.GetInterfaces on the type everytime.
20705 2001-10-28 Ravi Pratap <ravi@ximian.com>
20707 * typemanager.cs (IsBuiltinType): New method to help determine the same.
20709 * expression.cs (New::DoResolve): Get rid of array creation code and instead
20710 split functionality out into different classes.
20712 (New::FormArrayType): Move into NewBuiltinArray.
20714 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
20717 (NewBuiltinArray): New class to handle creation of built-in arrays.
20719 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
20720 account creation of one-dimensional arrays.
20722 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
20724 (NewUserdefinedArray::DoResolve): Implement.
20726 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
20728 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
20729 we maintain inside the TypeManager. This is necessary to perform lookups on the
20732 (LookupType): Update to perform GetType on the module builders too.
20734 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
20736 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
20738 2001-10-23 Ravi Pratap <ravi@ximian.com>
20740 * expression.cs (New::DoResolve): Implement guts of array creation.
20742 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
20744 2001-10-27 Miguel de Icaza <miguel@ximian.com>
20746 * expression.cs: Fix bug I introduced lsat night that broke
20749 (Expression.Resolve): Report a 246 error (can not resolve name)
20750 if we find a SimpleName in the stream.
20752 (Expression.ResolveLValue): Ditto.
20754 (Expression.ResolveWithSimpleName): This function is a variant of
20755 ResolveName, this one allows SimpleNames to be returned without a
20756 warning. The only consumer of SimpleNames is MemberAccess
20758 2001-10-26 Miguel de Icaza <miguel@ximian.com>
20760 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
20761 might arrive here. I have my doubts that this is correct.
20763 * statement.cs (Lock): Implement lock statement.
20765 * cs-parser.jay: Small fixes to support `lock' and `using'
20767 * cs-tokenizer.cs: Remove extra space
20769 * driver.cs: New flag --checked, allows to turn on integer math
20772 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
20773 Threading.Monitor.Exit
20775 2001-10-23 Miguel de Icaza <miguel@ximian.com>
20777 * expression.cs (IndexerAccess::DoResolveLValue): Set the
20778 Expression Class to be IndexerAccess.
20780 Notice that Indexer::DoResolve sets the eclass to Value.
20782 2001-10-22 Miguel de Icaza <miguel@ximian.com>
20784 * class.cs (TypeContainer::Emit): Emit code for indexers.
20786 * assign.cs (IAssignMethod): New interface implemented by Indexers
20787 and Properties for handling assignment.
20789 (Assign::Emit): Simplify and reuse code.
20791 * expression.cs (IndexerAccess, PropertyExpr): Implement
20792 IAssignMethod, clean up old code.
20794 2001-10-22 Ravi Pratap <ravi@ximian.com>
20796 * typemanager.cs (ImplementsInterface): New method to determine if a type
20797 implements a given interface. Provides a nice cache too.
20799 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
20802 (ConvertReferenceExplicit): Ditto.
20804 * delegate.cs (Delegate::Populate): Update to define the parameters on the
20805 various methods, with correct names etc.
20807 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
20808 Operator.UnaryNegation.
20810 * cs-parser.jay (operator_declarator): Be a little clever in the case where
20811 we have a unary plus or minus operator.
20813 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
20816 * everywhere : update accordingly.
20818 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
20821 * class.cs (Method::Define): For the case where we are implementing a method
20822 inherited from an interface, we need to set the MethodAttributes.Final flag too.
20823 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
20825 2001-10-21 Ravi Pratap <ravi@ximian.com>
20827 * interface.cs (FindMembers): Implement to work around S.R.E
20830 * typemanager.cs (IsInterfaceType): Implement.
20832 (FindMembers): Update to handle interface types too.
20834 * expression.cs (ImplicitReferenceConversion): Re-write bits which
20835 use IsAssignableFrom as that is not correct - it doesn't work.
20837 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
20838 and accordingly override EmitStatement.
20840 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
20841 using the correct logic :-)
20843 2001-10-19 Ravi Pratap <ravi@ximian.com>
20845 * ../errors/cs-11.cs : Add to demonstrate error -11
20847 2001-10-17 Miguel de Icaza <miguel@ximian.com>
20849 * assign.cs (Assign::Resolve): Resolve right hand side first, and
20850 then pass this as a hint to ResolveLValue.
20852 * expression.cs (FieldExpr): Add Location information
20854 (FieldExpr::LValueResolve): Report assignment to readonly
20857 (Expression::ExprClassFromMemberInfo): Pass location information.
20859 (Expression::ResolveLValue): Add new method that resolves an
20862 (Expression::DoResolveLValue): Default invocation calls
20865 (Indexers): New class used to keep track of indexers in a given
20868 (IStackStore): Renamed from LValue, as it did not really describe
20869 what this did. Also ResolveLValue is gone from this interface and
20870 now is part of Expression.
20872 (ElementAccess): Depending on the element access type
20874 * typemanager.cs: Add `indexer_name_type' as a Core type
20875 (System.Runtime.CompilerServices.IndexerNameAttribute)
20877 * statement.cs (Goto): Take a location.
20879 2001-10-18 Ravi Pratap <ravi@ximian.com>
20881 * delegate.cs (Delegate::VerifyDelegate): New method to verify
20882 if two delegates are compatible.
20884 (NewDelegate::DoResolve): Update to take care of the case when
20885 we instantiate a delegate from another delegate.
20887 * typemanager.cs (FindMembers): Don't even try to look up members
20888 of Delegate types for now.
20890 2001-10-18 Ravi Pratap <ravi@ximian.com>
20892 * delegate.cs (NewDelegate): New class to take care of delegate
20895 * expression.cs (New): Split the delegate related code out into
20896 the NewDelegate class.
20898 * delegate.cs (DelegateInvocation): New class to handle delegate
20901 * expression.cs (Invocation): Split out delegate related code into
20902 the DelegateInvocation class.
20904 2001-10-17 Ravi Pratap <ravi@ximian.com>
20906 * expression.cs (New::DoResolve): Implement delegate creation fully
20907 and according to the spec.
20909 (New::DoEmit): Update to handle delegates differently.
20911 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
20912 because of which we were printing out arguments in reverse order !
20914 * delegate.cs (VerifyMethod): Implement to check if the given method
20915 matches the delegate.
20917 (FullDelegateDesc): Implement.
20919 (VerifyApplicability): Implement.
20921 * expression.cs (Invocation::DoResolve): Update to accordingly handle
20922 delegate invocations too.
20924 (Invocation::Emit): Ditto.
20926 * ../errors/cs1593.cs : Added.
20928 * ../errors/cs1594.cs : Added.
20930 * delegate.cs (InstanceExpression, TargetMethod): New properties.
20932 2001-10-16 Ravi Pratap <ravi@ximian.com>
20934 * typemanager.cs (intptr_type): Core type for System.IntPtr
20936 (InitCoreTypes): Update for the same.
20938 (iasyncresult_type, asynccallback_type): Ditto.
20940 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
20943 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
20946 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
20947 the builders for the 4 members of a delegate type :-)
20949 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
20952 * expression.cs (New::DoResolve): Implement guts for delegate creation.
20954 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
20956 2001-10-15 Miguel de Icaza <miguel@ximian.com>
20958 * statement.cs (Break::Emit): Implement.
20959 (Continue::Emit): Implement.
20961 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
20962 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
20963 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
20964 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
20967 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
20968 properties that track the label for the current loop (begin of the
20969 loop and end of the loop).
20971 2001-10-15 Ravi Pratap <ravi@ximian.com>
20973 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
20974 use of emitting anything at all.
20976 * class.cs, rootcontext.cs : Get rid of calls to the same.
20978 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
20980 (Populate): Define the constructor correctly and set the implementation
20983 * typemanager.cs (delegate_types): New hashtable to hold delegates that
20986 (AddDelegateType): Implement.
20988 (IsDelegateType): Implement helper method.
20990 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
20992 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
20993 and accordingly handle it.
20995 * delegate.cs (Populate): Take TypeContainer argument.
20996 Implement bits to define the Invoke method. However, I still haven't figured out
20997 how to take care of the native int bit :-(
20999 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
21000 Qualify the name of the delegate, not its return type !
21002 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
21005 (StandardConversionExists): Checking for array types turns out to be recursive.
21007 (ConvertReferenceExplicit): Implement array conversion.
21009 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
21011 2001-10-12 Ravi Pratap <ravi@ximian.com>
21013 * cs-parser.jay (delegate_declaration): Store the fully qualified
21014 name as it is a type declaration.
21016 * delegate.cs (ReturnType, Name): Rename members to these. Make them
21019 (DefineDelegate): Renamed from Define. Does the same thing essentially,
21020 as TypeContainer::DefineType.
21022 (Populate): Method in which all the definition of the various methods (Invoke)
21025 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
21028 (CloseDelegate): Finally creates the delegate.
21030 * class.cs (TypeContainer::DefineType): Update to define delegates.
21031 (Populate, Emit and CloseType): Do the same thing here too.
21033 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
21034 delegates in all these operations.
21036 2001-10-14 Miguel de Icaza <miguel@ximian.com>
21038 * expression.cs: LocalTemporary: a new expression used to
21039 reference a temporary that has been created.
21041 * assign.cs: Handle PropertyAccess back here, so that we can
21042 provide the proper semantic access to properties.
21044 * expression.cs (Expression::ConvertReferenceExplicit): Implement
21045 a few more explicit conversions.
21047 * modifiers.cs: `NEW' modifier maps to HideBySig.
21049 * expression.cs (PropertyExpr): Make this into an
21050 ExpressionStatement, and support the EmitStatement code path.
21052 Perform get/set error checking, clean up the interface.
21054 * assign.cs: recognize PropertyExprs as targets, and if so, turn
21055 them into toplevel access objects.
21057 2001-10-12 Miguel de Icaza <miguel@ximian.com>
21059 * expression.cs: PropertyExpr::PropertyExpr: use work around the
21062 * typemanager.cs: Keep track here of our PropertyBuilders again to
21063 work around lameness in SRE.
21065 2001-10-11 Miguel de Icaza <miguel@ximian.com>
21067 * expression.cs (LValue::LValueResolve): New method in the
21068 interface, used to perform a second resolution pass for LValues.
21070 (This::DoResolve): Catch the use of this in static methods.
21072 (This::LValueResolve): Implement.
21074 (This::Store): Remove warning, assigning to `this' in structures
21077 (Invocation::Emit): Deal with invocation of
21078 methods on value types. We need to pass the address to structure
21079 methods rather than the object itself. (The equivalent code to
21080 emit "this" for structures leaves the entire structure on the
21081 stack instead of a pointer to it).
21083 (ParameterReference::DoResolve): Compute the real index for the
21084 argument based on whether the method takes or not a `this' pointer
21085 (ie, the method is static).
21087 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
21088 value types returned from functions when we need to invoke a
21089 method on the sturcture.
21092 2001-10-11 Ravi Pratap <ravi@ximian.com>
21094 * class.cs (TypeContainer::DefineType): Method to actually do the business of
21095 defining the type in the Modulebuilder or Typebuilder. This is to take
21096 care of nested types which need to be defined on the TypeBuilder using
21097 DefineNestedMethod.
21099 (TypeContainer::GetClassBases): Implement. Essentially the code from the
21100 methods in RootContext, only ported to be part of TypeContainer.
21102 (TypeContainer::GetInterfaceOrClass): Ditto.
21104 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
21106 * interface.cs (Interface::DefineInterface): New method. Does exactly
21107 what RootContext.CreateInterface did earlier, only it takes care of nested types
21110 (Interface::GetInterfaces): Move from RootContext here and port.
21112 (Interface::GetInterfaceByName): Same here.
21114 * rootcontext.cs (ResolveTree): Re-write.
21116 (PopulateTypes): Re-write.
21118 * class.cs (TypeContainer::Populate): Populate nested types too.
21119 (TypeContainer::Emit): Emit nested members too.
21121 * typemanager.cs (AddUserType): Do not make use of the FullName property,
21122 instead just use the name argument passed in as it is already fully
21125 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
21126 to TypeContainer mapping to see if a type is user-defined.
21128 * class.cs (TypeContainer::CloseType): Implement.
21130 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
21131 the default constructor.
21133 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
21136 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
21138 * interface.cs (CloseType): Create the type here.
21140 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
21143 Remove all the methods which are now in TypeContainer.
21145 2001-10-10 Ravi Pratap <ravi@ximian.com>
21147 * delegate.cs (Define): Re-write bits to define the delegate
21150 2001-10-10 Miguel de Icaza <miguel@ximian.com>
21152 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
21154 * expression.cs (ImplicitReferenceConversion): handle null as well
21155 as a source to convert to any reference type.
21157 * statement.cs (Return): Perform any implicit conversions to
21158 expected return type.
21160 Validate use of return statement.
21162 * codegen.cs (EmitContext): Pass the expected return type here.
21164 * class.cs (Method, Constructor, Property): Pass expected return
21165 type to EmitContext.
21167 2001-10-09 Miguel de Icaza <miguel@ximian.com>
21169 * expression.cs: Make DoResolve take an EmitContext instead of a
21172 Replaced `l' and `location' for `loc', for consistency.
21174 (Error, Warning): Remove unneeded Tc argument.
21176 * assign.cs, literal.cs, constant.cs: Update to new calling
21179 * codegen.cs: EmitContext now contains a flag indicating whether
21180 code is being generated in a static method or not.
21182 * cs-parser.jay: DecomposeQI, new function that replaces the old
21183 QualifiedIdentifier. Now we always decompose the assembled
21184 strings from qualified_identifier productions into a group of
21187 2001-10-08 Miguel de Icaza <miguel@ximian.com>
21189 * rootcontext.cs: Deal with field-less struct types correctly now
21190 by passing the size option to Define Type.
21192 * class.cs: Removed hack that created one static field.
21194 2001-10-07 Miguel de Icaza <miguel@ximian.com>
21196 * statement.cs: Moved most of the code generation here.
21198 2001-10-09 Ravi Pratap <ravi@ximian.com>
21200 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
21203 (ElementAccess): Remove useless bits for now - keep checks as the spec
21206 2001-10-08 Ravi Pratap <ravi@ximian.com>
21208 * expression.cs (ElementAccess::DoResolve): Remove my crap code
21209 and start performing checks according to the spec.
21211 2001-10-07 Ravi Pratap <ravi@ximian.com>
21213 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
21214 rank_specifiers instead.
21216 (rank_specifiers): Change the order in which the rank specifiers are stored
21218 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
21220 * expression.cs (ElementAccess): Implement the LValue interface too.
21222 2001-10-06 Ravi Pratap <ravi@ximian.com>
21224 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
21225 except that user defined conversions are not included.
21227 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
21228 perform the conversion of the return type, if necessary.
21230 (New::DoResolve): Check whether we are creating an array or an object
21231 and accordingly do the needful.
21233 (New::Emit): Same here.
21235 (New::DoResolve): Implement guts of array creation.
21237 (New::FormLookupType): Helper function.
21239 2001-10-07 Miguel de Icaza <miguel@ximian.com>
21241 * codegen.cs: Removed most of the code generation here, and move the
21242 corresponding code generation bits to the statement classes.
21244 Added support for try/catch/finalize and throw.
21246 * cs-parser.jay: Added support for try/catch/finalize.
21248 * class.cs: Catch static methods having the flags override,
21249 virtual or abstract.
21251 * expression.cs (UserCast): This user cast was not really doing
21252 what it was supposed to do. Which is to be born in fully resolved
21253 state. Parts of the resolution were being performed at Emit time!
21257 2001-10-05 Miguel de Icaza <miguel@ximian.com>
21259 * expression.cs: Implicity convert the result from UserCast.
21261 2001-10-05 Ravi Pratap <ravi@ximian.com>
21263 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
21264 prevented it from working correctly.
21266 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
21267 merely ConvertImplicit.
21269 2001-10-05 Miguel de Icaza <miguel@ximian.com>
21271 * typemanager.cs: Make the LookupTypeContainer function static,
21272 and not per-instance.
21274 * class.cs: Make static FindMembers (the one that takes a Type
21277 * codegen.cs: Add EmitForeach here.
21279 * cs-parser.jay: Make foreach a toplevel object instead of the
21280 inline expansion, as we need to perform semantic analysis on it.
21282 2001-10-05 Ravi Pratap <ravi@ximian.com>
21284 * expression.cs (Expression::ImplicitUserConversion): Rename to
21285 UserDefinedConversion.
21287 (Expression::UserDefinedConversion): Take an extra argument specifying
21288 whether we look for explicit user conversions too.
21290 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
21292 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
21294 (ExplicitUserConversion): Make it a call to UserDefinedConversion
21295 with the appropriate arguments.
21297 * cs-parser.jay (cast_expression): Record location too.
21299 * expression.cs (Cast): Record location info.
21301 (Expression::ConvertExplicit): Take location argument.
21303 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
21304 to determine if we are doing explicit conversions.
21306 (UserCast::Emit): Update accordingly.
21308 (Expression::ConvertExplicit): Report an error if everything fails.
21310 * ../errors/cs0030.cs : Add.
21312 2001-10-04 Miguel de Icaza <miguel@ximian.com>
21314 * modifiers.cs: If the ABSTRACT keyword is present, also set the
21315 virtual and newslot bits.
21317 * class.cs (TypeContainer::RegisterRequiredImplementations):
21318 Record methods we need.
21320 (TypeContainer::MakeKey): Helper function to make keys for
21321 MethodBases, since the Methodbase key is useless.
21323 (TypeContainer::Populate): Call RegisterRequiredImplementations
21324 before defining the methods.
21326 Create a mapping for method_builders_to_methods ahead of time
21327 instead of inside a tight loop.
21329 (::RequireMethods): Accept an object as the data to set into the
21330 hashtable so we can report interface vs abstract method mismatch.
21332 2001-10-03 Miguel de Icaza <miguel@ximian.com>
21334 * report.cs: Make all of it static.
21336 * rootcontext.cs: Drop object_type and value_type computations, as
21337 we have those in the TypeManager anyways.
21339 Drop report instance variable too, now it is a global.
21341 * driver.cs: Use try/catch on command line handling.
21343 Add --probe option to debug the error reporting system with a test
21346 * report.cs: Add support for exiting program when a probe
21347 condition is reached.
21349 2001-10-03 Ravi Pratap <ravi@ximian.com>
21351 * expression.cs (Binary::DoNumericPromotions): Fix the case when
21352 we do a forcible conversion regardless of type, to check if
21353 ForceConversion returns a null.
21355 (Binary::error19): Use location to report error.
21357 (Unary::error23): Use location here too.
21359 * ../errors/cs0019.cs : Check in.
21361 * ../errors/cs0023.cs : Check in.
21363 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
21364 case of a non-null MethodInfo object with a length of 0 !
21366 (Binary::ResolveOperator): Flag error if overload resolution fails to find
21367 an applicable member - according to the spec :-)
21368 Also fix logic to find members in base types.
21370 (Unary::ResolveOperator): Same here.
21372 (Unary::report23): Change name to error23 and make first argument a TypeContainer
21373 as I was getting thoroughly confused between this and error19 :-)
21375 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
21376 (::FindMostEncompassedType): Implement.
21377 (::FindMostEncompassingType): Implement.
21378 (::StandardConversionExists): Implement.
21380 (UserImplicitCast): Re-vamp. We now need info about most specific
21381 source and target types so that we can do the necessary conversions.
21383 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
21384 mathematical union with no duplicates.
21386 2001-10-03 Miguel de Icaza <miguel@ximian.com>
21388 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
21389 in order from base classes to child classes, so that we can in
21390 child classes look up in our parent for method names and
21391 attributes (required for handling abstract, virtual, new, override
21392 constructs: we need to instrospect our base class, and if we dont
21393 populate the classes in order, the introspection might be
21394 incorrect. For example, a method could query its parent before
21395 the parent has any methods and would determine that the parent has
21396 no abstract methods (while it could have had them)).
21398 (RootContext::CreateType): Record the order in which we define the
21401 2001-10-02 Miguel de Icaza <miguel@ximian.com>
21403 * class.cs (TypeContainer::Populate): Also method definitions can
21404 fail now, keep track of this.
21406 (TypeContainer::FindMembers): Implement support for
21407 DeclaredOnly/noDeclaredOnly flag.
21409 (Constructor::Emit) Return the ConstructorBuilder.
21411 (Method::Emit) Return the MethodBuilder.
21412 Check for abstract or virtual methods to be public.
21414 * rootcontext.cs (RootContext::CreateType): Register all the
21415 abstract methods required for the class to be complete and the
21416 interface methods that must be implemented.
21418 * cs-parser.jay: Report error 501 (method requires body if it is
21419 not marked abstract or extern).
21421 * expression.cs (TypeOf::Emit): Implement.
21423 * typemanager.cs: runtime_handle_type, new global type.
21425 * class.cs (Property::Emit): Generate code for properties.
21427 2001-10-02 Ravi Pratap <ravi@ximian.com>
21429 * expression.cs (Unary::ResolveOperator): Find operators on base type
21430 too - we now conform exactly to the spec.
21432 (Binary::ResolveOperator): Same here.
21434 * class.cs (Operator::Define): Fix minor quirk in the tests.
21436 * ../errors/cs0215.cs : Added.
21438 * ../errors/cs0556.cs : Added.
21440 * ../errors/cs0555.cs : Added.
21442 2001-10-01 Miguel de Icaza <miguel@ximian.com>
21444 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
21445 single integer which is really efficient
21447 2001-10-01 Ravi Pratap <ravi@ximian.com>
21449 * expression.cs (Expression::ImplicitUserConversion): Use location
21450 even in the case when we are examining True operators.
21452 * class.cs (Operator::Define): Perform extensive checks to conform
21453 with the rules for operator overloading in the spec.
21455 * expression.cs (Expression::ImplicitReferenceConversion): Implement
21456 some of the other conversions mentioned in the spec.
21458 * typemanager.cs (array_type): New static member for the System.Array built-in
21461 (cloneable_interface): For System.ICloneable interface.
21463 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
21464 we start resolving the tree and populating types.
21466 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
21468 2001-10-01 Miguel de Icaza <miguel@ximian.com>
21470 * expression.cs (Expression::ExprClassFromMemberInfo,
21471 Expression::Literalize): Create literal expressions from
21472 FieldInfos which are literals.
21474 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
21475 type casts, because they were wrong. The test suite in tests
21478 (ImplicitNumericConversion): ushort to ulong requires a widening
21481 Int32 constant to long requires widening cast as well.
21483 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
21484 for integers because the type on the stack is not i4.
21486 2001-09-30 Miguel de Icaza <miguel@ximian.com>
21488 * expression.cs (report118): require location argument.
21490 * parameter.cs: Do not dereference potential null value.
21492 * class.cs: Catch methods that lack the `new' keyword when
21493 overriding a name. Report warnings when `new' is used without
21494 anything being there to override.
21496 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
21498 * class.cs: Only add constructor to hashtable if it is non-null
21499 (as now constructors can fail on define).
21501 (TypeManager, Class, Struct): Take location arguments.
21503 Catch field instance initialization in structs as errors.
21505 accepting_filter: a new filter for FindMembers that is static so
21506 that we dont create an instance per invocation.
21508 (Constructor::Define): Catch errors where a struct constructor is
21511 * cs-parser.jay: Pass location information for various new
21514 * delegate.cs (Delegate): take a location argument.
21516 * driver.cs: Do not call EmitCode if there were problesm in the
21517 Definition of the types, as many Builders wont be there.
21519 * decl.cs (Decl::Decl): Require a location argument.
21521 * cs-tokenizer.cs: Handle properly hex constants that can not fit
21522 into integers, and find the most appropiate integer for it.
21524 * literal.cs: Implement ULongLiteral.
21526 * rootcontext.cs: Provide better information about the location of
21527 failure when CreateType fails.
21529 2001-09-29 Miguel de Icaza <miguel@ximian.com>
21531 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
21534 * expression.cs (Binary::CheckShiftArguments): Add missing type
21536 (Binary::ResolveOperator): Add type to the logical and and logical
21537 or, Bitwise And/Or and Exclusive Or code paths, it was missing
21540 (Binary::DoNumericPromotions): In the case where either argument
21541 is ulong (and most signed types combined with ulong cause an
21542 error) perform implicit integer constant conversions as well.
21544 2001-09-28 Miguel de Icaza <miguel@ximian.com>
21546 * expression.cs (UserImplicitCast): Method should always be
21548 (Invocation::BetterConversion): Simplified test for IntLiteral.
21550 (Expression::ImplicitNumericConversion): Split this routine out.
21551 Put the code that performs implicit constant integer conversions
21554 (Expression::Resolve): Become a wrapper around DoResolve so we can
21555 check eclass and type being set after resolve.
21557 (Invocation::Badness): Remove this dead function
21559 (Binary::ResolveOperator): Do not compute the expensive argumnets
21560 unless we have a union for it.
21562 (Probe::Emit): Is needs to do an isinst and then
21563 compare against null.
21565 (::CanConvert): Added Location argument. If the Location argument
21566 is null (Location.Null), then we do not report errors. This is
21567 used by the `probe' mechanism of the Explicit conversion. We do
21568 not want to generate an error for something that the user
21569 explicitly requested to be casted. But the pipeline for an
21570 explicit cast first tests for potential implicit casts.
21572 So for now, if the Location is null, it means `Probe only' to
21573 avoid adding another argument. Might have to revise this
21576 (ClassCast): New class used to type cast objects into arbitrary
21577 classes (used in Explicit Reference Conversions).
21579 Implement `as' as well.
21581 Reverted all the patches from Ravi below: they were broken:
21583 * The use of `level' as a mechanism to stop recursive
21584 invocations is wrong. That was there just to catch the
21585 bug with a strack trace but not as a way of addressing
21588 To fix the problem we have to *understand* what is going
21589 on and the interactions and come up with a plan, not
21590 just get things going.
21592 * The use of the type conversion cache that I proposed
21593 last night had an open topic: How does this work across
21594 protection domains. A user defined conversion might not
21595 be public in the location where we are applying the
21596 conversion, a different conversion might be selected
21597 (ie, private A->B (better) but public B->A (worse),
21598 inside A, A->B applies, but outside it, B->A will
21601 * On top of that (ie, even if the above is solved),
21602 conversions in a cache need to be abstract. Ie, `To
21603 convert from an Int to a Short use an OpcodeCast', not
21604 `To convert from an Int to a Short use the OpcodeCast on
21605 the variable 5' (which is what this patch was doing).
21607 2001-09-28 Ravi Pratap <ravi@ximian.com>
21609 * expression.cs (Invocation::ConversionExists): Re-write to use
21610 the conversion cache
21612 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
21613 cache all conversions done, not just user-defined ones.
21615 (Invocation::BetterConversion): The real culprit. Use ConversionExists
21616 to determine if a conversion exists instead of acutually trying to
21617 perform the conversion. It's faster too.
21619 (Expression::ConvertExplicit): Modify to use ConversionExists to check
21620 and only then attempt the implicit conversion.
21622 2001-09-28 Ravi Pratap <ravi@ximian.com>
21624 * expression.cs (ConvertImplicit): Use a cache for conversions
21625 already found. Check level of recursion and bail out if necessary.
21627 2001-09-28 Miguel de Icaza <miguel@ximian.com>
21629 * typemanager.cs (string_concat_string_string, string_concat_object_object):
21630 Export standard methods that we expect for string operations.
21632 * statement.cs (Block::UsageWarning): Track usage of variables and
21633 report the errors for not used variables.
21635 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
21638 2001-09-27 Miguel de Icaza <miguel@ximian.com>
21640 * codegen.cs: remove unnneded code
21642 * expression.cs: Removed BuiltinTypeAccess class
21644 Fix the order in which implicit conversions are
21647 The previous fixed dropped support for boxed conversions (adding a
21648 test to the test suite now)
21650 (UserImplicitCast::CanConvert): Remove test for source being null,
21651 that code is broken. We should not feed a null to begin with, if
21652 we do, then we should track the bug where the problem originates
21653 and not try to cover it up here.
21655 Return a resolved expression of type UserImplicitCast on success
21656 rather than true/false. Ravi: this is what I was talking about,
21657 the pattern is to use a static method as a "constructor" for
21660 Also, do not create arguments until the very last minute,
21661 otherwise we always create the arguments even for lookups that
21662 will never be performed.
21664 (UserImplicitCast::Resolve): Eliminate, objects of type
21665 UserImplicitCast are born in a fully resolved state.
21667 * typemanager.cs (InitCoreTypes): Init also value_type
21668 (System.ValueType).
21670 * expression.cs (Cast::Resolve): First resolve the child expression.
21672 (LValue): Add new method AddressOf to be used by
21675 Change the argument of Store to take an EmitContext instead of an
21676 ILGenerator, because things like FieldExpr need to be able to call
21677 their children expression to generate the instance code.
21679 (Expression::Error, Expression::Warning): Sugar functions for
21682 (Expression::MemberLookup): Accept a TypeContainer instead of a
21683 Report as the first argument.
21685 (Expression::ResolvePrimary): Killed. I still want to improve
21686 this as currently the code is just not right.
21688 (Expression::ResolveMemberAccess): Simplify, but it is still
21691 (Unary::Resolve): Catch errors in AddressOf operators.
21693 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
21694 index to a byte for the short-version, or the compiler will choose
21695 the wrong Emit call, which generates the wrong data.
21697 (ParameterReference::Emit, ::Store): same.
21699 (FieldExpr::AddressOf): Implement.
21701 * typemanager.cs: TypeManager: made public variable instead of
21704 * driver.cs: document --fatal.
21706 * report.cs (ErrorMessage, WarningMessage): new names for the old
21707 Error and Warning classes.
21709 * cs-parser.jay (member_access): Turn built-in access to types
21710 into a normal simplename
21712 2001-09-27 Ravi Pratap <ravi@ximian.com>
21714 * expression.cs (Invocation::BetterConversion): Fix to cope
21715 with q being null, since this was introducing a bug.
21717 * expression.cs (ConvertImplicit): Do built-in conversions first.
21719 2001-09-27 Ravi Pratap <ravi@ximian.com>
21721 * expression.cs (UserImplicitCast::Resolve): Fix bug.
21723 2001-09-27 Ravi Pratap <ravi@ximian.com>
21725 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
21726 I had introduced long ago (what's new ?).
21728 * expression.cs (UserImplicitCast::CanConvert): Static method to do
21729 the work of all the checking.
21730 (ConvertImplicit): Call CanConvert and only then create object if necessary.
21731 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
21733 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
21734 that is the right way.
21736 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
21737 overloading resolution. Use everywhere instead of cutting and pasting code.
21739 (Binary::ResolveOperator): Use MakeUnionSet.
21741 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
21742 we have to convert to bool types. Not complete yet.
21744 2001-09-27 Miguel de Icaza <miguel@ximian.com>
21746 * typemanager.cs (TypeManager::CSharpName): support ushort.
21748 * expression.cs (Expression::TryImplicitIntConversion): Attempts
21749 to provide an expression that performsn an implicit constant int
21750 conversion (section 6.1.6).
21751 (Expression::ConvertImplicitRequired): Reworked to include
21752 implicit constant expression conversions.
21754 (Expression::ConvertNumericExplicit): Finished.
21756 (Invocation::Emit): If InstanceExpression is null, then it means
21757 that we perform a call on this.
21759 2001-09-26 Miguel de Icaza <miguel@ximian.com>
21761 * expression.cs (Unary::Emit): Remove some dead code.
21762 (Probe): Implement Resolve and Emit for `is'.
21763 (Expression::ConvertImplicitRequired): Attempt to do constant
21764 expression conversions here. Maybe should be moved to
21765 ConvertImplicit, but I am not sure.
21766 (Expression::ImplicitLongConstantConversionPossible,
21767 Expression::ImplicitIntConstantConversionPossible): New functions
21768 that tell whether is it possible to apply an implicit constant
21769 expression conversion.
21771 (ConvertNumericExplicit): Started work on explicit numeric
21774 * cs-parser.jay: Update operator constants.
21776 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
21777 (Parameters::GetSignature): Hook up VerifyArgs here.
21778 (Parameters::VerifyArgs): Verifies that no two arguments have the
21781 * class.cs (Operator): Update the operator names to reflect the
21782 ones that the spec expects (as we are just stringizing the
21785 * expression.cs (Unary::ResolveOperator): Fix bug: Use
21786 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
21787 previous usage did only work for our methods.
21788 (Expression::ConvertImplicit): Handle decimal implicit numeric
21789 conversions as well.
21790 (Expression::InternalTypeConstructor): Used to invoke constructors
21791 on internal types for default promotions.
21793 (Unary::Emit): Implement special handling for the pre/post
21794 increment/decrement for overloaded operators, as they need to have
21795 the same semantics as the other operators.
21797 (Binary::ResolveOperator): ditto.
21798 (Invocation::ConversionExists): ditto.
21799 (UserImplicitCast::Resolve): ditto.
21801 2001-09-26 Ravi Pratap <ravi@ximian.com>
21803 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
21804 operator, return after emitting body. Regression tests pass again !
21806 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
21807 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
21808 (Invocation::OverloadResolve): Ditto.
21809 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
21811 * everywhere : update calls to the above methods accordingly.
21813 2001-09-26 Miguel de Icaza <miguel@ximian.com>
21815 * assign.cs (Assign): Make it inherit from ExpressionStatement.
21817 * expression.cs (ExpressionStatement): New base class used for
21818 expressions that can appear in statements, so that we can provide
21819 an alternate path to generate expression that do not leave a value
21822 (Expression::Emit, and all the derivatives): We no longer return
21823 whether a value is left on the stack or not. Every expression
21824 after being emitted leaves a single value on the stack.
21826 * codegen.cs (EmitContext::EmitStatementExpression): Use the
21827 facilties of ExpressionStatement if possible.
21829 * cs-parser.jay: Update statement_expression.
21831 2001-09-25 Miguel de Icaza <miguel@ximian.com>
21833 * driver.cs: Change the wording of message
21835 2001-09-25 Ravi Pratap <ravi@ximian.com>
21837 * expression.cs (Binary::ResolveOperator): Had forgottten to set
21838 the type of the expression to the return type of the method if
21839 we have an overloaded operator match ! The regression tests pass again !
21840 (Unary::ResolveOperator): Ditto.
21842 * expression.cs (Invocation::ConversionExists): Correct the member lookup
21843 to find "op_Implicit", not "implicit" ;-)
21844 (UserImplicitCast): New class to take care of user-defined implicit conversions.
21845 (ConvertImplicit, ForceConversion): Take TypeContainer argument
21847 * everywhere : Correct calls to the above accordingly.
21849 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
21850 (ConvertImplicit): Do user-defined conversion if it exists.
21852 2001-09-24 Miguel de Icaza <miguel@ximian.com>
21854 * assign.cs: track location.
21855 (Resolve): Use implicit conversions on assignment.
21857 * literal.cs: Oops. Not good, Emit of short access values should
21858 pass (Bytes) or the wrong argument will be selected.
21860 * expression.cs (Unary::Emit): Emit code for -expr.
21862 (Unary::ResolveOperator): Handle `Substract' for non-constants
21863 (substract from zero from the non-constants).
21864 Deal with Doubles as well.
21866 (Expression::ConvertImplicitRequired): New routine that reports an
21867 error if no implicit conversion exists.
21869 (Invocation::OverloadResolve): Store the converted implicit
21870 expressions if we make them
21872 2001-09-24 Ravi Pratap <ravi@ximian.com>
21874 * class.cs (ConstructorInitializer): Take a Location argument.
21875 (ConstructorBaseInitializer): Same here.
21876 (ConstructorThisInitializer): Same here.
21878 * cs-parser.jay : Update all calls accordingly.
21880 * expression.cs (Unary, Binary, New): Take location argument.
21881 Update accordingly everywhere.
21883 * cs-parser.jay : Update all calls to the above to take a location
21886 * class.cs : Ditto.
21888 2001-09-24 Ravi Pratap <ravi@ximian.com>
21890 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
21891 (Invocation::BetterConversion): Same here
21892 (Invocation::ConversionExists): Ditto.
21894 (Invocation::ConversionExists): Implement.
21896 2001-09-22 Ravi Pratap <ravi@ximian.com>
21898 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
21899 Also take an additional TypeContainer argument.
21901 * All over : Pass in TypeContainer as argument to OverloadResolve.
21903 * typemanager.cs (CSharpName): Update to check for the string type and return
21906 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
21909 2001-09-21 Ravi Pratap <ravi@ximian.com>
21911 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
21912 (Invocation::BetterFunction): Implement.
21913 (Invocation::BetterConversion): Implement.
21914 (Invocation::ConversionExists): Skeleton, no implementation yet.
21916 Okay, things work fine !
21918 2001-09-21 Miguel de Icaza <miguel@ximian.com>
21920 * typemanager.cs: declare and load enum_type, delegate_type and
21923 * expression.cs (Expression::Emit): Now emit returns a value that
21924 tells whether a value is left on the stack or not. This strategy
21925 might be reveted tomorrow with a mechanism that would address
21926 multiple assignments.
21927 (Expression::report118): Utility routine to report mismatches on
21930 (Unary::Report23): Report impossible type/operator combination
21933 (Unary::IsIncrementableNumber): Whether the type can be
21934 incremented or decremented with add.
21935 (Unary::ResolveOperator): Also allow enumerations to be bitwise
21937 (Unary::ResolveOperator): Implement ++, !, ~,
21939 (Invocation::Emit): Deal with new Emit convetion.
21941 * All Expression derivatives: Updated their Emit method to return
21942 whether they leave values on the stack or not.
21944 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
21945 stack for expressions that are statements.
21947 2001-09-20 Miguel de Icaza <miguel@ximian.com>
21949 * expression.cs (LValue): New interface. Must be implemented by
21951 (LocalVariableReference, ParameterReference, FieldExpr): Implement
21954 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
21955 interface for generating code, simplifies the code.
21957 2001-09-20 Ravi Pratap <ravi@ximian.com>
21959 * expression.cs (everywhere): Comment out return statements in ::Resolve
21960 methods to avoid the warnings.
21962 2001-09-20 Miguel de Icaza <miguel@ximian.com>
21964 * driver.cs (parse): Report error 2001 if we can not open the
21967 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
21970 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
21973 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
21974 otherwise nested blocks end up with the same index.
21976 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
21978 * expression.cs: Instead of having FIXMEs in the Resolve
21979 functions, throw exceptions so it is obvious that we are facing a
21982 * cs-parser.jay (invocation_expression): Pass Location information.
21984 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
21985 Use a basename for those routines because .NET does not like paths
21988 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
21991 2001-09-19 Miguel de Icaza <miguel@ximian.com>
21993 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
21994 are loading the correct data types (throws an exception if not).
21995 (TypeManager::InitCoreTypes): Use CoreLookupType
21997 * expression.cs (Unary::ResolveOperator): return the child
21998 expression for expressions which are just +expr.
21999 (Unary::ResolveOperator): Return negative literals for -LITERAL
22000 expressions (otherwise they are Unary {Literal}).
22001 (Invocation::Badness): Take into account `Implicit constant
22002 expression conversions'.
22004 * literal.cs (LongLiteral): Implement long literal class.
22005 (IntLiteral): export the `Value' of the intliteral.
22007 2001-09-19 Ravi Pratap <ravi@ximian.com>
22009 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
22011 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
22012 instead of 'Operator'
22014 * expression.cs (Binary::ResolveOperator): Update accordingly.
22015 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
22018 * cs-parser.jay (unary_expression): Update to use the new names.
22020 * gen-treedump.cs (GetUnary): Same here.
22022 * expression.cs (Unary::Resolve): Implement.
22023 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
22024 operators are found instead of making noise ;-)
22025 (Unary::ResolveOperator): New method to do precisely the same thing which
22026 Binary::ResolveOperator does for Binary expressions.
22027 (Unary.method, .Arguments): Add.
22028 (Unary::OperName): Implement.
22029 (Unary::ForceConversion): Copy and Paste !
22031 * class.cs (Operator::Define): Fix a small bug for the case when we have
22034 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
22035 for the inbuilt operators. Only overloading works for now ;-)
22037 2001-09-18 Miguel de Icaza <miguel@ximian.com>
22039 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
22040 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
22042 * expression.cs (This::Emit): Implement.
22043 (This::Resolve): Implement.
22044 (TypeOf:Resolve): Implement.
22045 (Expression::ResolveSimpleName): Add an implicit this to instance
22047 (MemberAccess::Resolve): Deal with Parameters and Fields.
22048 Bind instance variable to Field expressions.
22049 (FieldExpr::Instance): New field used to track the expression that
22050 represents the object instance.
22051 (FieldExpr::Resolve): Track potential errors from MemberLookup not
22053 (FieldExpr::Emit): Implement.
22055 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
22056 the last instruction contains a return opcode to avoid generating
22057 the last `ret' instruction (this generates correct code, and it is
22058 nice to pass the peverify output).
22060 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
22061 initializer for static and instance variables.
22062 (Constructor::Emit): Allow initializer to be null in the case of
22063 static constructors. Only emit initializer for instance
22066 (TypeContainer::FindMembers): Return a null array if there are no
22069 Also fix the code for the MemberTypes.Method branch, as it was not
22070 scanning that for operators (or tried to access null variables before).
22072 * assign.cs (Assign::Emit): Handle instance and static fields.
22076 * driver.cs: Stop compilation if there are parse errors.
22078 * cs-parser.jay (constructor_declaration): Provide default base
22079 initializer for non-static constructors.
22080 (constructor_declarator): Do not provide a default base
22081 initializers if none was specified.
22082 Catch the fact that constructors should not have parameters.
22084 * class.cs: Do not emit parent class initializers for static
22085 constructors, that should be flagged as an error.
22087 2001-09-18 Ravi Pratap <ravi@ximian.com>
22089 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
22090 Move back code into TypeContainer::Populate.
22092 2001-09-18 Ravi Pratap <ravi@ximian.com>
22094 * class.cs (TypeContainer::AddConstructor): Fix the check to
22095 compare against Name, not Basename.
22096 (Operator::OpType): Change Plus and Minus to Add and Subtract.
22098 * cs-parser.jay : Update accordingly.
22100 * class.cs (TypeContainer::FindMembers): For the case where we are searching
22101 for methods, don't forget to look into the operators too.
22102 (RegisterMethodBuilder): Helper method to take care of this for
22103 methods, constructors and operators.
22104 (Operator::Define): Completely revamp.
22105 (Operator.OperatorMethod, MethodName): New fields.
22106 (TypeContainer::Populate): Move the registering of builders into
22107 RegisterMethodBuilder.
22108 (Operator::Emit): Re-write.
22110 * expression.cs (Binary::Emit): Comment out code path to emit method
22111 invocation stuff for the case when we have a user defined operator. I am
22112 just not able to get it right !
22114 2001-09-17 Miguel de Icaza <miguel@ximian.com>
22116 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
22119 (Expression::MemberLookup): Provide a version that allows to
22120 specify the MemberTypes and BindingFlags.
22122 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
22123 so it was not fetching variable information from outer blocks.
22125 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
22126 Beforefieldinit as it was buggy.
22128 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
22129 that Ravi put here.
22131 * class.cs (Constructor::Emit): Only emit if block is not null.
22132 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
22133 deal with this by semantically definining it as if the user had
22136 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
22137 constructors as we now "emit" them at a higher level.
22139 (TypeContainer::DefineDefaultConstructor): Used to define the
22140 default constructors if none was provided.
22142 (ConstructorInitializer): Add methods Resolve and Emit.
22144 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
22146 2001-09-17 Ravi Pratap <ravi@ximian.com>
22148 * class.cs (TypeContainer::EmitDefaultConstructor): Register
22149 the default constructor builder with our hashtable for methodbuilders
22152 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
22153 and argument_count is 0 in which case we have a match.
22154 (Binary::ResolveOperator): More null checking and miscellaneous coding
22157 2001-09-17 Ravi Pratap <ravi@ximian.com>
22159 * rootcontext.cs (IsNameSpace): Compare against null.
22161 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
22163 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
22164 and Unary::Operator.
22166 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
22169 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
22170 we have overloaded operators.
22171 (Binary::ResolveOperator): Implement the part which does the operator overload
22174 * class.cs (Operator::Emit): Implement.
22175 (TypeContainer::Emit): Emit the operators we have too.
22177 * expression.cs (Binary::Emit): Update to emit the appropriate code for
22178 the case when we have a user-defined operator.
22180 2001-09-17 Miguel de Icaza <miguel@ximian.com>
22182 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
22184 2001-09-16 Ravi Pratap <ravi@ximian.com>
22186 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
22187 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
22188 (Constructor::Emit): Implement.
22189 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
22190 if we have no work to do.
22191 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
22194 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
22195 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
22197 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
22200 2001-09-15 Ravi Pratap <ravi@ximian.com>
22202 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
22204 (Tree::RecordNamespace): Method to do what the name says ;-)
22205 (Tree::Namespaces): Property to get at the namespaces hashtable.
22207 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
22210 * rootcontext.cs (IsNamespace): Fixed it :-)
22212 2001-09-14 Miguel de Icaza <miguel@ximian.com>
22214 * class.cs (TypeContainer::FindMembers): Add support for
22216 (MethodCore): New class that encapsulates both the shared aspects
22217 of a Constructor and a Method.
22218 (Method, Constructor): Factored pieces into MethodCore.
22220 * driver.cs: Added --fatal which makes errors throw exceptions.
22221 Load System assembly as well as part of the standard library.
22223 * report.cs: Allow throwing exceptions on errors for debugging.
22225 * modifiers.cs: Do not use `parent', instead use the real type
22226 container to evaluate permission settings.
22228 * class.cs: Put Ravi's patch back in. He is right, and we will
22229 have to cope with the
22231 2001-09-14 Ravi Pratap <ravi@ximian.com>
22233 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
22234 FamORAssem, not FamANDAssem.
22236 2001-09-14 Miguel de Icaza <miguel@ximian.com>
22238 * driver.cs: Added --parse option that only parses its input files
22241 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
22242 incorrect. IsTopLevel is not used to tell whether an object is
22243 root_types or not (that can be achieved by testing this ==
22244 root_types). But to see if this is a top-level *class* (not
22245 necessarly our "toplevel" container).
22247 2001-09-14 Ravi Pratap <ravi@ximian.com>
22249 * enum.cs (Enum::Define): Modify to call the Lookup method on the
22250 parent instead of a direct call to GetType.
22252 2001-09-14 Ravi Pratap <ravi@ximian.com>
22254 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
22255 Modifiers.TypeAttr. This should just be a call to that method.
22257 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
22258 object so that we can determine if we are top-level or not.
22260 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
22263 * enum.cs (Enum::Define): Ditto.
22265 * modifiers.cs (FieldAttr): Re-write.
22267 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
22268 (TypeContainer::HaveStaticConstructor): New property to provide access
22269 to precisely that info.
22271 * modifiers.cs (MethodAttr): Re-write.
22272 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
22274 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
22275 of top-level types as claimed.
22277 2001-09-13 Miguel de Icaza <miguel@ximian.com>
22279 * expression.cs (MemberLookup): Fruitless attempt to lookup
22280 constructors. Maybe I need to emit default constructors? That
22281 might be it (currently .NET emits this for me automatically).
22282 (Invocation::OverloadResolve): Cope with Arguments == null.
22283 (Invocation::EmitArguments): new function, shared by the new
22284 constructor and us.
22285 (Invocation::Emit): Handle static and instance methods. Emit
22286 proper call instruction for virtual or non-virtual invocations.
22287 (New::Emit): Implement.
22288 (New::Resolve): Implement.
22289 (MemberAccess:Resolve): Implement.
22290 (MethodGroupExpr::InstanceExpression): used conforming to the spec
22291 to track instances.
22292 (FieldExpr::Resolve): Set type.
22294 * support.cs: Handle empty arguments.
22296 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
22297 SimpleLookup): Auxiliary routines to help parse a qualifier
22300 Update qualifier_identifier rule.
22302 * codegen.cs: Removed debugging messages.
22304 * class.cs: Make this a global thing, this acts just as a "key" to
22305 objects that we might have around.
22307 (Populate): Only initialize method_builders_to_methods once.
22309 * expression.cs (PropertyExpr): Initialize type from the
22312 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
22313 Resolve pattern. Attempt to implicitly convert value to boolean.
22316 * expression.cs: Set the type for the int32/int32 argument case.
22317 (Binary::ResolveOperator): Set the return type to boolean for
22318 comparission operators
22320 * typemanager.cs: Remove debugging print code.
22322 (Invocation::Resolve): resolve type.
22324 * class.cs: Allocate a MemberInfo of the correct size, as the code
22325 elsewhere depends on the test to reflect the correct contents.
22327 (Method::) Keep track of parameters, due to System.Reflection holes
22329 (TypeContainer::Populate): Keep track of MethodBuilders to Method
22332 (TypeContainer::FindMembers): Use ArrayList and then copy an array
22333 of the exact size and return that.
22335 (Class::LookupMethodByBuilder): New function that maps
22336 MethodBuilders to its methods. Required to locate the information
22337 on methods because System.Reflection bit us again.
22339 * support.cs: New file, contains an interface ParameterData and
22340 two implementations: ReflectionParameters and InternalParameters
22341 used to access Parameter information. We will need to grow this
22344 * expression.cs (Invocation::GetParameterData): implement a cache
22345 and a wrapper around the ParameterData creation for methods.
22346 (Invocation::OverloadResolve): Use new code.
22348 2001-09-13 Ravi Pratap <ravi@ximian.com>
22350 * class.cs (TypeContainer::EmitField): Remove and move into
22351 (Field::Define): here and modify accordingly.
22352 (Field.FieldBuilder): New member.
22353 (TypeContainer::Populate): Update accordingly.
22354 (TypeContainer::FindMembers): Implement.
22356 2001-09-13 Miguel de Icaza <miguel@ximian.com>
22358 * statement.cs: (VariableInfo::VariableType): New field to be
22359 initialized with the full type once it is resolved.
22361 2001-09-12 Miguel de Icaza <miguel@ximian.com>
22363 * parameter.cs (GetParameterInfo): Use a type cache to compute
22364 things only once, and to reuse this information
22366 * expression.cs (LocalVariableReference::Emit): Implement.
22367 (OpcodeCast::Emit): fix.
22369 (ParameterReference::Resolve): Implement.
22370 (ParameterReference::Emit): Implement.
22372 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
22373 that are expressions need to stay as Expressions.
22375 * typemanager.cs (CSharpName): Returns the C# name of a type if
22378 * expression.cs (Expression::ConvertImplicit): New function that
22379 implements implicit type conversions.
22381 (Expression::ImplicitReferenceConversion): Implements implicit
22382 reference conversions.
22384 (EmptyCast): New type for transparent casts.
22386 (OpcodeCast): New type for casts of types that are performed with
22387 a sequence of bytecodes.
22389 (BoxedCast): New type used for casting value types into reference
22390 types. Emits a box opcode.
22392 (Binary::DoNumericPromotions): Implements numeric promotions of
22393 and computation of the Binary::Type.
22395 (Binary::EmitBranchable): Optimization.
22397 (Binary::Emit): Implement code emission for expressions.
22399 * typemanager.cs (TypeManager): Added two new core types: sbyte
22402 2001-09-12 Ravi Pratap <ravi@ximian.com>
22404 * class.cs (TypeContainer::FindMembers): Method which does exactly
22405 what Type.FindMembers does, only we don't have to use reflection. No
22406 implementation yet.
22408 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
22409 typecontainer objects as we need to get at them.
22410 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
22412 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
22413 typecontainer object.
22415 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
22416 of just a Report object.
22418 2001-09-11 Ravi Pratap <ravi@ximian.com>
22420 * class.cs (Event::Define): Go back to using the prefixes "add_" and
22422 (TypeContainer::Populate): Now define the delegates of the type too.
22423 (TypeContainer.Delegates): Property to access the list of delegates defined
22426 * delegates.cs (Delegate::Define): Implement partially.
22428 * modifiers.cs (TypeAttr): Handle more flags.
22430 2001-09-11 Ravi Pratap <ravi@ximian.com>
22432 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
22434 (Operator::Define): Re-write logic to get types by using the LookupType method
22435 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
22436 (Indexer::Define): Ditto.
22437 (Event::Define): Ditto.
22438 (Property::Define): Ditto.
22440 2001-09-10 Ravi Pratap <ravi@ximian.com>
22442 * class.cs (TypeContainer::Populate): Now define operators too.
22443 (TypeContainer.Operators): New property to access the list of operators
22445 (Operator.OperatorMethodBuilder): New member to hold the method builder
22446 for the operator we are defining.
22447 (Operator::Define): Implement.
22449 2001-09-10 Ravi Pratap <ravi@ximian.com>
22451 * class.cs (Event::Define): Make the prefixes of the accessor methods
22452 addOn_ and removeOn_
22454 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
22455 of the location being passed in too. Ideally, this should go later since all
22456 error reporting should be done through the Report object.
22458 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
22459 (Populate): Iterate thru the indexers we have and define them too.
22460 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
22461 for the get and set accessors.
22462 (Indexer::Define): Implement.
22464 2001-09-09 Miguel de Icaza <miguel@ximian.com>
22466 * expression.cs (Binary::Resolve): Beginning of it. I scratched
22467 my previous implementation, did not work.
22469 * typemanager.cs: Add a couple of missing types (the longs).
22471 * literal.cs: Use TypeManager.bool_type instead of getting it.
22473 * expression.cs (EventExpr): New kind of expressions.
22474 (Expressio::ExprClassFromMemberInfo): finish
22476 2001-09-08 Miguel de Icaza <miguel@ximian.com>
22478 * assign.cs: Emit stores to static fields differently.
22480 2001-09-08 Ravi Pratap <ravi@ximian.com>
22482 * Merge in changes and adjust code to tackle conflicts. Backed out my
22483 code in Assign::Resolve ;-)
22485 2001-09-08 Ravi Pratap <ravi@ximian.com>
22487 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
22488 instead Report.Error and also pass in the location.
22489 (CSharpParser::Lexer): New readonly property to return the reference
22490 to the Tokenizer object.
22491 (declare_local_variables): Use Report.Error with location instead of plain
22495 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
22496 (Operator.CheckBinaryOperator): Ditto.
22498 * cs-parser.jay (operator_declarator): Update accordingly.
22500 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
22501 (CheckBinaryOperator): Same here.
22503 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
22504 on the name without any prefixes of namespace names etc. This is because we
22505 already might have something already fully qualified like
22506 'System.Console.WriteLine'
22508 * assign.cs (Resolve): Begin implementation. Stuck ;-)
22510 2001-09-07 Ravi Pratap <ravi@ximian.com>
22512 * cs-tokenizer.cs (location): Return a string which also contains
22515 * expression.cs (ElementAccess): New class for expressions of the
22516 type 'element access.'
22517 (BaseAccess): New class for expressions of the type 'base access.'
22518 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
22521 * cs-parser.jay (element_access): Implement action.
22522 (base_access): Implement actions.
22523 (checked_expression, unchecked_expression): Implement.
22525 * cs-parser.jay (local_variable_type): Correct and implement.
22526 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
22528 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
22530 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
22531 name and the specifiers.
22533 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
22535 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
22536 making them all public ;-)
22538 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
22541 2001-09-07 Miguel de Icaza <miguel@ximian.com>
22543 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
22545 (FieldExpr, PropertyExprs): New resolved expressions.
22546 (SimpleName::MemberStaticCheck): Perform static checks for access
22547 to non-static fields on static methods. Maybe this should be
22548 generalized for MemberAccesses.
22549 (SimpleName::ResolveSimpleName): More work on simple name
22552 * cs-parser.jay (primary_expression/qualified_identifier): track
22553 the parameter index.
22555 * codegen.cs (CodeGen::Save): Catch save exception, report error.
22556 (EmitContext::EmitBoolExpression): Chain to expression generation
22557 instead of temporary hack.
22558 (::EmitStatementExpression): Put generic expression code generation.
22560 * assign.cs (Assign::Emit): Implement variable assignments to
22561 local variables, parameters and fields.
22563 2001-09-06 Miguel de Icaza <miguel@ximian.com>
22565 * statement.cs (Block::GetVariableInfo): New method, returns the
22566 VariableInfo for a variable name in a block.
22567 (Block::GetVariableType): Implement in terms of GetVariableInfo
22569 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
22570 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
22572 2001-09-06 Ravi Pratap <ravi@ximian.com>
22574 * cs-parser.jay (operator_declaration): Continue on my quest : update
22575 to take attributes argument.
22576 (event_declaration): Ditto.
22577 (enum_declaration): Ditto.
22578 (indexer_declaration): Ditto.
22580 * class.cs (Operator::Operator): Update constructor accordingly.
22581 (Event::Event): Ditto.
22583 * delegate.cs (Delegate::Delegate): Same here.
22585 * enum.cs (Enum::Enum): Same here.
22587 2001-09-05 Ravi Pratap <ravi@ximian.com>
22589 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
22591 * ../tests/cs0658.cs : New file to demonstrate error 0658.
22593 * attribute.cs (Attributes): New class to encapsulate all attributes which were
22594 being passed around as an arraylist.
22595 (Attributes::AddAttribute): Method to add attribute sections.
22597 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
22598 (struct_declaration): Update accordingly.
22599 (constant_declaration): Update.
22600 (field_declaration): Update.
22601 (method_header): Update.
22602 (fixed_parameter): Update.
22603 (parameter_array): Ditto.
22604 (property_declaration): Ditto.
22605 (destructor_declaration): Ditto.
22607 * class.cs (Struct::Struct): Update constructors accordingly.
22608 (Class::Class): Ditto.
22609 (Field::Field): Ditto.
22610 (Method::Method): Ditto.
22611 (Property::Property): Ditto.
22612 (TypeContainer::OptAttribute): update property's return type.
22614 * interface.cs (Interface.opt_attributes): New member.
22615 (Interface::Interface): Update to take the extra Attributes argument.
22617 * parameter.cs (Parameter::Parameter): Ditto.
22619 * constant.cs (Constant::Constant): Ditto.
22621 * interface.cs (InterfaceMemberBase): New OptAttributes field.
22622 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
22623 the attributes as a parameter.
22624 (InterfaceProperty): Update constructor call.
22625 (InterfaceEvent): Ditto.
22626 (InterfaceMethod): Ditto.
22627 (InterfaceIndexer): Ditto.
22629 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
22630 pass the attributes too.
22631 (interface_event_declaration): Ditto.
22632 (interface_property_declaration): Ditto.
22633 (interface_method_declaration): Ditto.
22634 (interface_declaration): Ditto.
22636 2001-09-05 Miguel de Icaza <miguel@ximian.com>
22638 * class.cs (Method::Define): Track the "static Main" definition to
22639 create an entry point.
22641 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
22642 EntryPoint if we find it.
22644 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
22645 (EmitContext::ig): Make this variable public.
22647 * driver.cs: Make the default output file be the first file name
22648 with the .exe extension.
22650 Detect empty compilations
22652 Handle various kinds of output targets. Handle --target and
22653 rename -t to --dumper.
22655 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
22656 methods inherited from Expression return now an Expression. This
22657 will is used during the tree rewriting as we resolve them during
22660 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
22661 the spec. Missing entirely is the information about
22662 accessability of elements of it.
22664 (Expression::ExprClassFromMemberInfo): New constructor for
22665 Expressions that creates a fully initialized Expression based on
22666 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
22669 (Invocation::Resolve): Begin implementing resolution of invocations.
22671 * literal.cs (StringLiteral): Implement Emit.
22673 2001-09-05 Ravi Pratap <ravi@ximian.com>
22675 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
22678 2001-09-04 Ravi Pratap <ravi@ximian.com>
22680 * cs-parser.jay (attribute_arguments): Implement actions.
22681 (attribute): Fix bug in production. Implement action.
22682 (attribute_list): Implement.
22683 (attribute_target): Implement.
22684 (attribute_target_specifier, opt_target_specifier): Implement
22685 (CheckAttributeTarget): New method to check if the attribute target
22687 (attribute_section): Implement.
22688 (opt_attributes): Implement.
22690 * attribute.cs : New file to handle attributes.
22691 (Attribute): Class to hold attribute info.
22693 * cs-parser.jay (opt_attribute_target_specifier): Remove production
22694 (attribute_section): Modify production to use 2 different rules to
22695 achieve the same thing. 1 s/r conflict down !
22696 Clean out commented, useless, non-reducing dimension_separator rules.
22698 * class.cs (TypeContainer.attributes): New member to hold list
22699 of attributes for a type.
22700 (Struct::Struct): Modify to take one more argument, the attribute list.
22701 (Class::Class): Ditto.
22702 (Field::Field): Ditto.
22703 (Method::Method): Ditto.
22704 (Property::Property): Ditto.
22706 * cs-parser.jay (struct_declaration): Update constructor call to
22707 pass in the attributes too.
22708 (class_declaration): Ditto.
22709 (constant_declaration): Ditto.
22710 (field_declaration): Ditto.
22711 (method_header): Ditto.
22712 (fixed_parameter): Ditto.
22713 (parameter_array): Ditto.
22714 (property_declaration): Ditto.
22716 * constant.cs (Constant::Constant): Update constructor similarly.
22717 Use System.Collections.
22719 * parameter.cs (Parameter::Parameter): Update as above.
22721 2001-09-02 Ravi Pratap <ravi@ximian.com>
22723 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
22724 (TypeContainer.delegates): New member to hold list of delegates.
22726 * cs-parser.jay (delegate_declaration): Implement the action correctly
22727 this time as I seem to be on crack ;-)
22729 2001-09-02 Miguel de Icaza <miguel@ximian.com>
22731 * rootcontext.cs (RootContext::IsNamespace): new function, used to
22732 tell whether an identifier represents a namespace.
22734 * expression.cs (NamespaceExpr): A namespace expression, used only
22735 temporarly during expression resolution.
22736 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
22737 utility functions to resolve names on expressions.
22739 2001-09-01 Miguel de Icaza <miguel@ximian.com>
22741 * codegen.cs: Add hook for StatementExpressions.
22743 * class.cs: Fix inverted test for static flag in methods.
22745 2001-09-02 Ravi Pratap <ravi@ximian.com>
22747 * class.cs (Operator::CheckUnaryOperator): Correct error number used
22748 to make it coincide with MS' number.
22749 (Operator::CheckBinaryOperator): Ditto.
22751 * ../errors/errors.txt : Remove error numbers added earlier.
22753 * ../errors/cs1019.cs : Test case for error # 1019
22755 * ../errros/cs1020.cs : Test case for error # 1020
22757 * cs-parser.jay : Clean out commented cruft.
22758 (dimension_separators, dimension_separator): Comment out. Ostensibly not
22759 used anywhere - non-reducing rule.
22760 (namespace_declarations): Non-reducing rule - comment out.
22762 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
22763 with TypeContainer::AddEnum.
22765 * delegate.cs : New file for delegate handling classes.
22766 (Delegate): Class for declaring delegates.
22768 * makefile : Update.
22770 * cs-parser.jay (delegate_declaration): Implement.
22772 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
22774 * class.cs (Event::Define): Implement.
22775 (Event.EventBuilder): New member.
22777 * class.cs (TypeContainer::Populate): Update to define all enums and events
22779 (Events): New property for the events arraylist we hold. Shouldn't we move to using
22780 readonly fields for all these cases ?
22782 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
22784 * class.cs (Property): Revamp to use the convention of making fields readonly.
22785 Accordingly modify code elsewhere.
22787 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
22788 the Define method of the Property class.
22790 * class.cs : Clean up applied patch and update references to variables etc. Fix
22792 (TypeContainer::Populate): Update to define all the properties we have. Also
22793 define all enumerations.
22795 * enum.cs (Define): Implement.
22797 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
22799 * cs-parser.jay (overloadable_operator): The semantic value is an
22800 enum of the Operator class.
22801 (operator_declarator): Implement actions.
22802 (operator_declaration): Implement.
22804 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
22805 validity of definitions.
22806 (Operator::CheckBinaryOperator): Static method to check for binary operators
22807 (TypeContainer::AddOperator): New method to add an operator to a type.
22809 * cs-parser.jay (indexer_declaration): Added line to actually call the
22810 AddIndexer method so it gets added ;-)
22812 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
22813 already taken care of by the MS compiler ?
22815 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
22817 * class.cs (Operator): New class for operator declarations.
22818 (Operator::OpType): Enum for the various operators.
22820 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
22822 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
22823 ostensibly handle this in semantic analysis.
22825 * cs-parser.jay (general_catch_clause): Comment out
22826 (specific_catch_clauses, specific_catch_clause): Ditto.
22827 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
22828 (catch_args, opt_catch_args): New productions.
22829 (catch_clause): Rewrite to use the new productions above
22830 (catch_clauses): Modify accordingly.
22831 (opt_catch_clauses): New production to use in try_statement
22832 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
22833 and re-write the code in the actions to extract the specific and
22834 general catch clauses by being a little smart ;-)
22836 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
22837 Hooray, try and catch statements parse fine !
22839 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
22841 * statement.cs (Block::GetVariableType): Fix logic to extract the type
22842 string from the hashtable of variables.
22844 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
22845 I end up making that mistake ;-)
22846 (catch_clauses): Fixed gross error which made Key and Value of the
22847 DictionaryEntry the same : $1 !!
22849 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
22851 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
22853 * cs-parser.jay (event_declaration): Correct to remove the semicolon
22854 when the add and remove accessors are specified.
22856 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
22858 * cs-parser.jay (IndexerDeclaration): New helper class to hold
22859 information about indexer_declarator.
22860 (indexer_declarator): Implement actions.
22861 (parsing_indexer): New local boolean used to keep track of whether
22862 we are parsing indexers or properties. This is necessary because
22863 implicit_parameters come into picture even for the get accessor in the
22864 case of an indexer.
22865 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
22867 * class.cs (Indexer): New class for indexer declarations.
22868 (TypeContainer::AddIndexer): New method to add an indexer to a type.
22869 (TypeContainer::indexers): New member to hold list of indexers for the
22872 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
22874 * cs-parser.jay (add_accessor_declaration): Implement action.
22875 (remove_accessor_declaration): Implement action.
22876 (event_accessors_declaration): Implement
22877 (variable_declarators): swap statements for first rule - trivial.
22879 * class.cs (Event): New class to hold information about event
22881 (TypeContainer::AddEvent): New method to add an event to a type
22882 (TypeContainer::events): New member to hold list of events.
22884 * cs-parser.jay (event_declaration): Implement actions.
22886 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
22888 * cs-parser.jay (dim_separators): Implement. Make it a string
22889 concatenating all the commas together, just as they appear.
22890 (opt_dim_separators): Modify accordingly
22891 (rank_specifiers): Update accordingly. Basically do the same
22892 thing - instead, collect the brackets here.
22893 (opt_rank_sepcifiers): Modify accordingly.
22894 (array_type): Modify to actually return the complete type string
22895 instead of ignoring the rank_specifiers.
22896 (expression_list): Implement to collect the expressions
22897 (variable_initializer): Implement. We make it a list of expressions
22898 essentially so that we can handle the array_initializer case neatly too.
22899 (variable_initializer_list): Implement.
22900 (array_initializer): Make it a list of variable_initializers
22901 (opt_array_initializer): Modify accordingly.
22903 * expression.cs (New::NType): Add enumeration to help us
22904 keep track of whether we have an object/delegate creation
22905 or an array creation.
22906 (New:NewType, New::Rank, New::Indices, New::Initializers): New
22907 members to hold data about array creation.
22908 (New:New): Modify to update NewType
22909 (New:New): New Overloaded contructor for the array creation
22912 * cs-parser.jay (array_creation_expression): Implement to call
22913 the overloaded New constructor.
22915 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
22917 * class.cs (TypeContainer::Constructors): Return member
22918 constructors instead of returning null.
22920 2001-08-26 Miguel de Icaza <miguel@ximian.com>
22922 * typemanager.cs (InitCoreTypes): Initialize the various core
22923 types after we have populated the type manager with the user
22924 defined types (this distinction will be important later while
22925 compiling corlib.dll)
22927 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
22928 on Expression Classification. Now all expressions have a method
22929 `Resolve' and a method `Emit'.
22931 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
22932 generation from working. Also add some temporary debugging
22935 2001-08-24 Miguel de Icaza <miguel@ximian.com>
22937 * codegen.cs: Lots of code generation pieces. This is only the
22938 beginning, will continue tomorrow with more touches of polish. We
22939 handle the fundamentals of if, while, do, for, return. Others are
22940 trickier and I need to start working on invocations soon.
22942 * gen-treedump.cs: Bug fix, use s.Increment here instead of
22945 * codegen.cs (EmitContext): New struct, used during code
22946 emission to keep a context. Most of the code generation will be
22949 * cs-parser.jay: Add embedded blocks to the list of statements of
22950 this block. So code generation proceeds in a top down fashion.
22952 2001-08-23 Miguel de Icaza <miguel@ximian.com>
22954 * statement.cs: Add support for multiple child blocks.
22956 2001-08-22 Miguel de Icaza <miguel@ximian.com>
22958 * codegen.cs (EmitCode): New function, will emit the code for a
22959 Block of code given a TypeContainer and its ILGenerator.
22961 * statement.cs (Block): Standard public readonly optimization.
22962 (Block::Block constructors): Link children.
22963 (Block::Child): Child Linker.
22964 (Block::EmitVariables): Emits IL variable declarations.
22966 * class.cs: Drop support for MethodGroups here, delay until
22968 (Method::): Applied the same simplification that I did before, and
22969 move from Properties to public readonly fields.
22970 (Method::ParameterTypes): Returns the parameter types for the
22971 function, and implements a cache that will be useful later when I
22972 do error checking and the semantic analysis on the methods is
22974 (Constructor::GetCallingConvention): Renamed from CallingConvetion
22975 and made a method, optional argument tells whether this is a class
22976 or a structure to apply the `has-this' bit.
22977 (Method::GetCallingConvention): Implement, returns the calling
22979 (Method::Define): Defines the type, a second pass is performed
22980 later to populate the methods.
22982 (Constructor::ParameterTypes): implement a cache similar to the
22983 one on Method::ParameterTypes, useful later when we do semantic
22986 (TypeContainer::EmitMethod): New method. Emits methods.
22988 * expression.cs: Removed MethodGroup class from here.
22990 * parameter.cs (Parameters::GetCallingConvention): new method.
22992 2001-08-21 Miguel de Icaza <miguel@ximian.com>
22994 * class.cs (TypeContainer::Populate): Drop RootContext from the
22997 (Constructor::CallingConvention): Returns the calling convention.
22998 (Constructor::ParameterTypes): Returns the constructor parameter
23001 (TypeContainer::AddConstructor): Keep track of default constructor
23002 and the default static constructor.
23004 (Constructor::) Another class that starts using `public readonly'
23005 instead of properties.
23007 (Constructor::IsDefault): Whether this is a default constructor.
23009 (Field::) use readonly public fields instead of properties also.
23011 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
23012 track of static constructors; If none is used, turn on
23013 BeforeFieldInit in the TypeAttributes.
23015 * cs-parser.jay (opt_argument_list): now the return can be null
23016 for the cases where there are no arguments.
23018 (constructor_declarator): If there is no implicit `base' or
23019 `this', then invoke the default parent constructor.
23021 * modifiers.cs (MethodAttr): New static function maps a set of
23022 modifiers flags into a MethodAttributes enum
23023 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
23024 MethodAttr, TypeAttr to represent the various mappings where the
23025 modifiers are used.
23026 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
23028 2001-08-19 Miguel de Icaza <miguel@ximian.com>
23030 * parameter.cs (GetParameterInfo): Fix bug where there would be no
23033 * interface.cs (PopulateIndexer): Implemented the code generator
23034 for interface indexers.
23036 2001-08-17 Miguel de Icaza <miguel@ximian.com>
23038 * interface.cs (InterfaceMemberBase): Now we track the new status
23041 (PopulateProperty): Implement property population. Woohoo! Got
23042 Methods and Properties going today.
23044 Removed all the properties for interfaces, and replaced them with
23045 `public readonly' fields.
23047 2001-08-16 Miguel de Icaza <miguel@ximian.com>
23049 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
23050 initialize their hashtables/arraylists only when they are needed
23051 instead of doing this always.
23053 * parameter.cs: Handle refs and out parameters.
23055 * cs-parser.jay: Use an ArrayList to construct the arguments
23056 instead of the ParameterCollection, and then cast that to a
23059 * parameter.cs: Drop the use of ParameterCollection and use
23060 instead arrays of Parameters.
23062 (GetParameterInfo): Use the Type, not the Name when resolving
23065 2001-08-13 Miguel de Icaza <miguel@ximian.com>
23067 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
23068 and instead use public readonly fields.
23070 * class.cs: Put back walking code for type containers.
23072 2001-08-11 Miguel de Icaza <miguel@ximian.com>
23074 * class.cs (MakeConstant): Code to define constants.
23076 * rootcontext.cs (LookupType): New function. Used to locate types
23079 2001-08-08 Miguel de Icaza <miguel@ximian.com>
23081 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
23082 this System.Reflection code is. Kudos to Microsoft
23084 * typemanager.cs: Implement a type cache and avoid loading all
23085 types at boot time. Wrap in LookupType the internals. This made
23086 the compiler so much faster. Wow. I rule!
23088 * driver.cs: Make sure we always load mscorlib first (for
23089 debugging purposes, nothing really important).
23091 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
23092 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
23094 * rootcontext.cs: Lookup types on their namespace; Lookup types
23095 on namespaces that have been imported using the `using' keyword.
23097 * class.cs (TypeContainer::TypeAttr): Virtualize.
23098 (Class::TypeAttr): Return attributes suitable for this bad boy.
23099 (Struct::TypeAttr): ditto.
23100 Handle nested classes.
23101 (TypeContainer::) Remove all the type visiting code, it is now
23102 replaced with the rootcontext.cs code
23104 * rootcontext.cs (GetClassBases): Added support for structs.
23106 2001-08-06 Miguel de Icaza <miguel@ximian.com>
23108 * interface.cs, statement.cs, class.cs, parameter.cs,
23109 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
23110 Drop use of TypeRefs, and use strings instead.
23112 2001-08-04 Miguel de Icaza <miguel@ximian.com>
23116 * class.cs (Struct::Struct): set the SEALED flags after
23117 checking the modifiers.
23118 (TypeContainer::TypeAttr): new property, returns the
23119 TypeAttributes for a class.
23121 * cs-parser.jay (type_list): Oops, list production was creating a
23122 new list of base types.
23124 * rootcontext.cs (StdLib): New property.
23125 (GetInterfaceTypeByName): returns an interface by type name, and
23126 encapsulates error handling here.
23127 (GetInterfaces): simplified.
23128 (ResolveTree): Encapsulated all the tree resolution here.
23129 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
23132 * driver.cs: Add support for --nostdlib, to avoid loading the
23133 default assemblies.
23134 (Main): Do not put tree resolution here.
23136 * rootcontext.cs: Beginning of the class resolution.
23138 2001-08-03 Miguel de Icaza <miguel@ximian.com>
23140 * rootcontext.cs: Provide better error reporting.
23142 * cs-parser.jay (interface_base): set our $$ to be interfaces.
23144 * rootcontext.cs (CreateInterface): Handle the case where there
23145 are no parent interfaces.
23147 (CloseTypes): Routine to flush types at the end.
23148 (CreateInterface): Track types.
23149 (GetInterfaces): Returns an array of Types from the list of
23150 defined interfaces.
23152 * typemanager.c (AddUserType): Mechanism to track user types (puts
23153 the type on the global type hash, and allows us to close it at the
23156 2001-08-02 Miguel de Icaza <miguel@ximian.com>
23158 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
23159 RecordInterface instead.
23161 * cs-parser.jay: Updated to reflect changes above.
23163 * decl.cs (Definition): Keep track of the TypeBuilder type that
23164 represents this type here. Not sure we will use it in the long
23165 run, but wont hurt for now.
23167 * driver.cs: Smaller changes to accomodate the new code.
23169 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
23172 * rootcontext.cs (CreateInterface): New method, used to create
23173 the System.TypeBuilder type for interfaces.
23174 (ResolveInterfaces): new entry point to resolve the interface
23176 (CodeGen): Property, used to keep track of the code generator.
23178 2001-07-26 Miguel de Icaza <miguel@ximian.com>
23180 * cs-parser.jay: Add a second production for delegate_declaration
23183 (enum_body): Put an opt_comma here instead of putting it on
23184 enum_body or enum_member_declarations so we can handle trailing
23185 commas on enumeration members. Gets rid of a shift/reduce.
23187 (type_list): Need a COMMA in the middle.
23189 (indexer_declaration): Tell tokenizer to recognize get/set
23191 * Remove old targets.
23193 * Re-add the parser target.
23195 2001-07-13 Simon Cozens <simon@simon-cozens.org>
23197 * cs-parser.jay: Add precendence rules for a number of operators
23198 ot reduce the number of shift/reduce conflicts in the grammar.
23200 2001-07-17 Miguel de Icaza <miguel@ximian.com>
23202 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
23205 Get rid of old crufty code.
23207 * rootcontext.cs: Use this to keep track of the parsed
23208 representation and the defined types available to the program.
23210 * gen-treedump.cs: adjust for new convention.
23212 * type.cs: Split out the type manager, and the assembly builder
23215 * typemanager.cs: the type manager will live here now.
23217 * cil-codegen.cs: And the code generator here.
23219 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
23221 * makefile: Fixed up for easy making.
23223 2001-07-13 Simon Cozens <simon@simon-cozens.org>
23225 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
23228 (unary_expression): Expand pre_increment_expression and
23229 post_decrement_expression to reduce a shift/reduce.
23231 2001-07-11 Simon Cozens
23233 * cs-tokenizer.cs: Hex numbers should begin with a 0.
23235 Improve allow_keyword_as_indent name.
23237 2001-06-19 Miguel de Icaza <miguel@ximian.com>
23239 * Adjustments for Beta2.
23241 2001-06-13 Miguel de Icaza <miguel@ximian.com>
23243 * decl.cs: Added `Define' abstract method.
23244 (InTransit): new property, used to catch recursive definitions.
23246 * interface.cs: Implement `Define'.
23248 * modifiers.cs: Map Modifiers.constants to
23249 System.Reflection.TypeAttribute flags.
23251 * class.cs: Keep track of types and user-defined types.
23252 (BuilderInit): New method for creating an assembly
23253 (ResolveType): New function to launch the resolution process, only
23254 used by interfaces for now.
23256 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
23257 that are inserted into the name space.
23259 2001-06-08 Miguel de Icaza <miguel@ximian.com>
23261 * ARGH. I have screwed up my tree so many times due to the use of
23262 rsync rather than using CVS. Going to fix this at once.
23264 * driver.cs: Objetify driver. Load assemblies, use assemblies to
23267 2001-06-07 Miguel de Icaza <miguel@ximian.com>
23269 * Experiment successful: Use System.Type rather that our own
23272 2001-05-25 Miguel de Icaza <miguel@ximian.com>
23274 * cs-parser.jay: Removed nsAliases from here.
23276 Use new namespaces, handle `using XXX;'
23278 * namespace.cs: Reimplemented namespace handling, use a recursive
23279 definition of the class. Now we can keep track of using clauses
23280 and catch invalid using clauses.
23282 2001-05-24 Miguel de Icaza <miguel@ximian.com>
23284 * gen-treedump.cs: Adapted for all the renaming.
23286 * expression.cs (Expression): this class now has a Type property
23287 which returns an expression Type.
23289 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
23290 `Type', as this has a different meaning now in the base
23292 2001-05-22 Miguel de Icaza <miguel@ximian.com>
23294 * interface.cs, class.cs: Removed from all the sources the
23295 references to signature computation, as we can not do method
23296 signature computation during the parsing time, as we are not
23297 trying to solve at that point distinguishing:
23301 void a (NS.Blah x) {}
23304 Which depending on the context might be valid or not, as we do not
23305 know if Blah is the same thing as NS.Blah at that point.
23307 * Redid everything so the code uses TypeRefs now instead of
23308 Types. TypeRefs are just temporary type placeholders, that need
23309 to be resolved. They initially have a pointer to a string and the
23310 current scope in which they are used. This is used later by the
23311 compiler to resolve the reference to an actual Type.
23313 * DeclSpace is no longer a CIR.Type, and neither are
23314 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
23315 are all DeclSpaces, but no Types.
23317 * type.cs (TypeRefManager): This implements the TypeRef manager,
23318 which keeps track of all the types that need to be resolved after
23319 the parsing has finished.
23321 2001-05-13 Miguel de Icaza <miguel@ximian.com>
23323 * ARGH. We are going to have to store `foreach' as a class rather
23324 than resolving it, as we need to verify error 1579 after name
23325 resolution. *OR* we could keep a flag that says `This request to
23326 IEnumerator comes from a foreach statement' which we can then use
23327 to generate the error.
23329 2001-05-10 Miguel de Icaza <miguel@ximian.com>
23331 * class.cs (TypeContainer.AddMethod): we now add methods to the
23332 MethodGroup instead of the method hashtable.
23334 * expression.cs: Add MethodGroup abstraction, which gets us one
23335 step closer to the specification in the way we handle method
23338 * cs-parser.jay (primary_expression): qualified_identifier now
23339 tried to match up an identifier to a local variable reference or
23340 to a parameter reference.
23342 current_local_parameters is now a parser global variable that
23343 points to the current parameters for the block, used during name
23346 (property_declaration): Now creates an implicit `value' argument to
23349 2001-05-09 Miguel de Icaza <miguel@ximian.com>
23351 * parameter.cs: Do not use `param' arguments as part of the
23352 signature, per the spec.
23354 2001-05-08 Miguel de Icaza <miguel@ximian.com>
23356 * decl.cs: Base class for classes, structs and interfaces. This
23357 is the "Declaration Space"
23359 * cs-parser.jay: Use CheckDef for checking declaration errors
23360 instead of having one on each function.
23362 * class.cs: Factor out some code for handling error handling in
23363 accordance to the "Declarations" section in the "Basic Concepts"
23364 chapter in the ECMA C# spec.
23366 * interface.cs: Make all interface member classes derive from
23367 InterfaceMemberBase.
23369 2001-05-07 Miguel de Icaza <miguel@ximian.com>
23371 * Many things: all interfaces are parsed and generated in
23372 gen-treedump. Support for member variables, constructors,
23373 destructors, properties, constants is there.
23375 Beginning of the IL backend, but very little done, just there for
23378 2001-04-29 Miguel de Icaza <miguel@ximian.com>
23380 * cs-parser.jay: Fix labeled statement.
23382 * cs-tokenizer.cs (escape): Escape " and ' always.
23383 ref_line, ref_name: keep track of the line/filename as instructed
23384 by #line by the compiler.
23387 2001-04-27 Miguel de Icaza <miguel@ximian.com>
23389 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
23390 to match the values in System.CodeDOM.
23392 Divid renamed to Divide.
23394 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
23396 (Statements.set): remove.
23398 * System.CodeDOM/CodeCatchClause.cs: always have a valid
23401 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
23402 falseStatements always have valid values.
23404 * cs-parser.jay: Use System.CodeDOM now.