1 2006-06-13 Martin Baulig <martin@ximian.com>
3 * ecore.cs (SimpleName.DoSimpleNameResolve): Check whether we have
4 type arguments and create a ConstructedType if necessary. Fixes #78400.
6 2006-06-04 Marek Safar <marek.safar@seznam.cz>
8 * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
9 attribute applicable tests for attribute argument.
11 2006-06-02 Raja R Harinath <rharinath@novell.com>
14 * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
15 (Binary.OverloadResolve_PredefinedIntegral): New.
16 (Binary.OverloadResolve_PredefinedFloating): New.
17 (Binary.OverloadResolve_PredefinedString): New.
18 (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
19 Follow the standard more closely, and treat numeric promotions in
20 terms of overload resolution.
21 (Binary.CheckShiftArguments): Simplify.
23 2006-06-01 Raja R Harinath <rharinath@novell.com>
25 * flowanalysis.cs (MyBitVector): Simplify representation.
26 (MyBitVector.Clone): Avoid allocating BitArray.
27 (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
28 (MyBitVector.operator|): Likewise, with MyBitVector.Or.
29 (*): Update. Change all references to MyBitVector.And and
30 MyBitVector.Or to &= and |=.
32 2006-05-31 Raja R Harinath <rharinath@novell.com>
34 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
35 Use bne.un instead of ceq+brfalse.
38 * typemanager.cs (IsUnmanagedType): Disallow generic types and
41 2006-05-29 Raja R Harinath <rharinath@novell.com>
44 * cs-parser.jay (formal_parameter_list): Extend the pattern below
45 to param arguments too.
47 2006-05-26 Miguel de Icaza <miguel@novell.com>
49 * cs-parser.jay: Catch another parsing form for arglist being
50 followed by other arguments. Fixes #78313.
52 2006-05-25 Raja R Harinath <rharinath@novell.com>
55 * expression.cs (Binary.DoResolve): Use Nullable.LiftedBinaryOperator
56 also when one of the operands is a null literal.
57 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality): Rewrite
58 to improve clarity, and generate slightly better code.
60 2006-05-24 Raja R Harinath <rharinath@novell.com>
62 * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
63 checking of out parameters to ...
64 (FlowBranchingToplevel.Merge): ... here.
65 (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
66 set, propagate the origin upward, and only complain if there was
68 (FlowBranchingException.AddContinueOrigin): Likewise.
69 (FlowBranchingException.AddReturnOrigin): Likewise.
70 (FlowBranchingException.AddGotoOrigin): Likewise.
72 2006-05-23 Raja R Harinath <rharinath@novell.com>
74 * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
76 (FlowBranchingException.Merge): Always propagate jumps, even if
77 the finally block renders subsequent code unreachable.
79 2006-05-18 Raja R Harinath <rharinath@novell.com>
82 * statement.cs (Goto.Resolve): Move responsibility for resolving
83 'goto' to FlowBranching.AddGotoOrigin.
84 (Goto.SetResolvedTarget): New. Callback to set the
85 LabeledStatement that's the target of the goto.
86 (Goto.DoEmit): Use Leave instead of Br when crossing an
87 unwind-protect boundary.
88 * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
89 LookupLabel and adjust to new semantics.
90 (FlowBranchingToplevel.AddGotoOrigin): Likewise.
91 (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
92 Goto.SetResolvedTarget to update target.
93 (FlowBranchingLabeled.AddGotoOrigin): Likewise.
94 (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
95 AddBreakOrigin & co. Delay propagation until ...
96 (FlowBranchingException.Merge): ... this.
98 * statement.cs (Block.Resolve): Always depend on flow-branching to
99 determine unreachability. Kill workaround that originally emitted
100 only one statement after an "unreachable" label (see infloop in
103 Fix #77869, #76148, #77755, #75255 and a host of other bugs.
104 This is still "wrong", but anything better would probably need a
105 multi-pass algorithm.
106 * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
107 usage vector. Force current usage vector to be reachable, to
108 optimistically signify backward jumps.
109 (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
111 (FlowBranchingLabeled.Merge): New. If no backward jump was
112 detected, return the original salted-away usage vector instead,
113 updated with appropriate changes. Print unreachable warning if
115 * statement.cs (Block.Resolve): Don't print unreachable warning on
118 2006-05-17 Gert Driesen <drieseng@users.sourceforge.net>
120 * driver.cs: Pass filename without path to AssemblyBuilder's
121 AddResourceFile. Fixes bug #78407.
123 2006-05-17 Raja R Harinath <rharinath@novell.com>
125 * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
126 * flowanalysis.cs (FlowBranchingLabeled): ... here.
127 (FlowBranching.MergeChild): Overwrite
128 reachability information from Labeled branchings too.
130 2006-05-16 Raja R Harinath <rharinath@novell.com>
132 * statement.cs (Goto.Resolve): Merge jump origins here ...
133 * flowanalysis.cs (FlowBranching.Label): ... rather than here.
135 * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
136 (FlowBranchingToplevel.LookupLabel): ... here. Add CS1632 check.
137 (FlowBranchingGoto.LookupLabel): New. Handle back jumps.
138 (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
140 * statement.cs (Goto.Resolve): ... not here.
141 (Goto.Emit): Remove CS1632 check.
143 2006-05-14 Marek Safar <marek.safar@seznam.cz>
145 * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
148 2006-05-11 Raja R Harinath <rharinath@novell.com>
150 * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
151 (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
152 (FlowBranchingException.Label): Likewise.
154 * flowanalysis.cs (MyBitVector.SetAll): New. Sets all bits to the
156 (MyBitVector.Or): Use it to avoid losing information (Count).
157 (FlowBranching.MergeOrigins): Likewise.
159 * flowanalysis.cs (UsageVector.IsDirty): Remove.
160 (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
161 (UsageVector.Locals, UsageVector.LocalVector): Likewise.
162 (UsageVector.ToString): Simplify.
163 (UsageVector.MergeSiblings): Move here from ...
164 (FlowBranching.Merge): ... here.
165 (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
168 2006-05-10 Raja R Harinath <rharinath@novell.com>
170 * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
171 null bitvector is treated as all-true.
173 * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
174 (MyBitVector): Rationalize invariants. 'vector != null' implies
175 that we have our own copy of the bitvector. Otherwise,
176 'InheritsFrom == null' implies all inherited bits are true.
178 2006-05-09 Marek Safar <marek.safar@seznam.cz>
180 * statement.cs (LocalInfo): Add IsConstant.
181 (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
182 local variable for constants.
184 2006-05-09 Raja R Harinath <rharinath@novell.com>
186 * flowanalysis.cs (MyBitVector.Empty): New.
187 (MyBitVector): Don't allow InheritedFrom to be null.
188 (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
189 (UsageVector, FlowBranching): Update to changes.
191 * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
192 recursion. The 'Parent == null' condition isn't sufficient for
194 (FlowBranching.AddBreakOrigin): Likewise.
195 (FlowBranching.AddContinueOrigin): Likewise.
196 (FlowBranching.AddReturnOrigin): Likewise.
197 (FlowBranching.StealFinallyClauses): Likewise.
198 (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
199 (FlowBranching.CheckOutParameters): Likewise.
200 (FlowBranchingToplevel): Terminate all the above recursions here.
201 (FlowBranchingToplevel.End): Rename from MergeTopBlock.
202 * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
204 * flowanalysis.cs (BranchingType.Toplevel): New. Represents a
206 (FlowBranchingToplevel): New. Empty for now.
207 (FlowBranching.MergeTopBlock): Update.
208 * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
209 branching for the anonymous delegate.
210 (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
212 * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
213 (UsageVector.MergeJumpOrigins): Don't ignore current reachability
214 information at the start of the merge. Reorganize.
216 2006-05-07 Marek Safar <marek.safar@seznam.cz>
218 * class.cs (MethodData.Define): Method cannot implement interface accessor.
220 2006-05-07 Marek Safar <marek.safar@seznam.cz>
222 * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
223 to newly introduced ctor.
225 * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
226 message to one place.
227 (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
230 2006-05-07 Marek Safar <marek.safar@seznam.cz>
232 * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
234 * ecore.cs (Expression.ResolveAsConstant): Updated.
236 * statement.cs (ResolveMeta): Updated.
238 2006-05-06 Marek Safar <marek.safar@seznam.cz>
240 * cs-parser.jay: __arglist cannot be used in initializer.
242 2006-05-06 Marek Safar <marek.safar@seznam.cz>
245 * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
248 2006-05-05 Raja R Harinath <rharinath@novell.com>
250 * statement.cs (EmptyStatement.ResolveUnreachable): Override.
251 (LabeledStatement): Add 'name' parameter.
252 (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
253 (Block.AddLabel): Update to changes.
254 * cs-parser.jay (labeled_statement): Likewise.
256 * flowanalysis.cs (BranchingType.Labeled): New.
257 (UsageVector.MergeOrigins): Remove unused 'branching' argument.
258 (FlowBranchingLabeled): New. Does nothing for now, but will
259 eventually handle 'goto' flows.
260 * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
261 * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
262 that's terminated ...
263 (Block.Resolve): ... here.
265 * flowanalysis.cs (UsageVector.MergeFinally): Remove.
266 (UsageVector.MergeFinallyOrigins): Likewise.
267 (FlowBranching.InTryOrCatch): Likewise.
268 (FlowBranching.AddFinallyVector): Likewise.
269 (FlowBranchingException): Update to changes.
272 * statement.cs (Return.Resolve): Move error checking to ...
273 * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
274 (FlowBranchingException): Handle return origins like break and
276 (FlowBranching.UsageVector.CheckOutParameters): Remove.
278 2006-05-04 Marek Safar <marek.safar@seznam.cz>
281 * class.cs (TypeContainer.FindMembers): Includes event method in the methods
284 2006-05-04 Marek Safar <marek.safar@seznam.cz>
287 * class.cs (MethodData.Define): Do public accessor check only when method
288 implements an interface.
290 2006-05-04 Raja R Harinath <rharinath@novell.com>
292 Remove special handling of 'break'
293 * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
294 (Reachability.Meet): Simplify. Remove 'do_breaks' argument.
295 (UsageVector.Break): Remove.
296 (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
298 (FlowBranchingBreakable.Merge): Don't ResetBreaks.
300 * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
301 UsageVector.Breaks (). Don't set NeedsReturnLabel.
303 2006-05-03 Marek Safar <marek.safar@seznam.cz>
306 * pending.cs (PendingImplementation.BaseImplements): A found member cannot
307 be the interface member.
309 2006-05-03 Marek Safar <marek.safar@seznam.cz>
312 * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
313 for emitting small (int) values.
315 2006-05-03 Raja R Harinath <rharinath@novell.com>
318 * flowanalysis.cs (FlowBranchingException.Merge): Ensure
319 control-flow passes through the 'finally' after merging-in all the
320 control-flows from 'try' and the 'catch' clauses.
322 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
323 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
324 always true at the only non-recursive entry point.
325 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
326 FlowBranchingBreakable.
327 (FlowBranchingLoop): Remove.
328 * statement.cs (Return.DoResolve): Update to changes.
331 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
332 (FlowBranching.CreateBranching): Handle it: create a
333 FlowBranchingContinuable.
334 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
335 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
336 except that it handles the 'continue' command.
337 (FlowBranching.UsageVector.MergeOrigins): Rename from
339 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
340 except that it overrides AddContinueOrigin.
341 (FlowBranchingException): Override AddContinueOrigin, similar to
343 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
344 Create a new branching around the embedded statement.
345 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
346 control flow after the embedded statement.
347 (Continue.Resolve): Move all error checking to AddContinueOrigin.
349 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
350 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
351 FlowBranchingBreakable.
352 (FlowBranchingSwitch): Remove.
355 * statement.cs (Break.Resolve): Simplify. Move responsibility for
356 error reporting to ...
357 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
358 Rename from 'AddBreakVector'. Add new location argument. Return
359 a bool indicating whether the 'break' crosses an unwind-protect.
360 (FlowBranchingException.AddBreakOrigin): Add.
361 (FlowBranchingException.Merge): Propagate 'break's to surrounding
362 flowbranching after updating with the effects of the 'finally'
364 (FlowBranchingBreakable): New common base class for
365 FlowBranchingLoop and FlowBranchingSwitch.
367 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
369 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
371 2006-05-02 Raja R Harinath <rharinath@novell.com>
373 * statement.cs (Do.Resolve): If the loop is infinite, set the
375 (While.Resolve, For.Resolve): Set a barrier after the embedded
376 statement. There's no direct control flow that goes from the end
377 of the embedded statement to the end of the loop.
378 * flowanalysis.cs (FlowBranching.Infinite): Remove.
379 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
380 above ensure that the reachability is correctly computed.
382 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
383 (UsageVector.MergeBreakOrigins): If the current path is
384 unreachable, treat it as if all parameters/locals are initialized.
385 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
386 infinite loops before merging-in break origins.
388 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
389 (Reachability.Reachable): Split part into ...
390 (Reachability.Unreachable): ... this. Simplify.
391 (Reachability.IsUnreachable): Use 'Unreachable' instead.
393 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
394 (Reachability.SetThrowsSometimes): Likewise.
395 (FlowBranchingBlock.MergeTopBlock): Don't compare against
396 TriState.Always, use corresponding property.
397 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
398 (Block.Resolve): Likewise. Remove some redundant checks.
400 2006-05-02 Raja R Harinath <harinath@gmail.com>
402 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
403 (Reachability.Meet): Don't bother checking AlwaysThrows --
404 barrier is always set.
405 (FlowBranchingBlock.Merge): Likewise.
407 2006-05-01 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
409 * attribute.cs: fixed_buffer_cache is declared only if NET_2_0 is
410 defined, so it's references should also compile only for NET_2_0
411 (as occurs in mcs version)
413 2006-05-01 Raja R Harinath <harinath@gmail.com>
415 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
416 checks for unreachable.
418 2006-05-01 Marek Safar <marek.safar@seznam.cz>
421 * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
423 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
424 whether field is really assigned.
426 2006-04-30 Raja R Harinath <harinath@gmail.com>
428 * flowanalysis.cs (Reachability): Make 4-argument constructor
430 (Reachability.Meet): Rename from 'And'. Remove static variant.
431 (Reachability.Always): Rename from the highly misleading
432 'Reachability.Never'.
433 (FlowBranching.Merge): Update to changes. Mark an impossible
434 situation with a 'throw'.
435 (*): Update to changes.
437 2006-04-29 Raja R Harinath <harinath@gmail.com>
439 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
441 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
442 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
443 (*): Update to changes.
444 * statement.cs: Update to changes.
446 2006-04-28 Marek Safar <marek.safar@seznam.cz>
449 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
451 2006-04-28 Raja R Harinath <harinath@gmail.com>
453 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
456 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
457 argument to two arguments: an usage-vector and a bool. Move call
458 to FlowBranching.Merge () ...
459 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
461 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
462 handling of loop and switch reachability to ...
463 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
465 2006-04-27 Raja R Harinath <harinath@gmail.com>
467 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
468 handling to FlowBranchingLoop.InLoop.
469 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
471 2006-04-26 Marek Safar <marek.safar@seznam.cz>
474 * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
475 anonymous method is allowed from AnonymousContainer here.
477 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
479 2006-04-24 Raja R Harinath <rharinath@novell.com>
482 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
484 2006-04-23 Marek Safar <marek.safar@seznam.cz>
487 * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
488 (DoubleConstant.Reduce): Ditto.
490 2006-04-23 Raja R Harinath <rharinath@novell.com>
492 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
493 Remove 'lvalue_right_side' argument. Move parts to ...
494 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
495 (LocalVariable.DoResolveLValue): ... these.
497 2006-04-21 Raja R Harinath <rharinath@novell.com>
500 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
501 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
502 (LocalVariableReference.DoResolveBase): Use it to implement new
504 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
505 (Argument.Resolve): Simplify. Move CS1510 check ...
506 * ecore.cs (Expression.ResolveLValue): ... here.
507 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
508 (PropertyExpr.DoResolveLValue): Likewise.
509 (FieldExpr.Report_AssignToReadonly): Likewise.
510 (FieldExpr.DoResolve): Add 'out_access' argument. Use
511 LValueMemberAccess or LValueMemberOutAccess on instance depending
513 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
514 DoResolve as appropriate.
516 2006-04-20 Raja R Harinath <rharinath@novell.com>
519 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
520 implicit conversions on 'out' and 'ref' arguments.
522 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
523 improve clarity. Remove dead code.
526 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
527 (Catch.Resolve): Resolve VarBlock if it exists.
529 2006-04-19 Miguel de Icaza <miguel@novell.com>
531 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
532 twice, this was some residual code, the enumerator was emitted
533 properly in the two branche of if later.
537 Thanks to Martin for finding the source of the problem
539 2006-04-19 Raja R Harinath <rharinath@novell.com>
541 * expression.cs (Cast.ResolveLValue): Remove. The result of a
542 cast is never an lvalue.
543 (Cast.DoResolve, Cast.ResolveRest): Combine.
544 (Argument.Emit): Simplify slightly. Move 'Expr is
545 IMemoryLocation' check ...
546 (Argument.Resolve): ... here.
547 (Argument.Error_LValueRequired): Remove. Inline into only user.
549 Simplifications. Fix cs0191-2.cs
550 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
551 CS1649 and CS1651 to ...
552 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
553 the actual selection of the error code and message to a lookup
554 table. Add a dummy return value to simplify callsites.
555 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
556 readonly fields of other instances of the same type. Move CS0197
558 * expression.cs (Argument.Resolve): ... here. Simplify code.
559 Ensure that ec.InRefOutArgumentResolving is only set during LValue
560 resolution of an out or ref argument. The code simplification
561 above uses this invariant.
563 2006-04-18 Raja R Harinath <rharinath@novell.com>
565 Possibly fix #77752. Fix cs1690-[4-7].cs.
566 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
567 CheckMarshallByRefAccess. Drop parameter.
568 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
570 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
572 * report.cs (AllWarnings): Add CS1690.
573 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
575 (LocalVariableReference.DoResolveBase): Update.
577 2006-04-09 Marek Safar <marek.safar@seznam.cz>
579 * class.cs (MethodOrOperator): Moved common parts from method class.
580 detect obsolete attributes.
581 (Method.Define): Simplified as it reuses code from base.
582 (Constructor.ValidAttributeTargets): Fixed issue found during
584 (Destructor.ValidAttributeTargets): Fixed issue found during
586 (Operator): Finished refactoring set off by #78020. Operator class is now
587 ordinary method class.
589 * anonymous.cs: Updated.
591 2006-04-09 Marek Safar <marek.safar@seznam.cz>
593 * class.cs (Constructor.Emit): Don't emit the attributes twice.
595 2006-04-09 Marek Safar <marek.safar@seznam.cz>
597 * class.cs (Operator.Emit): Extracted code from MethodData to correctly
598 detect obsolete attributes.
599 (Method.CreateEmitContext): Moved to MethodOrOperator.
601 2006-04-09 Marek Safar <marek.safar@seznam.cz>
604 * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
605 customized exception to make crash detection easier.
606 (MethodOrOperator): Started to work on new base class for methods and
608 (Method): Derives from MethodOrOperator.
609 (Constructor.Emit): Emits its own attributes.
610 (AbstractPropertyEventMethod.Emit): Ditto.
611 (Operator): Derives from MethodOrOperator, will refactor fully in extra
613 (Operator.Emit): It's temporary more tricky than should be.
615 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
617 * report.cs (InternalErrorException): Add ctor with inner exception.
619 2006-04-08 Marek Safar <marek.safar@seznam.cz>
622 * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
625 2006-04-07 Marek Safar <marek.safar@seznam.cz>
628 * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
631 2006-04-06 Marek Safar <marek.safar@seznam.cz>
633 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
634 attribute is present and Guid not.
635 (Interface.ApplyAttributeBuilder): Ditto.
637 * attribute.cs: Add error message.
639 2006-04-06 Marek Safar <marek.safar@seznam.cz>
643 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
644 sources (it's composite) so hold them in extra array as they are used in
645 Emit phase only. It worked in the previous versions by mistake.
646 (Attribute.Emit): Emit attribute for more owners when exist.
648 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
649 it has now different behaviour.
651 2006-04-04 Marek Safar <marek.safar@seznam.cz>
653 * constant.cs (Constant.IsDefaultInitializer): New method.
657 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
658 re-initialize default values. It saves KBs almost for every assembly.
659 Thanks Zoltan for the idea.
660 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
661 (ArrayCreation.DoResolve): Resolve only once.
662 (ArrayCreation.Emit): Emit static initializer only when it is faster.
663 (ArrayCreation.GetAttributableValue): Cope with optimized values.
665 2006-04-03 Zoltan Varga <vargaz@gmail.com>
667 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
670 2006-04-01 Marek Safar <marek.safar@seznam.cz>
672 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
673 in an embedded statement too.
675 2006-04-01 Raja R Harinath <rharinath@novell.com>
678 * typemanager.cs (IsNestedChildOf): Drop generic arguments before
682 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
685 * report.cs (SymbolRelatedToPreviousError): Drop generic type
686 arguments before checking whether a type is reflected or not.
689 * expression.cs (Invocation.IsApplicable): Ensure a generic method
690 definition doesn't take part in overload resolution.
691 (Invocation.IsParamsMethodApplicable): Likewise.
692 (Invocation.OverloadResolve): When replacing a reflected override
693 method with its base definition, ensure that type arguments are
696 2006-04-01 Marek Safar <marek.safar@seznam.cz>
700 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
703 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
705 2006-03-31 Marek Safar <marek.safar@seznam.cz>
707 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
710 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
711 LocalTemporary change.
713 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
715 (ClassOrStruct.DefineFieldInitializers): Implemented static field
716 initializers optimization.
717 (ClassOrStruct.TypeAttr): Moved from modifiers.
718 (Constructor.CheckBase): Don't crash when static ctor has parameters.
719 (FieldBase.ResolveInitializer): Resolves initializer.
720 (FieldBase.HasDefaultInitializer): New property.
722 * cs-parser.jay: Removed message.
724 * expression.cs (CompilerGeneratedThis): New specialization.
726 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
728 2006-03-28 Marek Safar <marek.safar@seznam.cz>
730 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
732 2006-03-27 Marek Safar <marek.safar@seznam.cz>
734 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
735 be now EnumConstants only.
737 2006-03-27 Marek Safar <marek.safar@seznam.cz>
739 * attribute.cs, driver.cs: Reset more caches.
741 2006-03-26 Marek Safar <marek.safar@seznam.cz>
743 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
745 2006-03-26 Marek Safar <marek.safar@seznam.cz>
747 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
748 for easier reuse. Updated all overrides.
749 (IntegralConstant): New base class for all integral constants.
750 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
751 of the constant range, report custom error.
752 (UIntConstant.Reduce): Fixed uint conversion.
754 * ecore.cs, literal.cs: Reduce updates.
756 2006-03-26 Marek Safar <marek.safar@seznam.cz>
760 * class.cs (Constructor.Define): Removed extra if for default ctors.
761 A patch from Atsushi Enomoto.
763 2006-03-26 Marek Safar <marek.safar@seznam.cz>
765 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
766 GetAttributableValue.
768 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
771 * convert.cs (ImplicitConversionRequired): Error message moved to
774 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
775 automatic implicit conversion of an output value.
776 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
778 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
780 (TypeOf.GetAttributableValue): Add extra handling for object type.
782 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
783 special error message.
785 2006-03-25 Marek Safar <marek.safar@seznam.cz>
787 * class.cs (Constructor.Emit): Don't crash when struct ctor is
789 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
790 compatible with MS runtime.
792 2006-03-23 Marek Safar <marek.safar@seznam.cz>
794 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
795 attribute arguments here.
797 * class.cs (Indexer.Define): The check was moved to attribute class.
799 2006-03-21 Marek Safar <marek.safar@seznam.cz>
801 * expression.cs (StringConcat.Append): Reverted back to no warning state.
803 2006-03-21 Marek Safar <marek.safar@seznam.cz>
805 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
807 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
810 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
812 * doc-bootstrap.cs : fix build.
814 2006-03-20 Marek Safar <marek.safar@seznam.cz>
816 * expression.cs (StringConcat.Append): Issue a warning when empty string
819 2006-03-20 Marek Safar <marek.safar@seznam.cz>
821 * assign.cs (CompoundAssign.ResolveSource): Removed.
823 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
826 * class.cs (TypeContainer.FindMethods): Removed.
827 (TypeContainer.CheckMemberUsage): Made static.
829 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
831 * constant.cs (CheckRange): Removed unused type argument.
832 (CheckUnsigned): Removed unused type argument.
834 * cs-parser.jay: Updated after MemberAccess clean up.
835 Uses Length for empty string test.
837 * cs-tokenizer.cs: Uses Length for empty string test.
838 (IsCastToken): Made static.
839 (is_hex): Made static.
840 (real_type_suffix): Made static.
842 * decl.cs (SetupCache): Made static.
843 (OnGenerateDocComment): Removed unused ds argument.
845 * delegate.cs (VerifyDelegate): Removed unused argument.
847 * doc.cs: Uses Length for empty string test.
849 * driver.cs: Uses Length for empty string test.
851 * enum.cs (IsValidEnumType): Made static
853 * expression.cs (EnumLiftUp): Removed unused argument.
854 (ResolveMethodGroup): Ditto.
855 (BetterConversion): Ditto.
856 (GetVarargsTypes): Ditto.
857 (UpdateIndices): Ditto.
858 (ValidateInitializers): Ditto.
859 (MemberAccess.ctor): Ditto.
860 (GetIndexersForType): Ditto.
862 * flowanalysis.cs: (MergeFinally): Removed unused argument.
864 * iterators.cs: Updated after MemberAccess clean up.
866 * location.cs: Uses Length for empty string test.
868 * namespace.cs: Uses Length for empty string test.
870 * report.cs (CheckWarningCode): Made static.
872 * statement.cs (LabeledStatement): Removed unused argument.
874 * typemanager.cs (FilterNone): Removed.
876 2006-03-18 Marek Safar <marek.safar@seznam.cz>
878 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
883 2006-03-18 Marek Safar <marek.safar@seznam.cz>
885 * cs-parser.jay.cs: __arglist is not allowed for delegates.
887 2006-03-18 Marek Safar <marek.safar@seznam.cz>
891 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
893 (AnonymousMethod.ImplicitStandardConversionExists): New method.
894 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
895 Add more error reporting; Fixed issue with params.
897 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
899 * cs-parser.jay: AnonymousMethod requires host container.
901 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
903 2006-03-18 Raja R Harinath <harinath@gmail.com>
905 * class.cs: Change 'TypeContainer ds' constructor argument to
906 'DeclSpace parent'. Some classes were missed below due to
907 different naming convention.
909 * class.cs (MemberCore.Parent): Delete. This makes the
910 ParentContainer changes below enforceable by the compiler.
912 Treat pointers to enclosing declaration space as 'DeclSpace', not
914 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
915 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
917 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
919 (Block.AddThisVariable): Likewise.
920 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
921 (AbstractPropertyEventMethod.Emit): Likewise.
922 (AbstractPropertyEventMethod.EmitMethod): Likewise.
923 (GetMethod.Define, SetMethod.Define): Likewise.
924 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
925 (DelegateMethod.EmitMethod): Likewise.
927 Fix regression test-partial-13.cs.
928 Rationalize use of PartialContainer. Ensure that the partial
929 class semantics can be tied to type-correctness, i.e., any
930 violation will cause a compile error.
931 * class.cs, const.cs: Access all fields that belong to class
932 TypeContainer via ParentContainer. Arguments of EmitContexts and
933 Resolve()-like functions still use 'Parent'.
935 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
936 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
937 (PropertyMethod.CheckModifiers): Remove unused argument.
938 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
941 2006-03-28 Raja R Harinath <rharinath@novell.com>
943 * decl.cs (DeclSpace.LookupGeneric): Update to changes.
945 2006-03-17 Raja R Harinath <harinath@gmail.com>
947 Make semantics of PartialContainer simpler.
948 * decl.cs (DeclSpace.IsPartial): Remove.
949 * class.cs (TypeContainer.IsPartial): Likewise.
950 (TypeContainer..ctor): Set PartialContainer to point to self.
951 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
952 (TypeContainer.FindNestedType): Likewise.
953 (MemberCore.ParentContainer): Simplify. Remove deprecation.
955 2006-03-17 Marek Safar <marek.safar@seznam.cz>
957 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
959 2006-03-15 Marek Safar <marek.safar@seznam.cz>
961 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
964 2006-03-15 Marek Safar <marek.safar@seznam.cz>
966 * class.cs (Operator.Define): An error for base conversion was not
969 2006-03-13 Marek Safar <marek.safar@seznam.cz>
971 A fix for #77593, #77574.
973 * class.cs (MethodCore.CheckBase): Another if for operator.
975 2006-03-18 Marek Safar <marek.safar@seznam.cz>
979 * expression.cs (VerifyArgumentsCompat): Reverted to double error
980 reporting, it's more tricky than I thought.
982 2006-03-09 Marek Safar <marek.safar@seznam.cz>
984 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
987 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
988 (DelegateCreation.ImplicitStandardConversionExists): New method for just
991 * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
994 2006-03-04 Marek Safar <marek.safar@seznam.cz>
998 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
999 (Event.Define): ditto
1000 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1002 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1003 Removed redundant code and set NewSlot for Invoke method too.
1005 * parameter.cs (Parameters.ctor): Add custom, type ctor.
1006 (Parameters.MergeGenerated): New method. Use this method when you merge
1007 compiler generated argument with user arguments.
1009 2006-03-03 Marek Safar <marek.safar@seznam.cz>
1011 * attribute.cs (ResolveAsTypeTerminal): Removed.
1013 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1014 specialization for predefined types; 30% speed up.
1015 Finally placed obsolete check to right place.
1016 (Expression.ResolveType): Removed.
1018 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1019 Updated after ResolveType was removed.
1021 * expression.cs (Cast.ctor): Check void cast.
1022 (Binary.ResolveAsTypeTerminal): Is never type.
1023 (Conditional.ResolveAsTypeTerminal): Is never type.
1025 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1027 2006-03-26 Marek Safar <marek.safar@seznam.cz>
1029 * rootcontext.cs (ResolveCore): Removed System.INullableValue.
1031 2006-03-23 Martin Baulig <martin@ximian.com>
1033 * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
1034 type check if either of the types is an open generic type.
1036 2006-03-23 Martin Baulig <martin@ximian.com>
1039 (Convert.ExplicitTypeParameterConversion): New method; implement
1040 explicit type parameter conversions.
1042 2006-03-23 Martin Baulig <martin@ximian.com>
1044 * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
1045 blindly allow all conversions if we do not have any constraints.
1047 2006-02-27 Marek Safar <marek.safar@seznam.cz>
1049 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1050 these two separated members to simplify the code.
1051 (Attribute.Resolve): Refactored to use new fields and methods.
1052 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1053 implemented obsolete attribute checking.
1054 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
1055 implemented obsolete checking again. It look line never ending quest ;-)
1056 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
1058 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
1060 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
1062 *class.cs (Property.Define): Add RegisterProperty call.
1064 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
1065 argument groups (only 2).
1067 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
1068 encoding expression to arguments.
1069 (Expression.ExprClassToResolveFlags): Just turned to property.
1071 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
1072 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
1073 optimized as well as implemented support for zero-length attributes.
1075 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
1076 Add caching of PropertyInfo's.
1078 2006-02-25 Marek Safar <marek.safar@seznam.cz>
1080 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
1081 error multiple times.
1083 2006-02-25 Marek Safar <marek.safar@seznam.cz>
1085 New partial class implementation.
1086 A fix for #77027, #77029, #77403
1088 * attribute.cs (Attributable): Made attributes protected.
1090 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
1091 the replacements of ClassPart and PartialContainer.
1092 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
1093 (TypeContainer.AddInterface): Ditto.
1094 (TypeContainer.AddPartial): The main method for partial classes. It checks
1095 for errors and merges ModFlags and attributes. At the end class is added to
1097 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
1099 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
1100 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
1101 from the rest of partial classes.
1102 (TypeContainer.GetClassBases): Simplified.
1103 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
1105 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
1106 (TypeContainer.HasExplicitLayout): Uses Flags now.
1107 (PartialContainer): Removed.
1108 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
1109 (StaticClass): Was merged with Class.
1110 (Class.GetClassBases): class and static class bases are verified here.
1111 (Class.TypeAttr): Added static attributes when class is static.
1112 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
1113 (MemberBase): In some cases we need to call parent container for partial
1114 class. It should be eliminated but it's not easy now.
1116 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
1118 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
1119 partial classed to accumulate class comments.
1120 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
1122 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
1124 * driver.cs (MainDriver): Tree.GetDecl was removed.
1126 * modifiers.cs (Modifiers): Add partial modifier.
1128 * tree.cs (Tree.decl): Removed.
1129 (RootTypes): Started to use this class more often for root types
1132 2006-03-23 Raja R Harinath <rharinath@novell.com>
1134 * generic.cs (TypeParameter.UpdateConstraints): Update
1135 'constraints' if null.
1137 2006-02-22 Marek Safar <marek.safar@seznam.cz>
1141 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
1142 external interface does not have an attribute.
1144 2006-02-22 Marek Safar <marek.safar@seznam.cz>
1146 Another prerequisites for new partial classs implementation.
1148 * attribute.cs (Attribute.Equal): Implemented.
1149 (Attribute.Emit): Changed as attributes can be applied more than twice.
1150 (Attributes.Emit): Check for duplicate attributes here.
1152 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
1153 as a parameter, clean-up.
1155 2006-02-11 Marek Safar <marek.safar@seznam.cz>
1159 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
1160 contains obsolete attribute check which can in some cases look for base
1161 type of current class which is not initialized yet.
1162 (TypeContainer.BaseType): Replacement of ptype.
1164 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
1166 2006-02-11 Marek Safar <marek.safar@seznam.cz>
1168 First of prerequisites for new partial classs implemention.
1170 * attribute.cs (Attributable): Extended by ResolveContext;
1171 Attributes finally have correct context for resolving in all cases.
1172 (AttachTo): Attribute owner is assigned here.
1174 * codegen.cs (IResolveContext): Introduce new interface to hold
1175 all information needed in resolving phase.
1176 (EmitContext): Implements IResolveContext; more clean-up needed here.
1178 * decl.cs (MemberCore): Implemented IResolveContext.
1180 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
1181 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
1182 parameter.cs, statement.cs, tree.cs, typemanager.cs:
1183 Refactored to use new IResolveContext instead of EmitContext; cleanup
1185 2006-03-22 Raja R Harinath <rharinath@novell.com>
1187 Support ParameterDefaultValueAttribute in gmcs. Also applied to
1188 mcs to keep code differences small.
1189 * attribute.cs (Attribute.GetParameterDefaultValue): New.
1190 * typemanager.cs (parameter_default_value_attribute_type): New.
1191 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
1194 2006-03-22 Martin Baulig <martin@ximian.com>
1197 (Nullable.NullableLiteral): Derive from `NullLiteral'.
1200 (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
1201 instead of the normal `NullLiteral'.
1203 2006-03-21 Martin Baulig <martin@ximian.com>
1206 * generic.cs (TypeManager.InferType): If `pt' is a generic
1207 parameter, don't check whether `pt == at'.
1209 2006-03-20 Raja R Harinath <rharinath@novell.com>
1212 * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
1213 (TypeParameter.Resolve): Update to change.
1214 (ConstraintChecker.CheckConstraints): Resolve type-argument
1215 constraints before use.
1217 2006-03-16 Martin Baulig <martin@ximian.com>
1220 (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
1221 and don't have any instance constructors, also lookup in the base class.
1222 (TypeManager.IsNullableValueType): New public method.
1224 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
1225 `BindingFlags.DeclaredOnly' flag and set `used_cache'.
1226 (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
1228 * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
1229 instead of just TypeManager.IsNullableType() to determine whether
1230 a lifted operator exists.
1231 (UnaryMutator.DoResolve): Likewise.
1232 (Conditional.DoResolve): Likewise.
1233 (Binary.DoResolve): A lifted operator only exists if both operands
1234 are valuetypes and at least one of them is a nullable type.
1236 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
1238 * iterator.cs : yield break is allowed in try statement which has
1239 catch clauses. Fixed bug #77767.
1241 2006-03-12 Martin Baulig <martin@ximian.com>
1243 * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
1244 private IsSignatureEqual() to compare types; see the comment in
1245 that method; fixes #77674.
1247 2006-03-10 Raja R Harinath <rharinath@novell.com>
1249 * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
1250 (Expression.ResolveAsTypeTerminal): Likewise.
1251 * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
1252 * expression.cs, generic.cs, iterators.cs: Likewise.
1253 * parameter.cs, statement.cs, typemanager.cs: Likewise.
1255 2006-03-09 Martin Baulig <martin@ximian.com>
1257 * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
1258 TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
1260 2006-03-09 Martin Baulig <martin@ximian.com>
1262 * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
1263 `prepared' flag is set.
1265 * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
1266 (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
1267 issues; see gtest-254.cs.
1269 2006-03-07 Martin Baulig <martin@ximian.com>
1271 * generic.cs (TypeManager.InferType): Allow infering
1272 `IEnumerable<T>' with an array of T; see gtest-251.cs.
1274 2006-03-06 Martin Baulig <martin@ximian.com>
1277 (TypeManager.InferType): Fix gtest-250.cs.
1280 (TypeManager.IsSubclassOf): Also check the base class.
1283 (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
1286 2006-03-01 Raja R Harinath <rharinath@novell.com>
1289 * expression.cs (ParameterReference.DoResolveBase): Change return
1291 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
1295 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
1298 * typemanager.cs (GetFullNameSignature): Don't nullref on
1299 protected accessors.
1301 2006-02-16 Martin Baulig <martin@ximian.com>
1304 (TypeManager.GetGenericFieldDefinition): New public method; use it
1305 instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
1307 2006-02-14 Martin Baulig <martin@ximian.com>
1309 * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
1311 2006-02-14 Martin Baulig <martin@ximian.com>
1314 (TypeManager.DropGenericMethodArguments): New public method; don't
1315 use GetGenericMethodDefinition() on something which is not a
1318 2006-02-14 Martin Baulig <martin@ximian.com>
1321 (ConstraintChecker.CheckConstraints): If a type parameter has the
1322 `struct' constraint, the type must be a non-nullable valuetype.
1324 2006-02-10 Martin Baulig <martin@ximian.com>
1327 (TypeManager.IsOverride): Make this work for instantiated methods
1328 in a generic class; fixes #77509.
1329 (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
1330 rather than calling it directly; fixes #77488.
1332 2006-02-08 Martin Baulig <martin@ximian.com>
1334 * generic.cs (ConstraintChecker.CheckConstraints): Move the error
1335 reporting into CheckConstraint() so we can use the correctly
1338 2006-02-08 Martin Baulig <martin@ximian.com>
1340 * expression.cs (BaseAccess): Add support for generic methods.
1342 * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
1343 the new MethodGroupExpr.
1345 2006-02-07 Martin Baulig <martin@ximian.com>
1347 * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
1348 also reference types; fixes #77483.
1350 2006-02-07 Martin Baulig <martin@ximian.com>
1353 (TypeManager.IsGenericMethod): We now return whether something is
1354 an instantiated generic method (and not a generic method def).
1355 (TypeManager.IsGenericMethodDefinition): New public method.
1358 (TypeManager.CSharpSignature): Only include type arguments for
1359 "real" generic methods, not for any instantiated method.
1360 (TypeManager.GetMethodName): Likewise, but also allow generic
1361 method definitions here.
1363 2006-02-06 Miguel de Icaza <miguel@novell.com>
1365 * codegen.cs (EmitScopeInitFromBlock): check here the
1366 capture_context, there is no need to make two calls to the
1369 * anonymous.cs: Add some debugging messages that might help me
1370 track other instances of this problem in the future (the
1371 regression of test 467).
1373 * cs-parser.jay: track the variable block, as we need to initalize
1374 any captured variables declared in this block for the "catch"
1375 portion of the "Try" statement.
1377 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
1378 scope initialization for captured variables.
1380 Also, move the emit for the variables after the block location has
1383 2006-02-06 Marek Safar <marek.safar@seznam.cz>
1385 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
1387 2006-02-06 Martin Baulig <martin@ximian.com>
1389 * class.cs (TypeContainer.DefineType): If we're a struct, pass
1390 `TypeManager.value_type' as parent type to
1391 ModuleBuilder.DefineType(). Fixes #77358.
1393 2006-02-02 Miguel de Icaza <miguel@novell.com>
1395 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
1396 commit yesterday, the initialization for the roots is necessary.
1397 What is not necessary is the scope activation.
1399 2006-02-02 Raja R Harinath <rharinath@novell.com>
1401 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
1402 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
1404 (Argument.Resolve): Remove CS0206 checks.
1406 2006-02-01 Miguel de Icaza <miguel@novell.com>
1408 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
1409 scopes for all the roots, the scopes will now be emitted when the
1410 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
1412 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
1413 code. This reduces a lot of existing cruft.
1415 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
1416 that the ScopeInfo is generated as we enter the scope, not at the
1417 time of use, which is what we used to do before.
1419 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
1420 every time a Block is about to be emitted if we have a
1423 2006-02-01 Raja R Harinath <rharinath@novell.com>
1425 * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
1426 attribute for mscorlib too.
1428 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
1430 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
1432 * typemanager.cs (cons_param_array_attribute): Make private.
1433 (Reset): Set it to null.
1434 (InitCoreHelpers): Don't initialize it.
1435 (ConsParamArrayAttribute): New. Initialize it as needed.
1436 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
1438 2006-01-31 Miguel de Icaza <miguel@novell.com>
1440 * expression.cs: There might be errors reported during the
1441 selection of applicable methods. If there are errors, do not
1442 continue execution as it will lead the compiler to crash.
1444 2006-01-30 Miguel de Icaza <miguel@novell.com>
1446 * expression.cs: Member access is not allowed on anonymous
1447 methods. Fixes #77402.
1449 2006-01-30 Raja R Harinath <rharinath@novell.com>
1452 * cs-parser.jay (VariableDeclaration): Don't set
1453 current_array_type to null.
1454 (field_declaration, event_declaration, declaration_statement):
1455 Set it to null here.
1457 2006-01-29 Raja R Harinath <harinath@gmail.com>
1460 * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
1462 2006-01-28 Raja R Harinath <harinath@gmail.com>
1464 * typemanager.cs (GenericParameterPosition): New.
1467 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
1469 * doc.cs : To process "include" elements, first we should create
1470 another list than XmlNodeList, because it could result in node
1471 removal, which could result in that the XmlNodeList gives up
1474 2006-01-25 Miguel de Icaza <miguel@novell.com>
1476 * expression.cs: Introduce an error report that we were not
1477 catching before. Gonzalo ran into it.
1479 2006-01-23 Miguel de Icaza <miguel@novell.com>
1481 A fix for bug: #76957
1483 * iterators.cs (MoveNextMethod.CreateMethodHost): call
1484 ComputeMethodHost before creating the method, this is a new
1487 * anonymous.cs (AnonymousContainer): Now we track all the scopes
1488 that this method references (RegisterScope). The actual scope
1489 where the method is hosted is computed with the ComputeMethodHost
1490 before we create the method.
1492 Moved the Deepest routine here.
1494 (AnonymousContainer.ComputeMethodHost): New routine used to
1495 compute the proper ScopeInfo that will host the anonymous method.
1497 (ScopeInfo): Deal with multiple roots. The problem was that we
1498 did not have a unique root where all ScopeInfos could be hanged
1499 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
1502 Remove AdjustMethodScope which is now computed at the end. Remove
1503 LinkScope which did a partial link, instead link all ScopeInfos
1504 before code generation from the new "LinkScopes" routine.
1506 Simplify all the Add* routines as they no longer need to maintain
1507 the tree, they just need to record that they are using variables
1510 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1511 routines to produce the forest of ScopeInfo trees.
1513 * class.cs (TypeContainer.AppendMethod): This is just like
1514 AddMethod, but ensures that an interface implementation method
1515 (IEnumerable.XXX) is not inserted at the beginning of the queue of
1516 methods, but at the end.
1518 We use this functionality to ensure that the generated MoveNext
1519 method in the iterator class is resolved/emitted before the
1520 enumerator methods created.
1522 This is required because the MoveNext method computes the right
1523 ScopeInfo for the method. And the other methods will eventually
1524 need to resolve and fetch information computed from the anonymous
1528 2006-01-23 Raja R Harinath <rharinath@novell.com>
1530 Improve implementation of section 14.4.2.2 (Better function member).
1531 * expression.cs (Invocation.MoreSpecific): Compare all type
1532 arguments before deciding if one type is more specific than
1533 another. Handle array types too. Return the more specific type.
1534 (Invocation.BetterFunction): Add more tie-breaking rules from
1535 section 14.4.2.2. Perform "more specific" check after
1536 other tie-breaking rules. Compare all parameter types before
1537 choosing the "more specific" method.
1539 2006-01-21 Raja R Harinath <harinath@gmail.com>
1540 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1543 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
1545 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
1546 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
1548 2006-01-18 Martin Baulig <martin@ximian.com>
1550 * class.cs (TypeContainer.AddToMemberContainer): Use
1551 `symbol.MemberName.MethodName' instead of just `symbol.Name';
1554 2006-01-18 Martin Baulig <martin@ximian.com>
1556 Fix #76417: a generic class may now have methods which may unify
1557 for some type parameter substitutions.
1559 * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
1560 for methods which may unify anymore.
1562 * expression.cs (Invocation.MoreSpecific): New private static
1563 method; checks whether one method is more specific than another
1564 according to 14.4.2.2 of the spec.
1565 (Invocation.BetterFunction): Implement the tie-breaking rules from
1566 14.4.2.2 of the spec: if two methods unify for some type parameter
1567 substitution, we need to pick the more specific one.
1569 2006-01-18 Raja R Harinath <rharinath@novell.com>
1571 Fix #76656, cs0231-2.cs.
1572 * cs-parser.jay (formal_parameter_list): Make error case catch
1574 (parenthesized_expression_0): Add CS1026 check.
1575 (invocation_expression): Remove unused { $$ = lexer.Location }.
1577 2006-01-17 Raja R Harinath <rharinath@novell.com>
1580 * cs-parser.jay (statement_expression): Don't list out the
1581 individual statement-expressions. Convert syntax error into
1584 2006-01-16 Raja R Harinath <rharinath@novell.com>
1587 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
1588 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
1589 CheckIntermediateModification.
1590 (FieldExpr.DoResolve): Add new two-argument version that
1591 allows us to resolve the InstanceExpression as an lvalue.
1592 The one-argument variant is now just a wrapper.
1593 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
1594 Resolve the lhs as an lvalue if the it has a value type.
1595 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
1596 from Assign.DoResolve.
1597 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
1598 resolved as an lvalue.
1599 (PropertyExpr.DoResolve): Update.
1600 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
1601 has a value type. Move CS1612 check here from
1602 CheckIntermediateModification.
1603 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
1604 * expression.cs (EmptyExpression.OutAccess): New. Used as the
1605 'right_side' of a ResolveLValue on an 'out' argument.
1606 (EmptyExpression.LValueMemberAccess): New. Used as the
1607 'right_side' of a propagated ResolveLValue on a value type.
1608 (LocalVariableReference.DoResolveBase): Recognize
1609 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
1611 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
1612 EmptyExpression.Null.
1614 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
1616 * typemanager.cs : added IsGenericParameter(). In gmcs it returns
1617 Type.IsGenericParameter(). Fixed bug #77183.
1618 * doc.cs : it is now identical to doc.cs in mcs.
1620 2006-01-16 Martin Baulig <martin@ximian.com>
1622 * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
1624 2006-01-16 Martin Baulig <martin@ximian.com>
1626 * typemanager.cs (TypeManager.CSharpSignature): Make this work for
1627 ctors; fixes #77250.
1629 2006-01-12 Miguel de Icaza <miguel@novell.com>
1631 This fixes the problem where we used ldfld instead of ldflda to
1632 load the "THIS" pointer on captured parameters, when THIS is a
1633 value type. See bug #77205.
1635 * iterators.cs (CapturedThisReference.Emit): Pass false to
1636 EmitThis (we do not need the address).
1638 * codegen.cs (EmitThis): it needs to know whether we need the
1639 address of `this' or not. This is used by value types.
1641 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
1642 every other call passes false.
1644 2006-01-12 Raja R Harinath <rharinath@novell.com>
1647 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
1649 * expression.cs (Invocation.OverloadResolve): Update.
1650 (Invocation.DoResolve): Avoid double resolution of invocation.
1652 2006-01-11 Raja R Harinath <rharinath@novell.com>
1655 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
1656 unary negation of floating point types as 0-expr; negation cannot
1657 overflow in floating point types.
1660 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
1661 on operands of 'void' type.
1664 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
1665 and ExclusiveOr for boolean constants too.
1667 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
1669 * expression.cs: Fix Console.WriteLine ((this = x).foo);
1671 2006-01-12 Miguel de Icaza <miguel@novell.com>
1673 * cs-tokenizer.cs (Position): New class used to save and restore
1674 the position state in the tokenizer. Before this patch the save
1675 and restore was not complete enough so the line and columns would
1676 start to drift and the debugger and stack traces will get the
1679 2006-01-10 Martin Baulig <martin@ximian.com>
1682 (TypeParameter.InflateConstraints): New public method.
1684 * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
1685 constraints; fixes #77042.
1687 2006-01-10 Martin Baulig <martin@ximian.com>
1689 * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
1690 instead of the `TypeBuilder' for this "<>THIS" variable; fixes
1693 2006-01-09 Raja R Harinath <rharinath@novell.com>
1696 * expression.cs (Invocation.OverloadResolve): Replace reflected
1697 override methods with their base virtual methods, rather than
1699 * typemanager.cs (TypeManager.GetOverride): New.
1701 2005-12-21 Miguel de Icaza <miguel@novell.com>
1703 * driver.cs: Report the case of no source files and no -out:
1706 2005-12-20 Raja R Harinath <rharinath@novell.com>
1709 * expression.cs (ComposedCast.GetSignatureForError): Define.
1711 2006-01-05 Jb Evain <jbevain@gmail.com>
1713 * class.cs (Property.Define, Indexer.Define): do not tag the
1714 properties as SpecialName | RTSpecialName.
1716 2006-01-04 Miguel de Icaza <miguel@novell.com>
1718 * class.cs (MethodCore.IsDuplicateImplementation): This method was
1719 doing a low-level comparission of parameter types. It was lacking
1720 a check for __argslist.
1722 2005-12-30 Miguel de Icaza <miguel@novell.com>
1724 * expression.cs (ParameterReference.DoResolveBase): Allow
1725 reference parameters if they are local to this block.
1727 This allows the ref and out parameters of a delegate to be used in
1728 an anonymous method, for example:
1730 delegate void set (out int x);
1732 set s = delegate (out int x){
1736 This is used by functionality introduced late in the C# language.
1738 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1739 method that take ref and out parameters.
1741 Fixes #77119 which was a late change in the spec.
1743 2005-12-23 Miguel de Icaza <miguel@novell.com>
1745 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1746 parent if its the same scope. Fixes #77060.
1748 2005-12-22 Marek Safar <marek.safar@seznam.cz>
1750 * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
1752 2005-12-21 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1754 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
1755 errors 1726 for strong named assemblies with InternalsVisibleToAttribute
1756 that doesn't contain the full public key. This is a update of the
1757 friend assemblies in .Net 2.0 release.
1759 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1763 * namespace.cs (NamespaceEntry): Add extern_aliases as a
1764 ListDictionary, to contain the ExternAliasEntry entries (in
1765 addition to the NamespaceEntry.aliases hashtable). This field is
1766 shared between the original entry and its doppelganger (bodyless
1768 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1769 extern_aliases field.
1770 (NamespaceEntry.Lookup): Move the IsImplicit check after the
1771 lookup in extern_aliases.
1773 2005-12-16 Raja R Harinath <rharinath@novell.com>
1776 * class.cs (TypeContainer.Mark_HasEquals): New.
1777 (TypeContainer.Mark_HasGetHashCode): New.
1778 (ClassPart): Override them.
1779 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1781 * generic.cs (GenericMethod.DefineMembers): Update to changes.
1782 (TypeParameter.TypeParameter): Change type of 'parent' argument to
1786 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1787 'parent' argument to the base constructor.
1789 Remove all mention of TypeContainer from decl.cs.
1790 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1791 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1792 (DeclSpace.DeclSpace): Likewise.
1793 (DeclSpace.DefineMembers): Remove unused argument.
1794 * cs-parser.jay (pop_current_class): Update to changes. Simplify
1795 debugging check -- we don't care if the debug code throws an
1796 InvalidCastException instead of an InternalErrorException.
1797 * class.cs (TypeContainer.DefineMembers): Update to changes.
1798 (TypeContainer.DoDefineMembers): Likewise.
1799 (TypeContainer.GetMethods): Likewise.
1800 (PropertyMember.Define): Likewise.
1801 (MemberBase.Parent): New property that forwards to
1802 MemberCore.Parent, but ensures that we get a TypeContainer.
1803 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1804 (RootContext.PopulateTypes): Likewise. Remove special case code
1805 for !RootContext.StdLib: DefineMembers is idempotent.
1807 2005-12-13 Marek Safar <marek.safar@seznam.cz>
1809 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1811 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
1813 * doc.cs : The search for referenced namespace was insufficient to
1814 get global one as it used to do. Fixed bug #76965.
1816 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
1818 * doc.cs : check name in cref in the last phase that whether it is
1821 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1823 * cs-tokenizer.cs : reverted the latest change: it somehow broke
1826 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1828 * doc.cs : so it turned out that we cannot skip override check for
1829 interface members. Fixed bug #76954.
1831 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1833 * cs-tokenizer.cs : fixed bug #75984:
1834 - #warning and #error should not be handled when the source line
1836 - #line is not checked strictly when the source line is disabled.
1837 - #define and #undef is on the other hand checked strictly at any
1840 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
1842 * cs-tokenizer.cs : missing Location (actually, filename) in one of
1845 2005-12-15 Raja R Harinath <rharinath@novell.com>
1847 * generic.cs (TypeManager.IsGeneric): Remove unused method.
1849 * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
1852 2005-12-14 Martin Baulig <martin@ximian.com>
1854 * typemanager.cs (TypeManager.GetFullName): Make this public;
1855 `Type.Fullname' now never returns null.
1857 * class.cs (Method.Define): Use TypeManager.GetFullName() for
1858 explicit interface implementations; we're now using the same
1859 naming convention than csc does.
1861 2005-12-14 Miguel de Icaza <miguel@novell.com>
1863 * convert.cs (ExplicitConversionCore): Check the return value from
1864 ExplicitConversionCore which can return null on failure. Fixes #76914
1866 2005-12-09 Raja R Harinath <rharinath@novell.com>
1868 * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
1869 instead of IsGenericInstance.
1870 * generic.cs (TypeManager.IsEqual): Likewise. Delete redundant
1871 code that's now covered by the more general test.
1872 * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
1874 * generic.cs (DropGenericTypeArguments): New. Captures the common
1875 pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
1876 * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
1877 * generic.cs, report.cs, typemanager.cs: Likewise.
1879 2005-12-08 Martin Baulig <martin@ximian.com>
1881 * generic.cs (TypeArguments.Resolve): Added CS1547 check.
1883 * typemanager.cs (TypeManager.CSharpSignature): Include type
1884 arguments in the signature of a generic method.
1886 2005-12-07 Martin Baulig <martin@ximian.com>
1888 Add support for custom attributes on type parameters.
1890 * cs-parser.jay (type_arguments): Added `opt_attributes'.
1892 * generic.cs (TypeParameterName): New public class; we use this
1893 instead of a `string' to store the name of a type parameter, so we
1894 can also have `Attributes'.
1895 (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
1896 array instead of a `string[]' array.
1897 (TypeParameter.ctor): We now also take an `Attributes' argument.
1898 (TypeParameter.EmitAttributes): New public method; emit our
1899 `OptAttributes' here.
1900 (GenericMethod.EmitAttributes): New public method; emit the custom
1901 attributes on all our type parameters.
1903 * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
1904 our type parameters.
1905 (MethodData.Define): If we're a generic method, call
1906 EmitAttributes() on it.
1908 2005-12-07 Martin Baulig <martin@ximian.com>
1911 (ConstraintChecker): New public abstract class; move the
1912 constraint checking here from `ConstructedType' and also do
1913 constraint checking for generic methods here.
1915 * expression.cs (Invocation.OverloadResolve): Use
1916 ConstraintChecker.CheckConstraints() if we resolved to a generic
1919 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1921 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1923 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1925 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1926 (FieldBase.Initializer): Initializer is now optional.
1927 (EventField.Define): Only event field can have initializer.
1929 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1931 * const.cs (Const): Reuse initializer.
1933 * cs-parser.jay: Updated after FieldBase changes.
1934 Added current_array_type to simplify array initializers.
1936 * ecore.cs (NullCast.IsDefaultValue): Implemented.
1938 * expression.cs, iterators.cs: Updated.
1940 * namespace.cs (NamespaceEntry): Made UsingFound private.
1942 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1944 * parameterCollection.cs: Obsolete, removed.
1945 * parser.cs: Obsolete, removed.
1947 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1950 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1952 * enum.cs (Enum.Define): Set obsolete context here.
1954 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
1957 - FindDocumentedMember() now expects 1) paramList as null
1958 when "we don't have to check the number of parameters" and
1959 2) Type.EmptyTypes when "there is no arguments".
1960 - Introduced FoundMember struct to hold the exact type which was
1961 used to find the documented member (the above change broke
1962 test-xml-044; it might be better just to use DeclaringType than
1963 what MS does, like this change does, but it depends on usage.)
1965 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
1967 * doc.cs : documented member might be from DeclaringType for nested
1968 types. Fixed bug #76782.
1970 2005-12-03 Ben Maurer <bmaurer@ximian.com>
1972 * anonymous.cs: Have the param code handle leaving copies on the
1973 stack etc. Allows anonymous params to take part in the assignment
1974 code (++, +=, etc). Fixes bug #76550
1976 * expression.cs: Handle the prepare_for_load/leave_copy by passing
1977 it down to the anon code.
1979 * iterators.cs: Use dummy var here
1981 * codegen.cs: Handle new vars
1983 2005-12-01 Marek Safar <marek.safar@seznam.cz>
1986 * class.cs (MethodData.Define): Set proper Obsolete context.
1988 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1990 (FieldExpr.DoResolve): Ditto.
1992 2005-12-01 Marek Safar <marek.safar@seznam.cz>
1995 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1996 parent is not obsolete.
1998 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
2000 * doc.cs : (FindDocumentedMember) find parameterless members first
2001 and get CS0419 in the early stage. Fixed first case of bug #76727.
2003 2005-11-30 Marek Safar <marek.safar@seznam.cz>
2006 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2007 no error was reported.
2009 *expression.cs (Binary.DoResolve): left can be null.
2011 2005-12-06 Raja R Harinath <rharinath@novell.com>
2013 * class.cs (MethodCore.CheckGenericOverride): Delete unused
2014 abstract method and all overrides.
2015 * support.cs (ParameterData.GenericConstraints): Delete.
2016 (ReflectionParameters.type_params): Delete.
2017 (ReflectionParameters.ReflectionParameters): Make private.
2018 (ReflectionParameters.GetConstaints): New factory method.
2019 * generic.cs (TypeParameterDefineType): Use it.
2020 (TypeManager.GetTypeParameterConstraints): Likewise.
2022 2005-11-22 Marek Safar <marek.safar@seznam.cz>
2025 * class.cs (MethodData.Emit): Parameters should be labeled first.
2027 2005-11-21 Marek Safar <marek.safar@seznam.cz>
2030 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2032 2005-11-18 Marek Safar <marek.safar@seznam.cz>
2034 * attribute.cs (AreParametersCompliant): Moved to Parameter.
2036 * class.cs (MethodCore): Parameter clean up.
2037 (IMethodData): Added ParameterInfo.
2038 (MethodData): Parameter clean up.
2039 (Indexer.Define): Parameter clean up.
2051 * typemanager.cs: Parameter clean up.
2053 * delegate.cs (Define): Get rid of duplicated code.
2055 * expression.cs (ParameterReference): Removed useless parameters
2057 (Invocation): Ditto.
2059 * parameter.cs (ParamsParameter): New class, params specialization.
2060 (ArglistParameter): Attemp to separate arglist.
2061 (Parameter): Refactored to be reusable and faster.
2062 (Parameter.Modifier): Made understandable.
2063 (Parameters): Changed to be used as a class for `this' assembly
2064 parameters. Refactored to use new specialized classes.
2066 * support.cs (ParameterData): Added Types property.
2067 (InternalParameters): Deleted.
2069 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2071 * doc.cs : the previous patch does not actually fix the bug.
2072 PropertyInfo override check is now implemented and really fixed it.
2073 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2075 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2077 * doc.cs : apply "override filter" also to properties.
2080 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
2082 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2083 no need to check overrides. For classes, omit those results from
2084 interfaces since they must exist in the class. Fixed bug #76726.
2086 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2088 * typemanager.cs : (GetFullNameSignature) differentiate indexers
2089 with different parameters. Fixed the second problem in #76685.
2091 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2093 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2094 get expected 'protected' access in CheckValidFamilyAccess()).
2097 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
2099 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2100 Fixed bug #76705. CS1569 was incorrectly commented out.
2102 2005-11-23 Martin Baulig <martin@ximian.com>
2104 * generic.cs (Constraints.Define): Removed.
2105 (TypeParameter.DefineConstraints): Removed.
2106 (TypeParameter.DefineType): Call SetGenericParameterAttributes()
2107 on the GenericTypeParameterBuilder here.
2109 2005-11-23 Martin Baulig <martin@ximian.com>
2111 * typemanager.cs (TypeManager.GetProperty): Make this public.
2113 * generic.cs (Nullable.NullableInfo.ctor): Use
2114 TypeManager.GetProperty() rather than using reflection directly.
2116 2005-11-17 Martin Baulig <martin@ximian.com>
2118 * expression.cs (Indexers.GetIndexersForType): Added support for
2119 generic parameters; fixes #76587.
2121 2005-11-17 Martin Baulig <martin@ximian.com>
2124 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2125 inherit the scope from our parent. Fixes #76653.
2127 2005-11-15 Martin Baulig <martin@ximian.com>
2129 * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
2130 instead of `ScopeTypeBuilder' to refer to the "current" type.
2131 (AnonymousMethod.CreateScopeType): Correctly create the helper
2132 class if we're inside a generic type definition.
2134 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
2136 * doc.cs : use Invocation.IsOverride() to do real override check.
2137 * expression.cs : made Invocation.IsOverride() internal.
2139 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
2141 * doc.cs : use TypeManager.FindMembers() instead of (possible)
2142 TypeBuilder.FindMembers() and filter overriden base members out.
2145 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2147 * doc.cs : ref/out parameters are represented as '@' (instead of
2148 '&' in type FullName). Fixed bug #76630 (additionally crefs).
2150 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2152 * doc.cs : when there was no '.' in cref to methods in doc comment,
2153 then parameters were missing in the output. Fixed bug #76691.
2155 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2157 * driver.cs : don't output docs when there is an error.
2160 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2163 Now it should detect indexers. Fixed primary concern in bug #76685.
2164 Fixed CS0419 message to not show the identical member signature in
2167 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
2169 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2170 instead of Type.FindMembers() since it does not handle events.
2173 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
2175 * codegen.cs: Fixed typo (speficied -> specified).
2177 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2180 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2182 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2184 * attribute.cs: Changed error message.
2186 * cs-tokenizer.cs: One more check.
2188 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2190 * statement.cs (Block.Resolve): Ignore empty statement.
2192 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2194 * report.cs: Made error/warning methods more strict to avoid
2197 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
2198 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
2199 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
2200 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2202 2005-11-11 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2204 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute):
2205 Use the more explicit AssemblyName.FullName instead of
2206 AssemblyName.Name to report errors.
2208 2005-11-11 Marek Safar <marek.safar@seznam.cz>
2210 * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
2213 2005-11-10 Marek Safar <marek.safar@seznam.cz>
2223 * report.cs: Fixed error reporting and typos.
2225 * generic.cs (TypeParameter.GetSignatureForError): New method.
2226 (ConstructedType.GetSignatureForError): Instead of DeclarationName.
2228 * typemanager.cs (GetFullName): Refactored.
2230 2005-11-08 Marek Safar <marek.safar@seznam.cz>
2232 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
2233 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
2235 * class.cs (TypeContainer.IsComImport): New property.
2236 (Constructor.Define): Create proper ctor for ComImport types.
2238 * expression.cs (New.CheckComImport): Fixed.
2240 2005-11-07 Miguel de Icaza <miguel@novell.com>
2242 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
2243 that a parameter has been captured does not mean that we do not
2244 have to do the rest of the processing. This fixes the second part
2245 of #76592. If there was another anonymous method capturing
2246 values in the past, the Scope would never be set for the second
2247 method that captured the same parameter.
2249 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
2250 properly manipulate the stack. Second part of fix for #76592.
2252 * expression.cs (New): Add support for invoking "new" on
2253 interfaces that have been flagged with the ComImport attribute and
2254 the CoClass. Fixes #76637
2256 * statement.cs (Try.DoEmit): When a variable is captured, do not
2257 try to emit the vi.LocalBuilder variable as it has been captured.
2258 Create a temporary variable and store the results on the
2259 FieldBuilder. Fixes #76642
2261 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2263 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
2265 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
2267 * expression.cs (Binary.DoResolve): Added && optimalization.
2269 * typemanager.cs (AddUserType): Removed useless argument.
2271 2005-11-04 Marek Safar <marek.safar@seznam.cz>
2273 * statement.cs (Block.variables): Uses ListDictionary.
2275 2005-11-03 Marek Safar <marek.safar@seznam.cz>
2278 * class.cs (PartialContainer.EmitType): Customized to emit
2279 security attributes.
2280 (ClassPart.ApplyAttributeBuilder): Transform security attribute
2281 for partial classes.
2283 2005-11-03 Marek Safar <marek.safar@seznam.cz>
2286 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
2287 access has to be fixed.
2289 * typemanager.cs (IsUnmanagedType): Wrong common field type.
2291 2005-11-01 Marek Safar <marek.safar@seznam.cz>
2294 * ecore.cs (NullCast.Reduce): Implemented.
2296 * expression.cs (ArrayCreation.CheckIndices): Correcly check
2299 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
2301 (Foreach.Resolve): Catch null properly.
2303 2005-10-29 Marek Safar <marek.safar@seznam.cz>
2305 * cs-tokenizer.cs: Warning text fix.
2307 * driver.cs: AllWarningNumbers exposed on public interface.
2309 * report.cs (): Reviewed warning numbers.
2310 (IsValidWarning): Use binary search.
2312 2005-10-29 Marek Safar <marek.safar@seznam.cz>
2314 * driver.cs: Implemeted resource visibility.
2315 (Resources): New class for code sharing between /res: and
2318 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2320 decl.cs (CurrentTypeParameters): Fixed to be public.
2322 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2324 generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
2326 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2328 gmcs.exe.sources: Use CryptoConvert.cs from corlib.
2330 2005-11-05 Kornél Pál <kornelpal@hotmail.com>
2332 * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
2334 2005-11-04 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2336 Add friend assembly access support.
2337 * typemanager.cs: assembly_internals_vis_attrs
2338 cache for friend assembly access.
2339 (TypeManager.IsFriendAssembly): New method for
2340 checking friend assembly access.
2341 (TypeManager.Error_FriendAccessNameNotMatching): New
2343 (TypeManager.CompareKeyTokens): Likewise.
2344 (TypeManager.Filter): Handle friend accessible
2347 * namespace.cs (RootNamespace.GetTypeInAssembly): Return
2348 friend accessible types.
2350 * ecore.cs (Expression.IsAccessorAccessible): Handle
2351 friend accessible properties.
2353 * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
2356 2005-10-28 Marek Safar <marek.safar@seznam.cz>
2359 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
2362 * convert (Convert.ImplicitReferenceConversion): NullCast holds
2365 * ecore.cs (NullCast): Child is contant only.
2367 * literal.cs (NullLiteral.Reduce): null can be converted to any
2370 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
2372 * driver.cs: Use Encoding.Default as default code page instead
2375 2005-10-27 Raja R Harinath <rharinath@novell.com>
2378 * expression.cs (Invocation.Error_InvalidArguments): Handle
2379 __arglist parameters.
2380 (Invocation.VerifyArgumentsCompat): Likewise.
2381 * support.cs (ReflectionParameters.GetSignatureForError): Print
2382 __arglist parameters.
2383 (InternalParamters.GetSignatureForError): Likewise.
2384 * parameter.cs (Parameters.GetSignatureForError): Likewise.
2386 2005-10-26 Marek Safar <marek.safar@seznam.cz>
2388 * attribute.cs (GetPropertyValue): Made public.
2390 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
2392 Add new property WrapNonExceptionThrows to handle 2.0 assembly
2394 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
2397 * driver.cs: Reflect method name change.
2399 * statement.cs (Try.Resolve): Warn when try has both general
2402 * typemanager.cs: runtime_compatibility_attr_type new predefined
2405 2005-10-26 Raja R Harinath <harinath@gmail.com>
2408 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
2409 treat it as an empty parameter list.
2411 2005-10-26 Raja R Harinath <rharinath@novell.com>
2414 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
2415 ResolveAsTypeStep silent.
2416 * statement.cs (Block.AddConstant): Mark block as used.
2417 (Block.ResolveMeta): Avoid piling on error messages
2418 if a constant initializer resolution fails.
2420 2005-10-25 Raja R Harinath <rharinath@novell.com>
2422 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
2424 (NamespaceEntry.VerifyAllUsing): New.
2425 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
2426 behaviour. Delegates actual resolution of alias to ...
2427 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
2428 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
2430 * driver.cs (Driver.MainDriver): Update.
2432 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
2433 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
2435 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
2437 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
2438 RootNamespace.DefineNamespacesForAll.
2440 2005-10-24 Raja R Harinath <harinath@gmail.com>
2442 * typemanager.cs (assemblies, external_aliases, modules)
2443 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
2444 (ComputeNamespaces, GetRootNamespace): Remove extra staging
2445 overhead. Move resposibility ...
2446 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
2447 * driver.cs, attribute.cs, codegen.cs: Update to changes.
2449 2005-10-23 Raja R Harinath <harinath@gmail.com>
2451 * namespace.cs (RootNamespace.all_namespaces): Renamed from
2452 cached_namespaces. Improve usage.
2453 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
2454 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
2455 Move from GlobalRootNamespace and simplify.
2456 (RootNamespace.Global): Make instance variable.
2457 (RootNamespace.RootNamespace): Add "alias name" parameter.
2458 (GlobalRootNamespace): Simplify drastically.
2459 (Namespace.Lookup): Don't use GetNamespace.
2460 * typemanager.cs (GetRootNamespace): Rename from
2461 ComputeNamespaceForAlias.
2462 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2464 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2466 * anonymous.cs (AnonymousContainer): Don't crash when container
2469 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2471 * expression.cs (Binary.DoResolve): Warn when comparing same
2474 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2477 * expression.cs (Binary.DoResolve): It looks like there are no
2478 convetsion rules in enum context.
2480 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2482 Add support for extern alias qualifiers.
2483 * typemanager.cs: Move some LookupTypeReflection code
2484 to namespace.cs, to have cleaner code. Added some methods
2485 to help us keep track of the extern aliased references.
2486 * driver.cs: Add suport for extern alias assemblies on command
2487 line and check for their warnings/errors. Also keep track of the
2488 extern aliased assemblies.
2489 * namespace.cs: Move the global functionality of Namespace
2490 to GlobalRootNamespace/RootNamespace. Now the global namespace
2491 is GlobalRootNamespace.Globa. Also the code moved from
2492 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
2493 Finally added LocalAliasEntry (AliasEntry before) and
2494 ExternAliasEntry, to handle alias statements.
2495 * cs-parser.jay: Add support in the grammar for extern alias
2497 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
2498 Update callings to Namespace (now in GlobalRootNamespace).
2500 2005-10-25 Martin Baulig <martin@ximian.com>
2502 * convert.cs (ImplicitTypeParameterConversion): Make base
2503 interfaces actually work; fixes #76557.
2505 2005-10-25 Martin Baulig <martin@ximian.com>
2508 (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
2509 all the type parameters; fixes #76551.
2511 2005-10-25 Martin Baulig <martin@ximian.com>
2516 (GenericMethod.ctor): Added `Expression return_type' and
2517 `Parameters parameters' arguments.
2518 (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
2519 parameter and return types to check their constraints if they're
2522 * codegen.cs (EmitContext.ResolvingGenericMethod): New public
2525 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
2526 constraints of a generic type if `ec.ResolvingGenericMethod'.
2528 * class.cs (MethodCore.DoDefineParameters): Set
2529 `ec.ResolvingGenericMethod' if we're a generic method.
2530 (MemberBase.MemberType): Likewise.
2532 2005-10-25 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2534 * typemanager.cs (TypeManager): Added
2535 TypeManager.internals_visible_attr_type to cache
2536 S.R.CompilerServices.InternalsVisibleToAttribute.
2538 * codegen.cs (AssemblyClass): Added checks for
2539 InternalsVisibleToAttribute in new method
2540 CheckInternalsVisibleAttribute () and also cache the
2541 AssemblyName in AssemblyClass.Name.
2543 2005-10-24 Martin Baulig <martin@ximian.com>
2546 (TypeManager.ExpandInterfaces): Added overloaded version which
2547 just takes a `Type[]' array.
2550 (Constraints.Resolve): Don't expand the interfaces here; ie. we
2551 just use the interfaces which were explicitly specified and not
2552 the interfaces they inherit. Fixes #76482.
2553 (TypeParameter.FindMembers): Expand the interfaces here.
2555 2005-10-21 Martin Baulig <martin@ximian.com>
2558 (Constraints.Resolve): Also resolve the actual types here.
2559 (Constraints.ResolveTypes): Just check the constraints here.
2560 Fixes #76363; see gtest-218.cs.
2562 2005-10-21 Martin Baulig <martin@ximian.com>
2565 (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
2566 instead of a `BoxedCast'; fixes gtest-217.cs.
2568 2005-10-20 Atsushi Enomoto <atsushi@ximian.com>
2570 * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
2571 1) "new()" is specified as generic parameter constraint and 2) the
2572 type is TypeBuilder and 3) the type is abstract even if it has a
2573 default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
2575 2005-10-20 Martin Baulig <martin@ximian.com>
2578 (GenericConstraints.TypeParameter): New public property.
2579 (TypeParameter.ctor): Also take a `DeclSpace' argument.
2580 (TypeParameter.DeclSpace): New public property.
2581 (TypeParameter.DefineType): Inflate the constraints if our
2582 `DeclSpace' is an `Iterator'.
2584 2005-10-19 Atsushi Enomoto <atsushi@ximian.com>
2586 * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added
2587 GenericMethod argument to compare methods' generic type arguments.
2590 2005-10-19 Martin Baulig <martin@ximian.com>
2592 * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
2593 not ResolveType() when resolving the base type, so we're not
2594 checking the constraints here.
2595 (TypeContainer.ResolveType): Call ResolveType() on our base_type
2598 2005-10-19 Martin Baulig <martin@ximian.com>
2600 * generic.cs (ConstructedType.CheckConstraints): Committing
2601 untested fix for #76441.
2603 2005-10-18 Raja R Harinath <rharinath@novell.com>
2606 * class.cs (TypeContainer.DefineType): Move updating of
2607 topological sort earlier in the code.
2608 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2610 2005-10-18 Marek Safar <marek.safar@seznam.cz>
2613 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
2615 * constant.cs (Constant.TryReduce): Moved from Cast class.
2616 (Reduce): Made little bit more OO and fixed missing conversions.
2618 * ecore.cs (Reduce): Implemented.
2619 (Binary.EnumLiftUp): New method to upgrade values to enum values.
2621 * literal.cs (Reduce): Implemented.
2623 * class.cs: Reverted Miguel's wrong commit.
2625 2005-10-14 Miguel de Icaza <miguel@novell.com>
2627 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2629 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
2631 * cs-parser.jay, expression.cs : CS0214 was missing error location
2632 for constants. Fixed bug #76404.
2634 2005-10-10 Raja R Harinath <rharinath@novell.com>
2636 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2638 (PropertyExpr.EmitCall): Likewise.
2639 * expression.cs (Invocation.EmitArguments): Handle case where
2641 (Invocation.EmitCall): Avoid allocating temporary variable if
2642 there are no arguments.
2644 2005-10-11 Marek Safar <marek.safar@seznam.cz>
2647 * convert.cs (ExplicitConversionCore): Fixed object->enum
2650 2005-10-07 Raja R Harinath <rharinath@novell.com>
2653 * convert.cs (ImplicitConversionStandard): Move conversion of
2654 void* to arbitrary pointer types ...
2655 (ExplicitConversionStandard): .. here.
2656 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2657 error to always print typenames.
2659 2005-10-07 Raja R Harinath <rharinath@novell.com>
2661 * convert.cs (GetConversionOperator): Rename from
2662 GetConversionOperators. Move operator selection code from ...
2663 (UserDefinedConversion): ... here.
2665 2005-10-06 Marek Safar <marek.safar@seznam.cz>
2667 * convert.cs (ExplicitConversionCore): Removed duplicate enum
2670 2005-10-05 Marek Safar <marek.safar@seznam.cz>
2672 * assign.cs (Assign.DoResolve): Error method changed.
2674 * cfold.cs (DoConstantNumericPromotions): Error method changed.
2676 * const.cs (ResolveValue): Reset in_transit immediately.
2678 * constant.cs: Error method changed.
2680 * convert.cs: Removed useless location parameter.
2681 (ExplicitNumericConversion): Don't do double enum check.
2682 (ExplicitConversionCore): Renamed from ExplicitConversion.
2683 (ExplicitUnsafe): Extracted from ExplicitConversion.
2684 (ExplicitConversion): Uses for error reporting.
2686 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2688 (ResolveBoolean): Uses common error method.
2689 (CastToDecimal): Get rid of ec.
2690 (CastFromDecimal): Optimized.
2691 (ConvCast): Get rid of ec.
2693 * enum.cs (ResolveValue): Reset in_transit immediately.
2694 (Emit): Return after first error.
2696 * expression.cs: Convert changes.
2698 * literal.cs: Error method changed.
2700 * statement.cs: Error method changed.
2702 2005-10-06 Raja R Harinath <rharinath@novell.com>
2704 Fix gtest-131.cs and gtest-211.cs.
2705 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
2706 Only emit code for a label if it is used. Unreachable code can
2707 violate ECMA evaluation stack invariants.
2709 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2711 * anonymous.cs: Implemented ExprClassName.
2713 * assign.cs (Assign.DoResolve): Don't chrash when type is not
2716 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2719 * class.cs (StaticClass.DefineContainerMembers): Report protected
2722 * codegen.cs: if(ed) PRODUCTION.
2724 * convert.cs (Error_CannotImplicitConversion): Better error
2727 * cs-parser.jay: More error checks.
2729 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2731 * driver.cs (CSCParseOption): Enabled wrong option check.
2733 * ecore.cs (Expression.ExprClassName): Turned to property.
2734 (MemberExpr.CheckIntermediateModification): For checking boxed
2735 value types modification.
2737 * statement.cs (Fixed.Resolve): Expression type must be
2738 convertible to fixed type.
2739 (CollectionForeach.GetEnumeratorFilter,TryType):
2740 Small refactoring for easier error checking.
2742 2005-09-26 Marek Safar <marek.safar@seznam.cz>
2744 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2747 * class.cs (GeneratedBaseInitializer): New class for customization
2748 compiler generated initializers.
2749 (MemberBase.DoDefine): Check Obsolete attribute here.
2750 (FieldMember.DoDefine): Ditto.
2752 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2755 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2756 (MemberCore.GetObsoleteAttribute): Removed argument.
2757 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2758 (MemberCore.CheckObsoleteType): New helper.
2762 * statement.cs: Updates after MemberCore changes.
2764 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2765 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2767 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2768 obsolete attribute for compiler construct.
2769 (As.DoResolve): Cache result.
2771 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2773 2005-10-01 Miguel de Icaza <miguel@novell.com>
2775 * expression.cs (Probe): instead of having a "Type probe_type"
2776 keep the extra information as a TypeExpr probe_type_expr since the
2777 "As" operator needs to perform some type checks.
2779 * (As.DoResolve): If the type is a type parameter, ensure that it
2780 is constrained by a class.
2782 2005-09-22 Miguel de Icaza <miguel@novell.com>
2784 * statement.cs (Lock): Use the TemporaryVariable class instead of
2785 manually using local variables as those do not work when variables
2788 * ecore.cs: Moved the TemporaryVariable class from being a nested
2789 class inside Foreach to be a public class that can be employed in
2792 2005-09-19 Marek Safar <marek.safar@seznam.cz>
2794 * cs-parser.jay: interface_accessors replaced by
2795 accessor_declarations.
2797 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2800 * statement.cs (GotoCase.Resolve): Convert null constant to
2802 (SwitchLabel.ResolveAndReduce): Ditto.
2803 (SwitchLabel.NullStringCase): Custom null stamp.
2804 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2806 typemanager.cs (CSharpSignature): Don't skip first argument
2809 2005-09-16 Marek Safar <marek.safar@seznam.cz>
2811 * cfold.cs, constant.cs, convert.cs, ecore.cs,
2812 expression.cs, iterators.cs, literal.cs: Store constants and
2815 * class.cs (MemberBase.ShortName): Pass location.
2817 * cs-parser.jay: Some location fixes.
2819 * ecore.cs (Expression.Location): Made virtual.
2821 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2824 * const.cs (Const.ResolveValue): Check for assigning non-null
2825 value to reference type.
2827 2005-09-26 Raja R Harinath <rharinath@novell.com>
2830 * expression.cs (This.VerifyFixed): In a value type T, the type of
2831 'this' is T&, iow, 'this' is either an out or ref parameter. In a
2832 value type R, 'this' is treated as a value parameter.
2834 2005-09-05 Miguel de Icaza <miguel@novell.com>
2836 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2837 if the underlying types are the same, otherwise we need to produce
2838 code that will do the proper cast.
2840 This was exposed by Marek's constant rewrite which produced
2841 invalid code for the call site:
2844 void Method (X v) {}
2848 This fixes test-49.cs
2850 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2852 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2853 Type/Object should be allowed as well. Fixed bug #75968.
2855 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2857 * expression.cs : (Binary.DoResolve): when one is enum constant and
2858 another is constant 0, then return enum one *as enum type*.
2861 2005-10-04 Martin Baulig <martin@ximian.com>
2863 * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
2864 `SetMemberIsUsed()' work for generics, too.
2866 2005-10-04 Martin Baulig <martin@ximian.com>
2868 * expression.cs (DelegateInvocation.EmitStatement): Make this work
2869 for corlib. Fixes #75691.
2871 2005-09-28 Marek Safar <marek.safar@seznam.cz>
2874 * driver.cs: Fix compilation files with full root path.
2876 2005-09-25 Miguel de Icaza <miguel@novell.com>
2878 * report.cs (SymbolRelatedToPreviousError): Format the output so
2879 it does not use an open parenthesis that is never closed.
2881 * driver.cs: Follow coding guidelines
2883 2005-09-18 Miguel de Icaza <miguel@novell.com>
2885 * driver.cs: Set InEmacs based on the environment variable EMACS.
2887 * location.cs (InEmacs): in this mode, do not report column
2888 location as it confuses Emacs.
2890 2005-10-03 Raja R Harinath <rharinath@novell.com>
2892 * support.cs (SeekableStreamReader.Position): Don't error out when
2893 the requested position is just beyond the end of the current
2896 2005-09-28 Raja R Harinath <rharinath@novell.com>
2898 * support.cs (SeekableStreamReader): Simplify drastically. Don't
2899 try to keep in sync with the byte count of the underlying Stream.
2900 However, this limits us to a window size of 2048 characters: i.e.,
2901 the maximum lookahead of our lexer/parser can be 2048 characters.
2903 2005-09-22 Martin Baulig <martin@ximian.com>
2905 * driver.cs: Removed a debugging FIXME.
2907 2005-09-21 Raja R Harinath <rharinath@novell.com>
2909 * cs-parser.jay (type_arguments): Add CS1644 check.
2910 * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
2912 2005-09-15 Raja R Harinath <rharinath@novell.com>
2914 * Makefile (PROGRAM): Make profile specific.
2915 (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
2916 the current directory.
2919 * expression.cs (Invocation.EmitCall): Remove optimization on
2920 this_call since it doesn't handle 'this' being a value type.
2922 2005-09-05 Geoff Norton <gnorton@customerdna.com>
2924 * driver.cs: Ensure file handles are closed after parsing
2926 2005-09-05 Miguel de Icaza <miguel@novell.com>
2928 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2929 if the underlying types are the same, otherwise we need to produce
2930 code that will do the proper cast.
2932 This was exposed by Marek's constant rewrite which produced
2933 invalid code for the call site:
2936 void Method (X v) {}
2940 This fixes test-49.cs
2942 2005-09-05 Martin Baulig <martin@ximian.com>
2944 * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
2945 instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
2947 * cs-parser.jay (delegate_declaration): Small fix for #75852.
2949 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2951 * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
2952 to be a pointer type due to the spec 25.2, so check if declaring
2953 type is generic type definition. Fixed bug #75772.
2955 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2958 * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
2959 both types are not defined by methods.
2960 * expression.cs : (Invocation.IsApplicable): it should work when
2961 the argument type is equal to the parameter type, not only when
2962 ImplicitConversionExists() returns true.
2964 2005-09-02 Raja R Harinath <rharinath@novell.com>
2966 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2970 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2971 flow-branching for LocalVariableReferences in case we were invoked
2972 from a MemberAccess.
2973 * expression.cs (LocalVariableReference.VerifyAssigned): New.
2975 (LocalVariableReference.DoResolveBase): ... this.
2976 (MemberAccess.Resolve): Do the check that was disabled during
2979 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
2982 (PartialContainer.Create): check abstract/sealed/static strictly
2983 but abstract/sealed can exist only at one side. Fixed bug #75883.
2985 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
2988 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2989 specified, don't default to UnmanagedType.I4.
2991 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
2993 * expression.cs : conditional operator should check possibly
2994 incorrect assign expression. Fixed bug #75946.
2996 2005-08-30 Raja R Harinath <rharinath@novell.com>
2999 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3000 (ScopeInfo.EmitScopeType): Use it to construct field names from
3001 names of captured locals.
3004 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3005 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3006 Pass 'target_type' to BoxedCast. Don't default to 'object'.
3007 (ExplicitConversion): Remove enum cases already handled by
3008 implicit conversion. Move implicit conversion check to the beginning.
3009 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3010 * expression.cs (ArrayCreation.EmitDynamicInitializers):
3011 Don't treat System.Enum as a struct.
3013 2005-08-30 Jb Evain <jbevain@gmail.com>
3015 * attribute.cs: handles as expression in parameters.
3017 2005-08-30 Raja R Harinath <rharinath@novell.com>
3020 * class.cs (TypeContainer.VerifyClsName): Don't use a
3021 PartialContainer when verifying CLS compliance.
3022 (AbstractPropertyEventMethod): Set Parent here, ...
3023 (PropertyMethod): ... not here.
3025 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
3027 * attribute.cs : escaped attribute name should not be allowed to be
3028 resolved (e.g. @class as classAttribute). Fixed bug #75930.
3030 2005-08-29 Raja R Harinath <rharinath@novell.com>
3033 * convert.cs (ImplicitStandardConversionExists): Allow zero also
3034 when converting a long constant to unsigned long.
3035 * expression.cs (Invocation.OverloadResolve): Add sanity check to
3036 detect where IsApplicable and VerifyArgumentsCompat disagree.
3038 2005-08-29 Raja R Harinath <rharinath@novell.com>
3039 and Carlos Alberto Cortez <carlos@unixmexico.org>
3042 * class.cs (TypeContainer.CanElideInitializer): New helper.
3043 (TypeContainer.EmitFieldInitializers): Use it to determine if we
3044 can safely emitting the initializer of a field.
3046 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3048 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
3049 allowed inside a switch (without loop). Fixed bug #75433.
3051 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
3053 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3054 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3056 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3058 * driver.cs : kinda reverting the default encoding changes (not exact
3059 revert since I noticed that "codepage:reset" might not work fine).
3061 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3063 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
3064 Location. Now getter and setter store location correctly.
3065 (errors/cs0111-12.cs now reports the expected location.)
3067 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3069 * driver.cs : Use default encoding on the environment.
3070 Removed (now that) extra parameter for SeekableStreamReader.
3071 * support.cs : (SeekableStreamReader) third .ctor() argument for
3072 StreamReader is not required (always true). preamble size could
3073 be acquired in simpler and safe way.
3075 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
3077 * cs-parser.jay: report CS0642 at warning level 3
3078 and report CS0642 for an if else statement also
3079 fixes bug #74745. Patch by John Luke (and a bit
3081 Removed extra CS0642 warning check for "while",
3083 * statement.cs: In Block.Resolve(), CS0642 check
3084 is reimplemented to check a sequence of an empty
3085 statement and a block.
3087 Both fix bug #66777.
3089 2005-08-24 Marek Safar <marek.safar@seznam.cz>
3091 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
3092 detection until I fix it.
3094 * cs-tokenizer.cs: Changed error message.
3096 * cs-parser.jay: Fixed 2 error locations.
3098 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
3099 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
3102 * enum.cs (GetSignatureForError): Fixed.
3104 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
3108 * typemanager.cs (RegisterProperty): Removed.
3110 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
3112 2005-08-24 Raja R Harinath <rharinath@novell.com>
3115 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
3116 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
3118 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3120 * expression.cs : tiny fix is required for not warning positive ulong.
3123 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3125 * expression.cs : add CS0652 check for constant and integral
3126 expression. Fixed bug #53974.
3128 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3130 * expression.cs : in DoNumericPromotions(), check if there is implicit
3131 conversion overload for string (to check CS0034). Fixed bug #52492.
3133 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3135 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
3137 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3139 * ecore.cs : report location when it is *not* Null.
3141 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
3147 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
3148 correctly. Fixed bug #75721.
3150 2005-08-23 Raja R Harinath <rharinath@novell.com>
3152 * support.cs (SeekableStreamReader.Position): Avoid an expensive
3153 loop that performs 'min (pos, char_count)'.
3156 * expression.cs (Unary.ResolveOperator): Don't discard implicit
3157 converted value in Operator.OnesComplement.
3159 2005-08-22 Ben Maurer <bmaurer@ximian.com>
3161 * anonymous.cs: If the anon method is pulled into a helper class,
3162 it needs to be `internal' not `private'. Fixes runtime behavior on
3165 2005-08-17 Marek Safar <marek.safar@seznam.cz>
3168 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
3171 2005-08-16 Marek Safar <marek.safar@seznam.cz>
3173 The big constants rewrite
3174 Fix #75746, #75685 and more
3175 As a side effect saved 1MB for MWF ;-)
3177 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
3178 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
3179 enum based for corlib compilation.
3181 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
3184 * class.cs (FixedField.Define): Use ResolveAsConstant.
3186 * const.cs (IConstant): Interface constants and enums.
3187 (Const.ResolveValue): New method for constant resolvning.
3188 (ExternalConstant): Constants from imported assemblies.
3190 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
3191 conversion; like enums.
3192 (Constant.ToType): Converts this constant to different type.
3193 (Constant.Increment): Adds 1.
3195 * convert.cs (ImplicitConversionRequired): Simplified.
3197 * cs-parser.jay: Create EnumMember directly.
3199 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
3201 * doc.cs (GenerateEnumDocComment): Removed.
3203 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
3204 (ConvertIntLiteral): Removed.
3205 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
3207 * enum.cs (EnumMember): Implement IConstant.
3208 (Enum.IsValidEnumConstant): Removed.
3209 (Enum.GetNextDefaultValue): Removed.
3210 (Enum.FindMembers): Updated.
3211 (Enum.GenerateDocComment): Iterate enum members.
3213 * expression.cs (Cast.TryReduce): Handle enums correctly.
3214 (New.Constantify): Made public.
3215 (MemberAccess.DoResolve): Removed contant specific if(s).
3217 * literal.cs (NullLiteral): Implement new abstract methods.
3219 * statement.cs (GotoCase.Resolve): Use new constant methods.
3220 (SwitchLabel.ResolveAndReduce): Use new constant methods.
3222 * typemanager.cs (LookupEnum): Removed.
3223 (IsEnumType): Fixed to work with corlib.
3224 (RegisterConstant): Removed.
3225 (LookupConstant): Removed.
3226 (GetConstant): Changed to work with IConstant.
3228 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
3230 * location.cs : Fixed overflown (>255) column number.
3232 2005-08-03 Raja R Harinath <rharinath@novell.com>
3234 First cut of the qualified-alias-member feature.
3235 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
3237 * cs-parser.jay (DOUBLE_COLON): New token.
3238 (namespace_or_type_name): Add rule for recognizing
3239 qualified-alias-members.
3240 (primary_expression): Likewise.
3241 (element_access): Allow QualifiedAliasMember as a possible
3242 type-bearing expression.
3243 (local_variable_type, local_variable_pointer_type): Likewise.
3244 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
3245 aliases in the current and enclosing namespace declarations.
3246 (NamespaceEntry.UsingAlias): Add CS0440 warning.
3247 * decl.cs (MemberName.is_double_colon): New.
3248 (MemberName.MemberName): Add new constructor for alias-member.
3249 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
3250 * expression.cs (QualifiedAliasMember): New expression type.
3252 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3254 * location.cs : it borked when no argument was specified.
3256 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3258 * location.cs : tiny ToString() format fix.
3260 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3262 * statement.cs : oops, it was missing.
3264 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
3266 A set of fixes for precise line/column location.
3269 "token" field now holds a file/line "delta", a line number offset
3270 from the segment, and a column number. See also:
3271 http://lists.ximian.com/pipermail/mono-devel-list/2004-
3272 December/009508.html
3273 Removed static IsNull. Use instance IsNull property instead.
3275 For some tokens it stores Location. For Identifier it stores
3276 LocatedToken which is a pair of string name and location.
3277 Column numbers are adjusted only at getChar().
3279 Use Location.ToString() for reporting (it now contains column).
3281 Largely modified to use LocatedToken instead of
3282 string (IDENTIFIER), and to acquire Location from some tokens.
3283 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
3284 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
3286 Now MemberName holds Location. DeclSpace.ctor() receives Location
3287 as a parameter. Removed extra parameters to all derived classes.
3288 Replaced Location.IsNull() with instance property.
3289 * assign.cs, expression.cs :
3290 Added .ctor() overload that omits Location.
3292 Added "nameEscaped" flag that indicates the identifier was escaped
3293 in the source file. This fixes bug #57047.
3295 2005-09-02 Martin Baulig <martin@ximian.com>
3297 * class.cs: Make CS3005 a warning, not an error.
3299 2005-08-02 Marek Safar <marek.safar@seznam.cz>
3301 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
3302 New method, looking for lo-case imported cls type.
3304 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
3307 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
3309 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
3311 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
3313 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
3315 Optimized to save 3.5 MB for SWF compilation.
3317 2005-08-01 Marek Safar <marek.safar@seznam.cz>
3319 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
3320 (PartialContainer.Create): Moved logic AddToContainer.
3321 (PartialContainer.MarkForDuplicationCheck): Shares name.
3323 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
3326 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3328 (Namespace.GetSignatureForError): New method.
3330 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3331 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3333 2005-08-01 Raja R Harinath <rharinath@novell.com>
3336 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3337 member lookup rather than qualifier_type, since qualifier_type can
3340 2005-08-01 Marek Safar <marek.safar@seznam.cz>
3342 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3345 2005-07-31 Miguel de Icaza <miguel@novell.com>
3347 * statement.cs: Copy the local exception into the exception
3348 captured local. Fixes 75674
3350 2005-07-31 Raja R Harinath <harinath@gmail.com>
3353 * expression.cs (Invocation.OverloadResolve): Don't report error
3354 CS1501 if error CS1502 has been reported.
3355 (New.DoResolve): Delegate CS1501 reporting to
3356 Invocation.OverloadResolve.
3359 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3360 invariant-meaning-in-block property in an enclosing block if
3363 2005-07-29 Marek Safar <marek.safar@seznam.cz>
3365 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3366 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3367 (Switch.CheckSwitch): Just save 50kb for SWF.
3369 2005-07-27 Martin Baulig <martin@ximian.com>
3371 * anonymous.cs (CaptureContext.AddField): Added
3372 `AnonymousContainer am' argument; compute its toplevel scope if
3373 it's not already computed. Fixes #75649.
3375 2005-07-26 Raja R Harinath <rharinath@novell.com>
3378 * class.cs (Constructor.Emit): Reset block to null if the block
3381 2005-07-25 Marek Safar <marek.safar@seznam.cz>
3383 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3385 2005-07-25 Marek Safar <marek.safar@seznam.cz>
3387 * class.cs (MethodData.Define): Check whether accessor implementing
3388 interface is public.
3390 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3392 2005-07-22 Marek Safar <marek.safar@seznam.cz>
3395 * namespace.cs (LookupType): Moved same type check to...
3397 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3400 2005-07-21 Raja R Harinath <rharinath@novell.com>
3402 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3403 already found a typebuilder.
3404 * class.cs (MethodCore.IsDuplicateImplementation): Compare
3405 MemberNames, not strings.
3407 * const.cs (Error_ExpressionMustBeConst):
3408 Rename from Error_EpressionMustBeConst.
3409 * const.cs, class.cs, statement.cd: Update.
3411 2005-07-21 Marek Safar <marek.safar@seznam.cz>
3415 * const.cs (Const.LookupConstantValue): Report missing contant expression
3417 (Error_EpressionMustBeConstant): Only one error method.
3419 * class.cs, statement.c: Updated.
3421 2005-07-20 Raja R Harinath <rharinath@novell.com>
3423 * statement.cs (Block.Flags): Add back HasVarargs.
3424 (Block.flags): Make protected.
3425 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3427 * typemanager.cs (types, typecontainers, user_types): Remove.
3428 (UserTypes, TypeContainers): Likewise.
3429 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3430 (CleanUp, Reset): Update.
3431 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
3432 (GetNestedType): Use Type.GetNestedType.
3433 (CoreLookupType): Take two arguments, the namespace and the
3434 basename of the type. Update to use the Namespace.Lookup
3436 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3437 (RealMemberLookup): Use IsNestedChildOf instead of playing with
3438 string concatenation and substring matches.
3439 * class.cs, enum.cs, delegate.cs: Update to changes.
3441 2005-07-20 Marek Safar <marek.safar@seznam.cz>
3443 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3444 Expression and made virtual.
3446 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3447 (ImplicitStandardConversionExists): Fixed `byte' typo ?
3449 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3451 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3454 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3457 2005-07-18 Marek Safar <marek.safar@seznam.cz>
3460 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3461 AssemblyCultureAttribute is not used on executable.
3464 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3466 2005-07-16 Raja R Harinath <rharinath@novell.com>
3469 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3470 New. Reports CS0252/CS0253.
3471 Mostly taken from preliminary patch by Duncak Mak.
3472 (Binary.DoResolveOperator): Store results of operator lookup.
3473 Use them to detect if we need to warn about unintended reference
3476 2005-07-15 Raja R Harinath <rharinath@novell.com>
3479 * namespace.cs (Namespace.Lookup): Add back location parameter.
3480 (Namespace.LookupType): Add CS0436 report. Add location parameter.
3481 * delegate.cs, ecore.cs, expression.cs: Update to changes.
3483 * codegen.cs (EmitContext.DeclSpace): Make readonly.
3484 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3485 (Namespace.LookupType): ... this.
3486 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3488 * typemanager.cs (LookupTypeReflection): Remove buggy code that
3489 purported to handle pointers.
3490 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3493 2005-07-15 Marek Safar <marek.safar@seznam.cz>
3495 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3498 2005-07-15 Raja R Harinath <rharinath@novell.com>
3500 * namespace.cs (Namespace.Lookup): Drop location parameter.
3501 (NamespaceEntry.LookupAlias): Remove. Merge into ...
3502 (NamespaceEntry.Lookup): ... this.
3503 (NamespaceEntry.Error_AmbiguousTypeReference):
3504 Move here from DeclSpace.
3505 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3507 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3508 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3509 Move to NamespaceEntry.
3510 * delegate.cs, expression.cs: Update to changes.
3512 2005-08-31 Martin Baulig <martin@ximian.com>
3514 Committing a patch from Atsushi Enomoto for #75850.
3516 * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
3517 Prefer a generic enumerator over a non-generic one.
3519 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
3521 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3522 * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3524 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3526 * driver.cs : reverting default encoding change as well as mcs.
3528 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3530 * driver.cs, support.cs : merged r48826.
3532 > could you integrate your mcs changes to gmcs otherwise
3533 > gmcs cannot compile some files.
3535 2005-08-20 Martin Baulig <martin@ximian.com>
3537 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3538 scope if we don't already have it.
3540 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
3541 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
3544 2005-07-31 Miguel de Icaza <miguel@novell.com>
3546 * statement.cs: Copy the local exception into the exception
3547 captured local. Fixes 75674
3549 2005-07-15 Marek Safar <marek.safar@seznam.cz>
3551 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3554 2005-08-12 Martin Baulig <martin@ximian.com>
3556 * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
3557 for nested types here to avoid hitting the cache too early.
3559 2005-08-09 Miguel de Icaza <miguel@novell.com>
3561 * enum.cs: On the new compiler CLS error 3005 is now a warning not
3564 2005-08-03 Martin Baulig <martin@ximian.com>
3566 Make iterators in generic methods work; see gtest-191.cs.
3569 (Constraints.Resolve): Protect against being called twice.
3572 (TypeContainer.GetClassBases): Make this `protected virtual'.
3574 * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
3575 (Iterator.GetClassBases): Override this and compute the base
3577 (Iterator.DefineNestedTypes): If we're a generic method, all our
3578 method type parameters become class type parameters on the proxy
3582 (ToplevelBlock.Parameters): Make this a property, not a field.
3583 (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
3585 2005-08-03 Martin Baulig <martin@ximian.com>
3587 * typemanager.cs (TypeManager.IsSubclassOf): Use
3588 `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
3589 (TypeManager.GetFullName_recursed): Improved.
3591 2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3594 * ecore.cs (Expression.IsAccessorAccessible): Change the check for
3595 Private accessor case, using TypeManager.IsPrivateAccessible instead of
3596 invocation_type == mi.DeclaringType, since the first one also checks
3597 other condition used by generic instances.
3599 2005-07-27 Martin Baulig <martin@ximian.com>
3601 * anonymous.cs (CaptureContext.AddField): Added
3602 `AnonymousContainer am' argument; compute its toplevel scope if
3603 it's not already computed. Fixes #75649.
3605 2005-07-14 Marek Safar <marek.safar@seznam.cz>
3607 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3608 CheckAttributeType and refactored.
3609 (Attribute.ResolvePossibleAttributeType): Changed to reuse
3610 ResolveAsTypeTerminal error handling.
3611 (ResolveAsTypeTerminal): Introduced because of global attributes extra
3613 (GetSignatureForError): Print errors in same way.
3616 * codegen.cs: Reflect attribute GetSignatureForError change.
3619 * expression.cs: Add silent parameter to ResolveAsTypeStep.
3621 * namespace.cs (UsingEntry): Refactored to make fields private.
3624 statement.cs: Error_UnexpectedKind has extra parameter.
3626 2005-07-14 Raja R Harinath <rharinath@novell.com>
3628 * ecore.cs (IAlias): Remove.
3629 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
3630 that implement the interface.
3631 * namespace.cs (Namespace): Likewise.
3632 (Namespace.declspaces): Renamed from 'defined_names'.
3633 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
3634 DeclSpace instead of an IAlias.
3635 * tree.cs (Tree.AddDecl): Update.
3637 2005-07-12 Raja R Harinath <rharinath@novell.com>
3639 * statement.cs (Block.Flags); Remove HasVarargs.
3640 (Block.HasVarargs): Move to ToplevelBlock.
3641 (Block.ThisVariable, Block.AddThisVariable): Likewise.
3642 (Block.Variables): Make protected. Initialize variable hashtable
3644 (Block.AddVariable): Update.
3645 (Block.Resolve): Update to changes.
3646 (ToplevelBlock.HasVarargs): New boolean.
3647 (ToplevelBlock.ThisVariable): Move here from Block.
3648 (ToplevelBlock.AddThisVariable): Likewise.
3649 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
3650 * expression.cs (This.ResolveBase): Update to changes.
3651 (ArglistAccess.DoResolve): Likewise.
3653 2005-07-11 Marek Safar <marek.safar@seznam.cz>
3656 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3658 * class.cs (TypeContainer.VerifyMembers): Distinguish between
3659 not used and not used & assigned.
3660 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3662 2005-07-11 Marek Safar <marek.safar@seznam.cz>
3665 * expression.cs (Is.DoResolve): null is never provided type.
3667 2005-07-08 Marek Safar <marek.safar@seznam.cz>
3670 * cs-parser.jay: Less strict event error rule to catch more errors.
3672 2005-07-11 Martin Baulig <martin@ximian.com>
3674 * generic.cs (ConstructedType.CheckConstraints): Improve the check
3675 for the constructor constraint: we do not only have to check
3676 whether the class has a public constructor, but also ensure that
3677 it's parameterless. Fixes #75492.
3679 2005-07-11 Martin Baulig <martin@ximian.com>
3681 * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
3682 between type parameters if they either have the reference type
3683 constraint or the class constraint.
3685 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
3687 * generic.cs: Use MakeGenericType instead of BindGenericParameters.
3689 2005-07-07 Marek Safar <marek.safar@seznam.cz>
3692 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3693 (ExtractSecurityPermissionSet): Cope with self referencing security
3694 attributes properly.
3696 * driver.cs (SetOutputFile): Made public property OutputFile.
3698 2005-07-07 Raja R Harinath <rharinath@novell.com>
3701 * class.cs (TypeContainer.first_nonstatic_field): Rename from
3702 has_nonstatic_fields. Make into a FieldBase pointer.
3703 (TypeContainer.AddField): Add CS0282 check.
3704 (TypeContainer.EmitType): Update.
3706 2005-07-06 Miguel de Icaza <miguel@novell.com>
3708 * cs-tokenizer.cs (consume_identifier): Do not create strings to
3709 compare if they start with __.
3711 2005-07-06 Raja R Harinath <rharinath@novell.com>
3713 * statement.cs (Switch.SwitchGoverningType): Only look at
3714 UserCasts that don't need implicit standard conversions to one of
3715 the allowed switch types (Fixes test-322.cs).
3716 (LocalInfo.Resolve): Re-enable sanity-test.
3718 2005-07-06 Marek Safar <marek.safar@seznam.cz>
3720 * cs-tokenizer.cs (consume_identifier): Detect double undescores
3722 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3724 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3726 2005-07-06 Raja R Harinath <rharinath@novell.com>
3729 * ecore.cs (SimpleName.GetSignatureForError): Add.
3730 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3731 (MemberAccess.GetSignatureForError): Add.
3733 2005-07-05 Marek Safar <marek.safar@seznam.cz>
3735 The big error and warning messages review.
3765 * typemanager.cs: Updated.
3767 * class.cs: (MethodCore.SetYields): Moved here to share.
3768 (PropertyMethod.Define): Moved iterator setup here.
3770 * iterators.cs: Add orig_method to have full access to parent
3773 2005-07-05 Raja R Harinath <rharinath@novell.com>
3775 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3776 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3777 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3778 variable of struct type.
3779 * expression.cs (Unary.ResolveOperator): Update to change.
3780 (Indirection.VerifyFixed): Likewise.
3781 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3782 (ParameterReference.VerifyFixed): Value parameters are fixed.
3783 (This.VerifyFixed): Treat 'this' as a value parameter.
3784 * statement.cs (LocalInfo.IsFixed): Remove.
3786 2005-07-01 Martin Baulig <martin@ximian.com>
3788 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3789 `ec.EmitThis ()' to get the correct scope.
3791 2005-07-01 Martin Baulig <martin@ximian.com>
3793 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3794 instance is a ParameterReference; fixes #75299.
3796 2005-06-30 Raja R Harinath <rharinath@novell.com>
3799 * expression.cs (Indexers.map): Remove.
3800 (Indexers.Append): Filter out inaccessible setters and getters.
3801 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3804 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
3806 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3807 (FieldExpr.Emit, PropertyExpr.Emit): Update.
3808 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3809 * expression.cs (Invocation.EmitCall): Add CS0120 check.
3811 2005-06-30 Marek Safar <marek.safar@seznam.cz>
3814 * class.cs (FieldBase.GetInitializerExpression): One more field
3817 2005-06-28 Miguel de Icaza <miguel@novell.com>
3819 * pending.cs: Do not define a proxy if the base method is virtual,
3820 it will be picked up by the runtime (bug 75270).
3822 2005-07-08 Martin Baulig <martin@ximian.com>
3824 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3825 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3827 2005-07-07 Martin Baulig <martin@ximian.com>
3829 * generic.cs (ConstructedType.CheckConstraint): Use
3830 ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
3831 called recursively; fixes #75329.
3833 2005-07-06 Martin Baulig <martin@ximian.com>
3835 * generic.cs (TypeManager.InferTypeArguments): Added support for
3836 anonymous methods; fixes #75461.
3838 2005-07-01 Martin Baulig <martin@ximian.com>
3840 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3841 `ec.EmitThis ()' to get the correct scope.
3843 2005-07-01 Martin Baulig <martin@ximian.com>
3845 * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
3846 instance is `This'; fixes #75299.
3848 2005-06-30 Martin Baulig <martin@ximian.com>
3850 * class.cs (Indexer): Implement IIteratorContainer; added support
3851 for iterators in indexers.
3854 (EmitContext.CurrentIterator): Make this a property, not a field.
3856 * anonymous.cs (AnonymousContainer.Iterator): New public property.
3858 2005-06-28 Miguel de Icaza <miguel@novell.com>
3860 * pending.cs: Do not define a proxy if the base method is virtual,
3861 it will be picked up by the runtime (bug 75270).
3863 2005-06-28 Martin Baulig <martin@ximian.com>
3865 * cs-parser.jay (interface_method_declaration): Avoid a
3866 reduce/reduce conflict by moving some of the code into a separate
3867 `interface_method_declaration_body' rule; fixes #75368.
3869 2005-06-28 Martin Baulig <martin@ximian.com>
3871 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
3872 array check after the check for TypeBuilder's.
3874 2005-06-21 Raja R Harinath <rharinath@novell.com>
3876 * convert.cs (FindMostEncompassedType): Add two trivial special
3877 cases (number_of_types == 0 || number_of_types == 1).
3878 (FindMostEncompasingType): Likewise.
3880 2005-06-17 Raja R Harinath <rharinath@novell.com>
3882 Some cleanups preparing for the fix of #75283.
3883 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3885 (EventExpr.InstanceResolve): Likewise.
3886 (EventExpr.DoResolve): Remove redundant checks.
3888 2005-06-08 Miguel de Icaza <miguel@novell.com>
3890 * class.cs: Small fix.
3892 2005-06-08 Raja R Harinath <rharinath@novell.com>
3895 * class.cs (GetPartialBases): Fix return value check of
3898 2005-06-07 Raja R Harinath <rharinath@novell.com>
3900 Ensure that partial classes are registered in their enclosing
3901 namespace. Initial part of fix of #75160.
3902 * tree.cs (Tree.RecordDecl): Add new namespace argument.
3903 Register declspace with namespace here, not in
3904 DeclSpace.RecordDecl.
3905 * cs-parser.jay: Pass namespace to RecordDecl.
3906 * class.cs (PartialContainer.Create): Likewise.
3907 (ClassPart.DefineType): New sanity-check. Throws an exception if
3909 * decl.cs (Declspace.RecordDecl): Remove.
3910 * namespace.cs (NamespaceEntry.DefineName): Remove.
3912 2005-06-06 Marek Safar <marek.safar@seznam.cz>
3914 * rootcontext.cs: Reset TargetExt as well.
3916 2005-06-03 Raja R Harinath <rharinath@novell.com>
3918 * ecore.cs (Expression.Resolve): Emit CS0654 error when
3921 2005-06-02 Raja R Harinath <rharinath@novell.com>
3923 Fix #75080, cs0119.cs.
3924 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
3926 (Expression.Resolve): ... this. Use it. Remove bogus code
3927 allowing ExprClass.Type and ExprClass.Namespace for
3928 ResolveFlags.VariableOrValue.
3929 (Expression.Resolve) [1-argument variant]: Change default resolve
3930 flags based on language version.
3931 (Expression.Error_UnexpectedKind): Use a simple string array
3932 rather than an ArrayList.
3933 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3935 (TypeOfVoid.DoResolve): Likewise.
3936 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
3937 flags argument -- it always has the same value.
3939 2005-05-31 Raja R Harinath <rharinath@novell.com>
3942 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3943 Use it in the error message.
3944 * assign.cs, expression.cs, statement.cs: Update.
3946 2005-05-30 Raja R Harinath <rharinath@novell.com>
3949 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3950 the "almostMatchedMember" case too.
3951 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3952 that failed the accessibility checks to 'almost_match'.
3954 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
3956 * attribute.cs: Use internal MethodBuilder methods to set
3957 ExactSpelling and SetLastError on PInvoke methods, instead
3958 of passing them via charset. Fixes #75060.
3960 2005-05-27 Raja R Harinath <rharinath@novell.com>
3962 * parameter.cs (Parameter): Remove TODO comment.
3963 (Parameter.DefineParameter): Remove Location parameter.
3964 (Parameters.LabelParameters): Likewise.
3965 * class.cs (Constructor.Emit): Update to change.
3966 (MethodData.Emit): Likewise.
3967 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
3968 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3970 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
3973 Removed Parameters.Location and added Parameter.Location instead.
3974 Removed Location parameter from Emit() and GetSignature().
3981 Modified all related calls.
3983 2005-06-21 Martin Baulig <martin@ximian.com>
3985 * generic.cs (NullCoalescingOperator.Emit): Make this work if the
3986 left-hand side is not a nullable type; fixes #75328.
3988 2005-06-21 Martin Baulig <martin@ximian.com>
3991 (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
3992 (TypeManager.GetFullNameSignature): Likewise.
3994 * convert.cs (Convert.Error_CannotImplicitConversion): Compare
3995 `source.FullName' and `target.FullName' to check whether there are
3996 two conflicting definitions.
3998 2005-06-21 Martin Baulig <martin@ximian.com>
4000 * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
4001 a BoxedCast - also for reference types - to be compatible with csc.
4003 2005-06-21 Martin Baulig <martin@ximian.com>
4005 * expression.cs (MemberAccess.DoResolve): Add support for nested
4006 types in a generic instance; fixes #75320.
4008 2005-06-20 Martin Baulig <martin@ximian.com>
4010 * generic.cs (TypeManager.InferType): Also walk the class
4011 hierarchy for generic instances; fixes #75261.
4013 2005-06-17 Martin Baulig <martin@ximian.com>
4015 * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
4016 to make things work for corlib.
4018 2005-06-15 Martin Baulig <martin@ximian.com>
4020 * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
4021 obsolete `SecurityAction' values.
4023 2005-06-06 Marek Safar <marek.safar@seznam.cz>
4025 * rootcontext.cs: Reset TargetExt as well.
4027 2005-06-09 Martin Baulig <martin@ximian.com>
4029 * delegate.cs (Delegate.VerifyMethod): Added
4030 `MethodGroupExpr old_mg' argument; inherit its
4031 `HasTypeParameters'; fix #75085.
4033 2005-06-09 Martin Baulig <martin@ximian.com>
4035 * expression.cs (Invocation.OverloadResolve): Correctly handle
4036 generic methods for the SetMemberIsUsed(); fix #75064.
4038 2005-06-09 Martin Baulig <martin@ximian.com>
4040 * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
4043 2005-06-08 Martin Baulig <martin@ximian.com>
4045 * cs-parser.jay (nullable_type_or_conditional): If we put the
4046 nullable back and our `type' is a `ComposedCast', remove the
4047 nullable from it. Fixes #75156.
4049 * expression.cs (ComposedCast.RemoveNullable): New public method.
4051 2005-06-08 Martin Baulig <martin@ximian.com>
4053 The big Iterators rewrite :-)
4055 * iterators.cs: Rewrite this to use the anonymous methods framework.
4057 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
4058 before the TypeContainers; see 2test-21.cs.
4061 (TypeContainer.DefineType): Don't create a new EmitContext if we
4062 already have one (this only happens if we're an Iterator).
4063 (TypeContainer.Define): Also call Define() on all our iterators.
4064 (Method.CreateEmitContext): Added support for iterators.
4067 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
4068 (AnonymousContainer.CreateMethodHost): Moved here from
4069 AnonymousMethod and made abstract.
4070 (AnonymousContainer.CreateScopeType): New abstract method.
4071 (AnonymousContainer.IsIterator): New public property.
4072 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
4073 get the ScopeTypeBuilder rather than manually defining it here.
4074 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
4077 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
4078 before RootContext.DefineTypes().
4080 * codegen.cs (EmitContext.RemapToProxy): Removed.
4081 (EmitContext.CurrentAnonymousMethod): Changed type from
4082 AnonymousMethod -> AnonymousContainer.
4083 (EmitContext.ResolveTopBlock): Protect from being called twice.
4084 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
4085 (EmitContext.EmitThis): Removed the iterators hacks; use the
4086 anonymous methods framework for that.
4089 (ToplevelBlock.Container): Make this a property, not a field.
4090 (ToplevelBlock.ReParent): New public method; move the
4091 ToplevelBlock into a new container.
4092 (Foreach.TemporaryVariable): Simplify.
4094 2005-06-05 Martin Baulig <martin@ximian.com>
4096 * statement.cs (LocalInfo.CompilerGenerated): New flag.
4097 (Block.AddTemporaryVariable): New public method; creates a new
4098 `LocalInfo' for a temporary variable.
4099 (Block.EmitMeta): Create the LocalBuilders for all the temporary
4101 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
4102 non-iterator variables.
4104 2005-06-05 Martin Baulig <martin@ximian.com>
4106 * statement.cs (Foreach.TemporaryVariable): Create the
4107 LocalBuilder in the Emit phase and not in Resolve since in some
4108 situations, we don't have an ILGenerator during Resolve; see
4109 2test-19.cs for an example.
4111 2005-06-04 Martin Baulig <martin@ximian.com>
4113 The big Foreach rewrite - Part II.
4115 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
4116 with `PropertyInfo ienumerator_getcurrent'.
4118 * codegen.cs (VariableStorage): Removed.
4121 (Foreach): Derive from Statement, not ExceptionStatement.
4122 (Foreach.CollectionForeach): New nested class. Moved all the code
4123 dealing with collection foreach here.
4124 (Foreach.ForeachHelperMethods): Removed.
4125 (Foreach.TemporaryVariable): Implement IMemoryLocation.
4127 2005-05-23 Martin Baulig <martin@ximian.com>
4129 * statement.cs (Try.DoResolve): Don't create a `finally' if we
4130 don't need to. Fix #75014.
4132 2005-05-26 Raja R Harinath <rharinath@novell.com>
4134 Improve user-defined conversion handling.
4135 * convert.cs (GetConversionOperators): Rewrite. Return only the
4136 applicable operators.
4137 (AddConversionOperators): New. Helper for GetConversionOperators.
4138 (FindMostEncompassedType, FindMostEncompassingType): Verify that
4139 there is only one most encompassed/encompassing type.
4140 (FindMostSpecificSource, FindMostSpecificTarget): Remove
4141 "applicable operator" handling.
4142 (UserConversion): Move cache here from GetConversionOperators.
4143 Directly cache the chosen operator, rather than the whole
4145 (ExplicitNumericConversion): Fix buggy implementation of Decimal
4146 case. Allow conversion of decimal to sbyte and byte too.
4147 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4148 New static methods. Used to avoid allocating EmptyExpressions in
4151 2005-05-24 Duncan Mak <duncan@novell.com>
4153 * ecore.cs (CastFromDecimal): New class for casting a decimal to
4154 another class, used in Convert.ExplicitNumericConversion.
4155 (CastToDecimal): New class, similar to above, but casts to
4156 System.Decimal, used in Convert.ImplicitNumericConversion and also
4157 in explicit convesion from double/float to decimal.
4159 * convert.cs (ImplicitNumericConversion): Handle implicit
4160 conversions to System.Decimal.
4161 (ExplicitNumericConversion): handle explicit conversions to
4166 2005-05-20 Miguel de Icaza <miguel@novell.com>
4168 * typemanager.cs: Do not throw an exception in the TypeBuilder
4169 case, we take care of it on the TypeCode.
4171 2005-05-17 Marek Safar <marek.safar@seznam.cz>
4173 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
4176 * cs-parser.jay: Catch more lexical errors.
4178 * report.cs: Add one more Error method.
4181 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
4183 2005-05-20 Martin Baulig <martin@ximian.com>
4185 * class.cs (TypeContainer.CircularDepException): Removed.
4186 (TypeContainer.DefineType): Removed the `InTransit' stuff.
4187 (TypeContainer.CheckRecursiveDefinition): Check for circular class
4188 (CS0146) and interface (CS0529) dependencies here.
4190 2005-05-20 Martin Baulig <martin@ximian.com>
4192 * expression.cs (New.DoResolve): Move the CS0712 check above the
4193 CS0144 check; otherwise it can never be reached.
4195 2005-05-20 Martin Baulig <martin@ximian.com>
4197 * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
4199 2005-05-20 Martin Baulig <martin@ximian.com>
4201 * class.cs (TypeContainer.DefineType): Fix CS0698 check.
4203 * typemanager.cs (TypeManager.IsAttributeType): New public method.
4205 2005-05-19 Martin Baulig <martin@ximian.com>
4208 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
4209 to disable error reporting.
4211 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
4212 here since we don't want to report an error; see the new test-336.cs.
4214 2005-05-19 Raja R Harinath <rharinath@novell.com>
4216 * statement.cs (ToplevelBlock.GetParameterReference)
4217 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
4218 Move here from class Block.
4219 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
4220 * expression.cs (ParameterReference.DoResolveBase): Likewise.
4222 2005-05-18 Martin Baulig <martin@ximian.com>
4227 (FlowBranching.Reachability): Add non-static public And() and Or()
4229 (FlowBranchingSwitch): New class; do the `break_origins' thing
4230 like in FlowBranchingLoop.
4231 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
4232 reachability, not just locals and parameters.
4233 (FlowBranching.MergeChild): Remove some of the hacks for loop and
4234 switch; MergeBreakOrigins() now takes care of that.
4236 2005-05-18 Martin Baulig <martin@ximian.com>
4238 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4239 a loop and may leave it, reset the barrier; fixes #74974.
4241 2005-05-16 Raja R Harinath <rharinath@novell.com>
4243 Fix test-382.cs. Emit values of decimal constants.
4244 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
4246 (TypeContainer.AddField): ... this.
4247 (TypeContainer.EmitFieldInitializers): Allow the list of fields
4248 with initializers to include 'Const's.
4249 (ClassPart.RegisterFieldForInitialization): Forward to
4251 * const.cs (Const.Const): Pass initializer to base class.
4252 (Const.Define): In case of decimal constants, register them for
4253 initialization in a static constructor.
4255 2005-05-14 Martin Baulig <martin@ximian.com>
4257 * statement.cs (Block.Resolve): Correctly handle unreachable code;
4258 do not call ResolveUnreachable() on unreachable statements in
4259 here, see the comment in the source code.
4261 2005-05-13 Raja R Harinath <rharinath@novell.com>
4264 * expression.cs (BinaryResolveOperator): If one of the operands of
4265 an equality comparison is 'null' and the other is a pointer type,
4266 convert the null to a NullPointer.
4267 * convert.cs (ImplicitReferenceConversion): If the expression is a
4268 NullLiteral and the target type is a pointer type, return a
4269 NullPointer instead.
4270 (ImplicitConversionStandard): Likewise.
4272 2005-05-13 Marek Safar <marek.safar@seznam.cz>
4274 * cs-parser.jay: Set readonly context based on special constructs.
4276 * expression.cs (LocalVariableReference.DoResolveBase): Improved
4277 readonly variable error handling.
4279 * rootcontext.cs (EmitCode): Don't verify members when error
4282 * statement.cs (LocalInfo): Add reaodnly context information.
4283 (SetReadOnlyContext, GetReadOnlyContext): New methods.
4285 2005-05-17 Martin Baulig <martin@ximian.com>
4287 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
4290 2005-05-13 Martin Baulig <martin@ximian.com>
4292 * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
4293 handle unreachable blocks.
4295 2005-05-13 Martin Baulig <martin@ximian.com>
4298 (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
4299 (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
4302 2005-05-13 Martin Baulig <martin@ximian.com>
4304 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
4305 instance variable, not a local. Fix #74873.
4306 (Block.ResolveUnreachable): Set it to true here.
4308 2005-05-12 Martin Baulig <martin@ximian.com>
4310 * cs-parser.jay (property_declaration): Pass the `current_class',
4311 not the `current_container' to Property's .ctor. Fixes #74912.
4313 2005-05-11 Martin Baulig <martin@ximian.com>
4315 * typemanager.cs (Closure): Copy this from MCS and merge all the
4316 GMCS-specific changes into it.
4318 2005-05-12 Raja R Harinath <harinath@gmail.com>
4321 * typemanager.cs (unmanaged_enclosing_types): New.
4322 (IsUnmanagedType): Avoid infloops by using
4323 'unmanaged_enclosing_types' to talk with recursive invocations.
4325 2005-05-11 Duncan Mak <duncan@novell.com>
4327 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
4328 continuing to process for 'arg'.
4329 (handle_preprocessing_directive): Check the argument of the #endif
4330 directive and report error CS1025 if there are any trailing
4333 According to the C# spec, having even whitespace after the #endif
4334 directive is illegal; however, because we call arg.TrimEnd ()
4335 beforehand, we have the same behavior as csc, allowing whitespace
4336 after the directive.
4340 2005-05-11 Marek Safar <marek.safar@seznam.cz>
4344 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
4345 (Constructor.GetObsoleteAttribute): Implemented correctly.
4347 2005-05-10 Martin Baulig <martin@ximian.com>
4349 * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
4350 resolve the type; fixes #74864.
4351 (DefaultValueExpression): Create the LocalTemporary in Emit(), not
4352 in DoResolve(); fixes #74862.
4354 2005-05-10 Martin Baulig <martin@ximian.com>
4356 * support.cs (ReflectionParameters.ParameterModifier): Use
4357 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
4358 and `ParameterAttributes.In'. Fixes #74884.
4360 2005-05-10 Martin Baulig <martin@ximian.com>
4362 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
4363 the cache if we're just looking for `MemberTypes.NestedType' in a
4366 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
4367 constraints if we're still resolving the type tree.
4368 (Expression.MemberLookup): If we're resolving the type tree, only
4369 look for `MemberTypes.NestedType' since we're only interested in
4372 * class.cs (TypeContainer.DefineType): Don't resolve the type
4373 parameters here; do this later in ResolveType() after the type
4374 tree has been resolved.
4375 (TypeContainer.ResolveType): New public method; this is called
4376 after the type tree is resolved and before the types are being
4377 populated. We resolve the generic constraints here.
4378 (TypeContainer.DoDefineMember): Check the constraints on our base
4379 class and interfaces.
4381 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
4382 set the `ResolvingTypeTree' flag on the EmitContext.
4384 * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
4386 2005-05-10 Marek Safar <marek.safar@seznam.cz>
4388 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
4390 * expression.cs (Argument.GetParameterModifier): Turned to property.
4391 (Invocation.Error_InvalidArguments): Add more descriptive errors.
4393 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
4396 2005-05-09 Raja R Harinath <rharinath@novell.com>
4399 * decl.cs (MemberCache.AddMethods): Register override methods,
4400 rather than non-override methods.
4401 * typemanager.cs (RegisterOverride): New.
4402 (IsOverride): Update.
4404 2005-05-09 Marek Safar <marek.safar@seznam.cz>
4406 * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
4408 2005-05-06 Martin Baulig <martin@ximian.com>
4411 (Attributable.IsClsComplianceRequired): Fix typo in the method name.
4412 (AttributeTester.AnalyzeTypeCompliance): Add generics support.
4414 2005-05-09 Marek Safar <marek.safar@seznam.cz>
4418 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
4419 recursive declaration.
4421 * statement.cs (Block.ResolveMeta): Report any error in resolving.
4423 2005-05-06 Marek Safar <marek.safar@seznam.cz>
4425 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
4427 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
4429 2005-05-05 Raja R Harinath <rharinath@novell.com>
4432 * decl.cs (DeclSpace.FamilyAccessible):
4433 Use TypeManager.IsNestedFamilyAccessible.
4435 Fix reopened #64812.
4436 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
4439 2005-05-04 Raja R Harinath <rharinath@novell.com>
4440 Abin Thomas <projectmonokochi@rediffmail.com>
4441 Anoob V E <projectmonokochi@rediffmail.com>
4442 Harilal P R <projectmonokochi@rediffmail.com>
4445 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
4446 allow access to all static members.
4448 2005-05-04 Martin Baulig <martin@ximian.com>
4450 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
4452 2005-05-04 Martin Baulig <martin@ximian.com>
4456 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
4457 section at the end; make things work if `default' is not the last
4460 2005-05-04 Martin Baulig <martin@ximian.com>
4464 * statement.cs (Switch): Replaced the `got_default' field with a
4465 `default_section' one.
4466 (Switch.CheckSwitch): Set `default_section' here.
4467 (Switch.Resolve): If we're a constant switch and the constant is
4468 not found, use the default section.
4470 2005-05-03 Martin Baulig <martin@ximian.com>
4472 * expression.cs (ArrayAccess.EmitGetLength): New public method.
4474 * statement.cs (Foreach.ArrayForeach): New nested class.
4475 (Foreach.TemporaryVariable): New nested class.
4476 (Foreach.EmitArrayForeach): Removed; this is now in the new
4479 2005-05-03 Raja R Harinath <rharinath@novell.com>
4481 * pending.cs (BaseImplements): Move the #74773 fix here. This is
4483 (VerifyPendingMethods): Revert change below.
4485 * typemanager.cs (IsOverride, RegisterNonOverride): New.
4486 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
4487 that used to trigger warning -28. Remove warning -28.
4488 * expression.cs (Invocation.OverloadResolve): Use
4489 TypeManager.IsOverride to distinguish override methods.
4492 * pending.cs (VerifyPendingMethods): If a base type implements the
4493 requested interface, don't bother checking individual methods of
4494 the base type. As a side-effect, this prevents the creation of
4495 unnecessary proxies.
4497 2005-05-02 Martin Baulig <martin@ximian.com>
4501 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4502 Also `And' the locals if the old vector is null.
4503 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
4504 null; in this case we basically reset all the variables.
4506 2005-05-02 Martin Baulig <martin@ximian.com>
4510 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
4511 Added `FlowBranching branching' argument; always `and' the
4512 variables instead of `or'ing them unless we're an infinite loop.
4514 * statement.cs (While.Resolve): Create a new sibling unless we're
4517 2005-05-02 Martin Baulig <martin@ximian.com>
4521 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
4522 arguments; use it instead of creating a new TopLevelBlock.
4523 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
4524 our ConstructorInitializer.
4527 (TopLevelBlock.TopLevelBranching): New public property.
4528 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
4529 and create our `TopLevelBranching'.
4531 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
4532 anonymous method host, use `block.TopLevelBranching' rather than
4533 creating a new branching.
4535 2005-04-20 Miguel de Icaza <miguel@novell.com>
4537 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
4538 a ScopeInfo, if any of the current children is a child of the new
4539 entry, move those children there.
4541 2005-04-30 Martin Baulig <martin@ximian.com>
4543 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
4544 at the beginning of a SwitchSection. Fix #73335.
4546 2005-04-27 Marek Safar <marek.safar@seznam.cz>
4549 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
4551 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
4552 (FieldExpr.DoResolve): Obsolete members are ignored for field
4555 2005-04-26 Marek Safar <marek.safar@seznam.cz>
4557 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
4558 of arrays detection.
4560 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
4562 (Field.VerifyClsCompliance): Volatile fields are not compliant.
4564 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
4567 2005-04-25 Ben Maurer <bmaurer@ximian.com>
4569 * cs-parser.jay: Use the prefered version of -unsafe in error
4572 2005-04-22 Marek Safar <marek.safar@seznam.cz>
4574 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4577 2005-04-20 John Luke <john.luke@gmail.com>
4579 * driver.cs: fix typo in error message, --outout to --output
4581 2005-04-30 Martin Baulig <martin@ximian.com>
4583 * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
4584 handle the .NET 2.x security attributes.
4586 2005-04-30 Martin Baulig <martin@ximian.com>
4589 (TypeManager.ExpandInterfaces): Don't add things twice.
4592 (TypeContainer.VerifyClsCompliance): Allow generic instances.
4594 2005-04-29 Martin Baulig <martin@ximian.com>
4596 * generic.cs (Constraints.ResolveTypes): Expand interfaces.
4598 * anonymous.cs: Added support for anonymous generic methods.
4600 2005-04-29 Martin Baulig <martin@ximian.com>
4602 * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
4605 2005-04-29 Martin Baulig <martin@ximian.com>
4607 * generic.cs (TypeManager.HasConstructorConstraint): Removed.
4609 * expression.cs (New.DoResolve): Fix the CS0304 check.
4611 2005-04-29 Martin Baulig <martin@ximian.com>
4613 * typemanager.cs (TypeManager.GetFullName): Updated to the new
4616 * class.cs (MethodCore.IsDuplicateImplementation): If we're an
4617 explicit interface implementation, compare the interface types.
4618 (MethodData.Define): Use the new naming scheme from the latest
4620 (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
4622 * decl.cs (MemberName.GetMemberName): Removed.
4623 (MemberName.MethodName, FullName): New properties.
4625 2005-04-25 Raja R Harinath <rharinath@novell.com>
4627 * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
4629 2005-04-22 Martin Baulig <martin@ximian.com>
4631 * generic.cs (GenericMethod): Create the EmitContext in the
4632 `Define()'; in `Define(MethodBuilder)', create the type parameters
4633 before calling `Define()'. Fixes #73933.
4635 2005-04-22 Martin Baulig <martin@ximian.com>
4638 (Constraints.Resolve): Make things work wrt. the new type lookup system.
4639 (ConstructedType.ResolveAsTypeTerminal): Don't override this.
4641 * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
4642 ConstructedType, check its constraints.
4644 2005-04-20 Marek Safar <marek.safar@seznam.cz>
4646 * codegen.cs (InRefOutArgumentResolving): New field.
4648 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4649 fields outside contructor.
4651 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4653 2005-04-19 Miguel de Icaza <miguel@novell.com>
4655 * anonymous.cs (CaptureContext.EmitParameterInstance): The
4656 parameter code was not completed ever, so it was not as up-to-date
4657 as local variables. Must finish it.
4659 The bug fix was to compare the Toplevel of the block, not the
4660 current block. Thanks for Ben for pointing this out.
4662 2005-04-19 Raja R Harinath <rharinath@novell.com>
4664 * decl.cs (AddMethods): Use the declaring type of the problem
4665 method to determine if we want to squash a warning.
4667 2005-04-19 Marek Safar <marek.safar@seznam.cz>
4669 * attribute.cs: Removed debug output.
4671 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4673 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4676 2005-04-18 Raja R Harinath <rharinath@novell.com>
4679 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4680 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4681 all null comparisons against reference types.
4683 2005-04-18 Marek Safar <marek.safar@seznam.cz>
4686 * class.cs (TypeContainer.CircularDepException) New nested
4688 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4689 (TypeContainer.DefineType): Removed error, reset InTransit before
4691 (Class.DefineType): Throw exception when is in Transit.
4692 Catch exception and report error.
4693 (Struct.DefineType): Throw exception when is in Transit.
4694 Catch exception and report error.
4695 (Interface.DefineType): Throw exception when is in Transit.
4696 Catch exception and report error.
4698 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4699 handle nested exception handlers.
4701 * flowanalysis.cs (InTryWithCatch): New method, search for try with
4704 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4705 InFinally and InCatch storage.
4707 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4708 (Catch.Resolve): Set and Restore ec.InCatch.
4709 (Try.Resolve): Set and Restore ec.InFinally.
4710 (Try.HasCatch): True when try has catch.
4712 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
4714 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4715 for the same event member, so exclude such cases from warning 419.
4718 2005-04-16 Miguel de Icaza <miguel@novell.com>
4720 * expression.cs (Binary.ResolveOperator): Apply patch from John
4721 Luke to fix bug 59864: operators &, | and ^ on enumerations
4722 require that the same enum type on both sides.
4724 * driver.cs: Add warnings to old flag usage, this is to assist
4725 people who produce Makefiles and hope that the Makefiles will be
4728 * class.cs (TypeContainer.EmitType): Moved the definition of the
4729 special $PRIVATE$ field from the resolve phase to the Emit phase.
4730 During resolve we do not know if we are a struct with
4731 HasExplicitLayout, we know this only after the attributes for the
4734 Set the FieldOffset to zero on the dummy field that we create for
4735 the class. Fixes 74590.
4737 2005-04-16 Raja R Harinath <rharinath@novell.com>
4740 * ecore.cs (PropertyExpr.resolved): New.
4741 (DoResolve): Use it to handle a case of double resolution here.
4742 Handle a case of identical-name-and-type-name.
4743 * expression.cs (ArrayCreation.CheckIndices): Avoid double
4744 resolution by storing the results of expression resolution back
4745 into the "probes" array.
4747 2005-04-15 Raja R Harinath <rharinath@novell.com>
4749 Fix cs0208-7.cs and cs0208-8.cs.
4750 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4751 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
4752 error reporting to point out the reason a struct is not unmanaged.
4754 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4756 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
4757 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4759 2005-04-13 Raja R Harinath <rharinath@novell.com>
4762 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4763 IdenticalNameAndTypeName here.
4764 (EventExpr.InstanceResolve): Likewise.
4766 2005-04-13 Marek Safar <marek.safar@seznam.cz>
4768 C# 2.0 DefaultCharSetAttribute implementation
4770 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4771 which allows us to set GlobalNamespace for every resolve.
4772 (Attribute.ResolveArguments): Cut from Resolve.
4773 (Attribute.GetCharSetValue): Returns CharSet named argument.
4774 (Attribute.DefinePInvokeMethod): Gets default charset from
4776 (GlobalAttribute.ResolveAsTypeStep): Override.
4777 (GlobalAttribute.ResolveArguments): Override.
4779 * class.cs (TypeAttr): Is protected.
4781 * codegen.cs (ModuleClass.DefaultCharSet): New member.
4782 (ModuleClass.DefaultCharSetType): New memeber.
4783 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4785 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4786 charset from module.
4788 * delegate.cs (TypeAttr): Override.
4789 (Delegate.DefineType): Use this TypeAttr.
4791 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4792 at very early stage (before types are defined) to resolve model
4793 module attributes. It will probably not work with corlib but it
4796 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4797 charset from module.
4799 * typemanager.cs (default_charset_type): New type.
4801 2005-04-13 Raja R Harinath <rharinath@novell.com>
4803 * decl.cs (MemberCache.AddMethods): Don't warn if
4804 System.Object.Finalize has buggy MethodAttributes.
4806 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4809 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4811 * doc.cs : detect ambiguous reference to overloaded members.
4812 Fixed bug #71603. MS 1.1 csc does not detect it.
4814 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4816 * doc.cs : delegates must not be referenced with parameters.
4819 2005-04-12 Miguel de Icaza <miguel@novell.com>
4821 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4823 2005-04-10 Miguel de Icaza <miguel@novell.com>
4825 * driver.cs (MainDriver): Stop processing if the CLS stage found
4828 (CompilerCallableEntryPoint.InvokeCompiler): Always
4829 reset after execution; Take a TextWriter argument for the
4832 * report.cs: Use the error stream instead of hardcoding stderr.
4834 2005-04-09 Miguel de Icaza <miguel@novell.com>
4836 * class.cs: Reduce code paths to test, too small of an
4837 optimization to make it worth the extra testing. Always perform
4840 2005-04-08 Raja R Harinath <rharinath@novell.com>
4843 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4844 operators that had errors reported on them.
4846 2005-04-08 Marek Safar <marek.safar@seznam.cz>
4848 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4850 (Attribute.Resolve): Add named argument type checking.
4852 * class.cs (FixedField.Define): Use IsPrimitiveType
4854 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4856 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4857 unsafe parameter types.
4859 * statement.cs (Using.ResolveExpression): Add better error description.
4861 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4863 2005-04-08 Raja R Harinath <rharinath@novell.com>
4866 * attribute.cs (Attribute.GetAttributeUsage): Resolve
4867 AttributeUsageAttribute in the emitcontext of the attribute class,
4868 not in the emitcontext of the attributable entity it was attached to.
4869 * cs-parser.jay: Use 'current_class', not 'current_container',
4870 when creating a GlobalAttribute.
4872 2005-04-08 Alp Toker <alp@atoker.com>
4874 * pending.cs: The fix to #58413 failed to compile methods implementing
4875 interfaces with/without params modifiers and vice versa, even though
4876 params modifiers aren't part of the signature. Make the modifier check
4877 less strict as in csc.
4879 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
4880 Anoob V E <projectmonokochi@rediffmail.com>
4881 Harilal P R <projectmonokochi@rediffmail.com>
4884 * pending.cs (TypeAndMethods.mods): New. Store the parameter
4885 modifiers of pending methods.
4886 (PendingImplementation.PendingImplementation): Initialize it.
4887 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4888 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4889 with ParameterData. Add check for modifiers.
4890 * class.cs (MethodData.Define): Update to changes.
4892 2005-04-07 Raja R Harinath <rharinath@novell.com>
4894 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4896 2005-04-07 Marek Safar <marek.safar@seznam.cz>
4898 * class.cs (PropertyMethod.Define): Check private accessor in abstract
4901 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4904 * typemanager.cs: Registered RequiredAttributeAttribute.
4906 2005-04-06 Marek Safar <marek.safar@seznam.cz>
4908 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4909 Warning CS0169 is back at level 3.
4910 (IMethodData.SetMemberIsUsed): New method.
4912 * decl.cs (IsUsed): New value; moved from FieldBase.Status
4913 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4915 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4917 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4919 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4922 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4925 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4926 to avoid the problems with nested types.
4928 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
4929 Anoob V.E <projectmonokochi@rediffmail.com>
4930 Harilal P.R <projectmonokochi@rediffmail.com>
4931 Raja R Harinath <rharinath@novell.com>
4934 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4936 * typemanager (GetConstructor): Make public.
4938 2005-04-05 John Luke <john.luke@gmail.com>
4939 Raja R Harinath <rharinath@novell.com>
4942 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4943 struct too. Return false quicker in a few cases.
4944 (VerifyUnManaged): Use it.
4946 2005-04-05 Raja R Harinath <rharinath@novell.com>
4949 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4950 not 'unreachable_seen'.
4952 2005-04-04 Marek Safar <marek.safar@seznam.cz>
4954 * attribute.cs (Attribute.GetValue): Removed unused.
4956 * codegen.cs (CodeGen.TrimExt): Removed unused.
4958 * cs-parser.jay (output): Removed unused.
4960 * cs-tokenizer.cs (hex_digits): Removed unused.
4962 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4964 * expression.cs (Indirection.LoadExprValue): Removed unused.
4965 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4967 * iterators.cs (Iterator.param_types): Removed unused.
4969 * statement.cs (Goto.block): Removed unused.
4970 (ToplevelBlock.did): Removed unused.
4971 (Switch.ResolveConstantSwitch): Removed unused.
4973 2005-04-01 Ben Maurer <bmaurer@ximian.com>
4975 * rootcontext.cs: Allow mcs to bootstrap with the compilation
4978 2005-04-19 Martin Baulig <martin@ximian.com>
4980 Merged r42462 from MCS and made it work for GMCS.
4982 * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
4984 * generic.cs (GenericMethod.Define): Removed `return_type' argument.
4986 2005-04-01 Raja R Harinath <rharinath@novell.com>
4988 Fix #74232 and cs0208-3.cs.
4989 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4990 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4991 unmanaged type. Don't use FieldBuilders when 't' is a
4992 TypeBuilder. Use ModFlags and MemberType fields.
4993 * class.cs (MemberBase.member_type): Rename from MemberType.
4994 (MemberBase.MemberType): New property. Determines member_type on
4996 (MemberBase.DoDefine): Don't initialize MemberType here.
4997 (FieldMember.Define): Likewise.
4999 2005-04-01 Marek Safar <marek.safar@seznam.cz>
5002 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
5003 Attributes are emitted there.
5005 2005-04-01 Raja R Harinath <rharinath@novell.com>
5007 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
5008 keyword in 'partial enum' too.
5009 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
5011 Report from Kamil Skalski <nazgul@omega.pl>.
5014 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
5015 have partial containers too.
5017 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
5018 in block' checks to Block.CheckInvariantMeaningInBlock.
5019 * statement.cs (Block.GetKnownVariableInfo): Make private.
5020 (Block.IsVariableUsedInChildBlock): Remove.
5021 (Block.IsVariableUsedInBlock): Likewise.
5022 (Block.CheckInvariantMeaningInBlock): New. Show location of
5023 conflicting declaration.
5024 (Block.AddVariable): Make error messages less long-winded and more
5025 specific. Show location of conflicting declaration.
5026 * parameter.cs (Parameters.Location): New readonly property.
5028 2005-03-31 Raja R Harinath <rharinath@novell.com>
5030 Clean up semantics of invoking ResolveMemberAccess.
5031 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
5032 can have an instance, ensure that we pass in a non-TypeExpression
5033 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
5034 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
5035 argument. Update to changes and simplify.
5036 (FieldExpr.Emitinstance): Remove CS0120 check.
5037 (PropertyExpr.EmitInstance): Likewise.
5038 * expression.cs (Argument.Resolve): Likewise.
5039 (Invocation.DoResolve): Update to changes in semantics of
5042 2005-03-31 Marek Safar <marek.safar@seznam.cz>
5045 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
5048 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
5050 2005-03-31 Raja R Harinath <rharinath@novell.com>
5052 Fix difference in behaviour with commandline invocation.
5053 * driver.cs (Driver.Reset): New.
5054 (CompilerCallableEntryPoint): Call it.
5056 * statement.cs (If.Resolve): Avoid spurious "uninitialized
5057 variable" warnings if the boolean expression failed to resolve.
5059 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
5061 * attribute.cs: Fix the union of several permissions when some of them
5062 are unrestricted (so the result isn't an unrestricted permission set).
5065 2005-03-30 Raja R Harinath <rharinath@novell.com>
5067 * ecore.cs (MemberExpr): New class. Convert from interface
5069 (MemberExpr.ResolveMemberAccess): Refactor and move here from
5070 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
5072 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
5073 (MethodGroupExpr.IsExplicitImpl): Remove.
5074 (Expression.GetFieldFromEvent): Remove.
5075 (SimpleName.MemberStaticCheck): Remove.
5076 (SimpleName.DoSimpleNameResolve): Update to changes.
5077 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
5078 (MemberAccess.IdenticalNameAndTypeName): Remove.
5079 (MemberAccess.error176): Move to MemberExpr.
5080 (MemberAccess.DoResolve): Update to changes.
5081 (BaseAccess.DoResolve): Likewise.
5083 2005-03-30 Marek Safar <marek.safar@seznam.cz>
5085 C# 2.0 Conditional attribute class implementation
5087 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
5088 Analyzes class whether it has attribute which has ConditionalAttribute
5089 and its condition is not defined.
5091 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
5092 (Class.IsExcluded): New method. Search for at least one defined
5093 condition in ConditionalAttribute of attribute class.
5095 2005-03-30 Raja R Harinath <rharinath@novell.com>
5097 * ecore.cs (PropertyExpr): Derive from Expression, not
5098 ExpressionStatement.
5099 (PropertyExpr.EmitStatement): Remove.
5101 2005-03-29 Raja R Harinath <rharinath@novell.com>
5104 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
5105 internal field "value__" of an enum be private. The examples for
5106 "value__" that I found on MSDN all used FieldAttributes.Private.
5108 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
5109 Don't mention IL method attribute names.
5111 Fix #47991. Remove a TODO.
5112 * statement.cs (Block.Toplevel): Make into a field.
5113 (Block.Parameters): Move into ToplevelBlock.
5114 (Block.known_variables): Rename from child_variable_names.
5115 (Block.Block): Remove variants that take Parameters. Initialize
5116 'Toplevel' with the immediately surrounding toplevel block.
5117 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
5118 LocalInfo parameter.
5119 (Block.GetKnownVariableInfo): New.
5120 (Block.IsVariableNameUsedInChildBlock): Update.
5121 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
5122 the block, even though it may not be in scope.
5123 (Block.AddVariable): Remove Parameters parameter. Use
5124 Toplevel.Parameters instead.
5125 (Block.AddConstant): Remove Parameters parameter.
5126 (Block.GetParameterReference): Update to use Toplevel.Parameters.
5127 (Block.IsParamaterReference): Likewise.
5128 (Block.IsLocalParameter): Likewise. Simplify a lot.
5129 (ToplevelBlock.Parameters): New. Moved from Block.
5130 (ToplevelBlock.ToplevelBlock): Update to changes. Always
5131 initialize Parameters to a non-null value.
5132 * cs-parser.jay: Update to changes.
5133 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
5134 simple names that mean different things in the same block. Use
5135 Block.IsVariableNameUsedInBlock.
5137 2005-03-28 Raja R Harinath <rharinath@novell.com>
5139 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
5141 2005-03-26 Raja R Harinath <harinath@acm.org>
5144 * assign.cs (Assign.DoResolve): When the RHS of an assignment
5145 fails to resolve, ensure that the LHS is still resolved as an
5148 2005-03-25 Raja R Harinath <harinath@acm.org>
5150 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
5152 (Enum.current_ec): Remove.
5153 (Enum.LookupEnumValue): Remove EmitContext argument.
5154 Just uses the one created during DefineType.
5155 (Enum.FindMembers): Update.
5156 * expression.cs (MemberAccess.DoResolve): Update.
5158 2005-03-22 Marek Safar <marek.safar@seznam.cz>
5160 * assign.cs (Assign.DoResolve): Check for CS1717 when
5161 source and target are same (uses Equals).
5163 * expression.cs (LocalVariableReference, ParameterReference,
5164 This): Implemented Equals, GetHashCode.
5166 * statement.cs (Block.GetParameterReference): Removed useless
5169 2005-03-22 Raja R Harinath <rharinath@novell.com>
5172 * statement.cs (Block.AddVariable): Ensure that we skip implicit
5173 blocks before deciding whether the error is cs0136 or cs0128.
5175 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
5176 (using_alias_directive, using_namespace_directive): Pass
5177 MemberName, not an expression to Namespace.UsingAlias and
5179 (MakeName): Use the MemberName of the namespace.
5180 * namespace.cs (Namespace.MemberName): New.
5181 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
5182 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
5184 * decl.cs (MemberName.Name): Make readonly.
5185 (MemberName.FromDotted): New "constructor".
5186 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
5187 (MemberCore.Name): Compute from MemberName on demand.
5188 (MemberCore.SetMemberName): Provide a way to change the
5190 (MemberCore.AddToContainer): Don't take a fullname parameter.
5191 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
5192 fully qualified name of the container to the member name.
5193 (TypeContainer.AddToTypeContainer): Use a fully qualified name
5194 only if the type is a member of the root container.
5195 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
5196 MemberName.Left rather than searching for an embedded ".".
5197 (PartialContainer.CreatePart): Update to changes in RootContext.
5198 (MemberBase.ShortName): Turn into a property. Use
5199 MemberCore.SetMemberName.
5200 (MemberBase.ExplicitInterfaceName): Remove.
5201 (MemberBase.UpdateMemberName): Remove.
5202 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
5203 (PropertyBase.SetMemberName): New override.
5204 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
5205 (Tree.GetDecl): New.
5206 (Tree.AllDecls): Rename from Decls.
5207 * attribute.cs, enum.cs, report.cs: Update to changes.
5208 * driver.cs (MainDriver): Use MemberName.FromDotted on
5209 RootContext.MainClass.
5211 2005-03-21 Marek Safar <marek.safar@seznam.cz>
5213 * class.cs (FixedField.Define): Check for CS1664 and more sanity
5216 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
5218 2005-03-18 Marek Safar <marek.safar@seznam.cz>
5220 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
5221 property accessor modifiers.
5223 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
5224 fixed buffer attribute (CS1716).
5225 (PropertyMethod.HasCustomAccessModifier): When property accessor
5226 has custom modifier.
5228 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
5230 (PropertyExpr.DoResolveLValue): Add CS0272.
5232 2005-03-17 Miguel de Icaza <miguel@novell.com>
5234 * convert.cs: When converting to a pointer, use the proper Conv.U
5235 or Conv.I depending on the source data type.
5237 * cs-tokenizer.cs: Make the size for large decimal constants,
5240 2005-03-17 Martin Baulig <martin@ximian.com>
5242 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5243 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
5245 2005-03-17 Martin Baulig <martin@ximian.com>
5247 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5248 to bool so we can return an error condition.
5249 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5252 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
5254 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
5257 2005-03-16 Raja R Harinath <rharinath@novell.com>
5259 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
5260 Refactor to avoid traversing the list of assemblies, and to avoid
5261 string concatenation.
5262 * typemanager.cs (guid_attr_type): Remove.
5263 (negative_hits, pointers, references): Remove hashes.
5265 (GetConstructedType): New. Uses type_hash to handle constructed
5266 types (arrays, references, pointers).
5267 (GetReferenceType, GetPointerType): Use it.
5268 (GetNestedType): New. Uses type_hash to handle nested types of
5270 (LookupType, LookupTypeDirect): Remove.
5271 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
5272 'types' hash and LookupTypeReflection directly.
5273 (params_string, params_object): Use GetConstructedType.
5274 * namespace.cs (Namespace.cached_types): New. Cache of reflected
5276 (Namespace.Lookup): Use cached_types.
5277 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
5278 provided by old TypeManager.LookupType.
5279 * rootcontext.cs (MakeFQN): Remove.
5280 * decl.cs (DeclSpace.MakeFQN): Likewise.
5281 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
5282 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
5283 TypeManager.GetConstructedType.
5284 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
5286 2005-04-16 Zoltan Varga <vargaz@freemail.hu>
5288 * cs-parser.jay: Fix build.
5290 2005-03-15 Marek Safar <marek.safar@seznam.cz>
5292 * class.cs (TypeContainer.CircularDepException) New nested
5293 (MethodCore.CheckBase): Report CS1715 for properties and indexers.
5295 * cs-parser.jay: Reports CS1527 for any namespace element.
5297 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
5300 * expression.cs (ParameterReference.IsAssigned): Changed error to
5302 (Error_WrongNumArguments): Moved CS0245 detection here.
5304 * statement.cs (Return.Resolve): Add CS1622 report.
5306 2005-03-11 Marek Safar <marek.safar@seznam.cz>
5308 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
5310 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
5312 * attribute.cs expression.cs: Get rid of some allocations.
5314 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
5316 * doc.cs : just eliminate the latest change.
5318 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5320 * doc.cs : commented out the latest change. It breaks xml-030.cs
5322 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5324 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
5325 fail. So invoke CreateType() in FindDocumentedType().
5327 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5329 * cs-tokenizer.cs : added IsKeyword().
5330 * doc.cs : Detect keyword incorrectly used as identifier.
5331 Allow identifiers prefixed by @.
5333 2005-03-10 Marek Safar <marek.safar@seznam.cz>
5335 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
5336 It caused exception in namespace resolving (again!).
5338 * class.cs (Class.ctor): Removed exit.
5339 (PropertyMethod.ctor): ditto.
5341 * codegen.cs (Codegen.Reset): Reset static data.
5342 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
5344 * cs-tokenizer.cs (Cleanup): Removed.
5346 * driver.cs (GetSystemDir): Rewrote to one line command.
5347 It caused problem with unloaded dynamic modules.
5348 (UnixParseOption): Removed Exit.
5349 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
5350 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
5351 Now can be mcs used as library.
5353 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
5356 * location.cs (Reset): Reset static data.
5358 * namespace.cs (Reset): Reset static data.
5360 * report.cs (Report.Reset): Reset static data.
5362 * rootcontext.cs (RootContext.Reset): Reset static data.
5364 * tree.cs (RootTypes.ctor): Use Location.Null
5366 * typemanager.cs (TypeManager.Reset): Reset static data.
5367 (CoreLookupType): Removed Exit.
5368 (TypeHandle.Reset): Reset static data.
5370 2005-03-10 Raja R Harinath <rharinath@novell.com>
5373 * typemanager.cs (ComputeNamespaces): Import namespaces from
5374 referenced modules too.
5376 2005-03-09 Raja R Harinath <rharinath@novell.com>
5378 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
5381 2005-03-09 Raja R Harinath <rharinath@novell.com>
5383 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
5384 enclosing DeclSpace. This ensures that a name-lookup populates
5385 more caches and there are fewer 'TypeExpression's. Carve out
5386 nested type lookup into ...
5387 (LookupNestedTypeInHierarchy): ... this.
5389 2005-04-15 Martin Baulig <martin@ximian.com>
5391 Merged r41590 from MCS and make it work in the generics land.
5393 * generic.cs (TypeParameter.UpdateConstraints): Removed the
5396 * class.cs (PartialContainer.UpdateConstraints): Removed.
5397 (PartialContainer.CheckConstraints): Removed.
5398 (PartialContainer.SetParameterInfo): Store the constraints here.
5399 (PartialContainer.DefineTypeParameters): New public method;
5400 resolve the type parameter's constraints here. Note that the
5401 PartialContainer doesn't have an EmitContext anymore, so we must
5402 do this in the ClassPart.
5404 2005-03-09 Raja R Harinath <rharinath@novell.com>
5406 Clean up a few partial-class semantics.
5407 Fixes test-357.cs and cs1618-2.cs.
5408 * cs-parser.jay (struct_declaration): Use 'current_class' as
5409 parent of newly-created struct. Remove call to Register ().
5410 Use 'pop_current_class' to complete handing the current struct.
5411 (interface_declaration): Likewise.
5412 (class_declaration): Likewise.
5413 (enum_declaration): Use 'current_class' as parent of newly created
5415 (delegate_declaration): Likewise.
5416 (pop_current_class): New function. This is used to handle closing
5417 up the 'current_class' and 'current_container', and pointing them
5418 to the enclosing class/container.
5419 (CSharpParser): Initialize 'current_class' too.
5420 * decl.cs (MemberCore): Add check for invariant: a partial
5421 container is not a parsed entity, and thus does not enclose any
5423 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
5424 (DeclSpace.BaseTypeExpr): Use it.
5425 (DeclSpace.LookupType): Add check for invariant.
5426 * class.cs (TypeContainer): Add check for invariant: a nested
5427 class should have the same NamespaceEntry as its enclosing class.
5428 (TypeContainer.EmitFieldInitializers): Make virtual.
5429 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
5431 (TypeContainer.Register): Remove.
5432 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
5433 null. Use TypeResolveEmitContext for resolving base types and
5434 interfaces. Move initialization of Parts.TypeBuilder here from
5436 (TypeContainer.DefineNestedTypes): ... here.
5437 (PartialContainer): Take a Namespace not a NamespaceEntry.
5438 (PartialContainer.Create): Don't use Register. Call the
5439 appropriate Add... function directly.
5440 (ClassPart): Take both the PartialContainer and the enclosing
5441 class as constructor arguments.
5442 (ClassPart.EmitFieldInitializers): Override.
5443 (ClassPart.PartFindNestedTypes): Remove.
5444 (FieldBase.GetInitializerExpression): Resolve the initializer
5445 expression in the emit context of the enclosing class.
5446 * tree.cs (RootTypes): Remove Register ().
5448 2005-03-08 Marek Safar <marek.safar@seznam.cz>
5450 * cs-parser.jay: Removed CS0134.
5452 * driver.cs: Removed CS1901.
5454 * expression.cs (SizeOf.DoResolve): Don't report CS0233
5455 for predefined types.
5457 2005-03-07 Duncan Mak <duncan@novell.com>
5459 * codegen.cs (Save): Catch UnauthorizedAccessException as
5460 well. Fixes bug #73454.
5462 2005-03-07 Marek Safar <marek.safar@seznam.cz>
5464 * cs-tokenizer.cs (xtoken): Add CS1035.
5466 * class.cs (MethodData.Define): Add CS0683.
5467 (FieldMember.ctor): Add CS0681.
5469 2005-03-07 Raja R Harinath <rharinath@novell.com>
5471 * ecore.cs (SimpleName.DoResolve): Rename from
5472 SimpleName.DoResolveAllowStatic.
5473 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
5474 Pass 'intermediate' flag to MemberStaticCheck.
5475 (SimpleName.MemberStaticCheck): Skip "static check" only in case
5476 of "intermediate" lookups via MemberAccess.
5477 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
5478 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
5480 2005-03-07 Raja R Harinath <rharinath@novell.com>
5483 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
5484 slipped in because of variable names that are identical to a
5485 builtin type's BCL equivalent ('string String;', 'int Int32;').
5486 (PropertyExpr.EmitInstance): Likewise.
5488 2005-03-04 Marek Safar <marek.safar@seznam.cz>
5490 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
5492 * report.cs (warning_ignore_table): Made public.
5494 2005-03-04 Raja R Harinath <rharinath@novell.com>
5497 * class.cs (MethodData.Emit): Pass 'container' to
5498 container.GetObsoleteAttribute instead of 'container.Parent'.
5500 2005-03-03 Marek Safar <marek.safar@seznam.cz>
5502 * cs-parser.jay: Add 1534 error test.
5504 * iterators.cs (Yield.CheckContext): Add error 1629.
5505 (Iterator.ctor): Save unsafe modifier.
5506 (MoveNextMethod.DoEmit): Restore unsafe context.
5508 * namespace.cs (UsingAlias): Better error message.
5510 2005-03-03 Dan Winship <danw@novell.com>
5512 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
5513 the warning message [#73219]
5515 2005-03-03 Raja R Harinath <rharinath@novell.com>
5517 Fix compile with MCS 1.0.0.0.
5518 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
5519 w_restore to not depend on string constant folding.
5521 2005-03-03 Raja R Harinath <rharinath@novell.com>
5523 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
5524 CS0246 check to users who passed 'silent = false'.
5525 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
5527 (SimpleName.SimpleNameResolve): Update.
5528 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
5529 (MemberAccess.IdenticalNameAndTypeName): Update.
5530 * doc.cs (FindDocumentedTypeNonArray): Update.
5532 2005-03-03 Raja R Harinath <rharinath@novell.com>
5534 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
5535 * parameters.cs (ComputeAndDefineParameters): Remove.
5536 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
5537 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
5538 Use GetParameterInfo.
5540 2005-03-02 Marek Safar <marek.safar@seznam.cz>
5542 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
5544 2005-03-02 Raja R Harinath <rharinath@novell.com>
5546 Unify DeclSpace.LookupType and DeclSpace.FindType.
5547 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
5548 is in charge of defining nested types on demand.
5549 (DeclSpace.LookupType): Use it when the current_type is a
5550 TypeBuilder. Use LookupTypeDirect for reflected types.
5551 (DeclSpace.FindType): Remove.
5552 (DeclSpace.LookupInterfaceOrClass): Likewise.
5553 (DeclSpace.DefineTypeAndParents): Likewise.
5554 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
5555 DeclSpace.LookupType.
5556 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
5557 * typemanager.cs (LookupType): Simplify.
5558 (AddUserType): Remove type from negative_hits.
5559 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
5560 * class.cs (TypeContainer.FindMembers): Move handling of nested
5562 (TypeContainer.FindMembers_NestedTypes): ... here.
5563 (TypeContainer.FindNestedType): Implement override.
5564 (ClassPart.FindNestedType): Delegate to PartialContainer.
5565 (ClassPart.PartFindNestedType): Looks up the nested types of the
5568 2005-04-14 Martin Baulig <martin@ximian.com>
5570 * generic.cs (ConstructedType): Moved all the type lookup and
5571 nested class logic into SimpleName.
5572 (ConstructedType.ResolveConstructedType): Our underlying type is
5573 already fully resolved; all the type lookup stuff is in
5576 * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
5577 constructed types here instead of in ConstructedType.
5579 * decl.cs (MemberName.GetTypeExpression): Always create a
5580 SimpleName, not a ConstructedType.
5581 (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
5583 2005-03-02 Martin Baulig <martin@ximian.com>
5585 * class.cs (TypeContainer.DoDefineMembers): We also need a default
5586 static constructor in static classes.
5588 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
5590 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
5591 sizeParamIndex is not specified.
5593 2005-03-01 Marek Safar <marek.safar@seznam.cz>
5596 * report.cs (WarningMessage.IsEnabled): Missing null check.
5598 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5600 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
5601 in the fields and not in the properties.
5603 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
5605 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
5608 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5610 * attribute.cs: Small refactoring (improved robustness).
5611 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
5612 (ValidateGuid): Removed.
5613 (Resolve): Removed referenced to above mentioned.
5614 (GetAttributeUsage): Made private and changed to work without
5616 (GetIndexerAttributeValue): Don't crash.
5617 (GetConditionalAttributeValue): Ditto.
5618 (GetClsCompliantAttributeValue): Ditto.
5619 (ExtractSecurityPermissionSet): All attributes exceptions are
5621 (GetPropertyValue): New helper.
5622 (GetMethodImplOptions): New method.
5623 (DefinePInvokeMethod): Reuse common code. Implemented handling of
5624 some missing properties.
5626 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5627 (Method.ApplyAttributeBuilder): Updated.
5629 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5632 2005-02-28 Raja R Harinath <rharinath@novell.com>
5635 * report.cs (Report.SymbolRelatedToPreviousError): Handle
5636 non-simple types (array, pointer, reference).
5638 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5640 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5642 * class.cs (MethodCore.IsDuplicateImplementation): Special error
5644 (Method.CheckBase): Catch wrong destructor here.
5645 (MethodData.Define): Add errors 550, 668.
5647 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5649 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5651 * pending.cs (VerifyPendingMethods): Add error 551.
5653 * typemanager.cs (CSharpName): Next error report helper.
5655 2005-02-25 Marek Safar <marek.safar@seznam.cz>
5657 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5658 attributes. Removed useless attribute double check.
5659 It saves almost 2MBs for corlib.
5661 2005-02-25 Raja R Harinath <rharinath@novell.com>
5664 * statement.cs (ExpressionStatement.Resolve): Make robust to being
5665 called twice in case of error.
5667 2005-02-23 Chris Toshok <toshok@ximian.com>
5669 Fix compiler portions of #72827.
5670 * statement.cs (Block.Emit): call Begin/EndScope on the
5671 EmitContext instead of the ILGenerator.
5673 * codegen.cs (EmitContext.BeginScope): new method, call
5674 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5676 (EmitContext.BeginScope): same, but EndScope and CloseScope
5678 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5679 offset and call the superclass's OpenScope(int) with it.
5680 (SymbolWriter.CloseScope): get the current il
5681 offset and call superclass's CloseScope(int) with it.
5683 2005-02-23 Marek Safar <marek.safar@seznam.cz>
5685 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5686 CS1677 for out and ref as well.
5688 * class.cs (Method.Define): Add error CS1599 detection.
5690 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5692 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5694 * delegate.cs (Delegate.Define): Add error CS1599 detection.
5696 * support.cs.cs (ModifierDesc): New helper method.
5698 2005-02-23 Raja R Harinath <rharinath@novell.com>
5699 Abin Thomas <projectmonokochi@rediffmail.com>
5700 Anoob V E <projectmonokochi@rediffmail.com>
5701 Harilal P R <projectmonokochi@rediffmail.com>
5704 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5705 MemberLookup (used for error reporting) actually returns a result.
5706 Fix error report number (122, not 112).
5708 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
5709 Anoob V E <projectmonokochi@rediffmail.com>
5710 Harilal P R <projectmonokochi@rediffmail.com>
5713 * pending.cs (PendingImplementation.GetAbstractMethods):
5714 Find NonPublic members too.
5716 2005-02-22 Marek Safar <marek.safar@seznam.cz>
5718 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5721 * class.cs (MethodCore.CheckMethodAgainstBase):
5722 Add error 239 report.
5724 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5726 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5728 * class.cs (Operator.Define): Add error 217 report.
5730 2005-02-21 Raja R Harinath <rharinath@novell.com>
5733 * expression.cs (Invocation.IsApplicable): Make public.
5734 (Invocation.IsParamsMethodApplicable): Likewise.
5735 * delegate.cs (Delegate.VerifyApplicability): Don't use
5736 Invocation.VerifyArgumentCompat for parameter applicability
5737 testing. Use Invocation.IsApplicable and
5738 Invocation.IsParamsMethodApplicable.
5740 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5742 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5744 * class.cs (Operator.Define): Add error 217 report.
5746 2005-02-21 Raja R Harinath <rharinath@novell.com>
5748 * namespace.cs (UsingEntry.Resolve): Undo change below.
5750 2005-02-21 Raja R Harinath <rharinath@novell.com>
5753 * ecore.cs (Expression.MemberLookupFailed): Add argument to
5754 disable the error message when the extended MemberLookup also
5756 (Expression.MemberLookupFinal): Update.
5757 (SimpleName.DoSimpleNameResolve): Update.
5758 * expression.cs (MemberAccess.ResolveNamespaceOrType):
5759 Don't use MemberLookupFinal.
5760 (New.DoResolve): Update.
5761 (BaseAccess.CommonResolve): Update.
5763 2005-02-21 Raja R Harinath <rharinath@novell.com>
5766 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5767 occured previously, don't resolve again.
5769 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5772 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5773 argument. Call ResolveAttributeUsage for unresolved.
5774 when types doesn't match ctor arguments.
5776 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5777 for nested attribute classes.
5778 (Class.attribute_usage): Removed.
5779 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5780 for attribute class.
5782 * ecore.cs (IsAttribute): Removed.
5784 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5786 * rootcontext.cs (RegisterAttribute): Removed, attributes are
5788 (attribute_types): Removed.
5789 (EmitCode): Global attributes are emited as the latest.
5791 2005-02-18 Marek Safar <marek.safar@seznam.cz>
5793 * class.cs (EmitFieldInitializers): Don't emit field initializer
5794 for default values when optimilization is on.
5796 * constant.cs (Constant.IsDefaultValue): New property.
5798 * driver.cs: Add /optimize handling.
5802 * literal.cs: Implement new IsDefaultValue property.
5804 * rootcontext.cs (Optimize): New field, holds /optimize option.
5806 2005-02-18 Raja R Harinath <rharinath@novell.com>
5808 Fix crasher in re-opened #72347.
5809 * namespace.cs (Namespace.Lookup): Return null if
5810 DeclSpace.DefineType returns null.
5813 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5815 2005-02-18 Raja R Harinath <rharinath@novell.com>
5817 Fix remainder of #63202. Change semantics of DoResolveLValue: it
5818 now returns null if it cannot resolve to an lvalue.
5819 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5820 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5821 returned null. Remove check for SimpleName.
5822 (EventExpr.DoResolveLValue): New.
5823 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5824 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
5826 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
5828 (Unary.ResolveOperator): Move CS0211 check ...
5829 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
5831 (Unary.DoResolveLValue): Simplify.
5832 (AddressOf.DoResolveLValue): New.
5833 (ArrayAccess.DoResolveLValue): New.
5835 2005-02-16 Marek Safar <marek.safar@seznam.cz>
5837 * attribute.cs (Attribute.Resolve): Add arguments casting for
5838 when types doesn't match ctor arguments.
5840 2005-02-16 Raja R Harinath <rharinath@novell.com>
5842 Fix parts of #63202.
5843 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5844 lookup of operator in base type. Ensure that all checks happen
5845 when the operator resolves to an "op_..." method.
5847 2005-02-15 Raja R Harinath <rharinath@novell.com>
5850 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5851 'ignore_cs0104' parameter. Pass it to ...
5852 (NamespaceEntry.Lookup): ... this.
5853 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5854 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5855 (TypeLookupExpression.DoResolveAsTypeStep): Update.
5856 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5857 Update. Request that cs0104 errors be ignored.
5858 (ComposedCast.ResolveAsTypeStep): Update.
5860 2005-02-14 Raja R Harinath <rharinath@novell.com>
5863 * expression.cs (Invocation.BetterFunction): Remove support for
5864 comparing virtual functions and their overrides.
5865 (Invocation.IsOverride): New.
5866 (Invocation.OverloadResolve): Don't consider 'override' functions
5867 during candidate selection. Store them in a lookaside list.
5868 If the selected method is a 'virtual' function, use the list to
5869 find any overrides that are closer to the LHS type.
5871 2005-02-14 Marek Safar <marek.safar@seznam.cz>
5873 * expression.cs (New.DoResolve): Add complex core type reduction.
5874 (New.Constantify): Converts complex core type syntax like 'new int ()'
5877 2005-02-14 Raja R Harinath <rharinath@novell.com>
5879 * decl.cs (EntryType.EntryType): New constructor to create an
5880 updated copy of a cache entry.
5881 (MemberCache.AddMethods): Use it.
5882 (MemberCache.ClearDeclaredOnly): Remove.
5883 (MemberCache.MemberCache): Update.
5885 2005-02-11 Miguel de Icaza <miguel@novell.com>
5887 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5888 variable. This one is represents the actual low-level declaration
5889 of the method, as opposed to the semantic level `IsStatic'.
5891 An anonymous method which is hosted into a static method might be
5892 actually an instance method. IsStatic would reflect the
5893 container, while MethodIsStatic represents the actual code
5896 * expression.cs (ParameterReference): Use the new MethodIsStatic
5897 instead of IsStatic.
5899 * anonymous.cs (AnonymousMethod.Compatible): Pass the
5900 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5901 set on the current EmitContext.
5903 * expression.cs (Cast): Overload DoResolveLValue so we can pass
5904 resolve our casted expression as an LValue. This triggers the
5905 proper LValue processing that is later required by Assign.
5909 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5911 2005-02-11 Marek Safar <marek.safar@seznam.cz>
5913 C# 2.0 Fixed buffer implementation
5915 * anonymous.cs: Update after RegisterHelperClass renaming.
5917 * attribute.cs (AttributeTester.fixed_buffer_cache):
5918 Cache of external fixed buffers.
5919 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5920 implementation if field is fixed buffer else null.
5923 (TypeContainer.AddField): Accept FieldMember instead of Field.
5924 (FieldBase.IsFieldClsCompliant): Extracted code from
5925 VerifyClsCompliance descendant customization.
5926 (FixedField): New class handles fixed buffer fields.
5927 (FixedFieldExternal): Keeps information about imported fixed
5929 (IFixedField): Make access to internal or external fixed buffer
5932 * cs-parser.jay: Add fixed buffer parsing.
5934 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5937 * expression.cs (Indirection): Extended implementation to accept
5939 (PointerArithmetic.Emit): Get element from fixed buffer as well.
5940 (ElementAccess.MakePointerAccess): Get type as parameter.
5941 (DoResolve): Add fixed buffer field expression conversion.
5942 (DoResolveLValue): Ditto.
5943 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5944 (ArrayPtr): Derives from FixedBufferPtr.
5945 (ArrayPtr.Emit): Add extra emit for array elements.
5947 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5949 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5950 for compiler generated types.
5951 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5953 * statement.cs (Fixed): Refactored to be easier add fixed buffer
5954 and consume less memory.
5955 (Fixed.Resolve): Add fixed buffer case.
5957 * typemanager.cs (compiler_generated_attr_ctor,
5958 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5959 (HasElementType): Add our own implementation to work on every
5962 2005-02-11 Miguel de Icaza <miguel@novell.com>
5964 * anonymous.cs (CaptureContext): Track whether `this' has been
5967 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
5968 only captured `this' if it was implicitly done (instance
5969 methods/variables were used).
5971 * codegen.cs (EmitContext.CaptureThis): New method to flag that
5972 `this' must be captured.
5974 2005-01-30 Miguel de Icaza <miguel@novell.com>
5976 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5977 is null it means that there has been no need to capture anything,
5978 so we just create a sibling.
5980 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5982 Just a partial fix. The other half is fairly elusive.
5984 2005-02-10 Raja R Harinath <rharinath@novell.com>
5986 Fix #52586, cs0121-4.cs.
5987 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
5988 and return a hashtable.
5989 (MemberCache.ClearDeclaredOnly): New.
5990 (MemberCache.MemberCache): Update to change. Make a deep copy of
5991 the method_hash of a base type too.
5992 (MemberCache.AddMethods): Adapt to having a deep copy of the base
5993 type methods. Overwrite entries with the same MethodHandle so
5994 that the ReflectedType is correct. The process leaves in base
5995 virtual functions and their overrides as distinct entries.
5996 (CacheEntry): Now a class instead of a struct. It shouldn't alter
5997 matters since it was boxed in a ArrayList before.
5998 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
6000 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
6001 case of a virtual function and its override (choose the overload
6003 (Invocation.OverloadResolve): Avoid 'override' members during
6004 'applicable_type' calculation.
6006 2005-03-28 Raja R Harinath <rharinath@novell.com>
6008 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
6009 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
6010 GetTypeHandle. It is possible for a reflected type to derive from
6011 a TypeBuilder (e.g., int[] derives from the TypeBuilder
6012 System.Array during mscorlib compilation).
6013 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
6014 contain a method_hash, don't create one either. Don't create a
6015 deep copy of the base cache's method_hash.
6016 (MemberCache.SetupCache): Rename back from DeepCopy.
6017 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
6018 already initialized. If we see an override function, add its
6019 underlying base virtual function to the member_hash too.
6021 2005-02-09 Raja R Harinath <rharinath@novell.com>
6023 Combine two near-redundant caches.
6024 * typemanager.cs (method_params): Rename from method_internal_params.
6025 (TypeManager.GetParameterData): New. Replace
6026 Invocation.GetParameterData.
6027 (TypeManager.LookupParametersByBuilder): Remove.
6028 * expression.cs (Invocation.method_parameter_cache): Remove.
6029 (Invocation.GetParameterData): Remove.
6031 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
6034 2005-02-08 Raja R Harinath <rharinath@novell.com>
6037 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
6038 TypeManager.multicast_delegate_type is null, resolve it by looking
6039 up "System.MulticastDelegate".
6040 * rootcontext.cs (RootContext.ResolveCore): Simplify.
6042 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
6043 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
6044 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
6047 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
6048 (LabeledStatement.AddReference): New. Set 'referenced'.
6049 (Goto.Resolve): Use it.
6051 2005-02-05 John Luke <john.luke@gmail.com>
6053 * driver.cs: remove duplicate -doc line in Usage ()
6055 2005-02-04 Raja R Harinath <rharinath@novell.com>
6057 * location.cs (Location.AddFile): Fix CS2002 error report.
6059 2005-02-02 Martin Baulig <martin@ximian.com>
6061 * delegate.cs (Delegate.DefineType): Report an internal error if
6062 TypeManager.multicast_delegate_type is null. See bug #72015 for
6065 2005-02-02 Raja R Harinath <rharinath@novell.com>
6067 Fix a crasher in a variant of #31984.
6068 * const.cs (Constant.CheckBase): New override that defers the
6069 new-or-override check in case the base type hasn't been populated
6071 (Constant.Define): Ensure the new-or-override check is performed.
6073 2005-02-01 Duncan Mak <duncan@ximian.com>
6075 * const.cs (LookupConstantValue): Check that `ce' is not null
6076 before calling GetValue ().
6078 2005-02-01 Raja R Harinath <rharinath@novell.com>
6080 Fix test-334.cs (#69519).
6081 * cs-parser.jay (using_alias_directive): Pass in an expression to
6082 NamespaceEntry.UsingAlias.
6083 (using_namespace_directive): Pass in an expression to
6084 NamespaceEntry.Using.
6085 (namespace_name): Don't flatten to a string.
6086 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
6087 (NamespaceEntry.AliasEntry.Resolve): Lookup using
6089 (NamespaceEntry.UsingEntry): Likewise.
6090 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
6092 (NamespaceEntry.LookupForUsing): Remove.
6093 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
6095 (NamespaceEntry.Lookup): Remove support for dotted names.
6097 2005-02-01 Raja R Harinath <rharinath@novell.com>
6099 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
6101 (NamespaceEntry.ImplicitParent): Compute on demand.
6102 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
6103 parallels the current.
6104 (NamespaceEntry.LookupForUsing): Use it.
6105 (NamespaceEntry.Lookup): If the current namespace-entry is
6106 implicit, don't search aliases and using tables.
6108 2005-02-01 Raja R Harinath <rharinath@novell.com>
6111 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
6113 (TypeContainer.BaseCache): Compute on demand.
6114 (TypeContainer.FindMembers): Define constants and types if they're
6115 not already created.
6116 (FieldMember.Define): Move resetting of ec.InUnsafe before error
6118 * const.cs (Constant.Define): Make idempotent.
6120 2005-01-29 Miguel de Icaza <miguel@novell.com>
6122 * pending.cs: Produce better code (no nops produced by using Ldarg
6125 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6126 i - 1' it should be arg + 1.
6130 2005-01-28 Raja R Harinath <rharinath@novell.com>
6132 * attribute.cs (Attribute.CheckAttributeType): Make private
6134 (Attribute.ResolveType): Make virtual.
6135 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
6136 handling of RootContext.Tree.Types.
6138 2005-01-27 Raja R Harinath <rharinath@novell.com>
6140 Update attribute-handling to use the SimpleName/MemberAccess
6142 * cs-parser.jay (attribute): Pass in an expression to the
6143 constructors of Attribute and GlobalAttribute.
6144 * attribute.cs (Attribute): Take an expression for the name.
6145 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
6146 passed in attribute name expression.
6147 (Attribute.CheckAttributeType): Use it.
6148 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
6149 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
6150 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
6151 argument to prevent error messages if the lookup fails.
6153 2005-01-27 Marek Safar <marek.safar@seznam.cz>
6155 * expression.cs (Indirection): Implemented IVariable interface
6156 to support indirection in AddressOf operator.
6157 (PointerArithmetic.Emit): Add optimalization for case where
6158 result can be precomputed.
6160 2005-01-26 Martin Baulig <martin@ximian.com>
6162 * class.cs (TypeContainer.AttributeTargets): Return the correct
6163 AttributeTargets depending on our `Kind' instead of throwing an
6164 exception; fixes #71632.
6166 2005-01-26 Marek Safar <marek.safar@seznam.cz>
6169 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
6172 2005-03-17 Martin Baulig <martin@ximian.com>
6174 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6175 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
6177 2005-03-17 Martin Baulig <martin@ximian.com>
6179 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6180 to bool so we can return an error condition.
6181 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6184 2005-03-17 Martin Baulig <martin@ximian.com>
6186 * generic.cs (TypeMananager.IsIEnumerable): New public method.
6188 * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
6189 converting from an array-type of T to `IEnumerable<T>'.
6191 2005-03-16 Martin Baulig <martin@ximian.com>
6193 * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
6194 (Nullable.LiftedUnaryMutator): New public class.
6196 * expression.cs (UnaryMutator.DoResolve): Added support for
6199 2005-03-14 Martin Baulig <martin@ximian.com>
6201 * generic.cs (Nullable.NullCoalescingOperator): Implemented.
6203 2005-03-14 Martin Baulig <martin@ximian.com>
6205 * generic.cs (Nullable.LiftedBinaryOperator): Added support for
6206 the comparision operators `<', `>', `<=' and `>='.
6208 2005-03-13 Martin Baulig <martin@ximian.com>
6211 (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
6212 avoid confusion with the `NullLiteral'.
6213 (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
6215 2005-03-13 Martin Baulig <martin@ximian.com>
6217 * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
6218 comparing arbitrary types with the null literal.
6220 2005-03-13 Martin Baulig <martin@ximian.com>
6222 * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
6223 boolean operators '&&', '||', '&' and '|'.
6224 (Nullable.OperatorTrueOrFalse): New public class.
6226 * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
6227 instead of a `StaticCallExpr'; added support for nullables.
6229 2005-03-10 Martin Baulig <martin@ximian.com>
6232 (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
6233 rather than `etype.IsSubclassOf (TypeManager.value_type)'.
6235 2005-03-07 Martin Baulig <martin@ximian.com>
6237 * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
6238 it work if `expr' is not an IMemoryLocation.
6239 (Nullable.Lifted): Implement IMemoryLocation.
6240 (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
6243 2005-03-05 Martin Baulig <martin@ximian.com>
6245 * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
6246 (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
6247 (Nullable): Added support for lifted unary and binary operators.
6249 * expression.cs (Unary.DoResolve): Added support for nullable types.
6250 (Binary.DoResolve): Likewise.
6251 (Conditional.DoResolve): Likewise.
6253 2005-03-02 Martin Baulig <martin@ximian.com>
6255 * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
6257 * class.cs (ClassPart.SetParameterInfo): Override this.
6258 (PartialContainer.SetParameterInfo): Override this.
6259 (TypeContainer.CheckConstraints): New protected method.
6260 (PartialContainer.CheckConstraints): Override this and check
6261 whether the same contraints were specified in all parts of a
6262 partial generic type definition.
6263 (PartialContainer.UpdateConstraints): New public method.
6265 * generic.cs (TypeParameter.UpdateConstraints): New public method.
6267 2005-03-02 Martin Baulig <martin@ximian.com>
6269 Committing a patch from Carlos Alberto Cortez to fix #72887.
6271 * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
6272 casts from `T []' to `int []'.
6274 2005-03-02 Martin Baulig <martin@ximian.com>
6276 * generic.cs (TypeManager.IsEqual): Make this symmetric.
6278 * expression.cs (Binary.ResolveOperator): When resolving a
6279 BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
6280 `=='. Fixes #71866. See gen-127.cs.
6282 2005-03-02 Martin Baulig <martin@ximian.com>
6284 * class.cs (TypeContainer.DoDefineMembers): We also need a default
6285 static constructor in static classes.
6287 2005-03-02 Martin Baulig <martin@ximian.com>
6290 (NullableType.Name, NullableType.FullName): Add a "?" to the name.
6291 (Nullable.LiftedConversion): Added support for user-defined
6294 * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
6296 * cs-parser.jay: Use ComposedCast everywhere instead of
6297 NullableType, so we don't need to check for NullableType
6299 (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
6300 case where we'll be resolved into a `parenthesized_expression_0'
6304 (Convert.UserDefinedConversion): Added nullable conversions.
6306 2005-02-28 Martin Baulig <martin@ximian.com>
6308 * generic.cs (TypeManager.IsNullableType): New static method.
6309 (Nullable): New abstract class.
6310 (Nullable.NullLiteral): New public class.
6311 (Nullable.LiftedConversion): New public class.
6313 * cs-parser.jay (non_expression_type): Changed `builtin_types' to
6314 `builtin_types opt_nullable'.
6317 (Convert.ImplicitConversionStandard): Added nullable conversions.
6318 (Convert.ExplicitConversionStandard): Likewise.
6319 (Convert.ExplicitConversion): Likewise.
6321 2005-02-26 Martin Baulig <martin@ximian.com>
6323 * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
6324 begin with a "?", for instance "?[]". Don't do a type lookup if
6327 2005-02-25 Martin Baulig <martin@ximian.com>
6329 The first part of Nullable Types :-)
6331 * generic.cs (NullableType): New public class.
6332 (NullCoalescingOperator): New public class.
6333 (TypeArguments.Resolve): Add a CS0306 check.
6335 * cs-parser.jay (opt_error_modifier): Removed, this was unused.
6336 (opt_nullable): New rule.
6337 (type): Added `opt_nullable' to `namespace_or_type_name',
6338 `builtin_types' and `pointer_type'.
6339 (array_type): Added `opt_nullable'.
6340 (opt_rank_specifier_or_nullable): New rule; this is the
6341 combination of `opt_rank_specifier' and `opt_nullable'.
6342 (opt_error): New rule; catch errors here.
6343 (nullable_type_or_conditional): New rule; we use this to check for
6344 nullable and still detect the conditional operator.
6345 (local_variable_type): Use `opt_rank_specifier_or_nullable'
6346 instead `opt_rank_specifier'.
6348 * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
6351 2005-02-24 Martin Baulig <martin@ximian.com>
6353 * README, README.Changes: Removed; they're old and obsolete.
6355 2005-02-22 Martin Baulig <martin@ximian.com>
6357 * generic.cs (TypeParameter.Resolve): If resolving the constraints
6358 returned an error, set `constraints' to null to avoid a crash
6360 (TypeParameter.ResolveType): Likewise.
6362 2005-02-22 Martin Baulig <martin@ximian.com>
6365 (Constraints.ResolveTypes): Protect against being called twice.
6366 (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
6367 (TypeParameter.ResolveType): New public method; calls
6368 constraints.ResolveTypes().
6369 (TypeParameter.DefineType): Moved constraints.ResolveType() out
6370 into the new ResolveType().
6371 (GenericMethod.Define): Call ResolveType() on all our
6374 2005-02-21 Martin Baulig <martin@ximian.com>
6377 (TypeManager.generic_nullable_type): New static public field.
6378 (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
6381 (RootContext.ResolveCore): Resolve "System.Nullable`1".
6383 2005-02-15 Martin Baulig <martin@ximian.com>
6385 * generic.cs (ConstructedType.Constraints): Correctly check
6386 constraints if the argument type is a type parameter; fixes
6389 2005-02-02 Martin Baulig <martin@ximian.com>
6391 * delegate.cs (Delegate.DefineType): Report an internal error if
6392 TypeManager.multicast_delegate_type is null. See bug #72015 for
6395 2005-01-29 Miguel de Icaza <miguel@novell.com>
6397 * pending.cs: Produce better code (no nops produced by using Ldarg
6400 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6401 i - 1' it should be arg + 1.
6405 2005-01-26 Martin Baulig <martin@ximian.com>
6407 * cs-parser.jay (indexer_declarator): Don't report an error if we
6408 have type parameters since we can be an explicit interface
6409 implementation; fixes #71449.
6411 2005-01-26 Martin Baulig <martin@ximian.com>
6413 * class.cs (TypeContainer.AttributeTargets): Return the correct
6414 AttributeTargets depending on our `Kind' instead of throwing an
6415 exception; fixes #71632.
6417 2005-01-26 Martin Baulig <martin@ximian.com>
6419 * delegate.cs (Delegate.DefineType): Correctly define our type
6420 parameters. Fixes #71483.
6422 2005-01-25 Raja R Harinath <rharinath@novell.com>
6425 * expression.cs (MemberAccess.DoResolve): Don't complain with
6426 cs0572 when the LHS of a member access has identical name and type
6429 2005-01-25 Marek Safar <marek.safar@seznam.cz>
6432 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
6434 Create custom PermissionSet only for PermissionSetAttribute.
6436 2005-01-24 Marek Safar <marek.safar@seznam.cz>
6439 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
6440 delegates in static class.
6442 2005-01-24 Martin Baulig <martin@ximian.com>
6444 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6445 merging an implicit block, just use its reachability.
6447 * statement.cs (Block.Resolve): Make the unreachable code check
6448 work wrt. implicit blocks; see test-337 from #63842.
6450 2005-01-21 Alp Toker <alp@atoker.com>
6452 * cs-parser.jay: destructor_declaration's container is PartialContainer
6453 not Class when partial types are used, so use Kind prop instead of
6456 2005-01-22 Miguel de Icaza <miguel@ximian.com>
6458 * cs-parser.jay: Improve error reporting when an interface
6461 2005-01-20 Dick Porter <dick@ximian.com>
6463 * support.cs: SeekableStreamReader fix from Sandor Dobos
6464 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
6465 chars are read. Fixes bug 70369.
6467 2005-01-20 Raja R Harinath <rharinath@novell.com>
6469 * cs-parser.jay (catch_clause): Simplify current_block handling
6472 2005-01-17 Miguel de Icaza <miguel@ximian.com>
6474 * convert.cs (ImplicitStandardConversionExists): Synchronize the
6475 code with ImplicitStandardConversion to handle the implicit
6476 conversion of method groups into valid delegate invocations.
6478 The problem is that in parameter handling we were using this code
6479 path. Fixes bug #64698
6481 2005-01-19 Raja R Harinath <rharinath@novell.com>
6483 * cs-parser.jay: Fix several infelicities.
6484 - Avoid assigning to the parser value stack. Code like
6485 '$3 = null' is unclean. Synthesize a value for the code block
6487 - Avoid using oob_stack for storing location information. Use ...
6488 (_mark_): ... this. New (empty) rule. Saves the current location
6490 (foreach_statement): Avoid using oob_stack for current_block
6491 handling. Use technique used in for_statement and
6492 using_statement. Synthesize a value for the code block to store
6493 additional intermediate information.
6495 2005-01-13 Miguel de Icaza <miguel@ximian.com>
6497 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
6498 of a different type is only allowed to private fields of a
6499 containing type, not on fields of a base class.
6501 See test-174.cs and error cs0122-9.cs
6503 2005-01-13 Raja R Harinath <rharinath@novell.com>
6505 Fix test-335.cs (bug #58126).
6506 * cs-parser.jay (argument): Split out non-expression parts of the
6507 rule into 'non_simple_argument'.
6508 (invocation_expression): Support parenthesized invocations with
6509 multiple arguments, and with single non-simple arguments.
6511 2005-01-13 Raja R Harinath <rharinath@novell.com>
6513 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
6516 2005-01-12 Raja R Harinath <rharinath@novell.com>
6518 Fix cs0038-1.cs, cs1640-6.cs.
6519 * ecore.cs (Expression.Resolve): Remove special-case for
6520 SimpleName in error-handling.
6521 (Expression.almostMatchedMembers): Relax access permission to
6523 (Expression.MemberLookupFailed): Handle duplicates in
6524 almostMatchedMembers list.
6525 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
6526 * expression.cs (New.DoResolve): Report CS1540 for more cases.
6527 * typemanager.cs (GetFullNameSignature): Use the MethodBase
6528 overload if the passed in MemberInfo is a MethodBase.
6530 2005-01-25 Martin Baulig <martin@ximian.com>
6533 (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
6535 2005-01-12 Marek Safar <marek.safar@seznam.cz>
6538 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
6539 for non-CAS & merge permission sets properly.
6541 2005-01-11 Raja R Harinath <rharinath@novell.com>
6543 Improve standard-compliance of simple name and member access
6544 resolution. Fixes bugs #52697, #57200, #67520, #69519.
6545 * ecore.cs (FullNamedExpression): New abstract base class
6546 for Namespaces and TypeExpressions.
6547 (ResolveFlags.SimpleName): Remove.
6548 (SimpleName): Remove support for dotted names.
6549 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
6550 DeclSpace.FindType and DeclSpace.LookupType.
6551 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
6552 (Expression.ExprClassName): Make member function.
6553 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
6554 a namespace. Remove creation of dotted "SimpleName"s.
6555 (MemberAccess.DoResolve): Likewise.
6556 * decl.cs (DeclSpace.Cache): Make private.
6557 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
6558 (DeclSpace.FindType): Update.
6559 (DeclSpace.LookupType): Move here from RootContext. Return a
6560 FullNamedExpression.
6561 * namespace.cs (Namespace): Derive from FullNamedExpression
6562 so that it can be part of expression resolution.
6563 (Namespace.Lookup): Return an FullNamedExpression.
6564 (NamespaceEntry.LookupAlias): Lookup aliases only in current
6566 * rootcontext.cs (NamespaceLookup): Remove.
6567 (LookupType): Move to DeclSpace.
6568 * attribute.cs (CheckAttributeType): Update.
6569 * doc.cs (FindDocumentedType): Remove allowAlias argument.
6570 (FindDocumentedTypeNonArray): Likewise.
6572 2005-01-11 Raja R Harinath <rharinath@novell.com>
6574 Fix cs0509.cs, cs1632.cs.
6575 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
6576 is the same as IsInterface.
6577 (TypeContainer.GetClassBases): Likewise.
6578 * statement.cs (LabeledStatement.ig): New field.
6579 (LabeledStatement.LabelTarget): Save ILGenerator which created the
6581 (LabeledStatement.DoEmit): Check that the label was created with
6582 the same ILGenerator.
6584 2005-01-10 Marek Safar <marek.safar@seznam.cz>
6587 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
6588 accessors to its properties.
6590 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
6591 from accessors to property.
6593 2005-01-10 Marek Safar <marek.safar@seznam.cz>
6596 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
6599 2005-01-08 Miguel de Icaza <miguel@ximian.com>
6601 * attribute.cs: Check for null and empty strings.
6603 I have lost another battle to Paolo.
6605 2005-01-07 Marek Safar <marek.safar@seznam.cz>
6608 * class.cs (PropertyMethod): Set Parent field in ctors.
6609 (SetMethod.InternalParameters): Add unsafe switch hack.
6610 Override MarkForDuplicationCheck where it is appropriate.
6612 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
6613 It says whether container allows members with the same name.
6615 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
6616 Removed is_method parameter.
6618 2005-01-06 Duncan Mak <duncan@ximian.com>
6620 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6621 because the previous change led to incorrect reporting of CS1032
6622 ("Cannot define/undefine preprocessor symbols after first token in
6623 file"). Instead of using `tokens_seen' as the only flag that
6624 triggers CS1040, introduce `comments_seen'. This new flag is used
6625 to signify having seen comments on the current line, so it is
6626 unset after a newline.
6628 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
6630 * doc.cs : When searching for a type, find nested type too.
6631 This fixes bug #71040.
6633 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
6636 - Warn missing member comment on those classes which also does not
6637 have doc comments. Fixed bug #71041.
6638 - Don't warn missing doc comment on default constructor.
6641 2005-01-06 Duncan Mak <duncan@ximian.com>
6643 * cs-tokenizer.cs (xtoken): After handling traditional C-style
6644 comments, set `tokens_seen' to true. This allows us to detect
6645 misplaced preprocessor directives (i.e. not at the beginning of
6646 the a line, nor after whitespaces). In that case, report error
6647 CS1040. This fixes bug #56460.
6649 * cs-parser.jay (interface_member_declaration): Add checks for
6650 IsExplicitImpl, and report CS0541 error if an interface member is
6651 defined as an explicit interface declaration.
6653 2005-01-06 Marek Safar <marek.safar@seznam.cz>
6656 * class.cs (PropertyMethod): Set Parent field in ctors.
6657 (SetMethod.InternalParameters): Add unsafe switch hack.
6659 * decl.cs (MemberCore.Parent): Cannot be readonly.
6661 2005-01-06 Raja R Harinath <rharinath@novell.com>
6663 * decl.cs (DeclSpace.ResolveType): Remove.
6664 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
6665 Merge in code from ...
6666 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
6667 * class.cs, enum.cs: Update to changes.
6669 2005-01-06 Miguel de Icaza <miguel@ximian.com>
6671 * anonymous.cs: Ensure that we init the scope of our parent if it
6672 has not been initialized yet.
6674 2004-12-30 Duncan Mak <duncan@ximian.com>
6676 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6677 if field.FieldBuilder is null. Fixes #70758.
6679 * convert.cs: Fixed some typos and updated some of the comments.
6680 (ImplicitStandardConversionExists):
6681 (TryImplicitIntConversion): If `target_type' is an interface and
6682 the type of `ic' implements this interface, return true or a new
6683 BoxedCast instead of null. This fixes #70468.
6685 2004-12-29 Duncan Mak <duncan@ximian.com>
6687 * expression.cs (Argument.Emit): Check that Expr is
6688 IMemoryLocation before casting to it, and report CS1510 otherwise.
6692 2004-12-21 Ben Maurer <bmaurer@ximian.com>
6694 * statement.cs (Block.ThisVariable): remove the recursion here, to
6695 make the --profile more sane.
6697 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
6699 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6700 assembly, by JB Evain.
6702 2004-12-17 Raja R Harinath <rharinath@novell.com>
6704 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
6705 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6706 "parent" refers to enclosing type/class. "base" refers to superclass.
6708 2004-12-17 Raja R Harinath <rharinath@novell.com>
6710 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6711 Ensure that we only have GlobalAttributes.
6712 * attribute.cs (Attribute.Emit): Make non-virtual.
6713 (GlobalAttribute.Emit): Remove.
6714 (Attribute.Resolve): Make virtual.
6715 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
6716 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6717 the argument. Don't create one.
6718 (Attribute.GetObsoleteAttribute): Likewise.
6719 (Attribute.GetClsCompliantAttributeValue): Likewise.
6720 * class.cs, decl.cs: Update to changes.
6722 2004-12-17 Marek Safar <marek.safar@seznam.cz>
6724 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6726 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6728 * statement.cs (Foreach.Resolve): Add error 186 report.
6730 2004-12-16 Marek Safar <marek.safar@seznam.cz>
6732 * expression.cs (Conditional.DoResolve): Add warning 429.
6734 * statement.cs (If.Resolve): Add warning 665.
6736 2004-12-16 Raja R Harinath <rharinath@novell.com>
6738 New invariant: RootContext.Tree.Types.NamespaceEntry == null
6739 except when in the parser, and in GlobalAttribute.
6740 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6741 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6742 RootContext.Tree.Types.NamespaceEntry once work is done.
6743 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
6744 and resets RootContext.Tree.Types.NamespaceEntry.
6746 2004-12-15 Marek Safar <marek.safar@seznam.cz>
6748 * cs-parser.jay: Don't create a block for every variable.
6750 2004-12-14 Miguel de Icaza <miguel@ximian.com>
6752 * location.cs: Provide extra information.
6754 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6755 variables from the captured environment, it is the ldarg_0.
6757 2004-12-14 Marek Safar <marek.safar@seznam.cz>
6759 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6762 * class.cs: Changed warning level for 169 to avoid developer
6763 displeasure from warning flooding. It will be changed back when they
6764 fix most of current BCL warnings.
6766 * RootContext.cs: Pushed default WarningLevel to 3.
6768 * statement.cs: Removed unused variable.
6770 2004-12-14 Marek Safar <marek.safar@seznam.cz>
6772 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6773 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6774 Add error 502 report.
6775 (StaticClass.DefineType): Add error 441 report.
6776 (Class.AllowedModifiersProp): New virtual property as temporary
6777 extension to AllowedModifiers.
6778 (Class.DefineType): Add error 418 report. Moved ModFlags check here
6779 to share implementation with StaticClass and don't call virtual
6782 * driver.cs (MainDriver): Add error 1558 test.
6784 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6785 report. Moved error 36 test here.
6787 * statement.cs (Throw.Resolve): Add error 724 report.
6789 * typemanager.cs: Add out_attribute_type core type.
6791 2004-12-13 Marek Safar <marek.safar@seznam.cz>
6793 * class.cs (TypeContainer.VerifyClsCompliance): Add error
6795 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6797 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6800 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6802 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
6803 Add error 3023 report.
6804 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6806 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6809 2004-12-12 John Luke <john.luke@gmail.com>
6811 * driver.cs (AddArgs): take -- into account when
6812 adding arguments, fixes bug 65710
6814 2004-12-12 Martin Baulig <martin@ximian.com>
6816 * expression.cs (Unary.TryReduceNegative): Added support for
6817 SByteConstant and ByteConstant.
6818 (Unary.Reduce): Check error values from TryReduceNegative().
6820 2004-12-10 Marek Safar <marek.safar@seznam.cz>
6822 * attributes.cs (Attribute.Resolve): Avoid multiple error report
6823 and report exception as error 182.
6825 2004-12-10 Raja R Harinath <rharinath@novell.com>
6827 * driver.cs (Main): Fix message when there are warnings.
6829 2004-12-09 Miguel de Icaza <miguel@ximian.com>
6831 * delegate.cs: Fixed my fix from yesterday, sorry about that.
6833 2004-12-09 Marek Safar <marek.safar@seznam.cz>
6835 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
6836 Reduced number of warnings.
6838 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6840 2004-12-08 Miguel de Icaza <miguel@ximian.com>
6842 * driver.cs: Removed message.
6844 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6846 2004-12-08 <vargaz@freemail.hu>
6848 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6850 2004-12-08 Martin Baulig <martin@ximian.com>
6852 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6853 instead of a CS3002 for properties and indexer.
6855 2004-12-08 Martin Baulig <martin@ximian.com>
6857 * decl.cs (MemberName.ToString): Make this work again.
6859 2004-12-08 Marek Safar <marek.safar@seznam.cz>
6861 * attribute.cs (Resolve): Add error 591 detection.
6863 * class.cs (FieldMember.Define): Add error 1547 detection.
6864 (Indexer.Define): Add error 620 detection.
6865 (Operator.Define): Add error 590 detection.
6867 * ecore.cs: Missing argument for error 79.
6869 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6872 2004-12-07 Marek Safar <marek.safar@seznam.cz>
6875 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6878 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
6880 * cs-parser.jay : handle doc comments on implicit/explicit operators.
6881 Some operator comments were suppressed.
6882 * doc.cs : Implicit/explicit operator name in doc comments are like
6883 "op_Explicit(type)~returnType", so added suffix handling.
6885 2005-01-21 Alp Toker <alp@atoker.com>
6887 * cs-parser.jay: destructor_declaration's container is PartialContainer
6888 not Class when partial types are used, so use Kind prop instead of 'is'.
6890 2004-12-12 Martin Baulig <martin@ximian.com>
6892 * expression.cs (Unary.TryReduceNegative): Added support for
6893 SByteConstant and ByteConstant.
6894 (Unary.Reduce): Check error values from TryReduceNegative().
6896 2004-12-11 Martin Baulig <martin@ximian.com>
6898 * support.cs (ReflectionParameters.ParameterName): If we have a
6899 `gpd', call `ParameterName' on it.
6901 * parameter.cs (Parameter.GetParameterAttributes): New static method.
6903 * pending.cs (PendingImplementation.DefineProxy): Call
6904 DefineParameter() for all of the MethodBuilder's arguments.
6906 2004-12-09 Martin Baulig <martin@ximian.com>
6908 * doc.cs (DocUtil): Make this a static class.
6910 2004-12-09 Martin Baulig <martin@ximian.com>
6912 * expression.cs (Invocation.InferType): Moved the type inference
6913 implementation into TypeManager.
6915 * generics.cs (TypeManager): Moved the type inference
6916 implementation here.
6918 2004-12-09 Martin Baulig <martin@ximian.com>
6920 * typemanager.cs (TypeManager): Make this a partial class.
6923 (TypeManager): Move the generics part of `TypeManager' here.
6925 2004-12-08 Martin Baulig <martin@ximian.com>
6927 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6928 instead of a CS3002 for properties and indexer. Added CS3024
6929 check for generic interfaces.
6931 * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
6932 instances are not CLS-compliant.
6934 2004-12-08 Martin Baulig <martin@ximian.com>
6937 (void_pointer_expression): New rule for `void*', `void**' etc.
6938 (typeof_expression): Add `void_pointer_expression'; fixes #66846.
6940 2004-12-08 Martin Baulig <martin@ximian.com>
6942 * expression.cs (Invocation.InferType): Removed the hack for
6943 MethodCore.MayUnify().
6945 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
6948 * class.cs (MethodCore.MayUnify): Use
6949 TypeManager.MayBecomeEqualGenericTypes().
6951 2004-12-08 Martin Baulig <martin@ximian.com>
6953 * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
6954 parameter, box it. Fixes #69233.
6956 2004-12-08 Martin Baulig <martin@ximian.com>
6958 * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
6959 have the ctor constraint. Fixes #68326.
6961 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
6963 * cs-parser.jay : interface comment was not consumed because of
6964 extra opt_semicolon before doc handling.
6966 2004-12-03 Raja R Harinath <rharinath@novell.com>
6968 Fix test-327.cs, test-328.cs, and put in early infrastructure
6969 for eventually fixing #52697.
6970 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6971 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6973 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6974 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6975 (VerifyUsing, error246): Update.
6976 * rootcontext.cs (RootContext.NamespaceLookup): Just use
6977 'NamespaceEntry.LookupNamespaceOrType'.
6979 2004-12-07 Martin Baulig <martin@ximian.com>
6981 * driver.cs: Call it "BETA SOFTWARE" :-)
6983 2004-12-06 Raja R Harinath <rharinath@novell.com>
6985 Fix crash on cs0657-17.cs.
6986 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6987 Use RootContext.Tree.Types, not 'new RootTypes ()'.
6988 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6989 the case where the NamespaceEntry gets overwritten.
6991 2004-12-06 Marek Safar <marek.safar@seznam.cz>
6993 Fixed #69195, #56821
6994 * ecore.cs (ResolveBoolean): Tiny refactoring.
6996 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6997 of right expression resolving when left is false constant and
6998 operator is LogicalAnd OR true constant and operator is LogicalOr.
7000 * statement.cs (ResolveUnreachable): Always reports warning.
7002 2004-12-05 Miguel de Icaza <miguel@ximian.com>
7004 * class.cs: Distinguish between 1721 and 1722 (just a little help
7005 for the programmer).
7007 2004-12-03 Miguel de Icaza <miguel@ximian.com>
7009 * delegate.cs: Only allow this on new versions of the language.
7011 2004-12-02 Duncan Mak <duncan@ximian.com>
7013 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
7015 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
7016 here as a static method. Take an additional bool out parameter
7017 `must_do_cs1540_check' for signaling to InstanceResolve.
7018 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
7019 member field from PropertyExpr class and made it an argument of
7021 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
7022 check for MarshalByRefObject, and report CS0122 instead of CS1540.
7023 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
7024 and `remove_accessor' as well as InstanceResolve: report CS0122
7029 2004-12-07 Martin Baulig <martin@ximian.com>
7031 * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
7032 and CS0692 where appropriate.
7034 2004-12-06 Martin Baulig <martin@ximian.com>
7036 * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
7037 IsDuplicateImplementation() and improved it.
7039 * expression.cs (Invocation.InferTypeArguments): Added
7040 `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
7041 and removed the "ref" modifier from `infered_types'.
7043 * decl.cs (MemberName.ToString): Removed the exception.
7045 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
7047 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
7048 comments are allowed.
7050 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7052 * delegate.cs: Add checks for subtypes in paramaters and return values
7053 in VerifyMethod () to add support for Covariance/Contravariance
7056 2004-12-02 Miguel de Icaza <miguel@ximian.com>
7058 * report.cs: Remove extra closing parenthesis.
7060 * convert.cs (Error_CannotImplicitConversion): If the name of the
7061 types are the same, provide some extra information.
7063 2004-12-02 Marek Safar <marek.safar@seznam.cz>
7066 * attribute.cs (Resolve): Improved implementation of params
7067 attribute arguments.
7069 * support.cs (ParameterData): Add HasParams to be faster.
7071 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
7073 all things are for /doc support:
7075 * doc.cs: new file that supports XML documentation generation.
7076 * mcs.exe.sources: added doc.cs.
7078 Handle /doc command line option.
7079 Report error 2006 instead of 5 for missing file name for /doc.
7080 Generate XML documentation when required, after type resolution.
7082 Added support for picking up documentation (/// and /** ... */),
7083 including a new XmlCommentState enumeration.
7085 Added lines to fill Documentation element for field, constant,
7086 property, indexer, method, constructor, destructor, operator, event
7087 and class, struct, interface, delegate, enum.
7088 Added lines to warn incorrect comment.
7090 Added Documentation field (passed only when /doc was specified).
7092 Added DocComment, DocCommentHeader, GenerateDocComment() and
7093 OnGenerateDocComment() and some supporting private members for
7094 /doc feature to MemberCore.
7096 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
7098 Added overriden DocCommentHeader.
7100 Added overriden DocCommentHeader and GenerateDocComment().
7102 2004-12-01 Miguel de Icaza <miguel@ximian.com>
7104 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
7105 unwrapping the enumeration values, chain to
7106 DoConstantNumericPromotions again, so we can promote things to the
7107 fundamental types (takes care of enums that are bytes, sbytes).
7111 2004-12-01 Raja R Harinath <rharinath@novell.com>
7113 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
7114 Fix long-standing bug in type-lookup. Use FindType instead of
7115 LookupType when ec.ResolvingTypeTree.
7116 (Attribute.ResolveType, Attribute.Resolve)
7117 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
7119 (Attributes.Search): Remove internal version. Update.
7120 (Attributes.SearchMulti): Update.
7121 (Attributes.GetClsCompliantAttribute): Remove.
7122 (Attributes.GetIndexerNameAttribute): Remove.
7123 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
7124 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
7125 * class.cs (Indexer.Define): Likewise.
7127 2004-12-01 Marek Safar <marek.safar@seznam.cz>
7130 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
7131 MarshallByReference members access.
7133 * expression.cs: Use CheckMarshallByRefAccess;
7134 Better error CS0197 message.
7136 * report.cs: Print whole related error message.
7138 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7140 * class (GetClassBases): Better error 60 report.
7141 (EventProperty): Disabled warning 67 detection.
7143 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7146 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
7148 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
7151 2004-11-29 Marek Safar <marek.safar@seznam.cz>
7154 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
7156 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
7158 2004-11-26 Miguel de Icaza <miguel@ximian.com>
7160 * attribute.cs (Attribute.Resolve): Refine error reporting and
7161 report a cs0117 if the identifier does not exist, to distinguish
7162 from 0617 which is a miss-use of the actual identifier.
7164 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
7165 between cs0070 and cs0079.
7167 * class.cs (MemberBase.DoDefine): When reporting a wrong
7168 accessibility level, we use MethodCore to compare instead of
7169 Method (this was a regression in some refactoring effort).
7171 So now we correctly report cs0056 again.
7173 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
7174 testing the target_type (which was known to be object_type) and
7175 not the source type (which is anonymous_method).
7177 Fixed reporting of error cs1660.
7179 * expression.cs (UserCast.Source): Expose the underlying cast.
7181 * statement.cs (Switch.SwitchGoverningType): Sort the list of
7182 allowed types to find a match to int32 first (most common).
7184 In addition, it ignores any ImplicitUserConversions that did an
7185 internal implicit conversion (as the switch statement allows only
7186 one integral conversion to exist).
7188 * class.cs (PartialContainer.Create): rename `name' to
7189 `member_name' for clarity. Then replace the string calls with a
7190 call to MemberName.GetPartialName, as now using
7191 MemberName.ToString is an error (this is due to the side effects
7192 it had, that were fixed in the past).
7194 This will restore the error reporting on a number of partial class
7195 errors that were missusing this (and getting an exception as a
7196 results, which is now just a plain textual warning, because
7197 yyparse debug output would crash otherwise).
7199 2004-11-26 Raja R Harinath <rharinath@novell.com>
7201 * Makefile (PROGRAM_INSTALL_DIR): Remove.
7203 2004-11-25 Ben Maurer <bmaurer@ximian.com>
7205 * rootcontext.cs (LookupType): Make sure to cache lookups that
7206 don't give us a negative result. This saves about 5% of corlib
7209 2004-11-25 Miguel de Icaza <miguel@ximian.com>
7211 * report.cs (AbstractMessage.Print): messages are sent to stderr
7213 * class.cs (TypeContainer.GetClassBases): It is an error to have a
7214 non-interface in the list of interfaces (at this point, either
7215 parent was properly set, or a base class is being listed in the
7216 interfaces section).
7218 This flags error 1722, and resolves the crash from bug 69259.
7220 2004-11-25 Ben Maurer <bmaurer@ximian.com>
7222 * statement.cs (Using.EmitExpressionFinally): make this work right
7223 for valuetypes. Fixes 69926.
7225 2004-11-25 Miguel de Icaza <miguel@ximian.com>
7227 * const.cs (Const.ChangeType): Cope with the "0 literal can be
7228 converted to an enum" here, before we try to change the underlying
7229 type. This code exists, but it is a different code path than the
7230 one used while encoding constants.
7232 (ImplicitReferenceConversionExists): In addition, resynchronized
7233 the code here, so it matches the same code in
7234 ImplicitReferenceConversionExists for the `from any class-type S
7235 to any interface-type T'.
7237 2004-11-25 Marek Safar <marek.safar@seznam.cz>
7239 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
7241 2004-11-24 Miguel de Icaza <miguel@ximian.com>
7243 * cs-parser.jay: Use verbosity accordingly.
7245 2004-11-24 Marek Safar <marek.safar@seznam.cz>
7247 * expression.cs (Unary.ResolveOperator): Do not report warning;
7248 AddressOf reads from variable.
7250 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
7252 2004-11-24 Marek Safar <marek.safar@seznam.cz>
7256 * attribute.cs (Attributable): Removed CheckTargets.
7257 (Attributes.Emit): Explicit attribute targets are tested here.
7259 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
7260 not enabled for interfaces.
7262 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
7263 (GetAssemblyName): Ouch next bug there.
7265 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7267 * expression.cs: Error 275 added.
7269 2004-11-23 Marek Safar <marek.safar@seznam.cz>
7271 Fix bug #69177 (Implemented decimal constant support)
7273 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
7274 (BinaryFold): Add DecimalConstant.
7276 * const.cs (Define): Decimal constant
7278 (ChangeType): Add decimal type handling.
7279 (LookupConstantValue): Don't set value for decimal type but
7280 emit DecimalConstantAttribute. Needed for constant optimization.
7282 * constant.cs (ToDecimal): New method.
7283 (ConvertToDecimal): New method.
7284 (IntConstant): Implemented ConvertToDecimal.
7285 (DecimalConstant.Emit): Emit optimized version for decimals in
7288 * expression.cs (ResolveOperator): Changed order of constant
7289 reduction to work correctly with native types which have
7290 overloaded operators.
7291 (ResolveMemberAccess): Extract constant value from attribute
7294 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
7296 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
7297 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
7298 (ChangeType): Decimal is special.
7299 (TypeToCoreType): Add decimal type.
7301 2004-11-22 Marek Safar <marek.safar@seznam.cz>
7303 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
7306 2004-11-22 Marek Safar <marek.safar@seznam.cz>
7308 * class.cs (EventField.ApplyAttributeBuilder): Fix error
7311 2004-11-19 Marek Safar <marek.safar@seznam.cz>
7313 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
7315 * pending.cs (PendingImplementation): Grab only interfaces.
7317 2004-11-19 Marek Safar <marek.safar@seznam.cz>
7319 * statement.cs (ForeachHelperMethods): Add location member and
7320 error 202 detection.
7322 2004-11-18 Marek Safar <marek.safar@seznam.cz>
7324 * expression.cs (DoResolveBase): Fixed wrong warning for out
7327 2004-12-04 Martin Baulig <martin@ximian.com>
7329 * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
7330 to check whether the conversion is ok.
7332 * typemanager.cs (TypeManager.GetTypeArguments): Just return
7333 `Type.EmptyTypes' if we're not a generic TypeContainer.
7335 2004-11-25 Miguel de Icaza <miguel@ximian.com>
7337 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
7338 old bug: when converting from the null literal to a pointer,
7339 return an EmptyCast, not the NullLiteral.
7341 This fixes #69921, the recent null_type changes probably made this
7344 2004-12-03 Martin Baulig <martin@ximian.com>
7346 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7347 method as our child, call AnonymousMethod.Compatible() on it.
7349 2004-12-02 Miguel de Icaza <miguel@ximian.com>
7351 * class.cs (FieldBase): Use an unused bit field from the field to
7352 encode the `has_offset' property from the FieldMember. This saves
7353 a couple of Ks on bootstrap compilation.
7355 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7356 method as our child, return the AnonymousMethod resolved
7359 * expression.cs (New.DoResolve): Allow return values from
7360 NewDelegate to also include AnonymousMethods.
7364 2004-11-29 Raja R Harinath <rharinath@novell.com>
7366 * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
7368 * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
7369 System.Runtime.InteropServices._Exception, since it's a base
7370 interface of the core type System.Exception in the net_2_0 profile.
7372 2004-11-27 Martin Baulig <martin@ximian.com>
7374 * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
7376 2004-11-26 Raja R Harinath <rharinath@novell.com>
7378 * Makefile: Convert to use executable.make.
7379 * gmcs.exe.sources: New.
7381 2004-11-25 Martin Baulig <martin@ximian.com>
7383 * expression.cs (Invocation.InferType): Added support for byref types.
7385 2004-11-25 Martin Baulig <martin@ximian.com>
7387 * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
7388 in TypeManager.TypeToCoreType().
7390 2004-11-25 Martin Baulig <martin@ximian.com>
7392 * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
7393 "Dispose" method from the `current_type'.
7394 (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
7395 DoDefineMembers() instead of using the MethodBuilder; this is
7396 required for generic iterators.
7398 * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
7400 2004-11-24 Martin Baulig <martin@ximian.com>
7402 * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
7404 2004-11-20 Martin Baulig <martin@ximian.com>
7406 * expression.cs (Invocation.InferType): Correctly infer generic
7407 instances; see gen-103.cs.
7408 (Invocation.InferTypeArguments): If a generic method doesn't have
7409 any unbound type parameters, we don't need to infer anything.
7411 2004-11-19 Raja R Harinath <rharinath@novell.com>
7413 * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
7415 2004-11-17 Raja R Harinath <rharinath@novell.com>
7417 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
7418 (TypeHandle.GetMemberCache): New.
7419 (TypeHandle.TypeHandle): Update.
7420 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
7421 (TypeManager.LookupParentInterfacesCache):
7422 Rename from LookupInterfaceCache. Optimize slightly.
7423 (TypeManager.MemberLookup_FindMembers): Update.
7424 * decl.cs (MemberCache.MemberCache): Set Container to null in the
7426 (AddCacheContents): Rename from AddHashtable.
7427 * class.cs (TypeContainer.parent_container): Remove.
7428 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
7429 (TypeContainer.DoDefineMembers): Don't initialize it.
7430 Update to name changes.
7432 2004-11-17 Miguel de Icaza <miguel@ximian.com>
7434 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
7435 that factors the code to check access modifiers on override.
7437 (PropertyBase): Use the code here.
7439 Patch from Lluis S'anchez, fixes bug #69361.
7441 2004-11-15 Miguel de Icaza <miguel@ximian.com>
7443 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
7444 routine that is used to report the use of a captured variable
7445 whose address has been taken.
7447 There are two checks: one when variables are being captured and
7448 the other check is when the address of a variable is taken.
7450 (because an anonymous methods might be resolved before *or* after
7451 the address has been taken) and
7453 * expression.cs (Conditional.DoResolve): Remove the special
7454 casing that Martin added to trueExpr and falseExpr being both
7455 NullLiteral. We get the right behavior now just by introducing
7456 the null_type into the compiler.
7458 * convert.cs (ExplicitConversion): Change the code to use
7459 null_type instead of testing `expr is NullLiteral'.
7460 (ImplicitConversionStandard): use null_type too.
7461 (ImplicitReferenceConversionExists): use null_type too.
7462 (ImplicitReferenceConversion): use null_type too.
7464 * literal.cs: The type of `NullLiteral' is now null_type instead
7466 (Resolve): Set the type here.
7468 * typemanager.cs: Introduce null_type.
7470 2004-11-18 Martin Baulig <martin@ximian.com>
7473 (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
7475 2004-11-18 Martin Baulig <martin@ximian.com>
7477 * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
7479 2004-11-18 Martin Baulig <martin@ximian.com>
7481 * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
7482 of a `DeclSpace'. If one of our constraints is a `ConstructedType',
7483 call ResolveConstructedType() on it to resolve it without checking
7485 (Constraints.ResolveTypes): Check them here.
7486 (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
7487 but don't check constraints.
7488 (ConstructedType.ResolveAsTypeTerminal): Override this and also
7489 check constraints here.
7490 (ConstructedType.ResolveConstructedType): New public method. This
7491 is called from DoResolveAsTypeStep() and Constraints.Resolve() to
7492 resolve ourselves without checking constraints.
7494 * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
7496 2004-11-18 Martin Baulig <martin@ximian.com>
7499 (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
7501 * delegate.cs (Delegate.DefineType): Always create the EmitContext.
7503 2004-11-18 Martin Baulig <martin@ximian.com>
7505 * ecore.cs (TypeExpr.ResolveType): Removed.
7506 (Expression.ResolveAsTypeTerminal): We always return a fully
7507 resolved `TypeExpr', so we can just access its `Type'.
7509 * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
7511 2004-11-17 Martin Baulig <martin@ximian.com>
7513 * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
7514 sure we don't return any unresolved TypeExpr's.
7515 (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
7517 (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
7519 * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
7520 unresolved `ConstructedType's.
7522 2004-11-17 Martin Baulig <martin@ximian.com>
7524 * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
7526 2004-11-17 Martin Baulig <martin@ximian.com>
7529 (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
7531 * decl.cs (DeclSpace.ResolveType): Removed.
7532 (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
7534 2004-11-17 Martin Baulig <martin@ximian.com>
7536 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
7537 direction, like FindMembers() does. Fixes #69546, testcase is in
7540 2004-11-16 Martin Baulig <martin@ximian.com>
7542 This is based on a patch from Marek Safar, see bug #69082.
7543 Fixes bugs #63705 and #67130.
7545 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
7546 method; create a MemberCache for an interface type and cache the
7549 * decl.cs (IMemberContainer.ParentContainer): Removed.
7550 (IMemberContainer.ParentCache): New property.
7551 (MemberCache.SetupCacheForInterface): Removed.
7552 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
7553 to create a cache for an interface's "parent".
7555 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
7558 2004-11-14 Ben Maurer <bmaurer@ximian.com>
7560 * statement.cs: Avoid adding bools to a hashtable.
7562 2004-11-15 Martin Baulig <martin@ximian.com>
7564 * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
7566 2004-11-11 Martin Baulig <martin@ximian.com>
7568 * typemanager.cs (TypeManager.GetMethodName): New method.
7570 * class.cs (MethodData.Define): Include the generic arity in the
7571 name of an explicit interface; also add it to the method name.
7573 * pending.cs (PendingImplementation.InterfaceMethod): The method
7574 name now includes the generic arity.
7576 2004-11-07 Miguel de Icaza <miguel@ximian.com>
7578 * expression.cs (Invocation.OverloadResolve): Flag error if we are
7579 calling an unsafe method from a safe location.
7581 2004-11-06 Marek Safar <marek.safar@seznam.cz>
7584 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
7586 2004-11-06 Miguel de Icaza <miguel@ximian.com>
7588 * namespace.cs (VerifyUsing): use GetPartialName instead of
7591 2004-11-05 Miguel de Icaza <miguel@ximian.com>
7593 * statement.cs (Return.Resolve): Fix regression in typo: if
7594 `in_exc', we have to request a NeedReturnLabel, this was a typo
7595 introduced in the anonymous method check-in. Fixes #69131.
7597 * Indexers were using the ShortName when defining themselves,
7598 causing a regression in the compiler bootstrap when applying the
7599 patch from 2004-11-02 (first part), now they use their full name
7600 and the bug is gone.
7602 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
7604 * driver.cs: Strip the path from the names of embedded resources. Fixes
7607 2004-11-04 Raja R Harinath <rharinath@novell.com>
7609 Fix error message regression: cs0104-2.cs.
7610 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
7611 (AliasEntry.Resolve): Update.
7612 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
7614 (RootContext.LookupType): Update.
7616 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
7618 * cs-parser.jay: Add support for handling accessor modifiers
7619 * class: Add support port accessor modifiers and error checking,
7620 define PropertyMethod.Define as virtual (not abstract anymore)
7621 * ecore.cs: Add checking for proeprties access with access modifiers
7622 * iterators.cs: Modify Accessor constructor call based in the modified
7624 2004-11-02 Ben Maurer <bmaurer@ximian.com>
7626 * expression.cs (StringConcat): Handle being called twice,
7627 as when we have a concat in a field init with more than two
7630 2004-11-02 Miguel de Icaza <miguel@ximian.com>
7632 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
7633 special case explicit implementations, we should always produce
7634 the .property or .event declaration.
7636 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
7637 since it will not return correct data if people use this
7638 unresolved in the presence of using statements (see test-313).
7640 * class.cs (MethodData.Define): If we are an explicit interface
7641 implementation, set the method name to the full name of the
7642 interface plus the name of the method.
7644 Notice that using the method.MethodName.GetFullName() does not
7645 work, as it will only contain the name as declared on the source
7646 file (it can be a shorthand in the presence of using statements)
7647 and not the fully qualifed type name, for example:
7651 class D : ICloneable {
7652 object ICloneable.Clone () {
7656 Would produce a method called `ICloneable.Clone' instead of
7657 `System.ICloneable.Clone'.
7659 * namespace.cs (Alias.Resolve): Use GetPartialName.
7661 2004-11-01 Marek Safar <marek.safar@seznam.cz>
7663 * cs-parser.jay: Add error 1055 report.
7665 2004-11-01 Miguel de Icaza <miguel@ximian.com>
7667 * assign.cs (Assign.DoResolve): Only do the transform of
7668 assignment into a New if the types are compatible, if not, fall
7669 through and let the implicit code deal with the errors and with
7670 the necessary conversions.
7672 2004-11-01 Marek Safar <marek.safar@seznam.cz>
7674 * cs-parser.jay: Add error 1031 report.
7676 * cs-tokenizer.cs: Add location for error 1038.
7678 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7680 * cs-parser.jay: Add error 1016 report.
7682 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7684 * cs-parser.jay: Add errors 1575,1611 report.
7686 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7688 * cs-parser.jay: Add error 1001 report.
7690 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7693 * attribute.cs (GetMarshal): Add method argument for
7694 caller identification.
7696 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7697 agument for GetMarshal and RuntimeMissingSupport.
7699 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7701 * attribute.cs (ExtractSecurityPermissionSet): Removed
7702 TypeManager.code_access_permission_type.
7704 * typemanager.cs: Removed TypeManager.code_access_permission_type.
7706 2004-10-27 Miguel de Icaza <miguel@ximian.com>
7708 * expression.cs (LocalVariableReference.DoResolveLValue): Check
7709 for obsolete use of a variable here. Fixes regression on errors
7710 cs0619-25 and cs0619-26.
7712 2004-10-27 Marek Safar <marek.safar@seznam.cz>
7714 Fix #62358, implemented security attribute encoding.
7716 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7717 Tests permitted SecurityAction for assembly or other types.
7718 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7719 data from SecurityPermissionAttribute to PermisionSet class.
7721 * class.cs (ApplyAttributeBuilder): Added special handling
7722 for System.Security.Permissions.SecurityAttribute based types.
7724 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7725 special handling for System.Security.Permissions.SecurityAttribute
7728 * enum.cs (ApplyAttributeBuilder): Added special handling
7729 for System.Security.Permissions.SecurityAttribute based types.
7731 * parameter.cs (ApplyAttributeBuilder): Added special handling
7732 for System.Security.Permissions.SecurityAttribute based types.
7734 * rootcontext.cs: Next 2 core types.
7736 * typemanager.cs (TypeManager.security_permission_attr_type):
7737 Built in type for the SecurityPermission Attribute.
7738 (code_access_permission_type): Build in type.
7740 2004-10-17 Miguel de Icaza <miguel@ximian.com>
7742 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7743 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7744 all of this information into
7745 EmitContext.EmitCapturedVariableInstance.
7747 * codegen.cs (EmitCapturedVariableInstance): move here the
7748 funcionality of emitting an ldarg.0 in the presence of a
7749 remapping. This centralizes the instance emit code.
7751 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7752 then emit a load of this: it means that we have reached the
7753 topmost ScopeInfo: the one that contains the pointer to the
7754 instance of the class hosting the anonymous method.
7756 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7757 captures to the topmost CaptureContext.
7759 2004-10-12 Miguel de Icaza <miguel@ximian.com>
7761 * expression.cs (LocalVariableReference): Move the knowledge about
7762 the iterators into codegen's EmitCapturedVariableInstance.
7764 2004-10-11 Miguel de Icaza <miguel@ximian.com>
7766 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7767 all code paths return a value from an anonymous method (it is the
7768 same as the 161 error, but for anonymous methods).
7770 2004-10-08 Miguel de Icaza <miguel@ximian.com>
7772 The introduction of anonymous methods in the compiler changed
7773 various ways of doing things in the compiler. The most
7774 significant one is the hard split between the resolution phase
7775 and the emission phases of the compiler.
7777 For instance, routines that referenced local variables no
7778 longer can safely create temporary variables during the
7779 resolution phase: they must do so from the emission phase,
7780 since the variable might have been "captured", hence access to
7781 it can not be done with the local-variable operations from the runtime.
7785 (Block.Flags): New flag `IsTopLevel' to indicate that this block
7786 is a toplevel block.
7788 (ToplevelBlock): A new kind of Block, these are the blocks that
7789 are created by the parser for all toplevel method bodies. These
7790 include methods, accessors and anonymous methods.
7792 These contain some extra information not found in regular blocks:
7793 A pointer to an optional CaptureContext (for tracking captured
7794 local variables and parameters). A pointer to the parent
7797 (Return.Resolve): Catch missmatches when returning a value from an
7798 anonymous method (error 1662).
7799 Invoke NeedReturnLabel from the Resolve phase instead of the emit
7802 (Break.Resolve): ditto.
7804 (SwitchLabel): instead of defining the labels during the
7805 resolution phase, we now turned the public ILLabel and ILLabelCode
7806 labels into methods called GetILLabelCode() and GetILLabel() that
7807 only define the label during the Emit phase.
7809 (GotoCase): Track the SwitchLabel instead of the computed label
7810 (its contained therein). Emit the code by using
7811 SwitchLabel.GetILLabelCode ().
7813 (LocalInfo.Flags.Captured): A new flag has been introduce to track
7814 whether the Local has been captured or not.
7816 (LocalInfo.IsCaptured): New property, used to tell whether the
7817 local has been captured.
7819 * anonymous.cs: Vastly updated to contain the anonymous method
7822 The main classes here are: CaptureContext which tracks any
7823 captured information for a toplevel block and ScopeInfo used to
7824 track the activation frames for various local variables.
7826 Each toplevel block has an optional capture context associated
7827 with it. When a method contains an anonymous method both the
7828 toplevel method and the anonymous method will create a capture
7829 context. When variables or parameters are captured, they are
7830 recorded on the CaptureContext that owns them, for example:
7834 MyDelegate d = delegate {
7839 Here `a' will be recorded as captured on the toplevel
7840 CapturedContext, the inner captured context will not have anything
7841 (it will only have data if local variables or parameters from it
7842 are captured in a nested anonymous method.
7844 The ScopeInfo is used to track the activation frames for local
7845 variables, for example:
7847 for (int i = 0; i < 10; i++)
7848 for (int j = 0; j < 10; j++){
7849 MyDelegate d = delegate {
7854 At runtime this captures a single captured variable `i', but it
7855 captures 10 different versions of the variable `j'. The variable
7856 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7857 recorded on a child.
7859 The toplevel ScopeInfo will also track information like the `this'
7860 pointer if instance variables were referenced (this is necessary
7861 as the anonymous method lives inside a nested class in the host
7862 type of the method).
7864 (AnonymousMethod): Expanded to track the Toplevel, implement
7865 `AnonymousMethod.Compatible' to tell whether an anonymous method
7866 can be converted to a target delegate type.
7868 The routine now also produces the anonymous method content
7870 (AnonymousDelegate): A helper class that derives from
7871 DelegateCreation, this is used to generate the code necessary to
7872 produce the delegate for the anonymous method that was created.
7874 * assign.cs: API adjustments for new changes in
7875 Convert.ImplicitStandardConversionExists.
7877 * class.cs: Adjustments to cope with the fact that now toplevel
7878 blocks are of type `ToplevelBlock'.
7880 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7881 insteda of standard blocks.
7883 Flag errors if params arguments are passed to anonymous methods.
7885 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7886 `CurrentAnonymousMethod' which points to the current Anonymous
7887 Method. The variable points to the AnonymousMethod class that
7888 holds the code being compiled. It is set in the new EmitContext
7889 created for the anonymous method.
7891 (EmitContext.Phase): Introduce a variable and an enumeration to
7892 assist in enforcing some rules about when and where we are allowed
7893 to invoke certain methods (EmitContext.NeedsReturnLabel is the
7894 only one that enfonces this right now).
7896 (EmitContext.HaveCaptureInfo): new helper method that returns
7897 whether we have a CapturedContext initialized.
7899 (EmitContext.CaptureVariable): New method used to register that a
7900 LocalInfo must be flagged for capturing.
7902 (EmitContext.CapturedParameter): New method used to register that a
7903 parameters must be flagged for capturing.
7905 (EmitContext.CapturedField): New method used to register that a
7906 field must be flagged for capturing.
7908 (EmitContext.HaveCapturedVariables,
7909 EmitContext.HaveCapturedFields): Return whether there are captured
7910 variables or fields.
7912 (EmitContext.EmitMethodHostInstance): This is used to emit the
7913 instance for the anonymous method. The instance might be null
7914 (static methods), this (for anonymous methods that capture nothing
7915 and happen to live side-by-side with the current method body) or a
7916 more complicated expression if the method has a CaptureContext.
7918 (EmitContext.EmitTopBlock): Routine that drives the emission of
7919 code: it will first resolve the top block, then emit any metadata
7920 and then emit the code. The split is done so that we can extract
7921 any anonymous methods and flag any captured variables/parameters.
7923 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7924 during this phase, the ILGenerator should not be used as labels
7925 and local variables declared here might not be accessible to any
7926 code that is part of an anonymous method.
7928 Exceptions to this include the temporary variables that are
7929 created by some statements internally for holding temporary
7932 (EmitContext.EmitMeta): New routine, in charge of emitting all the
7935 (EmitContext.TemporaryReturn): This method is typically called
7936 from the Emit phase, and its the only place where we allow the
7937 ReturnLabel to be defined other than the EmitMeta. The reason is
7938 that otherwise we would have to duplicate a lot of logic in the
7939 Resolve phases of various methods that today is on the Emit
7942 (EmitContext.NeedReturnLabel): This no longer creates the label,
7943 as the ILGenerator is not valid during the resolve phase.
7945 (EmitContext.EmitThis): Extended the knowledge in this class to
7946 work in anonymous methods in addition to iterators.
7948 (EmitContext.EmitCapturedVariableInstance): This emits whatever
7949 code is necessary on the stack to access the instance to a local
7950 variable (the variable will be accessed as a field).
7952 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7953 EmitContext.EmitAddressOfParameter): Routines to support
7954 parameters (not completed at this point).
7956 Removals: Removed RemapLocal and RemapLocalLValue. We probably
7957 will also remove the parameters.
7959 * convert.cs (Convert): Define a `ConstantEC' which points to a
7960 null. This is just to prefity some code that uses
7961 ImplicitStandardConversion code and do not have an EmitContext
7964 The idea is to flag explicitly that at that point in time, it is
7965 known that the conversion will not trigger the delegate checking
7966 code in implicit conversions (which requires a valid
7969 Everywhere: pass new EmitContext parameter since
7970 ImplicitStandardConversionExists now requires it to check for
7971 anonymous method conversions.
7973 (Convert.ImplicitStandardConversionExists): If the type of an
7974 expression is the anonymous_method_type, and the type is a
7975 delegate, we invoke the AnonymousMethod.Compatible method to check
7976 whether an implicit conversion is possible.
7978 (Convert.ImplicitConversionStandard): Only do implicit method
7979 group conversions if the language level is not ISO_1.
7981 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7982 MethodInfo for the Invoke method. used by Delegate and
7985 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7986 method conversions if the target type is a delegate.
7988 Removed extra debugging nops.
7990 (LocalVariableReference): Turn the `local_info' into a public
7993 Add `prepared' field, the same hack used for FieldExprs to cope
7994 with composed assignments, as Local variables do not necessarily
7995 operate purely on the stack as they used to: they can be captured
7998 Add `temp' for a temporary result, like fields.
8000 Refactor DoResolve and DoResolveLValue into DoResolveBase.
8002 It now copes with Local variables that are captured and emits the
8003 proper instance variable to load it from a field in the captured
8006 (ParameterReference.DoResolveBase): During the resolve phase,
8007 capture parameters if we are in an anonymous method.
8009 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
8010 anonymous method, use the EmitContext helper routines to emit the
8011 parameter reference.
8013 * iterators.cs: Set RemapToProxy to true/false during the
8016 * parameters.cs (GetParameterByName): New helper method.
8018 * typemanager.cs (anonymous_method_type) a new type that
8019 represents an anonyous method. This is always an internal type,
8020 used as a fencepost to test against the anonymous-methodness of an
8023 2004-10-20 Marek Safar <marek.safar@seznam.cz>
8025 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
8027 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
8029 2004-11-10 Martin Baulig <martin@ximian.com>
8031 * expression.cs (Invocation.BetterFunction): If two methods have
8032 equal parameter types, but only one of them is generic, the
8033 non-generic one wins.
8034 (New.DoResolve): Don't set `is_struct' to false if we're a generic
8035 instance; just use `Type.IsValueType' to determine whether
8036 something is a struct or not.
8037 (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
8038 so we can be called multiple times.
8040 2004-11-10 Martin Baulig <martin@ximian.com>
8042 * generic.cs (TypeParameter.DefineConstraints): New public method.
8043 (TypeParameter.CheckAccessLevel): Override this and return true.
8044 (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
8045 override ResolveType() anymore.
8046 (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
8048 2004-11-10 Martin Baulig <martin@ximian.com>
8050 * rootcontext.cs (RootContext.LookupType): If we're a nested type,
8051 call DeclSpace.ResolveNestedType() on it.
8053 2004-11-10 Martin Baulig <martin@ximian.com>
8055 * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
8056 non-null, call ParameterModifier() on it.
8058 2004-11-10 Martin Baulig <martin@ximian.com>
8061 (Iterators): Added `current_type' and `this_type' fields.
8062 (Iterators.DefineIterator): Create a new EmitContext and store it
8063 in `ec'; compute `this_type'.
8065 2004-11-10 Martin Baulig <martin@ximian.com>
8068 (TypeManager.IsPrivateAccessible): New public method.
8069 (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
8071 2004-11-10 Martin Baulig <martin@ximian.com>
8073 * class.cs (TypeContainer.DefineType): Call
8074 TypeBuilder.DefineGenericParameters() before resolving the type
8076 (MethodData.parent_method): New protected field.
8077 (MethodData..ctor): Added `MethodInfo parent_method' argument.
8078 (MethodData.Define): Compute `parent_method'.
8081 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
8082 (MemberCore.GetClsCompliantAttributeValue): Likewise.
8083 (DeclSpace.ec): New protected field; store the EmitContext here.
8084 (DeclSpace.EmitContext): New public property.
8085 (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
8086 (DeclSpace.ResolveNestedType): New public method.
8087 (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
8088 (DeclSpace.NestedAccessible): Added `Type tb' argument.
8089 (DeclSpace.FamilyAccessible): Likewise.
8090 (DeclSpace.FindType): Call ResolveNestedType() for nested types.
8091 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
8094 * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
8097 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
8098 (Enum.Emit): Don't create a new EmitContext.
8100 2004-10-18 Martin Baulig <martin@ximian.com>
8102 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
8103 `Type' directly, but call ResolveType() on it.
8104 (Catch.Resolve): Likewise.
8105 (Foreach.Resolve): Likewise.
8107 2004-10-18 Martin Baulig <martin@ximian.com>
8109 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
8110 `Type' directly, but call ResolveType() on it.
8111 (Probe.DoResolve): Likewise.
8112 (ArrayCreation.LookupType): Likewise.
8113 (TypeOf.DoResolve): Likewise.
8114 (SizeOf.DoResolve): Likewise.
8116 2004-10-18 Raja R Harinath <rharinath@novell.com>
8118 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
8121 2004-10-17 John Luke <john.luke@gmail.com>
8123 * class.cs (Operator.GetSignatureForError): use CSharpName
8125 * parameter.cs (Parameter.GetSignatureForError): Returns
8126 correct name even if was not defined.
8128 2004-10-13 Raja R Harinath <rharinath@novell.com>
8131 * class.cs (TypeContainer.EmitContext): New property.
8132 (DefineNestedTypes): Create an emitcontext for each part.
8133 (MethodCore.DoDefineParameters): Use container's emitcontext.
8134 Pass type array to InternalParameters.
8135 (MemberBase.DoDefine): Use container's emitcontext.
8136 (FieldMember.Define): Likewise.
8137 (Event.Define): Likewise.
8138 (SetMethod.GetParameterInfo): Change argument to EmitContext.
8139 Pass type array to InternalParameters.
8140 (SetIndexerMethod.GetParameterInfo): Likewise.
8141 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8142 * delegate.cs (Define): Pass emitcontext to
8143 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
8144 array to InternalParameters.
8145 * expression.cs (ParameterReference.DoResolveBase): Pass
8146 emitcontext to GetParameterInfo.
8147 (ComposedCast.DoResolveAsTypeStep): Remove check on
8148 ec.ResolvingTypeTree.
8149 * parameter.cs (Parameter.Resolve): Change argument to
8150 EmitContext. Use ResolveAsTypeTerminal.
8151 (Parameter.GetSignature): Change argument to EmitContext.
8152 (Parameters.ComputeSignature): Likewise.
8153 (Parameters.ComputeParameterTypes): Likewise.
8154 (Parameters.GetParameterInfo): Likewise.
8155 (Parameters.ComputeAndDefineParameterTypes): Likewise.
8156 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
8157 * support.cs (InternalParameters..ctor): Remove variant that takes
8159 * typemanager.cs (system_intptr_expr): New.
8160 (InitExpressionTypes): Initialize it.
8162 2004-10-12 Chris Toshok <toshok@ximian.com>
8164 * cs-parser.jay: fix location for try_statement and catch_clause.
8166 2004-10-18 Martin Baulig <martin@ximian.com>
8168 * class.cs (FieldMember.Define): Don't access the TypeExpr's
8169 `Type' directly, but call ResolveType() on it.
8170 (MemberBase.DoDefine): Likewise.
8172 * expression.cs (New.DoResolve): Don't access the TypeExpr's
8173 `Type' directly, but call ResolveType() on it.
8174 (ComposedCast.DoResolveAsTypeStep): Likewise.
8176 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
8177 `Type' directly, but call ResolveType() on it.
8179 2004-10-17 John Luke <john.luke@gmail.com>
8181 * class.cs (Operator.GetSignatureForError): use CSharpName
8183 * parameter.cs (Parameter.GetSignatureForError): Returns
8184 correct name even if was not defined.
8186 2004-10-13 Raja R Harinath <rharinath@novell.com>
8189 * class.cs (TypeContainer.EmitContext): New property.
8190 (DefineNestedTypes): Create an emitcontext for each part.
8191 (MethodCore.DoDefineParameters): Use container's emitcontext.
8192 Pass type array to InternalParameters.
8193 (MemberBase.DoDefine): Use container's emitcontext.
8194 (FieldMember.Define): Likewise.
8195 (Event.Define): Likewise.
8196 (SetMethod.GetParameterInfo): Change argument to EmitContext.
8197 Pass type array to InternalParameters.
8198 (SetIndexerMethod.GetParameterInfo): Likewise.
8199 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8200 * delegate.cs (Define): Pass emitcontext to
8201 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
8202 array to InternalParameters.
8203 * expression.cs (ParameterReference.DoResolveBase): Pass
8204 emitcontext to GetParameterInfo.
8205 (ComposedCast.DoResolveAsTypeStep): Remove check on
8206 ec.ResolvingTypeTree.
8207 * parameter.cs (Parameter.Resolve): Change argument to
8208 EmitContext. Use ResolveAsTypeTerminal.
8209 (Parameter.GetSignature): Change argument to EmitContext.
8210 (Parameters.ComputeSignature): Likewise.
8211 (Parameters.ComputeParameterTypes): Likewise.
8212 (Parameters.GetParameterInfo): Likewise.
8213 (Parameters.ComputeAndDefineParameterTypes): Likewise.
8214 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
8215 * support.cs (InternalParameters..ctor): Remove variant that takes
8217 * typemanager.cs (system_intptr_expr): New.
8218 (InitExpressionTypes): Initialize it.
8220 2004-10-12 Chris Toshok <toshok@ximian.com>
8222 * cs-parser.jay: fix location for try_statement and catch_clause.
8224 2004-10-07 Raja R Harinath <rharinath@novell.com>
8226 More DeclSpace.ResolveType avoidance.
8227 * decl.cs (MemberCore.InUnsafe): New property.
8228 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
8229 with newly created EmitContext.
8230 (FieldMember.Define): Likewise.
8231 * delegate.cs (Delegate.Define): Likewise.
8232 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
8233 only if normal name-lookup fails.
8234 (TypeExpr.DoResolve): Enable error-checking.
8235 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
8236 (SizeOf.DoResolve): Likewise.
8237 (ComposedCast.DoResolveAsTypeStep): Likewise.
8238 (StackAlloc.DoResolve): Likewise.
8239 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
8240 (Block.Unsafe): New property.
8241 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
8242 (Unsafe): Set 'unsafe' flag of contained block.
8243 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
8244 (Fixed.Resolve): Likewise.
8245 (Catch.Resolve): Likewise.
8246 (Using.ResolveLocalVariableDecls): Likewise.
8247 (Foreach.Resolve): Likewise.
8249 2004-10-05 John Luke <john.luke@gmail.com>
8251 * cs-parser.jay: add location to error CS0175
8253 2004-10-04 Miguel de Icaza <miguel@ximian.com>
8255 * ecore.cs (Expression.Constantity): Add support for turning null
8258 * const.cs (Const.Define): Allow constants to be reference types
8259 as long as the value is Null.
8261 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
8263 * namespace.cs (NamespaceEntry.Using): No matter which warning
8264 level is set, check if this namespace name has already been added.
8266 2004-10-03 Ben Maurer <bmaurer@ximian.com>
8268 * expression.cs: reftype [!=]= null should always use br[true,false].
8271 2004-10-03 Marek Safar <marek.safar@seznam.cz>
8274 * attribute.cs: Enum conversion moved to
8275 GetAttributeArgumentExpression to be applied to the all
8278 2004-10-01 Raja R Harinath <rharinath@novell.com>
8280 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
8281 * class.c (TypeContainer.DefineType): Flag error if
8282 base types aren't accessible due to access permissions.
8283 * decl.cs (DeclSpace.ResolveType): Move logic to
8284 Expression.ResolveAsTypeTerminal.
8285 (DeclSpace.ResolveTypeExpr): Thin layer over
8286 Expression.ResolveAsTypeTerminal.
8287 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
8288 Refactor code into NestedAccess. Use it.
8289 (DeclSpace.NestedAccess): New.
8290 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
8291 argument to silence errors. Check access permissions.
8292 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
8293 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
8294 (Cast.DoResolve): Likewise.
8295 (New.DoResolve): Likewise.
8296 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
8297 (TypeOf.DoResolve): Likewise.
8299 * expression.cs (Invocation.BetterConversion): Return the Type of
8300 the better conversion. Implement section 14.4.2.3 more faithfully.
8301 (Invocation.BetterFunction): Make boolean. Make correspondence to
8302 section 14.4.2.2 explicit.
8303 (Invocation.OverloadResolve): Update.
8304 (Invocation): Remove is_base field.
8305 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
8306 (Invocation.Emit): Likewise.
8308 2004-09-24 Marek Safar <marek.safar@seznam.cz>
8310 * cs-parser.jay: Reverted 642 warning fix.
8312 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8315 * decl.cs (FindMemberWithSameName): Indexer can have more than
8318 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8320 * expression.cs (LocalVariableReference.DoResolveLValue):
8321 Do not report warning 219 for out values.
8322 (EmptyExpression.Null): New member to avoid extra allocations.
8324 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8326 * cs-parser.jay: Fix wrong warning 642 report.
8328 * cs-tokenizer.cs (CheckNextToken): New helper;
8329 Inspect next character if is same as expected.
8331 2004-09-23 Martin Baulig <martin@ximian.com>
8333 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8334 (Convert.ImplicitReferenceConversionExists): Likewise.
8336 2004-11-09 Raja R Harinath <rharinath@novell.com>
8338 * Makefile (DISTFILES): Comment out a few missing files.
8340 2004-10-29 Raja R Harinath <rharinath@novell.com>
8342 * Makefile (bootstrap_libs,bootstrap_libfiles): New.
8343 (bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
8344 (gmcs.exe): Invoke bootstrap-libs.
8345 (clean-local): Clean the net_2_0_bootstrap profile too.
8346 (PROGRAM_INSTALL_DIR): New.
8347 (install-local): Use it.
8349 2004-10-13 Martin Baulig <martin@ximian.com>
8351 * generic.cs (TypeManager.InflatedConstraints): New nested class.
8352 (TypeParameter.DefineType): If we're a method type parameter and
8353 that method is overriding something, "inflate" its constraints.
8355 2004-10-12 Martin Baulig <martin@ximian.com>
8357 * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
8358 and have type arguments, create and resolve a ConstructedType.
8360 2004-10-12 Martin Baulig <martin@ximian.com>
8362 * decl.cs (MemberCache.FindMemberToOverride): Use
8363 TypeManager.IsEqual() to compare the parameters and Type.Equals()
8364 to compare the invocationType.
8366 * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
8367 When comparing two type parameters, only do the signature-only
8368 comparision for method type parameters.
8370 2004-10-11 Martin Baulig <martin@ximian.com>
8372 * report.cs: Don't make --fatal abort on warnings, we have
8373 -warnaserror for that.
8375 2004-10-11 Martin Baulig <martin@ximian.com>
8378 (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
8379 (TypeManager.IsEqual): Call ourself recursively instead of using
8382 2004-10-11 Martin Baulig <martin@ximian.com>
8384 * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
8385 on our own type parameters, not on the ones we inherit from a containing
8388 * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
8391 * generic.cs (TypeParameter.Define): We may only be called once.
8393 * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
8394 instead of TypeManager.IsEqual().
8396 2004-09-28 Martin Baulig <martin@ximian.com>
8399 (GenericConstraints.EffectiveBaseClass): New public property.
8400 (TypeParameter.GenericConstraints): New public property.
8401 (ConstructedType.CheckConstraints): Improved.
8403 * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
8404 (Convert.TypeParameterConversion): New private method; use this in
8405 ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
8406 for all conversions related to type parameters.
8408 2004-09-24 Martin Baulig <martin@ximian.com>
8410 * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
8411 type parameter conversions for type parameters which are known to
8414 2004-09-24 Martin Baulig <martin@ximian.com>
8416 * generic.cs (GenericConstraints): Added `IsReferenceType' and
8417 `IsValueType' properties.
8419 * support.cs (ReflectionConstraints): Use
8420 Type.GetGenericParameterConstraints() instead of the old hack.
8422 2004-09-24 Martin Baulig <martin@ximian.com>
8424 * generic.cs (GenericConstraints): Moved here and made it an
8427 * support.cs (GenericConstraints): Moved to generic.cs.
8429 2004-09-24 Martin Baulig <martin@ximian.com>
8432 (ReflectionConstraints): Un-nested this class and made it public.
8435 (TypeManager.GetTypeParameterConstraints): New public method.
8436 (TypeManager.HasConstructorConstraint): Use the attributes.
8438 2004-09-24 Martin Baulig <martin@ximian.com>
8440 * support.cs (GenericConstraints): Replaced `HasConstructor',
8441 `IsReferenceType' and `IsValueType' with `Attributes'.
8442 (ReflectionParameters.ReflectionConstraints): Removed the Create()
8443 method and made the .ctor public.
8445 * generic.cs (Constraints.Attributes): New public property.
8446 (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
8447 `IsReferenceType' -> `HasReferenceTypeConstraint' and
8448 `IsValueType' -> `HasValueTypeConstraint'.
8450 2004-09-23 Martin Baulig <martin@ximian.com>
8452 * generic.cs (Constraints): Reflect latest runtime changes.
8454 2004-09-23 Martin Baulig <martin@ximian.com>
8456 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8457 (Convert.ImplicitReferenceConversionExists): Likewise.
8459 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8461 * class.cs (Operator.Define): Add error 448 and 559 report.
8463 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8465 * class.cs (MemberBase.IsTypePermitted): New protected
8466 method for checking error CS0610.
8468 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8470 * class.cs (TypeContainer.HasExplicitLayout): New property
8471 Returns whether container has StructLayout attribute set Explicit.
8472 (FieldMember): New abstract class for consts and fields.
8473 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
8474 (Field): Reuse FieldMember.
8476 * const.cs (Const): Reuse FieldMember.
8478 * rootcontext.cs: EmitConstants call moved to class.
8480 2004-09-22 Martin Baulig <martin@ximian.com>
8482 Marek and me just fixed one of our oldest bugs: #28562 :-)
8484 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
8486 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
8487 we're an EnumConstant, just return that.
8488 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
8489 an EnumConstant. In this case, we need to use GetValueAsEnumType()
8490 to get the value which'll actually be written into the attribute.
8491 However, we have to use GetValue() to access the attribute's value
8494 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8496 * constant.cs (Constant.IsNegative): New abstract property
8499 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
8500 (StackAlloc.DoResolve): Reused IsNegative.
8502 2004-09-22 Martin Baulig <martin@ximian.com>
8504 * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
8505 public method; like LookupTypeContainer, but also works for
8508 * report.cs (Report.SymbolRelatedToPreviousError): Use
8509 TypeManager.LookupGenericTypeContainer().
8511 2004-09-22 Martin Baulig <martin@ximian.com>
8513 Thanks to Peter Sestoft for this bug report.
8515 * expression.cs (Conditional): If both the `trueExpr' and the
8516 `falseExpr' is a NullLiteral, return a NullLiteral.
8518 2004-09-22 Martin Baulig <martin@ximian.com>
8520 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
8521 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
8522 for the "get_Current" call.
8524 2004-09-21 Martin Baulig <martin@ximian.com>
8526 * convert.cs (Convert.ImplicitReferenceConversion): When
8527 converting to an interface type, first check whether we're
8528 converting from a reference type.
8530 2004-09-14 Martin Baulig <martin@ximian.com>
8532 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
8534 2004-09-14 Marek Safar <marek.safar@seznam.cz>
8537 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
8538 called and is obsolete then this member suppress message
8539 when call is inside next [Obsolete] method or type.
8541 * expression.cs: Use TestObsoleteMethodUsage member.
8543 2004-09-14 Martin Baulig <martin@ximian.com>
8545 * genericparser.cs: Removed.
8547 2004-09-13 Marek Safar <marek.safar@seznam.cz>
8549 * class.cs (MethodCore.CheckBase): Fix bug #65757.
8551 2004-09-12 Marek Safar <marek.safar@seznam.cz>
8553 * attribute.cs (Attribute.Resolve): Add error 653 report.
8555 * class.cs (Class.ApplyAttributeBuilder): Add error 641
8557 (Method.ApplyAttributeBuilder): Add error 685 report.
8558 (Operator.Define): Add error 564 report.
8560 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
8562 * expression.cs (Invocation.DoResolve): Add error
8565 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
8568 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8570 * class.cs (ConstructorInitializer.Resolve):
8571 Wrong error number (515->516).
8573 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8575 * class.cs (Indexer.Define): Add error 631 report.
8577 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8579 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
8581 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8583 * expression.cs (Probe.DoResolve): Add error CS0241 report.
8585 2004-09-10 Marek Safar <marek.safar@seznam.cz>
8587 * cs-parser.jay: Added error CS0241 report.
8589 2004-09-10 Raja R Harinath <rharinath@novell.com>
8591 * cs-parser.jay (fixed_statement): Introduce a scope for the
8592 declaration in the 'fixed' statement.
8594 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8596 * cs-parser.jay: Added CS0230 error report.
8598 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8600 * cs-parser.jay: Added errors CS0231 and CS0257 report.
8602 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8604 * expression.cs (Argument.Resolve): Added error CS0192 and
8607 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8609 C# 2.0 #pragma warning feature
8611 * cs-tokenizer.cs (PreProcessPragma): New method;
8612 Handles #pragma directive.
8614 * report.cs (WarningRegions): New class; Support
8615 class for #pragma warning directive. It tests whether
8616 warning is enabled for a given line.
8618 2004-09-08 Miguel de Icaza <miguel@ximian.com>
8620 * const.cs: Add more descriptive error report, tahnks to
8623 2004-09-08 Marek Safar <marek.safar@seznam.cz>
8625 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
8627 2004-09-07 Miguel de Icaza <miguel@ximian.com>
8629 * expression.cs: Apply patch from Ben: Remove dead code from
8630 ArrayCreation, and remove the TurnintoConstant call in const.cs,
8631 as that code just threw an exception anwyays.
8633 * const.cs: Remove the call to the turnintoconstant, for details
8636 * literal.cs: The type of the null-literal is the null type; So
8637 we use a placeholder type (literal.cs:System.Null, defined here)
8640 * expression.cs (Conditional.DoResolve): Remove some old code that
8641 is no longer needed, conversions have been fixed.
8643 (ArrayCreationExpression.DoResolve): Return false if we fail to
8644 resolve the inner expression.
8646 2004-09-07 Raja R Harinath <rharinath@novell.com>
8649 * cs-parser.jay (delegate_declaration): Record a delegate
8650 declaration as a type declaration.
8651 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
8653 2004-09-06 Miguel de Icaza <miguel@ximian.com>
8655 * parameter.cs: Do not crash if the type can not be resolved.
8657 * expression.cs: Report errors with unsafe pointers, fixes #64896
8659 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
8661 * expression.cs: Pointer arith always needs to do a conv.i
8662 if the operand is a long. fix 65320
8664 2004-09-04 Marek Safar <marek.safar@seznam.cz>
8666 Fixed cs0619-37.cs, cs0619-38.cs
8668 * enum.cs (GetObsoleteAttribute): Removed.
8670 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
8671 on Enum member is double staged. The first is tested member
8674 2004-09-04 Marek Safar <marek.safar@seznam.cz>
8676 Fixed #56986, #63631, #65231
8678 * class.cs: (TypeContainer.AddToMemberContainer): New method,
8679 adds member to name container.
8680 (TypeContainer.AddToTypeContainer): New method, adds type to
8682 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8683 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8684 AddOperator): Simplified by reusing AddToMemberContainer.
8685 (TypeContainer.UserDefinedStaticConstructor): Changed to property
8687 (Method.CheckForDuplications): Fixed implementation to test all
8689 (MemberBase): Detection whether member is explicit interface
8690 implementation is now in constructor.
8691 (MemberBase.UpdateMemberName): Handles IndexerName.
8692 (Accessor): Changed to keep also location information.
8693 (AbstractPropertyEventMethod): Is derived from MemberCore.
8694 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8695 will be emited or not.
8696 (PropertyBase.AreAccessorsDuplicateImplementation):
8697 Tests whether accessors are not in collision with some method.
8698 (Operator): Is derived from MethodCore to simplify common
8701 * decl.cs (Flags.TestMethodDuplication): Test for duplication
8703 (DeclSpace.AddToContainer): Adds the member to defined_names
8704 table. It tests for duplications and enclosing name conflicts.
8706 * enum.cs (EnumMember): Clean up to reuse the base structures
8708 2004-09-03 Martin Baulig <martin@ximian.com>
8710 Merged latest changes into gmcs. Please keep this comment in
8711 here, it makes it easier for me to see what changed in MCS since
8712 the last time I merged.
8714 2004-09-03 Martin Baulig <martin@ximian.com>
8716 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8717 into TypeContainer, to make partial classes work again.
8719 2004-09-03 Martin Baulig <martin@ximian.com>
8721 * rootcontext.cs (RootContext.V2): Removed.
8723 2004-03-23 Martin Baulig <martin@ximian.com>
8725 * expression.cs (Invocation.OverloadResolve): Added `bool
8726 may_fail' argument and use it instead of the Location.IsNull() hack.
8728 2004-09-09 Martin Baulig <martin@ximian.com>
8730 * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
8732 2004-09-09 Martin Baulig <martin@ximian.com>
8734 * generic.cs (TypeParameter.DefineType): Added support for
8735 explicit interface methods.
8737 2004-09-09 Martin Baulig <martin@ximian.com>
8739 * README.Changes: New document. Started to list important changes
8740 between MCS and GMCS here.
8742 2004-09-08 Martin Baulig <martin@ximian.com>
8745 (TypeContainer.CheckRecursiveDefinition): New protected method.
8746 (TypeContainer.DefineType): Move the CS0146 check into
8747 CheckRecursiveDefinition().
8749 2004-09-06 Martin Baulig <martin@ximian.com>
8751 * generic.cs (ConstructedType.CheckConstraints): Allow builtin
8752 types for the constructor constraint.
8754 2004-09-03 Martin Baulig <martin@ximian.com>
8756 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8757 into TypeContainer, to make partial classes work again.
8759 2004-09-03 Martin Baulig <martin@ximian.com>
8761 * rootcontext.cs (RootContext.V2): Removed.
8763 2004-03-23 Martin Baulig <martin@ximian.com>
8765 * expression.cs (Invocation.OverloadResolve): Added `bool
8766 may_fail' argument and use it instead of the Location.IsNull() hack.
8768 2004-09-03 Martin Baulig <martin@ximian.com>
8770 Merged latest changes into gmcs. Please keep this comment in
8771 here, it makes it easier for me to see what changed in MCS since
8772 the last time I merged.
8774 2004-09-03 Raja R Harinath <rharinath@novell.com>
8777 * expression.cs (BetterConversion): Don't allow either conversion
8778 to be null. Remove redundant implicit conversion test when 'q ==
8779 null' -- when this function is invoked, we already know that the
8780 implicit conversion exists.
8781 (BetterFunction): Assume that 'best' is non-null. Remove
8782 redundant reimplementation of IsApplicable when 'best' is null.
8783 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
8784 number of arguments.
8785 (IsAncestralType): Extract from OverloadResolve.
8786 (OverloadResolve): Make robust to the MethodGroupExpr being
8787 unsorted. Implement all the logic of Section 14.5.5.1, and
8788 support overloading of methods from multiple applicable types.
8789 Clean up logic somewhat. Don't pass null methods to BetterFunction.
8791 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
8792 (RealError, Warning): Append type of report to related symbol.
8794 2004-09-03 Marek Safar <marek.safar@seznam.cz>
8796 * enum.cs: Fixed CLS-Compliance checks for enum members.
8797 Error tests cs3008-8.cs, cs3014-8.cs
8799 2004-09-02 Marek Safar <marek.safar@seznam.cz>
8801 Fixed bug #62342, #63102
8802 * class.cs: ImplementIndexer uses member.IsExplicitImpl
8803 like ImplementMethod.
8805 2004-09-02 Marek Safar <marek.safar@seznam.cz>
8807 * attribute.cs (Attribute.GetAttributeArgumentExpression):
8810 2004-09-02 Martin Baulig <martin@ximian.com>
8812 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8813 TypeManager.GetArgumentTypes() rather than calling GetParameters()
8816 2004-09-01 Marek Safar <marek.safar@seznam.cz>
8818 C# 2.0 Static classes implemented
8820 * class.cs (TypeContainer): instance_constructors,
8821 initialized_fields, initialized_static_fields,
8822 default_constructor, base_inteface_types are protected to be
8823 accessible from StaticClass.
8824 (TypeContainer.DefineDefaultConstructor): New virtual method
8825 for custom default constructor generating
8826 (StaticClass): New class to handle "Static classes" feature.
8828 * cs-parser.jay: Handle static keyword on class like instance
8831 * driver.cs: Added "/langversion" command line switch with two
8832 options (iso-1, default).
8834 2004-08-31 Marek Safar <marek.safar@seznam.cz>
8836 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8838 2004-08-31 Miguel de Icaza <miguel@ximian.com>
8840 * delegate.cs: Style.
8842 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
8844 * delegate.cs: Add seperate instance expr field for miguel.
8846 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
8848 * PointerArithmetic (Resolve): make sure we are not doing
8849 pointer arith on void*. Also, make sure we are resolved
8850 by not setting eclass until resolve.
8852 All callers: Make sure that PointerArithmetic gets resolved.
8854 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
8856 * ArrayCreation (LookupType): If the type does not resolve
8857 to an array, give an error.
8859 2004-08-27 Marek Safar <marek.safar@seznam.cz>
8861 * statement.cs (Try.Resolve): Fixed bug #64222
8863 2004-08-27 Martin Baulig <martin@ximian.com>
8866 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8869 2004-08-26 Marek Safar <marek.safar@seznam.cz>
8871 * ecore.cs (Constantify): Get underlying type via
8872 System.Enum.GetUnderlyingType to avoid StackOverflow on the
8873 Windows in special cases.
8875 2004-08-26 Marek Safar <marek.safar@seznam.cz>
8877 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8878 for obtaining also private methods.
8879 (GetRemoveMethod): Used GetRemoveMethod (true)
8880 for obtaining also private methods.
8882 2004-09-02 Martin Baulig <martin@ximian.com>
8884 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8885 TypeManager.GetArgumentTypes() rather than calling GetParameters()
8888 2004-08-27 Martin Baulig <martin@ximian.com>
8891 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8894 2004-08-25 Martin Baulig <martin@ximian.com>
8896 * support.cs (ReflectionParameters..ctor): If this is a generic
8897 method, retrieve and store its type parameters.
8898 (InternalParameters..ctor): Added `TypeParameter[]' argument.
8899 (ReflectionParameters.GenericConstraints): The argument specifies
8900 the type parameter, not the method parameter.
8901 (InternalParameters.GenericConstraints): Likewise.
8903 * generic.cs (TypeParameter.DefineType): Correctly handle
8904 constraints wrt. generic methods in interfaces and their
8907 2004-08-24 Martin Baulig <martin@ximian.com>
8909 * generic.cs (TypeParameter.IsSubclassOf): New public method.
8910 (Constraints.IsSubclassOf): New internal method.
8912 * typemanager.cs (TypeManager.FindMembers): Added special support
8913 for GenericTypeParameterBuilder's.
8914 (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
8917 2004-08-24 Martin Baulig <martin@ximian.com>
8920 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8921 this for accessibility checks.
8922 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8923 IsNestedFamilyAccessible.
8924 (TypeManager.IsSubclassOf): New method, do what the name actually
8927 2004-08-24 Martin Baulig <martin@ximian.com>
8929 * expression.cs (MemberAccess.DoResolve): When resolving ourselves
8930 as a SimpleName, include the generic arity.
8932 2004-08-24 Martin Baulig <martin@ximian.com>
8934 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8935 MethodAttributes.HideBySig for operators.
8937 2004-08-23 Martin Baulig <martin@ximian.com>
8939 Back to the old error reporting system :-)
8941 * report.cs (Message): Removed.
8942 (Report.MessageData, ErrorData, WarningData): Removed.
8943 (Report.Error, Warning): Back to the old system.
8945 2004-08-23 Martin Baulig <martin@ximian.com>
8947 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8949 * class.cs (TypeContainer.ParentContainer): New public virtual
8950 method; replaces the explicit interface implementation.
8951 (ClassPart.ParentContainer): Override.
8953 2004-08-23 Martin Baulig <martin@ximian.com>
8955 * statement.cs (Switch): Added support for constant switches; see
8956 #59428 or test-285.cs.
8958 2004-08-22 Marek Safar <marek.safar@seznam.cz>
8961 * statement.cs (GetEnumeratorFilter): Removed useless
8962 logic because C# specs is strict. GetEnumerator must be
8965 2004-08-22 Martin Baulig <martin@ximian.com>
8967 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8968 a switch and may break, reset the barrier. Fixes #59867.
8970 2004-08-22 Marek Safar <marek.safar@seznam.cz>
8972 CLS-Compliance speed up (~5% for corlib)
8974 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8975 New method. Tests container for CLS-Compliant names
8977 * class.cs (TypeContainer.VerifyClsName): New method.
8978 Checks whether container name is CLS Compliant.
8979 (Constructor): Implements IMethodData.
8981 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8982 low-case table for CLS Compliance test.
8983 (MemberCache.VerifyClsParameterConflict): New method.
8984 Checks method parameters for CS3006 error.
8986 * enum.cs (EnumMember): Is derived from MemberCore.
8987 (Enum.VerifyClsName): Optimized for better performance.
8989 2004-08-06 Marek Safar <marek.safar@seznam.cz>
8991 * report.cs: Renamed Error_T to Error and changed all
8994 2004-08-06 Marek Safar <marek.safar@seznam.cz>
8996 * class.cs (TypeContainer.IndexerArrayList): New inner class
8997 container for indexers.
8998 (TypeContainer.DefaultIndexerName): New constant for default
8999 indexer name. Replaced all "Item" with this constant.
9000 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
9002 * typemanager.cs (TypeManager.default_member_ctor): Cache here
9003 DefaultMemberAttribute constructor.
9005 2004-08-05 Martin Baulig <martin@ximian.com>
9007 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9010 2004-08-05 Marek Safar <marek.safar@seznam.cz>
9012 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
9013 multi platforms problem.
9015 * compiler.csproj: Included shared files.
9017 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9019 Fix bug 60333, 55971 in the more general way
9020 * attribute.cs (Attribute.GetAttributeArgumentExpression):
9021 Added arg_type argument for constant conversion.
9022 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
9024 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9027 * class.cs (TypeContainer ): New inner classes MethodArrayList,
9028 OperatorArrayList, MethodCoreArrayList for typecontainer
9029 containers. Changed class member types to these new types.
9030 (MethodArrayList.DefineMembers): Added test for CS0659.
9032 2004-08-04 Miguel de Icaza <miguel@ximian.com>
9034 * cfold.cs: Synchronize the folding with the code in expression.cs
9035 Binary.DoNumericPromotions for uint operands.
9037 * attribute.cs: Revert patch from Raja, it introduced a regression
9038 while building Blam-1.2.1 (hard to isolate a test case).
9040 2004-08-04 Marek Safar <marek.safar@seznam.cz>
9044 (TypeContainer.Define): Renamed to DefineContainerMembers because of
9046 (MethodCore.parent_method): New member. The method we're overriding
9047 if this is an override method.
9048 (MethodCore.CheckBase): Moved from Method class and made common.
9049 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
9051 (MethodCore.CheckForDuplications): New abstract method. For custom
9052 member duplication search in a container
9053 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
9054 method and its return type.
9055 (Event.conflict_symbol): New member. Symbol with same name in the
9059 (MemberCache.FindMemberWithSameName): New method. The method
9060 is looking for conflict with inherited symbols.
9062 2004-08-04 Martin Baulig <martin@ximian.com>
9064 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9066 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9068 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9070 * report.cs (Message): New enum for better error, warning reference in
9072 (MessageData): New inner abstract class. It generally handles printing of
9073 error and warning messages.
9074 Removed unused Error, Warning, Message methods.
9076 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9078 Fix for cs0592-8.cs test
9080 (Attributable.ValidAttributeTargets): Made public.
9081 (Attribute.ExplicitTarget): New member for explicit target value.
9082 (Attribute.CheckTargets): Now we translate explicit attribute
9083 target to Target here.
9085 2004-08-03 Ben Maurer <bmaurer@ximian.com>
9087 * ecore.cs (MethodGroupExpr): new IsBase property.
9089 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
9091 * delegate.cs (DelegateCreation): store a MethodGroupExpr
9092 rather than an instance expr.
9094 (DelegateCreation.Emit): Use the method group rather than
9095 the instance expression. Also, if you have base.Foo as the
9096 method for a delegate, make sure to emit ldftn, not ldftnvirt.
9098 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
9100 (NewDelegate.DoResolve): Only check for the existance of Invoke
9101 if the method is going to be needed. Use MethodGroupExpr.
9103 (NewDelegate.Emit): Remove, DelegateCreation implements this.
9105 * expression.cs: For pointer arith., make sure to use
9106 the size of the type, not the size of the pointer to
9109 2004-08-03 Marek Safar <marek.safar@seznam.cz>
9112 * class.cs (Class): Added error CS0502 test.
9114 2004-08-03 John Luke <jluke@cfl.rr.com>
9115 Raja R Harinath <rharinath@novell.com>
9118 * attribute.cs (Attribute.complained_before): New flag.
9119 (Attribute.ResolveType, Attribute.Resolve),
9120 (Attribute.DefinePInvokeMethod): Set it.
9121 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
9123 2004-08-03 Martin Baulig <martin@ximian.com>
9125 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9126 use a user-defined operator; we still need to do numeric
9127 promotions in case one argument is a builtin type and the other
9128 one has an implicit conversion to that type. Fixes #62322.
9130 2004-08-18 Martin Baulig <martin@ximian.com>
9132 * class.cs (Method.Define): Use the correct method name when
9133 creating the MethodBuilder for a generic method.
9135 2004-08-17 Martin Baulig <martin@ximian.com>
9137 * generic.cs (Constraints): Support type parameter constraints.
9139 2004-08-16 Martin Baulig <martin@ximian.com>
9141 * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
9142 (Token.GENERIC_DIMENSION): New token; this is returned if we
9143 encounter an unbound generic type in a typeof() expression.
9145 * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
9146 this token is only generated while parsing a typeof() expression.
9147 (typeof_expression): Removed the old unbound_type hack.
9149 * generic.cs (TypeArguments.IsUnbound): New public property.
9151 * decl.cs (MemberName): Added support for unbound types.
9153 2004-08-14 Martin Baulig <martin@ximian.com>
9156 (TypeManager.IsEqualGenericInstance): New static method.
9157 (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
9158 just used to check accessibility, so follow the rules of 26.1.6.
9160 * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
9161 ConstructedType instead of a TypeExpression if we have type arguments.
9163 * cs-parser.jay (typeof_expression): Support unbound generic types.
9165 * ecore.cs (UnboundTypeExpression): New public class.
9167 2004-08-12 Martin Baulig <martin@ximian.com>
9169 * typemanager.cs (TypeManager.IsNestedChildOf): Use
9170 TypeManager.IsEqual() rather than `=='.
9172 * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
9173 generic instances as well.
9175 2004-08-12 Martin Baulig <martin@ximian.com>
9177 * expression.cs (Invocation.InferType): We can only infer method
9178 type parameters. Fixes #62647.
9180 2004-08-11 Martin Baulig <martin@ximian.com>
9182 * class.cs (TypeContainer.DefineType): Create the TypeBuilder
9183 before resolving the base classes.
9185 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9187 * Makefile: install .mdb file too.
9189 2004-08-05 Martin Baulig <martin@ximian.com>
9191 * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
9192 initializer, the current type is just the TypeBuilder, not the
9193 instantiated generic type.
9194 (FieldExpr.IsFieldInitializer): New public property.
9196 2004-08-04 Martin Baulig <martin@ximian.com>
9198 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9200 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9202 2004-08-03 Martin Baulig <martin@ximian.com>
9204 * class.cs (MethodData.Define): If we're an explicit
9205 implementation, remove the generic arity from the type name.
9207 2004-08-03 Martin Baulig <martin@ximian.com>
9209 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9210 use a user-defined operator; we still need to do numeric
9211 promotions in case one argument is a builtin type and the other
9212 one has an implicit conversion to that type. Fixes #62322.
9214 2004-08-02 Martin Baulig <martin@ximian.com>
9216 * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
9218 (TypeContainer.GetClassBases): Return the unexpanded list of
9219 interfaces; we expand them later.
9220 (TypeContainer.DefineType): After creating the TypeBuilder, call
9221 TypeManager.ExpandInterfaces() to get an expanded and resolved
9224 * ecore.cs (TypeExpr.GetInterfaces): Removed
9226 * generics.cs (Constraints.InterfaceConstraints): Remove.
9227 (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
9228 register the interface constraints.
9231 (TypeManager.AddUserType): Removed the `ifaces' argument.
9232 (TypeManager.AddTypeParameter): Likewise.
9233 (TypeManager.AddUserInterface): Removed, was unused.
9234 (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
9235 `TypeExpr[]' array for the interfaces.
9236 (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
9237 has been defined, returns a list of the resolved interfaces types.
9238 (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
9239 (TypeManager.GetExplicitInterfaces): Likewise.
9241 2004-08-02 Martin Baulig <martin@ximian.com>
9243 * expression.cs (Invocation.EmitCall): If we're invoking a method
9244 on a type parameter, use the new `Constrained' prefix opcode.
9246 2004-08-02 Martin Baulig <martin@ximian.com>
9248 * statement.cs (LocalInfo.Flags): Added `IsThis'.
9249 (LocalInfo.IsThis): New public property.
9250 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
9252 2004-08-01 Martin Baulig <martin@ximian.com>
9254 * class.cs (TypeContainer.GetClassBases): Don't set the default
9255 here since we may get called from GetPartialBases().
9256 (TypeContainer.DefineType): If GetClassBases() didn't return a
9257 parent, use the default one.
9259 2004-07-30 Martin Baulig <martin@ximian.com>
9261 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
9263 * class.cs (SourceMethod): New public class, derive from the
9264 symbol writer's ISourceMethod.
9265 (Method): Use the new symbol writer API.
9267 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
9268 as argument and use the new symbol writer.
9271 (SourceFile): Implement the symbol writer's ISourceFile.
9272 (Location.SymbolDocument): Removed.
9273 (Location.SourceFile): New public property.
9275 * symbolwriter.cs: Use the new symbol writer API.
9277 2004-07-30 Raja R Harinath <rharinath@novell.com>
9279 * Makefile (install-local): Remove. Functionality moved to
9282 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
9284 * Makefile: Install mcs.exe.config file together with mcs.exe.
9285 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
9286 correct runtime version.
9288 2004-07-25 Martin Baulig <martin@ximian.com>
9291 (TypeContainer.RegisterOrder): Removed, this was unused.
9292 (TypeContainer, interface_order): Removed.
9293 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
9294 TypeContainer as argument since we can also be called with a
9295 `PartialContainer' for a partial class/struct/interface.
9296 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
9297 of checking whether we're an `Interface' - we could be a
9299 (PartialContainer.Register): Override; call
9300 AddClass()/AddStruct()/AddInterface() on our parent.
9302 * cs-parser.jay (interface_member_declaration): Add things to the
9303 `current_container', not the `current_class'.
9305 * rootcontext.cs (RegisterOrder): The overloaded version which
9306 takes an `Interface' was unused, removed.
9308 * typemanager.cs (TypeManager.LookupInterface): Return a
9309 `TypeContainer', not an `Interface'.
9310 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
9311 contain a `PartialContainer' for an interface, so check it's
9312 `Kind' to figure out what it is.
9314 2004-07-25 Martin Baulig <martin@ximian.com>
9316 * class.cs (Class.DefaultTypeAttributes): New public constant.
9317 (Struct.DefaultTypeAttributes): Likewise.
9318 (Interface.DefaultTypeAttributes): Likewise.
9319 (PartialContainer.TypeAttr): Override this and add the
9320 DefaultTypeAttributes.
9322 2004-07-25 Martin Baulig <martin@ximian.com>
9324 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
9325 we can just use the `Parent' field instead.
9327 2004-07-25 Martin Baulig <martin@ximian.com>
9329 * class.cs (TypeContainer.Emit): Renamed to EmitType().
9331 2004-07-25 Martin Baulig <martin@ximian.com>
9333 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
9334 our parts before defining any methods.
9335 (TypeContainer.VerifyImplements): Make this virtual.
9336 (ClassPart.VerifyImplements): Override and call VerifyImplements()
9337 on our PartialContainer.
9339 2004-07-25 Martin Baulig <martin@ximian.com>
9341 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
9343 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
9344 argument, we can just use the `Parent' field instead.
9347 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
9348 (MemberBase.DoDefine): Likewise.
9350 2004-07-24 Martin Baulig <martin@ximian.com>
9352 * decl.cs (MemberCore.Parent): New public field.
9353 (DeclSpace.Parent): Moved to MemberCore.
9355 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
9356 (MemberBase.ctor): Added TypeContainer argument, pass it to our
9358 (FieldBase, Field, Operator): Likewise.
9359 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
9360 (EventField, Event): Likewise.
9362 2004-07-23 Martin Baulig <martin@ximian.com>
9364 * class.cs (PartialContainer): New public class.
9365 (ClassPart): New public class.
9366 (TypeContainer): Added support for partial classes.
9367 (TypeContainer.GetClassBases): Splitted some of the functionality
9368 out into GetNormalBases() and GetPartialBases().
9370 * cs-tokenizer.cs (Token.PARTIAL): New token.
9371 (Tokenizer.consume_identifier): Added some hacks to recognize
9372 `partial', but only if it's immediately followed by `class',
9373 `struct' or `interface'.
9375 * cs-parser.jay: Added support for partial clases.
9377 2004-07-23 Martin Baulig <martin@ximian.com>
9379 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
9380 a `DeclSpace' and also made it readonly.
9381 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
9382 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
9383 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
9385 * cs-parser.jay: Pass the `current_class', not the
9386 `current_container' (at the moment, this is still the same thing)
9387 to a new Method, Property, Event, Indexer or Constructor.
9389 2004-07-23 Martin Baulig <martin@ximian.com>
9391 * cs-parser.jay (CSharpParser): Added a new `current_class' field
9392 and removed the `current_interface' one.
9393 (struct_declaration, class_declaration, interface_declaration):
9394 Set `current_class' to the newly created class/struct/interface;
9395 set their `Bases' and call Register() before parsing their body.
9397 2004-07-23 Martin Baulig <martin@ximian.com>
9399 * class.cs (Kind): New public enum.
9400 (TypeContainer): Made this class abstract.
9401 (TypeContainer.Kind): New public readonly field.
9402 (TypeContainer.CheckDef): New public method; moved here from
9404 (TypeContainer.Register): New public abstract method.
9405 (TypeContainer.GetPendingImplementations): New public abstract
9407 (TypeContainer.GetClassBases): Removed the `is_class' and
9408 `is_iface' parameters.
9409 (TypeContainer.DefineNestedTypes): Formerly known as
9411 (ClassOrStruct): Made this class abstract.
9413 * tree.cs (RootTypes): New public type.
9415 2004-07-20 Martin Baulig <martin@ximian.com>
9417 * tree.cs (Tree.RecordNamespace): Removed.
9418 (Tree.Namespaces): Removed.
9420 * rootcontext.cs (RootContext.IsNamespace): Removed.
9422 * cs-parser.jay (namespace_declaration): Just create a new
9423 NamespaceEntry here.
9425 2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
9427 * Makefile: Install gmcs.exe.config file together with gmcs.exe.
9428 * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
9429 entry to make sure it runs in the correct runtime version.
9431 2004-07-18 Martin Baulig <martin@ximian.com>
9433 * generic.cs (ConstructedType.CheckConstraints): Improved
9434 constraints checking.
9436 2004-07-18 Martin Baulig <martin@ximian.com>
9438 * expression.cs (Invocation.BetterMethod): Call
9439 TypeManager.TypeToCoreType() on all types and removed my previous
9440 hack; we're already doig the right thing here.
9442 2004-07-17 Martin Baulig <martin@ximian.com>
9444 * decl.cs (MemberName.MakeName): Create the "class`1" names here.
9446 2004-07-16 Martin Baulig <martin@ximian.com>
9448 * iterators.cs: Added generics support.
9450 2004-07-16 Martin Baulig <martin@ximian.com>
9452 * iterators.cs: Rewrote this. We're now using one single Proxy
9453 class for both the IEnumerable and the IEnumerator interface and
9454 `Iterator' derives from Class so we can use the high-level API.
9456 * class.cs (TypeContainer.AddIterator): New method.
9457 (TypeContainer.DoDefineType): New protected virtual method, which
9458 is called from DefineType().
9459 (TypeContainer.DoDefineMembers): Call DefineType() and
9460 DefineMembers() on all our iterators.
9461 (TypeContainer.Emit): Call Emit() on all our iterators.
9462 (TypeContainer.CloseType): Call CloseType() on all our iterators.
9464 * codegen.cs (EmitContext.CurrentIterator): New public field.
9466 2004-07-15 Martin Baulig <martin@ximian.com>
9469 (TypeManager.not_supported_exception_type): New type.
9471 2004-07-14 Martin Baulig <martin@ximian.com>
9474 (TypeManager.generic_ienumerable_type): New type.
9475 (TypeManager.generic_ienumerator_type): New type.
9478 (RootContext.interfaces_first_stage): Added
9479 "System.Collections.Generic.IEnumerator`1" and
9480 "System.Collections.Generic.IEnumerable`1".
9482 2004-07-14 Martin Baulig <martin@ximian.com>
9484 * iterators.cs: Use real error numbers.
9486 2004-07-14 Martin Baulig <martin@ximian.com>
9488 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
9489 requires this to be a System.Collection.IEnumerable and not a
9490 class implementing that interface.
9491 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
9493 2004-07-13 Marek Safar <marek.safar@seznam.cz>
9495 * class.cs: Fixed previous fix, it broke some error tests.
9497 2004-07-12 Martin Baulig <martin@ximian.com>
9499 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
9502 2004-07-14 Martin Baulig <martin@ximian.com>
9504 * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
9505 an exclamation mark (!) for the generic arity to reflect the
9506 latest spec changes; ie. use "System.Collections.Generic.IList`1".
9508 2004-07-13 Martin Baulig <martin@ximian.com>
9510 * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
9511 specifiers being part of a type argument.
9513 2004-07-13 Martin Baulig <martin@ximian.com>
9515 * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
9516 name for generic types.
9518 2004-07-13 Martin Baulig <martin@ximian.com>
9520 * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
9523 2004-07-09 Miguel de Icaza <miguel@ximian.com>
9525 * assign.cs (LocalTemporary): Add new argument: is_address,If
9526 `is_address' is true, then the value that we store is the address
9527 to the real value, and not the value itself.
9529 * ecore.cs (PropertyExpr): use the new local temporary
9530 stuff to allow us to handle X.Y += z (where X is a struct)
9532 2004-07-08 Martin Baulig <martin@ximian.com>
9534 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
9535 not always return, just like we're doing in Using.Resolve().
9537 2004-07-07 Miguel de Icaza <miguel@ximian.com>
9539 * cs-parser.jay (fixed_statement): flag this as Pinned.
9541 2004-07-06 Miguel de Icaza <miguel@ximian.com>
9543 * typemanager.cs (TypeManager): Removed MakePinned method, this
9544 mechanism is replaced with the .NET 2.x compatible mechanism of
9545 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
9547 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
9548 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
9549 `IsFixed' property which has a different meaning.
9551 2004-07-02 Raja R Harinath <rharinath@novell.com>
9553 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
9554 visible from inside a nested class, not just the names of the
9555 immediately enclosing class.
9558 2004-06-24 Raja R Harinath <rharinath@novell.com>
9560 * expression.cs (BetterConversion): Remove buggy special-case
9561 handling of "implicit constant expression conversions". At this
9562 point, we already know that the conversion is possible -- we're
9563 only checking to see which is better.
9565 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9567 * cs-parser.jay: Added error CS0210 test.
9569 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9571 * cs-parser.jay: Added error CS0134 test.
9573 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9576 * cs-parser.jay: Added error CS0145 test.
9578 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9580 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
9582 2004-06-23 Ben Maurer <bmaurer@ximian.com>
9584 * expression.cs (StackAlloc.Resolve): The argument may not
9585 be a constant; deal with this case.
9587 2004-06-23 Marek Safar <marek.safar@seznam.cz>
9589 * attribute.cs (IndexerName_GetIndexerName): Renamed to
9590 GetIndexerAttributeValue.
9591 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
9593 * class.cs (Indexer.Define): Added error tests for CS0415,
9596 2004-06-23 Miguel de Icaza <miguel@ximian.com>
9598 * attribute.cs (Attribute.Resolve): Keep field code in sync with
9601 2004-06-23 Martin Baulig <martin@ximian.com>
9603 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
9604 neither return nor throw, reset the barrier as well. Fixes #60457.
9606 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
9608 * class.cs : EventAttributes is now set to None by default.
9609 This fixes bug #60459.
9611 2004-06-18 Marek Safar <marek.safar@seznam.cz>
9614 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9615 Don't throw exception but return null (it's sufficient now).
9617 2004-06-18 Marek Safar <marek.safar@seznam.cz>
9619 * typemanager.cs (GetArgumentTypes): Faster implementation.
9621 2004-06-18 Martin Baulig <martin@ximian.com>
9623 * attribute.cs (Attribute.Resolve): Check whether we're an
9624 EmptyCast which a Constant child. Fixes #60333.
9626 2004-06-17 Ben Maurer <bmaurer@ximian.com>
9628 * statement.cs (EmitCollectionForeach): Account for the fact that
9629 not all valuetypes are in areas which we can take the address of.
9630 For these variables, we store to a temporary variable. Also, make
9631 sure that we dont emit a `callvirt' on a valuetype method.
9633 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9635 * expression.cs (StackAlloc.DoReSolve): Added test for
9636 negative parameter (CS0247).
9638 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9641 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
9643 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9646 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
9649 2004-06-14 Marek Safar <marek.safar@seznam.cz>
9651 Fix bug #58254 & cs1555.cs, cs1556.cs
9652 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
9654 2004-06-14 Marek Safar <marek.safar@seznam.cz>
9656 * cs-parser.jay: Added error CS1669 test for indexers.
9658 2004-06-18 Martin Baulig <martin@ximian.com>
9660 * generics.cs (GenericMethod.ctor): Don't take an Attributes
9661 argument. Fixes #60441.
9663 2004-06-16 Ben Maurer <bmaurer@ximian.com>
9664 * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
9665 The name needs to have the actual name of the method in order
9666 for other tests (such as the one in OverloadResolve for Invoke
9667 on a delegate) to work. As well, it does not really help
9668 error reporting because the method group had multiple methods.
9669 * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
9670 Make profiling work.
9672 2004-06-13 Martin Baulig <martin@ximian.com>
9674 * cs-parser.jay: Don't allow generic attributes.
9676 2004-06-13 Martin Baulig <martin@ximian.com>
9678 * class.cs (MemberBase.DoDefineBase): New protected method.
9679 (MemberBase.DoDefine): Compute the `flags' in the new
9680 DoDefineBase() which must be called first.
9681 (Method.Define): Call DoDefineBase() first so we have the flags
9682 when defining the generic method.
9684 * cs-parser.jay (interface_method_declaration): Support generic methods.
9686 2004-06-13 Martin Baulig <martin@ximian.com>
9688 * decl.cs (TypeName): Removed.
9689 (MemberName): Removed TypeName and MemberNow; now we just have
9692 * cs-parser.jay: Don't distinguish between type arguments and type
9693 parameters in the grammar and simplified the rules a bit. The
9694 reduce/reduce conflicts are now gone (except the one we inherited
9697 2004-06-11 Martin Baulig <martin@ximian.com>
9699 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9700 call this twice: for params and varargs methods.
9702 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9705 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9707 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9709 * attribute.cs (Attribute.GetValidTargets): Made public.
9712 (AbstractPropertyEventMethod): New class for better code sharing.
9713 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
9715 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
9717 2004-06-09 Martin Baulig <martin@ximian.com>
9719 * cs-parser.jay: Removed a reduce/reduce conflict.
9721 2004-06-03 Martin Baulig <martin@ximian.com>
9723 * generic.cs (ConstructedType.GetMemberAccess): Renamed to
9724 GetSimpleName() and return a SimpleName.
9726 * ecore.cs (SimpleName.Arguments): New public field.
9727 (SimpleName): Added overloaded ctor which takes an additional
9728 TypeArguments argument.
9729 (SimpleName.SimpleNameResolve): Added support for generic methods.
9730 (MethodGroupExpr.ResolveGeneric): New public method. The code was
9731 formerly in MemberAccess.DoResolve(), but we also need it in
9732 SimpleNameResolve().
9734 * expression.cs (MemberAccess.DoResolve): Use the new
9735 MethodGroupExpr.ResolveGeneric().
9737 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9739 * decl.cs: If possible, use lookuptypedirect here. We can only do
9740 this if there is no `.' after the namespace. Avoids using
9741 LookupType, which does lots of slow processing.
9742 (FindNestedType) New method, does what it says :-).
9743 * namespace.cs: use LookupTypeDirect.
9744 * rootcontext.cs: use membercache, if possible.
9745 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9747 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9750 According to the spec,
9752 In a member access of the form E.I, if E is a single identifier,
9753 and if the meaning of E as a simple-name (§7.5.2) is a constant,
9754 field, property, localvariable, or parameter with the same type as
9755 the meaning of E as a type-name (§3.8), then both possible
9756 meanings of E are permitted.
9758 We did not check that E as a simple-name had the same type as E as
9761 This trivial check gives us 5-7% on bootstrap time.
9763 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9765 * expression.cs (Invocation.OverloadResolve): Avoid the
9766 use of hashtables and boxing here by allocating on demand.
9768 2004-05-30 Martin Baulig <martin@ximian.com>
9770 * rootcontext.cs (RootContext.LookupType): Don't cache things if
9771 we're doing a silent lookup. Don't try to lookup nested types in
9772 TypeManager.object_type (thanks to Ben Maurer).
9774 2004-05-30 Martin Baulig <martin@ximian.com>
9776 Committing a patch from Ben Maurer.
9778 * rootcontext.cs (RootContext.LookupType): Cache negative results.
9780 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9782 * convert.cs: add a trivial cache for overload operator resolution.
9784 2004-05-31 Marek Safar <marek.safar@seznam.cz>
9787 (AttributeTester.GetObsoleteAttribute): Returns instance of
9788 ObsoleteAttribute when type is obsolete.
9791 (TypeContainer.VerifyObsoleteAttribute): Override.
9792 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
9793 (MethodCode.VerifyObsoleteAttribute): Override.
9794 (MemberBase.VerifyObsoleteAttribute): Override.
9797 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
9798 and report proper error.
9801 (Delegate.VerifyObsoleteAttribute): Override.
9804 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
9805 and report proper error.
9806 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
9809 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
9813 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
9814 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
9815 Added test for ObsoleteAttribute.
9818 (Catch): Derived from Statement.
9820 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9822 * decl.cs: If possible, use lookuptypedirect here. We can only do
9823 this if there is no `.' after the namespace. Avoids using
9824 LookupType, which does lots of slow processing.
9825 (FindNestedType) New method, does what it says :-).
9826 * namespace.cs: use LookupTypeDirect.
9827 * rootcontext.cs: use membercache, if possible.
9828 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9830 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9833 According to the spec,
9835 In a member access of the form E.I, if E is a single identifier,
9836 and if the meaning of E as a simple-name (§7.5.2) is a constant,
9837 field, property, localvariable, or parameter with the same type as
9838 the meaning of E as a type-name (§3.8), then both possible
9839 meanings of E are permitted.
9841 We did not check that E as a simple-name had the same type as E as
9844 This trivial check gives us 5-7% on bootstrap time.
9846 2004-05-30 Marek Safar <marek.safar@seznam.cz>
9848 Fixed bug #59071 & cs0160.cs
9849 * statement.cs (Try.Resolve): Check here whether order of catch
9850 clauses matches their dependencies.
9852 2004-05-30 Marek Safar <marek.safar@seznam.cz>
9855 * ecore.cs (SimpleName.SimpleNameResolve): Added test for
9858 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9860 * expression.cs (Invocation.OverloadResolve): Avoid the
9861 use of hashtables and boxing here by allocating on demand.
9863 2004-05-30 Martin Baulig <martin@ximian.com>
9865 * rootcontext.cs (RootContext.LookupType): Don't cache things if
9866 we're doing a silent lookup. Don't try to lookup nested types in
9867 TypeManager.object_type (thanks to Ben Maurer).
9869 2004-05-30 Martin Baulig <martin@ximian.com>
9871 Committing a patch from Ben Maurer.
9873 * rootcontext.cs (RootContext.LookupType): Cache negative results.
9875 2004-05-29 Martin Baulig <martin@ximian.com>
9877 * class.cs (IMethodData.ShouldIgnore): New method.
9879 * typemanager.cs (TypeManager.MethodFlags): Don't take a
9880 `Location' argument, we don't need it anywhere. Use
9881 `IMethodData.ShouldIgnore ()' instead of
9882 `MethodData.GetMethodFlags ()'.
9883 (TypeManager.AddMethod): Removed.
9884 (TypeManager.AddMethod2): Renamed to AddMethod.
9886 2004-05-29 Martin Baulig <martin@ximian.com>
9888 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9890 * convert.cs (Convert.ImplicitReferenceConversion): If we're
9891 converting from a class type S to an interface type and we already
9892 have an object on the stack, don't box it again. Fixes #52578.
9894 2004-05-29 Martin Baulig <martin@ximian.com>
9896 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9897 Added support for `params' parameters. Fixes #59267.
9899 2004-05-29 Martin Baulig <martin@ximian.com>
9901 * literal.cs (NullPointer): Provide a private .ctor which sets
9902 `type' to TypeManager.object_type. Fixes #59048.
9904 2004-05-29 Martin Baulig <martin@ximian.com>
9906 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9907 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
9909 * ecore.cs (EventExpr.instance_expr): Make the field private.
9911 2004-05-26 Marek Safar <marek.safar@seznam.cz>
9913 Fixed bug #50080 & cs0214-2.cs
9914 * expression.cs (Cast.DoResolve): Check unsafe context here.
9916 * statement.cs (Resolve.DoResolve): Likewise.
9918 2004-05-26 Martin Baulig <martin@ximian.com>
9920 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9922 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9923 (RootContext.LookupType): Pass down the `silent' flag.
9925 2004-05-25 Martin Baulig <martin@ximian.com>
9928 (MethodGroupExpr.IdenticalTypeName): New public property.
9929 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9930 expression actually refers to a type.
9932 2004-05-25 Martin Baulig <martin@ximian.com>
9934 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9935 for #56176 and made it actually work.
9937 2004-05-25 Martin Baulig <martin@ximian.com>
9939 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9940 (FieldExpr, PropertyExpr): Override and implement
9941 CacheTemporaries. Fixes #52279.
9943 2004-05-25 Miguel de Icaza <miguel@ximian.com>
9945 * location.cs: In the new compiler listing a file twice is a
9946 warning, not an error.
9948 2004-05-24 Martin Baulig <martin@ximian.com>
9950 * enum.cs (Enum.DefineType): For the `BaseType' to be a
9951 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
9953 2004-05-24 Martin Baulig <martin@ximian.com>
9955 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9956 walking the `using' list. Fixes #53921.
9958 2004-05-24 Martin Baulig <martin@ximian.com>
9960 * const.cs (Const.LookupConstantValue): Added support for
9961 EmptyCast's; fixes #55251.
9963 2004-05-24 Martin Baulig <martin@ximian.com>
9965 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9966 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9967 which does the CS0135 check. The reason is that we first need to
9968 check whether the variable actually exists.
9970 2004-05-24 Martin Baulig <martin@ximian.com>
9972 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9973 than RootContext.LookupType() to find the explicit interface
9976 2004-05-24 Raja R Harinath <rharinath@novell.com>
9978 * Makefile: Simplify. Use executable.make.
9979 * mcs.exe.sources: New file. List of sources of mcs.exe.
9981 2004-05-24 Anders Carlsson <andersca@gnome.org>
9985 Use the invariant culture when doing String.Compare for CLS case
9988 2004-05-23 Martin Baulig <martin@ximian.com>
9990 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9991 don't have any dots. Fixes #52622, added cs0246-8.cs.
9993 * namespace.cs (NamespaceEntry.Lookup): Likewise.
9995 2004-05-23 Marek Safar <marek.safar@seznam.cz>
9997 * class.cs (MemberBase.Define): Reuse MemberType member for
9998 resolved type. Other methods can use it too.
10000 2004-05-23 Martin Baulig <martin@ximian.com>
10002 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
10003 the variable also exists in the current block (otherwise, we need
10004 to report a CS0103). Fixes #58670.
10006 2004-05-23 Martin Baulig <martin@ximian.com>
10008 * flowanalysis.cs (Reachability.Reachable): Compute this
10009 on-the-fly rather than storing it as a field.
10011 2004-05-23 Martin Baulig <martin@ximian.com>
10013 * flowanalysis.cs (Reachability.And): Manually compute the
10014 resulting `barrier' from the reachability.
10016 2004-05-23 Marek Safar <marek.safar@seznam.cz>
10019 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
10020 instance of ObsoleteAttribute when symbol is obsolete.
10023 (IMethodData): Extended interface for ObsoleteAttribute support.
10025 2004-05-22 Marek Safar <marek.safar@seznam.cz>
10027 * attribute.cs: Fix bug #55970
10029 2004-05-22 Marek Safar <marek.safar@seznam.cz>
10033 (GetObsoleteAttribute): New method. Creates the instance of
10035 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
10036 ObsoleteAttribute when member is obsolete.
10037 (AttributeTester.Report_ObsoleteMessage): Common method for
10038 Obsolete error/warning reporting.
10041 (TypeContainer.base_classs_type): New member for storing parent type.
10044 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
10045 for this MemberCore.
10047 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10049 * attribute.cs, const.cs: Fix bug #58590
10051 2004-05-21 Martin Baulig <martin@ximian.com>
10053 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
10054 out parameters if the end of the method is unreachable. Fixes
10057 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10059 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
10060 Hari was right, why extra method.
10062 2004-05-21 Marek Safar <marek.safar@seznam.cz>
10064 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
10066 2004-05-20 Martin Baulig <martin@ximian.com>
10068 * delegate.cs: Convert this file to Unix mode - like the original
10071 2004-05-20 Martin Baulig <martin@ximian.com>
10073 * attribute.cs: Convert this file to Unix mode - like the original
10076 2004-05-19 Marek Safar <marek.safar@seznam.cz>
10078 Fix bug #58688 (MCS does not report error when the same attribute
10081 * attribute.cs (Attribute.Emit): Distinction between null and default.
10083 2004-05-19 Raja R Harinath <rharinath@novell.com>
10085 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
10086 of a top-level attribute without an attribute target.
10087 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
10089 (Attribute.Conditional_GetConditionName),
10090 (Attribute.Obsolete_GetObsoleteMessage): Update.
10091 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
10092 part of ScanForIndexerName.
10093 (Attribute.CanIgnoreInvalidAttribute): New function.
10094 (Attribute.ScanForIndexerName): Move to ...
10095 (Attributes.ScanForIndexerName): ... here.
10096 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
10097 (Attributes.Search): New internal variant that can choose not to
10098 complain if types aren't resolved. The original signature now
10100 (Attributes.GetClsCompliantAttribute): Use internal variant, with
10101 complaints suppressed.
10102 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
10103 only if it not useful.
10104 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
10105 top-level for attributes that are shared between the assembly
10106 and a top-level class.
10107 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
10108 * class.cs: Update to reflect changes.
10109 (DefineIndexers): Fuse loops.
10110 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
10111 a couple more variants of attribute names.
10113 2004-05-18 Marek Safar <marek.safar@seznam.cz>
10115 Fix bug #52585 (Implemented explicit attribute declaration)
10118 (Attributable.ValidAttributeTargets): New abstract method. It gets
10119 list of valid attribute targets for explicit target declaration.
10120 (Attribute.Target): It holds target itself.
10121 (AttributeSection): Removed.
10122 (Attribute.CheckTargets): New method. It checks whether attribute
10123 target is valid for the current element.
10126 (EventProperty): New class. For events that are declared like
10127 property (with add and remove accessors).
10128 (EventField): New class. For events that are declared like field.
10131 * cs-parser.jay: Implemented explicit attribute target declaration.
10133 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
10134 Override ValidAttributeTargets.
10137 (ReturnParameter): Class for applying custom attributes on
10139 (ParameterAtribute): New class. Class for applying custom
10140 attributes on the parameter type.
10142 2004-05-17 Miguel de Icaza <miguel@ximian.com>
10144 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
10147 (Method): Allow UNSAFE here.
10149 * modifiers.cs: Support unsafe reporting.
10151 2004-05-17 Marek Safar <marek.safar@seznam.cz>
10153 * decl.cs: Fix bug #58478.
10155 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10157 * statement.cs: When checking for unreachable code on an EmptyStatement,
10158 set the location. Fixes bug #58488.
10160 2004-05-13 Miguel de Icaza <miguel@ximian.com>
10162 * driver.cs: Add -pkg handling.
10164 From Gonzalo: UseShelLExecute=false
10166 2004-05-12 Marek Safar <marek.safar@seznam.cz>
10169 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
10171 (Attribute.IsClsCompliaceRequired): Moved to base for better
10173 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
10174 when attribute is AttributeUsageAttribute.
10175 (Attribute.GetValidTargets): Simplified.
10176 (Attribute.GetAttributeUsage): New method returns AttributeUsage
10177 attribute for this type.
10178 (Attribute.ApplyAttributes): Method renamed to Emit and make
10180 (GlobalAttributeSection): New class for special handling of global
10181 attributes (assembly, module).
10182 (AttributeSection.Emit): New method.
10184 * class.cs: Implemented Attributable abstract methods.
10185 (MethodCore.LabelParameters): Moved to Parameter class.
10186 (Accessor): Is back simple class.
10187 (PropertyMethod): Implemented Attributable abstract class.
10188 (DelegateMethod): Implemented Attributable abstract class.
10189 (Event): New constructor for disctintion between normal Event
10190 and Event with accessors.
10192 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
10194 * codegen.cs, const.cs, decl.cs, delegate.cs:
10195 (CommonAssemblyModulClass): Implemented Attributable abstract class
10198 * enum.cs: Implement IAttributeSupport interface.
10199 (EnumMember): New class for emum members. Implemented Attributable
10203 (ParameterBase): Is abstract.
10204 (ReturnParameter): New class for easier [return:] attribute handling.
10206 * typemanager.cs: Removed builder_to_attr.
10208 2004-05-11 Raja R Harinath <rharinath@novell.com>
10211 * attribute.cs (Attribute.GetPositionalValue): New function.
10212 * class.cs (TypeContainer.VerifyMembers): New function.
10213 (TypeContainer.Emit): Use it.
10214 (ClassOrStruct): New base class for Class and Struct.
10215 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
10216 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
10218 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
10219 then each non-static field should have a FieldOffset attribute.
10220 Otherwise, none of the fields should have a FieldOffset attribute.
10221 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
10222 and FieldOffset attributes.
10223 * typemanager.cs (TypeManager.struct_layout_attribute_type)
10224 (TypeManager.field_offset_attribute_type): New core types.
10225 (TypeManager.InitCoreTypes): Initialize them.
10227 2004-05-11 Michal Moskal <malekith@pld-linux.org>
10229 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
10230 Return correct type.
10233 2004-05-09 Miguel de Icaza <miguel@ximian.com>
10235 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
10236 be implicitly converted to ulong.
10238 * expression.cs: The logic for allowing operator &, | and ^ worked
10239 was wrong, it worked before because we did not report an error in
10240 an else branch. Fixes 57895.
10242 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
10243 allow volatile fields to be reference types.
10245 2004-05-07 Miguel de Icaza <miguel@ximian.com>
10247 * driver.cs: Add support for /debug-
10249 2004-05-07 Raja R Harinath <rharinath@novell.com>
10251 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
10252 Add a 'complain' parameter to silence errors.
10253 (Attribute.Resolve): Update to changes. Put in sanity check to catch
10254 silently overlooked type-resolutions.
10255 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
10256 to reflect changes.
10257 (Attributes.Search): New function.
10258 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
10259 (Attributes.GetAttributeFullName): Remove hack.
10260 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
10261 Update to reflect changes.
10262 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10263 Use Attributes.Search instead of nested loops.
10265 2004-05-07 Marek Safar <marek.safar@seznam.cz>
10268 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
10269 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
10270 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
10272 * report.cs: (Report.Warning): Renamed to Warning_T because of
10273 parameter collision.
10275 2004-05-05 Raja R Harinath <rharinath@novell.com>
10277 * expression.cs (MemberAccess.ResolveMemberAccess):
10278 Exit with non-zero status after Report.Error.
10279 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
10281 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
10283 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
10285 * support.cs: Don't hang when the file is empty.
10287 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
10289 * support.cs: In SeekableStreamReader, compute the preamble size of the
10290 underlying stream. Position changes should take into account that initial
10293 2004-05-03 Todd Berman <tberman@sevenl.net>
10295 * driver.cs: remove unused GetSysVersion function.
10297 2004-05-03 Todd Berman <tberman@sevenl.net>
10299 * driver.cs: Remove the hack from saturday, as well as the hack
10300 from jackson (LoadAssemblyFromGac), also adds the CWD to the
10301 link_paths to get that bit proper.
10303 2004-05-01 Todd Berman <tberman@sevenl.net>
10305 * driver.cs: Try a LoadFrom before a Load, this checks the current
10306 path. This is currently a bug in mono that is be fixed, however, this
10307 provides a workaround for now. This will be removed when the bug
10310 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
10312 * CryptoConvert.cs: Updated to latest version. Fix issue with
10313 incomplete key pairs (#57941).
10315 2004-05-01 Todd Berman <tberman@sevenl.net>
10317 * driver.cs: Remove '.' from path_chars, now System.* loads properly
10320 2004-04-30 Jackson Harper <jackson@ximian.com>
10322 * codegen.cs: Open keys readonly.
10324 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10326 * typemanager.cs: don't report cyclic struct layout when a struct
10327 contains 2 or more fields of the same type. Failed for Pango.AttrShape
10328 which has 2 Pango.Rectangle fields.
10330 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
10332 * expression.cs: Handle IntPtr comparisons with IL code
10333 rather than a method call.
10335 2004-04-29 Martin Baulig <martin@ximian.com>
10337 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
10338 the list of PropertyInfo's in class hierarchy and find the
10339 accessor. Fixes #56013.
10341 2004-04-29 Martin Baulig <martin@ximian.com>
10343 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
10345 2004-04-29 Martin Baulig <martin@ximian.com>
10347 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10349 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
10351 2004-04-29 Martin Baulig <martin@ximian.com>
10353 * class.cs (ConstructorInitializer.Resolve): Check whether the
10354 parent .ctor is accessible. Fixes #52146.
10356 2004-04-29 Martin Baulig <martin@ximian.com>
10358 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10360 * statement.cs (Using.EmitLocalVariableDecls): Use
10361 TypeManager.idisposable_type, not typeof (IDisposable).
10362 (Foreach.EmitCollectionForeach): Added support for valuetypes.
10364 2004-04-29 Martin Baulig <martin@ximian.com>
10366 * class.cs (Event.Define): Don't emit the field and don't set
10367 RTSpecialName and SpecialName for events on interfaces. Fixes
10370 2004-04-29 Raja R Harinath <rharinath@novell.com>
10372 Refactor Attribute.ApplyAttributes.
10373 * attribute.cs (Attributable): New base class for objects that can
10374 have Attributes applied on them.
10375 (Attribute): Make AttributeUsage fields public.
10376 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
10377 (Attribute.IsInternalCall): New property.
10378 (Attribute.UsageAttr): Convert to a public read-only property.
10379 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
10380 (Attribute.ResolveType, Attribute.Resolve)
10381 (Attribute.ScanForIndexerName): Update to reflect changes.
10382 (Attribute.CheckAttributeTarget): Re-format.
10383 (Attribute.ApplyAttributes): Refactor, to various
10384 Attributable.ApplyAttributeBuilder methods.
10385 * decl.cs (MemberCore): Make Attributable.
10386 * class.cs (Accessor): Make Attributable.
10387 (MethodData.ApplyAttributes): Use proper attribute types, not
10389 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
10390 (TypeContainer.ApplyAttributeBuilder)
10391 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
10392 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
10393 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
10394 (Operator.ApplyAttributeBuilder): New factored-out methods.
10395 * const.cs (Const.ApplyAttributeBuilder): Likewise.
10396 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
10397 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
10398 * parameter.cs (ParameterBase): New Attributable base class
10399 that can also represent Return types.
10400 (Parameter): Update to the changes.
10402 2004-04-29 Jackson Harper <jackson@ximian.com>
10404 * driver.cs: Prefer the corlib system version when looking for
10405 assemblies in the GAC. This is still a hack, but its a better hack
10408 2004-04-29 Marek Safar <marek.safar@seznam.cz>
10410 * decl.cs, enum.cs: Improved error 3005 reporting.
10412 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
10413 (related_symbols): New private member for list of symbols
10414 related to reported error/warning.
10416 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
10418 2004-04-29 Martin Baulig <martin@ximian.com>
10420 * ecore.cs (Expression.Constantify): If we're an enum and
10421 TypeManager.TypeToCoreType() doesn't give us another type, use
10422 t.UnderlyingSystemType. Fixes #56178.
10424 2004-04-29 Martin Baulig <martin@ximian.com>
10426 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
10427 interfaces and for each interface, only add members directly
10428 declared in that interface. Fixes #53255.
10430 2004-04-28 Martin Baulig <martin@ximian.com>
10432 * expression.cs (ConditionalLogicalOperator): Use a temporary
10433 variable for `left' to avoid that we evaluate it more than once;
10436 2004-04-28 Martin Baulig <martin@ximian.com>
10438 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
10441 2004-04-28 Martin Baulig <martin@ximian.com>
10443 * statement.cs (LocalInfo.Resolve): Check whether the type is not
10446 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
10447 whether the type is not void (CS1547).
10449 2004-04-28 Martin Baulig <martin@ximian.com>
10451 * expression.cs (Unary.DoResolveLValue): Override this and report
10452 CS0131 for anything but Operator.Indirection.
10454 2004-04-28 Martin Baulig <martin@ximian.com>
10456 Committing a patch from Ben Maurer; see bug #50820.
10458 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10461 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10464 2004-04-28 Martin Baulig <martin@ximian.com>
10466 Committing a patch from Ben Maurer; see bug #50820.
10468 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10471 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10474 2004-04-28 Martin Baulig <martin@ximian.com>
10476 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
10477 (Block.AddLabel): Call DoLookupLabel() to only search in the
10480 2004-04-28 Martin Baulig <martin@ximian.com>
10482 * cfold.cs (ConstantFold.BinaryFold): Added special support for
10483 comparing StringConstants and NullLiterals in Equality and Inequality.
10485 2004-04-28 Jackson Harper <jackson@ximian.com>
10487 * driver.cs: Attempt to load referenced assemblies from the
10488 GAC. This is the quick and dirty version of this method that
10489 doesnt take into account versions and just takes the first
10490 canidate found. Will be good enough for now as we will not have more
10491 then one version installed into the GAC until I update this method.
10493 2004-04-28 Martin Baulig <martin@ximian.com>
10495 * typemanager.cs (TypeManager.CheckStructCycles): New public
10496 static method to check for cycles in the struct layout.
10498 * rootcontext.cs (RootContext.PopulateTypes): Call
10499 TypeManager.CheckStructCycles() for each TypeContainer.
10500 [Note: We only need to visit each type once.]
10502 2004-04-28 Martin Baulig <martin@ximian.com>
10504 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
10506 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
10507 success and added `out object value'. Use a `bool resolved' field
10508 to check whether we've already been called rather than
10509 `ConstantValue != null' since this breaks for NullLiterals.
10511 2004-04-28 Raja R Harinath <rharinath@novell.com>
10513 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
10514 setting of this flag, since the 'set' method may be non-public.
10516 2004-04-28 Raja R Harinath <rharinath@novell.com>
10518 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
10519 check on current_vector.Block.
10521 2004-04-27 Martin Baulig <martin@ximian.com>
10523 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
10524 a field initializer. Fixes #56459.
10526 2004-04-27 Martin Baulig <martin@ximian.com>
10528 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
10529 we're not attempting to use an indexer. Fixes #52154.
10531 2004-04-27 Martin Baulig <martin@ximian.com>
10533 * statement.cs (Return): Don't create a return label if we don't
10534 need it; reverts my change from January 20th. Thanks to Ben
10537 2004-04-27 Martin Baulig <martin@ximian.com>
10539 According to the spec, `goto' can only leave a nested scope, but
10542 * statement.cs (Block.LookupLabel): Only lookup in the current
10543 block, don't recurse into parent or child blocks.
10544 (Block.AddLabel): Check in parent and child blocks, report
10545 CS0140/CS0158 if we find a duplicate.
10546 (Block): Removed this indexer for label lookups.
10547 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
10548 this already does the error reporting for us.
10551 (FlowBranching.UsageVector.Block): New public variable; may be null.
10552 (FlowBranching.CreateSibling): Added `Block' argument.
10553 (FlowBranching.LookupLabel): New public virtual method. Lookup a
10554 label for the target of a `goto' and check whether we're not
10555 leaving a `finally'.
10557 2004-04-27 Martin Baulig <martin@ximian.com>
10559 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10560 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
10563 2004-04-27 Martin Baulig <martin@ximian.com>
10565 * statement.cs (Block.AddLabel): Also check for implicit blocks
10566 and added a CS0158 check.
10568 2004-04-27 Martin Baulig <martin@ximian.com>
10570 * flowanalysis.cs (FlowBranchingLoop): New class.
10571 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
10572 UsageVector's instead of an ArrayList.
10573 (FlowBranching.Label): Likewise.
10574 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
10575 (FlowBranching.AddBreakVector): New method.
10577 2004-04-27 Miguel de Icaza <miguel@ximian.com>
10579 * attribute.cs: Small regression fix: only convert the type if we
10580 the type is different, fixes System.Drawing build.
10582 2004-04-27 Martin Baulig <martin@ximian.com>
10584 * attribute.cs (Attribute.Resolve): If we have a constant value
10585 for a named field or property, implicity convert it to the correct
10588 2004-04-27 Raja R Harinath <rharinath@novell.com>
10590 * statement.cs (Block.Block): Implicit blocks share
10591 'child_variable_names' fields with parent blocks.
10592 (Block.AddChildVariableNames): Remove.
10593 (Block.AddVariable): Mark variable as "used by a child block" in
10594 every surrounding block.
10595 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
10596 been used in a child block, complain about violation of "Invariant
10597 meaning in blocks" rule.
10598 * cs-parser.jay (declare_local_variables): Don't use
10599 AddChildVariableNames.
10600 (foreach_statement): Don't create an implicit block: 'foreach'
10601 introduces a scope.
10603 2004-04-23 Miguel de Icaza <miguel@ximian.com>
10605 * convert.cs (ImplicitNumericConversion): 0 is also positive when
10606 converting from 0L to ulong. Fixes 57522.
10608 2004-04-22 Marek Safar <marek.safar@seznam.cz>
10610 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
10611 derived class hides via 'new' keyword field from base class (test-242.cs).
10612 TODO: Handle this in the more general way.
10614 * class.cs (CheckBase): Ditto.
10616 2004-04-22 Marek Safar <marek.safar@seznam.cz>
10618 * decl.cs (caching_flags): New member for storing cached values
10620 (MemberCore.Flags): New enum where bit flags for caching_flags
10622 (MemberCore.cls_compliance): Moved to caching_flags.
10623 (DeclSpace.Created): Moved to caching_flags.
10625 * class.cs: Use caching_flags instead of DeclSpace.Created
10627 2004-04-21 Miguel de Icaza <miguel@ximian.com>
10629 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
10630 if we are only a derived class, not a nested class.
10632 * typemanager.cs: Same as above, but do this at the MemberLookup
10633 level (used by field and methods, properties are handled in
10634 PropertyExpr). Allow for the qualified access if we are a nested
10637 2004-04-21 Marek Safar <marek.safar@seznam.cz>
10639 * class.cs: Refactoring.
10640 (IMethodData): New inteface; Holds links to parent members
10641 to avoid member duplication (reduced memory allocation).
10642 (Method): Implemented IMethodData interface.
10643 (PropertyBase): New inner classes for get/set methods.
10644 (PropertyBase.PropertyMethod): Implemented IMethodData interface
10645 (Event): New inner classes for add/remove methods.
10646 (Event.DelegateMethod): Implemented IMethodData interface.
10648 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
10649 EmitContext (related to class.cs refactoring).
10651 2004-04-21 Raja R Harinath <rharinath@novell.com>
10653 * delegate.cs (Delegate.VerifyApplicability): If the number of
10654 arguments are the same as the number of parameters, first try to
10655 verify applicability ignoring any 'params' modifier on the last
10659 2004-04-08 Martin Baulig <martin@ximian.com>
10661 Merged latest changes into gmcs. Please keep this comment in
10662 here, it makes it easier for me to see what changed in MCS since
10663 the last time I merged.
10665 2004-04-16 Raja R Harinath <rharinath@novell.com>
10667 * class.cs (TypeContainer.AddIndexer): Use
10668 'ExplicitInterfaceName' to determine if interface name was
10669 explicitly specified. 'InterfaceType' is not initialized at this time.
10670 (TypeContainer.DefineIndexers): Remove use of temporary list. The
10671 Indexers array is already in the required order. Initialize
10672 'IndexerName' only if there are normal indexers.
10673 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10674 (TypeContainer.Emit): Emit DefaultMember attribute only if
10675 IndexerName is initialized.
10678 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
10680 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10683 2004-04-15 Raja R Harinath <rharinath@novell.com>
10685 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10689 * attribute.cs (Attribute.Resolve): Check for duplicate named
10693 2004-04-15 Miguel de Icaza <miguel@ximian.com>
10695 * iterators.cs (MarkYield): track whether we are in an exception,
10696 and generate code accordingly. Use a temporary value to store the
10697 result for our state.
10699 I had ignored a bit the interaction of try/catch with iterators
10700 since their behavior was not entirely obvious, but now it is
10701 possible to verify that our behavior is the same as MS .NET 2.0
10705 2004-04-14 Miguel de Icaza <miguel@ximian.com>
10707 * iterators.cs: Avoid creating temporaries if there is no work to
10710 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10711 Enumerations, use TypeManager.EnumToUnderlying and call
10714 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10717 (This.Emit): Use EmitContext.EmitThis to emit our
10720 (This.EmitAssign): Ditto.
10722 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
10723 codepaths, we will move all the functionality into
10726 (FieldExpr.EmitAssign): Ditto.
10728 This fixes several hidden bugs that I uncovered while doing a code
10729 review of this today.
10731 * codegen.cs (EmitThis): reworked so the semantics are more clear
10732 and also support value types "this" instances.
10734 * iterators.cs: Changed so that for iterators in value types, we
10735 do not pass the value type as a parameter.
10737 Initialization of the enumerator helpers is now done in the caller
10738 instead of passing the parameters to the constructors and having
10739 the constructor set the fields.
10741 The fields have now `assembly' visibility instead of private.
10743 2004-04-11 Miguel de Icaza <miguel@ximian.com>
10745 * expression.cs (Argument.Resolve): Check if fields passed as ref
10746 or out are contained in a MarshalByRefObject.
10748 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
10749 another compiler type.
10751 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
10753 * class.cs (Indexer.Define): use the new name checking method.
10754 Also, return false on an error.
10755 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
10756 (is_identifier_[start/part]_character): make static.
10758 2004-04-10 Miguel de Icaza <miguel@ximian.com>
10760 * expression.cs (Binary.ResolveOperator): Do no append strings
10761 twice: since we can be invoked more than once (array evaluation)
10762 on the same concatenation, take care of this here. Based on a fix
10763 from Ben (bug #56454)
10765 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
10767 * codegen.cs: Fix another case where CS1548 must be reported (when
10768 delay-sign isn't specified and no private is available #56564). Fix
10769 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
10770 error when MCS is used on the MS runtime and we need to delay-sign
10771 (which seems unsupported by AssemblyBuilder - see #56621).
10773 2004-04-08 Marek Safar <marek.safar@seznam.cz>
10775 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
10776 (TypeManager.ComputeNamespaces): Faster implementation for
10779 * compiler.csproj: Updated AssemblyName to mcs.
10781 2004-05-11 Jackson Harper <jackson@ximian.com>
10783 * Makefile: Preserve MONO_PATH
10785 2004-05-11 Jackson Harper <jackson@ximian.com>
10787 * Makefile: Use mono and mcs to build gmcs
10789 2004-05-03 Miguel de Icaza <miguel@ximian.com>
10791 * codegen.cs: Add patch from Robert Shade
10792 <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
10795 2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
10797 * CryptoConvert.cs: Updated to latest version. Fix issue with
10798 incomplete key pairs (#57941).
10800 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
10802 * codegen.cs: Fix another case where CS1548 must be reported (when
10803 delay-sign isn't specified and no private is available #56564). Fix
10804 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
10805 error when MCS is used on the MS runtime and we need to delay-sign
10806 (which seems unsupported by AssemblyBuilder - see #56621).
10808 2004-04-29 Jackson Harper <jackson@ximian.com>
10810 * Makefile: Set MONO_PATH to use the bootstrap corlib
10811 * driver.cs: Check the GAC for referenced assemblies.
10813 2004-04-29 Martin Baulig <martin@ximian.com>
10815 * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
10817 2004-04-07 Martin Baulig <martin@ximian.com>
10819 * expression.cs (Binary.ResolveOperator): Added special case for
10820 Equality/Inequality between a type parameter and a null literal.
10822 2004-04-07 Martin Baulig <martin@ximian.com>
10824 * convert.cs: Check null literal -> type parameter conversions.
10826 2004-04-07 Martin Baulig <martin@ximian.com>
10828 * generic.cs (ConstructedType.CheckConstraints): Enforce the
10829 `class' and `struct' constraints.
10831 2004-04-07 Martin Baulig <martin@ximian.com>
10833 * generic.cs (SpecialConstraint): New public enum.
10834 (Constraints.Resolve): Added support for the `class' and `struct'
10837 * cs-parser.jay (type_parameter_constraint): Added support for the
10838 `class' and `struct' constraints.
10840 2004-04-07 Martin Baulig <martin@ximian.com>
10842 * support.cs (GenericConstraints): Replaced `Types' by
10843 `ClassConstraint' and `InterfaceConstraints'; added
10844 `HasClassConstraint'.
10846 2004-04-07 Martin Baulig <martin@ximian.com>
10849 (Constraints.InterfaceConstraints): New public property.
10850 (Constraints.Types): Make this property public
10851 (TypeParameter): Implement IMemberContainer.
10852 (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
10853 instead of a TypeBuilder/MethodBuilder; pass the interface
10854 constraints to TypeManager.AddTypeParameter().
10855 (TypeParameter.DefineType): Just take an EmitContext and no
10856 TypeBuilder/MethodBuilder. Use the new public API.
10858 * typemanager.cs (TypeManager.AddTypeParameter): Added
10859 `TypeExpr[]' argument; add the interfaces to the
10860 `builder_to_ifaces' hash.
10861 (TypeManager.LookupMemberContainer): For
10862 GenericTypeParameterBuilders, get the TypeParameter from the
10863 `builder_to_type_param'.
10864 (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
10865 the TypeParameter and call FindMembers on it.
10867 2004-04-07 Martin Baulig <martin@ximian.com>
10870 (MethodCore.GenericMethod): Moved this field here from Method.
10871 (MethodCore.IsDuplicateImplementation): Take the number of type
10872 parameters into account if we're a generic method.
10874 * expression.cs (Invocation.InferTypeArguments): Don't return true
10875 if `arguments' is null; we still need to check whether we actually
10876 don't need to infer anything in this case.
10877 (MemberAccess): Merged the functionality from GenericMemberAccess
10880 * generic.cs (GenericMemberAccess): Removed.
10882 2004-04-05 Martin Baulig <martin@ximian.com>
10884 * decl.cs (MemberCore): For generic classes, interfaces and
10885 structs, `Name' now includes the number of type parameters
10886 ("Stack!1.Node!1").
10887 (DeclSpace.FindType): Removed the `num_type_args' argument; we now
10888 encode the number of type arguments in the type name.
10890 * expression.cs (Expression.MemberLookup): Removed the
10891 `num_type_args' argument; we now encode the number of type
10892 arguments in the type name.
10894 * ecore.cs (SimpleName): Encode the number of type arguments in
10895 the type name itself.
10897 * generic.cs (ConstructedType): Likewise.
10899 * tree.cs (Tree.RecordDecl): Take a `string' instead of a
10900 `MemberName'; we now include the number of type parameters in the
10903 * typemanager.cs (TypeManager.CheckGeneric): Removed.
10904 (TypeManager.MemberLookup): Removed the
10905 `num_type_args' argument; we now encode the number of type
10906 arguments in the type name.
10908 2004-04-03 Martin Baulig <martin@ximian.com>
10910 * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
10911 (MemberCore.MemberName): Moved here from MemberBase.
10912 (DeclSpace.SetParameterInfo): Just take the constraints as an
10913 ArrayList; we already have the type parameters in our
10914 `MemberName'; also do the CS0080 reporting here.
10916 * cs-parser.jay (struct_declaration): Use `member_name' instead of
10917 `IDENTIFIER opt_type_parameter_list'; when constructing our
10918 `MemberName', it'll already include our type parameters.
10919 (class_declaration, interface_declaration): Likewise.
10920 (delegate_declaration): Likewise.
10921 (MakeName): Take a MemberName and return a MemberName.
10922 The following two changes are required to avoid shift/reduce conflicts:
10923 (member_name): Don't include a TypeName anymore; ie. this is now
10924 just 'IDENTIFIER opt_type_parameter_list'.
10925 (property_declaration, event_declaration): Use a
10926 `namespace_or_type_name' instead of a `member_name'.
10928 2004-04-03 Martin Baulig <martin@ximian.com>
10930 * decl.cs (MemberName): Renamed to `TypeName' and created a new
10931 `MemberName' class.
10932 (TypeName): Formerly known as MemberName.
10934 * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
10935 instead of a `MemberName'.
10937 * cs-parser.jay (namespace_or_type_name): Create a TypeName.
10938 (member_name): New rule; create a MemberName.
10940 2004-04-02 Martin Baulig <martin@ximian.com>
10942 * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
10943 (CS0305 and CS0308).
10945 2004-04-02 Martin Baulig <martin@ximian.com>
10947 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
10948 support for nested types.
10950 2004-04-02 Martin Baulig <martin@ximian.com>
10952 * ecore.cs (IAlias): New public interface.
10953 (TypeExpr, TypeExpression): Implement IAlias.
10954 (TypeAliasExpression): New public class.
10956 * namespace.cs (Namespace): Implement IAlias.
10957 (Namespace.Lookup): Return an IAlias instead on an object.
10958 (Namespace.DefineName): Take an IAlias instead of an object.
10959 (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
10961 (NamespaceEntry.UsingAlias): Take a Membername instead of an
10963 (NamespaceEntry.LookupAlias): Return an IAlias instead on an
10965 (NamespaceEntry.Lookup): Likewise.
10967 * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
10970 * decl.cs (DeclSpace): Implement IAlias.
10971 (DeclSpace.LookupAlias): Return an IAlias instead of a string.
10973 * generic.cs (ConstructedType): Improved error checking.
10975 2004-04-02 Martin Baulig <martin@ximian.com>
10977 * convert.cs: Added type parameter conversions.
10980 (UnboxCast.Emit): Emit an `unbox.any' for type params.
10981 (ClassCast.Emit): If the source type is a type parameter, box it.
10982 If the target type is a type parameter, emit an `unbox.any'
10983 instead of a `classcast'.1
10985 2004-04-01 Martin Baulig <martin@ximian.com>
10987 * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
10989 2004-04-01 Martin Baulig <martin@ximian.com>
10991 * generic.cs (ConstructedType.CheckConstraints): Use
10992 Convert.ImplicitStandardConversionExists(); user-defined implicit
10993 conversions are not allowed according to the spec.
10995 2004-03-30 Martin Baulig <martin@ximian.com>
10997 * expression.cs (New): Added support for type parameters.
11000 (TypeManager.activator_type): New public static field.
11001 (TypeManager.activator_create_instance): Likewise.
11003 2004-03-30 Martin Baulig <martin@ximian.com>
11005 * typemanager.cs (TypeManager.HasConstructorConstraint): New
11008 2004-03-30 Martin Baulig <martin@ximian.com>
11010 * generic.cs (ConstructedType.CheckConstraints): Actually follow
11011 the spec here: the argument type must be convertible to the
11014 2004-03-30 Martin Baulig <martin@ximian.com>
11017 (TypeParameter.Define, TypeParameter.DefineMethod): Call
11018 TypeManager.AddTypeParameter().
11019 (ConstructedType.CheckConstraints): Re-enable this and actually
11020 check whether we have a constructor constraint.
11023 (TypeManager.builder_to_type_param): New static field.
11024 (TypeManager.AddTypeParameter): New static method.
11025 (TypeManager.LookupTypeParameter): New public method.
11027 2004-03-30 Martin Baulig <martin@ximian.com>
11029 * generic.cs (TypeParameter.DefineType): Return a boolean and use
11030 the new API to actually define the constructor constraint.
11033 (TypeManager.new_constraint_attr_type): New static field.
11034 (TypeManager.InitCoreTypes): Initialize it.
11036 2004-03-30 Martin Baulig <martin@ximian.com>
11038 * generic.cs (Constraints): Completed error checking, use correct
11041 2004-03-29 Martin Baulig <martin@ximian.com>
11043 * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
11045 * expression.cs (Invocation.InferTypeArguments): Added overloaded
11046 public version which takes a `ParameterData pd' instead of an
11049 2004-03-29 Martin Baulig <martin@ximian.com>
11051 * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
11054 2004-03-29 Martin Baulig <martin@ximian.com>
11056 * expression.cs (Argument.ResolveMethodGroup): If we're a
11057 ConstructedType, call GetMemberAccess() on it.
11059 2004-03-29 Martin Baulig <martin@ximian.com>
11061 * class.cs (MethodBase.CheckGenericOverride): New abstract method.
11062 (MethodCore.CheckGenericOverride): When overriding a generic
11063 method, check whether the constraints match.
11065 * support.cs (GenericConstraints): New public interface.
11066 (ParameterData.GenericConstraints): New public method.
11068 * parameter.cs (Parameter.Resolve): Check whether we're a generic
11069 method parameter and compute our constraints if appropriate.
11070 (Parameter.GenericConstraints): New public property.
11072 * generic.cs (Constraints): Implement GenericConstraints.
11074 2004-03-29 Martin Baulig <martin@ximian.com>
11076 * decl.cs (MemberCache.FindMemberToOverride): Use
11077 `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
11079 2004-03-29 Martin Baulig <martin@ximian.com>
11081 * generic.cs (GenericMethod.Define): Resolve our type parameters.
11083 2004-03-29 Martin Baulig <martin@ximian.com>
11085 * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
11086 not allowed on non-generic declarations").
11088 2004-03-29 Martin Baulig <martin@ximian.com>
11090 * expression.cs (Invocation.InferTypeArguments): Added overloaded
11091 public version of this method.
11093 * class.cs (MethodCore.IsDuplicateImplementation): Use
11094 Invocation.InferTypeArguments() to check this.
11096 2004-03-29 Martin Baulig <martin@ximian.com>
11098 * convert.cs: Use TypeManager.IsDelegateType() instead of
11099 comparing types correctly.
11101 2004-03-29 Martin Baulig <martin@ximian.com>
11103 * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
11104 types directly to make it work for generic instances.
11106 * typemanager.cs (TypeManager.IsSubclassOf): New static method.
11108 2004-03-29 Martin Baulig <martin@ximian.com>
11110 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
11111 support for arrays.
11113 2004-03-24 Martin Baulig <martin@ximian.com>
11115 * decl.cs (DeclSpace.FindType): Also use
11116 TypeManager.CheckGeneric() for types from the using clauses.
11118 2004-03-23 Martin Baulig <martin@ximian.com>
11120 * expression.cs (Invocation.OverloadResolve): Added `bool
11121 may_fail' argument and use it instead of the Location.IsNull() hack.
11123 2004-03-23 Martin Baulig <martin@ximian.com>
11125 * expression.cs (Invocation.InferType): Use correct type inference
11128 2004-03-23 Martin Baulig <martin@ximian.com>
11130 * ecore.cs (MethodGroupExpr.Name): Use
11131 TypeManager.CSharpSignature() instead of just the name.
11133 * expression.cs (Invocation.OverloadResolve): Provide better error
11135 (Invocation.DoResolve): OverloadResolve() never returns null
11136 without reporting an error, so removed the error -6 reporting here.
11138 2004-03-23 Martin Baulig <martin@ximian.com>
11140 * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
11143 * cs-parser.jay (delegate_declaration): Support generic delegates.
11145 * delegate.cs: Support generic delegates.
11147 2004-03-22 Martin Baulig <martin@ximian.com>
11149 * expression.cs (Invocation.InferParamsTypeArguments): New static
11150 method; does type inference for params arguments.
11152 2004-03-21 Martin Baulig <martin@ximian.com>
11154 * typemanager.cs (TypeManager.IsGenericMethod): New public static
11155 method; checks whether a method is a generic method.
11157 * expression.cs (Invocation.InferTypeArguments): New static method;
11158 infer type arguments for generic method invocation.
11160 * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
11161 property; we set this to true if we're resolving a generic method
11162 invocation and the user specified type arguments, ie. we're not
11163 doing type inference.
11165 2004-03-20 Martin Baulig <martin@ximian.com>
11167 * class.cs (MethodData.DeclaringType): New public property.
11168 (MethodData.Define): Set DeclaringType here.
11169 (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
11170 instead of OperatorMethodBuilder.DeclaringType.
11172 2004-03-20 Martin Baulig <martin@ximian.com>
11174 * cs-tokenizer.cs (xtoken): Return a special
11175 Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
11177 * cs-parser.jay (default_value_expression): Switch to the new
11180 2004-03-19 Martin Baulig <martin@ximian.com>
11182 * decl.cs (MemberName): New class. We use this to "construct"
11183 namespace_or_type_name's.
11185 * generics.cs (TypeArguments.GetDeclarations): New public method;
11186 returns the type arguments as a string[] and reports a CS0081 if
11187 one of them is not an identifier.
11189 * class.cs (MemberBase): The .ctor now takes the name as a
11190 MemberName instead of a string.
11191 (MemberBase.ExplicitInterfaceName): Changed type from string to
11193 (MemberBase.DoDefine): If we're an explicit implementation, the
11194 InterfaceType may be a generic instance.
11196 * cs-parser.jay (namespace_or_type_name): Return a MemberName.
11197 (namespace_name): Call MemberName.GetName () to transform the
11198 MemberName into a string and ensure we don't have any type
11200 (type_name): Call MemberName.GetTypeExpression() to transfrom the
11201 MemberName into an expression.
11202 (method_header): Use namespace_or_type_name instead of member_name.
11204 2004-04-07 Miguel de Icaza <miguel@ximian.com>
11206 * rootcontext.cs: Add new types to the boot resolution.
11208 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
11209 MulticastDelegate is not allowed.
11211 * typemanager.cs: Add new types to lookup: System.TypedReference
11214 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
11215 check for TypedReference or ArgIterator, they are not allowed.
11217 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
11218 makes us properly catch 1510 in some conditions (see bug 56016 for
11221 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
11223 * CryptoConvert.cs: update from corlib version
11226 2004-04-05 Miguel de Icaza <miguel@ximian.com>
11228 * class.cs (Indexer.Define): Check indexername declaration
11230 2004-04-05 Marek Safar <marek.safar@seznam.cz>
11232 * attribute.cs (IsClsCompliant): Fixed problem with handling
11233 all three states (compliant, not-compliant, undetected).
11235 2004-03-30 Marek Safar <marek.safar@seznam.cz>
11237 * attribute.cs (Attribute): Location is now public.
11238 (Resolve): Store resolved arguments (pos_values) in attribute class.
11239 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
11240 (GetClsCompliantAttributeValue): New method that gets
11241 CLSCompliantAttribute value.
11242 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
11243 if exists else null.
11244 (AttributeTester): New class for CLS-Compliant verification routines.
11246 * class.cs (Emit): Add CLS-Compliant verification.
11247 (Method.GetSignatureForError): Implemented.
11248 (Constructor.GetSignatureForError): Implemented
11249 (Constructor.HasCompliantArgs): Returns if constructor has
11250 CLS-Compliant arguments.
11251 (Constructor.Emit): Override.
11252 (Construcor.IsIdentifierClsCompliant): New method; For constructors
11253 is needed to test only parameters.
11254 (FieldBase.GetSignatureForError): Implemented.
11255 (TypeContainer): New member for storing base interfaces.
11256 (TypeContainer.FindMembers): Search in base interfaces too.
11258 * codegen.cs (GetClsComplianceAttribute): New method that gets
11259 assembly or module CLSCompliantAttribute value.
11260 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
11262 (ModuleClass.Emit): Add error 3012 test.
11264 * const.cs (Emit): Override and call base for CLS-Compliant tests.
11266 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
11267 state for all decl types.
11268 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
11269 if CLS-Compliant tests are required.
11270 (IsClsCompliaceRequired): New method. Analyze whether code
11271 must be CLS-Compliant.
11272 (IsExposedFromAssembly): New method. Returns true when MemberCore
11273 is exposed from assembly.
11274 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
11275 value or gets cached value.
11276 (HasClsCompliantAttribute): New method. Returns true if MemberCore
11277 is explicitly marked with CLSCompliantAttribute.
11278 (IsIdentifierClsCompliant): New abstract method. This method is
11279 used to testing error 3005.
11280 (IsIdentifierAndParamClsCompliant): New method. Common helper method
11281 for identifier and parameters CLS-Compliant testing.
11282 (VerifyClsCompliance): New method. The main virtual method for
11283 CLS-Compliant verifications.
11284 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
11285 null. I don't know why is null (too many public members !).
11286 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
11287 and get value of first CLSCompliantAttribute that found.
11289 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
11290 (VerifyClsCompliance): Override and add extra tests.
11292 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
11293 clscheck- disable CLS-Compliant verification event if assembly is has
11294 CLSCompliantAttribute(true).
11296 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
11297 ApllyAttribute is now called in emit section as in the other cases.
11298 Possible future Emit integration.
11299 (IsIdentifierClsCompliant): New override.
11300 (VerifyClsCompliance): New override.
11301 (GetEnumeratorName): Returns full enum name.
11303 * parameter.cs (GetSignatureForError): Implemented.
11305 * report.cs (WarningData): New struct for Warning message information.
11306 (LocationOfPreviousError): New method.
11307 (Warning): New method. Reports warning based on the warning table.
11308 (Error_T): New method. Reports error based on the error table.
11310 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
11311 verifications are done here.
11313 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
11315 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
11316 CLSCompliantAttribute.
11317 (all_imported_types): New member holds all imported types from other
11319 (LoadAllImportedTypes): New method fills static table with exported types
11320 from all referenced assemblies.
11321 (Modules): New property returns all assembly modules.
11323 2004-03-30 Miguel de Icaza <miguel@ximian.com>
11325 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
11326 throwing a parser error.
11328 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
11329 which removes the hardcoded get_/set_ prefixes for properties, as
11330 IL allows for the properties to be named something else.
11334 * expression.cs: Do not override operand before we know if it is
11335 non-null. Fix 56207
11337 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
11339 * typemanager.cs: support for pinned variables.
11341 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
11343 * decl.cs, typemanager.cs: Avoid using an arraylist
11344 as a buffer if there is only one result set.
11346 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
11348 * expression.cs: Make sure you cant call a static method
11349 with an instance expression, bug #56174.
11351 2004-03-29 Miguel de Icaza <miguel@ximian.com>
11353 * class.cs (IsDuplicateImplementation): Improve error reporting to
11354 flag 663 (method only differs in parameter modifier).
11356 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
11357 in preprocessor directives.
11359 * location.cs (LookupFile): Allow for the empty path.
11361 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
11362 better approach for some of that patch, but its failing with the
11363 CharSet enumeration. For now try/catch will do.
11365 * typemanager.cs: Do not crash if a struct does not have fields.
11368 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
11370 * expression.cs: cs0213, cant fix a fixed expression.
11373 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
11375 * cs-parser.jay: detect invalid embeded statements gracefully.
11378 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
11380 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
11383 the invocation type may not be a subclass of the tye of the item/
11384 The type of the item must be a subclass of the invocation item.
11389 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
11391 * attribute.cs: Added methods to get a string and a bool from an
11392 attribute. Required to information from AssemblyKeyFileAttribute,
11393 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
11394 * codegen.cs: Modified AssemblyName creation to include support for
11395 strongnames. Catch additional exceptions to report them as CS1548.
11396 * compiler.csproj: Updated include CryptoConvert.cs.
11397 * compiler.csproj.user: Removed file - user specific configuration.
11398 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
11399 Mono.Security assembly. The original class is maintained and tested in
11400 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
11401 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
11402 like CSC 8.0 (C# v2) supports.
11403 * Makefile: Added CryptoConvert.cs to mcs sources.
11404 * rootcontext.cs: Added new options for strongnames.
11406 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
11408 * driver.cs: For --expect-error, report error code `2'
11409 if the program compiled with no errors, error code `1' if
11410 it compiled with an error other than the one expected.
11412 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
11414 * compiler.csproj: Updated for Visual Studio .NET 2003.
11415 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
11416 * compiler.sln: Updated for Visual Studio .NET 2003.
11418 2004-03-24 Ravi Pratap M <ravi@ximian.com>
11420 * expression.cs: Fix bug #47234. We basically need to apply the
11421 rule that we prefer the conversion of null to a reference type
11422 when faced with a conversion to 'object' (csc behaviour).
11424 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11426 * statement.cs: Shorter form for foreach, eliminates
11427 a local variable. r=Martin.
11429 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11431 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
11432 checks if we can use brtrue/brfalse to test for 0.
11433 * expression.cs: use the above in the test for using brtrue/brfalse.
11434 cleanup code a bit.
11436 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11438 * expression.cs: Rewrite string concat stuff. Benefits:
11440 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
11441 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
11442 rather than a concat chain.
11444 * typemanager.cs: Add lookups for more concat overloads.
11446 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11448 * expression.cs: Emit shorter il code for array init.
11465 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
11467 * statement.cs: Before, two switch blocks would be merged if the
11468 total size of the blocks (end_item - begin_item + 1) was less than
11469 two times the combined sizes of the blocks.
11471 Now, it will only merge if after the merge at least half of the
11476 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
11478 * class.cs : csc build fix for GetMethods(). See bug #52503.
11480 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
11482 * expression.cs: Make sure fp comparisons work with NaN.
11483 This fixes bug #54303. Mig approved this patch a long
11484 time ago, but we were not able to test b/c the runtime
11487 2004-03-19 Miguel de Icaza <miguel@ximian.com>
11489 * ecore.cs (TypExpr.GetHashCode): implement this overload.
11491 2004-03-19 Martin Baulig <martin@ximian.com>
11493 * class.cs (MemberCore.IsDuplicateImplementation): Check whether
11494 two overloads may unify for some type parameter substitutions and
11495 report a CS0408 if appropriate.
11497 2004-03-19 Martin Baulig <martin@ximian.com>
11499 * class.cs (MemberCore.IsDuplicateImplementation): Report the
11500 error here and not in our caller.
11502 2004-03-19 Martin Baulig <martin@ximian.com>
11504 * interface.cs: Completely killed this file.
11505 (Interface): We're now a TypeContainer and live in class.cs.
11507 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
11508 argument; we're now also called for interfaces.
11509 (TypeContainer.DefineMembers): Allow this method being called
11511 (TypeContainer.GetMethods): New public method; formerly known as
11512 Interface.GetMethod(). This is used by PendingImplementation.
11513 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
11514 it's now private and non-static.
11515 (Interface): Moved this here; it's now implemented similar to
11517 (Method, Property, Event, Indexer): Added `bool is_interface'
11518 argument to their .ctor's.
11519 (MemberBase.IsInterface): New public field.
11521 * cs-parser.jay: Create normal Method, Property, Event, Indexer
11522 instances instead of InterfaceMethod, InterfaceProperty, etc.
11523 (opt_interface_base): Removed; we now use `opt_class_base' instead.
11524 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
11526 2004-03-19 Martin Baulig <martin@ximian.com>
11528 * class.cs (MethodCore.IsDuplicateImplementation): New private
11529 method which does the CS0111 checking.
11530 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
11531 Use IsDuplicateImplementation().
11533 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
11535 * decl.cs (FindMemberToOverride): New method to find the correct
11536 method or property to override in the base class.
11538 - Make Method/Property use the above method to find the
11539 version in the base class.
11540 - Remove the InheritableMemberSignatureCompare as it is now
11543 This patch makes large code bases much faster to compile, as it is
11544 O(n) rather than O(n^2) to do this validation.
11546 Also, it fixes bug 52458 which is that nested classes are not
11547 taken into account when finding the base class member.
11549 Reviewed/Approved by Martin.
11551 2004-03-17 Martin Baulig <martin@ximian.com>
11553 * expression.cs (MemberAccess.DoResolve): Take the parent's number
11554 of type arguments into account; use the `real_num_type_args'
11555 approach like in DoResolveAsTypeStep().
11557 * generic.cs (GenericMemberAccess.DoResolve): Make this work for
11560 2004-03-17 Marek Safar <marek.safar@seznam.cz>
11562 * interface.cs: In all interface classes removed redundant
11563 member initialization.
11565 2004-03-16 Martin Baulig <martin@ximian.com>
11567 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11569 2004-03-15 Miguel de Icaza <miguel@ximian.com>
11571 * decl.cs (DefineTypeAndParents): New helper method to define a
11572 type's containers before the type itself is defined; This is a
11573 bug exposed by the recent changes to Windows.Forms when an
11574 implemented interface was defined inside a class that had not been
11577 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
11579 (Check): Loop correctly to report errors modifiers
11580 (UNSAFE was not in the loop, since it was the same as TOP).
11582 * interface.cs: Every interface member now takes a ModFlags,
11583 instead of a "is_new" bool, which we set on the base MemberCore.
11585 Every place where we called "UnsafeOk" in the interface, now we
11586 call the proper member (InterfaceMethod.UnsafeOK) instead to get
11587 the unsafe settings from the member declaration instead of the
11588 container interface.
11590 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
11592 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11593 `set_indexer_name' to the pending bits (one per type).
11595 We fixed a bug today that was picking the wrong method to
11596 override, since for properties the existing InterfaceMethod code
11597 basically ignored the method name. Now we make sure that the
11598 method name is one of the valid indexer names.
11600 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
11602 * support.cs (SeekableStreamReader): Keep track of stream byte
11603 positions and don't mix them with character offsets to the buffer.
11605 Patch from Gustavo Giráldez
11607 2004-03-15 Marek Safar <marek.safar@seznam.cz>
11609 * interface.cs (InterfaceSetGetBase): Removed double member
11610 initialization, base class does it as well.
11612 2004-03-13 Martin Baulig <martin@ximian.com>
11614 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
11615 when compiling corlib.
11617 2004-03-13 Miguel de Icaza <miguel@ximian.com>
11619 * convert.cs (ExplicitConversion): We were reporting an error on
11620 certain conversions (object_type source to a value type, when the
11621 expression was `null') before we had a chance to pass it through
11622 the user defined conversions.
11624 * driver.cs: Replace / and \ in resource specifications to dots.
11627 * class.cs: Add check for duplicate operators. Fixes 52477
11629 2004-03-11 Miguel de Icaza <miguel@ximian.com>
11631 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
11632 that are in the middle of the statements, not only at the end.
11635 * class.cs (TypeContainer.AddField): No longer set the
11636 `HaveStaticConstructor' flag, now we call it
11637 `UserDefineStaticConstructor' to diferentiate the slightly
11638 semantic difference.
11640 The situation is that we were not adding BeforeFieldInit (from
11641 Modifiers.TypeAttr) to classes that could have it.
11642 BeforeFieldInit should be set to classes that have no static
11647 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
11649 And most importantly Zoltan's comment:
11651 http://bugzilla.ximian.com/show_bug.cgi?id=44229
11653 "I think beforefieldinit means 'it's ok to initialize the type sometime
11654 before its static fields are used', i.e. initialization does not need
11655 to be triggered by the first access to the type. Setting this flag
11656 helps the JIT to compile better code, since it can run the static
11657 constructor at JIT time, and does not need to generate code to call it
11658 (possibly lots of times) at runtime. Unfortunately, mcs does not set
11659 this flag for lots of classes like String.
11661 csc sets this flag if the type does not have an explicit static
11662 constructor. The reasoning seems to be that if there are only static
11663 initalizers for a type, and no static constructor, then the programmer
11664 does not care when this initialization happens, so beforefieldinit
11667 This bug prevents the AOT compiler from being usable, since it
11668 generates so many calls to mono_runtime_class_init that the AOT code
11669 is much slower than the JITted code. The JITted code is faster,
11670 because it does not generate these calls if the vtable is type is
11671 already initialized, which is true in the majority of cases. But the
11672 AOT compiler can't do this."
11674 2004-03-10 Miguel de Icaza <miguel@ximian.com>
11676 * class.cs (MethodData.Emit): Refactor the code so symbolic
11677 information is generated for destructors; For some reasons we
11678 were taking a code path that did not generate symbolic information
11681 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
11683 * class.cs: Create a Constructor.CheckBase method that
11684 takes care of all validation type code. The method
11685 contains some code that was moved from Define.
11687 It also includes new code that checks for duplicate ctors.
11688 This fixes bug #55148.
11690 2004-03-09 Joshua Tauberer <tauberer@for.net>
11692 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
11693 a { ... }-style array creation invokes EmitStaticInitializers
11694 which is not good for reference-type arrays. String, decimal
11695 and now null constants (NullCast) are not counted toward
11696 static initializers.
11698 2004-03-05 Martin Baulig <martin@ximian.com>
11700 * location.cs (SourceFile.HasLineDirective): New public field;
11701 specifies whether the file contains or is referenced by a "#line"
11703 (Location.DefineSymbolDocuments): Ignore source files which
11704 either contain or are referenced by a "#line" directive.
11706 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
11708 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
11709 direct access to our parent, so check the method inline there.
11711 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
11713 * expression.cs (Invocation.EmitCall): Miguel's last commit
11714 caused a regression. If you had:
11719 In Foo the implict this would be null.
11721 2004-02-27 Miguel de Icaza <miguel@ximian.com>
11723 * expression.cs (Invocation.EmitCall): If the method is not
11724 virtual, do not emit a CallVirt to it, use Call.
11726 * typemanager.cs (GetFullNameSignature): Improve the method to
11727 cope with ".ctor" and replace it with the type name.
11729 * class.cs (ConstructorInitializer.Resolve): Now the method takes
11730 as an argument the ConstructorBuilder where it is being defined,
11731 to catch the recursive constructor invocations.
11733 2004-03-16 Martin Baulig <martin@ximian.com>
11735 * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
11736 ConstructedType, call ResolveType() on it to get the type rather
11737 than just using `expr.Type'.
11739 2004-03-16 Martin Baulig <martin@ximian.com>
11741 * generics.cs (ConstructedType.GetMemberAccess): Take the
11742 EmitContext instead on the TypeExpr and use
11743 ec.TypeContainer.CurrentType/ec.ContainerType.
11745 2004-03-16 Martin Baulig <martin@ximian.com>
11747 * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
11748 parameters before aliases.
11750 2004-03-16 Martin Baulig <martin@ximian.com>
11752 * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
11753 New oublic function; checks whether two generic instances may become
11754 equal under some instantiations (26.3.1).
11756 * class.cs (TypeContainer.Define): Call
11757 TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
11760 2004-03-16 Martin Baulig <martin@ximian.com>
11762 * class.cs (TypeContainer.GetClassBases): Moved
11763 Error_TypeParameterAsBase() here and also check whether the base
11764 class is not an attribute.
11766 2004-03-16 Martin Baulig <martin@ximian.com>
11768 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11770 2004-03-16 Martin Baulig <martin@ximian.com>
11772 * class.cs (Error_TypeParameterAsBase): Use correct error number
11775 2004-03-16 Martin Baulig <martin@ximian.com>
11777 * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
11780 * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
11783 2004-03-15 Martin Baulig <martin@ximian.com>
11785 * typemanager.cs (TypeManager.GetFullName): New public method.
11786 (TypeManager.MemberLookup): Added `int_num_type_arguments'
11787 argument; only return members with the correct number of type
11789 (TypeManager.CheckGeneric): Allow -1 to bypass the check.
11790 (TypeManager.FilterWithClosure): Call CheckGeneric() to check
11791 whether the number of type arguments matches.
11793 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
11794 not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
11796 * expression.cs (MemberAccess): Added public `NumTypeArguments'
11797 field; it's set by the protected .ctor when we're actually a
11798 GenericMemberAccess.
11799 (MemberAccess.ResolveAsTypeStep): Compute the total number of type
11800 arguments and pass it to MemberLookupFinal ().
11802 * ecore.cs (Expression.MemberLookup): Added `int
11803 num_type_arguments' argument; only return members with the correct
11804 number of type arguments.
11805 (Expression.MemberLookupFailed): Check whether the MemberLookup
11806 failed because we did not have the correct number of type
11807 arguments; report CS0305 in this case.
11809 * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
11810 `e.ResolveAsTypeTerminal()' already did so.
11812 2004-03-15 Martin Baulig <martin@ximian.com>
11814 * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
11815 we're a ConstructedType; in this case, the caller must report an
11816 error (for instance CS0131).
11818 * generic.cs (TypeArguments): Added Location argument to the .ctor.
11819 (TypeArguments.Resolve): Actually report errors here.
11821 2004-03-15 Miguel de Icaza <miguel@ximian.com>
11823 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11824 `set_indexer_name' to the pending bits (one per type).
11826 We fixed a bug today that was picking the wrong method to
11827 override, since for properties the existing InterfaceMethod code
11828 basically ignored the method name. Now we make sure that the
11829 method name is one of the valid indexer names.
11831 2004-03-15 Martin Baulig <martin@ximian.com>
11833 * typemanager.cs (TypeManager.IndexerPropertyName): Added support
11834 for generic instances.
11836 2004-03-13 Martin Baulig <martin@ximian.com>
11838 * class.cs (TypeContainer.DefineType): Call
11839 TypeManager.AddUserType() immediately after creating the
11840 TypeBuilder; pass all type parameters when creating the
11843 * decl.cs (DeclSpace.FindNestedType): New public method.
11844 (DeclSpace.FindType): Added `int num_type_args' argument; only
11845 return types with the correct number of type parameters.
11846 (DeclSpace.CountTypeParams): New public property.
11848 * ecore.cs (SimpleName.ctor): Added overloaded version which takes
11849 the number of type parameters; defaults to zero.
11851 * generic.cs (TypeArguments.Count): New public property.
11852 (ConstructedType.DoResolveAsTypeStep): First call
11853 ds.FindNestedType() to find out whether we're nested in the
11854 current generic type; in this case, we inherit all type parameters
11855 from the current class.
11857 * rootcontext.cs (RootContext.NamespaceLookup): Added `int
11858 num_type_args' argument.
11859 (RootContext.LookupType): Added overloaded version which takes the
11860 number of type arguments; only return types with the correct
11861 number of type arguments.
11863 * typemanager.cs (TypeManager.CheckGeneric): New public function;
11864 checks whether `Type t' has `int num_type_args'.
11866 2004-03-13 Martin Baulig <martin@ximian.com>
11868 * generic.cs (GenericMethod.DefineType): New method; calls
11869 DefineType() on all the type parameters.
11871 * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
11872 (MethodData.Define): If we're a generic method, call
11873 GenericMethod.DefineType() to define the type parameters.
11875 2004-03-10 Martin Baulig <martin@ximian.com>
11877 * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
11878 instead of IsAssignableFrom.
11880 2004-03-10 Martin Baulig <martin@ximian.com>
11882 * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
11884 * support.cs (ParameterData.HasArrayParameter): New property.
11885 (ReflectionParameters.ctor): Take a MethodBase instead of a
11886 ParameterInfo[]. If we have any type parameters, get the generic
11887 method definition and ask it whether we have variable arguments.
11889 2004-02-26 Miguel de Icaza <miguel@ximian.com>
11891 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11892 routines to check if a type is an enumerable/enumerator allow
11893 classes that implement the IEnumerable or IEnumerator interfaces.
11895 * class.cs (Property, Operator): Implement IIteratorContainer, and
11896 implement SetYields.
11898 (Property.Define): Do the block swapping for get_methods in the
11899 context of iterators. We need to check if Properties also
11900 include indexers or not.
11902 (Operator): Assign the Block before invoking the
11903 OperatorMethod.Define, so we can trigger the Iterator code
11906 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
11907 Property and Operator classes are not created when we parse the
11908 declarator but until we have the block completed, so we use a
11909 singleton SimpleIteratorContainer.Simple to flag whether the
11910 SetYields has been invoked.
11912 We propagate this setting then to the Property or the Operator to
11913 allow the `yield' to function.
11915 2004-02-25 Marek Safar <marek.safar@seznam.cz>
11917 * codegen.cs: Implemented attribute support for modules.
11918 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11919 Assembly/Module functionality.
11921 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11922 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11923 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11925 2004-02-16 Marek Safar <marek.safar@seznam.cz>
11927 * interface.cs (FindMembers): The operation is performed on all base
11928 interfaces and not only on the first. It is required for future CLS Compliance patch.
11930 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
11932 * statement.cs, codegen.cs:
11933 This patch deals with patterns such as:
11935 public class List : IEnumerable {
11937 public MyEnumerator GetEnumerator () {
11938 return new MyEnumerator(this);
11941 IEnumerator IEnumerable.GetEnumerator () {
11945 public struct MyEnumerator : IEnumerator {
11950 Before, there were a few things we did wrong:
11951 1) we would emit callvirt on a struct, which is illegal
11952 2) we emited ldarg when we needed to emit ldarga
11953 3) we would mistakenly call the interface methods on an enumerator
11954 type that derived from IEnumerator and was in another assembly. For example:
11956 public class MyEnumerator : IEnumerator
11958 Would have the interface methods called, even if there were public impls of the
11959 method. In a struct, this lead to invalid IL code.
11961 2004-02-11 Marek Safar <marek.safar@seznam.cz>
11963 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11966 * delegate.cs (Define): Fixed crash when delegate type is undefined.
11968 2004-02-11 Miguel de Icaza <miguel@ximian.com>
11970 * cs-parser.jay: Fix small regression: we were not testing V2
11971 compiler features correctly.
11973 * interface.cs: If the emit context is null, then create one
11975 2004-02-09 Marek Safar <marek.safar@seznam.cz>
11977 * decl.cs (GetSignatureForError): New virtual method to get full name
11978 for error messages.
11980 * attribute.cs (IAttributeSupport): New interface for attribute setting.
11981 Now it is possible to rewrite ApplyAttributes method to be less if/else.
11983 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11984 Duplicated members and code in these classes has been removed.
11985 Better encapsulation in these classes.
11987 2004-02-07 Miguel de Icaza <miguel@ximian.com>
11989 * assign.cs (Assign.DoResolve): When dealing with compound
11990 assignments, there is a new rule in ECMA C# 2.4 (might have been
11991 there before, but it is documented here) that states that in:
11995 If b is of type int, and the `op' is a shift-operator, then the
11996 above is evaluated as:
12000 * expression.cs (Binary.ResolveOperator): Instead of testing for
12001 int/uint/long/ulong, try to implicitly convert to any of those
12002 types and use that in pointer arithmetic.
12004 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
12005 method to print information for from the type, not from the
12006 null-method we were given.
12008 2004-02-01 Duncan Mak <duncan@ximian.com>
12010 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
12011 parsing for cmd, fixes bug #53694.
12013 2004-02-04 Marek Safar <marek.safar@seznam.cz>
12015 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
12016 in the member name duplication tests. Property and operator name duplication
12017 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
12019 2004-02-03 Marek Safar <marek.safar@seznam.cz>
12021 * interface.cs (PopulateMethod): Fixed crash when interface method
12022 returns not existing type (error test cs0246-3.cs).
12024 2004-02-02 Ravi Pratap M <ravi@ximian.com>
12026 * cs-parser.jay (interface_accessors): Re-write actions to also
12027 store attributes attached to get and set methods. Fix spelling
12030 (inteface_property_declaration): Modify accordingly.
12032 (InterfaceAccessorInfo): New helper class to store information to pass
12033 around between rules that use interface_accessors.
12035 * interface.cs (Emit): Apply attributes on the get and set
12036 accessors of properties and indexers too.
12038 * attribute.cs (ApplyAttributes): Modify accordingly to use the
12039 right MethodBuilder when applying attributes to the get and set accessors.
12041 2004-01-31 Miguel de Icaza <miguel@ximian.com>
12043 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
12045 2004-01-26 Miguel de Icaza <miguel@ximian.com>
12047 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
12049 2004-01-25 Miguel de Icaza <miguel@ximian.com>
12051 * cs-parser.jay: Remove YIELD token, instead use the new grammar
12052 changes that treat `yield' specially when present before `break'
12053 or `return' tokens.
12055 * cs-tokenizer.cs: yield is no longer a keyword.
12057 2004-01-23 Marek Safar <marek.safar@seznam.cz>
12059 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
12060 setting for default constructors.
12061 For default constructors are almost every time set wrong Modifier. The
12062 generated IL code has been alright. But inside mcs this values was
12063 wrong and this was reason why several of my CLS Compliance tests
12066 2004-02-27 Martin Baulig <martin@ximian.com>
12068 * generics.cs (ConstructedType.ResolveType): Make the nested type
12069 stuff actually work.
12071 2004-02-25 Martin Baulig <martin@ximian.com>
12073 * decl.cs (DeclSpace.CurrentTypeParameters): New protected
12074 property; returns the type parameters just from the current type,
12075 ie. with the ones from outer classes.
12076 (DeclSpace.LookupGeneric): First search in the current class, then
12078 (DeclSpace.initialize_type_params): When hiding a type parameter
12079 from an outer class, put it into the `type_param_list' anyways.
12081 * expression.cs (MemberAccess.expr): Made this field protected.
12083 * class.cs (TypeContainer.Define): The `CurrentType' just contains
12084 the type parameters from the current class.
12086 * generic.cs (ConstructedType.ResolveType): Support nested generic
12087 types by taking the type parameters which we inherit from outer
12088 classes into account.
12089 (GenericMemberAccess.ResolveAsTypeStep): Override this and added
12090 support for nested generic types.
12092 2004-02-23 Martin Baulig <martin@ximian.com>
12094 * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
12095 field and check whether we're nested inside a generic type.
12096 (DeclSpace.ResolveType): If we're resolving to a generic type
12097 definition, create a ConstructedType and return its resolved type.
12098 (DeclSpace.initialize_type_params): New private method;
12099 initializes the `type_param_list' field from the type parameters
12100 from this and all enclosing classes.
12101 (DeclSpace.TypeParameters): Call initialize_type_params() unless
12102 we're already initialized.
12104 2004-02-23 Martin Baulig <martin@ximian.com>
12106 * class.cs (Method.Define): Create the generic method before
12107 calling DoDefine().
12108 (Memberbase.DoDefine): Added DeclSpace argument (in addition to
12109 the TypeContainer one); we use this for generic methods.
12111 * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
12112 parent's TypeBuilder.
12114 2004-02-18 Martin Baulig <martin@ximian.com>
12116 * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
12117 to check for equality.
12119 2004-02-05 Martin Baulig <martin@ximian.com>
12121 * ecore.cs (FieldExpr.DoResolveLValue): If we have an
12122 `ec.TypeContainer.CurrentType', use it instead of
12123 `ec.ContainerType' to check whether we're in the type's ctor.
12125 2004-01-29 Martin Baulig <martin@ximian.com>
12127 * expression.cs (Invocation.DoResolve): If we're a
12128 `ConstructedType', then we're actually a generic method, so
12129 rewrite the expr as a GenericMemberAccess.
12131 * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
12132 here; manually parse it into a string.
12134 2004-01-28 Martin Baulig <martin@ximian.com>
12136 * typemanager.cs (TypeManager.IsEqual): New static method.
12137 (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
12138 check for equality instead of using `=='.
12140 2004-01-26 Martin Baulig <martin@ximian.com>
12142 * decl.cs (DeclSpace.CurrentType): New public field.
12144 * expression.cs (This.ResolveBase): If we have an
12145 `ec.TypeContainer.CurrentType', use it instead of
12146 `ec.ContainerType'.
12148 * class.cs (TypeContainer.DefineType): If we're a generic type,
12149 create the `CurrentType' (unresolved).
12150 (TypeContainer.GenericType): New private field.
12151 (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
12152 it and store it in `GenericType' before creating the MemberCache.
12153 (TypeContainer.GetMembers): If we have a `GenericType', call
12154 TypeManager.FindMembers() on it.
12156 * interface.cs (Interface.GenericType): New private field.
12157 (Interface.DefineType): If we're a generic type, create the
12158 `CurrentType' (unresolved).
12159 (Interface.DefineMembers): If we have a `CurrentType', resolve it
12160 and store it in `GenericType' before creating the MemberCache.
12161 (Interface.GetMembers): If we have a `GenericType', call
12162 TypeManager.FindMembers() on it.
12164 2004-01-22 Martin Baulig <martin@ximian.com>
12166 * cs-parser.jay (namespace_or_type_name): Return an Expression,
12167 not a QualifiedIdentifier. This is what `type_name_expression'
12168 was previously doing.
12169 (type_name_expression): Removed; the code is now in
12170 `namespace_or_type_name'.
12171 (qualified_identifier): Removed, use `namespace_or_type_name'
12173 (QualifiedIdentifier): Removed this class.
12175 2004-01-22 Martin Baulig <martin@ximian.com>
12177 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
12178 not a string as alias name.
12180 2004-01-21 Miguel de Icaza <miguel@ximian.com>
12182 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
12183 #52730 bug, and instead compute correctly the need to use a
12184 temporary variable when requesting an address based on the
12185 static/instace modified of the field and the constructor.
12187 2004-01-21 Martin Baulig <martin@ximian.com>
12189 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
12190 class and namespace before looking up aliases. Fixes #52517.
12192 2004-01-21 Martin Baulig <martin@ximian.com>
12194 * flowanalysis.cs (UsageVector.Merge): Allow variables being
12195 assinged in a 'try'; fixes exception4.cs.
12197 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12198 * class.cs : Implemented parameter-less constructor for TypeContainer
12200 * decl.cs: Attributes are now stored here. New property OptAttributes
12202 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
12204 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
12206 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12208 * typemanager.cs (CSharpSignature): Now reports also inner class name.
12209 (CSharpSignature): New method for indexer and property signature.
12211 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12213 * pending.cs (IsVirtualFilter): Faster implementation.
12215 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12217 * typemanager.cs: Avoid inclusion of same assembly more than once.
12219 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12221 * cs-parser.jay: Fixed problem where the last assembly attribute
12222 has been applied also to following declaration (class, struct, etc.)
12224 2004-01-21 Marek Safar <marek.safar@seznam.cz>
12226 * class.cs: Added error CS0538, CS0539 reporting.
12227 Fixed crash on Microsoft runtime when field type is void.
12229 * cs-parser.jay: Added error CS0537 reporting.
12231 * pending.cs: Added error CS0535 reporting.
12232 Improved error report for errors CS0536, CS0534.
12234 2004-01-20 Miguel de Icaza <miguel@ximian.com>
12236 Merge a few bits from the Anonymous Method MCS tree.
12238 * statement.cs (ToplevelBlock): New class for toplevel methods,
12239 will hold anonymous methods, lifted variables.
12241 * cs-parser.jay: Create toplevel blocks for delegates and for
12242 regular blocks of code.
12244 2004-01-20 Martin Baulig <martin@ximian.com>
12246 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
12247 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
12248 and `NeedExplicitReturn'; added `IsLastStatement'.
12249 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
12250 have a `ReturnLabel' or we're not unreachable.
12252 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
12253 child's reachability; don't just override ours with it. Fixes
12254 #58058 (lluis's example).
12255 (FlowBranching): Added public InTryOrCatch(), InCatch(),
12256 InFinally(), InLoop(), InSwitch() and
12257 BreakCrossesTryCatchBoundary() methods.
12259 * statement.cs (Return): Do all error checking in Resolve().
12260 Unless we are the last statement in a top-level block, always
12261 create a return label and jump to it.
12262 (Break, Continue): Do all error checking in Resolve(); also make
12263 sure we aren't leaving a `finally'.
12264 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
12265 statement in a top-level block.
12266 (Block.Flags): Added `IsDestructor'.
12267 (Block.IsDestructor): New public property.
12269 2004-01-20 Martin Baulig <martin@ximian.com>
12271 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
12273 2004-01-20 Martin Baulig <martin@ximian.com>
12275 * statement.cs (Statement.ResolveUnreachable): New public method.
12276 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
12277 (Block.Resolve): Resolve unreachable statements.
12279 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
12281 * expression.cs: We need to fix the case where we do
12282 not have a temp variable here.
12284 * assign.cs: Only expression compound assignments need
12285 temporary variables.
12287 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
12289 * flowanalysis.cs: Reduce memory allocation in a few ways:
12290 - A block with no variables should not allocate a bit
12292 - A method with no out parameters does not need any tracking
12293 for assignment of the parameters, so we need not allocate
12296 public readonly Type[] VariableTypes;
12297 public readonly string[] VariableNames;
12298 Are redundant. The data is already stored in the variable
12299 map, so we need not allocate another array for it.
12300 - We need to add alot of checks for if (params | locals) == null
12301 due to the first two changes.
12303 2004-01-18 Miguel de Icaza <miguel@ximian.com>
12305 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
12306 implement IMemoryLocation, we store a copy on a local variable and
12307 take the address of it. Patch from Benjamin Jemlich
12309 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
12310 to use a special "type_name_expression" rule which reduces the
12311 number of "QualifiedIdentifier" classes created, and instead
12312 directly creates MemberAccess expressions.
12314 2004-01-17 Miguel de Icaza <miguel@ximian.com>
12316 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
12317 that fixes #52853. Null literal assignment to ValueType
12319 * class.cs (MethodData.Emit): Instead of checking the name of the
12320 method to determine if its a destructor, create a new derived
12321 class from Method called Destructor, and test for that.
12323 * cs-parser.jay: Create a Destructor object instead of a Method.
12325 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
12329 2004-01-16 Miguel de Icaza <miguel@ximian.com>
12331 * expression.cs (Binary.ResolveOperator): Perform an implicit
12332 conversion from MethodGroups to their delegate types on the
12333 Addition operation.
12335 * delegate.cs: Introduce a new class DelegateCreation that is the
12336 base class for `NewDelegate' and `ImplicitDelegateCreation',
12337 factor some code in here.
12339 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
12340 conversion from MethodGroups to compatible delegate types.
12342 * ecore.cs (Expression.Resolve): Do not flag error 654
12343 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
12344 we allow conversions from MethodGroups to delegate types now.
12346 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
12347 assignments in v2 either.
12349 2004-01-10 Miguel de Icaza <miguel@ximian.com>
12351 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
12352 static read-only fields in ctors.
12354 Applied patch from Benjamin Jemlich
12356 * expression.cs (UnaryMutator): Avoid leaking local variables.
12358 2004-01-09 Miguel de Icaza <miguel@ximian.com>
12360 * cs-tokenizer.cs (IsCastToken): Allow the various native types
12361 here to return true, as they can be used like this:
12363 (XXX) int.MEMBER ()
12365 Fixed 49836 and all the other dups
12367 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
12369 * driver.cs: Implement /win32res and /win32icon.
12371 2004-01-08 Miguel de Icaza <miguel@ximian.com>
12373 * cs-parser.jay: Add a rule to improve error handling for the
12374 common mistake of placing modifiers after the type.
12376 2004-01-07 Miguel de Icaza <miguel@ximian.com>
12378 * cs-parser.jay (interface_event_declaration): Catch
12379 initialization of events on interfaces, and report cs0068
12381 * cs-parser.jay (interface_event_declaration): Catch
12382 initialization of events.
12384 * ecore.cs: Better report missing constructors.
12386 * expression.cs (Binary.ResolveOperator): My previous bug fix had
12387 the error reporting done in the wrong place. Fix.
12389 * expression.cs (Binary.ResolveOperator): Catch the
12390 operator + (E x, E y) error earlier, and later allow for implicit
12391 conversions in operator +/- (E e, U x) from U to the underlying
12394 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
12395 52596, if the container class is abstract, the default constructor
12396 is protected otherwise its public (before, we were always public).
12398 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
12401 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
12402 Jemlich that fixes bug #52597, MCS was generating invalid code for
12403 idisposable structs. Thanks to Ben for following up with this
12406 2004-01-06 Miguel de Icaza <miguel@ximian.com>
12408 * driver.cs: Allow assemblies without code to be generated, fixes
12411 2004-01-07 Nick Drochak <ndrochak@gol.com>
12413 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
12415 2004-01-05 Miguel de Icaza <miguel@ximian.com>
12417 * cs-parser.jay: Add rules to improve error reporting if fields or
12418 methods are declared at the namespace level (error 116)
12420 * Add rules to catch event add/remove
12422 2004-01-04 David Sheldon <dave-mono@earth.li>
12424 * expression.cs: Added matching ")" to error message for
12427 2004-01-03 Todd Berman <tberman@gentoo.org>
12429 * ecore.cs, attribute.cs:
12430 Applying fix from #52429.
12432 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12434 * ecore.cs, expression.cs, statement.cs:
12435 Total rewrite of how we handle branching. We
12436 now handle complex boolean expressions with fewer
12437 jumps. As well if (x == 0) no longer emits a ceq.
12439 if (x is Foo) is much faster now, because we generate
12442 Overall, we get a pretty big improvement on our benchmark
12443 tests. The code we generate is smaller and more readable.
12445 I did a full two-stage bootstrap. The patch was reviewed
12446 by Martin and Miguel.
12448 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12450 * cs-parser.jay: Make primary_expression not take a QI.
12451 we dont need this because the member_access rule covers
12452 us here. So we replace the rule with just IDENTIFIER.
12454 This has two good effects. First, we remove a s/r conflict.
12455 Second, we allocate many fewer QualifiedIdentifier objects.
12457 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12459 * attribute.cs: Handle MarshalAs attributes as pseudo, and
12460 set the correct information via SRE. This prevents
12461 hanging on the MS runtime. Fixes #29374.
12463 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12465 * convert.cs: correctly handle conversions to value types
12466 from Enum and ValueType as unboxing conversions.
12468 Fixes bug #52569. Patch by Benjamin Jemlich.
12470 2004-01-02 Ravi Pratap <ravi@ximian.com>
12472 * expression.cs (BetterConversion): Prefer int -> uint
12473 over int -> ulong (csc's behaviour). This fixed bug #52046.
12475 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
12477 * decl.cs (MemberCache.FindMembers): now returns a
12480 * typemanager.cs: In general, go with with ^^.
12481 (CopyNewMethods): take an IList.
12482 (RealMemberLookup): Only allocate an arraylist
12483 if we copy from two sets of methods.
12485 This change basically does two things:
12486 1) Fewer array lists allocated due to CopyNewMethods.
12487 2) the explicit cast in MemberList costed ALOT.
12489 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
12491 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
12492 a hashtable to avoid needless string allocations when an identifier is
12493 used more than once (the common case).
12495 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
12497 * pending.cs: MS's TypeBuilder.GetInterfaces ()
12498 is broken, it will not return anything. So, we
12499 have to use the information we have in mcs to
12502 * typemanager.cs: Add a cache for GetInterfaces,
12503 since this will now be used more often (due to ^^)
12505 (GetExplicitInterfaces) New method that gets the
12506 declared, not effective, interfaces on a type
12507 builder (eg, if you have interface IFoo, interface
12508 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
12511 This patch makes MCS able to bootstrap itself on
12514 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
12516 * expression.cs: Remove the Nop's that Miguel put
12519 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12521 * report.cs, codegen.cs: Give the real stack trace to
12522 the error when an exception is thrown.
12524 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12526 * decl.cs: only allocate hashtables for ifaces if
12529 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12531 * expression.cs: fix the error from cs0121-2.cs
12532 (a parent interface has two child interfaces that
12533 have a function with the same name and 0 params
12534 and the function is called through the parent).
12536 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
12538 * class.cs, rootcontext.cs, typmanager.cs: do not
12541 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
12543 * codegen.cs: remove stack for the ec flow branching.
12544 It is already a linked list, so no need.
12546 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
12548 * Makefile: Allow custom profiler here.
12550 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
12552 * typemanager.cs (LookupType):
12553 - Use a static char [], because split takes
12554 a param array for args, so it was allocating
12556 - Do not store true in a hashtable, it boxes.
12558 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
12560 * flowanalysis.cs: bytify common enums.
12562 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12564 * modifiers.cs: Add a new set of flags for the
12565 flags allowed on explicit interface impls.
12566 * cs-parser.jay: catch the use of modifiers in
12567 interfaces correctly.
12568 * class.cs: catch private void IFoo.Blah ().
12570 All related to bug #50572.
12572 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12574 * decl.cs: Rewrite the consistant accessability checking.
12575 Accessability is not linear, it must be implemented in
12576 a tableish way. Fixes #49704.
12578 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12580 * expression.cs: Handle negation in a checked context.
12581 We must use subtraction from zero. Fixes #38674.
12583 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
12585 * class.cs: Ignore static void main in DLLs.
12586 * rootcontext.cs: Handle the target type here,
12587 since we are have to access it from class.cs
12588 * driver.cs: account for the above.
12590 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
12592 * report.cs: Give line numbers and files if available.
12594 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
12596 * driver.cs: Implement /addmodule.
12598 * typemanager.cs: Change 'modules' field so it now contains Modules not
12601 2003-12-20 Martin Baulig <martin@ximian.com>
12603 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
12604 (FieldBase.IsAssigned): Removed this field.
12605 (FieldBase.SetAssigned): New public method.
12606 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
12608 2003-12-20 Martin Baulig <martin@ximian.com>
12610 * expression.cs (LocalVariableReference.DoResolve): Don't set
12611 `vi.Used' if we're called from DoResolveLValue().
12613 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
12614 returns the usage vector it just merged into the current one -
12615 pass this one to UsageWarning().
12616 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
12617 of the `EmitContext', don't call this recursively on our children.
12619 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
12621 * driver.cs: Implement /target:module.
12623 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
12625 * support.cs (CharArrayHashtable): New helper class.
12627 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
12628 char arrays, not strings, so we can avoid creating a string in
12629 consume_identifier if the identifier is a keyword.
12631 2003-12-16 Martin Baulig <martin@ximian.com>
12633 * statement.cs (LocalInfo.Assigned): Removed this property.
12634 (LocalInfo.Flags): Removed `Assigned'.
12635 (LocalInfo.IsAssigned): New public method; takes the EmitContext
12636 and uses flow analysis.
12637 (Block.UsageWarning): Made this method private.
12638 (Block.Resolve): Call UsageWarning() if appropriate.
12640 * expression.cs (LocalVariableReference.DoResolve): Always set
12641 LocalInfo.Used here.
12643 2003-12-13 Martin Baulig <martin@ximian.com>
12645 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
12646 any value here; we're now using flow analysis to figure out
12647 whether a statement/block returns a value.
12649 2003-12-13 Martin Baulig <martin@ximian.com>
12651 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
12653 (FlowBranching.MergeFinally): Don't call
12654 `branching.CheckOutParameters()' here, this is called in
12656 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
12657 when adding the `finally' vector.
12659 2003-12-13 Martin Baulig <martin@ximian.com>
12662 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
12663 actually work and also fix #48962.
12665 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
12667 * decl.cs: Do not check System.Object for nested types,
12668 since we know it does not have any. Big bang for buck:
12671 Run 1: 8.35 seconds
12672 Run 2: 8.32 seconds
12673 corlib: 17.99 seconds
12675 Run 1: 8.17 seconds
12676 Run 2: 8.17 seconds
12677 corlib: 17.39 seconds
12679 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
12681 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
12682 time we are returning 0 members, so we save alot here.
12684 2003-12-11 Martin Baulig <martin@ximian.com>
12686 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
12687 `MergeChild()', also just take the `FlowBranching' as argument;
12688 call Merge() on it and return the result.
12689 (FlowBranching.Merge): We don't need to do anything if we just
12692 2003-12-11 Martin Baulig <martin@ximian.com>
12694 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
12695 them in an `ArrayList' to reduce memory usage. Thanks to Ben
12696 Maurer for this idea.
12698 2003-12-11 Martin Baulig <martin@ximian.com>
12700 * flowanalysis.cs (MergeResult): This class is now gone; we now
12701 use the `UsageVector' for this. The reason for this is that if a
12702 branching just has one sibling, we don't need to "merge" them at
12703 all - that's the next step to do.
12704 (FlowBranching.Merge): We now return a `UsageVector' instead of a
12707 2003-12-11 Martin Baulig <martin@ximian.com>
12709 Reworked flow analyis and made it more precise and bug-free. The
12710 most important change is that we're now using a special `Reachability'
12711 class instead of having "magic" meanings of `FlowReturns'. I'll
12712 do some more cleanups and optimizations and also add some more
12713 documentation this week.
12715 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
12716 largely reworked this class.
12717 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
12718 the new `Reachability' class instead of having "magic" values here.
12719 (FlowBranching): We're now using an instance of `Reachability'
12720 instead of having separate `Returns', `Breaks' etc. fields.
12722 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
12723 based on flow analysis; ignore the return value of block.Emit ().
12725 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
12727 * driver.cs typemanager.cs: Find the mono extensions to corlib even
12728 if they are private.
12730 2003-12-09 Martin Baulig <martin@ximian.com>
12732 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
12733 call them directly on the UsageVector.
12735 2003-12-09 Martin Baulig <martin@ximian.com>
12737 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
12738 Changed return type from `FlowReturns' to `Reachability'.
12740 2003-12-09 Martin Baulig <martin@ximian.com>
12742 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
12743 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
12744 `Reachable' fields with a single `Reachability' one.
12746 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12748 * class.cs (FindMembers): Remove foreach's.
12753 Run 1: 8.74 seconds
12754 Run 2: 8.71 seconds
12757 Run 1: 8.64 seconds
12758 Run 2: 8.58 seconds
12761 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12766 This patch does a few things:
12767 1. EmptyStatement is now a singleton, so it is never reallocated.
12768 2. All blah is EmptyStatement constructs have been changed to
12769 blah == EmptyStatement.Value, which is much faster and valid
12770 now that EmptyStatement is a singleton.
12771 3. When resolving a block, rather than allocating a new array for
12772 the non-empty statements, empty statements are replaced with
12773 EmptyStatement.Value
12774 4. Some recursive functions have been made non-recursive.
12775 Mainly the performance impact is from (3), however (1) and (2) are needed for
12776 this to work. (4) does not make a big difference in normal situations, however
12777 it makes the profile look saner.
12782 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12783 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12784 Total memory allocated: 56397 KB
12787 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
12788 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
12789 Total memory allocated: 55666 KB
12791 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12793 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
12794 than the hashtable in a hashtable version
12796 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
12797 we always end up concating a string. This results in a huge perf
12798 loss, because many strings have to be tracked by the GC. In this
12799 patch, we first use a hashtable that works with two keys, so that
12800 the strings do not need to be concat'ed.
12804 Run 1: 8.74 seconds
12805 Run 2: 8.71 seconds
12808 Run 1: 8.65 seconds
12809 Run 2: 8.56 seconds
12811 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12813 * Makefile: Add a new target `do-time' that does a quick and simple
12814 profile, leaving easy to parse output.
12816 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
12818 * codegen.cs (Init): Create the dynamic assembly with
12819 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
12821 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
12823 * support.cs: Make the PtrHashtable use only one
12824 instance of its comparer.
12826 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
12828 * typemanager.cs: Fix lookup of GetNamespaces.
12830 2003-11-29 Miguel de Icaza <miguel@ximian.com>
12832 * expression.cs: Removed redundant line.
12834 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
12835 ArrayLists, use for loops with bounds.
12837 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
12840 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
12841 arraylists, use for loop with bounds.
12843 The above three changes give us a 0.071 second performance
12844 improvement out of 3.294 seconds down to 3.223. On my machine
12845 the above changes reduced the memory usage by 1,387 KB during
12846 compiler bootstrap.
12848 * cs-parser.jay (QualifiedIdentifier): New class used to represent
12849 QualifiedIdentifiers. Before we created a new string through
12850 concatenation, and mostly later on, the result would be
12851 manipulated by DecomposeQI through string manipulation.
12853 This reduced the compiler memory usage for bootstrapping from
12854 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
12855 compile times in 0.05 seconds.
12857 2003-11-28 Dick Porter <dick@ximian.com>
12859 * support.cs: Do string compares with the Invariant culture.
12867 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
12868 the comparison is done with the Invariant culture.
12870 2003-11-27 Miguel de Icaza <miguel@ximian.com>
12872 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
12873 GetEnumerator method.
12875 (ProbeCollectionType): Iterate starting at the most specific type
12876 upwards looking for a GetEnumerator
12878 * expression.cs: Shift count can be up to 31 for int/uint and 63
12881 2003-11-26 Miguel de Icaza <miguel@ximian.com>
12883 * statement.cs (Block.LookupLabel): Also look for the label on the
12884 children blocks. Use a hash table to keep track of visited
12887 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12888 we actually did transform the other operand, otherwise fall back
12889 to the common codepath that casts to long.
12891 * cs-tokenizer.cs: Use the same code pattern as the int case.
12892 Maybe I should do the parsing myself, and avoid depending on the
12893 Parse routines to get this done.
12895 2003-11-25 Miguel de Icaza <miguel@ximian.com>
12897 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
12898 which fixes bug 51347. This time test it.
12900 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12901 attributes for example can not tell the difference between these.
12902 The difference was only a syntax feature of the language.
12904 * attribute.cs: Apply attributes to delegates.
12906 * delegate.cs: Call the apply attributes method.
12908 2003-11-24 Miguel de Icaza <miguel@ximian.com>
12910 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12911 comparing 0 vs Byte.MinValue, not the value
12913 (ImplicitConversionRequired): When reporting a conversion error,
12914 use error 31 to print out the constant error instead of the
12917 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
12918 which fixes bug 51347.
12920 2003-11-22 Miguel de Icaza <miguel@ximian.com>
12922 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
12923 which fixes the -warnaserror command line option.
12925 2003-11-21 Miguel de Icaza <miguel@ximian.com>
12927 * cfold.cs (DoNumericPromotions): During constant folding of
12928 additions on UIntConstant, special case intconstants with
12929 IntConstants like we do on the expression binary operator.
12931 2003-11-12 Miguel de Icaza <miguel@ximian.com>
12933 * convert.cs (ImplicitReferenceConversion): We were missing a case
12934 (System.Enum are not value types or class types, so we need to
12935 classify them separatedly).
12937 * driver.cs: We do not support error 2007.
12939 2003-11-12 Jackson Harper <jackson@ximian.com>
12941 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
12942 system directory. Also use the full file name so users can
12943 libraries names mscorlib-o-tron.dll in a non system dir.
12945 2004-01-04 David Sheldon <dave-mono@earth.li>
12947 * expression.cs: Added matching ")" to error message for CS0077.
12949 2003-12-19 Martin Baulig <martin@ximian.com>
12951 * typemanager.cs (TypeManager.IsEqualGenericType): New public
12952 static method; see documentation in the method.
12953 (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
12955 * convert.cs (Convert.ImplicitReferenceConversion,
12956 Convert.ImplicitReferenceConversionExists): Add support for
12957 generic type declarations; see gen-36.cs.
12959 2003-12-19 Martin Baulig <martin@ximian.com>
12961 * pending.cs (Pending.InterfaceMethod): Use
12962 `Type.IsAssignableFrom()' instead of `=='.
12964 2003-12-18 Martin Baulig <martin@ximian.com>
12966 * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
12969 * convert.cs (Convert.ImplicitStandardConversionExists): Use
12970 `expr_type.Equals (target_type)' instead of `=='.
12972 2003-12-08 Martin Baulig <martin@ximian.com>
12974 * generics.cs (Constraints.Types): Removed.
12975 (Constraints.Resolve): Just resolve everything to TypeExpr's, not
12977 (Constraints.ResolveTypes): New public method; resolves the
12978 TypeExpr's to Type's.
12979 (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
12980 longer takes the constraints.
12981 (TypeParameter.DefineMethod): Likewise.
12982 (TypeParameter.DefineType): New public method. Calls
12983 `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
12986 2003-12-08 Martin Baulig <martin@ximian.com>
12988 * convert.cs (Convert.ImplicitConversionStandard): Use
12989 `expr_type.Equals (target_type)' instead of `=='.
12991 2003-12-08 Martin Baulig <martin@ximian.com>
12993 * typemanager.cs (TypeManager.GetReferenceType): Call
12994 `Type.MakeByRefType ()'.
12996 2003-12-08 Martin Baulig <martin@ximian.com>
12998 * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
12999 just has some special meaning in some situations. For instance,
13000 it is allowed to use `where' as the name of a variable etc.
13002 2003-12-04 Martin Baulig <martin@ximian.com>
13004 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
13005 `Type.MakeArrayType()' for array types.
13007 2003-11-18 Miguel de Icaza <miguel@ximian.com>
13009 * expression.cs (Invocation.VerifyArgumentsCompat): Remove
13012 (SizeOf.DoResolve): assign the `type_queried' field. This gets
13015 2003-11-16 Martin Baulig <martin@ximian.com>
13017 * codegen.cs (EmitContext.IsGeneric): Removed.
13019 * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
13020 ResolveGeneric() on the DeclSpace.
13022 2003-11-16 Martin Baulig <martin@ximian.com>
13024 * generic.cs (TypeArguments.Resolve):
13025 `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
13026 `ResolveType()' on it to get the Type.
13028 2003-11-15 Martin Baulig <martin@ximian.com>
13030 * generic.cs (ConstructedType.GetInterfaces): Override this.
13032 2003-11-14 Martin Baulig <martin@ximian.com>
13034 * interface.cs (Interface.DefineType): Define all type parameters
13035 before adding the interfaces we inherit.
13037 2003-11-11 Martin Baulig <martin@ximian.com>
13039 * generic.cs (ConstructedType.ResolveType): Always call
13040 `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
13042 2003-11-10 Martin Baulig <martin@ximian.com>
13044 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
13045 (TypeManager.InitCoreTypes): Initialize them here, but instead of
13046 calling `ResolveType()' on them, directly assign their `Type'.
13048 2003-11-08 Martin Baulig <martin@ximian.com>
13050 * generic.cs (ConstructedType): Override `IsClass' etc.
13052 2003-11-08 Martin Baulig <martin@ximian.com>
13054 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
13055 return value and the `out parent' parameter.
13056 (TypeContainer.DefineType): Moved the CS0644 check into
13057 GetClassBases(). Don't pass the interface types to the
13058 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
13059 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
13061 * ecore.cs (TypeExpr.IsAttribute): New property.
13062 (TypeExpr.GetInterfaces): New method.
13064 * interface.cs (Interface.GetInterfaceTypeByName): Return a
13065 TypeExpr instead of a Type.
13066 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
13067 (Interface.DefineType): Don't pass the interface types to the
13068 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
13069 them later and then call `TypeBulider.AddInterfaceImplementation()'.
13071 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
13072 instead of a `Type[]'.
13073 (TypeManager.RegisterBuilder): Likewise.
13074 (TypeManager.AddUserInterface): Likewise.
13075 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
13076 `Type[]' and also return a `TypeExpr[]'.
13077 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
13079 2003-11-08 Martin Baulig <martin@ximian.com>
13081 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
13084 2003-11-08 Martin Baulig <martin@ximian.com>
13086 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
13087 TypeManager.ResolveExpressionTypes().
13089 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
13090 instead of an Expression.
13091 (TypeExpr): This is now an abstract base class for `TypeExpression'.
13092 (TypeExpression): New public class; formerly known as `TypeExpr'.
13094 * expression.cs (ComposedCast): Derive from TypeExpr.
13096 * typemanager.cs (TypeManager.system_*_expr): These are now
13097 TypExpr's instead of Expression's.
13098 (TypeManager.ResolveExpressionTypes): New public static function;
13099 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
13102 2003-11-06 Miguel de Icaza <miguel@ximian.com>
13104 * expression.cs (New.DoResolve): Do not dereference value that
13105 might be a null return.
13107 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
13108 sure that the constant value has the right type. Fixes an
13109 unreported bug, similar to 50425.
13111 * const.cs (Const.LookupConstantValue): Call
13112 ImplicitStandardConversionExists before doing a conversion to
13113 avoid havng the TypeManager.ChangeType do conversions.
13115 Reduced the number of casts used
13117 (Const.ChangeType): New routine to enable reuse of the constant
13118 type changing code from statement.
13120 * typemanager.cs (ChangeType): Move common initialization to
13121 static global variables.
13125 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
13126 every value type to go through, even if it was void. Fix that.
13128 * cs-tokenizer.cs: Use is_identifier_start_character on the start
13129 character of the define, and the is_identifier_part_character for
13130 the rest of the string.
13132 2003-11-05 Miguel de Icaza <miguel@ximian.com>
13134 * expression.cs (UnaryMutator.EmitCode): When I updated
13135 LocalVariableReference.DoResolve, I overdid it, and dropped an
13136 optimization done on local variable references.
13138 2003-11-04 Miguel de Icaza <miguel@ximian.com>
13140 * ecore.cs: Convert the return from Ldlen into an int.
13142 2003-10-20 Miguel de Icaza <miguel@ximian.com>
13144 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
13145 the accessibility, this is a special case for toplevel non-public
13146 classes (internal for instance).
13148 2003-10-20 Nick Drochak <ndrochak@gol.com>
13150 * ecore.cs: Fix typo and build. Needed another right paren.
13152 2003-10-19 Miguel de Icaza <miguel@ximian.com>
13154 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
13155 `internal' case regular and protected, but not allowing protected
13156 to be evaluated later. Bug 49840
13158 2003-10-15 Miguel de Icaza <miguel@ximian.com>
13160 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
13161 to kb.Nlast, and not the kb.nFirst to isolate the switch
13164 Extract the underlying type, so enumerations of long/ulong are
13165 treated like long/ulong.
13167 2003-10-14 Miguel de Icaza <miguel@ximian.com>
13169 * expression.cs (New): Overload the meaning of RequestedType to
13170 track the possible creation of the NewDelegate type, since
13171 DoResolve is invoked more than once for new constructors on field
13174 See bugs: #48800 and #37014
13176 * cs-parser.jay (declare_local_constants): Take an arraylist
13177 instead of a single constant.
13179 (local_constant_declaration): It should take a
13180 constant_declarators, not a constant_declarator. Fixes 49487
13182 * convert.cs: Fix error report.
13184 2003-10-13 Jackson Harper <jackson@ximian.com>
13186 * typemanager.cs (TypeToCoreType): Add float and double this fixes
13189 2003-11-03 Martin Baulig <martin@ximian.com>
13191 * expression.cs (ArrayAccess.GetStoreOpcode): Added
13192 `out bool has_type_arg'; if set, we need to pass the type to
13194 (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
13195 Stelem_Any/Ldelem_Any for generic parameters.
13197 2003-11-02 Martin Baulig <martin@ximian.com>
13199 * expression.cs (Invocation.EmitCall): Use
13200 `TypeManager.IsValueType()' to check whether it's a value type.
13201 Don't set `struct_call' when calling a method on a type parameter.
13203 2003-11-02 Martin Baulig <martin@ximian.com>
13205 * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
13206 and removed the TypeBuilder argument.
13208 * typemanager.cs (TypeManager.IsValueType): Return
13209 `t.IsGenericParameter || t.IsValueType'.
13211 2003-10-25 Martin Baulig <martin@ximian.com>
13213 * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
13214 call ConstructedType.Resolve() on it.
13216 * generic.cs (ConstructedType.Resolve): Set `type' on success.
13218 2003-10-25 Martin Baulig <martin@ximian.com>
13220 * class.cs (TypeContainer.GetClassBases): Changed
13221 `out Type parent' into `out TypeExpr parent'. Moved CS0644 and
13222 CS8214 reporting here.
13223 (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
13224 instead of a `Type' for our parent. In case of a recursive
13225 declaration (see tests/gen-23.cs for an example), our parent is a
13226 ConstructedType and it doesn't have its type set. So, first
13227 create our own TypeBuilder, then call constructed.Resolve() to get
13228 the parent's type and finally TypeBuilder.SetParent() it.
13230 * ecore.cs (TypeExpr.Name): New public virtual property.
13233 (ConstructedType): We're now a TypeExpr and not just an Expression.
13234 (ConstructedType.ResolveAsTypeStep): Don't resolve our type
13235 arguments here; this is done later.
13236 (ConstructedType.Resolve): New public method to resolve the type
13237 arguments and bind them.
13239 2003-10-21 Martin Baulig <martin@ximian.com>
13241 * convert.cs: Use `TypeManager.IsValueType' instead of
13242 'type.IsValueType' everywhere.
13244 * typemanager.cs (TypeManager.IsValueType): Return true for type
13245 parameters. The reason for this is that we need to box a type
13246 parameter when converting it to a reference type.
13248 * cs-parser.jay: Added support for default value expressions.
13250 * generics.cs (DefaultValueExpression): New public class.
13252 2003-10-17 Martin Baulig <martin@ximian.com>
13254 * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
13255 TypeContainer so we can also use this for Interfaces.
13256 (TypeParameter.Resolve): Likewise.
13258 * interface.cs (Interface.DefineType): Added support for generic
13261 * cs-parser.jay: Added support for generic structs and interfaces.
13263 2003-10-17 Martin Baulig <martin@ximian.com>
13265 * generic.cs (GenericMemberAccess.DoResolve): We can now actually
13266 call generic methods :-)
13268 2003-10-16 Martin Baulig <martin@ximian.com>
13270 * cs-parser.jay (namespace_or_type_name): Only create a
13271 GenericMemberAccess if we actually have type arguments.
13273 2003-10-13 Martin Baulig <martin@ximian.com>
13275 * class.cs (Method.Define): If we're a generic method, call
13276 TypeBuilder.DefineGenericMethod () before resolving
13278 (MethodData): Added .ctor which takes an additional MethodBuilder
13279 argument; this is used for generic methods.
13280 (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
13281 we already have a MethodBuilder.
13283 2003-10-10 Martin Baulig <martin@ximian.com>
13285 * class.cs (Method): Added .ctor which takes a `GenericMethod'
13286 instead of a `DeclSpace'. This is used for generic methods.
13288 * cs-parser.jay (method_header): Added support for generic
13289 methods; create a `GenericMethod' instance and pass it to the
13290 `Method's .ctor; it'll be used as the `DeclSpace' to lookup
13291 parameters and locals.
13293 * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
13294 since we already have the location. Check whether we're a generic
13295 type declaration or a generic method and create the correct type
13298 * generic.cs (TypeParameter.DefineMethod): New public method.
13299 (GenericMethod): New public class; derives from DeclSpace and is
13300 used for generic methods.
13302 2003-10-09 Martin Baulig <martin@ximian.com>
13304 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
13306 (MethodCore.DoDefineParameters): Removed the TypeContainer
13307 argument; use the DeclSpace which was passed to the .ctor instead.
13308 (MethodCore.CheckParameter): Take a DeclSpace instead of a
13309 TypeContainer; we only need a DeclSpace here.
13311 2003-10-09 Martin Baulig <martin@ximian.com>
13313 * class.cs (MethodData): Added additional `DeclSpace ds' argument
13315 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
13316 EmitContext's .ctor.
13318 2003-10-09 Martin Baulig <martin@ximian.com>
13320 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
13321 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
13322 AsAccessible(), moved them as well.
13324 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
13326 2003-10-07 Miguel de Icaza <miguel@ximian.com>
13328 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
13329 generation for >=, as spotted by Paolo, bug 48679.
13330 Patch from David Waite.
13332 * cs-tokenizer.cs: Add handling for #pragma.
13334 * cs-parser.jay: Allow for both yield and yield return in the
13335 syntax. The anti-cobolization of C# fight will go on!
13337 * class.cs (TypeBuilder.DefineType): Catch error condition here
13338 (Parent.DefineType erroring out and returning null).
13340 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13341 coping with enumerations variables, we were mistakenly processing
13342 them as a regular value type instead of built-in types. Fixes the
13345 * typemanager.cs (IsBuiltinOrEnum): New method.
13347 2003-09-30 Miguel de Icaza <miguel@ximian.com>
13349 * cs-parser.jay: Upgrade: yield now needs the return clause.
13351 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
13353 * cs-parser.jay : Renamed yyName to yyNames related to jay.
13355 2003-09-29 Martin Baulig <martin@ximian.com>
13357 * typemanager.cs (TypeManager.GetMethodFlags): Added support for
13358 inflated generic methods.
13360 * generics.cs (ConstructedType): Distinguish between open and
13361 closed constructed types; correctly resolve the arguments.
13363 2003-09-22 Martin Baulig <martin@ximian.com>
13365 * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
13366 all type arguments meet their constraints.
13368 2003-09-19 Martin Baulig <martin@ximian.com>
13370 * decl.cs (MemberCache.SetupCacheForInterface): Take a
13371 `MemberCache parent' argument. Normally, an interface doesn't
13372 have a parent type except System.Object, but we use this in gmcs
13373 for generic type parameters.
13375 2003-09-18 Martin Baulig <martin@ximian.com>
13377 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
13378 on `type.IsInterface'; don't check whether the type has a parent
13379 to determine whether it's an interface.
13381 2003-09-17 Martin Baulig <martin@ximian.com>
13383 * generic.cs (ConstructedType.ToString): Always use `name' as the
13386 2003-09-15 Martin Baulig <martin@ximian.com>
13388 * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
13390 * generic.cs (Constraints.Resolve): New public method; this is
13391 called to resolve the constraint types and to check whether all
13392 the constraints are correct.
13393 (Constraints.Types): New public property.
13394 (TypeParameter.Resolve): New public method; resolves all the
13395 type's constraints.
13397 * class.cs (TypeContainer.DefineType): Call
13398 TypeParameter.Resolve() before actually defining the type.
13400 2003-09-15 Martin Baulig <martin@ximian.com>
13402 * class.cs (TypeContainer.DefineType): Added an error flag to
13403 avoid reporting duplicate CS0146's ("class definition is
13406 * driver.cs (Driver.MainDriver): Abort if
13407 RootContext.ResolveTree() reported any errors.
13409 2003-09-07 Martin Baulig <martin@ximian.com>
13411 * report.cs (Error, Warning): Added overloaded versions which take
13412 a `params object[] args' and call String.Format().
13414 2003-09-07 Martin Baulig <martin@ximian.com>
13416 * decl.cs (DeclSpace..ctor): Don't call
13417 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
13418 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
13419 (DeclSpace.RecordDecl): New method.
13421 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
13423 2003-09-02 Ravi Pratap <ravi@ximian.com>
13425 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
13426 value attributes to be applied to ParameterBuilders.
13428 * class.cs (MethodCore.LabelParameters): Make static and more
13429 generic so that it can be used from other places - like interface
13430 methods, for instance.
13432 * interface.cs (Interface.Emit): Call LabelParameters before
13433 emitting attributes on the InterfaceMethod.
13435 2003-09-07 Martin Baulig <martin@ximian.com>
13437 * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
13438 if the number of type parameters doesn't match.
13440 2003-09-04 Martin Baulig <martin@ximian.com>
13442 * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
13443 for arrays of generic type params (ie. `!0[]').
13445 2003-09-04 Martin Baulig <martin@ximian.com>
13447 * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
13450 2003-09-04 Martin Baulig <martin@ximian.com>
13452 * decl.cs (DeclSpace.LookupGeneric): New method.
13453 (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
13456 * generic.cs (TypeParameterExpr): Take a TypeParameter as
13457 argument, not just a string.
13458 (TypeParameter.Define): New public method; this is called to
13459 actually define the generic parameter; after this, you can use the
13460 new `Type' property to get the type.
13462 2003-09-04 Martin Baulig <martin@ximian.com>
13464 * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
13465 is now an ArrayList; initialize the result of the `TypeParameters'
13467 (DeclSpace.GetGenericData): Removed.
13468 (DeclSpace.LookupGeneric): Temporarily removed; we need to
13469 implement this in a different way.
13470 (DeclSpace.GetTypeParameters): Removed; there's now a
13471 `TypeParameters' property.
13472 (DeclSpace.TypeParameters): New public property.
13474 * generic.cs (Constraints): Make this class public.
13475 (TypeParameter): New public class.
13477 2003-09-04 Martin Baulig <martin@ximian.com>
13479 * decl.cs (DeclSpace.GetTypeParameters): New method to return the
13480 generic parameters.
13482 * class.cs (TypeContainer.DefineType): Call
13483 TypeBuilder.DefineGenericParameter () on all generic parameters if
13484 this is a generic type.
13486 2003-08-28 Martin Baulig <martin@ximian.com>
13488 * sample-stack.il: Compile this with ilasm: "ilasm /dll
13491 * sample-hello.cs: Compile this with gmcs: "gmcs
13492 /r:sample-stack.dll sample-hello.cs".
13494 2003-08-28 Martin Baulig <martin@ximian.com>
13496 * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
13497 the parameters to the generic type.
13499 2003-08-28 Martin Baulig <martin@ximian.com>
13501 * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
13503 2003-08-28 Martin Baulig <martin@ximian.com>
13505 * cs-parser.jay (opt_type_argument_list): Use
13506 `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
13507 (primary_expression): Replace `qualified_identifier' with `type_name'.
13508 (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
13510 * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
13511 parser to check whether it is syntactically a type parameter list;
13512 return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
13515 2003-08-26 Martin Baulig <martin@ximian.com>
13517 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
13518 resolving aliases; fixes #47927.
13520 2003-08-26 Martin Baulig <martin@ximian.com>
13522 * statement.cs (Using.DoResolve): This is internally emitting a
13523 try/finally clause, so we need to set ec.NeedExplicitReturn if we
13524 do not always return. Fixes #47681.
13526 2003-08-26 Martin Baulig <martin@ximian.com>
13528 * decl.cs (MemberCore): Moved WarningNotHiding(),
13529 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
13531 (AdditionResult): Make this nested in DeclSpace.
13532 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
13533 argument; call NamespaceEntry.Define() unless we're nested in a
13536 * namespace.cs (Namespace.DefineName): New public function. This
13537 is called from DeclSpace's .ctor to add
13538 (Namespace.Lookup): Include DeclSpaces in the lookup.
13540 * class.cs (Operator): Derive from MemberBase, not MemberCore.
13542 * const.cs (Const): Derive from MemberBase, not MemberCore.
13544 2003-08-25 Martin Baulig <martin@ximian.com>
13546 * convert.cs (Convert.ExplicitReferenceConversion): When
13547 converting from an interface type to a class, unbox if the target
13548 type is a struct type. Fixes #47822.
13550 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13552 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
13555 2003-08-22 Martin Baulig <martin@ximian.com>
13557 * class.cs (TypeManager.DefineType): When defining a nested type,
13558 call DefineType() on our parent; fixes #47801.
13560 2003-08-22 Martin Baulig <martin@ximian.com>
13562 * class.cs (MethodData.Define): While checking if a method is an
13563 interface implementation, improve the test a bit more to fix #47654.
13565 2003-08-22 Martin Baulig <martin@ximian.com>
13567 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
13568 correctly; fixes #47722.
13570 2003-08-22 Martin Baulig <martin@ximian.com>
13572 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
13573 LocalVariableReference, ensure it's not read-only. Fixes #47536.
13575 * statement.cs (Fixed.DoResolve): Make all variables read-only.
13577 2003-08-22 Martin Baulig <martin@ximian.com>
13579 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
13580 can only be assigned in static constructors. Fixes #47161.
13582 2003-08-22 Martin Baulig <martin@ximian.com>
13584 Rewrote and improved the flow analysis code.
13586 * flowbranching.cs (FlowBranching): Make this class abstract.
13587 (FlowBranching.CreateBranching): New static function to create a
13588 new flow branching.
13589 (FlowBranchingBlock, FlowBranchingException): New classes.
13590 (FlowBranching.UsageVector.Type): New public readonly field.
13591 (FlowBranching.UsageVector.Breaks): Removed the setter.
13592 (FlowBranching.UsageVector.Returns): Removed the setter.
13593 (FlowBranching.UsageVector): Added Break(), Return(),
13594 NeverReachable() and Throw() methods to modify the reachability.
13595 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
13596 done by FlowBranching.Merge().
13597 (FlowBranching.UsageVector.MergeChild): New method; merges the
13598 merge result into the current vector.
13599 (FlowBranching.Merge): New abstract method to merge a branching.
13601 2003-08-12 Martin Baulig <martin@ximian.com>
13603 * expression.cs (Indirection.CacheTemporaries): Create the
13604 LocalTemporary with the pointer type, not its element type.
13606 2003-08-10 Miguel de Icaza <miguel@ximian.com>
13608 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
13609 token was a keyword or not.
13611 Add `error' options where an IDENTIFIER was expected; Provide
13612 CheckToken and CheckIdentifierToken convenience error reporting
13615 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
13617 * decl.cs: Rename `NamespaceEntry Namespace' public field into
13618 NameSpaceEntry NameSpaceEntry.
13620 (LookupInterfaceOrClass): Avoid creating a full qualified name
13621 from namespace and name: avoid doing lookups when we know the
13622 namespace is non-existant. Use new Tree.LookupByNamespace which
13623 looks up DeclSpaces based on their namespace, name pair.
13625 * driver.cs: Provide a new `parser verbose' to display the
13626 exception thrown during parsing. This is turned off by default
13627 now, so the output of a failure from mcs is more graceful.
13629 * namespace.cs: Track all the namespaces defined in a hashtable
13632 (IsNamespace): New method
13634 2003-08-09 Miguel de Icaza <miguel@ximian.com>
13636 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
13637 we know that we need to concatenate (full typename can never be
13642 * statement.cs: Use a bitfield; Do not initialize to null things
13643 which are done by the constructor by default.
13645 * cs-parser.jay: bug fix, parameter was 4, not 3.
13647 * expression.cs: Just use the property;
13649 * statement.cs: No need for GetVariableInfo method.
13651 2003-08-08 Martin Baulig <martin@ximian.com>
13653 * flowanalysis.cs (FlowReturns): This is now nested in the
13654 `FlowBranching' class.
13655 (MyBitVector): Moved this here from statement.cs.
13656 (FlowBranching.SiblingType): New enum type.
13657 (FlowBranching.CreateSibling): Added `SiblingType' argument.
13659 2003-08-07 Martin Baulig <martin@ximian.com>
13661 * flowanalysis.cs (FlowBranchingType): This is now nested in the
13662 `FlowBranching' class and called `BranchingType'.
13664 2003-08-07 Martin Baulig <martin@ximian.com>
13666 * flowanalysis.cs: Moved all the control flow analysis code into
13669 2003-08-07 Martin Baulig <martin@ximian.com>
13671 * assign.cs (Assign.DoResolve): `target' must either be an
13672 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
13675 2003-08-07 Miguel de Icaza <miguel@ximian.com>
13677 * expression.cs (BinaryMethod): This kind of expression is created by the
13678 Binary class if it determines that the operator has to be handled
13681 (BinaryDelegate): This kind of expression is created if we are
13682 dealing with a + or - operator on delegates.
13684 (Binary): remove method, argumetns, and DelegateOperator: when
13685 dealing with methods,
13687 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
13689 * statement.cs (Block): use bitfields for the three extra booleans
13690 we had in use. Remove unused topblock parameter.
13692 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
13694 * assign.cs: Drop extra unneeded tests.
13696 2003-08-06 Miguel de Icaza <miguel@ximian.com>
13698 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
13700 * statement.cs (Foreach): Use VariableStorage instead of
13703 * codegen.cs (VariableStorage): New class used by clients that
13704 require a variable stored: locals or fields for variables that
13705 need to live across yield.
13707 Maybe provide a convenience api for EmitThis+EmitLoad?
13709 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
13712 2003-08-05 Miguel de Icaza <miguel@ximian.com>
13714 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
13715 RemapParameterLValue): New methods that are used to turn a
13716 precomputed FieldInfo into an expression like this:
13720 The idea is to use this instead of making LocalVariableReference
13721 have more than one meaning.
13723 * cs-parser.jay: Add error production to BASE.
13725 * ecore.cs: Deal with TypeManager.GetField returning null, which
13726 is now a valid return value.
13728 (FieldExprNoAddress): New expression for Fields whose address can
13731 * expression.cs (LocalVariableReference): During the resolve
13732 phases, create new expressions if we are in a remapping context.
13733 Remove code that dealt with remapping here.
13735 (ParameterReference): same.
13737 (ProxyInstance): New expression, like the `This' expression, but
13738 it is born fully resolved. We know what we are doing, so remove
13739 the errors that are targeted to user-provided uses of `this'.
13741 * statement.cs (Foreach): our variable is now stored as an
13742 Expression; During resolution, follow the protocol, dont just
13743 assume it will return this.
13745 2003-08-06 Martin Baulig <martin@ximian.com>
13747 * support.cs (SeekableStreamReader.cs): New public class.
13749 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
13750 SeekableStreamReader instead of the normal StreamReader.
13752 2003-08-04 Martin Baulig <martin@ximian.com>
13754 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
13755 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
13756 deambiguate casts and delegate invocations.
13757 (parenthesized_expression): Use the new tokens to ensure this is
13758 not a cast of method invocation.
13760 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
13761 when reading a `)' and Deambiguate_CloseParens () was previously
13764 * expression.cs (ParenthesizedExpression): New class. This is
13765 just used for the CS0075 test.
13766 (Binary.DoResolve): Check for CS0075.
13768 2003-07-29 Ravi Pratap <ravi@ximian.com>
13770 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
13771 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
13772 reference comparison.
13774 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
13775 examine the ReturnType for equality - this is necessary in the
13776 cases of implicit and explicit operators whose signature also
13777 includes the return type.
13779 2003-07-26 Miguel de Icaza <miguel@ximian.com>
13781 * namespace.cs: Cache the result of the namespace computation,
13782 instead of computing it every time.
13784 2003-07-24 Miguel de Icaza <miguel@ximian.com>
13786 * decl.cs: Use a global arraylist that we reuse over invocations
13787 to avoid excesive memory consumption. Reduces memory usage on an
13788 mcs compile by one meg (45 average).
13790 * typemanager.cs (LookupTypeReflection): In .NET pointers are
13791 private, work around that.
13793 2003-07-23 Miguel de Icaza <miguel@ximian.com>
13795 * literal.cs (IntLiteral): Define Zero and One static literals.
13797 * cs-parser.jay (integer_literal): use static literals to reduce
13798 memory usage for the most used literals (0, 1 and -1). 211kb
13799 reduced in memory usage.
13801 Replace all calls to `new ArrayList' with `new
13802 ArrayList(4)' which is a good average number for most allocations,
13803 and also requires only 16 bytes of memory for its buffer by
13806 This reduced MCS memory usage in seven megabytes for the RSS after
13809 2003-07-28 Ravi Pratap <ravi@ximian.com>
13811 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
13812 handle params methods the correct way by forming only one
13813 applicable set with params and normal methods in them. Earlier we
13814 were looking at params methods only if we found no normal methods
13815 which was not the correct thing to do.
13817 (Invocation.BetterFunction): Take separate arguments indicating
13818 when candidate and the best method are params methods in their
13821 This fixes bugs #43367 and #46199.
13823 * attribute.cs: Documentation updates.
13825 (CheckAttribute): Rename to CheckAttributeTarget.
13826 (GetValidPlaces): Rename to GetValidTargets.
13828 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
13829 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
13833 2003-07-28 Miguel de Icaza <miguel@ximian.com>
13835 * codegen.cs: Compute IsGeneric correctly.
13837 * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
13840 Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
13841 OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
13842 regressions, and I was chasing more bugs than I required.
13844 * interface.cs: Use expressions for base type names (like classes
13845 and structs have been doing for a while now), and resolve that.
13846 This patch should probably go into head as well.
13848 This makes it one less user of FindType.
13850 2003-07-24 Miguel de Icaza <miguel@ximian.com>
13852 This compiler can not self host currently. Need to fix that.
13854 * Makefile: compile to `gmcs.exe'
13856 * driver.cs: Turn on v2 by default on gmcs.
13858 * generic.cs (ConstructedType): Does no longer take a container
13859 type argument; That will be taken care of later.
13861 (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
13862 Use SimpleName to resolve for now, so we can continue the work on
13863 the parser, until we get Type.GetType that understands generics.
13865 (ConstructedType.ToString): Implement
13867 (TypeArguments.Resolve): Resolve the child expressions as types.
13869 * cs-parser.jay: Rename interface_constraints to
13870 type_parameter_constraints
13872 (namespace_or_type_name): Only use constructed types for the basic
13873 construction, we will deal with identifier<...> later.
13875 (type/type_name): No longer call DecomposeQI, as
13876 namespace_or_type_name is always decoded now.
13878 2003-07-22 Ravi Pratap <ravi@ximian.com>
13880 * expression.cs (Invocation.OverloadResolve): Follow the spec more
13881 closely: we eliminate methods in base types when we have an
13882 applicable method in a top-level type.
13884 Please see section 14.5.5.1 for an exact description of what goes
13887 This fixes bug #45127 and a host of other related to corlib compilation.
13889 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13890 array is the method corresponding to the top-level type (this is
13891 because of the changes made to icall.c) so we change this
13894 (MethodGroupExpr.Name): This too.
13896 * typemanager.cs (GetElementType): New method which does the right
13897 thing when compiling corlib.
13899 * everywhere: Make use of the above in the relevant places.
13901 2003-07-22 Martin Baulig <martin@ximian.com>
13903 * cs-parser.jay (invocation_expression): Moved
13904 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
13905 `cast_expression', but create a InvocationOrCast which later
13906 resolves to either an Invocation or a Cast.
13908 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
13909 method; call this before EmitStatement() to make sure that this
13910 expression can be used as a statement.
13912 * expression.cs (InvocationOrCast): New class; resolves to either
13913 an Invocation or a Cast.
13915 * statement.cs (StatementExpression): Call ResolveStatement() on
13916 the ExpressionStatement before emitting it.
13918 2003-07-21 Martin Baulig <martin@ximian.com>
13920 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
13921 `ref' and `out' attributes match; fixes #46220.
13922 (MemberAccess.ResolveMemberAccess): You can't reference a type
13923 through an expression; fixes #33180.
13924 (Indexers.GetIndexersForType): Don't return the indexers from
13925 interfaces the class implements; fixes #46502.
13927 2003-07-21 Martin Baulig <martin@ximian.com>
13929 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
13930 CS0661 checks; fixes bug #30442.
13932 2003-07-21 Martin Baulig <martin@ximian.com>
13934 * decl.cs (AdditionResult): Added `Error'.
13936 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
13938 * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
13939 cs0031.cs actually work.
13941 2003-07-20 Miguel de Icaza <miguel@ximian.com>
13943 * cs-parser.jay (namespace_name): do not use
13944 namespace_or_type_name, use qualified_identifier, because
13945 namespace_or_type_name will soon return a composed expression
13946 instead of a string.
13948 (namespace_or_type_name): Instead of returning a string, now this
13949 production returns an expression.
13951 * codegen.cs (EmitContext): Setup IsGeneric property based on
13952 whether our DeclSpace is generic, our the method is generic.
13954 * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
13955 the method is generic.
13957 * cs-parser.jay (type_arguments, opt_type_argument_list,
13958 type_parameters, type_parameter_list, opt_type_parameter_list,
13959 type_parameter,, opt_type_parameter_constraints_clauses,
13960 type_parameter_constraints_clauses,
13961 type_parameter_constraint_clause, type_parameter_constraint,
13962 interface_constraints): Add new production
13964 * decl.cs (DeclSpace): IsGeneric, flag to track whether this
13965 DeclSpace is generic or not.
13967 (DeclSpace.SetParameterInfo): New routine, used to set the
13968 parameter info for a type.
13970 (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
13971 returns a GenericTypeExpr
13973 * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
13974 generic, lookup the generic argument.
13976 * attribute.cs: Do not allow TypeParameterExpressions in
13979 * class.cs: Do not allow the Main method to be defined in a
13982 * expression.cs (SizeOf): Do not allow generic types to be used as
13983 arguments to sizeof.
13985 * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
13986 it: whether a type is generic or not. Only works for types we are
13987 currently building for now.
13989 2003-07-20 Martin Baulig <martin@ximian.com>
13991 * namespace.cs: Fixed that bug which caused a crash when compiling
13992 the debugger's GUI.
13994 2003-07-20 Miguel de Icaza <miguel@ximian.com>
13996 * typemanager.cs (LookupTypeReflection): Never expose types which
13997 are NotPublic, NestedPrivate, NestedAssembly, or
13998 NestedFamANDAssem. We used to return these, and later do a check
13999 that would report a meaningful error, but the problem is that we
14000 would not get the real match, if there was a name override.
14002 2003-07-18 Miguel de Icaza <miguel@ximian.com>
14004 * namespace.cs (Namespace, Name): Do not compute the namespace
14005 name dynamically, compute it in the constructor. This reduced
14006 memory usage by 1697 KB.
14008 * driver.cs: Use --pause to pause at the end.
14010 2003-07-17 Peter Williams <peter@newton.cx>
14012 * Makefile: Change the name of the test target so that it doesn't
14013 conflict with the recursive test target.
14015 2003-07-17 Miguel de Icaza <miguel@ximian.com>
14017 * expression.cs (LocalVariableReference.Emit, EmitAssign,
14018 AddressOf): Do not use EmitThis, that was wrong, use the actual
14021 2003-07-15 Miguel de Icaza <miguel@ximian.com>
14023 * class.cs (MethodData.Define): While checking if a method is an
14024 interface implementation, improve the test: If we are not public
14025 (use new test here: use the computed MethodAttributes directly,
14026 instead of the parsed modifier flags) check if the `implementing'
14027 method comes from an interface or not.
14029 * pending.cs (VerifyPendingMethods): Slightly better error
14032 * makefile: add test target that does the mcs bootstrap.
14034 2003-07-16 Ravi Pratap <ravi@ximian.com>
14036 * interface.cs (Define): Do nothing here since there are no
14037 members to populate etc. Move the attribute emission out of here
14038 since this was just totally the wrong place to put it. Attribute
14039 application happens during the 'Emit' phase, not in the 'Define'
14042 (Emit): Add this method and move the attribute emission here
14044 * rootcontext.cs (EmitCode): Call the Emit method on interface
14047 2003-07-14 Ravi Pratap M <ravi@ximian.com>
14049 * expression.cs (OverloadResolve): Report error only if Location
14050 is not 'Null' which means that there was a probe going on.
14052 2003-07-14 Martin Baulig <martin@ximian.com>
14054 * expression.cs (ConditionalLogicalOperator): New public class to
14055 implement user defined conditional logical operators.
14056 This is section 14.11.2 in the spec and bug #40505.
14058 2003-07-14 Martin Baulig <martin@ximian.com>
14060 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
14062 2003-07-14 Martin Baulig <martin@ximian.com>
14064 * codegen.cs (EmitContext.InFixedInitializer): New public field.
14066 * ecore.cs (IVariable.VerifyFixed): New interface method.
14068 * expression.cs (Unary.ResolveOperator): When resolving the `&'
14069 operator, check whether the variable is actually fixed. Fixes bug
14070 #36055. Set a variable definitely assigned when taking its
14071 address as required by the spec.
14073 * statement.cs (LocalInfo.IsFixed): New field.
14074 (LocalInfo.MakePinned): Set `IsFixed' to true.
14076 2003-07-14 Ravi Pratap M <ravi@ximian.com>
14078 * attribute.cs (Attribute.Resolve): While doing a Member lookup
14079 for .ctors, ensure that we only ask for members declared in the
14080 attribute type (BindingFlags.DeclaredOnly).
14084 * expression.cs (Error_WrongNumArguments): Report error 1501
14085 correctly the way CSC does.
14087 2003-07-13 Martin Baulig <martin@ximian.com>
14089 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
14090 lookup on the fully qualified name, to make things like "X.X" work
14091 where "X.X" is a fully qualified type name, but we also have a
14092 namespace "X" in the using list. Fixes #41975.
14094 2003-07-13 Martin Baulig <martin@ximian.com>
14096 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
14097 function. If we're a CompoundAssign, we need to create an embedded
14098 CompoundAssign, not an embedded Assign.
14099 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
14102 2003-07-13 Martin Baulig <martin@ximian.com>
14104 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
14105 work to fix bug #46088.
14107 2003-07-13 Ravi Pratap <ravi@ximian.com>
14109 * class.cs (Operator.Emit): Do not emit attributes here - it is
14110 taken care of by the Method class that we delegate too. This takes
14111 care of bug #45876.
14113 2003-07-10 Martin Baulig <martin@ximian.com>
14115 * expression.cs (TypeOfVoid): New class.
14116 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
14118 2003-07-10 Martin Baulig <martin@ximian.com>
14120 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
14123 2003-07-10 Martin Baulig <martin@ximian.com>
14125 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
14126 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
14128 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
14130 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
14132 2003-07-10 Martin Baulig <martin@ximian.com>
14134 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
14135 of decimal. Fixes #42850.
14137 NOTE: I also fixed the created byte blob, but this doesn't work on
14138 the MS runtime and csc never produces any byte blobs for decimal
14141 2003-07-10 Martin Baulig <martin@ximian.com>
14143 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
14144 structs; fixes #32068.
14145 (Block.AddChildVariableNames): Fixed #44302.
14147 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14149 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
14151 2003-07-07 Miguel de Icaza <miguel@ximian.com>
14153 * attribute.cs: And this test is onger needed.
14155 2003-07-08 Martin Baulig <martin@ximian.com>
14157 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
14158 inaccessible types. Fixes #36313.
14160 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
14162 * namespace.cs (NamespaceEntry): Create implicit entries for all
14163 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
14164 implicit entries for N1.N2 and N1.
14166 2003-07-08 Martin Baulig <martin@ximian.com>
14168 Rewrote the handling of namespaces to fix a lot of the issues
14169 wrt. `using' aliases etc.
14171 * namespace.cs (Namespace): Splitted this class into a
14172 per-assembly `Namespace' and a per-file `NamespaceEntry'.
14174 * typemanager.cs (TypeManager.IsNamespace): Removed.
14175 (TypeManager.ComputeNamespaces): Only compute namespaces from
14176 loaded assemblies here, not the namespaces from the assembly we're
14177 currently compiling.
14179 2003-07-08 Martin Baulig <martin@ximian.com>
14181 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
14183 2003-07-07 Miguel de Icaza <miguel@ximian.com>
14185 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
14188 I thought about the memory savings here, but LookupTypeReflection
14189 is used under already very constrained scenarios. Compiling
14190 corlib or mcs only exposes one hit, so it would not really reduce
14191 any memory consumption.
14193 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14195 * typemanager.cs: fixes bug #45889 by only adding public types from
14196 other assemblies to the list of known types.
14198 2003-07-07 Miguel de Icaza <miguel@ximian.com>
14200 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
14201 on the type we resolved.
14203 2003-07-05 Martin Baulig <martin@ximian.com>
14205 * pending.cs (PendingImplementation.ParentImplements): Don't
14206 create the proxy if the parent is abstract.
14208 * class.cs (TypeContainer.DefineIndexers): Process explicit
14209 interface implementations first. Fixes #37714.
14211 2003-07-04 Miguel de Icaza <miguel@ximian.com>
14213 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
14214 defined recursively; but since we modify the input parameters
14215 (left is set to `this' temporarily), we reset this value if the
14216 left_is_explicit is false, which gives the original semantics to
14219 * literal.cs (NullPointer): new class used to represent a null
14220 literal in a pointer context.
14222 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
14223 type is a pointer, use a NullPointer object instead of a
14224 NullLiteral. Closes 43687
14226 (ExplicitConversion): Convert pointer values using
14227 the conv opcode to the proper type.
14229 * ecore.cs (New): change ValueTypeVariable property into a method,
14230 that returns whether the valuetype is suitable for being used.
14232 * expression.cs (Binary.DoNumericPromotions): Only return if we
14233 the int constant was a valid uint, and we can return both left and
14234 right as uints. If not, we continue processing, to trigger the
14235 type conversion. This fixes 39018.
14237 * statement.cs (Block.EmitMeta): During constant resolution, set
14238 the CurrentBlock property on the emitcontext, so that we resolve
14239 constants propertly.
14241 2003-07-02 Martin Baulig <martin@ximian.com>
14243 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
14244 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
14246 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
14247 than emitting it here.
14249 * statement.cs: Fixed some more flow analysis bugs.
14251 2003-07-02 Martin Baulig <martin@ximian.com>
14253 * class.cs (MethodData.Define): When implementing interface
14254 methods, set Final unless we're Virtual.
14256 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
14257 check work for interface methods.
14259 2003-07-01 Martin Baulig <martin@ximian.com>
14261 * ecore.cs (EmitContext.This): Replaced this property with a
14262 GetThis() method which takes a Location argument. This ensures
14263 that we get the correct error location for a CS0188.
14265 2003-07-01 Miguel de Icaza <miguel@ximian.com>
14267 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
14268 ImplicitStandardConversion.
14270 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
14272 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
14274 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
14277 2003-06-30 Miguel de Icaza <miguel@ximian.com>
14279 * class.cs (Constructor.Define): Turn off initlocals for unsafe
14282 (MethodData.Define): Turn off initlocals for unsafe methods.
14284 2003-06-29 Miguel de Icaza <miguel@ximian.com>
14286 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
14287 complete; Fixes #37521.
14289 * delegate.cs: Use Modifiers.TypeAttr to compute the
14290 TypeAttributes, instead of rolling our own. This makes the flags
14291 correct for the delegates.
14293 2003-06-28 Miguel de Icaza <miguel@ximian.com>
14295 * class.cs (Constructor.Define): Set the private flag for static
14296 constructors as well.
14298 * cs-parser.jay (statement_expression): Set the return value to
14299 null, to avoid a crash when we catch an error.
14301 2003-06-24 Miguel de Icaza <miguel@ximian.com>
14303 * cs-parser.jay: Applied patch from Jackson that adds support for
14304 extern and unsafe modifiers to destructor declarations.
14306 * expression.cs: Report error 21 if the user is trying to index a
14309 * driver.cs: Add an error message, suggested by the bug report.
14311 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
14312 if we do not have a ": this ()" constructor initializer. Fixes 45149
14314 2003-06-14 Miguel de Icaza <miguel@ximian.com>
14316 * namespace.cs: Add some information to reduce FAQs.
14318 2003-06-13 Miguel de Icaza <miguel@ximian.com>
14320 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
14321 underlying enumeration types. Fixes #43915.
14323 * expression.cs: Treat ushort/short as legal values to be used in
14324 bitwise operations.
14326 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
14328 * delegate.cs: transfer custom attributes for paramenters from
14329 the delegate declaration to Invoke and BeginInvoke.
14331 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
14333 * attribute.cs: handle custom marshalers and emit marshal info
14336 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
14338 * makefile.gnu: Added anonymous.cs to the compiler sources.
14340 2003-05-28 Miguel de Icaza <miguel@ximian.com>
14342 * iterators.cs: Change the name of the proxy class to include two
14345 * cs-parser.jay: Update grammar to include anonymous methods.
14347 * anonymous.cs: new file.
14349 2003-05-27 Miguel de Icaza <miguel@ximian.com>
14351 * class.cs (Field.Define): Add missing test for pointers and
14354 2003-05-27 Ravi Pratap <ravi@ximian.com>
14356 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
14357 we use the stobj opcode.
14359 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
14360 since it wasn't the correct fix.
14362 It still is puzzling that we are required to use stobj for IntPtr
14363 which seems to be a ValueType.
14365 2003-05-26 Miguel de Icaza <miguel@ximian.com>
14367 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
14368 during regular simple name resolution. Now, the trick is that
14369 instead of returning for processing the simplename, we do a
14370 TypeManager.LookupType (ie, a rooted lookup as opposed to a
14371 contextual lookup type). If a match is found, return that, if
14372 not, return for further composition.
14374 This fixes long-standing 30485.
14376 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14377 using the address to initialize an object, do an Stobj instead of
14378 using the regular Stelem.
14380 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
14381 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
14382 Because if we are a BaseIndexerAccess that value will be true.
14385 * statement.cs (GotoCase.Resolve): Return after reporting an
14386 error, do not attempt to continue.
14388 * expression.cs (PointerArithmetic.Emit): If our operand is a
14389 long, convert our constants to match the operand before
14390 multiplying. Convert to I type before adding. Fixes 43670.
14392 2003-05-14 Ravi Pratap <ravi@ximian.com>
14394 * enum.cs (ImplicitConversionExists) : Rename to
14395 ImplicitEnumConversionExists to remove ambiguity.
14397 * ecore.cs (NullCast): New type of cast expression class which
14398 basically is very similar to EmptyCast with the difference being
14399 it still is a constant since it is used only to cast a null to
14401 (eg. (string) null)
14403 * convert.cs (ImplicitReferenceConversion): When casting a null
14404 literal, we return a NullCast.
14406 * literal.cs (NullLiteralTyped): Remove - I don't see why this
14407 should be around anymore.
14409 The renaming (reported was slightly wrong). Corrections:
14411 ConvertImplicitStandard -> ImplicitConversionStandard
14412 ConvertExplicitStandard -> ExplicitConversionStandard
14414 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
14415 before passing them in !
14417 * convert.cs (ImplicitConversionStandard): When comparing for
14418 equal expr and target types, ensure that expr is not a
14421 In general, we must not be checking (expr_type ==
14422 target_type) in the top level conversion methods
14423 (ImplicitConversion, ExplicitConversion etc). This checking is
14424 done in the methods that they delegate to.
14426 2003-05-20 Miguel de Icaza <miguel@ximian.com>
14428 * convert.cs: Move Error_CannotConvertType,
14429 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
14430 ImplicitNumericConversion, ImplicitConversionExists,
14431 ImplicitUserConversionExists, StandardConversionExists,
14432 FindMostEncompassedType, FindMostSpecificSource,
14433 FindMostSpecificTarget, ImplicitUserConversion,
14434 ExplicitUserConversion, GetConversionOperators,
14435 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
14436 TryImplicitIntConversion, Error_CannotConvertImplicit,
14437 ConvertImplicitRequired, ConvertNumericExplicit,
14438 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
14439 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
14442 Perform the following renames:
14444 StandardConversionExists -> ImplicitStandardConversionExists
14445 ConvertImplicit -> ImplicitConversion
14446 ConvertImplicitStandard -> ImplicitStandardConversion
14447 TryImplicitIntConversion -> ImplicitIntConversion
14448 ConvertImplicitRequired -> ImplicitConversionRequired
14449 ConvertNumericExplicit -> ExplicitNumericConversion
14450 ConvertReferenceExplicit -> ExplicitReferenceConversion
14451 ConvertExplicit -> ExplicitConversion
14452 ConvertExplicitStandard -> ExplicitStandardConversion
14454 2003-05-19 Martin Baulig <martin@ximian.com>
14456 * statement.cs (TypeInfo.StructInfo): Made this type protected.
14457 (TypeInfo): Added support for structs having structs as fields.
14459 * ecore.cs (FieldExpr): Implement IVariable.
14460 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
14461 VariableInfo for the field.
14463 2003-05-18 Martin Baulig <martin@ximian.com>
14465 * expression.cs (This.DoResolve): Report a CS0027 if we're
14466 emitting a field initializer.
14468 2003-05-18 Martin Baulig <martin@ximian.com>
14470 * expression.cs (This.ResolveBase): New public function.
14471 (This.DoResolve): Check for CS0188.
14473 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
14476 * ecore.cs (MethodGroupExpr.DoResolve): Set the
14477 `instance_expression' to null if we don't have any non-static
14480 2003-05-18 Martin Baulig <martin@ximian.com>
14482 Reworked the way how local variables and parameters are handled by
14483 the flow analysis code.
14485 * statement.cs (TypeInfo, VariableMap): New public classes.
14486 (VariableInfo): New public class. This is now responsible for
14487 checking whether a variable has been assigned. It is used for
14488 parameters and local variables.
14489 (Block.EmitMeta): Take the InternalParameters as argument; compute
14490 the layout of the flow vectors here.
14491 (Block.LocalMap, Block.ParameterMap): New public properties.
14492 (FlowBranching): The .ctor doesn't get the InternalParameters
14493 anymore since Block.EmitMeta() now computes the layout of the flow
14495 (MyStructInfo): This class is now known as `StructInfo' and nested
14496 in `TypeInfo'; we don't access this directly anymore.
14498 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
14499 property and removed IsAssigned(), IsFieldAssigned(),
14500 SetAssigned() and SetFieldAssigned(); we now call them on the
14501 VariableInfo so we don't need to duplicate this code everywhere.
14503 * expression.cs (ParameterReference): Added `Block block' argument
14505 (LocalVariableReference, ParameterReference, This): The new
14506 VariableInfo class is now responsible for all the definite
14509 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
14510 IsParameterAssigned, SetParameterAssigned): Removed.
14512 2003-05-18 Martin Baulig <martin@ximian.com>
14514 * typemanager.cs (InitCoreTypes): Try calling
14515 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
14516 the 3-args-version. Corlib now also needs our `void_type'.
14517 (GetMethod): Added overloaded version which takes an optional
14518 `bool report_errors' to allow lookups of optional methods.
14520 2003-05-12 Martin Baulig <martin@ximian.com>
14522 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
14523 only used for locals and not for parameters.
14525 2003-05-12 Miguel de Icaza <miguel@ximian.com>
14527 * support.cs (InternalParameters.ParameterType): Return the
14528 ExternalType of the parameter.
14530 * parameter.cs (Parameter.ExternalType): drop the two arguments,
14533 2003-05-11 Miguel de Icaza <miguel@ximian.com>
14535 * class.cs (MethodData.Define): Do not set the `newslot' on
14536 interface members, if they are also flagged as "override".
14538 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
14539 better code for ++i and i++. This only works for static fields
14540 and local variables.
14542 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
14543 want to pull the DeclSpace out of the builder_to_declspace instead
14544 of the TypeBuilder (like in TypeContainer.FindMembers).
14546 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
14547 instead of LookupTypeContainer. Fixes the crash on .NET for
14548 looking up interface members.
14550 * const.cs: Create our own emit context during the Definition
14551 stage, so that constants are evaluated in the proper context, when
14552 a recursive definition happens.
14554 2003-05-11 Martin Baulig <martin@ximian.com>
14556 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
14557 new block for a switch section.
14558 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
14559 the adding/lookup in the switch block. Fixes #39828.
14561 2003-05-09 Miguel de Icaza <miguel@ximian.com>
14563 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
14564 functionality: I needed to convert the data after I had performed
14565 the add/sub operation into the operands type size.
14567 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
14568 pass the type for the box operation, otherwise the resulting
14569 object would have been of type object.
14571 (BoxedCast): Add constructor to specify the type to box as.
14573 2003-05-07 Miguel de Icaza <miguel@ximian.com>
14575 * iterators.cs: I was reusing the `count' variable inadvertently,
14576 take steps to not allow this to happen.
14578 2003-05-06 Miguel de Icaza <miguel@ximian.com>
14580 * attribute.cs (Attribute.Resolve): Params attributes are encoded
14581 by creating an array at the point where the params starts and
14582 putting all those arguments there, then adjusting the size of the
14585 2003-05-05 Miguel de Icaza <miguel@ximian.com>
14587 * expression.cs (New.AddressOf): Implement interface
14588 IMemoryLocation. This is used when the `new' operator is used in
14589 the context of an invocation to a method on a value type.
14591 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
14594 * namespace.cs: Also check the using aliases here.
14596 * driver.cs: Move the test for using validity after the types have
14597 been entered, so we do a single pass that also includes the using
14600 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
14601 in the regular case. CreateSiblingForFinally is doing extra
14604 * attribute.cs (GetAttributeArgumentExpression): Store the result
14605 on an out value, and use the return value to indicate failure
14606 instead of using null (which is a valid return for Constant.GetValue).
14608 * statement.cs: Perform the analysis flow for the increment
14609 portion after the statement, because this will be the real flow of
14610 execution. Fixes #42385
14612 * codegen.cs (EmitContext.EmitArgument,
14613 EmitContext.EmitStoreArgument): New helper functions when the
14614 RemapToProxy flag is set.
14616 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
14619 Add support for remapping parameters.
14621 * iterators.cs: Propagate parameter values; Store parameter
14622 values in the proxy classes.
14624 2003-05-04 Miguel de Icaza <miguel@ximian.com>
14626 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
14627 need a proxy reference; I do not know what I was thinking
14629 * cs-parser.jay (constructor_initializer): catch another error,
14630 and display nice message.
14632 (field_declaration): catch void field declaration
14633 to flag a better error.
14635 * class.cs (MemberBase.CheckBase): Report an error instead of a
14636 warning if a new protected member is declared in a struct.
14637 (Field.Define): catch the error of readonly/volatile.
14639 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
14641 (FieldExpr.AddressOf): ditto. Catch error where the address of a
14642 volatile variable is taken
14644 2003-05-02 Miguel de Icaza <miguel@ximian.com>
14646 * statement.cs (Fixed.Resolve): Report an error if we are not in
14649 2003-05-01 Miguel de Icaza <miguel@ximian.com>
14651 * typemanager.cs: reuse the code that handles type clashes for
14652 delegates and enumerations.
14654 * class.cs (Report28): Always report.
14656 * expression.cs (EncodeAsAttribute): Allow nulls here.
14658 2003-04-28 Miguel de Icaza <miguel@ximian.com>
14660 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
14661 the functionality for testing whether an expression is valid for
14662 an attribute here. Also handle the case of arrays of elements
14665 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
14666 encoding a linear array into an array of objects that are suitable
14667 to be passed to an CustomAttributeBuilder.
14669 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
14671 * ecore.cs: (FieldExpr): Handle field remapping here.
14673 * iteratators.cs: Pass the instance variable (if the method is an
14674 instance method) to the constructors, so we can access the field
14675 variables on the class.
14677 TODO: Test this with structs. I think the THIS variable on
14678 structs might have to be a pointer, and not a refenrece
14680 2003-04-27 Miguel de Icaza <miguel@ximian.com>
14682 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
14683 local variables to fields in a proxy class.
14685 * iterators.cs (PopulateProxy): Rename our internal fields to
14687 Create a <THIS> field if we are an instance method, so we can
14688 reference our parent container variables.
14689 (MapVariable): Called back from the EmitContext code to enter a
14690 new variable to field mapping into the proxy class (we just create
14694 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
14695 for using the remapped locals to fields.
14697 I placed the code here, because that gives the same semantics to
14698 local variables, and only changes the Emit code.
14700 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
14701 statements inside iterators.
14702 (VariableInfo): Add a FieldBuilder for the cases when we are
14703 remapping local variables to fields in a proxy class
14705 * ecore.cs (SimpleNameResolve): Avoid testing two times for
14706 current_block != null.
14708 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
14709 not cope with strings, as it has been moved to the
14710 TableSwitchEmit. Fixed bug in switch generation.
14712 * expression.cs (New.DoResolve): Provide more context for the user
14713 when reporting an error.
14715 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
14718 * expression.cs (MemberAccess.DoResolve): When we get a type back,
14719 check the permissions for it. Note than in a type-resolution
14720 context the check was already present in DeclSpace.ResolveType,
14721 but was missing from the MemberAccess.
14723 (ArrayCreation.CheckIndices): warn if the user has
14724 more nested levels of expressions, but there are no more
14725 dimensions specified. Avoids crash on bug 41906.
14727 2003-04-26 Miguel de Icaza <miguel@ximian.com>
14729 * statement.cs (Block): replace Implicit bool, for a generic
14731 New flag: `Unchecked'. This is used during the EmitMeta phase
14732 (which is out-of-line with the regular Resolve/Emit process for a
14733 statement, as this is done ahead of time, but still gets a chance
14734 to call constant resolve).
14736 (Block.Flags): new enum for adding a new flag.
14738 (Block.EmitMeta): track the state of unchecked.
14740 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
14741 to enable constant resolution to work there as well.
14743 2003-04-22 Miguel de Icaza <miguel@ximian.com>
14745 * typemanager.cs (ienumerable_type): Also look up
14746 System.Collections.IEnumerable.
14748 2003-04-21 Miguel de Icaza <miguel@ximian.com>
14750 TODO: Test more than one conditional per method.
14752 * class.cs (Indexer.Define): Report the location where the user is
14753 referencing the unsupported feature.
14755 (MethodData): Overload the use of `conditionals' to
14756 minimize the creation of needless ArrayLists. This saves roughly
14757 212kb on my machine.
14759 (Method): Implement the new IIteratorContainer interface.
14760 (Method.SetYields): Implement the method by setting the ModFlags
14761 to contain METHOD_YIELDS.
14763 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
14764 which just got set to null.
14766 * iterators.cs: New file.
14768 (Yield, YieldBreak): New statements.
14770 * statement.cs (Return.Resolve): Flag an error if we are used in
14771 an iterator method.
14773 * codegen.cs (InIterator): New flag set if the code is being
14774 compiled in an iterator method.
14776 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
14777 internal modifier, and we just use it to avoid adding extra
14778 fields, as this is seldom used.
14780 * cs-parser.jay: Add yield_statement (yield and yield break).
14782 * driver.cs: New flag -v2 to turn on version 2 features.
14784 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
14785 hashtable when v2 is enabled.
14787 2003-04-20 Miguel de Icaza <miguel@ximian.com>
14789 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
14790 there is already a namespace defined with this name.
14792 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
14793 people upgraded their corlibs.
14795 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
14796 always use fully qualified types, no need to use the compiler
14799 (TypeManager.IsNamespace): Use binarysearch.
14801 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
14802 AddDelegate): I did not quite use the new IsValid API properly: I
14803 have to pass the short-name and the fullname. I was passing only
14804 the basename instead of the fullname sometimes.
14806 (TypeContainer.DefineType): call NamespaceClash.
14808 * interface.cs (Interface.DefineType): use NamespaceClash before
14811 * delegate.cs (Delegate.DefineType): use NamespaceClash before
14814 * enum.cs: (Enum.DefineType): use NamespaceClash before
14817 * typemanager.cs (: 3-line patch that gives us some tasty 11%
14818 speed increase. First, use the negative_hits cache when we get a
14819 negative. Second, add the type with its full original name
14820 instead of the new . and + encoded name (reflection uses + to
14821 separate type from a nested type). Use LookupTypeReflection
14822 directly which bypasses the type->name hashtable (that we already
14823 know does not contain the type.
14825 * decl.cs (DeclSpace.ResolveTypeExpr): track the
14826 location/container type.
14828 * driver.cs: When passing utf8, use directly the UTF8Encoding.
14830 2003-04-19 Miguel de Icaza <miguel@ximian.com>
14832 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
14834 * delegate.cs (NewDelegate.Resolve): Test whether an instance
14835 method is being referenced in the method group from a static
14836 context, and report error 120 if so.
14838 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
14841 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
14842 is created, we create the A namespace).
14844 * cs-parser.jay: A namespace also introduces a DeclarationFound.
14847 2003-04-18 Miguel de Icaza <miguel@ximian.com>
14849 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
14850 invocation to ModuleBuilder.GetType with the same values will
14851 return a new type instance, so we need to cache its return
14854 * expression.cs (Binary.ResolveOperator): Only allow the compare
14855 operators on enums if they are of the same type.
14857 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
14858 types of ValueType on their own case. Before we were giving them
14859 the same treatment as objects.
14861 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
14862 fullname. Short name is used to compare against container name.
14863 Fullname is used to check against defined namespace names.
14865 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
14866 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
14868 (Method.CheckBase): Call parent.
14869 (MemberBase.CheckBase): Check for protected members on sealed
14871 (PropertyBase.CheckBase): Call parent.
14872 (Field.Define): Call parent.
14874 * report.cs: Negative error codes are now mapped to 8000 - code,
14875 so that the display is render more nicely.
14877 * typemanager.cs: Do not use try/catch, instead report a regular
14880 (GetPointerType, GetReferenceType): These methods provide
14881 mechanisms to obtain the T* and T& from a T. We had the code
14882 previously scattered around the code base, and it also used
14883 TypeManager.LookupType that would go through plenty of caches.
14884 This one goes directly to the type source.
14886 In some places we did the Type.GetType followed by
14887 ModuleBuilder.GetType, but not in others, so this unifies the
14888 processing as well.
14890 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14891 statements now that we have namespace information.
14893 * typemanager.cs (IsNamespace): New method, returns whether the
14894 string presented is a namespace or not.
14896 (ComputeNamespaces): New public entry point, computes the list of
14897 available namespaces, using the GetNamespaces API call in Mono, or
14898 the slower version in MS.NET.
14900 Now before we start the semantic analysis phase, we have a
14901 complete list of namespaces including everything that the user has
14904 Deleted old code to cache namespaces in .nsc files.
14906 2003-04-17 Miguel de Icaza <miguel@ximian.com>
14908 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14909 class/struct location definition Location for the implicit
14910 constructor location.
14912 (Operator.Define): Use the location of the operator for the
14913 implicit Method definition.
14915 (Constructor.Emit): use the constructor location for the implicit
14916 base initializer constructor.
14918 * ecore.cs: Remove ITypeExpression. This interface is now gone,
14919 and the Expression class now contains two new methods:
14921 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
14922 isolate type lookup from the rest of the resolution process.
14924 Since we use Expressions to hold type definitions due to the way
14925 we parse the input we have historically overloaded Resolve to
14926 perform the Type lookups if a special flag is passed. Now this is
14927 eliminated and two methods take their place.
14929 The differences in the two methods between xStep and xTerminal is
14930 that xStep is involved in our current lookup system that uses
14931 SimpleNames to compose a name, while xTerminal is used just to
14932 catch the case where the simplename lookup failed.
14934 2003-04-16 Miguel de Icaza <miguel@ximian.com>
14936 * expression.cs (ResolveMemberAccess): Remove redundant code.
14937 TypeExpr expressions are always born fully resolved.
14939 * interface.cs (PopulateMethod): Do not lookup the types twice.
14940 We were doing it once during SemanticAnalysis and once during
14943 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
14944 in local variable type definitions, were being returned as a
14945 SimpleName (we decomposed everything into a string), that is
14946 because primary_expression was being used instead of a type in the
14947 grammar (reduce/reduce conflicts).
14949 The part that was wrong is that we converted the expression into a
14950 string (an oversimplification in one hand, compounded with primary
14951 expressions doing string concatenation).
14957 Would return "A.B.C[]" as a SimpleName. This stopped things like
14958 using clauses from working on this particular context. And a type
14959 was being matched directly against "A.B.C[]".
14961 We now use the correct approach, and allow for ComposedCast to be
14962 part of the unary expression. So the "A.B.C []" become a composed
14963 cast of "A.B.C" (as a nested group of MemberAccess with a
14964 SimpleName at the end) plus the rank composition "[]".
14968 2003-04-10 Miguel de Icaza <miguel@ximian.com>
14970 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
14971 for the access level checking.
14973 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
14974 `TypeContainer container', because I kept getting confused when I
14975 was debugging this code.
14977 * expression.cs (Indexers): Instead of tracking getters/setters,
14978 we now track them in parallel. We create one arraylist less, but
14979 most importantly it is possible now for the LValue code to find a
14980 matching get for a set.
14982 (IndexerAccess.DoResolveLValue): Update the code.
14983 GetIndexersForType has been modified already to extract all the
14984 indexers from a type. The code assumed it did not.
14986 Also make the code set the correct return type for the indexer.
14987 This was fixed a long time ago for properties, but was missing for
14988 indexers. It used to be void_type.
14990 (Binary.Emit): Test first for doubles instead of
14991 floats, as they are more common.
14993 (Binary.EmitBranchable): Use the .un version of the branch opcodes
14994 when dealing with floats and the <=, >= operators. This fixes bug
14997 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14998 to load the array value by emitting a load on the foreach variable
14999 type. This was incorrect.
15001 We now emit the code to load an element using the the array
15002 variable type, and then we emit the conversion operator.
15006 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
15008 * attribute.cs: Avoid allocation of ArrayLists in the common case.
15010 2003-04-09 Miguel de Icaza <miguel@ximian.com>
15012 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
15013 test for protection before we test for signatures.
15015 (MethodSignature.ToString): implement.
15017 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
15018 to the case where we reduced into a LongConstant.
15020 * decl.cs (CheckAccessLevel): If the type is an array, we can not
15021 depend on whether the information is acurrate, because the
15022 Microsoft runtime will always claim that the array type is public,
15023 regardless of the real state.
15025 If the type is a pointer, another problem happens: the type is
15026 reported as non-public in Microsoft.
15028 In both cases we have to call CheckAccessLevel recursively with
15029 the underlying type as the argument to be tested.
15031 2003-04-08 Miguel de Icaza <miguel@ximian.com>
15033 * assign.cs (Assign.Emit): If we are dealing with a compound
15034 assignment expression, we should use the code path that stores the
15035 intermediate result in a temporary value. This fixes #40903.
15037 *expression.cs (Indirection.ToString): Provide ToString method for
15040 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
15042 * class.cs: Null out fields holding references to Block objects so
15043 they can be garbage collected.
15045 * expression.cs (OverloadResolve): Remove unused local.
15047 2003-04-07 Martin Baulig <martin@ximian.com>
15049 * codegen.cs (EmitContext.CurrentFile): New public field.
15050 (EmitContext.Mark): Use the CurrentFile to check whether the
15051 location is in the correct file.
15052 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
15054 2003-04-07 Martin Baulig <martin@ximian.com>
15056 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
15058 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
15059 location. [FIXME: The location argument which gets passed to this
15060 method is sometimes wrong!]
15062 2003-04-07 Nick Drochak <ndrochak@gol.com>
15064 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
15066 2003-04-07 Miguel de Icaza <miguel@ximian.com>
15068 * expression.cs (Indirection.EmitAssign): We were using the
15069 temporary, but returning immediately instead of continuing the
15072 2003-04-06 Martin Baulig <martin@ximian.com>
15074 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
15075 if it's a nested child, but also deriving from the outer class.
15078 * typemanager.cs (IsNestedChildOf): Make this work if it's a
15079 nested child, but also deriving from the outer class. See
15081 (FilterWithClosure): We may access private members of the outer
15082 class if we're a nested child and deriving from the outer class.
15083 (RealMemberLookup): Only set `closure_private_ok' if the
15084 `original_bf' contained BindingFlags.NonPublic.
15086 2003-04-05 Martin Baulig <martin@ximian.com>
15088 * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
15089 probe if its a type parameter, and if so, flag an error.
15091 * decl.cs: Move here the SetParameterInfo code from class.cs.
15092 Handle IsGeneric here.
15094 Handle a variety of errors in the parameter info definition.
15096 * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
15097 type parameters here.
15099 * cs-parser.jay (class_declaration): report errors for parameters
15102 2003-01-21 Miguel de Icaza <miguel@ximian.com>
15104 * generic.cs: New file, contains support code for generics.
15106 * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
15107 OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
15109 Update parser for the above removals.
15111 * cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
15112 now taken care of in the parser.
15114 2003-04-02 Miguel de Icaza <miguel@ximian.com>
15116 * class.cs (Event.Define): Do not allow abstract events to have
15119 2003-04-01 Miguel de Icaza <miguel@ximian.com>
15121 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
15122 block in event declarations.
15124 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
15125 value type, get its address.
15127 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
15128 leaving a class on the stack instead of a boolean value (int
15129 0/1). Change the code so we compare against null, and then the
15130 result against zero.
15132 * class.cs (TypeContainer.GetClassBases): We were checking for the
15133 parent class being sealed too late.
15135 * expression.cs (Binary.Emit): For <= and >= when dealing with
15136 floating point values, use cgt.un and clt.un instead of cgt and
15139 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
15141 * statement.cs: Apply the same optimization as MS: skip the
15142 GetEnumerator returning an IEnumerator, and use the one returning a
15143 CharEnumerator instead. This allows us to avoid the try-finally block
15146 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
15148 * cs-parser.jay: Attributes cannot be applied to
15149 namespaces. Fixes #40473
15151 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15154 (Add*): check if the name is valid using the full name for constants,
15155 fields, properties and events.
15157 2003-03-28 Miguel de Icaza <miguel@ximian.com>
15159 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
15160 char constants to be part of the enumeration.
15162 * expression.cs (Conditional.DoResolve): Add support for operator
15163 true. Implements the missing functionality from 14.12
15165 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
15166 operator true/false as required by the spec.
15168 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
15169 implicit conversion to boolean.
15171 * statement.cs (Statement.ResolveBoolean): A boolean expression is
15172 also one where the type implements `operator true'.
15174 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
15175 get an expression that will invoke operator true based on an
15178 (GetConversionOperators): Removed the hack that called op_True
15181 (Expression.ResolveBoolean): Move this from Statement.
15183 2003-03-17 Miguel de Icaza <miguel@ximian.com>
15185 * ecore.cs (FieldExpr): do not allow initialization of initonly
15186 fields on derived classes
15188 2003-03-13 Martin Baulig <martin@ximian.com>
15190 * statement.cs (Block.Emit): Call ig.BeginScope() and
15191 ig.EndScope() when compiling with debugging info; call
15192 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
15194 2003-03-08 Miguel de Icaza <miguel@ximian.com>
15196 * expression.cs (Indexers): Do not construct immediately, allow
15197 for new members to be appended as we go. Fixes 38143
15199 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15201 * expression.cs: save/restore context when resolving an unchecked
15204 2003-03-05 Miguel de Icaza <miguel@ximian.com>
15206 * cfold.cs: Catch division by zero in modulus operator during
15209 2003-03-03 Miguel de Icaza <miguel@ximian.com>
15211 * interface.cs (Interface.DefineMembers): Avoid defining members
15214 2003-02-27 Miguel de Icaza <miguel@ximian.com>
15216 * driver.cs: handle the +/- options for -noconfig
15218 * statement.cs (Unckeched.Resolve): Also track the state of
15219 unchecked in the Resolve phase.
15221 2003-02-27 Martin Baulig <martin@ximian.com>
15223 * ecore.cs (Expression.MemberLookup): Don't create a
15224 MethodGroupExpr for something which is not a method. Fixes #38291.
15226 2003-02-25 Miguel de Icaza <miguel@ximian.com>
15228 * class.cs (MemberBase.CheckParameters): Also check that the type
15229 is unmanaged if it is a pointer.
15231 * expression.cs (SizeOf.Resolve): Add location information.
15233 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
15234 a managed type is declared.
15236 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
15237 parameter modifiers as well. Fixes bug 38606
15239 * class.cs: Very sad. Am backing out the speed up changes
15240 introduced by the ArrayList -> Array in the TypeContainer, as they
15241 were not actually that much faster, and introduced a bug (no error
15242 reports on duplicated methods).
15244 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
15245 source first, this will guarantee that we have a valid expression
15246 before calling in lower levels functions that will require a
15247 resolved object. Then use this original_source in the
15248 target.ResolveLValue instead of the original source that was
15251 Another change. Use target.Resolve instead of LValueResolve.
15252 Although we are resolving for LValues, we will let the Assign code
15253 take care of that (it will be called again from Resolve). This
15254 basically allows code like this:
15256 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
15257 class Y { void A (X x) { x [0] += o; }
15259 The problem was that the indexer was trying to resolve for
15260 set_Item (idx, object o) and never finding one. The real set_Item
15261 was set_Item (idx, X). By delaying the process we get the right
15266 2003-02-23 Martin Baulig <martin@ximian.com>
15268 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
15269 while calling DoEmit ().
15271 * codegen.cs (EmitContext.Mark): Don't mark locations in other
15272 source files; if you use the #line directive inside a method, the
15273 compiler stops emitting line numbers for the debugger until it
15274 reaches the end of the method or another #line directive which
15275 restores the original file.
15277 2003-02-23 Martin Baulig <martin@ximian.com>
15279 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
15281 2003-02-23 Martin Baulig <martin@ximian.com>
15283 * statement.cs (Block.AddChildVariableNames): We need to call this
15284 recursively, not just for our immediate children.
15286 2003-02-23 Martin Baulig <martin@ximian.com>
15288 * class.cs (Event.Define): Always make the field private, like csc does.
15290 * typemanager.cs (TypeManager.RealMemberLookup): Make events
15291 actually work, fixes bug #37521.
15293 2003-02-23 Miguel de Icaza <miguel@ximian.com>
15295 * delegate.cs: When creating the various temporary "Parameters"
15296 classes, make sure that we call the ComputeAndDefineParameterTypes
15297 on those new parameters (just like we do with the formal ones), to
15298 allow them to be resolved in the context of the DeclSpace.
15300 This fixes the bug that Dick observed in Bugzilla #38530.
15302 2003-02-22 Miguel de Icaza <miguel@ximian.com>
15304 * expression.cs (ResolveMemberAccess): When resolving a constant,
15305 do not attempt to pull a constant if the value was not able to
15306 generate a valid constant.
15308 * const.cs (LookupConstantValue): Do not report more errors than required.
15310 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15312 * expression.cs: fixes bug #38328.
15314 2003-02-18 Miguel de Icaza <miguel@ximian.com>
15316 * class.cs: Changed all the various members that can be part of a
15317 class from being an ArrayList to be an Array of the right type.
15318 During the DefineType type_list, interface_list, delegate_list and
15319 enum_list are turned into types, interfaces, delegates and enums
15322 And during the member population, indexer_list, event_list,
15323 constant_list, field_list, instance_constructor_list, method_list,
15324 operator_list and property_list are turned into their real arrays.
15326 Although we could probably perform this operation earlier, for
15327 good error reporting we need to keep the lists and remove the
15328 lists for longer than required.
15330 This optimization was triggered by Paolo profiling the compiler
15331 speed on the output of `gen-sample-program.pl' perl script.
15333 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
15334 not crash in methods like MemberLookupFailed that use this field.
15336 This problem arises when the compiler fails to resolve a type
15337 during interface type definition for example.
15339 2003-02-18 Miguel de Icaza <miguel@ximian.com>
15341 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
15342 inherit from System.Object, so we have to stop at null, not only
15343 when reaching System.Object.
15345 2003-02-17 Miguel de Icaza <miguel@ximian.com>
15347 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
15348 DeclaredOnly because the parent indexer might have had a different
15349 name, but did not loop until the top of the hierarchy was reached.
15351 The problem this one fixes is 35492: when a class implemented an
15352 indexer from an interface, we were getting the interface method
15353 (which was abstract) and we were flagging an error (can not invoke
15356 This also keeps bug 33089 functioning, and test-148 functioning.
15358 * typemanager.cs (IsSpecialMethod): The correct way of figuring
15359 out if a method is special is to see if it is declared in a
15360 property or event, or whether it is one of the predefined operator
15361 names. This should fix correctly #36804.
15363 2003-02-15 Miguel de Icaza <miguel@ximian.com>
15365 The goal here is to remove the dependency on EmptyCast.Peel ().
15366 Killing it completely.
15368 The problem is that currently in a number of places where
15369 constants are expected, we have to "probe" for an EmptyCast, and
15370 Peel, which is not the correct thing to do, as this will be
15371 repetitive and will likely lead to errors.
15373 The idea is to remove any EmptyCasts that are used in casts that
15374 can be reduced to constants, so we only have to cope with
15377 This bug hunt was triggered by Bug 37363 and the desire to remove
15378 the duplicate pattern where we were "peeling" emptycasts to check
15379 whether they were constants. Now constants will always be
15382 * ecore.cs: Use an enumconstant here instead of wrapping with
15385 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
15386 throwing me off. By handling this we can get rid of a few hacks.
15388 * statement.cs (Switch): Removed Peel() code.
15390 2003-02-14 Miguel de Icaza <miguel@ximian.com>
15392 * class.cs: Location information for error 508
15394 * expression.cs (New.DoResolve): Add a guard against double
15395 resolution of an expression.
15397 The New DoResolve might be called twice when initializing field
15398 expressions (see EmitFieldInitializers, the call to
15399 GetInitializerExpression will perform a resolve on the expression,
15400 and later the assign will trigger another resolution
15402 This leads to bugs (#37014)
15404 * delegate.cs: The signature for EndInvoke should contain any ref
15405 or out parameters as well. We were not doing this in the past.
15407 * class.cs (Field.Define): Do not overwrite the type definition
15408 inside the `volatile' group. Turns out that volatile enumerations
15409 were changing the type here to perform a validity test, which
15412 2003-02-12 Miguel de Icaza <miguel@ximian.com>
15414 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
15415 and structs, we do not want to load the instance variable
15417 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
15418 enum_type has to be handled like an object reference (implicit
15419 conversions exists from this to object), but the regular IsClass
15420 and IsValueType tests will never return true for this one.
15422 Also we use TypeManager.IsValueType instead of type.IsValueType,
15423 just for consistency with the rest of the code (this is only
15424 needed if we ever use the construct exposed by test-180.cs inside
15425 corlib, which we dont today).
15427 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
15429 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
15432 2003-02-09 Martin Baulig <martin@ximian.com>
15434 * namespace.cs (Namespace..ctor): Added SourceFile argument.
15435 (Namespace.DefineNamespaces): New static public method; this is
15436 called when we're compiling with debugging to add all namespaces
15437 to the symbol file.
15439 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
15440 pass it to the Namespace's .ctor.
15442 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
15443 and MethodBase arguments; pass the namespace ID to the symwriter;
15444 pass the MethodBase instead of the token to the symwriter.
15445 (SymbolWriter.DefineNamespace): New method to add a namespace to
15448 2003-02-09 Martin Baulig <martin@ximian.com>
15450 * symbolwriter.cs: New file. This is a wrapper around
15451 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
15452 methods here in near future.
15454 2003-02-09 Martin Baulig <martin@ximian.com>
15456 * codegen.cs (EmitContext.Mark): Just pass the arguments to
15457 ILGenerator.MarkSequencePoint() which are actually used by the
15460 2003-02-09 Martin Baulig <martin@ximian.com>
15462 * location.cs (SourceFile): New public sealed class. This
15463 contains the name and an index which is used in the location's token.
15464 (Location): Reserve an appropriate number of bits in the token for
15465 the source file instead of walking over that list, this gives us a
15466 really huge performance improvement when compiling with debugging.
15468 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
15469 `SourceFile' argument instead of a string.
15470 (Driver.ProcessFile): Add all the files via Location.AddFile(),
15471 but don't parse/tokenize here, we need to generate the list of all
15472 source files before we do that.
15473 (Driver.ProcessFiles): New static function. Parses/tokenizes all
15476 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
15477 instead of a string.
15479 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
15482 2003-02-09 Martin Baulig <martin@ximian.com>
15484 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
15485 filename on `#line default'.
15487 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
15489 * statement.cs: don't clear the pinned var when the fixed statement
15490 returns from the method (fixes bug#37752).
15492 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
15494 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
15497 2003-02-07 Martin Baulig <martin@ximian.com>
15499 * driver.cs: Removed the `--debug-args' command line argument.
15501 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
15502 automatically by the AsssemblyBuilder.
15503 (CodeGen.InitializeSymbolWriter): We don't need to call any
15504 initialization function on the symbol writer anymore. This method
15505 doesn't take any arguments.
15507 2003-02-03 Miguel de Icaza <miguel@ximian.com>
15509 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
15510 from referenced assemblies as well.
15512 2003-02-02 Martin Baulig <martin@ximian.com>
15514 * class.cs (MethodData.Emit): Generate debugging info for external methods.
15516 2003-02-02 Martin Baulig <martin@ximian.com>
15518 * class.cs (Constructor.Emit): Open the symbol writer before
15519 emitting the constructor initializer.
15520 (ConstructorInitializer.Emit): Call ec.Mark() to allow
15521 single-stepping through constructor initializers.
15523 2003-01-30 Miguel de Icaza <miguel@ximian.com>
15525 * class.cs: Handle error 549: do not allow virtual methods in
15528 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
15530 * decl.cs: Check access levels when resolving types
15532 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
15534 * statement.cs: Add parameters and locals set in catch blocks that might
15535 return to set vector
15537 2003-01-29 Miguel de Icaza <miguel@ximian.com>
15539 * class.cs (Operator): Set the SpecialName flags for operators.
15541 * expression.cs (Invocation.DoResolve): Only block calls to
15542 accessors and operators on SpecialName methods.
15544 (Cast.TryReduce): Handle conversions from char constants.
15547 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
15549 * statement.cs: small memory and time optimization in FlowBranching.
15551 2003-01-28 Pedro Mart <yoros@wanadoo.es>
15553 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
15554 problem that the last fix but in the other sid (Set).
15556 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
15557 access when there is no indexer in the hierarchy.
15559 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
15561 * class.cs: Combine some if statements.
15563 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15565 * driver.cs: fixed bug #37187.
15567 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
15569 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
15570 any indexer, it's needed to build a list with all the indexers in the
15571 hierarchy (AllGetters), else we have problems. Fixes #35653.
15573 2003-01-23 Miguel de Icaza <miguel@ximian.com>
15575 * class.cs (MethodData.Define): It is wrong for an interface
15576 implementation to be static in both cases: explicit and implicit.
15577 We were only handling this in one case.
15579 Improve the if situation there to not have negations.
15581 * class.cs (Field.Define): Turns out that we do not need to check
15582 the unsafe bit on field definition, only on usage. Remove the test.
15584 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15586 * driver.cs: use assembly.Location instead of Codebase (the latest
15587 patch made mcs fail when using MS assemblies).
15589 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
15591 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
15592 get the path to *corlib.dll.
15594 2003-01-21 Nick Drochak <ndrochak@gol.com>
15598 * typemanager.cs: Remove compiler warnings
15600 2003-01-20 Duncan Mak <duncan@ximian.com>
15602 * AssemblyInfo.cs: Bump the version number to 0.19.
15604 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15606 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
15608 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
15610 * class.cs (Constructor::Emit): Emit debugging info for constructors.
15612 2003-01-17 Miguel de Icaza <miguel@ximian.com>
15614 * cs-parser.jay: Small fix: we were not comparing the constructor
15615 name correctly. Thanks to Zoltan for the initial pointer.
15617 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
15619 * cs-tokenizer.cs: Set file name when specified with #line
15621 2003-01-15 Miguel de Icaza <miguel@ximian.com>
15623 * cs-parser.jay: Only perform the constructor checks here if we
15624 are named like the class; This will help provider a better
15625 error. The constructor path is taken when a type definition is
15626 not found, but most likely the user forgot to add the type, so
15627 report that rather than the constructor error.
15629 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
15631 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
15634 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15636 * cs-parser.jay: Add cleanup call.
15638 2003-01-13 Duncan Mak <duncan@ximian.com>
15640 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
15641 consistent with other methods.
15643 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15645 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
15647 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
15649 * attribute.cs: only set GuidAttr to true when we have a
15652 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15656 * typemanager.cs: fixes to allow mcs compile corlib with the new
15657 Type.IsSubclassOf fix.
15659 2003-01-08 Miguel de Icaza <miguel@ximian.com>
15661 * expression.cs (LocalVariableReference.DoResolve): Classify a
15662 constant as a value, not as a variable. Also, set the type for
15665 * cs-parser.jay (fixed_statement): take a type instead of a
15666 pointer_type, so we can produce a better error message later.
15668 * statement.cs (Fixed.Resolve): Flag types that are not pointers
15671 (For.DoEmit): Make inifinite loops have a
15672 non-conditional branch back.
15674 (Fixed.DoEmit): First populate the pinned variables, then emit the
15675 statement, then clear the variables. Before I was emitting the
15676 code once for each fixed piece.
15679 2003-01-08 Martin Baulig <martin@ximian.com>
15681 * statement.cs (FlowBranching.MergeChild): A break in a
15682 SWITCH_SECTION does not leave a loop. Fixes #36155.
15684 2003-01-08 Martin Baulig <martin@ximian.com>
15686 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
15687 lives in the same number space than `param_map'. Fixes #36154.
15689 2003-01-07 Miguel de Icaza <miguel@ximian.com>
15691 * cs-parser.jay (constructor_declaration): Set the
15692 Constructor.ModFlags before probing for it. This makes the
15693 compiler report 514, 515 and 132 (the code was there, but got
15696 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
15697 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
15698 (GotoCase.Resolve): Set `Returns' to ALWAYS.
15700 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
15702 * enum.cs: create the enum static fields using the enum type.
15704 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
15706 * class.cs: don't try to create the ParamBuilder for the return
15707 type if it's not needed (and handle it breaking for the ms runtime
15710 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
15712 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
15714 2002-12-29 Miguel de Icaza <miguel@ximian.com>
15716 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
15717 the command. This showed up while compiling the JANET source
15718 code, which used \r as its only newline separator.
15720 2002-12-28 Miguel de Icaza <miguel@ximian.com>
15722 * class.cs (Method.Define): If we are an operator (because it
15723 reuses our code), then set the SpecialName and HideBySig. #36128
15725 2002-12-22 Miguel de Icaza <miguel@ximian.com>
15727 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
15728 exception, report error 120 `object reference required'.
15730 * driver.cs: Add --pause option, used during to measure the size
15731 of the process as it goes with --timestamp.
15733 * expression.cs (Invocation.DoResolve): Do not allow methods with
15734 SpecialName to be invoked.
15736 2002-12-21 Miguel de Icaza <miguel@ximian.com>
15738 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
15739 number before adding it.
15741 2002-12-21 Ravi Pratap <ravi@ximian.com>
15743 * ecore.cs (StandardImplicitConversion): When in an unsafe
15744 context, we allow conversion between void * to any other pointer
15745 type. This fixes bug #35973.
15747 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
15749 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
15750 is not thrown when extensionless outputs are used
15752 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15754 * rootcontext.cs: fixed compilation of corlib.
15756 2002-12-19 Miguel de Icaza <miguel@ximian.com>
15758 * attribute.cs (Attributes.Contains): Add new method.
15760 * class.cs (MethodCore.LabelParameters): if the parameter is an
15761 `out' parameter, check that no attribute `[In]' has been passed.
15763 * enum.cs: Handle the `value__' name in an enumeration.
15765 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
15767 * decl.cs: Added special case to allow overrides on "protected
15770 2002-12-18 Ravi Pratap <ravi@ximian.com>
15772 * attribute.cs (Attributes.AddAttributeSection): Rename to this
15773 since it makes much more sense.
15775 (Attributes.ctor): Don't require a Location parameter.
15777 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
15779 * attribute.cs (ApplyAttributes): Remove extra Location parameters
15780 since we already have that information per attribute.
15782 * everywhere : make appropriate changes.
15784 * class.cs (LabelParameters): Write the code which actually
15785 applies attributes to the return type. We can't do this on the MS
15786 .NET runtime so we flag a warning in the case an exception is
15789 2002-12-18 Miguel de Icaza <miguel@ximian.com>
15791 * const.cs: Handle implicit null conversions here too.
15793 2002-12-17 Ravi Pratap <ravi@ximian.com>
15795 * class.cs (MethodCore.LabelParameters): Remove the extra
15796 Type [] parameter since it is completely unnecessary. Instead
15797 pass in the method's attributes so that we can extract
15798 the "return" attribute.
15800 2002-12-17 Miguel de Icaza <miguel@ximian.com>
15802 * cs-parser.jay (parse): Use Report.Error to flag errors instead
15803 of ignoring it and letting the compile continue.
15805 * typemanager.cs (ChangeType): use an extra argument to return an
15806 error condition instead of throwing an exception.
15808 2002-12-15 Miguel de Icaza <miguel@ximian.com>
15810 * expression.cs (Unary.TryReduce): mimic the code for the regular
15811 code path. Perform an implicit cast in the cases where we can
15812 implicitly convert to one of the integral types, and then reduce
15813 based on that constant. This fixes bug #35483.
15815 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15817 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
15819 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15821 * namespace.cs: fixed bug #35489.
15823 2002-12-12 Miguel de Icaza <miguel@ximian.com>
15825 * class.cs: Remove some dead code.
15827 * cs-parser.jay: Estimate the number of methods needed
15828 (RootContext.MethodCount);
15830 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
15831 numbers instead of StringBuilders.
15833 * support.cs (PtrHashtable): Add constructor with initial size;
15834 We can now reduce reallocations of the method table.
15836 2002-12-10 Ravi Pratap <ravi@ximian.com>
15838 * attribute.cs (ApplyAttributes): Keep track of the emitted
15839 attributes on a per-target basis. This fixes bug #35413.
15841 2002-12-10 Miguel de Icaza <miguel@ximian.com>
15843 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
15844 default to the Windows 1252 encoding.
15846 (UnixParseOption): Support version, thanks to Alp for the missing
15849 * AssemblyInfo.cs: Add nice assembly information.
15851 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
15854 * cs-parser.jay: Allow a trailing comma before the close bracked
15855 in the attribute_section production.
15857 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
15858 address of the instance was being taken, I will take this out,
15859 because we take the address of the object immediately here.
15861 2002-12-09 Ravi Pratap <ravi@ximian.com>
15863 * typemanager.cs (AreMultipleAllowed): Take care of the most
15864 obvious case where attribute type is not in the current assembly -
15867 2002-12-08 Miguel de Icaza <miguel@ximian.com>
15869 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
15870 definitions, instead of doing that afterwards.
15872 Also we use a nice little hack, depending on the constructor, we
15873 know if we are a "composed" name or a simple name. Hence, we
15874 avoid the IndexOf test, and we avoid
15876 * codegen.cs: Add code to assist in a bug reporter to track down
15877 the source of a compiler crash.
15879 2002-12-07 Ravi Pratap <ravi@ximian.com>
15881 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
15882 types have been emitted for a given element and flag an error
15883 if something which does not have AllowMultiple set is used more
15886 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15887 attribute types and their corresponding AllowMultiple properties
15889 (AreMultipleAllowed): Check the property for a given type.
15891 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15892 property in the case we have a TypeContainer.
15894 (Attributes.AddAttribute): Detect duplicates and just skip on
15895 adding them. This trivial fix catches a pretty gross error in our
15896 attribute emission - global attributes were being emitted twice!
15898 Bugzilla bug #33187 is now fixed.
15900 2002-12-06 Miguel de Icaza <miguel@ximian.com>
15902 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15903 instead of pp_and).
15905 * expression.cs (Binary.ResolveOperator): I can only use the
15906 Concat (string, string, string) and Concat (string, string,
15907 string, string) if the child is actually a concatenation of
15910 2002-12-04 Miguel de Icaza <miguel@ximian.com>
15912 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15913 context where we need a 2-character lookahead.
15915 * pending.cs (PendingImplementation): Rework so we can keep track
15916 of interface types all the time, and flag those which were
15917 implemented by parents as optional.
15919 2002-12-03 Miguel de Icaza <miguel@ximian.com>
15921 * expression.cs (Binary.ResolveOperator): Use
15922 String.Concat(string,string,string) or
15923 String.Concat(string,string,string,string) when possible.
15925 * typemanager: More helper methods.
15928 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15930 * pending.cs: remove the bogus return from GetMissingInterfaces()
15931 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15933 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15935 * namespace.cs: avoid duplicated 'using xxx' being added to
15936 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15937 when we get more than one 'using' statement for the same namespace.
15938 Report a CS0105 warning for it.
15940 2002-11-30 Miguel de Icaza <miguel@ximian.com>
15942 * cs-tokenizer.cs (consume_identifier): use read directly, instead
15943 of calling getChar/putback, uses internal knowledge of it.
15945 (xtoken): Reorder tokenizer so most common patterns are checked
15946 first. This reduces the compilation time in another 5% (from 8.11s
15947 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15949 The parsing time is 22% of the compilation in mcs, and from that
15950 64% is spent on the tokenization process.
15952 I tried using a binary search for keywords, but this is slower
15953 than the hashtable. Another option would be to do a couple of
15956 * Not use a StringBuilder, instead use an array of chars,
15957 with a set value. Notice that this way we could catch
15958 the 645 error without having to do it *afterwards*.
15960 * We could write a hand-parser to avoid the hashtable
15961 compares altogether.
15963 The identifier consumption process takes 37% of the tokenization
15964 time. Another 15% is spent on is_number. 56% of the time spent
15965 on is_number is spent on Int64.Parse:
15967 * We could probably choose based on the string length to
15968 use Int32.Parse or Int64.Parse and avoid all the 64-bit
15971 Another 3% is spend on wrapping `xtoken' in the `token' function.
15973 Handle 0xa0 as whitespace (#34752)
15975 2002-11-26 Miguel de Icaza <miguel@ximian.com>
15977 * typemanager.cs (IsCLRType): New routine to tell whether a type
15978 is one of the builtin types.
15980 Maybe it needs to use TypeCodes to be faster. Maybe we could use
15981 typecode in more places instead of doing pointer comparissions.
15982 We could leverage some knowledge about the way the typecodes are
15985 New code to cache namespaces in assemblies, it is currently not
15986 invoked, to be used soon.
15988 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
15990 * expression.cs (Binary.ResolveOperator): specially handle
15991 strings, and do not perform user-defined operator overloading for
15994 2002-11-24 Miguel de Icaza <miguel@ximian.com>
15996 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15997 internalcall as it is a pretty simple operation; Avoid whenever
15998 possible to call Char.IsLetter.
16000 (consume_identifier): Cut by half the number of
16001 hashtable calls by merging the is_keyword and GetKeyword behavior.
16003 Do not short-circuit, because if we do, we
16004 report errors (ie, #if false && true would produce an invalid
16008 2002-11-24 Martin Baulig <martin@ximian.com>
16010 * expression.cs (Cast.TryReduce): If we're in checked syntax,
16011 check constant ranges and report a CS0221. Fixes #33186.
16013 2002-11-24 Martin Baulig <martin@ximian.com>
16015 * cs-parser.jay: Make this work for uninitialized variable
16016 declarations in the `for' initializer. Fixes #32416.
16018 2002-11-24 Martin Baulig <martin@ximian.com>
16020 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
16021 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
16023 2002-11-24 Martin Baulig <martin@ximian.com>
16025 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
16026 argument; if true, we also check for user-defined conversions.
16027 This is only needed if both arguments are of a user-defined type.
16028 Fixes #30443, added test-175.cs.
16029 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
16031 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
16033 2002-11-24 Martin Baulig <martin@ximian.com>
16035 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
16036 function to get the store opcode.
16037 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
16038 only emit the Ldelema if the store opcode is Stobj. You must run
16039 both test-34 and test-167 to test this. Fixes #34529.
16041 2002-11-23 Martin Baulig <martin@ximian.com>
16043 * ecore.cs (Expression.MemberLookup): Added additional
16044 `qualifier_type' argument which is used when we're being called
16045 from MemberAccess.DoResolve() and null if we're called from a
16047 (Expression.MemberLookupFailed): New method to report errors; this
16048 does the CS1540 check and reports the correct error message.
16050 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
16051 argument for the CS1540 check and redone the way how we're dealing
16052 with private members. See the comment in the source code for details.
16053 (FilterWithClosure): Reverted this back to revision 1.197; renamed
16054 `closure_start_type' to `closure_qualifier_type' and check whether
16055 it's not null. It was not this filter being broken, it was just
16056 being called with the wrong arguments.
16058 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
16059 and pass it the correct `qualifier_type'; this also does the error
16062 2002-11-22 Miguel de Icaza <miguel@ximian.com>
16064 * expression.cs (Invocation.EmitParams): If the we are dealing
16065 with a non-built-in value type, load its address as well.
16067 (ArrayCreation): Use a a pretty constant instead
16068 of the hardcoded value 2. Use 6 instead of 2 for the number of
16069 static initializers.
16071 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
16072 because they are not really value types, just glorified integers.
16074 * driver.cs: Do not append .exe, the CSC compiler does not do it.
16076 * ecore.cs: Remove redundant code for enumerations, make them use
16077 the same code path as everything else, fixes the casting issue
16078 with enumerations in Windows.Forms.
16080 * attribute.cs: Do only cast to string if it is a string, the
16081 validation happens later.
16083 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
16084 people upgrade their corlibs.
16086 * ecore.cs: Oops, enumerations were not following the entire code path
16088 2002-11-21 Miguel de Icaza <miguel@ximian.com>
16090 * typemanager.cs (FilterWithClosure): Commented out the test for
16091 1540 in typemanager.cs, as it has problems when accessing
16092 protected methods from a parent class (see test-174.cs).
16094 * attribute.cs (Attribute.ValidateGuid): new method.
16095 (Attribute.Resolve): Use above.
16097 2002-11-19 Miguel de Icaza <miguel@ximian.com>
16099 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
16101 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
16102 handling for enumerations, as we only needed the TypeContainer
16103 functionality to begin with (this is required for the fix below to
16104 work for enums that reference constants in a container class for
16107 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
16109 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
16110 a valid TypeBuilder to perform lookups on.o
16112 * class.cs (InheritableMemberSignatureCompare): Use true in the
16113 call to GetGetMethod and GetSetMethod, because we are comparing
16114 the signature, and we need to get the methods *even* if they are
16117 (PropertyBase.CheckBase): ditto.
16119 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
16120 GotoCase.Resolve): Use Peel on EmpytCasts.
16122 * ecore.cs (EmptyCast): drop child, add Peel method.
16124 2002-11-17 Martin Baulig <martin@ximian.com>
16126 * ecore.cs (EmptyCast.Child): New public property.
16128 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
16129 label resolved to an EmptyCast. Fixes #34162.
16130 (GotoCase.Resolve): Likewise.
16131 (Block.EmitMeta): Likewise.
16133 2002-11-17 Martin Baulig <martin@ximian.com>
16135 * expression.cs (Invocation.BetterConversion): Prefer int over
16136 uint; short over ushort; long over ulong for integer literals.
16137 Use ImplicitConversionExists instead of StandardConversionExists
16138 since we also need to check for user-defined implicit conversions.
16139 Fixes #34165. Added test-173.cs.
16141 2002-11-16 Martin Baulig <martin@ximian.com>
16143 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
16144 with the `true' and `false' literals. Fixes #33151.
16146 2002-11-16 Martin Baulig <martin@ximian.com>
16148 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
16149 October 22nd; don't do the cs1540 check for static members.
16151 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
16152 now using our own filter here and doing the cs1540 check again.
16154 2002-11-16 Martin Baulig <martin@ximian.com>
16156 * support.cs (InternalParameters): Don't crash if we don't have
16157 any fixed parameters. Fixes #33532.
16159 2002-11-16 Martin Baulig <martin@ximian.com>
16161 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
16162 when looking up static methods to make this work on Windows.
16165 2002-11-16 Martin Baulig <martin@ximian.com>
16167 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
16168 a setter rather than using PropertyInfo.CanWrite.
16170 2002-11-15 Nick Drochak <ndrochak@gol.com>
16172 * class.cs: Allow acces to block member by subclasses. Fixes build
16175 2002-11-14 Martin Baulig <martin@ximian.com>
16177 * class.cs (Constructor.Emit): Added the extern/block check.
16180 2002-11-14 Martin Baulig <martin@ximian.com>
16182 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
16183 iteration while looking for indexers, this is needed because the
16184 indexer may have a different name in our base classes. Fixed the
16185 error reporting (no indexers at all, not get accessor, no
16186 overloaded match). Fixes bug #33089.
16187 (IndexerAccess.DoResolveLValue): Likewise.
16189 2002-11-14 Martin Baulig <martin@ximian.com>
16191 * class.cs (PropertyBase.CheckBase): Make this work for multiple
16192 indexers. Fixes the first part of bug #33089.
16193 (MethodSignature.InheritableMemberSignatureCompare): Added support
16196 2002-11-13 Ravi Pratap <ravi@ximian.com>
16198 * attribute.cs (Attribute.Resolve): Catch the
16199 NullReferenceException and report it since it isn't supposed to
16202 2002-11-12 Miguel de Icaza <miguel@ximian.com>
16204 * expression.cs (Binary.EmitBranchable): Also handle the cases for
16205 LogicalOr and LogicalAnd that can benefit from recursively
16206 handling EmitBranchable. The code now should be nice for Paolo.
16208 2002-11-08 Miguel de Icaza <miguel@ximian.com>
16210 * typemanager.cs (LookupType): Added a negative-hit hashtable for
16211 the Type lookups, as we perform quite a number of lookups on
16212 non-Types. This can be removed once we can deterministically tell
16213 whether we have a type or a namespace in advance.
16215 But this might require special hacks from our corlib.
16219 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
16220 and double which avoids a conversion from an integer to a double.
16222 * expression.cs: tiny optimization, avoid calling IsConstant,
16223 because it effectively performs the lookup twice.
16225 2002-11-06 Miguel de Icaza <miguel@ximian.com>
16227 But a bogus return here to keep the semantics of the old code
16228 until the Mono runtime is fixed.
16230 * pending.cs (GetMissingInterfaces): New method used to remove all
16231 the interfaces that are already implemented by our parent
16232 classes from the list of pending methods.
16234 * interface.cs: Add checks for calls after ResolveTypeExpr.
16236 2002-11-05 Miguel de Icaza <miguel@ximian.com>
16238 * class.cs (Class.Emit): Report warning 67: event not used if the
16239 warning level is beyond 3.
16241 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
16242 being a NullLiteral.
16244 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
16247 * class.cs (TypeContainer.GetClassBases): Cover a missing code
16248 path that might fail if a type can not be resolved.
16250 * expression.cs (Binary.Emit): Emit unsigned versions of the
16253 * driver.cs: use error 5.
16255 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
16257 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
16259 2002-11-01 Miguel de Icaza <miguel@ximian.com>
16261 * cs-parser.jay (switch_section): A beautiful patch from Martin
16262 Baulig that fixed 33094.
16264 2002-10-31 Miguel de Icaza <miguel@ximian.com>
16266 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
16267 Check whether the base is abstract and report an error if so.
16269 * expression.cs (IndexerAccess.DoResolveLValue,
16270 IndexerAccess.DoResolve): ditto.
16272 (Invocation.DoResolve): ditto.
16274 (Invocation.FullMethodDesc): Improve the report string.
16276 * statement.cs (Block): Eliminate IsVariableDefined as it is
16277 basically just a wrapper for GetVariableInfo.
16279 * ecore.cs (SimpleName): Use new
16281 * support.cs (ReflectionParamter.ParameterType): We unwrap the
16282 type, as we return the actual parameter ref/unref state on a
16285 2002-10-30 Miguel de Icaza <miguel@ximian.com>
16287 * support.cs: Return proper flags REF/OUT fixing the previous
16290 * expression.cs: Reverted last patch, that was wrong. Is_ref is
16291 not used to mean `ref' but `ref or out' in ParameterReference
16293 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
16294 full type signature instead of calling TypeManger.CSharpName
16297 * support.cs (InternalParameters.ParameterDesc): Do not compare
16298 directly to the modflags, because REF/OUT will actually be bitsets
16301 * delegate.cs (VerifyMethod): Check also the modifiers.
16303 * cs-tokenizer.cs: Fix bug where floating point values with an
16304 exponent where a sign was missing was ignored.
16306 * driver.cs: Allow multiple assemblies to be specified in a single
16309 2002-10-28 Miguel de Icaza <miguel@ximian.com>
16311 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
16312 because identifiers after a parenthesis would end up in this kind
16313 of production, and we needed to desamiguate it for having casts
16316 (UserDefinedType *) xxx
16318 2002-10-24 Miguel de Icaza <miguel@ximian.com>
16320 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
16321 we should set on the Bindingflags.NonPublic, but not turn on
16322 private_ok. private_ok controls whether a Private member is
16323 returned (this is chekced on the filter routine), while the
16324 BindingFlags.NonPublic just controls whether private/protected
16325 will be allowed. This fixes the problem part of the problem of
16326 private properties being allowed to be used in derived classes.
16328 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
16329 so we can call the children DoResolveLValue method (this will
16330 properly signal errors on lvalue assignments to base properties)
16332 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
16333 getter are null, and we have a property info, we know that this
16334 happened because the lookup failed, so we report an error 122 for
16335 protection level violation.
16337 We also silently return if setter and getter are null in the
16338 resolve functions, this condition only happens if we have flagged
16339 the error before. This is the other half of the problem.
16341 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
16342 not have accessibility information, that is why we were returning
16343 true in the filter function in typemanager.cs.
16345 To properly report 122 (property is inaccessible because of its
16346 protection level) correctly, we report this error in ResolveAccess
16347 by failing if both the setter and the getter are lacking (ie, the
16350 DoResolve and DoLResolve have been modified to check for both
16351 setter/getter being null and returning silently, the reason being
16352 that I did not want to put the knowledge about this error in upper
16355 int old = Report.Errors;
16356 x = new PropertyExpr (...);
16357 if (old != Report.Errors)
16362 So the property expr is returned, but it is invalid, so the error
16363 will be flagged during the resolve process.
16365 * class.cs: Remove InheritablePropertySignatureCompare from the
16366 class, as we no longer depend on the property signature to compute
16367 whether it is possible to implement a method or not.
16369 The reason is that calling PropertyInfo.GetGetMethod will return
16370 null (in .NET, in Mono it works, and we should change this), in
16371 cases where the Get Method does not exist in that particular
16376 class X { public virtual int A { get { return 1; } } }
16378 class Z : Y { public override int A { get { return 2; } } }
16380 Would fail in Z because the parent (Y) would not have the property
16381 defined. So we avoid this completely now (because the alternative
16382 fix was ugly and slow), and we now depend exclusively on the
16385 (PropertyBase.CheckBase): Use a method-base mechanism to find our
16386 reference method, instead of using the property.
16388 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
16389 routines are gone now.
16391 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
16392 names, they were incorrectly named.
16394 * cs-tokenizer.cs: Return are more gentle token on failure.
16396 * pending.cs (PendingImplementation.InterfaceMethod): This routine
16397 had an out-of-sync index variable, which caused it to remove from
16398 the list of pending methods the wrong method sometimes.
16400 2002-10-22 Miguel de Icaza <miguel@ximian.com>
16402 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
16403 CanWrite, because those refer to this particular instance of the
16404 property, and do not take into account the fact that we can
16405 override single members of a property.
16407 Constructor requires an EmitContext. The resolution process does
16408 not happen here, but we need to compute the accessors before,
16409 because the resolution does not always happen for properties.
16411 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
16412 subclass, before we did not update this flag, but we did update
16415 (GetAccessors): Drop this routine, as it did not work in the
16416 presence of partially overwritten set/get methods.
16418 Notice that this broke the cs1540 detection, but that will require
16421 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16425 * driver.cs: issue a warning instead of an error if we don't support
16426 debugging for the platform. Also ignore a couple of errors that may
16427 arise when trying to write the symbols. Undo my previous patch.
16429 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16431 * driver.cs: ignore /debug switch except for Unix platforms.
16433 2002-10-23 Nick Drochak <ndrochak@gol.com>
16435 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
16437 2002-10-21 Miguel de Icaza <miguel@ximian.com>
16439 * driver.cs: Do not make mcs-debug conditional, so we do not break
16440 builds that use it.
16442 * statement.cs (UsageVector.MergeChildren): I would like Martin to
16443 review this patch. But basically after all the children variables
16444 have been merged, the value of "Breaks" was not being set to
16445 new_breaks for Switch blocks. I think that it should be set after
16446 it has executed. Currently I set this to the value of new_breaks,
16447 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
16448 conservative, but I do not understand this code very well.
16450 I did not break anything in the build, so that is good ;-)
16452 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
16454 2002-10-20 Mark Crichton <crichton@gimp.org>
16456 * cfold.cs: Fixed compile blocker. Really fixed it this time.
16458 2002-10-20 Nick Drochak <ndrochak@gol.com>
16460 * cfold.cs: Fixed compile blocker.
16462 2002-10-20 Miguel de Icaza <miguel@ximian.com>
16464 * driver.cs: I was chekcing the key, not the file.
16466 2002-10-19 Ravi Pratap <ravi@ximian.com>
16468 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
16469 message that we were generating - we just need to silently return
16472 2002-10-19 Miguel de Icaza <miguel@ximian.com>
16474 * class.cs (Event.Define): Change my previous commit, as this
16475 breaks the debugger. This is a temporary hack, as it seems like
16476 the compiler is generating events incorrectly to begin with.
16478 * expression.cs (Binary.ResolveOperator): Added support for
16479 "U operator - (E x, E y)"
16481 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
16484 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
16485 init-only variables, but this path did not take into account that
16486 there might be also instance readonly variables. Correct this
16489 This fixes bug 32253
16491 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
16494 * driver.cs: Change the extension for modules to `netmodule'
16496 * cs-parser.jay: Improved slightly the location tracking for
16497 the debugger symbols.
16499 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
16500 modifiers that were specified instead of the hardcoded value
16501 (FamAndAssem). This was basically ignoring the static modifier,
16502 and others. Fixes 32429.
16504 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
16505 fixed a bug in the process (32476)
16507 * expression.cs (ArrayAccess.EmitAssign): Patch from
16508 hwang_rob@yahoo.ca that fixes bug 31834.3
16510 2002-10-18 Miguel de Icaza <miguel@ximian.com>
16512 * driver.cs: Make the module extension .netmodule.
16514 2002-10-16 Miguel de Icaza <miguel@ximian.com>
16516 * driver.cs: Report an error if the resource file is not found
16517 instead of crashing.
16519 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
16520 false, like Emit does.
16522 2002-10-16 Nick Drochak <ndrochak@gol.com>
16524 * typemanager.cs: Remove unused private member. Also reported mcs
16525 bug to report this as a warning like csc.
16527 2002-10-15 Martin Baulig <martin@gnome.org>
16529 * statement.cs (Statement.Emit): Made this a virtual method; emits
16530 the line number info and calls DoEmit().
16531 (Statement.DoEmit): New protected abstract method, formerly knows
16532 as Statement.Emit().
16534 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
16536 2002-10-11 Miguel de Icaza <miguel@ximian.com>
16538 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
16539 have fixed a remaining problem: not every AddXXXX was adding a
16540 fully qualified name.
16542 Now everyone registers a fully qualified name in the DeclSpace as
16543 being defined instead of the partial name.
16545 Downsides: we are slower than we need to be due to the excess
16546 copies and the names being registered this way.
16548 The reason for this is that we currently depend (on the corlib
16549 bootstrap for instance) that types are fully qualified, because
16550 we dump all the types in the namespace, and we should really have
16551 types inserted into the proper namespace, so we can only store the
16552 basenames in the defined_names array.
16554 2002-10-10 Martin Baulig <martin@gnome.org>
16556 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
16557 from bug #31834, see the bug report for a testcase which is
16560 2002-10-10 Martin Baulig <martin@gnome.org>
16562 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
16563 flow analysis code for this.
16565 * statement.cs (Do, While, For): Tell the flow analysis code about
16567 (FlowBranching.UsageVector): Added support for infinite loops.
16568 (Block.Resolve): Moved the dead code elimination here and use flow
16571 2002-10-09 Miguel de Icaza <miguel@ximian.com>
16573 * class.cs (Field.Define): Catch cycles on struct type
16576 * typemanager.cs (IsUnmanagedtype): Do not recursively check
16577 fields if the fields are static. We only need to check instance
16580 * expression.cs (As.DoResolve): Test for reference type.
16582 * statement.cs (Using.ResolveExpression): Use
16583 ConvertImplicitRequired, not ConvertImplicit which reports an
16585 (Using.ResolveLocalVariableDecls): ditto.
16587 * expression.cs (Binary.ResolveOperator): Report errors in a few
16588 places where we had to.
16590 * typemanager.cs (IsUnmanagedtype): Finish implementation.
16592 2002-10-08 Miguel de Icaza <miguel@ximian.com>
16594 * expression.cs: Use StoreFromPtr instead of extracting the type
16595 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
16597 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
16598 an enumeration value to a System.Enum, but System.Enum is not a
16599 value type, but an class type, so we need to box.
16601 (Expression.ConvertExplicit): One codepath could return
16602 errors but not flag them. Fix this. Fixes #31853
16604 * parameter.cs (Resolve): Do not allow void as a parameter type.
16606 2002-10-06 Martin Baulig <martin@gnome.org>
16608 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
16609 if it's a class type and not a struct. Fixes #31815.
16611 2002-10-06 Martin Baulig <martin@gnome.org>
16613 * statement.cs: Reworked the flow analysis code a bit to make it
16614 usable for dead code elimination.
16616 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16618 * cs-parser.jay: allow empty source files. Fixes bug #31781.
16620 2002-10-04 Miguel de Icaza <miguel@ximian.com>
16622 * expression.cs (ComposedCast.DoResolveType): A quick workaround
16623 to fix the test 165, will investigate deeper.
16625 2002-10-04 Martin Baulig <martin@gnome.org>
16627 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
16628 finally blocks actually work.
16629 (Try.Resolve): We don't need to create a sibling for `finally' if
16630 there is no finally block.
16632 2002-10-04 Martin Baulig <martin@gnome.org>
16634 * class.cs (Constructor.Define): The default accessibility for a
16635 non-default constructor is private, not public.
16637 2002-10-04 Miguel de Icaza <miguel@ximian.com>
16639 * class.cs (Constructor): Make AllowedModifiers public, add
16642 * cs-parser.jay: Perform the modifiers test here, as the
16643 constructor for the Constructor class usually receives a zero
16644 because of the way we create it (first we create, later we
16645 customize, and we were never checking the modifiers).
16647 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
16648 is a version of LookupTypeReflection that includes the type-name
16649 cache. This can be used as a fast path for functions that know
16650 the fully qualified name and are only calling into *.GetType() to
16651 obtain a composed type.
16653 This is also used by TypeManager.LookupType during its type
16656 (LookupType): We now also track the real type name, as sometimes
16657 we can get a quey for the real type name from things like
16658 ComposedCast. This fixes bug 31422.
16660 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
16661 complete type fullname, it does not have to go through the type
16662 resolution system to obtain the composed version of the type (for
16663 obtaining arrays or pointers).
16665 (Conditional.Emit): Use the EmitBoolExpression to
16666 generate nicer code, as requested by Paolo.
16668 (ArrayCreation.CheckIndices): Use the patch from
16669 hwang_rob@yahoo.ca to validate the array initializers.
16671 2002-10-03 Miguel de Icaza <miguel@ximian.com>
16673 * class.cs (ConstructorInitializer.Emit): simplify code by using
16674 Invocation.EmitCall, and at the same time, fix the bugs in calling
16675 parent constructors that took variable arguments.
16677 * ecore.cs (Expression.ConvertNumericExplicit,
16678 Expression.ImplicitNumericConversion): Remove the code that
16679 manually wrapped decimal (InternalTypeConstructor call is now gone
16682 * expression.cs (Cast.TryReduce): Also handle decimal types when
16683 trying to perform a constant fold on the type.
16685 * typemanager.cs (IsUnmanagedtype): Partially implemented.
16687 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
16688 that only turned off an error report, and did nothing else.
16690 2002-10-02 Miguel de Icaza <miguel@ximian.com>
16692 * driver.cs: Handle and ignore /fullpaths
16694 2002-10-01 Miguel de Icaza <miguel@ximian.com>
16696 * expression.cs (Binary.ResolveOperator): Catch the case where
16697 DoNumericPromotions returns true,
16699 (Binary.DoNumericPromotions): Simplify the code, and the tests.
16701 2002-09-27 Miguel de Icaza <miguel@ximian.com>
16703 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
16706 2002-09-26 Miguel de Icaza <miguel@ximian.com>
16708 * ecore.cs (ConvertNumericExplicit): It is not enough that the
16709 conversion exists, but it is also required that the conversion be
16710 performed. This manifested in "(Type64Enum) 2".
16712 * class.cs (TypeManager.AddMethod): The fix is not to change
16713 AddEnum, because that one was using a fully qualified name (every
16714 DeclSpace derivative does), but to change the AddMethod routine
16715 that was using an un-namespaced name. This now correctly reports
16716 the duplicated name.
16718 Revert patch until I can properly fix it. The issue
16719 is that we have a shared Type space across all namespaces
16720 currently, which is wrong.
16722 Options include making the Namespace a DeclSpace, and merge
16723 current_namespace/current_container in the parser.
16725 2002-09-25 Miguel de Icaza <miguel@ximian.com>
16727 * cs-parser.jay: Improve error reporting when we get a different
16728 kind of expression in local_variable_type and
16729 local_variable_pointer_type.
16731 Propagate this to avoid missleading errors being reported.
16733 * ecore.cs (ImplicitReferenceConversion): treat
16734 TypeManager.value_type as a target just like object_type. As
16739 Is valid, and needs to result in the int 1 being boxed before it
16740 is assigned to the value type v.
16742 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
16743 to validate the enumeration name.
16745 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
16746 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
16747 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
16749 * ecore.cs (TryImplicitIntConversion): When doing an
16750 implicit-enumeration-conversion, check if the type is 64-bits and
16751 perform a conversion before passing to EnumConstant.
16753 2002-09-23 Miguel de Icaza <miguel@ximian.com>
16755 * decl.cs (Error_AmbiguousTypeReference); New routine used to
16756 report ambiguous type references. Unlike the MS version, we
16757 report what the ambiguity is. Innovation at work ;-)
16759 (DeclSpace.FindType): Require a location argument to
16760 display when we display an ambiguous error.
16762 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
16764 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
16766 * expression.cs (EmitDynamicInitializers): Apply patch from
16767 hwang_rob@yahoo.ca that fixes the order in which we emit our
16770 2002-09-21 Martin Baulig <martin@gnome.org>
16772 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
16773 delegate takes no arguments.
16775 2002-09-20 Miguel de Icaza <miguel@ximian.com>
16777 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
16780 * expression.cs: Extract the underlying type.
16782 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
16784 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
16786 2002-09-19 Miguel de Icaza <miguel@ximian.com>
16788 * class.cs (TypeContainer.DefineType): We can not use the nice
16789 PackingSize with the size set to 1 DefineType method, because it
16790 will not allow us to define the interfaces that the struct
16793 This completes the fixing of bug 27287
16795 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
16796 means also structs. This fixes part of the problem.
16797 (Expresion.ImplicitReferenceConversionExists): ditto.
16799 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
16800 error if there were no errors reported during the type lookup
16801 process, to avoid duplicates or redundant errors. Without this
16802 you would get an ambiguous errors plus a type not found. We have
16803 beaten the user enough with the first error.
16805 (DeclSparce.FindType): Emit a warning if we have an ambiguous
16808 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
16809 during the resolution process, stop the lookup, this avoids
16810 repeated error reports (same error twice).
16812 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
16814 * typemanager.cs (LookupType): Redo the type lookup code to match
16815 the needs of System.Reflection.
16817 The issue is that System.Reflection requires references to nested
16818 types to begin with a "+" sign instead of a dot. So toplevel
16819 types look like: "NameSpace.TopLevelClass", and nested ones look
16820 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
16823 2002-09-19 Martin Baulig <martin@gnome.org>
16825 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
16826 says that a method always returns or always throws an exception,
16827 don't report the CS0161.
16829 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
16830 set `Returns = new_returns'.
16832 2002-09-19 Martin Baulig <martin@gnome.org>
16834 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
16835 to an enum constant, check for a CS0176.
16837 2002-09-18 Miguel de Icaza <miguel@ximian.com>
16839 * class.cs (TypeContainer.CheckPairedOperators): Now we check
16840 for operators that must be in pairs and report errors.
16842 * ecore.cs (SimpleName.DoResolveType): During the initial type
16843 resolution process, when we define types recursively, we must
16844 check first for types in our current scope before we perform
16845 lookups in the enclosing scopes.
16847 * expression.cs (MakeByteBlob): Handle Decimal blobs.
16849 (Invocation.VerifyArgumentsCompat): Call
16850 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
16851 I thought we were supposed to always call this, but there are a
16852 few places in the code where we dont do it.
16854 2002-09-17 Miguel de Icaza <miguel@ximian.com>
16856 * driver.cs: Add support in -linkres and -resource to specify the
16857 name of the identifier.
16859 2002-09-16 Miguel de Icaza <miguel@ximian.com>
16861 * ecore.cs (StandardConversionExists): Sync with the conversion
16862 code: allow anything-* to void* conversions.
16864 (FindMostSpecificSource): Use an Expression argument
16865 instead of a Type, because we might be handed over a Literal which
16866 gets a few more implicit conversions that plain types do not. So
16867 this information was being lost.
16869 Also, we drop the temporary type-holder expression when not
16872 2002-09-17 Martin Baulig <martin@gnome.org>
16874 * class.cs (PropertyBase.CheckBase): Don't check the base class if
16875 this is an explicit interface implementation.
16877 2002-09-17 Martin Baulig <martin@gnome.org>
16879 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
16880 different `IndexerName' attributes.
16882 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
16883 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
16884 virtual CommonResolve().
16886 2002-09-16 Miguel de Icaza <miguel@ximian.com>
16888 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16889 and convert that to the UnderlyingType.
16891 * statement.cs (Foreach.Resolve): Indexers are just like variables
16892 or PropertyAccesses.
16894 * cs-tokenizer.cs (consume_string): Track line numbers and columns
16895 inside quoted strings, we were not doing this before.
16897 2002-09-16 Martin Baulig <martin@gnome.org>
16899 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16900 resolve it. This is needed for the definite assignment check of the
16901 instance expression, fixes bug #29846.
16902 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16904 2002-09-16 Nick Drochak <ndrochak@gol.com>
16906 * parameter.cs: Fix compile error. Cannot reference static member
16907 from an instance object. Is this an mcs bug?
16909 2002-09-14 Martin Baulig <martin@gnome.org>
16911 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16912 multiple times. Fixes bug #30295, added test-166.cs.
16914 2002-09-14 Martin Baulig <martin@gnome.org>
16916 * statement.cs (Block.Emit): Don't emit unreachable code.
16917 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16918 `break' statements.
16919 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16921 2002-09-14 Martin Baulig <martin@gnome.org>
16923 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16926 2002-09-14 Martin Baulig <martin@gnome.org>
16928 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16929 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16930 be false on the ms runtime.
16932 2002-09-13 Martin Baulig <martin@gnome.org>
16934 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16935 the CS0038 error message.
16937 2002-09-12 Miguel de Icaza <miguel@ximian.com>
16939 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16940 constant inside, return it.
16942 2002-09-12 Martin Baulig <martin@gnome.org>
16944 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16945 implicit conversion can be done between enum types.
16947 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16948 check whether an implicit conversion to the current enum's UnderlyingType
16949 exists and report an error if not.
16951 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16952 without debugging support.
16954 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16955 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
16957 2002-09-12 Martin Baulig <martin@gnome.org>
16959 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16961 * ecore.cs (IMemberExpr.DeclaringType): New property.
16962 (SimpleName.SimpleNameResolve): Check whether we're accessing a
16963 nonstatic member of an outer type (CS0038).
16965 2002-09-11 Miguel de Icaza <miguel@ximian.com>
16967 * driver.cs: Activate the using-error detector at warning level
16968 4 (at least for MS-compatible APIs).
16970 * namespace.cs (VerifyUsing): Small buglett fix.
16972 * pending.cs (PendingImplementation): pass the container pointer.
16974 * interface.cs (GetMethods): Allow for recursive definition. Long
16975 term, I would like to move every type to support recursive
16976 definitions, not the current ordering mechanism that we have right
16979 The situation is this: Attributes are handled before interfaces,
16980 so we can apply attributes to interfaces. But some attributes
16981 implement interfaces, we will now handle the simple cases
16982 (recursive definitions will just get an error).
16984 * parameter.cs: Only invalidate types at the end if we fail to
16987 2002-09-09 Martin Baulig <martin@gnome.org>
16989 * ecore.cs (PropertyExpr.Emit): Also check for
16990 TypeManager.system_int_array_get_length so this'll also work when
16991 compiling corlib. Fixes #30003.
16993 2002-09-09 Martin Baulig <martin@gnome.org>
16995 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16996 and throw an exception if we can't get the type's size. Fixed #30040,
16999 2002-09-09 Martin Baulig <martin@gnome.org>
17001 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
17003 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
17004 context. Fixes bug #30027.
17006 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
17007 virtual functions. Fixes bug #30043, added test-164.cs.
17009 2002-09-08 Ravi Pratap <ravi@ximian.com>
17011 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
17013 2002-09-08 Nick Drochak <ndrochak@gol.com>
17015 * driver.cs: Use an object to get the windows codepage since it's not a
17018 2002-09-08 Miguel de Icaza <miguel@ximian.com>
17020 * statement.cs (For.Emit): for infinite loops (test == null)
17021 return whether there is a break inside, not always "true".
17023 * namespace.cs (UsingEntry): New struct to hold the name of the
17024 using definition, the location where it is defined, and whether it
17025 has been used in a successful type lookup.
17027 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
17032 2002-09-06 Ravi Pratap <ravi@ximian.com>
17034 * attribute.cs : Fix incorrect code which relied on catching
17035 a NullReferenceException to detect a null being passed in
17036 where an object was expected.
17038 2002-09-06 Miguel de Icaza <miguel@ximian.com>
17040 * statement.cs (Try): flag the catch variable as assigned
17042 * expression.cs (Cast): Simplified by using ResolveType instead of
17043 manually resolving.
17045 * statement.cs (Catch): Fix bug by using ResolveType.
17047 2002-09-06 Ravi Pratap <ravi@ximian.com>
17049 * expression.cs (BetterConversion): Special case for when we have
17050 a NullLiteral as the argument and we have to choose between string
17051 and object types - we choose string the way csc does.
17053 * attribute.cs (Attribute.Resolve): Catch the
17054 NullReferenceException and report error #182 since the Mono
17055 runtime no more has the bug and having this exception raised means
17056 we tried to select a constructor which takes an object and is
17059 2002-09-05 Ravi Pratap <ravi@ximian.com>
17061 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
17062 message (1502, 1503) when we can't locate a method after overload
17063 resolution. This is much more informative and closes the bug
17066 * interface.cs (PopulateMethod): Return if there are no argument
17067 types. Fixes a NullReferenceException bug.
17069 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
17070 expressions too. Previously we were checking only in one place for
17071 positional arguments leaving out named arguments.
17073 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
17074 type to the enum type is not allowed. Remove code corresponding to
17077 (ConvertNumericExplicit): Allow explicit conversions from
17078 the underlying type to enum type. This precisely follows the spec
17079 and closes a bug filed by Gonzalo.
17081 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17084 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
17086 2002-09-03 Miguel de Icaza <miguel@ximian.com>
17088 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
17089 it was important that we stored the right value after the
17090 reduction in `converted'.
17092 2002-09-04 Martin Baulig <martin@gnome.org>
17094 * location.cs (Location.SymbolDocument): Use full pathnames for the
17097 2002-08-30 Miguel de Icaza <miguel@ximian.com>
17099 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
17100 of the expression resolve mechanism, because that will catch the
17101 SimpleName error failures.
17103 (Conditional): If we can not resolve the
17104 expression, return, do not crash.
17106 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17109 (location): display token name instead of its number.
17111 2002-08-28 Martin Baulig <martin@gnome.org>
17113 * expression.cs (Binary.ResolveOperator): Don't silently return
17114 but return an error if an operator cannot be applied between two
17117 2002-08-28 Martin Baulig <martin@gnome.org>
17119 * class.cs (Constructor.Define): Set the permission attributes
17120 correctly instead of making all constructors public.
17122 2002-08-28 Martin Baulig <martin@gnome.org>
17124 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
17125 for private members before reporting a CS0103; if we find anything,
17128 2002-08-28 Martin Baulig <martin@gnome.org>
17130 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
17131 to check whether `closure_start_type == closure_invocation_type',
17132 we also need to check whether `m.DeclaringType == closure_invocation_type'
17133 before bypassing the permission checks. We might be accessing
17134 protected/private members from the base class.
17135 (TypeManager.RealMemberLookup): Only set private_ok if private
17136 members were requested via BindingFlags.NonPublic.
17138 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
17140 * expression.cs (MemberAccess.ResolveMemberAccess): Set
17141 MethodGroupExpr.IsExplicitImpl if appropriate.
17142 (Invocation.DoResolve): Don't report the CS0120 for explicit
17143 interface implementations.
17145 2002-08-27 Martin Baulig <martin@gnome.org>
17147 * expression.cs (Invocation.DoResolve): If this is a static
17148 method and we don't have an InstanceExpression, we must report
17151 2002-08-25 Martin Baulig <martin@gnome.org>
17153 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
17154 `==' between a valuetype and an object.
17156 2002-08-25 Miguel de Icaza <miguel@ximian.com>
17158 * ecore.cs (TypeExpr): Provide a ToString method.
17160 2002-08-24 Martin Baulig <martin@gnome.org>
17162 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
17163 now called proggie.dbg and it's a binary file.
17165 2002-08-23 Martin Baulig <martin@gnome.org>
17167 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
17169 2002-08-23 Martin Baulig <martin@gnome.org>
17171 * struct.cs (MyStructInfo.ctor): Make this work with empty
17172 structs; it's not allowed to use foreach() on null.
17174 2002-08-23 Martin Baulig <martin@gnome.org>
17176 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
17177 writer the full pathname of the generated assembly.
17179 2002-08-23 Martin Baulig <martin@gnome.org>
17181 * statements.cs (FlowBranching.UsageVector.MergeChildren):
17182 A `finally' block never returns or breaks; improved handling of
17185 2002-08-23 Martin Baulig <martin@gnome.org>
17187 * statement.cs (Throw.Resolve): Allow `throw null'.
17189 2002-08-23 Martin Baulig <martin@gnome.org>
17191 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
17192 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
17193 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
17194 MemberLookup would return a wrong event if this is an explicit
17195 interface implementation and the class has an event with the same
17198 2002-08-23 Martin Baulig <martin@gnome.org>
17200 * statement.cs (Block.AddChildVariableNames): New public method.
17201 (Block.AddChildVariableName): Likewise.
17202 (Block.IsVariableNameUsedInChildBlock): Likewise.
17203 (Block.AddVariable): Check whether a variable name has already
17204 been used in a child block.
17206 * cs-parser.jay (declare_local_variables): Mark all variable names
17207 from the current block as being used in a child block in the
17210 2002-08-23 Martin Baulig <martin@gnome.org>
17212 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
17213 find the symbol writer.
17215 * driver.cs: csc also allows the arguments to /define being
17216 separated by commas, not only by semicolons.
17218 2002-08-23 Martin Baulig <martin@gnome.org>
17220 * interface.cs (Interface.GetMembers): Added static check for events.
17222 2002-08-15 Martin Baulig <martin@gnome.org>
17224 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
17225 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
17227 * ecore.cs (Expression.MemberLookup): Added documentation and explained
17228 why the MethodData.EmitDestructor() change was necessary.
17230 2002-08-20 Martin Baulig <martin@gnome.org>
17232 * class.cs (TypeContainer.FindMembers): Added static check for events.
17234 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
17236 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
17237 use Type.GetEvents(), not Type.FindMembers().
17239 2002-08-20 Martin Baulig <martin@gnome.org>
17241 * decl.cs (MemberCache): Added a special method cache which will
17242 be used for method-only searched. This ensures that a method
17243 search will return a MethodInfo with the correct ReflectedType for
17246 2002-08-20 Martin Baulig <martin@gnome.org>
17248 * decl.cs (DeclSpace.FindMembers): Made this public.
17250 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17252 * delegate.cs: fixed build on windows.
17253 [FIXME: Filed as bug #29150: MCS must report these errors.]
17255 2002-08-19 Ravi Pratap <ravi@ximian.com>
17257 * ecore.cs (StandardConversionExists): Return a false
17258 if we are trying to convert the void type to anything else
17259 since that is not allowed.
17261 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
17262 we flag error 70 in the event an event is trying to be accessed
17263 directly from outside the declaring type.
17265 2002-08-20 Martin Baulig <martin@gnome.org>
17267 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
17268 MemberCache from typemanager.cs to decl.cs.
17270 2002-08-19 Martin Baulig <martin@gnome.org>
17272 * class.cs (TypeContainer): Implement IMemberContainer.
17273 (TypeContainer.DefineMembers): Create the MemberCache.
17274 (TypeContainer.FindMembers): Do better BindingFlags checking; only
17275 return public members if BindingFlags.Public was given, check
17276 whether members are static.
17278 2002-08-16 Martin Baulig <martin@gnome.org>
17280 * decl.cs (DeclSpace.Define): Splitted this in Define and
17281 DefineMembers. DefineMembers is called first and initializes the
17284 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
17285 DefineMembers() on all our DeclSpaces.
17287 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
17288 but call DefineMembers() on all nested interfaces. We call their
17289 Define() in our new Define() function.
17291 * interface.cs (Interface): Implement IMemberContainer.
17292 (Interface.Define): Moved all code except the attribute stuf to
17294 (Interface.DefineMembers): Initialize the member cache.
17296 * typemanager.cs (IMemberFinder): Removed this interface, we don't
17297 need this anymore since we can use MemberCache.FindMembers directly.
17299 2002-08-19 Martin Baulig <martin@gnome.org>
17301 * typemanager.cs (MemberCache): When creating the cache for an
17302 interface type, add all inherited members.
17303 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
17304 to `out bool used_cache' and documented it.
17305 (TypeManager.MemberLookup): If we already used the cache in the first
17306 iteration, we don't need to do the interfaces check.
17308 2002-08-19 Martin Baulig <martin@gnome.org>
17310 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
17311 here from IMemberFinder and don't implement this interface anymore.
17312 (DeclSpace.MemberCache): Moved here from IMemberFinder.
17314 * typemanager.cs (IMemberFinder): This interface is now only used by
17315 classes which actually support the member cache.
17316 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
17317 since we only put DeclSpaces into this Hashtable.
17318 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
17319 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
17321 2002-08-16 Martin Baulig <martin@gnome.org>
17323 * typemanager.cs (ICachingMemberFinder): Removed.
17324 (IMemberFinder.MemberCache): New property.
17325 (TypeManager.FindMembers): Merged this with RealFindMembers().
17326 This function will never be called from TypeManager.MemberLookup()
17327 so we can't use the cache here, just the IMemberFinder.
17328 (TypeManager.MemberLookup_FindMembers): Check whether the
17329 IMemberFinder has a MemberCache and call the cache's FindMembers
17331 (MemberCache): Rewrote larger parts of this yet another time and
17332 cleaned it up a bit.
17334 2002-08-15 Miguel de Icaza <miguel@ximian.com>
17336 * driver.cs (LoadArgs): Support quoting.
17338 (Usage): Show the CSC-like command line arguments.
17340 Improved a few error messages.
17342 2002-08-15 Martin Baulig <martin@gnome.org>
17344 * typemanager.cs (IMemberContainer.Type): New property.
17345 (IMemberContainer.IsInterface): New property.
17347 The following changes are conditional to BROKEN_RUNTIME, which is
17348 defined at the top of the file.
17350 * typemanager.cs (MemberCache.MemberCache): Don't add the base
17351 class'es members, but add all members from TypeHandle.ObjectType
17352 if we're an interface.
17353 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
17354 is the current type.
17355 (MemberCache.CacheEntry.Container): Removed this field.
17356 (TypeHandle.GetMembers): Include inherited members.
17358 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17360 * typemanager.cs: fixed compilation and added a comment on a field that
17363 2002-08-15 Martin Baulig <martin@gnome.org>
17365 * class.cs (ConstructorInitializer.Resolve): In the
17366 Expression.MemberLookup call, use the queried_type as
17369 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
17370 declared' attribute, it's always true.
17371 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
17372 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
17373 temporary wrapper for FindMembers which tells MemberLookup whether
17374 members from the base classes are included in the return value.
17375 This will go away soon.
17376 (TypeManager.MemberLookup): Use this temporary hack here; once the
17377 new MemberCache is completed, we don't need to do the DeclaredOnly
17378 looping here anymore since the MemberCache will take care of this.
17379 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
17380 (MemberCache): When creating the MemberCache for a class, get
17381 members from the current class and all its base classes.
17382 (MemberCache.CacheEntry.Container): New field. This is a
17383 temporary hack until the Mono runtime is fixed to distinguish
17384 between ReflectedType and DeclaringType. It allows us to use MCS
17385 with both the MS runtime and the unfixed Mono runtime without
17386 problems and without accecting performance.
17387 (MemberCache.SearchMembers): The DeclaredOnly looping from
17388 TypeManager.MemberLookup is now done here.
17390 2002-08-14 Martin Baulig <martin@gnome.org>
17392 * statement.cs (MyStructInfo.MyStructInfo): Don't call
17393 Type.GetFields on dynamic types but get the fields from the
17394 corresponding TypeContainer.
17395 (MyStructInfo.GetStructInfo): Added check for enum types.
17397 * typemanager.cs (MemberList.IsSynchronized): Implemented.
17398 (MemberList.SyncRoot): Implemented.
17399 (TypeManager.FilterWithClosure): No need to check permissions if
17400 closure_start_type == closure_invocation_type, don't crash if
17401 closure_invocation_type is null.
17403 2002-08-13 Martin Baulig <martin@gnome.org>
17405 Rewrote TypeContainer.FindMembers to use a member cache. This
17406 gives us a speed increase of about 35% for the self-hosting MCS
17407 build and of about 15-20% for the class libs (both on GNU/Linux).
17409 * report.cs (Timer): New class to get enhanced profiling. This
17410 whole class is "TIMER" conditional since it remarkably slows down
17413 * class.cs (MemberList): New class. This is an IList wrapper
17414 which we're now using instead of passing MemberInfo[]'s around to
17415 avoid copying this array unnecessarily.
17416 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
17417 (ICachingMemberFinder, IMemberContainer): New interface.
17418 (TypeManager.FilterWithClosure): If `criteria' is null, the name
17419 has already been checked, otherwise use it for the name comparision.
17420 (TypeManager.FindMembers): Renamed to RealMemberFinder and
17421 provided wrapper which tries to use ICachingMemberFinder.FindMembers
17422 if possible. Returns a MemberList, not a MemberInfo [].
17423 (TypeHandle): New class, implements IMemberContainer. We create
17424 one instance of this class per type, it contains a MemberCache
17425 which is used to do the member lookups.
17426 (MemberCache): New class. Each instance of this class contains
17427 all members of a type and a name-based hash table.
17428 (MemberCache.FindMembers): This is our new member lookup
17429 function. First, it looks up all members of the requested name in
17430 the hash table. Then, it walks this list and sorts out all
17431 applicable members and returns them.
17433 2002-08-13 Martin Baulig <martin@gnome.org>
17435 In addition to a nice code cleanup, this gives us a performance
17436 increase of about 1.4% on GNU/Linux - not much, but it's already
17437 half a second for the self-hosting MCS compilation.
17439 * typemanager.cs (IMemberFinder): New interface. It is used by
17440 TypeManager.FindMembers to call FindMembers on a TypeContainer,
17441 Enum, Delegate or Interface.
17442 (TypeManager.finder_to_member_finder): New PtrHashtable.
17443 (TypeManager.finder_to_container): Removed.
17444 (TypeManager.finder_to_delegate): Removed.
17445 (TypeManager.finder_to_interface): Removed.
17446 (TypeManager.finder_to_enum): Removed.
17448 * interface.cs (Interface): Implement IMemberFinder.
17450 * delegate.cs (Delegate): Implement IMemberFinder.
17452 * enum.cs (Enum): Implement IMemberFinder.
17454 * class.cs (TypeContainer): Implement IMemberFinder.
17456 2002-08-12 Martin Baulig <martin@gnome.org>
17458 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
17460 2002-08-12 Martin Baulig <martin@gnome.org>
17462 * ecore.cs (ITypeExpression): New interface for expressions which
17464 (TypeExpression): Renamed to TypeLookupExpression.
17465 (Expression.DoResolve): If we're doing a types-only lookup, the
17466 expression must implement the ITypeExpression interface and we
17467 call DoResolveType() on it.
17468 (SimpleName): Implement the new ITypeExpression interface.
17469 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
17470 hack, the situation that we're only looking up types can't happen
17471 anymore when this method is called. Moved the type lookup code to
17472 DoResolveType() and call it.
17473 (SimpleName.DoResolveType): This ITypeExpression interface method
17474 is now doing the types-only lookup.
17475 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
17476 (ResolveFlags): Added MaskExprClass.
17478 * expression.cs (MemberAccess): Implement the ITypeExpression
17480 (MemberAccess.DoResolve): Added support for a types-only lookup
17481 when we're called via ITypeExpression.DoResolveType().
17482 (ComposedCast): Implement the ITypeExpression interface.
17484 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
17485 Expression.Resolve() with ResolveFlags.Type instead.
17487 2002-08-12 Martin Baulig <martin@gnome.org>
17489 * interface.cs (Interface.Define): Apply attributes.
17491 * attribute.cs (Attribute.ApplyAttributes): Added support for
17492 interface attributes.
17494 2002-08-11 Martin Baulig <martin@gnome.org>
17496 * statement.cs (Block.Emit): Only check the "this" variable if we
17497 do not always throw an exception.
17499 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
17500 whether the property has a set accessor.
17502 2002-08-11 Martin Baulig <martin@gnome.org>
17504 Added control flow analysis support for structs.
17506 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
17507 with control flow analysis turned off.
17508 (IVariable): New interface.
17509 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
17510 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
17511 (FieldExpr.DoResolve): Resolve the instance expression with flow
17512 analysis turned off and do the definite assignment check after the
17513 resolving when we know what the expression will resolve to.
17515 * expression.cs (LocalVariableReference, ParameterReference):
17516 Implement the new IVariable interface, only call the flow analysis
17517 code if ec.DoFlowAnalysis is true.
17518 (This): Added constructor which takes a Block argument. Implement
17519 the new IVariable interface.
17520 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
17521 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
17522 This does the definite assignment checks for struct members.
17524 * class.cs (Constructor.Emit): If this is a non-static `struct'
17525 constructor which doesn't have any initializer, call
17526 Block.AddThisVariable() to tell the flow analysis code that all
17527 struct elements must be initialized before control returns from
17530 * statement.cs (MyStructInfo): New public class.
17531 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
17532 argument to this indexer. If non-zero, check an individual struct
17533 member, not the whole struct.
17534 (FlowBranching.CheckOutParameters): Check struct members.
17535 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
17536 overloaded versions of these methods which take an additional
17537 `int field_idx' argument to check struct members.
17538 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
17539 overloaded versions of these methods which take an additional
17540 `string field_name' argument to check struct member.s
17541 (VariableInfo): Implement the IVariable interface.
17542 (VariableInfo.StructInfo): New public property. Returns the
17543 MyStructInfo instance of the variable if it's a struct or null.
17544 (Block.AddThisVariable): New public method. This is called from
17545 Constructor.Emit() for non-static `struct' constructor which do
17546 not have any initializer. It creates a special variable for the
17547 "this" instance variable which will be checked by the flow
17548 analysis code to ensure that all of the struct's fields are
17549 initialized before control returns from the constructor.
17550 (UsageVector): Added support for struct members. If a
17551 variable/parameter is a struct with N members, we reserve a slot
17552 in the usage vector for each member. A struct is considered fully
17553 initialized if either the struct itself (slot 0) or all its
17554 members are initialized.
17556 2002-08-08 Martin Baulig <martin@gnome.org>
17558 * driver.cs (Driver.MainDriver): Only report an error CS5001
17559 if there were no compilation errors.
17561 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
17562 `UnsafeContext' property to determine whether the parent is in
17563 unsafe context rather than checking the parent's ModFlags:
17564 classes nested in an unsafe class are unsafe as well.
17566 2002-08-08 Martin Baulig <martin@gnome.org>
17568 * statement.cs (UsageVector.MergeChildren): Distinguish between
17569 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
17570 we return. Added test17() and test18() to test-154.cs.
17572 2002-08-08 Martin Baulig <martin@gnome.org>
17574 * typemanager.cs (TypeManager.FilterWithClosure): If we have
17575 Family access, make sure the invoking type isn't a subclass of the
17576 queried type (that'd be a CS1540).
17578 * ecore.cs (Expression.MemberLookup): Added overloaded version of
17579 this method which takes an additional `Type invocation_type'.
17581 * expression.cs (BaseAccess.DoResolve): Use the base type as
17582 invocation and query type.
17583 (MemberAccess.DoResolve): If the lookup failed and we're about to
17584 report a CS0122, try a lookup with the ec.ContainerType - if this
17585 succeeds, we must report a CS1540.
17587 2002-08-08 Martin Baulig <martin@gnome.org>
17589 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
17590 (MethodGroupExpr): Implement the IMemberExpr interface.
17592 * expression (MemberAccess.ResolveMemberAccess): No need to have
17593 any special code for MethodGroupExprs anymore, they're now
17596 2002-08-08 Martin Baulig <martin@gnome.org>
17598 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
17599 Family, FamANDAssem and FamORAssem permissions.
17600 (TypeManager.IsSubclassOrNestedChildOf): New public method.
17602 2002-08-08 Martin Baulig <martin@gnome.org>
17604 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
17605 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
17608 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
17610 * driver.cs: implemented /resource option to embed managed resources.
17612 2002-08-07 Martin Baulig <martin@gnome.org>
17614 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
17615 (FieldBase.HasFieldInitializer): New public property.
17616 (FieldBase.GetInitializerExpression): New public method. Resolves and
17617 returns the field initializer and makes sure it is only resolved once.
17618 (TypeContainer.EmitFieldInitializers): Call
17619 FieldBase.GetInitializerExpression to get the initializer, this ensures
17620 that it isn't resolved multiple times.
17622 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
17623 the resolving process (SimpleName/MemberLookup) that we're currently
17624 emitting a field initializer (which must not access any instance members,
17625 this is an error CS0236).
17627 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
17628 argument, if the `IsFieldInitializer' flag is set, we must report and
17629 error CS0236 and not an error CS0120.
17631 2002-08-07 Martin Baulig <martin@gnome.org>
17633 * ecore.cs (IMemberExpr): New public interface.
17634 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
17635 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
17636 if the expression is an IMemberExpr.
17638 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
17639 to be null, implicitly default to `this' if we're non-static in
17640 this case. Simplified the code a lot by using the new IMemberExpr
17641 interface. Also fixed bug #28176 here.
17643 2002-08-06 Martin Baulig <martin@gnome.org>
17645 * cs-parser.jay (SimpleLookup): Removed. We need to create
17646 ParameterReferences during semantic analysis so that we can do a
17647 type-only search when resolving Cast, TypeOf and SizeOf.
17648 (block): Pass the `current_local_parameters' to the Block's
17651 * class.cs (ConstructorInitializer): Added `Parameters parameters'
17652 argument to the constructor.
17653 (ConstructorInitializer.Resolve): Create a temporary implicit
17654 block with the parameters.
17656 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
17657 references here if we aren't doing a type-only search.
17659 * statement.cs (Block): Added constructor which takes a
17660 `Parameters parameters' argument.
17661 (Block.Parameters): New public property.
17663 * support.cs (InternalParameters.Parameters): Renamed `parameters'
17664 to `Parameters' and made it public readonly.
17666 2002-08-06 Martin Baulig <martin@gnome.org>
17668 * ecore.cs (Expression.Warning): Made this public as well.
17670 * report.cs (Report.Debug): Print the contents of collections.
17672 2002-08-06 Martin Baulig <martin@gnome.org>
17674 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
17675 used to tell Resolve() which kinds of expressions it may return.
17676 (Expression.Resolve): Added overloaded version of this method which
17677 takes a `ResolveFlags flags' argument. This can be used to tell
17678 Resolve() which kinds of expressions it may return. Reports a
17680 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
17681 ResolveFlags.SimpleName.
17682 (Expression.Error118): Added overloaded version of this method which
17683 takes a `ResolveFlags flags' argument. It uses the flags to determine
17684 which kinds of expressions are allowed.
17686 * expression.cs (Argument.ResolveMethodGroup): New public method.
17687 Resolves an argument, but allows a MethodGroup to be returned.
17688 This is used when invoking a delegate.
17690 * TODO: Updated a bit.
17692 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17694 Fixed compilation with csc.
17696 * ecore.cs: Expression.Error made public. Is this correct? Should
17697 Warning be made public too?
17699 * expression.cs: use ea.Location instead of ea.loc.
17700 [FIXME: Filed as bug #28607: MCS must report these errors.]
17702 2002-08-06 Martin Baulig <martin@gnome.org>
17704 * ecore.cs (Expression.loc): Moved the location here instead of
17705 duplicating it in all derived classes.
17706 (Expression.Location): New public property.
17707 (Expression.Error, Expression.Warning): Made them non-static and
17708 removed the location argument.
17709 (Expression.Warning): Added overloaded version which takes an
17710 `int level' argument.
17711 (Expression.Error118): Make this non-static and removed the
17712 expression and location arguments.
17713 (TypeExpr): Added location argument to the constructor.
17715 * expression.cs (StaticCallExpr): Added location argument to
17717 (Indirection, PointerArithmetic): Likewise.
17718 (CheckedExpr, UnCheckedExpr): Likewise.
17719 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
17720 (StringPtr): Likewise.
17723 2002-08-05 Martin Baulig <martin@gnome.org>
17725 * expression.cs (BaseAccess.DoResolve): Actually report errors.
17727 * assign.cs (Assign.DoResolve): Check whether the source
17728 expression is a value or variable.
17730 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
17731 while resolving the corresponding blocks.
17733 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
17734 an error, don't silently return null.
17736 * statement.cs (Block.AddVariable): Do the error reporting here
17737 and distinguish between CS0128 and CS0136.
17738 (Block.DoResolve): Report all unused labels (warning CS0164).
17739 (LabeledStatement): Pass the location to the constructor.
17740 (LabeledStatement.HasBeenReferenced): New property.
17741 (LabeledStatement.Resolve): Set it to true here.
17743 * statement.cs (Return.Emit): Return success even after reporting
17744 a type mismatch error (CS0126 or CS0127), this is what csc does and
17745 it avoids confusing the users with any consecutive errors.
17747 2002-08-05 Martin Baulig <martin@gnome.org>
17749 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
17751 * const.cs (Const.LookupConstantValue): Catch circular definitions.
17753 * expression.cs (MemberAccess.DoResolve): Silently return if an
17754 error has already been reported.
17756 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
17757 error has already been reported.
17759 2002-08-05 Martin Baulig <martin@gnome.org>
17761 * statement.cs (UsageVector): Only initialize the `parameters'
17762 vector if we actually have any "out" parameters.
17764 2002-08-05 Martin Baulig <martin@gnome.org>
17766 * expression.cs (Binary.ResolveOperator): When combining delegates,
17767 they must have the same type.
17769 2002-08-05 Martin Baulig <martin@gnome.org>
17771 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
17772 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
17773 work with the ms runtime and we also don't need it: if we're a
17774 PropertyBuilder and not in the `indexer_arguments' hash, then we
17775 are a property and not an indexer.
17777 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
17778 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
17779 since the latter one doesn't work with the ms runtime.
17781 2002-08-03 Martin Baulig <martin@gnome.org>
17783 Fixed bugs #27998 and #22735.
17785 * class.cs (Method.IsOperator): New public field.
17786 (Method.CheckBase): Report CS0111 if there's already a method
17787 with the same parameters in the current class. Report CS0508 when
17788 attempting to change the return type of an inherited method.
17789 (MethodData.Emit): Report CS0179 if a method doesn't have a body
17790 and it's not marked abstract or extern.
17791 (PropertyBase): New abstract base class for Property and Indexer.
17792 (PropertyBase.CheckBase): Moved here from Property and made it work
17794 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
17795 the same so we can reuse it there.
17796 (Property, Indexer): Derive from PropertyBase.
17797 (MethodSignature.inheritable_property_signature_filter): New delegate
17798 to find properties and indexers.
17800 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
17801 argument and improved error reporting.
17803 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
17804 EmptyReadOnlyParameters and made it a property.
17806 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
17807 version of this method which takes a `PropertyInfo indexer'.
17808 (TypeManager.RegisterIndexer): New method.
17810 * class.cs: Added myself as author of this file :-)
17812 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17814 * class.cs: fixed compilation on windoze.
17816 2002-08-03 Martin Baulig <martin@gnome.org>
17818 * interface.cs (Interface.GetInterfaceBases): Check whether all
17819 base interfaces are at least as accessible than the current one.
17821 * class.cs (TypeContainer.GetClassBases): Check whether base types
17822 are at least as accessible than the current type.
17823 (TypeContainer.AsAccessible): Implemented and made non-static.
17824 (MemberBase.CheckParameters): Report errors if the accessibility
17827 * delegate.cs (Delegate.Delegate): The default visibility is
17828 internal for top-level types and private for nested types.
17829 (Delegate.Define): Report errors if the accessibility checks fail.
17831 * enum.cs (Enum.Enum): The default visibility is internal for
17832 top-level types and private for nested types.
17833 (Enum.DefineType): Compute the correct visibility.
17835 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
17836 function which takes a `bool is_toplevel' instead of a TypeContainer.
17838 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
17841 2002-08-02 Martin Baulig <martin@gnome.org>
17843 * expression.cs (LocalVariableReferenc): Added constructor which
17844 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
17845 (LocalVariableReference.IsReadOnly): New property.
17846 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
17847 variable is readonly, use our own readonly flag to do this; you can
17848 use the new constructor to get a writable reference to a read-only
17851 * cs-parser.jay (foreach_statement, using_statement): Get a writable
17852 reference to the local variable.
17854 2002-08-01 Miguel de Icaza <miguel@ximian.com>
17856 * rootcontext.cs (ResolveCore): Also include System.Exception
17858 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
17859 we reach an EmptyStatement.
17861 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
17864 * expression.cs (Binary.ResolveOperator): Check error result in
17867 use brtrue/brfalse directly and avoid compares to null.
17869 2002-08-02 Martin Baulig <martin@gnome.org>
17871 * class.cs (TypeContainer.Define): Define all nested interfaces here.
17872 Fixes bug #28407, added test-155.cs.
17874 2002-08-01 Martin Baulig <martin@gnome.org>
17876 * class.cs (Event.EmitDefaultMethod): Make this work with static
17877 events. Fixes #28311, added verify-3.cs.
17879 2002-08-01 Martin Baulig <martin@gnome.org>
17881 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
17882 `is_disposable' fields.
17883 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
17884 `hm.is_disposable' if we're using the collection pattern.
17885 (Foreach.EmitCollectionForeach): Use the correct type for the
17886 enumerator's local variable, only emit the try/finally block if
17887 necessary (fixes #27713).
17889 2002-08-01 Martin Baulig <martin@gnome.org>
17891 * ecore.cs (Expression.report118): Renamed to Error118 and made
17894 * statement.cs (Throw.Resolve): Check whether the expression is of
17895 the correct type (CS0118) and whether the type derives from
17896 System.Exception (CS0155).
17897 (Catch.Resolve): New method. Do the type lookup here and check
17898 whether it derives from System.Exception (CS0155).
17899 (Catch.CatchType, Catch.IsGeneral): New public properties.
17901 * typemanager.cs (TypeManager.exception_type): Added.
17903 2002-07-31 Miguel de Icaza <miguel@ximian.com>
17905 * driver.cs: Updated About function.
17907 2002-07-31 Martin Baulig <martin@gnome.org>
17909 Implemented Control Flow Analysis.
17911 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17912 (EmitContext.CurrentBranching): Added.
17913 (EmitContext.StartFlowBranching): Added.
17914 (EmitContext.EndFlowBranching): Added.
17915 (EmitContext.KillFlowBranching): Added.
17916 (EmitContext.IsVariableAssigned): Added.
17917 (EmitContext.SetVariableAssigned): Added.
17918 (EmitContext.IsParameterAssigned): Added.
17919 (EmitContext.SetParameterAssigned): Added.
17920 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17921 Added control flow analysis stuff here.
17923 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17924 resolve the expression as lvalue.
17925 (LocalVariableReference.DoResolve): Check whether the variable has
17926 already been assigned.
17927 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17928 the parameter as assigned here.
17929 (ParameterReference.DoResolve): Check whether the parameter has already
17931 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17932 expression as lvalue.
17934 * statement.cs (FlowBranching): New class for the flow analysis code.
17935 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17936 (LabeledStatement.IsDefined): New public property.
17937 (LabeledStatement.AddUsageVector): New public method to tell flow
17938 analyis that the label may be reached via a forward jump.
17939 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17941 (VariableInfo.Number): New public field. This is used by flow analysis
17942 to number all locals of a block.
17943 (Block.CountVariables): New public property. This is the number of
17944 local variables in this block (including the locals from all parent
17946 (Block.EmitMeta): Number all the variables.
17948 * statement.cs: Added flow analysis support to all classes.
17950 2002-07-31 Martin Baulig <martin@gnome.org>
17952 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
17953 To get debugging messages, compile mcs with /define:MCS_DEBUG and
17954 then use this argument.
17956 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17958 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17959 use this to specify /define options.
17961 2002-07-29 Martin Baulig <martin@gnome.org>
17963 * statement.cs (Fixed): Moved all code that does variable lookups
17964 and resolvings from Emit to Resolve.
17966 * statement.cs (For): Moved all code that does variable lookups
17967 and resolvings from Emit to Resolve.
17969 * statement.cs (Using): Moved all code that does variable lookups
17970 and resolvings from Emit to Resolve.
17972 2002-07-29 Martin Baulig <martin@gnome.org>
17974 * attribute.cs (Attribute.Resolve): Explicitly catch a
17975 System.NullReferenceException when creating the
17976 CustromAttributeBuilder and report a different warning message.
17978 2002-07-29 Martin Baulig <martin@gnome.org>
17980 * support.cs (ParameterData.ParameterName): Added method to
17981 get the name of a parameter.
17983 * typemanager.cs (TypeManager.IsValueType): New public method.
17985 2002-07-29 Martin Baulig <martin@gnome.org>
17987 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
17988 is a flag which specifies that it's either ref or out.
17989 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
17990 the out parameter to `out Parameter.Modifier mod', also set the
17991 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17993 * support.cs (InternalParameters.ParameterModifier): Distinguish
17994 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17995 Parameter.Modifier.ISBYREF flag if it's either ref or out.
17997 * expression.cs (Argument.GetParameterModifier): Distinguish
17998 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17999 Parameter.Modifier.ISBYREF flag if it's either ref or out.
18001 2002-07-29 Martin Baulig <martin@gnome.org>
18003 * expression.cs (ParameterReference.ParameterReference): Added
18004 `Location loc' argument to the constructor.
18006 * cs-parser.jay: Pass location to ParameterReference.
18008 2002-07-28 Miguel de Icaza <miguel@ximian.com>
18010 * statement.cs (Try): Initialize the location.
18012 * cs-parser.jay: pass location to Try.
18014 * expression.cs (Unary.Reduce): Change the prototype to return
18015 whether a constant fold could be performed or not. The result is
18016 returned in an out parameters. In the case of Indirection and
18017 AddressOf, we want to perform the full tests.
18019 2002-07-26 Miguel de Icaza <miguel@ximian.com>
18021 * statement.cs (Statement.Emit): Flag dead code.
18023 2002-07-27 Andrew Birkett <andy@nobugs.org>
18025 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
18027 2002-07-27 Martin Baulig <martin@gnome.org>
18029 * class.cs (MethodData.Define): Put back call to
18030 TypeManager.AddMethod(), accidentally commented this out.
18032 * report.cs (Debug): New public method to print debugging information,
18033 this is `[Conditional ("DEBUG")]'.
18035 2002-07-26 Martin Baulig <martin@gnome.org>
18037 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
18038 (switch_statement): Push the current_block to the switch_stack and
18039 pop it again when we're done with the switch.
18040 (switch_section): The new block is a child of the current_block.
18041 Fixes bug #24007, added test-152.cs.
18043 2002-07-27 Martin Baulig <martin@gnome.org>
18045 * expression.cs (Invocation.EmitArguments): When calling a varargs
18046 function with only its fixed arguments, we need to pass an empty
18049 2002-07-27 Martin Baulig <martin@gnome.org>
18051 Mono 0.13 has been released.
18053 2002-07-25 Miguel de Icaza <miguel@ximian.com>
18055 * driver.cs: Rename --resource to --linkres, because that is what
18056 we do currently, we dont support --resource yet.
18058 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
18060 2002-07-25 Martin Baulig <martin@gnome.org>
18062 * class.cs (MethodData): New public class. This is a `method builder'
18063 class for a method or one accessor of a Property/Indexer/Event.
18064 (MethodData.GetMethodFlags): Moved here from MemberBase.
18065 (MethodData.ApplyAttributes): Likewise.
18066 (MethodData.ApplyObsoleteAttribute): Likewise.
18067 (MethodData.ApplyConditionalAttribute): Likewise.
18068 (MethodData.ApplyDllImportAttribute): Likewise.
18069 (MethodData.CheckAbstractAndExternal): Likewise.
18070 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
18071 (MethodData.Emit): Formerly known as Method.Emit().
18072 (MemberBase): Moved everything which was specific to a single
18073 accessor/method to MethodData.
18074 (Method): Create a new MethodData and call Define() and Emit() on it.
18075 (Property, Indexer, Event): Create a new MethodData objects for each
18076 accessor and call Define() and Emit() on them.
18078 2002-07-25 Martin Baulig <martin@gnome.org>
18080 Made MethodCore derive from MemberBase to reuse the code from there.
18081 MemberBase now also checks for attributes.
18083 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
18084 (MemberBase.GetMethodFlags): Moved here from class Method and marked
18086 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
18087 `CallingConventions cc' and `Attributes opt_attrs' arguments.
18088 (MemberBase.ApplyAttributes): New virtual method; applies the
18089 attributes to a method or accessor.
18090 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
18091 (MemberBase.ApplyConditionalAttribute): Likewise.
18092 (MemberBase.ApplyDllImportAttribute): Likewise.
18093 (MemberBase.CheckAbstractAndExternal): Likewise.
18094 (MethodCore.ParameterTypes): This is now a property instead of a
18095 method, it's initialized from DoDefineParameters().
18096 (MethodCore.ParameterInfo): Removed the set accessor.
18097 (MethodCore.DoDefineParameters): New protected virtual method to
18098 initialize ParameterTypes and ParameterInfo.
18099 (Method.GetReturnType): We can now simply return the MemberType.
18100 (Method.GetMethodFlags): Override the MemberBase version and add
18101 the conditional flags.
18102 (Method.CheckBase): Moved some code from Define() here, call
18103 DoDefineParameters() here.
18104 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
18105 here to avoid some larger code duplication.
18106 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
18107 ensure that abstract and external accessors don't declare a body.
18109 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
18110 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
18111 lookup in the attribute's parent classes, so we need to abort as soon
18112 as we found the first match.
18113 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
18114 the attribute has no arguments.
18116 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
18119 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18121 * cs-parser.jay: reverted previous patch.
18123 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18125 * cs-parser.jay: fixed bug #22119.
18127 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18129 * attribute.cs: fixed compilation. The error was:
18130 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
18131 be assigned to before control leaves the current method."
18132 [FIXME: Filed as bug #28186: MCS must report this error.]
18134 2002-07-25 Martin Baulig <martin@gnome.org>
18136 * attribute.cs (Attribute.Conditional_GetConditionName): New static
18137 method to pull the condition name ouf of a Conditional attribute.
18138 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
18139 the obsolete message and error flag out of an Obsolete attribute.
18141 * class.cs (Method.GetMethodFlags): New public method to get the
18142 TypeManager.MethodFlags for this method.
18143 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
18145 (Method.Define): Get and apply the Obsolete and Conditional attributes;
18146 if we're overriding a virtual function, set the new private variable
18147 `parent_method'; call the new TypeManager.AddMethod().
18149 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
18150 the MethodBuilder and the Method in a PtrHashtable.
18151 (TypeManager.builder_to_method): Added for this purpose.
18152 (TypeManager.MethodFlags): Added IsObsoleteError.
18153 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
18154 Obsolete and Conditional arguments in MethodBuilders. If we discover
18155 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
18156 the message from the attribute.
18158 2002-07-24 Martin Baulig <martin@gnome.org>
18160 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
18161 preprocessor directives, ensure that the argument to #define/#undef is
18162 exactly one identifier and that it's actually an identifier.
18164 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
18167 2002-07-24 Martin Baulig <martin@gnome.org>
18169 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
18170 initialize it to TypeManager.object_type in the constructor.
18171 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
18172 of the `hm.get_current' method if we're using the collection pattern.
18173 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
18174 for the explicit conversion to make it work when we're using the collection
18175 pattern and the `Current' property has a different return type than `object'.
18178 2002-07-24 Martin Baulig <martin@gnome.org>
18180 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
18181 does not match, but don't report any errors. This method is called in
18182 order for all methods in a MethodGroupExpr until a matching method is
18183 found, so we don't want to bail out if the first method doesn't match.
18184 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
18185 matches, report the 123. Fixes #28070.
18187 2002-07-24 Martin Baulig <martin@gnome.org>
18189 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
18190 TypeManager.TypeToCoreType() to the top of the method so the
18191 following equality checks will work. Fixes #28107.
18193 2002-07-24 Martin Baulig <martin@gnome.org>
18195 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
18196 operand is of type uint, and the other operand is of type sbyte,
18197 short or int, the operands are converted to type long." -
18198 Actually do what this comment already told us. Fixes bug #28106,
18201 2002-07-24 Martin Baulig <martin@gnome.org>
18203 * class.cs (MethodBase): New abstract class. This is now a base
18204 class for Property, Indexer and Event to avoid some code duplication
18205 in their Define() and DefineMethods() methods.
18206 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
18207 generic methods for Define() and DefineMethods().
18208 (FieldBase): Derive from MemberBase, not MemberCore.
18209 (Property): Derive from MemberBase, not MemberCore.
18210 (Property.DefineMethod): Moved all the code from this method to the
18211 new MethodBase.DefineAccessor(), just call it with appropriate
18213 (Property.Define): Call the new Property.DoDefine(), this does some
18214 sanity checks and we don't need to duplicate the code everywhere.
18215 (Event): Derive from MemberBase, not MemberCore.
18216 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
18217 accessors, this will also make them work with interface events.
18218 (Indexer): Derive from MemberBase, not MemberCore.
18219 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
18220 (Indexer.Define): Use the new MethodBase functions.
18222 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
18223 argument to the constructor.
18224 (Interface.FindMembers): Added support for interface events.
18225 (Interface.PopluateEvent): Implemented.
18227 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
18229 2002-07-22 Miguel de Icaza <miguel@ximian.com>
18231 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
18232 but this is required to check for a method name being the same as
18233 the containing class.
18237 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18239 * interface.cs: initialize variable.
18241 2002-07-23 Martin Baulig <martin@gnome.org>
18243 Implemented the IndexerName attribute in interfaces.
18245 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
18246 name if this is an explicit interface implementation.
18247 (Indexer.InterfaceIndexerName): New public variable. If we're
18248 implementing an interface indexer, this is the IndexerName in that
18249 interface. Otherwise, it's the IndexerName.
18250 (Indexer.DefineMethod): If we're implementing interface indexer,
18251 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
18252 and Pending.ImplementIndexer methods.
18253 (Indexer.Define): Also define the PropertyBuilder if we're
18254 implementing an interface indexer and this is neither an explicit
18255 interface implementation nor do the IndexerName match the one in
18258 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
18259 If a method is defined here, then we always need to create a proxy
18260 for it. This is used when implementing interface indexers.
18261 (Pending.IsInterfaceIndexer): New public method.
18262 (Pending.ImplementIndexer): New public method.
18263 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
18264 This is used when implementing interface indexers to define a proxy
18266 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
18267 define a proxy if necessary.
18269 * interface.cs (Interface.IndexerName): New public variable.
18270 (Interface.PopulateIndexer): Set the IndexerName.
18271 (Interface.DefineIndexers): New private method. Populate all the
18272 indexers and make sure their IndexerNames match.
18274 * typemanager.cs (IndexerPropertyName): Added support for interface
18277 2002-07-22 Martin Baulig <martin@gnome.org>
18279 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
18280 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
18281 ret if HasReturnLabel.
18282 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
18285 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
18286 and set the ec.LoopBeginTryCatchLevel.
18287 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
18288 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
18289 the current ec.TryCatchLevel, the branch goes out of an exception
18290 block. In this case, we need to use Leave and not Br.
18292 2002-07-22 Martin Baulig <martin@gnome.org>
18294 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
18295 block unless the block does not always return or it is contained in
18296 another try { ... } catch { ... } block. Fixes bug #26506.
18297 Added verify-1.cs to the test suite.
18299 2002-07-22 Martin Baulig <martin@gnome.org>
18301 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
18302 then we do not always return. Fixes bug #24985.
18304 2002-07-22 Martin Baulig <martin@gnome.org>
18306 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
18307 lookup on a per-class level; ie. walk up the class hierarchy until we
18308 found at least one applicable method, then choose the best among them.
18309 Fixes bug #24463 and test-29.cs.
18311 2002-07-22 Martin Baulig <martin@gnome.org>
18313 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
18314 return types of the methods. The return type is not part of the
18315 signature and we must not check it to make the `new' modifier work.
18316 Fixes bug #27999, also added test-147.cs.
18317 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
18319 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
18320 on the method's return type.
18322 2002-07-21 Martin Baulig <martin@gnome.org>
18324 * assign.cs: Make this work if the rightmost source is a constant and
18325 we need to do an implicit type conversion. Also adding a few more tests
18326 to test-38.cs which should have caught this.
18328 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
18329 target in the makefile for this. The makefile.gnu is primarily intended
18330 for end-users who don't want to debug the compiler.
18332 2002-07-21 Martin Baulig <martin@gnome.org>
18334 * assign.cs: Improved the Assign class so it can now handle embedded
18335 assignments (X = Y = Z = something). As a side-effect this'll now also
18336 consume less local variables. test-38.cs now passes with MCS, added
18337 a few new test cases to that test.
18339 2002-07-20 Martin Baulig <martin@gnome.org>
18341 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
18342 instructions. Fixes bug #27977, also added test-146.cs.
18344 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18346 * cs-tokenizer.cs: fixed getHex ().
18348 2002-07-19 Martin Baulig <martin@gnome.org>
18350 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
18351 not Type.GetType() to lookup the array type. This is needed when
18352 we're constructing an array of a user-defined type.
18353 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
18354 single-dimensional arrays, but also for single-dimensial arrays of
18357 2002-07-19 Martin Baulig <martin@gnome.org>
18359 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
18360 this function is called, it's not allowed to share LocalBuilders
18361 among ILGenerators.
18363 2002-07-19 Martin Baulig <martin@gnome.org>
18365 * expression.cs (Argument.Resolve): Report an error 118 when trying
18366 to pass a type as argument.
18368 2002-07-18 Martin Baulig <martin@gnome.org>
18370 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
18371 Conv_R_Un for the signed `long' type.
18373 2002-07-15 Miguel de Icaza <miguel@ximian.com>
18375 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
18376 `expr' for the temporary result, as that will fail if we do
18377 multiple resolves on the same expression.
18379 2002-07-05 Miguel de Icaza <miguel@ximian.com>
18381 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
18382 ec.TypeContainer for looking up aliases.
18384 * class.cs (TypeContainer): Remove LookupAlias from here.
18386 * decl.cs (DeclSpace); Move here.
18388 2002-07-01 Miguel de Icaza <miguel@ximian.com>
18390 * class.cs (FindMembers): Only call filter if the constructor
18391 bulider is not null.
18393 Also handle delegates in `NestedTypes' now. Now we will perform
18394 type lookups using the standard resolution process. This also
18397 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
18398 This uses Expressions (the limited kind that can be parsed by the
18399 tree) instead of strings.
18401 * expression.cs (ComposedCast.ToString): Implement, used to flag
18402 errors since now we have to render expressions.
18404 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
18407 * ecore.cs (SimpleName.ToString): ditto.
18409 * cs-parser.jay: Instead of using strings to assemble types, use
18410 Expressions to assemble the type (using SimpleName, ComposedCast,
18411 MemberAccess). This should fix the type lookups in declarations,
18412 because we were using a different code path for this.
18414 * statement.cs (Block.Resolve): Continue processing statements
18415 even when there is an error.
18417 2002-07-17 Miguel de Icaza <miguel@ximian.com>
18419 * class.cs (Event.Define): Also remove the `remove' method from
18420 the list of pending items.
18422 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
18423 generate more compact code.
18425 2002-07-17 Martin Baulig <martin@gnome.org>
18427 * const.cs (Const.LookupConstantValue): Add support for constant
18428 `unchecked' and `checked' expressions.
18429 Also adding test case test-140.cs for this.
18431 2002-07-17 Martin Baulig <martin@gnome.org>
18433 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
18434 check whether mi.ReturnType implements the IEnumerator interface; the
18435 `==' and the IsAssignableFrom() will fail in this situation.
18437 2002-07-16 Ravi Pratap <ravi@ximian.com>
18439 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
18442 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18444 * expression.cs: fixed bug #27811.
18446 2002-07-14 Miguel de Icaza <miguel@ximian.com>
18448 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
18449 Molaro: when we are a ref, the value already contains a pointer
18450 value, do not take the address of it.
18452 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18453 * removed mb-parser.jay and mb-tokenizer.cs
18455 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18457 * expression.cs: check against the building corlib void type.
18459 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
18461 * ecore.cs: fix for valuetype static readonly fields: when
18462 initializing them, we need their address, not the address of a copy.
18464 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
18466 * typemanager.cs: register also enum_type in corlib.
18468 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18470 * class.cs: allow calling this (but not base) initializers in structs.
18472 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
18474 * ecore.cs: make sure we compare against the building base types
18477 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
18479 * typemanager.cs: fix TypeToCoreType() to handle void and object
18480 (corlib gets no more typerefs after this change).
18482 2002-07-12 Miguel de Icaza <miguel@ximian.com>
18484 * expression.cs (ArrayCreation.EmitArrayArguments): use
18485 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
18487 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
18488 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
18489 array indexes, the runtime actually forbids them.
18491 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
18492 for array arguments here.
18494 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
18495 instead of the default for ValueTypes.
18497 (New.DoEmit): Use IsValueType instead of
18498 IsSubclassOf (value_type)
18499 (New.DoResolve): ditto.
18500 (Invocation.EmitCall): ditto.
18502 * assign.cs (Assign): ditto.
18504 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
18505 Statements *are* currently doing part of their resolution during
18508 Expressions do always resolve during resolve, but statements are
18509 only required to propagate resolution to their children.
18511 2002-07-11 Miguel de Icaza <miguel@ximian.com>
18513 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
18515 (LoadAssembly): Do not add the dll if it is already specified
18517 (MainDriver): Add the System directory to the link path at the end,
18518 after all the other -L arguments.
18520 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
18521 wrong opcode for loading bytes and bools (ldelem.i1 instead of
18522 ldelem.u1) and using the opposite for sbytes.
18524 This fixes Digger, and we can finally run it.
18526 * driver.cs (UnixParseOption): Move the option parsing here.
18527 (CSCParseOption): Implement CSC-like parsing of options.
18529 We now support both modes of operation, the old Unix way, and the
18530 new CSC-like way. This should help those who wanted to make cross
18531 platform makefiles.
18533 The only thing broken is that /r:, /reference: and /lib: are not
18534 implemented, because I want to make those have the same semantics
18535 as the CSC compiler has, and kill once and for all the confussion
18536 around this. Will be doing this tomorrow.
18538 * statement.cs (Unsafe.Resolve): The state is checked during
18539 resolve, not emit, so we have to set the flags for IsUnsfe here.
18541 2002-07-10 Miguel de Icaza <miguel@ximian.com>
18543 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
18544 not catch the Error_ObjectRefRequired in SimpleName (as it is
18545 possible to have a class/instance variable name that later gets
18546 deambiguated), we have to check this here.
18548 2002-07-10 Ravi Pratap <ravi@ximian.com>
18550 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
18551 make static and put into Expression.
18553 (Event.Define): Register the private field of the event with the
18554 TypeManager so that GetFieldFromEvent can get at it.
18556 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
18557 keep track of the private field associated with an event which
18560 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
18563 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
18565 2002-07-10 Miguel de Icaza <miguel@ximian.com>
18567 * expression.cs (Binary.EmitBranchable): this routine emits the
18568 Binary expression in a branchable context. This basically means:
18569 we need to branch somewhere, not just get the value on the stack.
18571 This works together with Statement.EmitBoolExpression.
18573 * statement.cs (Statement.EmitBoolExpression): Use
18576 2002-07-09 Miguel de Icaza <miguel@ximian.com>
18578 * statement.cs (For): Reduce the number of jumps in loops.
18580 (For): Implement loop inversion for the For statement.
18582 (Break): We can be breaking out of a Try/Catch controlled section
18583 (foreach might have an implicit try/catch clause), so we need to
18584 use Leave instead of Br.
18586 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
18587 now). If the instace expression supports IMemoryLocation, we use
18588 the AddressOf method from the IMemoryLocation to extract the
18589 address instead of emitting the instance.
18591 This showed up with `This', as we were emitting the instance
18592 always (Emit) instead of the Address of This. Particularly
18593 interesting when This is a value type, as we dont want the Emit
18594 effect (which was to load the object).
18596 2002-07-08 Miguel de Icaza <miguel@ximian.com>
18598 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
18600 * statement.cs (Checked): Set the CheckedState during the resolve
18601 process too, as the ConvCast operations track the checked state on
18602 the resolve process, and not emit.
18604 * cs-parser.jay (namespace_member_declaration): Flag that we have
18605 found a declaration when we do. This is used to flag error 1529
18607 * driver.cs: Report ok when we display the help only.
18609 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
18611 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
18613 2002-07-04 Miguel de Icaza <miguel@ximian.com>
18615 * cs-tokenizer.cs (define): We also have to track locally the
18616 defines. AllDefines is just used for the Conditional Attribute,
18617 but we also need the local defines for the current source code.
18619 2002-07-03 Miguel de Icaza <miguel@ximian.com>
18621 * statement.cs (While, For, Do): These loops can exit through a
18622 Break statement, use this information to tell whether the
18623 statement is the last piece of code.
18625 (Break): Flag that we break.
18627 * codegen.cs (EmitContexts): New `Breaks' state variable.
18629 2002-07-03 Martin Baulig <martin@gnome.org>
18631 * class.cs (TypeContainer.MethodModifiersValid): Allow override
18632 modifiers in method declarations in structs. Otherwise, you won't
18633 be able to override things like Object.Equals().
18635 2002-07-02 Miguel de Icaza <miguel@ximian.com>
18637 * class.cs (Method, Property, Indexer): Do not allow the public
18638 modifier to be used in explicit interface implementations.
18640 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
18641 override modifiers in method declarations in structs
18643 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
18645 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
18646 integer or real overflow, report an error
18648 2002-07-02 Martin Baulig <martin@gnome.org>
18650 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
18651 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
18652 to tell the runtime about our newly created System.Object and
18653 System.ValueType types.
18655 2002-07-02 Miguel de Icaza <miguel@ximian.com>
18657 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
18658 struct instead of Ldarg/Starg.
18660 2002-07-02 Martin Baulig <martin@gnome.org>
18662 * expression.cs (Indirection.Indirection): Call
18663 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
18665 2002-07-02 Martin Baulig <martin@gnome.org>
18667 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
18668 ValueType, call TypeManager.TypeToCoreType() on it.
18669 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
18670 the OpCodes.Newarr argument.
18672 2002-07-02 Martin Baulig <martin@gnome.org>
18674 * expression.cs (Invocation.EmitCall): When compiling corlib,
18675 replace all calls to the system's System.Array type to calls to
18676 the newly created one.
18678 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
18679 System.Array methods.
18680 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
18681 from the system's System.Array type which must be replaced.
18683 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
18685 * typemanager.cs: load unverifiable_code_ctor so we can build
18686 corlib using the correct type. Avoid using GetTypeCode() with
18688 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
18689 TypeManager.object_type to allow building corlib.
18691 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
18693 * ecore.cs: handle System.Enum separately in LoadFromPtr().
18695 2002-07-01 Martin Baulig <martin@gnome.org>
18697 * class.cs: Make the last change actually work, we need to check
18698 whether `ifaces != null' to avoid a crash.
18700 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18702 * class.cs: when we build structs without fields that implement
18703 interfaces, we need to add the interfaces separately, since there is
18704 no API to both set the size and add the interfaces at type creation
18707 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18709 * expression.cs: the dimension arguments to the array constructors
18710 need to be converted if they are a long.
18712 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
18714 * class.cs: don't emit ldarg.0 if there is no parent constructor
18715 (fixes showstopper for corlib).
18717 2002-06-29 Martin Baulig <martin@gnome.org>
18719 MCS now compiles corlib on GNU/Linux :-)
18721 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
18722 ie. check for MethodImplOptions.InternalCall.
18724 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
18725 and TypeManager.attribute_type are null, so we must explicitly check
18726 whether parent is not null to find out whether it's an attribute type.
18727 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
18728 and SetBuilder, not only if the property is neither abstract nor external.
18729 This is necessary to set the MethodImplOptions on the accessor methods.
18730 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
18731 SetBuilder, see Property.Emit().
18733 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
18734 populate "System.Object", "System.ValueType" and "System.Attribute" since
18735 they've already been populated from BootCorlib_PopulateCoreTypes().
18737 2002-06-29 Martin Baulig <martin@gnome.org>
18739 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
18740 is the NullLiteral, we also need to make sure that target_type is not
18743 2002-06-29 Martin Baulig <martin@gnome.org>
18745 * rootcontext.cs (RootContext.ResolveCore): We must initialize
18746 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
18747 before calling BootstrapCorlib_ResolveDelegate ().
18749 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18751 * statement.cs: fixed build-breaker. All tests passed ok.
18753 2002-06-27 Martin Baulig <martin@gnome.org>
18755 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
18756 for System.Decimal when compiling corlib.
18758 2002-06-27 Martin Baulig <martin@gnome.org>
18760 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
18761 switch blocks which contain nothing but a default clause.
18763 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
18765 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
18767 2002-06-27 Martin Baulig <martin@gnome.org>
18769 * ecore.cs (PropertyExpr.PropertyExpr): Call
18770 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
18772 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
18773 is already a TypeBuilder.
18775 2002-06-27 Martin Baulig <martin@gnome.org>
18777 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
18778 `target_type == TypeManager.array_type', not IsAssignableFrom() in
18779 the "from an array-type to System.Array" case. This makes it work
18780 when compiling corlib.
18782 2002-06-27 Martin Baulig <martin@gnome.org>
18784 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
18785 non-static PropertyExpr, set its InstanceExpression. This makes
18786 the `ICollection.Count' property work in System/Array.cs.
18788 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
18790 * driver.cs: Made error handling more consistent. Errors now
18791 tracked by Report class, so many methods which used to return int
18792 now return void. Main() now prints success/failure and
18793 errors/warnings message.
18795 Renamed '--probe' compiler argument to '--expect-error'. Removed
18796 the magic number return values (123 and 124). Now, if the
18797 expected error occurs, the compiler exits with success (exit value
18798 0). If the compilation completes without seeing that particular
18799 error, the compiler exits with failure (exit value 1). The
18800 makefile in mcs/errors has been changed to handle the new behaviour.
18802 * report.cs: Made 'expected error' number a property and renamed
18803 it from 'Probe' to 'ExpectedError'.
18805 * genericparser.cs: Removed error handling support, since it is
18806 now all done by Report class.
18808 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
18809 class, so parse() no longer returns an int.
18811 * namespace.cs: Use Report.Error instead of GenericParser.error
18813 2002-06-22 Miguel de Icaza <miguel@ximian.com>
18815 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
18816 TypeContainer.AddOperator): At the front of the list put the
18817 explicit implementations, so they get resolved/defined first.
18819 2002-06-21 Miguel de Icaza <miguel@ximian.com>
18821 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
18822 interface type is implemented by this TypeContainer. Used during
18823 explicit interface implementation.
18825 (Property.Define, Indexer.Define, Method.Define): Validate that
18826 the given interface in the explicit implementation is one of the
18827 base classes for the containing type.
18829 Also if we are explicitly implementing an interface, but there is
18830 no match in the pending implementation table, report an error.
18832 (Property.Define): Only define the property if we are
18833 not explicitly implementing a property from an interface. Use the
18834 correct name also for those properties (the same CSC uses,
18835 although that is really not needed).
18837 (Property.Emit): Do not emit attributes for explicitly implemented
18838 properties, as there is no TypeBuilder.
18840 (Indexer.Emit): ditto.
18842 Hiding then means that we do not really *implement* a pending
18843 implementation, which makes code fail.
18845 2002-06-22 Martin Baulig <martin@gnome.org>
18847 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
18848 the return value of Object.GetType(). [FIXME: we need to do this whenever
18849 we get a type back from the reflection library].
18851 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
18853 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
18855 2002-06-20 Miguel de Icaza <miguel@ximian.com>
18857 * attribute.cs: Return null if we can not look up the type.
18859 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
18860 the interface types found.
18862 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
18863 interface types found.
18865 * typemanager.cs (GetInterfaces): Make this routine returns alll
18866 the interfaces and work around the lame differences between
18867 System.Type and System.Reflection.Emit.TypeBuilder in the results
18868 result for GetInterfaces.
18870 (ExpandInterfaces): Given an array of interface types, expand and
18871 eliminate repeated ocurrences of an interface. This expands in
18872 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
18875 2002-06-21 Martin Baulig <martin@gnome.org>
18877 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
18880 2002-06-21 Martin Baulig <martin@gnome.org>
18882 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
18883 and called with one of the core types, return the corresponding typebuilder for
18886 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18889 2002-06-21 Martin Baulig <martin@gnome.org>
18891 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18892 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18893 (Expression.ConvertReferenceExplicit): Likewise.
18895 * expression.cs (ElementAccess.DoResolve): Likewise.
18896 (ElementAccess.DoResolveLValue): Likewise.
18898 2002-06-10 Martin Baulig <martin@gnome.org>
18900 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18901 add the "value" parameter to the parameter list.
18903 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18906 2002-06-19 Miguel de Icaza <miguel@ximian.com>
18908 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18909 the argument to an int, uint, long or ulong, per the spec. Also
18910 catch negative constants in array creation.
18912 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18914 * class.cs: do not allow the same interface to appear twice in
18915 the definition list.
18917 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18919 * ecore.cs: don't use ldlen with System.Array.
18921 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18923 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18925 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18927 * modifiers.cs: produce correct field attributes for protected
18928 internal. Easy fix so miguel can work on ther harder stuff:-)
18930 2002-06-18 Miguel de Icaza <miguel@ximian.com>
18932 * pending.cs: New file. Move the code from class.cs here.
18933 Support clearning the pending flag for all methods (when not doing
18934 explicit interface implementation).
18936 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18938 * rootcontext.cs: added a couple more types needed to bootstrap.
18940 2002-06-17 Miguel de Icaza <miguel@ximian.com>
18942 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18943 constructor in the type, instead of any constructor in the type
18944 hierarchy. Thanks to Paolo for finding this bug (it showed up as
18945 a bug in the Mono runtime when applying the params attribute).
18947 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18948 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18950 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
18952 * expression.cs (Unary.ResolveOperator): Use TypeManager
18953 to resolve the type.
18955 2002-06-13 Ravi Pratap <ravi@ximian.com>
18957 * cs-parser.jay (enum_member_declaration): Pass in the attributes
18960 * enum.cs (AddEnumMember): Add support to store the attributes associated
18961 with each member too.
18963 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18964 field builders too - this takes care of the enum member case.
18966 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
18968 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
18969 address-of operator on both value types and pointers.
18971 2002-06-10 Martin Baulig <martin@gnome.org>
18973 * interface.cs (Interface.PopulateIndexer): Add the indexer's
18974 PropertyBuilder to the `property_builders' list.
18976 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
18977 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
18978 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
18979 find any indexers which are inherited from an interface.
18981 2002-06-09 Martin Baulig <martin@gnome.org>
18983 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
18984 the same type as the constant if necessary. There's also a test-130.cs
18987 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
18989 * typemanager.cs (TypeManager.ChangeType): Previously known as
18990 Enum.ChangeEnumType().
18992 2002-06-09 Martin Baulig <martin@gnome.org>
18994 * expression.cs (Cast.TryReduce): Added support for consts.
18996 2002-06-08 Ravi Pratap <ravi@ximian.com>
18998 * class.cs (Accessor): Hold attributes information so we can pass
19001 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
19002 Modify to pass in attributes attached to the methods.
19004 (add_accessor_declaration, remove_accessor_declaration): Ditto.
19006 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
19007 to handle the Accessor kind :-)
19009 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
19011 2002-06-08 Martin Baulig <martin@gnome.org>
19013 * expression.cs (Unary.TryReduceNegative): Added support for
19016 2002-06-08 Martin Baulig <martin@gnome.org>
19018 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
19019 name can't be found in the `defined_names' - the caller will do a
19020 MemberLookup in this case and thus find methods in System.Enum
19021 such as Enum.IsDefined().
19023 2002-06-08 Martin Baulig <martin@gnome.org>
19025 * enum.cs (Enum.ChangeEnumType): This is a custom version of
19026 Convert.ChangeType() which works with TypeBuilder created types.
19027 (Enum.LookupEnumValue, Enum.Define): Use it here.
19029 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
19030 `TypeBuilder.BaseType != null' check.
19031 (TypeContainer.FindMembers): Only lookup parent members if we
19032 actually have a parent.
19033 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
19034 (ConstructorInitializer.Resolve): Likewise.
19036 * interface.cs (Interface.FindMembers): Added
19037 `TypeBuilder.BaseType != null' check.
19039 * rootcontext.cs (RootContext.ResolveCore): Added
19040 "System.Runtime.CompilerServices.IndexerNameAttribute" to
19041 classes_second_stage.
19043 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
19044 debug_type and trace_type when compiling with --nostdlib.
19046 2002-06-07 Martin Baulig <martin@gnome.org>
19048 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
19049 (AddField): Set it to true when adding a non-static field.
19050 (DefineType): Use `have_nonstatic_fields' to find out whether we
19051 have non-static fields, not `Fields != null'.
19053 2002-06-02 Miguel de Icaza <miguel@ximian.com>
19055 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
19056 dereferencing a null on the static-field code path)
19058 2002-05-30 Martin Baulig <martin@gnome.org>
19060 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
19061 to take command line arguments. Use reflection to call the new
19062 custom `Initialize' function on the symbol writer and pass it the
19063 command line arguments.
19065 * driver.cs (--debug-args): New command line argument to pass command
19066 line arguments to the symbol writer.
19068 2002-05-28 Miguel de Icaza <miguel@ximian.com>
19070 * assign.cs (DoResolve): Forgot to do the implicit conversion to
19071 the target type for indexers and properties. Thanks to Joe for
19074 2002-05-27 Miguel de Icaza <miguel@ximian.com>
19076 * typemanager.cs (MethodFlags): returns the method flags
19077 (Obsolete/ShouldIgnore) that control warning emission and whether
19078 the invocation should be made, or ignored.
19080 * expression.cs (Invocation.Emit): Remove previous hack, we should
19081 not do this on matching a base type, we should do this based on an attribute
19083 Only emit calls to System.Diagnostics.Debug and
19084 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
19085 on the command line.
19087 * rootcontext.cs: Global settings for tracing and debugging.
19089 * cs-tokenizer.cs (define): New utility function to track
19090 defines. Set the global settings for TRACE and DEBUG if found.
19092 2002-05-25 Ravi Pratap <ravi@ximian.com>
19094 * interface.cs (Populate*): Pass in the TypeContainer as well as
19095 the DeclSpace as parameters so that we can create EmitContexts and
19096 then use that to apply attributes etc.
19098 (PopulateMethod, PopulateEvent, PopulateProperty)
19099 (PopulateIndexer): Apply attributes everywhere.
19101 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
19104 (ApplyAttributes): Update accordingly.
19106 We now apply interface attributes for all members too.
19108 2002-05-26 Miguel de Icaza <miguel@ximian.com>
19110 * class.cs (Indexer.Define); Correctly check if we are explicit
19111 implementation (instead of checking the Name for a ".", we
19112 directly look up if the InterfaceType was specified).
19114 Delay the creation of the PropertyBuilder.
19116 Only create the PropertyBuilder if we are not an explicit
19117 interface implementation. This means that explicit interface
19118 implementation members do not participate in regular function
19119 lookups, and hence fixes another major ambiguity problem in
19120 overload resolution (that was the visible effect).
19122 (DefineMethod): Return whether we are doing an interface
19125 * typemanager.cs: Temporary hack until we get attributes in
19126 interfaces (Ravi is working on that) and we get IndexerName
19127 support in interfaces.
19129 * interface.cs: Register the indexers as properties.
19131 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
19132 warning, I have verified that this is a bug in the .NET runtime
19133 (JavaScript suffers of the same problem).
19135 * typemanager.cs (MemberLookup): When looking up members for
19136 interfaces, the parent of an interface is the implicit
19137 System.Object (so we succeed in searches of Object methods in an
19138 interface method invocation. Example: IEnumerable x; x.ToString
19141 2002-05-25 Miguel de Icaza <miguel@ximian.com>
19143 * class.cs (Event): Events should also register if they do
19144 implement the methods that an interface requires.
19146 * typemanager.cs (MemberLookup); use the new GetInterfaces
19149 (GetInterfaces): The code used to lookup interfaces for a type is
19150 used in more than one place, factor it here.
19152 * driver.cs: Track the errors at the bottom of the file, we kept
19155 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
19156 instance if the method we are calling is static!
19158 2002-05-24 Miguel de Icaza <miguel@ximian.com>
19160 * attribute.cs (ApplyAttributes): Make this function filter out
19161 the IndexerName attribute (as that attribute in reality is never
19162 applied) and return the string constant for the IndexerName
19165 * class.cs (TypeContainer.Emit): Validate that all the indexers
19166 have the same IndexerName attribute, and if so, set the
19167 DefaultName attribute on the class.
19169 * typemanager.cs: The return value might contain other stuff (not
19170 only methods). For instance, consider a method with an "Item"
19171 property and an Item method.
19173 * class.cs: If there is a problem with the parameter types,
19176 2002-05-24 Ravi Pratap <ravi@ximian.com>
19178 * ecore.cs (ImplicitConversionExists): Wrapper function which also
19179 looks at user defined conversion after making a call to
19180 StandardConversionExists - we need this for overload resolution.
19182 * expression.cs : Update accordingly the various method calls.
19184 This fixes 2 bugs filed against implicit user defined conversions
19186 2002-05-22 Miguel de Icaza <miguel@ximian.com>
19188 * statement.cs: Track the result of the assignment.
19190 2002-05-21 Miguel de Icaza <miguel@ximian.com>
19192 * expression.cs (MemberAccess): Improved error reporting for
19193 inaccessible members.
19195 2002-05-22 Martin Baulig <martin@gnome.org>
19197 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
19198 itself with debugging support.
19200 2002-05-22 Martin Baulig <martin@gnome.org>
19202 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
19203 Removed, this isn't needed anymore.
19205 2002-05-20 Martin Baulig <martin@gnome.org>
19207 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
19208 be underlying type for an enum.
19210 2002-05-20 Miguel de Icaza <miguel@ximian.com>
19212 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
19213 that splits out the loading of just the core types.
19215 * rootcontext.cs (ResolveCore): Split the struct resolution in
19216 two, so we can load the enumeration underlying types before any
19219 * expression.cs (Is): Bandaid until we fix properly Switch (see
19220 bug #24985 for details).
19222 * typemanager.cs (ImplementsInterface): The hashtable will contain
19223 a null if there are no interfaces implemented.
19225 2002-05-18 Miguel de Icaza <miguel@ximian.com>
19227 * cs-parser.jay (indexer_declarator): It is fine to have array
19230 2002-05-17 Miguel de Icaza <miguel@ximian.com>
19232 * typemanager.cs: (RegisterBuilder): New function used to register
19233 TypeBuilders that implement interfaces. Since
19234 TypeBuilder.GetInterfaces (as usual) does not work with lame
19236 (AddUserType): register interfaces.
19238 (ImplementsInterface): Use the builder_to_ifaces hash if we are
19239 dealing with TypeBuilder. Also, arrays are showing up as
19240 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
19241 methods can not be invoked on them!
19243 * ecore.cs (ExplicitReferenceConversionExists): Made public.
19244 (ImplicitReferenceConversionExists): Split out from
19245 StandardConversionExists.
19247 * expression.cs (As): We were only implementing one of the three
19248 cases for the as operator. We now implement them all.
19249 (Is): Implement the various other cases for Is as well.
19251 * typemanager.cs (CACHE): New define used to control if we want or
19252 not the FindMembers cache. Seems to have a negative impact on
19253 performance currently
19255 (MemberLookup): Nested types have full acess to
19256 enclosing type members
19258 Remove code that coped with instance/static returns for events, we
19259 now catch this in RealFindMembers.
19261 (RealFindMembers): only perform static lookup if the instance
19262 lookup did not return a type or an event.
19264 2002-05-17 Miguel de Icaza <miguel@ximian.com>
19266 * assign.cs (CompoundAssign): We pass more semantic information
19267 now to Compound Assignments than we did before: now we have all
19268 the information at hand, and now we resolve the target *before* we
19269 do the expression expansion, which allows the "CacheValue" method
19270 to have the effect we intended (before, a [x] += 1 would generate
19271 two differen ArrayAccess expressions from the ElementAccess,
19272 during the resolution process).
19274 (CompoundAssign.DoResolve): Resolve target and original_source here.
19276 2002-05-16 Miguel de Icaza <miguel@ximian.com>
19278 * expression.cs (ArrayAccess): dropped debugging information.
19280 * typemanager.cs: Small bug fix: I was always returning i_members,
19281 instead of one of i_members or s_members (depending on which had
19284 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
19285 method is invoked before any code generation takes place, and it
19286 is a mechanism to inform that the expression will be invoked more
19287 than once, and that the method should use temporary values to
19288 avoid having side effects
19290 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
19292 * ecore.cs (Expression.CacheTemporaries): Provide empty default
19295 * expression.cs (Indirection, ArrayAccess): Add support for
19296 CacheTemporaries in these two bad boys.
19298 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
19299 ldobj or ldind_ref.
19300 (StoreFromPtr): Handle stobj as well.
19302 * expression.cs (UnaryMutator): Share more code.
19304 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
19305 down: I was not tracking the Filter function as well, which
19306 was affecting the results of the cache.
19308 2002-05-15 Miguel de Icaza <miguel@ximian.com>
19310 * attribute.cs: Remove the hack to handle the CharSet property on
19313 2002-05-14 Miguel de Icaza <miguel@ximian.com>
19315 * attribute.cs (DoResolve): More uglyness, we now only try to
19316 resolve the attribute partially, to extract the CharSet
19317 information (only if we are a StructLayout attribute). Otherwise
19319 (GetExtraTypeInfo): Add some code to conditionally kill in the
19320 future this. I am more and more convinced that the .NET
19321 framework has special code to handle the attribute setting on
19324 * expression.cs (IsParamsMethodApplicable): Revert my previous
19325 foreach change here, it was wrong.
19327 2002-05-13 Miguel de Icaza <miguel@ximian.com>
19329 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
19330 (pp_expr): do not abort on unknown input, just return.
19331 (eval): abort if there are pending chars.
19333 * attribute.cs (Attribute.Resolve): Positional parameters are
19334 optional. Deal with that case.
19336 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
19337 the Ansi/Unicode/Auto information for the type.
19339 (TypeContainer.DefineType): instantiate the EmitContext here, as
19340 we will be using it during the type definition (to resolve
19341 attributes) and during the emit phase.
19343 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
19344 to pull type information out of the attributes
19346 (Attribute.Resolve): track the constructor builder, and allow for
19347 multiple invocations (structs and classes will use this).
19349 * ecore.cs (MemberLookupFinal): new version with all the
19350 parameters customizable.
19352 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
19353 constructors. Return if the result value is null (as the error
19354 would have been flagged already by MemberLookupFinal)
19356 Do not allow instances of abstract classes or interfaces to be
19359 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
19360 We have to compare the assembly property here when dealing with
19361 FamANDAssem and Assembly access modifiers, because we might be
19362 creating an assembly from *modules* (that means that we are not
19363 getting TypeBuilders for types defined in other modules that are
19364 part of this assembly).
19366 (Method.Emit): If the method is marked abstract and has a body,
19369 (TypeContainer.DefineMembers): If both the defined member and the
19370 parent name match are methods, then do not emit any warnings: let
19371 the Method.Define routine take care of flagging warnings. But if
19372 there is a mismatch (method overrides something else, or method is
19373 overriwritten by something, then emit warning).
19375 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
19376 set to null, this means `do not check for the return type on the
19379 (Method.Define): set the return type for the method signature to
19380 null, so that we get methods with the same name and parameters and
19381 different return types. This is used to flag warning 114 (you are
19382 hiding a method, and you probably want to use the new/override
19385 * typemanager.cs (MemberLookup): Implemented proper access
19386 control, closing a long standing set of bug reports. The problem
19387 was that the Framework only has two bits: Public and NonPublic,
19388 and NonPublic includes private and protected methods, but we need
19389 to enforce the FamANDAssem, FamOrAssem and Family.
19391 2002-05-11 Miguel de Icaza <miguel@ximian.com>
19393 * statement.cs (GotoCase): Return true: Ammounts to giving up
19394 knowledge on whether we return or not, and letting the other case
19395 be responsible for it.
19397 2002-05-10 Miguel de Icaza <miguel@ximian.com>
19399 * driver.cs: Do not load directories for each file processed, only
19400 do it if there is a pattern.
19402 * ecore.cs: Report readonly assigns here as well, as we might have
19403 been resolved only by MemberAccess.
19405 (SimpleName.SimpleNameResolve): Also be useful for LValue
19406 resolution. We need this to propagate assign to local readonly variables
19408 * typemanager.cs: Use a ptrhashtable for the criteria, because we
19409 do not want to reuse potential criteria memory.
19411 * class.cs (MyEventBuilder): Set reflected_type;
19413 * ecore.cs (Constantify): Added support for constifying bools.
19415 (RootContext.LookupType): Added a cache for values looked up in
19416 the declaration space.
19418 * typemanager.cs (FindMembers): Now is a front-end to
19419 RealFindMembers, and provides a two-level hashtable-based cache to
19422 15% performance improvement: from 22.5 to 19.2 seconds.
19424 * expression.cs (IsParamsMethodApplicable): use foreach.
19425 (Invocation.DoResolve): ditto.
19426 (New.DoResolve): ditto.
19427 (ArrayCreation.DoResolve): ditto.
19429 * ecore.cs (FindMostEncompassingType): use foreach.
19431 * delegate.cs (NewDelegate.DoResolve): Use foreach
19433 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
19434 (RemoveMethods): use foreach.
19436 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
19437 nested foreach statements instead of for, and also break out of
19438 the inner loop once a match is found.
19440 (Invocation.OverloadResolve): Use foreach, simplify the code.
19442 2002-05-08 Miguel de Icaza <miguel@ximian.com>
19444 * cfold.cs (BinaryFold): During an enumeration evaluation context,
19445 we actually unwrap the expression to allow for extra information
19448 * expression.cs: Use Shr_Un on unsigned operations.
19450 2002-05-08 Ravi Pratap <ravi@ximian.com>
19452 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
19453 applicable operators was not being considered correctly. This closes
19454 the bug Miguel reported.
19456 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
19458 * attribute.cs: check that the type derives from System.Attribute
19459 and report the correct error in that case (moved the duplicate code to
19460 its own method, too).
19462 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
19464 * attribute.cs: lookup attribute type name as the spec says: first the
19465 bare attribute name and then name + "Attribute" (nant compiles with
19466 mcs after this fix).
19468 2002-05-07 Miguel de Icaza <miguel@ximian.com>
19470 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
19471 Because of the way we parse things, we should try to see if a
19472 UIntConstant can fit in an integer.
19474 2002-05-07 Ravi Pratap <ravi@ximian.com>
19476 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
19477 when we are in an explicit context.
19479 (ConvertReferenceExplicit): When converting from Iface type S to Class
19480 T make sure the rules are implemented as an OR.
19482 * parameter.cs (ParameterType): Make it a property for now although the
19483 purpose really isn't anything immediate.
19485 * expression.cs (Is*Applicable): Do better checking on the parameter type
19486 of a ref/out parameter. The ones from the system assemblies are already
19487 marked with the correct type so we don't need to do any correction.
19489 * ecore.cs (StandardConversionExists): Conversion from Interface types to
19490 the object type is standard too so include that.
19492 2002-05-06 Miguel de Icaza <miguel@ximian.com>
19494 * ecore.cs (StandardConversionExists): Augment with missing code:
19495 deal with IntConstant, LongConstants and Enumerations.
19497 * assign.cs: Report the error, instead of failing silently
19499 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
19500 typecontainer that they are declared, because the
19501 typecontainer/namespace will have the list of using clauses that
19502 need to be applied.
19504 Assembly Attributes were escaping the normal registration
19507 (EmitCode): Apply attributes within an EmitContext that represents
19508 the container they were declared on.
19510 * cs-parser.jay: Track bases for structs. How did I get this wrong?
19512 2002-05-06 Ravi Pratap <ravi@ximian.com>
19514 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
19515 Revamp completely - make much cleaner as we now operate only
19518 (FindMostSpecificSource, FindMostSpecificTarget): New methods
19519 to implement the logic detailed in the spec more correctly.
19521 (UserDefinedConversion): Update accordingly.
19523 2002-05-06 Miguel de Icaza <miguel@ximian.com>
19525 * statement.cs: Return flow analysis information up.
19527 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
19530 (token): Do not consume an extra character before calling
19533 2002-05-06 Piers Haken <piersh@friskit.com>
19535 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
19537 2002-05-06 Miguel de Icaza <miguel@ximian.com>
19539 * class.cs (Constructor.Emit): Set the IsStatic flag in the
19540 EmitContext during the instance constructor initializer
19541 resolution, to stop access to instance variables.
19543 This is mandated by the spec, last paragraph of the `constructor
19544 initializers' section.
19546 2002-05-05 Miguel de Icaza <miguel@ximian.com>
19548 * cs-parser.jay, class.cs (Accessor): new class used to represent
19549 an accessor (get or set). In the past we used `null' to represent
19550 a missing accessor. But this is ambiguous because there was no
19551 way to tell in abstract indexers/properties if one of them was
19554 Now there is a way of addressing that.
19556 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
19557 instead of FindMembers.
19559 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
19560 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
19562 * attribute.cs: Treat indexers and properties as the same in terms
19563 of applying attributes
19565 * ecore.cs (FindMostEncompassedType): Use statically initialized
19566 EmptyExpressions()s like we do elsewhere to avoid creating useless
19567 objects (and we take this out of the tight loop).
19569 (GetConversionOperators): Move the code to extract the actual
19570 operators to a separate routine to clean things up.
19572 2002-05-04 Miguel de Icaza <miguel@ximian.com>
19574 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
19575 events are always registered FieldBuilders.
19577 * class.cs (FieldBase): New class shared by Fields
19579 * delegate.cs: If we are a toplevel delegate, use our full name.
19580 If we are a nested delegate, then only use our tail name.
19582 2002-05-02 Ravi Pratap <ravi@ximian.com>
19584 * expression.cs (IsApplicable): Ensure that we add the "&" to
19585 ref/out types before comparing it with the type of the argument.
19587 (IsParamsMethodApplicable): Ditto.
19589 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
19592 * delegate.cs : Handle the case when we have more than one applicable
19593 method. Flag an error only when we finish checking all.
19595 2002-05-02 Miguel de Icaza <miguel@ximian.com>
19597 * expression.cs: Add support for boolean static initializers.
19599 2002-05-01 Miguel de Icaza <miguel@ximian.com>
19601 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
19603 * parameter.cs (ComputeParameterTypes,
19604 ComputeAndDefineParameterTypes): Better error handling: now we
19605 clear the `types' cache if we fail during any of the type lookups.
19606 We also return the status code correctly to our caller
19608 * delegate.cs: If we fail to define a delegate, abort the extra
19611 * expression.cs (Binary.ResolveOperator): for
19612 operator==(object,object) and operator !=(object, object) we also
19613 have to verify that there is an implicit conversion from one to
19616 (ArrayAccess.DoResolve): Array Access can operate on
19619 2002-04-30 Miguel de Icaza <miguel@ximian.com>
19621 * assign.cs (CompoundAssign): A new class used as a "flag" that
19622 the assignment actually is happening as part of a compound
19623 assignment operator.
19625 During compound assignment, a few new rules exist to enable things
19632 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
19633 to the type of x) if y is implicitly convertible to the type of x,
19634 and the operator is a builtin operator and the return type of the
19635 operator is explicitly convertible to the type of x.
19637 * rootcontext.cs: Reset warning level to 2. 4 catches various
19638 "interesting" features in mcs, we must clean this up at some
19639 point, but currently am trying to kill other bugs ;-)
19641 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
19642 in container classes as well.
19644 * expression.cs (Binary.ResolveOperator): Handle string case
19645 before anything else (as operator overloading does emit an error
19646 before doing anything else).
19648 This code could go away when we move to a table driven model, but
19649 i could not come up with a good plan last night.
19651 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
19653 * typemanager.cs (CSharpName): reimplementation using regex.
19654 * class.cs: added null check for fields in Emit
19655 * rootcontext.cs: set warninglevel to 4
19657 2002-04-29 Miguel de Icaza <miguel@ximian.com>
19659 * typemanager.cs (CSharpName): reimplemented with Lupus
19662 2002-04-28 Miguel de Icaza <miguel@ximian.com>
19664 * statement.cs (If): correclty implement Resolve, because we were
19665 not catching sem errors in there. The same process is needed
19667 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
19670 (Statement.Warning_DeadCodeFound): Factorize code.
19671 (While): Report dead code here too.
19673 (Statement): Added Resolve virtual method to allow
19674 for resolution split from the emit code.
19676 2002-04-26 Miguel de Icaza <miguel@ximian.com>
19678 * statement.cs (EmitBoolExpression): No longer try to resolve the
19680 (MakeBoolean): New utility function that resolve, implicitly
19681 converts to boolean and tags the expression.
19684 (If, Do): Implement dead code elimination.
19685 (While): Implement loop inversion
19687 (Do, While, For, If): Resolve the expression prior to calling our
19690 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
19693 - added method Report28 (warning: program has more than one entry point)
19694 - added method IsEntryPoint, implements paragraph 10.1 of the spec
19695 - modified method Method.Define, the part at the end of the method
19697 * rootcontext.cs: added static public Location EntryPointLocation;
19699 * ../errors/cs0028.cs : Add test case for the above warning.
19702 - modified method CSharpName to allow arrays of primitive type to
19703 be printed nicely (e.g. instead of System.Int32[][] it now prints
19705 - added method CSharpSignature: returns the signature of a method
19706 in string format to be used in reporting errors, warnings, etc.
19708 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
19711 2002-04-26 Ravi Pratap <ravi@ximian.com>
19713 * delegate.cs (Define): Fix extremely silly bug where I was
19714 setting the type of the 'object' parameter of the BeginInvoke
19715 method to System.IAsyncResult instead of System.Object ;-)
19717 2002-04-26 Miguel de Icaza <miguel@ximian.com>
19719 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
19722 (Constructor.Emit): return if we fail to initialize the
19723 constructor. Another door closed!
19725 * expression.cs (New.DoResolve): Improve error message (from -6 to
19726 1501). Use DeclaredOnly lookup to find the exact constructor.
19728 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
19729 loop. This is useful.
19731 * cs-parser.jay: Adjust the default parameters so that destructors
19732 have the proper signature.
19734 2002-04-26 Martin Baulig <martin@gnome.org>
19736 * driver.cs (LoadAssembly): If `assembly' contains any characters
19737 which are only valid in path names and not in assembly names
19738 (currently slash, backslash and point), use Assembly.LoadFrom ()
19739 instead of Assembly.Load () on the `assembly' (before iteration
19740 over the link_paths).
19742 2002-04-26 Martin Baulig <martin@gnome.org>
19744 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
19746 2002-04-25 Miguel de Icaza <miguel@ximian.com>
19748 * class.cs (Property): use the new typemanager.MemberLookup
19750 (TypeContainer.MemberLookup): Implement using the
19751 TypeManager.MemberLookup now.
19753 * typemanager.cs: Make MemberLookup a function of the TypeManager,
19754 and return MemberInfos, so that these can be used without an
19755 EmitContext (what we had before).
19757 2002-04-24 Miguel de Icaza <miguel@ximian.com>
19759 * expression.cs: Fix the case where the argument to params if the
19760 type of the params. I omitted handling this before. Fixed
19762 2002-04-22 Miguel de Icaza <miguel@ximian.com>
19764 * driver.cs: Call BootCorlib_PopulateCoreType
19766 * class.cs (Property.CheckBase): Check for properties only, not
19769 * interface.cs: Temporary hack: try/catch around the
19770 CustomAttributeBuilder, because I am getting an exception that I
19773 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
19774 types whose definitions are required to be there (attributes are
19775 defined before standard types).
19777 Compute definitions as we boot the various types, as they are used
19778 immediately (value_type class will need object_type, but if we do
19779 not initialize object_type, we will pass a null, which will let
19780 the runtime pick the System.Object from the existing corlib, which
19781 is not what we want).
19783 2002-04-22 Patrik Torstensson <totte@labs2.com>
19785 * cs-tokenizer.cs: fixed a number of trim() issues.
19787 2002-04-22 Ravi Pratap <ravi@ximian.com>
19789 * expression.cs (Argument.Type): Ensure that we return the correct
19790 type when we have out or ref parameters [in which case we
19793 2002-04-22 Miguel de Icaza <miguel@ximian.com>
19795 * class.cs (Property, Indexer): Allow extern modifier in there.
19797 * typemanager.cs (InitBaseTypes): Initializes object_type and
19798 value_type, since those will be used early on during the bootstrap
19799 process to compile corlib.
19801 (InitCoreTypes): Move code from here to InitBaseTypes.
19803 2002-04-21 Miguel de Icaza <miguel@ximian.com>
19805 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
19806 single-dimension arrays as using the ldlen opcode.
19808 Daniel Lewis discovered this optimization.
19810 * typemanager.cs: Add signature for System.Array::get_Length
19812 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19814 * statement.cs: report the error when the foreach does not apply to an
19815 array nor a collection.
19817 2002-04-19 Miguel de Icaza <miguel@ximian.com>
19819 * expression.cs: Add implicit conversions to the operator ~.
19821 * constant.cs (DecimalConstant.Emit): Emit decimal value.
19823 * typemanager.cs: Locate the decimal constructor.
19825 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19827 * attribute.cs: use the new property of TypeOf.
19828 * expression.cs: added 'get' property around typearg.
19830 These changes fix a build breaker reported by NickD. Is this the
19831 correct way to fix? If not, please, revert my changes and make it
19834 2002-04-17 Miguel de Icaza <miguel@ximian.com>
19836 * attribute.cs: Add support for typeof in attribute invocations.
19837 I am not sure that this is right though.
19839 2002-04-14 Duncan Mak <duncan@ximian.com>
19841 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
19842 Binary.Operator.Division case.
19844 2002-04-13 Ravi Pratap <ravi@ximian.com>
19846 * class.cs (DefineType): Ensure that we do a proper check on
19847 attribute types and also register it with the TypeManager.
19849 (TypeContainer.Targets): The default for attribute types is
19850 AttributeTargets.All.
19852 * attribute.cs (ApplyAttributes): Registering the attribute type
19853 is done elsewhere, not when we discover we have a Usage attribute.
19855 2002-04-12 Ravi Pratap <ravi@ximian.com>
19857 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
19858 and get rid of is_delegate parameter.
19860 * everywhere : update.
19862 2002-04-12 Ravi Pratap <ravi@ximian.com>
19864 * cs-parser.jay (compilation_unit): Revamp completely to use
19865 some new ideas that I got from Rhys' grammar to solve the problems
19866 with assembly level attributes.
19868 (outer_declaration): New grammar production.
19870 (attribute_sections): Add.
19872 (opt_attributes): Base on attribute_sections
19874 (namespace_declaration): Allow opt_attributes to tackle the case
19875 when we have assembly level attributes - we are clever in this
19878 * attribute.cs (ApplyAttributes): Do not worry about assembly
19879 attributes in the non-global context.
19881 * rootcontext.cs (AddGlobalAttributes): Go back to using this
19882 instead of SetGlobalAttributes.
19884 * class.cs, rootcontext.cs : Ensure we define and generate
19885 attribute types before anything else.
19887 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19888 and flag the new error -20 for the case when the attribute type
19889 does not have valid targets specified. csc does not catch this.
19891 * ../errors/errors.txt : update for error # -20
19893 2002-04-11 Ravi Pratap <ravi@ximian.com>
19895 * support.cs (InternalParameters.ParameterModifier): Do some null
19896 checking and return sane values.
19898 * class.cs (Method.Define): If we are a PInvoke method, ensure
19899 that we are static and extern. Report error # 601
19901 * ../errors/cs0601.cs : Add test case for the above error.
19903 2002-04-07 Ravi Pratap <ravi@ximian.com>
19905 * rootcontext.cs (attribute_types): We need to keep type of
19906 all attribute types separately and emit code for them first.
19908 (RegisterAttribute) : Implement.
19910 * class.cs (DefineType): Check if the current Type is a custom
19911 attribute type and register it accordingly.
19913 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19914 adding the first attribute twice and rename to
19916 (SetGlobalAttributes): this.
19918 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19921 * attribute.cs (ApplyAttributes): Take an additional argument telling us
19922 if we are processing global arguments. Hmm, I am unsure of this.
19924 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19926 * expression.cs: added static array of strings to avoid calling
19927 Enum.ToString () for Operator in Binary. Significant recover of
19930 2002-04-10 Miguel de Icaza <miguel@ximian.com>
19932 * class.cs (FindMembers): Allow the Builders of the various
19933 members to be null. If they are skip them. This only happens
19934 during the PInvoke declaration.
19936 2002-04-09 Miguel de Icaza <miguel@ximian.com>
19938 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19939 failure, so we do not keep going afterwards.
19941 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19942 wanted to pass `false' as the `is_delegate' argument. If this is
19943 the case, why not use delegate_type == null to mean `is_delegate =
19944 false' and anything else as is_delegate = true.
19946 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
19948 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19949 code for the section, not the beginning of the tests.
19951 2002-04-08 Miguel de Icaza <miguel@ximian.com>
19953 * cfold.cs: Handle operator + (Enum x, Underlying x)
19955 * expression.cs (Binary): same. Warn about errors where we have
19956 Enum/Enum in operator + as well.
19958 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
19961 - added support for switch(bool)
19962 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19963 - add TableSwitchEmit() to handle table-based switch statements
19965 2002-04-05 Ravi Pratap <ravi@ximian.com>
19967 * expression.cs (Invocation.OverloadResolve): Factor out code which
19968 does parameter compatibility checking with arguments so that we can
19969 re-use the code even from Delegate.VerifyApplicability
19971 (VerifyArgumentsCompat): Move above code here.
19973 * delegate.cs (VerifyApplicability): Get rid of duplicate code
19974 and instead make a call to the above method.
19976 2002-03-31 Ravi Pratap <ravi@ximian.com>
19978 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
19979 We use it to keep track of classes which are attribute types.
19981 2002-04-02 Miguel de Icaza <miguel@ximian.com>
19983 * delegate.cs (Delegate.Define): Correctly define the types in the
19984 presence of fixed and array parameters.
19986 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
19989 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
19990 include NonPublic after the first iteration.
19992 * class.cs (Indexer.CheckBase): Only check if both parents are
19995 * cs-parser.jay (accessor_body): If empty, set to null.
19997 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19998 same code path here to resolve constants names that we did have in
19999 MemberAccess.DoResolve. There is too much code duplicated here.
20001 2002-04-01 Miguel de Icaza <miguel@ximian.com>
20003 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
20005 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
20008 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
20009 tokens, numbers and strings.
20011 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
20014 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
20015 asyncronous parameters and the regular parameters.
20017 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
20018 specify the target directory.
20020 * expression.cs: (This.DoResolve): Simplify
20021 (As.Emit): Optimize, do not generate IsInst if the expression is
20022 always of the given type.
20024 (Is.DoResolve): Bug fix, we were reporting both always/never for
20027 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
20028 creating too many unnecessary arrays.
20030 2002-03-31 Miguel de Icaza <miguel@ximian.com>
20032 * class.cs (EmitFieldInitializer): Use Assign expression to assign
20033 fields instead of rolling our own initializer. Takes care of all
20034 implicit conversions, and drops unnecessary static checks/argument.
20036 2002-03-31 Dick Porter <dick@ximian.com>
20038 * driver.cs: use the GetDirectories() return values properly, and
20039 use "/" as path separator.
20041 2002-03-30 Miguel de Icaza <miguel@ximian.com>
20043 * expression.cs (Unary): Optimize - - expr into expr.
20044 (Binary): Optimize a + (-b) into a -b.
20046 * codegen.cs (CodeGen): Made all methods static.
20048 2002-03-29 Miguel de Icaza <miguel@ximian.com>
20052 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
20053 TypeBuilder property.
20055 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
20058 * tree.cs: Removed the various RecordXXXX, and replaced with a
20059 single RecordDecl. Removed all the accessor methods, and just
20060 left a single access point Type
20062 * enum.cs: Rename DefineEnum to DefineType.
20064 * decl.cs: New abstract method `DefineType' used to unify the
20065 Defines for Enumerations, Interfaces, TypeContainers and
20068 (FindType): Moved LookupInterfaceOrClass here. Moved the
20069 LookupBaseClasses method that used to live in class.cs and
20070 interface.cs here, and renamed to FindType.
20072 * delegate.cs: Implement DefineType. Take advantage of the
20073 refactored pattern for locating the parent builder without taking
20074 the parent_builder argument (which we know does not work if we are
20075 nested, and triggering a toplevel definition).
20077 2002-03-28 Miguel de Icaza <miguel@ximian.com>
20079 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
20080 accessibility of a member has changed during override and report
20083 * class.cs (Method.Define, Property.Define): Only complain on
20084 overrides if the method is private, any other accessibility is
20085 fine (and since we just checked the permission is the same, we are
20088 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
20089 and elif are processed always. The other pre-processing
20090 directives are only processed if we are "taking" the path
20092 2002-03-29 Martin Baulig <martin@gnome.org>
20094 * class.cs (Method.Emit): Only emit symbolic debugging info if the
20095 current location is not Null.
20097 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
20098 a separate method so we can profile it.
20100 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
20101 `span.Seconds' are just seconds, but no minutes or hours.
20102 (MainDriver): Profile the CodeGen.SaveSymbols calls.
20104 2002-03-28 Miguel de Icaza <miguel@ximian.com>
20106 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
20107 Remove the gratuitous set of Final:
20109 // If an interface implementation, then we can set Final.
20110 if (((flags & MethodAttributes.Abstract) == 0) &&
20111 implementing.DeclaringType.IsInterface)
20112 flags |= MethodAttributes.Final;
20114 I do not know what I was smoking when I used that.
20117 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
20118 step into fixing the name resolution issues for delegates and
20119 unifying the toplevel name resolution.
20121 2002-03-28 Martin Baulig <martin@gnome.org>
20123 * class.cs (Method.Emit): If we have a symbol writer, call its
20124 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
20125 tell it about the current method.
20127 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
20128 writer that we're going to emit the first byte of IL code for a new
20129 statement (a new source line).
20130 (EmitContext.EmitTopBlock): If we have a symbol writer, call
20131 EmitContext.Mark() before emitting any code.
20133 * location.cs (SymbolDocument): Return null when we're Null.
20135 * statement.cs (Statement): Moved the `Location loc' variable here.
20136 (Statement.EmitBoolExpression): If we have a symbol writer, call
20137 ec.Mark() before emitting any code to tell it that we're at the
20138 beginning of a new statement.
20139 (StatementExpression): Added `Location' argument to the constructor.
20140 (Block): Added public readonly variable `StartLocation' and public
20141 variable `EndLocation'. The latter is to be set using SetEndLocation().
20142 (Block): Added constructor which takes a start and end location.
20143 (Block.SetEndLocation): New method. This sets the end location.
20144 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
20145 local variables we create.
20146 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
20147 each statement and do also mark the begin and end of the block.
20149 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
20150 tell it the current lexer.Location, use Location.Null for the end of the
20152 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
20153 current block, set its end location using SetEndLocation().
20154 (statement_expression): StatementExpression constructor now takes the
20155 lexer.Location as additional argument.
20156 (for_statement, declare_local_variables): Likewise.
20157 (declare_local_variables): When creating a new implicit block, use the
20158 new Block constructor and pass it the lexer.Location.
20160 2002-03-28 Miguel de Icaza <miguel@ximian.com>
20162 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
20163 members also on the parent interfaces recursively.
20165 2002-03-27 Miguel de Icaza <miguel@ximian.com>
20167 * report.cs: Use new formats, since Gonzalo finished the missing
20170 * expression.cs (Binary.ResolveOperator): added missing operator|
20171 operator& and operator^ for bool/bool.
20173 * cs-parser.jay: CheckDef now takes a Location argument that is
20174 used to report errors more precisly (instead of reporting the end
20175 of a definition, we try to track something which is a lot closer
20176 to the source of the problem).
20178 * cs-tokenizer.cs: Track global token use, so we can properly flag
20179 the use of #define/#undef after the first token has been seen.
20181 Also, rename the reportXXXX to Error_DescriptiveName
20183 * decl.cs (DeclSpace.IsTopLevel): Move property here from
20184 TypeContainer, so that Enum and Interface can use this too.
20186 * class.cs (TypeContainer.LookupInterfaceOrClass,
20187 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
20188 `builder' argument. Typically this was used to pass the parent
20189 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
20192 The problem is that a nested class could trigger the definition of
20193 a toplevel class, and the builder would be obviously wrong in that
20196 So we drop this argument, and we compute dynamically the
20197 TypeBuilder/ModuleBuilder (the correct information was available
20198 to us anyways from DeclSpace.Parent)
20200 * interface.cs (Interface.DefineInterface): Drop builder
20201 parameter cleanup like class.cs
20203 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
20206 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
20209 (Try.Emit): Propagate the returns value from the statement.
20211 (Return.Emit): Even if we are leavning
20213 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
20215 * modifiers.cs: Fix the computation of MethodAttributes flags.
20217 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
20219 * driver.cs: allow compilation of files that start with '/'.
20220 Add a default case when checking the argument of --target.
20222 2002-03-25 Miguel de Icaza <miguel@ximian.com>
20224 * interface.cs: Implement the same search algorithm for types in
20225 the interface code.
20227 * delegate.cs: Do not allow multiple definition.
20229 * Recovered ChangeLog that got accidentally amputated
20231 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
20233 * rootcontext.cs: Load manually enum to allow core classes to
20234 contain enumerations.
20236 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
20237 Update to new static methods in TypeManager.
20239 * typemanager.cs (GetMethod, GetConstructor): Use our
20240 implementation of FindMembers to find the members, since during
20241 corlib compilation, the types are TypeBuilders and GetMethod and
20242 GetConstructor do not work.
20244 Make all methods in TypeManager static.
20246 (InitCodeHelpers): Split the functionality from
20247 the InitCodeTypes function.
20249 * driver.cs: Call InitCodeHelpers after we have populated the
20252 * cs-parser.jay (delegate_declaration): we did not used to compute
20253 the delegate name correctly for void delegates.
20255 2002-03-24 Miguel de Icaza <miguel@ximian.com>
20257 * rootcontext.cs (RootContext): Init the interface_resolve_order
20258 and type_container_resolve_order always.
20260 (ResolveCore, BootstrapCorlib_ResolveClass,
20261 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
20262 compiler when compiling with --nostdlib
20264 * class.cs (TypeContainer.DefineType): Check that our parent is
20265 not null. This test is most important when we are bootstraping
20268 * codegen.cs: Split out the symbol writing code.
20270 2002-03-25 Martin Baulig <martin@gnome.org>
20272 * driver.cs (-g): Made -g an alias for --debug.
20274 2002-03-24 Martin Baulig <martin@gnome.org>
20276 * codegen.cs (SymbolWriter): New public variable. Returns the
20277 current symbol writer.
20278 (CodeGen): Added `bool want_debugging_support' argument to the
20279 constructor. If true, tell the ModuleBuild that we want debugging
20280 support and ask it for the ISymbolWriter.
20281 (Save): If we have a symbol writer, call it's Close() method after
20282 saving the assembly.
20284 * driver.c (--debug): New command line argument to create a
20285 debugger information file.
20287 * location.cs (SymbolDocument): New public property. Returns an
20288 ISymbolDocumentWriter object for the current source file or null
20289 if we don't have a symbol writer.
20291 2002-03-21 Miguel de Icaza <miguel@ximian.com>
20293 * driver.cs (LoadAssembly): Correctly return when all the paths
20294 have been tried and not before.
20296 * statement.cs (Switch.Emit): return the actual coverage for this
20297 statement (returns/not-returns)
20299 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
20300 switch of the statement if we are the last switch section. That
20301 kills two problems: try/catch problems (we used to emit an empty
20302 nop at the end) and switch statements where all branches would
20305 2002-03-19 Miguel de Icaza <miguel@ximian.com>
20307 * driver.cs: Add default assemblies (the equivalent to the
20308 Microsoft CSC.RSP file)
20310 * cs-tokenizer.cs: When updating `cols and setting it to zero,
20311 also update tokens_seen and set it to false.
20313 * driver.cs: Implement --recurse for Mike.
20315 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
20316 correctly splitting out the paths.
20318 2002-03-18 Miguel de Icaza <miguel@ximian.com>
20320 * interface.cs (Interface.PopulateProperty): Instead of using
20321 `parent' as the declaration space for the set parameters, use
20324 * support.cs (InternalParameters): InternalParameters constructor
20325 takes a DeclSpace instead of a TypeContainer.
20327 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
20328 types are being initialized, load the address of it before calling
20331 (New): Provide a mechanism to disable the generation of local
20332 value type temporaries when the caller will be providing us with
20333 an address to store it.
20335 (ArrayCreation.EmitDynamicInitializers): Use it.
20337 2002-03-17 Miguel de Icaza <miguel@ximian.com>
20339 * expression.cs (Invocation.EmitArguments): Only probe for array
20340 property if there is more than one argument. Sorry about that.
20342 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
20343 empty param arrays.
20345 * class.cs (Method.LabelParameters): Fix incorrect code path that
20346 prevented the `ParamArrayAttribute' from being applied to the
20349 2002-03-16 Miguel de Icaza <miguel@ximian.com>
20351 * support.cs (ReflectionParameters): Correctly compute whether the
20352 last argument is a params array. Fixes the problem with
20355 * typemanager.cs: Make the assemblies array always be non-null
20356 (empty, but non-null)
20358 * tree.cs (RecordDecl): New function that abstracts the recording
20359 of names. This reports error 101, and provides a pointer to the
20360 previous declaration. Fixes a crash in the compiler.
20362 * cs-parser.jay (constructor_declaration): Update to new grammar,
20363 and provide a constructor_body that can be empty.
20365 2002-03-15 Miguel de Icaza <miguel@ximian.com>
20367 * driver.cs: Add support for --resources.
20369 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
20370 Make all types for the various array helper methods be integer.
20372 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
20373 CheckState to ConvCast.
20375 (ConvCast): Now it takes a `checked' state argument, to avoid
20376 depending on the emit context for the conversion, and just using
20377 the resolve time setting.
20379 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
20380 instead of Invocation.EmitArguments. We do not emit the original
20381 arguments, instead we emit those which have been converted to
20382 unsigned int expressions.
20384 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
20386 * codegen.cs: ditto.
20388 * expression.cs (LocalVariableReference): Drop the use of the
20389 Store function that depended on the variable index.
20391 * statement.cs (VariableInfo): Drop the `Idx' property from this
20392 class, as this is not taking into account the indexes for
20393 temporaries tat we generate during the execution, getting the
20396 * class.cs: First emit class initializers, then call the parent
20399 * expression.cs (Binary): Fix opcode emision.
20400 (UnaryMutator.EmitCode): Support checked code generation
20402 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
20403 matches for events for both the Static and Instance scans,
20404 pointing to the same element. Fix that.
20406 2002-03-14 Miguel de Icaza <miguel@ximian.com>
20408 * rootcontext.cs (ResolveTree): Always set the
20409 interface_resolve_order, because nested interfaces will be calling
20412 * class.cs (GetInterfaceOrClass): Track the same resolution
20413 process used by TypeManager.LookupType. This fixes the nested
20414 type lookups in class declarations (separate path from
20417 (TypeContainer.DefineType): Also define nested interfaces.
20418 (TypeContainer.RegisterOrder): New public function used to
20419 register the order in which child interfaces need to be closed.
20421 Nested interfaces need to be closed after their parents have been
20424 * interface.cs (InterfaceAttr): Put all the logic for computing
20425 the interface attribute here.
20427 (DefineInterface): Register our interface order with the
20428 RootContext or with the TypeContainer depending on the case.
20430 2002-03-12 Miguel de Icaza <miguel@ximian.com>
20432 * cs-parser.jay: rework foreach statement to work with the new
20433 changes to the policy on SimpleNames.
20435 * report.cs: support Stacktrace on warnings as well.
20437 * makefile: drop --unsafe and /unsafe from the compile.
20439 2002-03-13 Ravi Pratap <ravi@ximian.com>
20441 * ecore.cs (StandardConversionExists): Modify to take an Expression
20442 as the first parameter. Ensure we do null -> reference type conversion
20445 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
20446 temporary Expression objects.
20448 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
20450 * interface.cs: workaround bug in method overloading resolution
20451 (there is already a bugzilla bug for it).
20453 2002-03-12 Miguel de Icaza <miguel@ximian.com>
20455 We could also solve this problem by having a separate path for
20456 performing type lookups, instead of DoResolve, we could have a
20457 ResolveType entry point, and only participating pieces of the
20458 production (simplename, deref, array) would implement this.
20460 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
20461 signal SimpleName to only resolve type names and not attempt to
20462 resolve anything else.
20464 * expression.cs (Cast): Set the flag.
20466 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
20468 * class.cs: Only report 108 if there is no `new' modifier.
20470 * cs-parser.jay: rework foreach statement to work with the new
20471 changes to the policy on SimpleNames.
20473 * report.cs: support Stacktrace on warnings as well.
20475 * makefile: drop --unsafe and /unsafe from the compile.
20477 2002-03-11 Miguel de Icaza <miguel@ximian.com>
20479 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20480 lookups here, instead of doing that at parse time. This means
20481 that our grammar will not introduce `LocalVariableReferences' as
20482 expressions at this point. That solves the problem of code like
20486 static void Main ()
20490 This is only half the fix. The full fix requires parameters to
20491 also be handled in this way.
20493 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
20494 makes the use more obvious of the DeclSpace. The
20495 ec.TypeContainer.TypeBuilder is now only used to pull the
20496 TypeBuilder for it.
20498 My theory is that I can get rid of the TypeBuilder completely from
20499 the EmitContext, and have typecasts where it is used (from
20500 DeclSpace to where it matters).
20502 The only pending problem is that the code that implements Aliases
20503 is on TypeContainer, and probably should go in DeclSpace.
20505 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20506 lookups here, instead of doing that at parse time. This means
20507 that our grammar will not introduce `LocalVariableReferences' as
20508 expressions at this point. That solves the problem of code like
20512 static void Main ()
20516 This is only half the fix. The full fix requires parameters to
20517 also be handled in this way.
20519 * class.cs (Property.DefineMethod): When implementing an interface
20520 method, set newslot, when implementing an abstract method, do not
20521 set the flag (before we tried never setting it, or always setting
20522 it, which is the difference).
20523 (Indexer.DefineMethod): same.
20524 (Method.DefineMethod): same.
20526 * ecore.cs: Only set the status used flag if we get back a Field.
20528 * attribute.cs: Temporary hack, so Paolo can keep working.
20530 2002-03-08 Ravi Pratap <ravi@ximian.com>
20532 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
20533 the unmanaged type in the case we have a MarshalAs attribute.
20535 (Resolve): Handle the case when we are parsing the special MarshalAs
20536 attribute [we need to store the unmanaged type to use later]
20538 * typemanager.cs (marshal_as_attr_type): Built in type for the
20539 MarshalAs Attribute.
20541 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
20542 on parameters and accordingly set the marshalling info.
20544 2002-03-09 Miguel de Icaza <miguel@ximian.com>
20546 * class.cs: Optimizing slightly by removing redundant code after
20547 we switched to the `NoTypes' return value.
20548 (Property.DefineMethod): use NoTypes here too.
20550 This fixes the bug I introduced in my last batch of changes.
20552 2002-03-05 Ravi Pratap <ravi@ximian.com>
20554 * tree.cs (RecordEnum): Add. We now keep track of enums too.
20556 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
20557 Enums since those are types too.
20559 * cs-parser.jay (enum_declaration): Record enums as we parse them.
20561 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
20562 thanks to a call during the lookup process.
20564 2002-03-07 Miguel de Icaza <miguel@ximian.com>
20566 * statement.cs (Foreach): Lots of work to accomodate a particular
20567 kind of foreach statement that I had not kept in mind. It is
20568 possible to have foreachs on classes that provide a GetEnumerator
20569 method that return objects that implement the "pattern" for using
20570 a foreach, there is no need to support GetEnumerator
20573 This is needed to compile nant.
20575 * decl.cs: Only report 114 if the member is not `Finalize' and if
20576 the warning level is at least 2.
20578 * class.cs: Moved the compare function from Method to
20581 (MethodSignature.InheritableMemberSignatureCompare): Add new
20582 filter function that is used to extract inheritable methods from a
20585 (Method.Define): Use the new `inheritable_method_signature_filter'
20588 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
20591 2002-03-06 Miguel de Icaza <miguel@ximian.com>
20593 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
20595 * cs-parser.jay: Add opt_semicolon to the interface declaration.
20597 * expression.cs: Pass location information to
20598 ConvertImplicitStandard.
20600 * class.cs: Added debugging code to track return values from
20603 2002-03-05 Miguel de Icaza <miguel@ximian.com>
20605 * expression.cs (Is.DoResolve): If either side of the `is' is an
20606 interface, do not flag the warning.
20608 * ecore.cs (ImplicitReferenceConversion): We need a separate test
20611 * report.cs: Allow for --fatal to be used with --probe.
20613 * typemanager.cs (NoTypes): Move the definition for the empty Type
20616 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
20618 (TypeContainer.DefineProxy): New function used to proxy to parent
20619 implementations when implementing interfaces.
20620 (TypeContainer.ParentImplements): used to lookup if our parent
20621 implements a public function that is required by an interface.
20622 (TypeContainer.VerifyPendingMethods): Hook this up.
20624 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
20625 `modules' and `assemblies' arraylists into arrays. We only grow
20626 these are the very early start up of the program, so this improves
20627 the speedof LookupType (nicely measured).
20629 * expression.cs (MakeByteBlob): Replaced unsafe code with
20630 BitConverter, as suggested by Paolo.
20632 * cfold.cs (ConstantFold.Binary): Special case: perform constant
20633 folding of string concatenation, but if either side is a string,
20634 and the other is not, then return null, and let the runtime use
20635 the concatenation on the string plus the object (using
20636 `Object.ToString').
20638 2002-03-04 Miguel de Icaza <miguel@ximian.com>
20640 Constant Folding has been implemented now.
20642 * expression.cs (Unary.Reduce): Do not throw an exception, catch
20643 the error instead on types that are not supported in one's
20646 * constant.cs (Constant and all children): New set of functions to
20647 perform implict and explicit conversions.
20649 * ecore.cs (EnumConstant): Implement the new functions to perform
20650 conversion by proxying to the child expression.
20652 * codegen.cs: (ConstantCheckState): Constant evaluation has its
20653 own separate setting that can not be turned off from the command
20654 line using --unchecked or --checked and is only controlled using
20655 the checked/unchecked statements and expressions. This setting is
20656 used by the constant folder to flag errors.
20658 * expression.cs (CheckedExpr, UncheckedExpr): Set the
20659 ConstantCheckState as well.
20661 During Resolve, they also have to flag the state, because the
20662 constant folder runs completely in the Resolve phase.
20664 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
20667 2002-03-01 Miguel de Icaza <miguel@ximian.com>
20669 * cfold.cs: New file, this file contains the constant folder.
20671 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
20672 argument to track whether we are using the resulting address to
20673 load or store a value and provide better error messages.
20675 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
20676 new AddressOf arguments.
20678 * statement.cs (Foreach.EmitCollectionForeach): Update
20680 * expression.cs (Argument.Emit): Call AddressOf with proper
20681 arguments to track usage.
20683 (New.DoEmit): Call AddressOf with new arguments.
20685 (Unary.Emit): Adjust AddressOf call.
20687 2002-03-01 Ravi Pratap <ravi@ximian.com>
20689 * cs-parser.jay (member_access): Change the case for pre-defined types
20690 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
20693 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
20696 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
20697 essentially like methods and apply attributes like MethodImplOptions to them too.
20699 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
20702 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
20703 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
20706 * Update code everywhere accordingly.
20708 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
20710 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
20712 2002-02-28 Ravi Pratap <ravi@ximian.com>
20714 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
20715 try performing lookups against those instead of jumping straight into using
20716 the 'using' clauses.
20718 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
20720 (LookupType): Perform lookups in implicit parents too.
20722 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
20723 sequence as RootContext.LookupType.
20725 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
20726 the various cases of namespace lookups into this method.
20728 2002-03-01 Miguel de Icaza <miguel@ximian.com>
20730 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
20731 in positional arguments)
20733 * class.cs (Operator): Update the AllowedModifiers to contain
20736 * cs-parser.jay: Update operator declaration to allow for the
20737 operator body to be empty.
20739 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
20742 2002-02-27 Miguel de Icaza <miguel@ximian.com>
20744 * class.cs (Method.Emit): Label parameters.
20746 * driver.cs: Return 1 or 0 as the program exit code.
20748 2002-02-26 Miguel de Icaza <miguel@ximian.com>
20750 * expression.cs: Special case the `null' object when trying to
20751 auto-compute the type, as anything can be explicitly converted to
20754 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
20755 spotting this Paolo.
20757 (Expression.ImplicitNumericConversion): Perform comparissions of
20758 the type using the underlying type in the case of an enumeration
20759 rather than using the enumeration type for the compare.
20761 Cope with the underlying == type case, which is not possible to
20764 (Expression.ConvertNumericExplicit): Perform comparissions of
20765 the type using the underlying type in the case of an enumeration
20766 rather than using the enumeration type for the compare.
20768 * driver.cs: If the user does not supply an extension, assume .exe
20770 * cs-parser.jay (if_statement): Rewrote so that we can track the
20771 location for the if statement.
20773 * expression.cs (Binary.ConstantFold): Only concat strings when
20774 the operation is "+", not everything ;-)
20776 * statement.cs (Statement.EmitBoolExpression): Take a location
20778 (If, While, Do): Track location.
20780 * expression.cs (Binary.ResolveOperator): In the object + string
20781 case, I was missing a call to ConvertImplicit
20783 2002-02-25 Ravi Pratap <ravi@ximian.com>
20785 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
20786 Location arguments. Ensure we use RootContext.LookupType to do our work
20787 and not try to do a direct Type.GetType and ModuleBuilder.GetType
20789 * interface.cs (PopulateMethod): Handle the type of the parameter being
20792 * expression.cs (Invocation.BetterFunction): Handle the case when we
20793 have a params method with no fixed arguments and a call is made with no
20796 2002-02-25 Miguel de Icaza <miguel@ximian.com>
20798 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
20799 the verbatim-string-literal
20801 * support.cs (InternalParameters.ParameterModifier): handle null
20803 (InternalParameters.ParameterType): ditto.
20805 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
20806 duplicating the name of the variable parameter.
20807 (GetParameterByName): Fix bug where we were not looking up array
20808 paramters if they were the only present (thanks Paolo!).
20809 (GetParameterInfo): We only have an empty set of types if both
20810 fixed and array are set to null.
20811 (GetParameterInfo-idx): Handle FixedParameter == null
20813 * cs-parser.jay: Handle the case where there is no catch
20814 statements (missing null test).
20816 2002-02-22 Miguel de Icaza <miguel@ximian.com>
20818 * driver.cs (MainDriver): Be conservative on our command line
20821 Catch DirectoryNotFoundException when calling GetFiles.
20823 (SplitPathAndPattern): Used to split the input specification into
20824 a path and a pattern that we can feed to Directory.GetFiles.
20826 2002-02-21 Miguel de Icaza <miguel@ximian.com>
20828 * statement.cs (Fixed): Implement the last case of the Fixed
20829 statement (string handling).
20831 * expression.cs (StringPtr): New class used to return a char * to
20832 a string; Used by the Fixed statement.
20834 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
20836 * expression.cs (Binary.ResolveOperator): Remove redundant
20837 MemberLookup pn parent type.
20838 Optimize union call, we do not need a union if the types are the same.
20839 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
20842 Specialize the use of MemberLookup everywhere, instead of using
20843 the default settings.
20845 (StackAlloc): Implement stackalloc keyword.
20847 * cs-parser.jay: Add rule to parse stackalloc.
20849 * driver.cs: Handle /h, /help, /?
20851 * expression.cs (MakeByteBlob): Removed the hacks we had in place
20852 before we supported unsafe code.
20854 * makefile: add --unsafe to the self compilation of mcs.
20856 2002-02-20 Miguel de Icaza <miguel@ximian.com>
20858 * expression.cs (PointerArithmetic): New class that is used to
20859 perform pointer arithmetic.
20860 (Binary.Resolve): Handle pointer arithmetic
20861 Handle pointer comparission.
20862 (ArrayPtr): Utility expression class that is used to take the
20863 address of an array.
20865 (ElementAccess): Implement array access for pointers
20867 * statement.cs (Fixed): Implement fixed statement for arrays, we
20868 are missing one more case before we are done.
20870 * expression.cs (Indirection): Implement EmitAssign and set the
20871 ExprClass to Variable. This allows pointer dereferences to be
20872 treated as variables, and to have values assigned to them.
20874 * ecore.cs (Expression.StoreFromPtr): New utility function to
20875 store values dereferencing.
20877 2002-02-20 Ravi Pratap <ravi@ximian.com>
20879 * expression.cs (Binary.ResolveOperator): Ensure that we are
20880 not trying to operate on a void type - this fixes the reported
20883 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
20884 the parent implementation is sealed.
20886 * ../errors/cs0239.cs : Add.
20888 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20890 * typemanager.cs (unverifiable_code_type): Corresponds to
20891 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20892 which have unsafe code in them.
20894 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
20897 2002-02-19 Miguel de Icaza <miguel@ximian.com>
20899 * cs-tokenizer.cs: Add support for @"litreal strings"
20901 Make tokenizer accept pre-processor directives
20902 on any column (remove the old C-like limitation).
20904 * rootcontext.cs (EmitCode): Emit any global attributes.
20905 (AddGlobalAttributes): Used to keep track of assembly attributes.
20907 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20909 * cs-parser.jay: Add support for global attributes.
20911 2002-02-17 Miguel de Icaza <miguel@ximian.com>
20913 * expression.cs (Indirection): New helper class. Unary will
20914 create Indirection classes to be able to implement the
20915 IMemoryLocation interface on it.
20917 2002-02-16 Miguel de Icaza <miguel@ximian.com>
20919 * cs-parser.jay (fixed_statement): reference the right statement.
20921 * statement.cs (Fixed.Emit): Finish implementing the fixed
20922 statement for the &x case.
20924 2002-02-14 Miguel de Icaza <miguel@ximian.com>
20926 * class.cs (Property.Define, Method.Define): Remove newslot when
20929 * modifiers.cs: My use of NewSlot when `Abstract' was set was
20930 wrong. NewSlot should only be used if the `new' keyword is present.
20932 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20933 locating our system dir. Sorry about this.
20935 2002-02-13 Miguel de Icaza <miguel@ximian.com>
20937 * driver.cs (GetSystemDir): Compute correctly the location of our
20938 system assemblies. I was using the compiler directory instead of
20939 the library directory.
20941 2002-02-13 Ravi Pratap <ravi@ximian.com>
20943 * expression.cs (BetterFunction): Put back in what Miguel commented out
20944 since it is the correct fix. The problem is elsewhere ;-)
20946 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20947 parameters of the parms method are themselves compatible or not !
20949 (StandardConversionExists): Fix very dangerous bug where we were forgetting
20950 to check that a class implements an interface before saying that an implicit
20951 conversion was allowed. Use ImplementsInterface to do the checking.
20953 2002-02-13 Miguel de Icaza <miguel@ximian.com>
20955 * class.cs (Method.Define): Track whether we are an explicit
20956 implementation or not. And only call DefineMethodOverride if we
20957 are an explicit implementation.
20959 (Property.DefineMethod): Ditto.
20961 2002-02-11 Ravi Pratap <ravi@ximian.com>
20963 * expression.cs (BetterFunction): Catch hideous bug which was
20964 preventing us from detecting ambiguous calls due to implicit casts i.e
20967 2002-01-29 Miguel de Icaza <miguel@ximian.com>
20969 * support.cs (Pair): Remove un-needed method. I figured why I was
20970 getting the error in cs-parser.jay, the variable in a foreach loop
20971 is readonly, and the compiler does not really treat this as a variable.
20973 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
20974 instead of EQUALS in grammar.
20976 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
20978 * expression.cs (Unary.DoResolve): Check whether the argument is
20981 2002-01-28 Miguel de Icaza <miguel@ximian.com>
20983 * support.cs: Api for Pair to set a value. Despite the fact that
20984 the variables are public the MS C# compiler refuses to compile
20985 code that accesses the field if the variable is part of a foreach
20988 * statement.cs (Fixed): Begin implementation of the fixed
20991 (Block.AddVariable): Return the VariableInfo on success and null
20992 on failure instead of true/false.
20994 * cs-parser.jay (foreach): Catch errors on variables already
20995 defined (we were ignoring this value before) and properly unwind
20996 the block hierarchy
20998 (fixed_statement): grammar for the fixed statement.
21000 2002-01-25 Miguel de Icaza <miguel@ximian.com>
21002 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
21003 pointer types to be incretemented.
21005 (SizeOf): Implement.
21007 * cs-parser.jay (pointer_member_access): Implement
21008 expr->IDENTIFIER production.
21010 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
21011 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
21014 (Unary): Implement indirection.
21016 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
21017 use in non-unsafe context).
21019 (SimpleName.DoResolve): Check for pointers in field access on safe
21022 (Expression.LoadFromPtr): Factor the load-indirect code in this
21023 function. This was duplicated in UnboxCast and ParameterReference
21025 2002-01-24 Miguel de Icaza <miguel@ximian.com>
21027 * expression.cs (ComposedCast): report an error if a pointer cast
21028 is used in a safe region.
21030 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
21031 pointer type casts in unsafe context.
21033 * codegen.cs (EmitContext): Set up IsUnsafe.
21035 * cs-parser.jay (non_expression_type): Add productions for pointer
21038 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
21039 code. We should not use force into static mode if the method is
21040 not virtual. Fixes bug in MIS
21042 * statement.cs (Do.Emit, While.Emit, For.Emit,
21043 Statement.EmitBoolExpression): Add support to Do and While to
21044 propagate infinite loop as `I do return' semantics.
21046 Improve the For case to also test for boolean constants.
21048 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
21049 to the list of attributes we can add.
21051 Remove `EmitContext' argument.
21053 * class.cs (Method.Define): Apply parameter attributes.
21054 (Constructor.Define): Apply parameter attributes.
21055 (MethodCore.LabelParameters): Move here the core of labeling
21058 * support.cs (ReflectionParameters.ParameterModifier,
21059 InternalParameters.ParameterModifier): Use IsByRef on the type and
21060 only return the OUT bit for these parameters instead of in/out/ref
21063 This is because I miss-understood things. The ParameterInfo.IsIn
21064 and IsOut represent whether the parameter has the [In] and [Out]
21067 2002-01-22 Miguel de Icaza <miguel@ximian.com>
21069 * ecore.cs (FieldExpr.Emit): Release temporaries.
21071 * assign.cs (LocalTemporary.Release): new function.
21073 * codegen.cs (EmitContext.GetTemporaryStorage,
21074 EmitContext.FreeTemporaryStorage): Rework the way we deal with
21075 temporary storage. Now we can "put back" localbuilders when we
21078 2002-01-21 Miguel de Icaza <miguel@ximian.com>
21080 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
21081 need to make a copy of the variable to generate verifiable code.
21083 2002-01-19 Miguel de Icaza <miguel@ximian.com>
21085 * driver.cs: Compute dynamically the system directory.
21087 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
21088 Slower, but more generally useful. Used by the abstract
21089 registering implementation.
21091 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
21092 the rules for the special rule on Type/instances. First check if
21093 we have the same name, and if so, try that special static path
21094 rather than the instance path.
21096 2002-01-18 Miguel de Icaza <miguel@ximian.com>
21098 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
21101 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
21102 Enum, ValueType, Delegate or Array for non-corlib compiles.
21104 * cs-tokenizer.cs: Catch long identifiers (645)
21106 * typemanager.cs (IndexerPropetyName): Ravi never tested this
21109 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
21110 fix, we were returning too early, so we were not registering
21111 pending methods from abstract classes.
21113 Do not register pending methods if the class is abstract.
21115 * expression.cs (Conditional.DoResolve): Report circular implicit
21116 conversions when we neecd to compute it for conditional
21119 (Is.DoResolve): If the expression is always of the provided type,
21120 flag warning 183. If the expression can not ever be of the
21121 provided type flag warning 184.
21123 * class.cs: Catch 169 as well.
21125 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
21128 2002-01-18 Nick Drochak <ndrochak@gol.com>
21130 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
21132 2002-01-17 Miguel de Icaza <miguel@ximian.com>
21134 * interface.cs: (PopulateMethod): Check for pointers being defined
21135 only if the unsafe context is active.
21136 (PopulateProperty): ditto.
21137 (PopulateIndexer): ditto.
21139 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
21140 specified. If pointers are present, make sure that they are
21141 present in an unsafe context.
21142 (Constructor, Constructor.Define): ditto.
21143 (Field, Field.Define): ditto.
21144 (Property, Property.Define): ditto.
21145 (Event, Event.Define): ditto.
21147 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
21148 hashtable if there are classes or structs defined.
21150 * expression.cs (LocalVariableReference.DoResolve): Simplify this
21151 code, as the constant resolution moved.
21153 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
21154 the metadata, so we can flag error 133.
21156 * decl.cs (MemberCore.UnsafeOK): New function to test that a
21157 pointer is being declared in an unsafe context.
21159 2002-01-16 Miguel de Icaza <miguel@ximian.com>
21161 * modifiers.cs (Modifiers.Check): Require a Location argument.
21162 Report error 227 for Unsafe use.
21164 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
21166 * statement.cs (For.Emit): If the test is null, then report that
21167 we do `return', as we wont reach anything afterwards.
21169 (Switch.SwitchGoverningType): Track the expression that matched
21172 * driver.cs: Allow negative numbers as an error code to flag.
21174 * cs-parser.jay: Handle 1551.
21176 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
21178 2002-01-15 Miguel de Icaza <miguel@ximian.com>
21180 * cs-parser.jay: Report 1518 (type declaration can only contain
21181 class, struct, interface, enum or delegate)
21183 (switch_label): Report 1523 (keywords `case' or `default' must
21186 (opt_switch_sections): Report 1522 (empty switch)
21188 * driver.cs: Report 1515 (response file specified multiple times)
21189 Report 1516 (Source file specified multiple times).
21191 * expression.cs (Argument.Resolve): Signal 1510
21193 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
21194 access not allowed in static code)
21196 2002-01-11 Ravi Pratap <ravi@ximian.com>
21198 * typemanager.cs (IsPointerType): Utility method which we are going
21201 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
21202 the object type, so we take care of that.
21204 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
21206 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
21207 added to non-params parameters :-)
21209 * typemanager.cs (CSharpName): Include 'void' type too.
21211 (void_ptr_type): Include in the set of core types.
21213 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
21216 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
21219 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
21220 completely forgotten about it.
21222 2002-01-10 Ravi Pratap <ravi@ximian.com>
21224 * cs-parser.jay (pointer_type): Add. This begins our implementation
21225 of parsing rules for unsafe code.
21227 (unsafe_statement): Implement.
21229 (embedded_statement): Modify to include the above.
21231 * statement.cs (Unsafe): Implement new class for unsafe blocks.
21233 * codegen.cs (EmitContext.InUnsafe): Add. This determines
21234 if the current context is an unsafe one.
21236 * cs-parser.jay (local_variable_pointer_type): Since local variable types
21237 are handled differently, we need separate rules for them.
21239 (local_variable_declaration): Update to use local_variable_pointer_type
21240 to allow variable declarations of unmanaged pointer types.
21242 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
21243 in unsafe contexts.
21245 * ../errors/cs0214.cs : Add.
21247 2002-01-16 Nick Drochak <ndrochak@gol.com>
21249 * makefile: remove 'response' file when cleaning.
21251 2002-01-15 Miguel de Icaza <miguel@ximian.com>
21253 * cs-parser.jay: Report 1524.
21255 2002-01-14 Miguel de Icaza <miguel@ximian.com>
21257 * typemanager.cs (RegisterMethod): drop checking if we have
21258 registered this from here
21260 2002-01-12 Miguel de Icaza <miguel@ximian.com>
21262 * class.cs (Method.EmitDestructor): Implement calling our base
21265 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
21266 value of InFinally.
21268 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
21269 this routine and will wrap the call in a try/catch block. Deal
21272 2002-01-11 Miguel de Icaza <miguel@ximian.com>
21274 * ecore.cs (Expression.MemberLookup): instead of taking a
21275 parameter `same_type' that was used to tell whether we could
21276 access private members we compute our containing type from the
21279 (FieldExpr): Added partial support for volatile fields. This does
21280 not work for volatile fields exposed from assemblies, as I can not
21281 figure out how to extract the modreq from it.
21283 Updated all the source files to use this.
21285 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
21286 because it is referenced by MemberLookup very often.
21288 2002-01-09 Ravi Pratap <ravi@ximian.com>
21290 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
21291 TypeBuilder.GetCustomAttributes to retrieve what we need.
21293 Get rid of redundant default_member_attr_type as this is the same as
21294 default_member_type which already exists.
21296 * interface.cs, attribute.cs : Update accordingly.
21298 2002-01-08 Miguel de Icaza <miguel@ximian.com>
21300 * typemanager.cs: Enable IndexerPropertyName again. It does not
21301 work for TYpeBuilders though. Ravi, can you please fix this?
21303 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
21305 * expression.cs (Argument.Emit): Handle the case of ref objects
21306 being passed to ref functions;
21308 (ParameterReference.EmitLoad): Loads the content of the pointer
21309 without dereferencing.
21311 2002-01-07 Miguel de Icaza <miguel@ximian.com>
21313 * cs-tokenizer.cs: Implemented the pre-processing expressions.
21315 2002-01-08 Ravi Pratap <ravi@ximian.com>
21317 * class.cs (Indexer.DefineMethod): Incorporate the interface
21318 type in the name of the method if we are doing explicit interface
21321 * expression.cs (ConversionExists): Remove as it is completely obsolete.
21323 (BetterConversion): Fix extremely trivial bug where we were referring to
21324 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
21327 * ../errors/bug16.cs : Add although we have fixed it.
21329 2002-01-07 Miguel de Icaza <miguel@ximian.com>
21331 * expression.cs (BaseIndexer): Begin implementation.
21333 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
21335 * cs-parser.jay (indexer_declarator): Use qualified_identifier
21336 production directly to remove a shift/reduce, and implement
21337 explicit interface implementation.
21339 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
21340 after a floating point suffix.
21342 * expression.cs (DoNumericPromotions): Improved the conversion for
21343 uint/uint. If we have a constant, we avoid doing a typecast to a
21346 * class.cs (Indexer): Implement explicit interface implementation
21349 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
21351 * class.cs: make the default instance constructor public and hidebysig.
21353 2001-01-03 Ravi Pratap <ravi@ximian.com>
21355 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
21356 so we can call it from elsewhere.
21358 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
21359 we emit it internally if the class has a defined indexer; otherwise the user
21360 emits it by decorating the class definition with the DefaultMemberAttribute.
21362 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
21363 attribute is not used on a type which defines an indexer.
21365 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
21366 character when we skip whitespace.
21368 * ../errors/cs0646.cs : Add.
21370 2002-01-03 Miguel de Icaza <miguel@ximian.com>
21372 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
21375 * makefile: Add practical target `mcs3.exe' which builds the third
21376 generation compiler.
21378 * expression.cs (New): Fix structures constructor calling.
21380 * class.cs (Property, Method, Indexer): Emit Final flag on the
21381 method if we are an interface implementation and we are not
21384 * ecore.cs (PropertyExpr): New public field `IsBase', tells
21385 whether this property is referencing a `base' method.
21387 * expression.cs (Invocation.EmitCall): take an extra argument:
21388 is_base, this is used to determine whether the `call' or
21389 `callvirt' opcode should be used.
21392 * delegate.cs: update EmitCall.
21394 * class.cs (Method.Define): Set NewSlot for the cases where we are
21395 not implementing an interface method.
21397 (Property.Define): ditto.
21399 2002-01-02 Miguel de Icaza <miguel@ximian.com>
21401 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
21402 'r'. Allows mcs to parse itself fully.
21404 2002-01-02 Ravi Pratap <ravi@ximian.com>
21406 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
21407 of the number of initializers that require the InitializeArray method.
21409 (CheckIndices): Store the Expression in all cases - not the plain value. Also
21410 update the above field where necessary.
21412 (MakeByteBlob): Update accordingly.
21414 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
21417 (EmitDynamicInitializers): Update in accordance with the new optimization.
21419 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
21420 same OpCode applies.
21422 * cs-parser.jay : Fix some glaring errors I introduced.
21424 2002-01-01 Ravi Pratap <ravi@ximian.com>
21426 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
21427 so that we can check for name clashes there too.
21429 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
21430 for interface indexers.
21432 * interfaces.cs (Define): Emit the default member attribute.
21434 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
21435 variable was being referred to while setting the value ;-)
21437 2002-01-01 Miguel de Icaza <miguel@ximian.com>
21439 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
21440 byte-by-byte information when we know the data is zero.
21442 Make the block always a multiple of 4, because
21443 DefineInitializedData has a bug.
21445 * assign.cs: Fix, we should assign from the temporary, not from
21448 * expression.cs (MakeByteBlob): Fix my incorrect code.
21450 2001-12-31 Miguel de Icaza <miguel@ximian.com>
21452 * typemanager.cs (EnumToUnderlying): This function is used to get
21453 the underlying type from an enumeration, because it does not
21456 * constant.cs: Use the I4_S form for values between -128 and 127.
21458 * statement.cs (Block.LookupLabel): Looks up a label.
21459 (Block): Drop support for labeled blocks.
21461 (LabeledStatement): New kind of statement that represents a label
21464 (Goto): Finally implement this bad boy.
21466 * cs-parser.jay: Update to reflect new mechanism to implement
21469 2001-12-30 Miguel de Icaza <miguel@ximian.com>
21471 * codegen.cs (EmitContext.This): a codegen property that keeps the
21472 a single instance of this instead of creating many different this
21475 * delegate.cs (Delegate.DoResolve): Update to use the property;
21477 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
21479 * expression.cs (BaseAccess.DoResolve): Ditto.
21481 2001-12-29 Ravi Pratap <ravi@ximian.com>
21483 * typemanager.cs (methodimpl_attr_type): Add to hold the type
21484 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
21486 (InitCoreTypes): Update accordingly.
21488 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
21489 so we can quickly store the state.
21491 (ApplyAttributes): Set the correct implementation flags
21492 for InternalCall methods.
21494 2001-12-29 Miguel de Icaza <miguel@ximian.com>
21496 * expression.cs (EmitCall): if a method is not virtual, then do
21497 not use callvirt on it.
21499 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
21500 user defined stuff) requires the use of stobj, which takes an
21501 address on the stack instead of an array and an index. So emit
21502 the Ldelema operation for it.
21504 (EmitStoreOpcode): Use stobj for valuetypes.
21506 (UnaryMutator.EmitCode): Use the right 1 value depending on
21507 whether we are dealing with int64/uint64, float or doubles.
21509 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
21510 constructors that I implemented last night.
21512 (Constructor.IsDefault): Fix to work properly for static
21515 * cs-parser.jay (CheckDef): report method signature errors.
21516 Update error number 103 to be 132.
21518 * decl.cs: New AdditionResult enumeration value: MethodExists.
21519 Although we do this check for methods later on in the semantic
21520 analysis, catching repeated default constructors is so easy that
21521 we catch these here.
21523 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
21526 (ParameterReference.EmitAssign, Emit): handle
21529 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
21530 (ArrayAccess.EmitStoreOpcode): ditto.
21532 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
21534 * expression.cs (MakeByteBlob): Complete all the missing types
21535 (uint, short, ushort, byte, sbyte)
21537 * class.cs: Only init instance field initializers on instance
21540 Rename `constructors' to instance_constructors.
21542 (TypeContainer.AddConstructor): Only add constructors to the list
21543 if it is not static.
21545 Make sure that we handle default_static_constructor independently
21546 everywhere where we handle instance_constructors
21548 2001-12-28 Miguel de Icaza <miguel@ximian.com>
21550 * class.cs: Do not lookup or create a base initializer for a
21551 static constructor.
21553 (ConstructorInitializer.Resolve): use the proper type to lookup
21556 * cs-parser.jay: Report error 1585 (modifiers between type and name).
21558 * enum.cs, interface.cs: Remove CloseType, this is taken care by
21561 * decl.cs: CloseType is now an virtual method, the default
21562 implementation just closes this type.
21564 2001-12-28 Ravi Pratap <ravi@ximian.com>
21566 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
21567 to PreserveSig by default. Also emit HideBySig on such methods.
21569 Basically, set the defaults to standard values.
21571 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
21572 argument, if candidate is better, it can't be worse than the best !
21574 (Invocation): Re-write bits to differentiate between methods being
21575 applicable in their expanded form and their normal form - for params
21578 Get rid of use_standard everywhere as only standard conversions are allowed
21579 in overload resolution.
21581 More spec conformance.
21583 2001-12-27 Miguel de Icaza <miguel@ximian.com>
21585 * driver.cs: Add --timestamp, to see where the compiler spends
21588 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
21589 `this' in static code.
21591 (SimpleName.DoResolve): Implement in terms of a helper function
21592 that allows static-references to be passed upstream to
21595 (Expression.ResolveWithSimpleName): Resolve specially simple
21596 names when called by MemberAccess to implement the special
21599 (Expression.ImplicitReferenceConversion): Handle conversions from
21600 Null to reference types before others, as Null's type is
21603 * expression.cs (Invocation.EmitCall): Handle the special case of
21604 calling methods declared on a reference type from a ValueType
21605 (Base classes System.Object and System.Enum)
21607 (MemberAccess.Resolve): Only perform lookups on Enumerations if
21608 the left hand side is a TypeExpr, not on every enumeration.
21610 (Binary.Resolve): If types are reference types, then do a cast to
21611 object on operators != and == of both arguments.
21613 * typemanager.cs (FindMembers): Extract instance and static
21614 members if requested.
21616 * interface.cs (PopulateProperty): Use void_type instead of null
21617 as the return type for the setter method.
21619 (PopulateIndexer): ditto.
21621 2001-12-27 Ravi Pratap <ravi@ximian.com>
21623 * support.cs (ReflectionParameters): Fix minor bug where we
21624 were examining the wrong parameter for the ParamArray attribute.
21626 Cope with requests for the type of the parameter at position
21627 greater than the params parameter's. We now return the element
21628 type of the params array as that makes more sense.
21630 * expression.cs (Invocation.IsParamsMethodApplicable): Update
21631 accordingly as we no longer have to extract the element type
21634 (Invocation.OverloadResolve): Update.
21636 2001-12-27 Miguel de Icaza <miguel@ximian.com>
21638 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
21639 against IEnumerator, test whether the return value is a descendant
21640 of the IEnumerator interface.
21642 * class.cs (Indexer.Define): Use an auxiliary method to implement
21643 the other bits of the method definition. Begin support for
21644 explicit interface implementation.
21646 (Property.DefineMethod): Use TypeManager.void_type instead of null
21647 for an empty return value.
21649 2001-12-26 Miguel de Icaza <miguel@ximian.com>
21651 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
21652 dealing with a FieldExpr which is composed of a FieldBuilder, in
21653 the code path we did extract the constant, but we should have
21654 obtained the underlying value to be able to cast it (otherwise we
21655 end up in an infinite loop, this is what Ravi was running into).
21657 (ArrayCreation.UpdateIndices): Arrays might be empty.
21659 (MemberAccess.ResolveMemberAccess): Add support for section
21660 14.5.4.1 that deals with the special case of E.I when E is a type
21661 and something else, that I can be a reference to a static member.
21663 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
21664 handle a particular array type to create byte blobs, it is just
21665 something we dont generate byteblobs for.
21667 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
21670 * location.cs (Push): remove the key from the hashtable that we
21671 are about to add. This happens for empty files.
21673 * driver.cs: Dispose files after we have parsed them.
21675 (tokenize): new function that only runs the tokenizer on its
21676 input, for speed testing.
21678 2001-12-26 Ravi Pratap <ravi@ximian.com>
21680 * class.cs (Event.Define): Define the private field only if there
21681 are no accessors defined.
21683 * expression.cs (ResolveMemberAccess): If there is no associated
21684 field with the event, that means we have an event defined with its
21685 own accessors and we should flag error cs0070 since transforming
21686 ourselves into a field is not valid in that case.
21688 * ecore.cs (SimpleName.DoResolve): Same as above.
21690 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
21691 and charset to sane values.
21693 2001-12-25 Ravi Pratap <ravi@ximian.com>
21695 * assign.cs (DoResolve): Perform check on events only if they
21696 are being accessed outside the declaring type.
21698 * cs-parser.jay (event_declarations): Update rules to correctly
21699 set the type of the implicit parameter etc.
21701 (add_accessor, remove_accessor): Set current local parameters.
21703 * expression.cs (Binary): For delegate addition and subtraction,
21704 cast the return value from the method into the appropriate delegate
21707 2001-12-24 Ravi Pratap <ravi@ximian.com>
21709 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
21710 of these as the workaround is unnecessary.
21712 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
21713 delegate data - none of that is needed at all.
21715 Re-write bits to extract the instance expression and the delegate method
21718 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
21721 * attribute.cs (ApplyAttributes): New method to take care of common tasks
21722 of attaching attributes instead of duplicating code everywhere.
21724 * everywhere : Update code to do attribute emission using the above method.
21726 2001-12-23 Miguel de Icaza <miguel@ximian.com>
21728 * expression.cs (IsParamsMethodApplicable): if there are not
21729 parameters, return immediately.
21731 * ecore.cs: The 0 literal can be implicity converted to an enum
21734 (SimpleName.DoResolve): First lookup the type, then lookup the
21737 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
21738 want to get its address. If the InstanceExpression is not
21739 addressable, store the result in a temporary variable, then get
21742 * codegen.cs: Only display 219 errors on warning level or above.
21744 * expression.cs (ArrayAccess): Make it implement the
21745 IMemoryLocation interface.
21747 (Binary.DoResolve): handle the operator == (object a, object b)
21748 and operator != (object a, object b) without incurring into a
21749 BoxedCast (because 5 != o should never be performed).
21751 Handle binary enumerator operators.
21753 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
21754 value type, otherwise use Ldelem_ref.
21756 Use precomputed names;
21758 (AddressOf): Implement address of
21760 * cs-parser.jay (labeled_statement): Fix recursive block
21761 addition by reworking the production.
21763 * expression.cs (New.DoEmit): New has a special case:
21765 If we are dealing with a ValueType, we have a few
21766 situations to deal with:
21768 * The target of New is a ValueType variable, that is
21769 easy, we just pass this as the variable reference
21771 * The target of New is being passed as an argument,
21772 to a boxing operation or a function that takes a
21775 In this case, we need to create a temporary variable
21776 that is the argument of New.
21779 2001-12-23 Ravi Pratap <ravi@ximian.com>
21781 * rootcontext.cs (LookupType): Check that current_type is not null before
21782 going about looking at nested types.
21784 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
21785 not implement the IAssignMethod interface any more.
21787 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
21788 where we tranform them into FieldExprs if they are being resolved from within
21789 the declaring type.
21791 * ecore.cs (SimpleName.DoResolve): Do the same here.
21793 * assign.cs (DoResolve, Emit): Clean up code considerably.
21795 * ../errors/bug10.cs : Add.
21797 * ../errors/cs0070.cs : Add.
21799 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
21801 * assign.cs : Get rid of EventIsLocal everywhere.
21803 2001-12-23 Miguel de Icaza <miguel@ximian.com>
21805 * ecore.cs (ConvertIntLiteral): finished the implementation.
21807 * statement.cs (SwitchLabel): Convert the value we are using as a
21808 key before looking up the table.
21810 2001-12-22 Miguel de Icaza <miguel@ximian.com>
21812 * codegen.cs (EmitTopBlock): Require a Location argument now.
21814 * cs-parser.jay (constructor_declarator): We need to setup
21815 current_local_parameters before we parse the
21816 opt_constructor_initializer, to allow the variables to be bound
21817 to the constructor arguments.
21819 * rootcontext.cs (LookupType): First lookup nested classes in our
21820 class and our parents before we go looking outside our class.
21822 * expression.cs (ConstantFold): Extract/debox the values at the
21825 * rootcontext.cs (EmitCode): Resolve the constants first before we
21826 resolve the types. This is not really needed, but it helps debugging.
21828 * statement.cs: report location.
21830 * cs-parser.jay: pass location to throw statement.
21832 * driver.cs: Small bug fix.
21834 * report.cs: Updated format to be 4-zero filled digits.
21836 2001-12-22 Ravi Pratap <ravi@ximian.com>
21838 * expression.cs (CheckIndices): Fix minor bug where the wrong
21839 variable was being referred to ;-)
21841 (DoEmit): Do not call EmitStaticInitializers when the
21842 underlying type is System.Object.
21844 2001-12-21 Ravi Pratap <ravi@ximian.com>
21846 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
21847 and do the usual workaround for SRE.
21849 * class.cs (MyEventBuilder.EventType): New member to get at the type
21850 of the event, quickly.
21852 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
21854 * assign.cs (Assign.DoResolve): Handle the case when the target
21855 is an EventExpr and perform the necessary checks.
21857 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
21860 (SimpleName.MemberStaticCheck): Include check for EventExpr.
21862 (EventExpr): Set the type in the constructor itself since we
21863 are meant to be born fully resolved.
21865 (EventExpr.Define): Revert code I wrote earlier.
21867 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
21868 instance expression is null. The instance expression is a This in that case
21869 or a null, depending on whether it is a static method or not.
21871 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
21872 refers to more than one method.
21874 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
21875 and accordingly flag errors.
21877 2001-12-21 Miguel de Icaza <miguel@ximian.com>
21879 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
21881 2001-12-22 Miguel de Icaza <miguel@ximian.com>
21883 * location.cs (ToString): Provide useful rutine.
21885 2001-12-21 Miguel de Icaza <miguel@ximian.com>
21887 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21888 objects, return the actual integral boxed.
21890 * statement.cs (SwitchLabel): define an ILLabel for each
21893 (Switch.CheckSwitch): If the value is a Literal, extract
21894 the underlying literal.
21896 Also in the unused hashtable we had, add the SwitchLabel so we can
21897 quickly look this value up.
21899 * constant.cs: Implement a bunch of new constants. Rewrite
21900 Literal based on this. Made changes everywhere to adapt to this.
21902 * expression.cs (Expression.MakeByteBlob): Optimize routine by
21903 dereferencing array only once, and also copes with enumrations.
21905 bytes are two bytes wide, not one.
21907 (Cast): Perform constant conversions.
21909 * ecore.cs (TryImplicitIntConversion): Return literals instead of
21910 wrappers to the literals here.
21912 * expression.cs (DoNumericPromotions): long literals can converted
21913 to ulong implicity (this is taken care of elsewhere, but I was
21914 missing this spot).
21916 * ecore.cs (Expression.Literalize): Make the return type Literal,
21917 to improve type checking.
21919 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21921 2001-12-20 Miguel de Icaza <miguel@ximian.com>
21923 * literal.cs: Revert code from ravi that checked the bounds. The
21924 bounds are sane by the definition of the type itself.
21926 * typemanager.cs: Fix implementation of ImplementsInterface. We
21927 need to actually look up in our parent hierarchy for interfaces
21930 * const.cs: Use the underlying type for enumerations
21932 * delegate.cs: Compute the basename for the delegate creation,
21933 that should fix the delegate test case, and restore the correct
21934 Type Lookup semantics in rootcontext
21936 * rootcontext.cs: Revert Ravi's last patch. The correct way of
21937 referencing a nested type with the Reflection API is using the "+"
21940 * cs-parser.jay: Do not require EOF token at the end.
21942 2001-12-20 Ravi Pratap <ravi@ximian.com>
21944 * rootcontext.cs (LookupType): Concatenate type names with
21945 a '.' instead of a '+' The test suite passes again.
21947 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21948 field of the enumeration.
21950 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21951 the case when the member is an EventExpr.
21953 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21954 static has an associated instance expression.
21956 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21958 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21960 * class.cs (Event.Define): Register event and perform appropriate checks
21963 We define the Add and Remove methods even if the use provides none because
21964 in that case, we provide default implementations ourselves.
21966 Define a private field of the type of the event. This is done by the CSC compiler
21967 and we should be doing it too ;-)
21969 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
21970 More methods we use in code we generate.
21972 (multicast_delegate_type, delegate_type): Two separate types since the distinction
21975 (InitCoreTypes): Update accordingly for the above.
21977 * class.cs (Event.Emit): Generate code for default accessors that we provide
21979 (EmitDefaultMethod): Do the job in the above.
21981 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
21984 2001-12-20 Miguel de Icaza <miguel@ximian.com>
21986 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
21987 builders even if we were missing one.
21989 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
21990 pass the Basename as our class name instead of the Name. The
21991 basename will be correctly composed for us.
21993 * parameter.cs (Paramters): Now takes a Location argument.
21995 * decl.cs (DeclSpace.LookupType): Removed convenience function and
21996 make all the code call directly LookupType in RootContext and take
21997 this chance to pass the Location information everywhere.
21999 * Everywhere: pass Location information.
22001 2001-12-19 Miguel de Icaza <miguel@ximian.com>
22003 * class.cs (Constructor.Define): Updated way of detecting the
22004 length of the parameters.
22006 (TypeContainer.DefineType): Use basename as the type name for
22009 (TypeContainer.Define): Do not recursively define types here, as
22010 definition is taken care in order by the RootContext.
22012 * tree.cs: Keep track of namespaces in a per-file basis.
22014 * parameter.cs (Parameter.ComputeSignature): Update to use
22017 (Parameters.GetSignature): ditto.
22019 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
22020 instead of a TypeContainer.
22022 (Interface.SemanticAnalysis): Use `this' instead of our parent to
22023 resolve names. Because we need to be resolve in our context, not
22026 * driver.cs: Implement response files.
22028 * class.cs (TypeContainer.DefineType): If we are defined, do not
22029 redefine ourselves.
22031 (Event.Emit): Emit the code for add/remove handlers.
22032 (Event.Define): Save the MethodBuilders for add/remove.
22034 * typemanager.cs: Use pair here too.
22036 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
22037 DictionaryEntry requires the first argument to be non-null.
22039 (enum_declaration): Compute full name for registering the
22042 (delegate_declaration): Instead of using
22043 formal_parameter_list, use opt_formal_parameter_list as the list
22046 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
22047 (EventParsing): New property that controls whether `add' and
22048 `remove' are returned as tokens or identifiers (for events);
22050 2001-12-19 Ravi Pratap <ravi@ximian.com>
22052 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
22053 use MyEventBuilder only and let it wrap the real builder for us.
22055 (MyEventBuilder): Revamp constructor etc.
22057 Implement all operations that we perform on EventBuilder in precisely the same
22060 (FindMembers): Update to use the EventBuilder member.
22062 (Event.Emit): Update accordingly.
22064 2001-12-18 Ravi Pratap <ravi@ximian.com>
22066 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
22067 by calling the appropriate methods.
22069 (GetCustomAttributes): Make stubs as they cannot possibly do anything
22072 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
22074 2001-12-17 Ravi Pratap <ravi@ximian.com>
22076 * delegate.cs (Delegate.Populate): Check that the return type
22077 and various parameters types are indeed accessible.
22079 * class.cs (Constructor.Define): Same here.
22081 (Field.Define): Ditto.
22083 (Event.Define): Ditto.
22085 (Operator.Define): Check that the underlying Method defined itself
22086 correctly - so it's MethodBuilder should not be null.
22088 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
22089 expression happens to be null.
22091 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
22092 members but as of now we don't seem to be able to do anything really useful with it.
22094 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
22095 not the EventBuilder.
22097 2001-12-18 Miguel de Icaza <miguel@ximian.com>
22099 * cs-tokenizer.cs: Add support for defines.
22100 Add support for #if, #elif, #else, #endif
22102 (eval_var): evaluates a variable.
22103 (eval): stubbed for evaluating functions.
22105 * cs-parser.jay: Pass the defines information
22107 * driver.cs: Add --define command line option.
22109 * decl.cs: Move MemberCore here.
22111 Make it the base class for DeclSpace. This allows us to catch and
22112 report 108 and 109 for everything now.
22114 * class.cs (TypeContainer.Define): Extract all the members
22115 before populating and emit the warning 108 (new keyword required
22116 to override) instead of having each member implement this.
22118 (MemberCore.Define): New abstract method, we will be using this in
22119 the warning reporting engine in Populate.
22121 (Operator.Define): Adjust to new MemberCore protocol.
22123 * const.cs (Const): This does not derive from Expression, it is a
22124 temporary object we use to create fields, it is a MemberCore.
22126 * class.cs (Method.Define): Allow the entry point to be in a
22129 * driver.cs: Rewrite the argument handler to clean it up a bit.
22131 * rootcontext.cs: Made it just an auxiliary namespace feature by
22132 making everything static.
22134 * driver.cs: Adapt code to use RootContext type name instead of
22137 * delegate.cs: Remove RootContext argument.
22139 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
22142 * class.cs (Event.Define): The lookup can fail.
22144 * cs-tokenizer.cs: Begin implementation of pre-procesor.
22146 * expression.cs: Resolve the this instance before invoking the code.
22148 2001-12-17 Miguel de Icaza <miguel@ximian.com>
22150 * cs-parser.jay: Add a production in element_access that allows
22151 the thing to become a "type" reference. This way we can parse
22152 things like "(string [])" as a type.
22154 Note that this still does not handle the more complex rules of
22158 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
22160 * ecore.cs: (CopyNewMethods): new utility function used to
22161 assemble the list of methods from running FindMembers.
22163 (MemberLookup): Rework FindMembers so that
22165 2001-12-16 Miguel de Icaza <miguel@ximian.com>
22167 * class.cs (TypeContainer): Remove Delegates who fail to be
22170 * delegate.cs (Populate): Verify that we dont get null return
22171 values. TODO: Check for AsAccessible.
22173 * cs-parser.jay: Use basename to emit error 574 (destructor should
22174 have the same name as container class), not the full name.
22176 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
22177 possible representation.
22179 Also implements integer type suffixes U and L.
22181 2001-12-15 Miguel de Icaza <miguel@ximian.com>
22183 * expression.cs (ArrayCreation.DoResolve): We need to do the
22184 argument resolution *always*.
22186 * decl.cs: Make this hold the namespace. Hold the root context as
22188 (LookupType): Move here.
22190 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
22192 * location.cs (Row, Name): Fixed the code, it was always returning
22193 references to the first file.
22195 * interface.cs: Register properties defined through interfaces.
22197 * driver.cs: Add support for globbing on the command line
22199 * class.cs (Field): Make it derive from MemberCore as well.
22202 2001-12-15 Ravi Pratap <ravi@ximian.com>
22204 * class.cs (Event::Define): Check that the type of the event is a delegate
22205 type else flag error #66.
22207 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
22210 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
22211 values of EntryPoint, CharSet etc etc.
22213 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
22215 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
22216 be null and we should ignore this. I am not sure if this is really clean. Apparently,
22217 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
22218 which needs this to do its work.
22220 * ../errors/cs0066.cs : Add.
22222 2001-12-14 Miguel de Icaza <miguel@ximian.com>
22224 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
22227 * class.cs: (MethodSignature.MethodSignature): Removed hack that
22228 clears out the parameters field.
22229 (MemberSignatureCompare): Cleanup
22231 (MemberCore): New base class used to share code between MethodCore
22234 (RegisterRequiredImplementations) BindingFlags.Public requires
22235 either BindingFlags.Instace or Static. Use instance here.
22237 (Property): Refactored code to cope better with the full spec.
22239 * parameter.cs (GetParameterInfo): Return an empty array instead
22242 * class.cs (Property): Abstract or extern properties have no bodies.
22244 * parameter.cs (GetParameterInfo): return a zero-sized array.
22246 * class.cs (TypeContainer.MethodModifiersValid): Move all the
22247 method modifier validation to the typecontainer so we can reuse
22248 this on properties.
22250 (MethodCore.ParameterTypes): return an empty sized array of types.
22252 (Property.Define): Test property modifier validity.
22254 Add tests for sealed/override too.
22256 (Method.Emit): abstract or extern methods have no bodies.
22258 2001-12-14 Ravi Pratap <ravi@ximian.com>
22260 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
22263 (Method::Define, ::Emit): Modify accordingly.
22265 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
22267 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
22269 * makefile: Pass in /unsafe.
22271 2001-12-13 Miguel de Icaza <miguel@ximian.com>
22273 * class.cs (MakeKey): Kill routine.
22275 * class.cs (TypeContainer.Define): Correctly define explicit
22276 method implementations (they require the full interface name plus
22279 * typemanager.cs: Deply the PtrHashtable here and stop using the
22280 lame keys. Things work so much better.
22282 This of course broke everyone who depended on `RegisterMethod' to
22283 do the `test for existance' test. This has to be done elsewhere.
22285 * support.cs (PtrHashtable): A hashtable that avoid comparing with
22286 the object stupid Equals method (because, that like fails all over
22287 the place). We still do not use it.
22289 * class.cs (TypeContainer.SetRequiredInterface,
22290 TypeContainer.RequireMethods): Killed these two routines and moved
22291 all the functionality to RegisterRequiredImplementations.
22293 (TypeContainer.RegisterRequiredImplementations): This routine now
22294 registers all the implementations required in an array for the
22295 interfaces and abstract methods. We use an array of structures
22296 which can be computed ahead of time to reduce memory usage and we
22297 also assume that lookups are cheap as most classes will not
22298 implement too many interfaces.
22300 We also avoid creating too many MethodSignatures.
22302 (TypeContainer.IsInterfaceMethod): Update and optionally does not
22303 clear the "pending" bit if we find that there are problems with
22306 (TypeContainer.VerifyPendingMethods): Update to report errors of
22307 methods that look like implementations but are not.
22309 (TypeContainer.Define): Add support for explicit interface method
22312 2001-12-12 Miguel de Icaza <miguel@ximian.com>
22314 * typemanager.cs: Keep track of the parameters here instead of
22315 being a feature of the TypeContainer.
22317 * class.cs: Drop the registration of parameters here, as
22318 InterfaceMethods are also interface declarations.
22320 * delegate.cs: Register methods with the TypeManager not only with
22321 the TypeContainer. This code was buggy.
22323 * interface.cs: Full registation here.
22325 2001-12-11 Miguel de Icaza <miguel@ximian.com>
22327 * expression.cs: Remove reducer for binary expressions, it can not
22330 * const.cs: Put here the code that used to go into constant.cs
22332 * constant.cs: Put here the code for constants, this is a new base
22333 class for Literals.
22335 * literal.cs: Make Literal derive from Constant.
22337 2001-12-09 Miguel de Icaza <miguel@ximian.com>
22339 * statement.cs (Return.Emit): Report error 157 if the user
22340 attempts to return from a finally block.
22342 (Return.Emit): Instead of emitting a return, jump to the end of
22345 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
22346 LocalBuilder to store the result of the function. ReturnLabel is
22347 the target where we jump.
22350 2001-12-09 Radek Doulik <rodo@ximian.com>
22352 * cs-parser.jay: remember alias in current namespace
22354 * ecore.cs (SimpleName::DoResolve): use aliases for types or
22357 * class.cs (LookupAlias): lookup alias in my_namespace
22359 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
22361 (LookupAlias): lookup alias in this and if needed in parent
22364 2001-12-08 Miguel de Icaza <miguel@ximian.com>
22368 * rootcontext.cs: (ModuleBuilder) Made static, first step into
22369 making things static. I need this to avoid passing the
22370 TypeContainer when calling ParameterType.
22372 * support.cs (InternalParameters.ParameterType): Remove ugly hack
22373 that did string manipulation to compute the type and then call
22374 GetType. Use Parameter.ParameterType instead.
22376 * cs-tokenizer.cs: Consume the suffix for floating values.
22378 * expression.cs (ParameterReference): figure out whether this is a
22379 reference parameter or not. Kill an extra variable by computing
22380 the arg_idx during emission.
22382 * parameter.cs (Parameters.GetParameterInfo): New overloaded
22383 function that returns whether a parameter is an out/ref value or not.
22385 (Parameter.ParameterType): The type of the parameter (base,
22386 without ref/out applied).
22388 (Parameter.Resolve): Perform resolution here.
22389 (Parameter.ExternalType): The full type (with ref/out applied).
22391 * statement.cs (Using.Emit, Using.EmitExpression): Implement
22392 support for expressions on the using statement.
22394 2001-12-07 Miguel de Icaza <miguel@ximian.com>
22396 * statement.cs (Using.EmitLocalVariableDecls): Split the
22397 localvariable handling of the using statement.
22399 (Block.EmitMeta): Keep track of variable count across blocks. We
22400 were reusing slots on separate branches of blocks.
22402 (Try.Emit): Emit the general code block, we were not emitting it.
22404 Check the type of the declaration to be an IDisposable or
22405 something that can be implicity converted to it.
22407 Emit conversions if required.
22409 * ecore.cs (EmptyExpression): New utility class.
22410 (Expression.ImplicitConversionExists): New utility function.
22412 2001-12-06 Miguel de Icaza <miguel@ximian.com>
22414 * statement.cs (Using): Implement.
22416 * expression.cs (LocalVariableReference): Support read only variables.
22418 * statement.cs: Remove the explicit emit for the Leave opcode.
22419 (VariableInfo): Add a readonly field.
22421 2001-12-05 Miguel de Icaza <miguel@ximian.com>
22423 * ecore.cs (ConvCast): new class used to encapsulate the various
22424 explicit integer conversions that works in both checked and
22425 unchecked contexts.
22427 (Expression.ConvertNumericExplicit): Use new ConvCast class to
22428 properly generate the overflow opcodes.
22430 2001-12-04 Miguel de Icaza <miguel@ximian.com>
22432 * statement.cs: The correct type for the EmptyExpression is the
22433 element_type, not the variable type. Ravi pointed this out.
22435 2001-12-04 Ravi Pratap <ravi@ximian.com>
22437 * class.cs (Method::Define): Handle PInvoke methods specially
22438 by using DefinePInvokeMethod instead of the usual one.
22440 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
22441 above to do the task of extracting information and defining the method.
22443 2001-12-04 Ravi Pratap <ravi@ximian.com>
22445 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
22446 of the condition for string type.
22448 (Emit): Move that here.
22450 (ArrayCreation::CheckIndices): Keep string literals in their expression
22453 (EmitDynamicInitializers): Handle strings appropriately.
22455 2001-12-04 Miguel de Icaza <miguel@ximian.com>
22457 * codegen.cs (EmitContext): Replace multiple variables with a
22458 single pointer to the current Switch statement.
22460 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
22463 2001-12-03 Miguel de Icaza <miguel@ximian.com>
22467 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
22470 (Foreach.Emit): Foreach on arrays was not setting
22471 up the loop variables (for break/continue).
22473 (GotoCase): Semi-implented.
22475 2001-12-03 Ravi Pratap <ravi@ximian.com>
22477 * attribute.cs (CheckAttribute): Handle system attributes by using
22478 Attribute.GetAttributes to examine information we need.
22480 (GetValidPlaces): Same here.
22482 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
22484 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
22486 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
22488 (Method::Define): Set appropriate flags if we have a DllImport attribute.
22490 (Method::Emit): Handle the case when we are a PInvoke method.
22492 2001-12-03 Miguel de Icaza <miguel@ximian.com>
22494 * expression.cs: Use ResolveWithSimpleName on compound names.
22496 2001-12-02 Ravi Pratap <ravi@ximian.com>
22498 * constant.cs (EmitConstant): Make sure we resolve the associated expression
22499 before trying to reduce it.
22501 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
22503 * constant.cs (LookupConstantValue): Implement.
22505 (EmitConstant): Use the above in emitting the constant.
22507 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
22508 that are user-defined by doing a LookupConstantValue on them.
22510 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
22513 2001-11-29 Miguel de Icaza <miguel@ximian.com>
22515 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
22517 (BaseAccess.DoResolve): Implement.
22519 (MemberAccess.DoResolve): Split this routine into a
22520 ResolveMemberAccess routine that can be used independently
22522 2001-11-28 Miguel de Icaza <miguel@ximian.com>
22524 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
22525 As that share bits of the implementation. Is returns a boolean,
22526 while As returns the Type that is being probed.
22528 2001-12-01 Ravi Pratap <ravi@ximian.com>
22530 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
22531 instead of a Literal - much easier.
22533 (EnumInTransit): Remove - utterly useless :-)
22535 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
22537 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
22539 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
22540 chain when we have no associated expression.
22542 2001-11-30 Ravi Pratap <ravi@ximian.com>
22544 * constant.cs (Define): Use Location while reporting the errror.
22546 Also emit a warning when 'new' is used and there is no inherited
22549 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
22552 (LookupEnumValue): Implement to lookup an enum member's value and define it
22555 (Populate): Re-write accordingly to use the above routine.
22557 2001-11-27 Miguel de Icaza <miguel@ximian.com>
22559 * expression.cs (This): Fix prototype for DoResolveLValue to
22560 override the base class DoResolveLValue.
22562 * cs-parser.cs: Report errors cs574 and cs575 (destructor
22565 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
22566 (we need to load the address of the field here). This fixes
22569 (FieldExpr.DoResolveLValue): Call the DoResolve
22570 function to initialize the Instance expression.
22572 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
22573 correctly the GetEnumerator operation on a value type.
22575 * cs-parser.jay: Add more simple parsing error catches.
22577 * statement.cs (Switch): Add support for string switches.
22578 Handle null specially.
22580 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
22582 2001-11-28 Ravi Pratap <ravi@ximian.com>
22584 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
22586 (declare_local_constant): New helper function.
22588 * statement.cs (AddConstant): Keep a separate record of constants
22590 (IsConstant): Implement to determine if a variable is a constant.
22592 (GetConstantExpression): Implement.
22594 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
22596 * statement.cs (IsVariableDefined): Re-write.
22598 2001-11-27 Ravi Pratap <ravi@ximian.com>
22600 * class.cs (TypeContainer::FindMembers): Look for constants
22601 in the case when we are looking for MemberTypes.Field
22603 * expression.cs (MemberAccess::DoResolve): Check that in the
22604 case we are a FieldExpr and a Literal, we are not being accessed
22605 by an instance reference.
22607 * cs-parser.jay (local_constant_declaration): Implement.
22609 (declaration_statement): Implement for constant declarations.
22611 2001-11-26 Miguel de Icaza <miguel@ximian.com>
22613 * statement.cs (Switch): Catch double defaults.
22615 (Switch): More work on the switch() statement
22616 implementation. It works for integral values now, need to finish
22620 2001-11-24 Miguel de Icaza <miguel@ximian.com>
22622 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
22623 integer literals into other integer literals. To be used by
22626 2001-11-24 Ravi Pratap <ravi@ximian.com>
22628 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
22631 (EmitDynamicInitializers): Cope with the above since we extract data
22632 directly from ArrayData now.
22634 (ExpectInitializers): Keep track of whether initializers are mandatory
22637 (Bounds): Make it a hashtable to prevent the same dimension being
22638 recorded for every element in that dimension.
22640 (EmitDynamicInitializers): Fix bug which prevented the Set array method
22643 Also fix bug which was causing the indices to be emitted in the reverse
22646 2001-11-24 Miguel de Icaza <miguel@ximian.com>
22648 * expression.cs (ArrayCreation): Implement the bits that Ravi left
22649 unfinished. They do not work, because the underlying code is
22652 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22654 * cs-parser.jay: Remove bogus fixme.
22656 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
22657 on Switch statement.
22659 2001-11-23 Ravi Pratap <ravi@ximian.com>
22661 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
22664 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
22665 parameter. Apparently, any expression is allowed.
22667 (ValidateInitializers): Update accordingly.
22669 (CheckIndices): Fix some tricky bugs thanks to recursion.
22671 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
22672 I was being completely brain-dead.
22674 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
22675 and re-write acordingly.
22677 (DelegateInvocation): Re-write accordingly.
22679 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
22681 (MakeByteBlob): Handle types more correctly.
22683 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
22684 initialization from expressions but it is incomplete because I am a complete
22687 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22689 * statement.cs (If.Emit): Fix a bug that generated incorrect code
22690 on If. Basically, we have to return `true' (ie, we do return to
22691 our caller) only if both branches of the if return.
22693 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
22694 short-circuit operators, handle them as short circuit operators.
22696 (Cast.DoResolve): Resolve type.
22697 (Cast.Cast): Take an expression as the target type.
22699 * cs-parser.jay (cast_expression): Remove old hack that only
22700 allowed a limited set of types to be handled. Now we take a
22701 unary_expression and we resolve to a type during semantic
22704 Use the grammar productions from Rhys to handle casts (this is
22705 not complete like Rhys syntax yet, we fail to handle that corner
22706 case that C# has regarding (-x), but we will get there.
22708 2001-11-22 Ravi Pratap <ravi@ximian.com>
22710 * class.cs (EmitFieldInitializer): Take care of the case when we have a
22711 field which is an array type.
22713 * cs-parser.jay (declare_local_variables): Support array initialization too.
22715 * typemanager.cs (MakeKey): Implement.
22717 (everywhere): Use the above appropriately.
22719 * cs-parser.jay (for_statement): Update for array initialization while
22720 declaring variables.
22722 * ecore.cs : The error message was correct, it's the variable's names that
22723 were misleading ;-) Make the code more readable.
22725 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
22726 the correct type etc.
22728 (ConvertExplicit): Handle Enum types by examining the underlying type.
22730 2001-11-21 Ravi Pratap <ravi@ximian.com>
22732 * parameter.cs (GetCallingConvention): Always return
22733 CallingConventions.Standard for now.
22735 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22737 * expression.cs (Binary.ResolveOperator): Update the values of `l'
22738 and `r' after calling DoNumericPromotions.
22740 * ecore.cs: Fix error message (the types were in the wrong order).
22742 * statement.cs (Foreach.ProbeCollectionType): Need to pass
22743 BindingFlags.Instance as well
22745 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
22746 implicit int literal conversion in an empty cast so that we
22747 propagate the right type upstream.
22749 (UnboxCast): new class used to unbox value types.
22750 (Expression.ConvertExplicit): Add explicit type conversions done
22753 (Expression.ImplicitNumericConversion): Oops, forgot to test for
22754 the target type before applying the implicit LongLiterals to ULong
22757 2001-11-21 Miguel de Icaza <miguel@ximian.com>
22759 * cs-parser.jay (for_statement): Reworked the way For works: now
22760 we declare manually any variables that are introduced in
22761 for_initializer to solve the problem of having out-of-band code
22762 emition (that is what got for broken).
22764 (declaration_statement): Perform the actual variable declaration
22765 that used to be done in local_variable_declaration here.
22767 (local_variable_declaration): Do not declare anything, just pass
22768 the information on a DictionaryEntry
22770 2001-11-20 Ravi Pratap <ravi@ximian.com>
22772 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
22773 re-write of the logic to now make it recursive.
22775 (UpdateIndices): Re-write accordingly.
22777 Store element data in a separate ArrayData list in the above methods.
22779 (MakeByteBlob): Implement to dump the array data into a byte array.
22781 2001-11-19 Ravi Pratap <ravi@ximian.com>
22783 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
22786 * constant.cs (Define): Implement.
22788 (EmitConstant): Re-write fully.
22790 Pass in location info.
22792 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
22795 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
22796 DictionaryEntry since we need location info too.
22798 (constant_declaration): Update accordingly.
22800 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
22801 code into another method : UpdateIndices.
22803 2001-11-18 Ravi Pratap <ravi@ximian.com>
22805 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
22806 some type checking etc.
22808 2001-11-17 Ravi Pratap <ravi@ximian.com>
22810 * expression.cs (ArrayCreation::ValidateInitializers): Implement
22811 bits to provide dimension info if the user skips doing that.
22813 Update second constructor to store the rank correctly.
22815 2001-11-16 Ravi Pratap <ravi@ximian.com>
22817 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
22818 and try to implement.
22820 * ../errors/cs0150.cs : Add.
22822 * ../errors/cs0178.cs : Add.
22824 2001-11-16 Miguel de Icaza <miguel@ximian.com>
22826 * statement.cs: Implement foreach on multi-dimensional arrays.
22828 * parameter.cs (Parameters.GetParameterByName): Also lookup the
22829 name of the params argument.
22831 * expression.cs: Use EmitStoreOpcode to get the right opcode while
22832 initializing the array.
22834 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
22835 we can use this elsewhere.
22837 * statement.cs: Finish implementation of foreach for single
22840 * cs-parser.jay: Use an out-of-band stack to pass information
22841 around, I wonder why I need this.
22843 foreach_block: Make the new foreach_block the current_block.
22845 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
22846 function used to return a static Parameters structure. Used for
22847 empty parameters, as those are created very frequently.
22849 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
22851 2001-11-15 Ravi Pratap <ravi@ximian.com>
22853 * interface.cs : Default modifier is private, not public. The
22854 make verify test passes again.
22856 2001-11-15 Ravi Pratap <ravi@ximian.com>
22858 * support.cs (ReflectionParameters): Fix logic to determine
22859 whether the last parameter is a params one. Test 9 passes again.
22861 * delegate.cs (Populate): Register the builders we define with
22862 RegisterParameterForBuilder. Test 19 passes again.
22864 * cs-parser.jay (property_declaration): Reference $6 instead
22865 of $$ to get at the location.
22867 (indexer_declaration): Similar stuff.
22869 (attribute): Ditto.
22871 * class.cs (Property): Register parameters for the Get and Set methods
22872 if they exist. Test 23 passes again.
22874 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
22875 call to EmitArguments as we are sure there aren't any params arguments.
22876 Test 32 passes again.
22878 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
22879 IndexOutOfRangeException.
22881 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
22882 Test 33 now passes again.
22884 2001-11-15 Miguel de Icaza <miguel@ximian.com>
22886 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22887 broke a bunch of things. Will have to come up with a better way
22888 of tracking locations.
22890 * statement.cs: Implemented foreach for single dimension arrays.
22892 2001-11-09 Miguel de Icaza <miguel@ximian.com>
22894 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22895 an error. This removes the lookup from the critical path.
22897 * cs-parser.jay: Removed use of temporary_loc, which is completely
22900 2001-11-14 Miguel de Icaza <miguel@ximian.com>
22902 * support.cs (ReflectionParameters.ParameterModifier): Report
22903 whether the argument is a PARAMS argument or not.
22905 * class.cs: Set the attribute `ParamArrayAttribute' on the
22906 parameter argument.
22908 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22909 and cons_param_array_attribute (ConstructorInfo for
22910 ParamArrayAttribute).,
22912 * codegen.cs: Emit the return using the `Return' statement, that
22913 way we can report the error correctly for missing return values.
22915 * class.cs (Method.Emit): Clean up.
22917 * expression.cs (Argument.Resolve): Take another argument: the
22918 location where this argument is used. Notice that this is not
22919 part of the "Argument" class as to reduce the size of the
22920 structure (we know the approximate location anyways).
22922 Test if the argument is a variable-reference, if not, then
22923 complain with a 206.
22925 (Argument.Emit): Emit addresses of variables.
22927 (Argument.FullDesc): Simplify.
22929 (Invocation.DoResolve): Update for Argument.Resolve.
22931 (ElementAccess.DoResolve): ditto.
22933 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22934 method should be virtual, as this method is always virtual.
22936 (NewDelegate.DoResolve): Update for Argument.Resolve.
22938 * class.cs (ConstructorInitializer.DoResolve): ditto.
22940 * attribute.cs (Attribute.Resolve): ditto.
22942 2001-11-13 Miguel de Icaza <miguel@ximian.com>
22944 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22946 * expression.cs (ParameterReference): Drop IStackStorage and implement
22947 IAssignMethod instead.
22949 (LocalVariableReference): ditto.
22951 * ecore.cs (FieldExpr): Drop IStackStorage and implement
22952 IAssignMethod instead.
22954 2001-11-13 Miguel de Icaza <miguel@ximian.com>
22956 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22957 enumerations that are used in heavily used structures derive from
22958 byte in a laughable and pathetic attempt to reduce memory usage.
22959 This is the kind of pre-optimzations that you should not do at
22960 home without adult supervision.
22962 * expression.cs (UnaryMutator): New class, used to handle ++ and
22963 -- separatedly from the other unary operators. Cleans up the
22964 code, and kills the ExpressionStatement dependency in Unary.
22966 (Unary): Removed `method' and `Arguments' from this class, making
22967 it smaller, and moving it all to SimpleCall, so I can reuse this
22968 code in other locations and avoid creating a lot of transient data
22969 strucutres when not required.
22971 * cs-parser.jay: Adjust for new changes.
22973 2001-11-11 Miguel de Icaza <miguel@ximian.com>
22975 * enum.cs (Enum.Populate): If there is a failure during
22978 * cs-parser.jay (opt_enum_base): we used to catch type errors
22979 here, but this is really incorrect. The type error should be
22980 catched during semantic analysis.
22982 2001-12-11 Ravi Pratap <ravi@ximian.com>
22984 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
22985 current_local_parameters as expected since I, in my stupidity, had forgotten
22988 * attribute.cs (GetValidPlaces): Fix stupid bug.
22990 * class.cs (Method::Emit): Perform check on applicability of attributes.
22992 (Constructor::Emit): Ditto.
22994 (Field::Emit): Ditto.
22996 (Field.Location): Store location information.
22998 (Property, Event, Indexer, Operator): Ditto.
23000 * cs-parser.jay (field_declaration): Pass in location for each field.
23002 * ../errors/cs0592.cs : Add.
23004 2001-11-12 Ravi Pratap <ravi@ximian.com>
23006 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
23008 (InitCoreTypes): Update accordingly.
23010 (RegisterAttrType, LookupAttr): Implement.
23012 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
23013 info about the same.
23015 (Resolve): Update to populate the above as necessary.
23017 (Error592): Helper.
23019 (GetValidPlaces): Helper to the above.
23021 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
23023 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
23025 2001-11-12 Ravi Pratap <ravi@ximian.com>
23027 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
23029 * ../errors/cs0617.cs : Add.
23031 2001-11-11 Ravi Pratap <ravi@ximian.com>
23033 * enum.cs (Emit): Rename to Populate to be more consistent with what
23034 we expect it to do and when exactly it is called.
23036 * class.cs, rootcontext.cs : Update accordingly.
23038 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
23039 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
23041 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
23043 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
23044 of a fieldinfo using the above, when dealing with a FieldBuilder.
23046 2001-11-10 Ravi Pratap <ravi@ximian.com>
23048 * ../errors/cs0031.cs : Add.
23050 * ../errors/cs1008.cs : Add.
23052 * ../errrors/cs0543.cs : Add.
23054 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
23057 (FindMembers): Implement.
23059 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
23060 enums and delegates too.
23062 (enum_types): Rename to builder_to_enum.
23064 (delegate_types): Rename to builder_to_delegate.
23066 * delegate.cs (FindMembers): Implement.
23068 2001-11-09 Ravi Pratap <ravi@ximian.com>
23070 * typemanager.cs (IsEnumType): Implement.
23072 * enum.cs (Emit): Re-write parts to account for the underlying type
23073 better and perform checking etc.
23075 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
23076 of the underlying type.
23078 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
23081 * enum.cs (error31): Helper to report error #31.
23083 * cs-parser.jay (enum_declaration): Store location of each member too.
23085 * enum.cs (member_to_location): New hashtable.
23087 (AddEnumMember): Update location hashtable.
23089 (Emit): Use the location of each member while reporting errors.
23091 2001-11-09 Miguel de Icaza <miguel@ximian.com>
23093 * cs-parser.jay: A for_initializer if is a
23094 local_variable_declaration really ammount to have an implicit
23095 block with the variable declaration and no initializer for for.
23097 * statement.cs (For.Emit): Cope with null initializers.
23099 This fixes the infinite loop on for initializers.
23101 2001-11-08 Miguel de Icaza <miguel@ximian.com>
23103 * enum.cs: More cleanup.
23105 * ecore.cs: Remove dead code.
23107 * class.cs (Property.Emit): More simplification.
23108 (Event.Emit): ditto.
23110 Reworked to have less levels of indentation.
23112 2001-11-08 Ravi Pratap <ravi@ximian.com>
23114 * class.cs (Property): Emit attributes.
23124 * enum.cs (Emit): Ditto.
23126 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
23129 * class.cs (Field, Event, etc.): Move attribute generation into the
23130 Emit method everywhere.
23132 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
23133 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
23134 as we had no way of defining nested enums !
23136 * rootcontext.cs : Adjust code accordingly.
23138 * typemanager.cs (AddEnumType): To keep track of enum types separately.
23140 2001-11-07 Ravi Pratap <ravi@ximian.com>
23142 * expression.cs (EvalConstantExpression): Move into ecore.cs
23144 * enum.cs (Enum): Rename some members and make them public and readonly
23145 according to our convention.
23147 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
23150 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
23152 (Enum::Emit): Write a simple version for now which doesn't try to compute
23153 expressions. I shall modify this to be more robust in just a while.
23155 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
23157 (TypeContainer::CloseType): Create the Enum types too.
23159 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
23161 * expression.cs (EvalConstantExpression): Get rid of completely.
23163 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
23164 user-defined values and other cases.
23166 (IsValidEnumLiteral): Helper function.
23168 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
23169 out there in the case we had a literal FieldExpr.
23171 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
23173 (Literalize): Revamp a bit to take two arguments.
23175 (EnumLiteral): New class which derives from Literal to wrap enum literals.
23177 2001-11-06 Ravi Pratap <ravi@ximian.com>
23179 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
23181 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
23183 (Resolve): Use the above to ensure we have proper initializers.
23185 2001-11-05 Ravi Pratap <ravi@ximian.com>
23187 * expression.cs (Expression::EvalConstantExpression): New method to
23188 evaluate constant expressions.
23190 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
23192 2001-11-07 Miguel de Icaza <miguel@ximian.com>
23194 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
23197 (Binary.ResolveOperator): Handle operator != (object a, object b)
23198 and operator == (object a, object b);
23200 (Binary.DoNumericPromotions): Indicate whether the numeric
23201 promotion was possible.
23203 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
23206 Made the ArrayAccess implement interface IAssignMethod instead of
23207 IStackStore as the order in which arguments are passed reflects
23210 * assign.cs: Instead of using expr.ExprClass to select the way of
23211 assinging, probe for the IStackStore/IAssignMethod interfaces.
23213 * typemanager.cs: Load InitializeArray definition.
23215 * rootcontext.cs (RootContext.MakeStaticData): Used to define
23216 static data that can be used to initialize arrays.
23218 2001-11-05 Miguel de Icaza <miguel@ximian.com>
23220 * expression.cs: Handle operator== and operator!= for booleans.
23222 (Conditioal.Reduce): Implement reducer for the ?: operator.
23224 (Conditional.Resolve): Implement dead code elimination.
23226 (Binary.Resolve): Catch string literals and return a new
23227 concatenated string.
23229 (Unary.Reduce): Implement reduction of unary expressions.
23231 * ecore.cs: Split out the expression core handling here.
23233 (Expression.Reduce): New method used to perform constant folding
23234 and CSE. This is needed to support constant-expressions.
23236 * statement.cs (Statement.EmitBoolExpression): Pass true and false
23237 targets, and optimize for !x.
23239 2001-11-04 Ravi Pratap <ravi@ximian.com>
23241 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
23242 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
23243 set custom atttributes.
23245 * literal.cs (Literal::GetValue): New abstract method to return the actual
23246 value of the literal, cast as an object.
23248 (*Literal): Implement GetValue method.
23250 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
23251 expressions to the arraylist but objects of type Argument.
23253 * class.cs (TypeContainer::Emit): Emit our attributes too.
23255 (Method::Emit, Constructor::Emit): Ditto.
23257 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
23258 to be ignoring earlier.
23260 2001-11-03 Ravi Pratap <ravi@ximian.com>
23262 * attribute.cs (AttributeSection::Define): Implement to do the business
23263 of constructing a CustomAttributeBuilder.
23265 (Attribute): New trivial class. Increases readability of code.
23267 * cs-parser.jay : Update accordingly.
23269 (positional_argument_list, named_argument_list, named_argument): New rules
23271 (attribute_arguments): Use the above so that we are more correct.
23273 2001-11-02 Ravi Pratap <ravi@ximian.com>
23275 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
23276 to perform all checks for a method with a params parameter.
23278 (Invocation::OverloadResolve): Update to use the above method and therefore
23279 cope correctly with params method invocations.
23281 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
23284 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
23285 constructors in our parent too because we can't afford to miss out on
23288 * attribute.cs (AttributeSection): New name for the class Attribute
23290 Other trivial changes to improve readability.
23292 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
23293 use the new class names.
23295 2001-11-01 Ravi Pratap <ravi@ximian.com>
23297 * class.cs (Method::Define): Complete definition for params types too
23299 (Indexer::Define): Ditto.
23301 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
23302 Cope everywhere with a request for info about the array parameter.
23304 2001-11-01 Ravi Pratap <ravi@ximian.com>
23306 * tree.cs (RecordNamespace): Fix up to check for the correct key.
23308 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
23309 local_variable_type to extract the string corresponding to the type.
23311 (local_variable_type): Fixup the action to use the new helper method.
23313 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
23316 * expression.cs : Clean out code which uses the above.
23318 2001-10-31 Ravi Pratap <ravi@ximian.com>
23320 * typemanager.cs (RegisterMethod): Check if we already have an existing key
23321 and bale out if necessary by returning a false.
23323 (RegisterProperty): Ditto.
23325 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
23326 and print out appropriate error messages.
23328 * interface.cs (everywhere): Ditto.
23330 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
23331 location to constructor.
23333 * class.cs (Property, Event, Indexer): Update accordingly.
23335 * ../errors/cs111.cs : Added.
23337 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
23338 of a method, as laid down by the spec.
23340 (Invocation::OverloadResolve): Use the above method.
23342 2001-10-31 Ravi Pratap <ravi@ximian.com>
23344 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
23345 now take a TypeContainer and a Parameters object.
23347 (ParameterData): Modify return type of ParameterModifier method to be
23348 Parameter.Modifier and not a string.
23350 (ReflectionParameters, InternalParameters): Update accordingly.
23352 * expression.cs (Argument::GetParameterModifier): Same here.
23354 * support.cs (InternalParameters::ParameterType): Find a better way of determining
23355 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
23356 symbol in it at all so maybe this is only for now.
23358 2001-10-30 Ravi Pratap <ravi@ximian.com>
23360 * support.cs (InternalParameters): Constructor now takes an extra argument
23361 which is the actual Parameters class.
23363 (ParameterDesc): Update to provide info on ref/out modifiers.
23365 * class.cs (everywhere): Update call to InternalParameters to pass in
23366 the second argument too.
23368 * support.cs (ParameterData): Add ParameterModifier, which is a method
23369 to return the modifier info [ref/out etc]
23371 (InternalParameters, ReflectionParameters): Implement the above.
23373 * expression.cs (Argument::ParameterModifier): Similar function to return
23374 info about the argument's modifiers.
23376 (Invocation::OverloadResolve): Update to take into account matching modifiers
23379 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
23380 a new SetFormalParameters object which we pass to InternalParameters.
23382 2001-10-30 Ravi Pratap <ravi@ximian.com>
23384 * expression.cs (NewArray): Merge into the ArrayCreation class.
23386 2001-10-29 Ravi Pratap <ravi@ximian.com>
23388 * expression.cs (NewArray): Merge classes NewBuiltinArray and
23389 NewUserdefinedArray into one as there wasn't much of a use in having
23392 * expression.cs (Argument): Change field's name to ArgType from Type.
23394 (Type): New readonly property which returns the proper type, taking into
23395 account ref/out modifiers.
23397 (everywhere): Adjust code accordingly for the above.
23399 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
23400 whether we are emitting for a ref or out parameter.
23402 * expression.cs (Argument::Emit): Use the above field to set the state.
23404 (LocalVariableReference::Emit): Update to honour the flag and emit the
23407 * parameter.cs (Attributes): Set the correct flags for ref parameters.
23409 * expression.cs (Argument::FullDesc): New function to provide a full desc.
23411 * support.cs (ParameterData): Add method ParameterDesc to the interface.
23413 (ReflectionParameters, InternalParameters): Implement the above method.
23415 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
23418 (Invocation::FullMethodDesc): Ditto.
23420 2001-10-29 Miguel de Icaza <miguel@ximian.com>
23422 * cs-parser.jay: Add extra production for the second form of array
23425 * expression.cs (ArrayCreation): Update to reflect the above
23428 * Small changes to prepare for Array initialization.
23430 2001-10-28 Miguel de Icaza <miguel@ximian.com>
23432 * typemanager.cs (ImplementsInterface): interface might be null;
23433 Deal with this problem;
23435 Also, we do store negative hits on the cache (null values), so use
23436 this instead of calling t.GetInterfaces on the type everytime.
23438 2001-10-28 Ravi Pratap <ravi@ximian.com>
23440 * typemanager.cs (IsBuiltinType): New method to help determine the same.
23442 * expression.cs (New::DoResolve): Get rid of array creation code and instead
23443 split functionality out into different classes.
23445 (New::FormArrayType): Move into NewBuiltinArray.
23447 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
23450 (NewBuiltinArray): New class to handle creation of built-in arrays.
23452 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
23453 account creation of one-dimensional arrays.
23455 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
23457 (NewUserdefinedArray::DoResolve): Implement.
23459 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
23461 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
23462 we maintain inside the TypeManager. This is necessary to perform lookups on the
23465 (LookupType): Update to perform GetType on the module builders too.
23467 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
23469 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
23471 2001-10-23 Ravi Pratap <ravi@ximian.com>
23473 * expression.cs (New::DoResolve): Implement guts of array creation.
23475 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
23477 2001-10-27 Miguel de Icaza <miguel@ximian.com>
23479 * expression.cs: Fix bug I introduced lsat night that broke
23482 (Expression.Resolve): Report a 246 error (can not resolve name)
23483 if we find a SimpleName in the stream.
23485 (Expression.ResolveLValue): Ditto.
23487 (Expression.ResolveWithSimpleName): This function is a variant of
23488 ResolveName, this one allows SimpleNames to be returned without a
23489 warning. The only consumer of SimpleNames is MemberAccess
23491 2001-10-26 Miguel de Icaza <miguel@ximian.com>
23493 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
23494 might arrive here. I have my doubts that this is correct.
23496 * statement.cs (Lock): Implement lock statement.
23498 * cs-parser.jay: Small fixes to support `lock' and `using'
23500 * cs-tokenizer.cs: Remove extra space
23502 * driver.cs: New flag --checked, allows to turn on integer math
23505 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
23506 Threading.Monitor.Exit
23508 2001-10-23 Miguel de Icaza <miguel@ximian.com>
23510 * expression.cs (IndexerAccess::DoResolveLValue): Set the
23511 Expression Class to be IndexerAccess.
23513 Notice that Indexer::DoResolve sets the eclass to Value.
23515 2001-10-22 Miguel de Icaza <miguel@ximian.com>
23517 * class.cs (TypeContainer::Emit): Emit code for indexers.
23519 * assign.cs (IAssignMethod): New interface implemented by Indexers
23520 and Properties for handling assignment.
23522 (Assign::Emit): Simplify and reuse code.
23524 * expression.cs (IndexerAccess, PropertyExpr): Implement
23525 IAssignMethod, clean up old code.
23527 2001-10-22 Ravi Pratap <ravi@ximian.com>
23529 * typemanager.cs (ImplementsInterface): New method to determine if a type
23530 implements a given interface. Provides a nice cache too.
23532 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
23535 (ConvertReferenceExplicit): Ditto.
23537 * delegate.cs (Delegate::Populate): Update to define the parameters on the
23538 various methods, with correct names etc.
23540 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
23541 Operator.UnaryNegation.
23543 * cs-parser.jay (operator_declarator): Be a little clever in the case where
23544 we have a unary plus or minus operator.
23546 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
23549 * everywhere : update accordingly.
23551 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
23554 * class.cs (Method::Define): For the case where we are implementing a method
23555 inherited from an interface, we need to set the MethodAttributes.Final flag too.
23556 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
23558 2001-10-21 Ravi Pratap <ravi@ximian.com>
23560 * interface.cs (FindMembers): Implement to work around S.R.E
23563 * typemanager.cs (IsInterfaceType): Implement.
23565 (FindMembers): Update to handle interface types too.
23567 * expression.cs (ImplicitReferenceConversion): Re-write bits which
23568 use IsAssignableFrom as that is not correct - it doesn't work.
23570 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
23571 and accordingly override EmitStatement.
23573 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
23574 using the correct logic :-)
23576 2001-10-19 Ravi Pratap <ravi@ximian.com>
23578 * ../errors/cs-11.cs : Add to demonstrate error -11
23580 2001-10-17 Miguel de Icaza <miguel@ximian.com>
23582 * assign.cs (Assign::Resolve): Resolve right hand side first, and
23583 then pass this as a hint to ResolveLValue.
23585 * expression.cs (FieldExpr): Add Location information
23587 (FieldExpr::LValueResolve): Report assignment to readonly
23590 (Expression::ExprClassFromMemberInfo): Pass location information.
23592 (Expression::ResolveLValue): Add new method that resolves an
23595 (Expression::DoResolveLValue): Default invocation calls
23598 (Indexers): New class used to keep track of indexers in a given
23601 (IStackStore): Renamed from LValue, as it did not really describe
23602 what this did. Also ResolveLValue is gone from this interface and
23603 now is part of Expression.
23605 (ElementAccess): Depending on the element access type
23607 * typemanager.cs: Add `indexer_name_type' as a Core type
23608 (System.Runtime.CompilerServices.IndexerNameAttribute)
23610 * statement.cs (Goto): Take a location.
23612 2001-10-18 Ravi Pratap <ravi@ximian.com>
23614 * delegate.cs (Delegate::VerifyDelegate): New method to verify
23615 if two delegates are compatible.
23617 (NewDelegate::DoResolve): Update to take care of the case when
23618 we instantiate a delegate from another delegate.
23620 * typemanager.cs (FindMembers): Don't even try to look up members
23621 of Delegate types for now.
23623 2001-10-18 Ravi Pratap <ravi@ximian.com>
23625 * delegate.cs (NewDelegate): New class to take care of delegate
23628 * expression.cs (New): Split the delegate related code out into
23629 the NewDelegate class.
23631 * delegate.cs (DelegateInvocation): New class to handle delegate
23634 * expression.cs (Invocation): Split out delegate related code into
23635 the DelegateInvocation class.
23637 2001-10-17 Ravi Pratap <ravi@ximian.com>
23639 * expression.cs (New::DoResolve): Implement delegate creation fully
23640 and according to the spec.
23642 (New::DoEmit): Update to handle delegates differently.
23644 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
23645 because of which we were printing out arguments in reverse order !
23647 * delegate.cs (VerifyMethod): Implement to check if the given method
23648 matches the delegate.
23650 (FullDelegateDesc): Implement.
23652 (VerifyApplicability): Implement.
23654 * expression.cs (Invocation::DoResolve): Update to accordingly handle
23655 delegate invocations too.
23657 (Invocation::Emit): Ditto.
23659 * ../errors/cs1593.cs : Added.
23661 * ../errors/cs1594.cs : Added.
23663 * delegate.cs (InstanceExpression, TargetMethod): New properties.
23665 2001-10-16 Ravi Pratap <ravi@ximian.com>
23667 * typemanager.cs (intptr_type): Core type for System.IntPtr
23669 (InitCoreTypes): Update for the same.
23671 (iasyncresult_type, asynccallback_type): Ditto.
23673 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
23676 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
23679 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
23680 the builders for the 4 members of a delegate type :-)
23682 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
23685 * expression.cs (New::DoResolve): Implement guts for delegate creation.
23687 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
23689 2001-10-15 Miguel de Icaza <miguel@ximian.com>
23691 * statement.cs (Break::Emit): Implement.
23692 (Continue::Emit): Implement.
23694 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
23695 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
23696 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
23697 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
23700 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
23701 properties that track the label for the current loop (begin of the
23702 loop and end of the loop).
23704 2001-10-15 Ravi Pratap <ravi@ximian.com>
23706 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
23707 use of emitting anything at all.
23709 * class.cs, rootcontext.cs : Get rid of calls to the same.
23711 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
23713 (Populate): Define the constructor correctly and set the implementation
23716 * typemanager.cs (delegate_types): New hashtable to hold delegates that
23719 (AddDelegateType): Implement.
23721 (IsDelegateType): Implement helper method.
23723 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
23725 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
23726 and accordingly handle it.
23728 * delegate.cs (Populate): Take TypeContainer argument.
23729 Implement bits to define the Invoke method. However, I still haven't figured out
23730 how to take care of the native int bit :-(
23732 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
23733 Qualify the name of the delegate, not its return type !
23735 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
23738 (StandardConversionExists): Checking for array types turns out to be recursive.
23740 (ConvertReferenceExplicit): Implement array conversion.
23742 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
23744 2001-10-12 Ravi Pratap <ravi@ximian.com>
23746 * cs-parser.jay (delegate_declaration): Store the fully qualified
23747 name as it is a type declaration.
23749 * delegate.cs (ReturnType, Name): Rename members to these. Make them
23752 (DefineDelegate): Renamed from Define. Does the same thing essentially,
23753 as TypeContainer::DefineType.
23755 (Populate): Method in which all the definition of the various methods (Invoke)
23758 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
23761 (CloseDelegate): Finally creates the delegate.
23763 * class.cs (TypeContainer::DefineType): Update to define delegates.
23764 (Populate, Emit and CloseType): Do the same thing here too.
23766 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
23767 delegates in all these operations.
23769 2001-10-14 Miguel de Icaza <miguel@ximian.com>
23771 * expression.cs: LocalTemporary: a new expression used to
23772 reference a temporary that has been created.
23774 * assign.cs: Handle PropertyAccess back here, so that we can
23775 provide the proper semantic access to properties.
23777 * expression.cs (Expression::ConvertReferenceExplicit): Implement
23778 a few more explicit conversions.
23780 * modifiers.cs: `NEW' modifier maps to HideBySig.
23782 * expression.cs (PropertyExpr): Make this into an
23783 ExpressionStatement, and support the EmitStatement code path.
23785 Perform get/set error checking, clean up the interface.
23787 * assign.cs: recognize PropertyExprs as targets, and if so, turn
23788 them into toplevel access objects.
23790 2001-10-12 Miguel de Icaza <miguel@ximian.com>
23792 * expression.cs: PropertyExpr::PropertyExpr: use work around the
23795 * typemanager.cs: Keep track here of our PropertyBuilders again to
23796 work around lameness in SRE.
23798 2001-10-11 Miguel de Icaza <miguel@ximian.com>
23800 * expression.cs (LValue::LValueResolve): New method in the
23801 interface, used to perform a second resolution pass for LValues.
23803 (This::DoResolve): Catch the use of this in static methods.
23805 (This::LValueResolve): Implement.
23807 (This::Store): Remove warning, assigning to `this' in structures
23810 (Invocation::Emit): Deal with invocation of
23811 methods on value types. We need to pass the address to structure
23812 methods rather than the object itself. (The equivalent code to
23813 emit "this" for structures leaves the entire structure on the
23814 stack instead of a pointer to it).
23816 (ParameterReference::DoResolve): Compute the real index for the
23817 argument based on whether the method takes or not a `this' pointer
23818 (ie, the method is static).
23820 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
23821 value types returned from functions when we need to invoke a
23822 method on the sturcture.
23825 2001-10-11 Ravi Pratap <ravi@ximian.com>
23827 * class.cs (TypeContainer::DefineType): Method to actually do the business of
23828 defining the type in the Modulebuilder or Typebuilder. This is to take
23829 care of nested types which need to be defined on the TypeBuilder using
23830 DefineNestedMethod.
23832 (TypeContainer::GetClassBases): Implement. Essentially the code from the
23833 methods in RootContext, only ported to be part of TypeContainer.
23835 (TypeContainer::GetInterfaceOrClass): Ditto.
23837 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
23839 * interface.cs (Interface::DefineInterface): New method. Does exactly
23840 what RootContext.CreateInterface did earlier, only it takes care of nested types
23843 (Interface::GetInterfaces): Move from RootContext here and port.
23845 (Interface::GetInterfaceByName): Same here.
23847 * rootcontext.cs (ResolveTree): Re-write.
23849 (PopulateTypes): Re-write.
23851 * class.cs (TypeContainer::Populate): Populate nested types too.
23852 (TypeContainer::Emit): Emit nested members too.
23854 * typemanager.cs (AddUserType): Do not make use of the FullName property,
23855 instead just use the name argument passed in as it is already fully
23858 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
23859 to TypeContainer mapping to see if a type is user-defined.
23861 * class.cs (TypeContainer::CloseType): Implement.
23863 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
23864 the default constructor.
23866 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
23869 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
23871 * interface.cs (CloseType): Create the type here.
23873 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
23876 Remove all the methods which are now in TypeContainer.
23878 2001-10-10 Ravi Pratap <ravi@ximian.com>
23880 * delegate.cs (Define): Re-write bits to define the delegate
23883 2001-10-10 Miguel de Icaza <miguel@ximian.com>
23885 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23887 * expression.cs (ImplicitReferenceConversion): handle null as well
23888 as a source to convert to any reference type.
23890 * statement.cs (Return): Perform any implicit conversions to
23891 expected return type.
23893 Validate use of return statement.
23895 * codegen.cs (EmitContext): Pass the expected return type here.
23897 * class.cs (Method, Constructor, Property): Pass expected return
23898 type to EmitContext.
23900 2001-10-09 Miguel de Icaza <miguel@ximian.com>
23902 * expression.cs: Make DoResolve take an EmitContext instead of a
23905 Replaced `l' and `location' for `loc', for consistency.
23907 (Error, Warning): Remove unneeded Tc argument.
23909 * assign.cs, literal.cs, constant.cs: Update to new calling
23912 * codegen.cs: EmitContext now contains a flag indicating whether
23913 code is being generated in a static method or not.
23915 * cs-parser.jay: DecomposeQI, new function that replaces the old
23916 QualifiedIdentifier. Now we always decompose the assembled
23917 strings from qualified_identifier productions into a group of
23920 2001-10-08 Miguel de Icaza <miguel@ximian.com>
23922 * rootcontext.cs: Deal with field-less struct types correctly now
23923 by passing the size option to Define Type.
23925 * class.cs: Removed hack that created one static field.
23927 2001-10-07 Miguel de Icaza <miguel@ximian.com>
23929 * statement.cs: Moved most of the code generation here.
23931 2001-10-09 Ravi Pratap <ravi@ximian.com>
23933 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23936 (ElementAccess): Remove useless bits for now - keep checks as the spec
23939 2001-10-08 Ravi Pratap <ravi@ximian.com>
23941 * expression.cs (ElementAccess::DoResolve): Remove my crap code
23942 and start performing checks according to the spec.
23944 2001-10-07 Ravi Pratap <ravi@ximian.com>
23946 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23947 rank_specifiers instead.
23949 (rank_specifiers): Change the order in which the rank specifiers are stored
23951 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23953 * expression.cs (ElementAccess): Implement the LValue interface too.
23955 2001-10-06 Ravi Pratap <ravi@ximian.com>
23957 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23958 except that user defined conversions are not included.
23960 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
23961 perform the conversion of the return type, if necessary.
23963 (New::DoResolve): Check whether we are creating an array or an object
23964 and accordingly do the needful.
23966 (New::Emit): Same here.
23968 (New::DoResolve): Implement guts of array creation.
23970 (New::FormLookupType): Helper function.
23972 2001-10-07 Miguel de Icaza <miguel@ximian.com>
23974 * codegen.cs: Removed most of the code generation here, and move the
23975 corresponding code generation bits to the statement classes.
23977 Added support for try/catch/finalize and throw.
23979 * cs-parser.jay: Added support for try/catch/finalize.
23981 * class.cs: Catch static methods having the flags override,
23982 virtual or abstract.
23984 * expression.cs (UserCast): This user cast was not really doing
23985 what it was supposed to do. Which is to be born in fully resolved
23986 state. Parts of the resolution were being performed at Emit time!
23990 2001-10-05 Miguel de Icaza <miguel@ximian.com>
23992 * expression.cs: Implicity convert the result from UserCast.
23994 2001-10-05 Ravi Pratap <ravi@ximian.com>
23996 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23997 prevented it from working correctly.
23999 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
24000 merely ConvertImplicit.
24002 2001-10-05 Miguel de Icaza <miguel@ximian.com>
24004 * typemanager.cs: Make the LookupTypeContainer function static,
24005 and not per-instance.
24007 * class.cs: Make static FindMembers (the one that takes a Type
24010 * codegen.cs: Add EmitForeach here.
24012 * cs-parser.jay: Make foreach a toplevel object instead of the
24013 inline expansion, as we need to perform semantic analysis on it.
24015 2001-10-05 Ravi Pratap <ravi@ximian.com>
24017 * expression.cs (Expression::ImplicitUserConversion): Rename to
24018 UserDefinedConversion.
24020 (Expression::UserDefinedConversion): Take an extra argument specifying
24021 whether we look for explicit user conversions too.
24023 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
24025 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
24027 (ExplicitUserConversion): Make it a call to UserDefinedConversion
24028 with the appropriate arguments.
24030 * cs-parser.jay (cast_expression): Record location too.
24032 * expression.cs (Cast): Record location info.
24034 (Expression::ConvertExplicit): Take location argument.
24036 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
24037 to determine if we are doing explicit conversions.
24039 (UserCast::Emit): Update accordingly.
24041 (Expression::ConvertExplicit): Report an error if everything fails.
24043 * ../errors/cs0030.cs : Add.
24045 2001-10-04 Miguel de Icaza <miguel@ximian.com>
24047 * modifiers.cs: If the ABSTRACT keyword is present, also set the
24048 virtual and newslot bits.
24050 * class.cs (TypeContainer::RegisterRequiredImplementations):
24051 Record methods we need.
24053 (TypeContainer::MakeKey): Helper function to make keys for
24054 MethodBases, since the Methodbase key is useless.
24056 (TypeContainer::Populate): Call RegisterRequiredImplementations
24057 before defining the methods.
24059 Create a mapping for method_builders_to_methods ahead of time
24060 instead of inside a tight loop.
24062 (::RequireMethods): Accept an object as the data to set into the
24063 hashtable so we can report interface vs abstract method mismatch.
24065 2001-10-03 Miguel de Icaza <miguel@ximian.com>
24067 * report.cs: Make all of it static.
24069 * rootcontext.cs: Drop object_type and value_type computations, as
24070 we have those in the TypeManager anyways.
24072 Drop report instance variable too, now it is a global.
24074 * driver.cs: Use try/catch on command line handling.
24076 Add --probe option to debug the error reporting system with a test
24079 * report.cs: Add support for exiting program when a probe
24080 condition is reached.
24082 2001-10-03 Ravi Pratap <ravi@ximian.com>
24084 * expression.cs (Binary::DoNumericPromotions): Fix the case when
24085 we do a forcible conversion regardless of type, to check if
24086 ForceConversion returns a null.
24088 (Binary::error19): Use location to report error.
24090 (Unary::error23): Use location here too.
24092 * ../errors/cs0019.cs : Check in.
24094 * ../errors/cs0023.cs : Check in.
24096 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
24097 case of a non-null MethodInfo object with a length of 0 !
24099 (Binary::ResolveOperator): Flag error if overload resolution fails to find
24100 an applicable member - according to the spec :-)
24101 Also fix logic to find members in base types.
24103 (Unary::ResolveOperator): Same here.
24105 (Unary::report23): Change name to error23 and make first argument a TypeContainer
24106 as I was getting thoroughly confused between this and error19 :-)
24108 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
24109 (::FindMostEncompassedType): Implement.
24110 (::FindMostEncompassingType): Implement.
24111 (::StandardConversionExists): Implement.
24113 (UserImplicitCast): Re-vamp. We now need info about most specific
24114 source and target types so that we can do the necessary conversions.
24116 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
24117 mathematical union with no duplicates.
24119 2001-10-03 Miguel de Icaza <miguel@ximian.com>
24121 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
24122 in order from base classes to child classes, so that we can in
24123 child classes look up in our parent for method names and
24124 attributes (required for handling abstract, virtual, new, override
24125 constructs: we need to instrospect our base class, and if we dont
24126 populate the classes in order, the introspection might be
24127 incorrect. For example, a method could query its parent before
24128 the parent has any methods and would determine that the parent has
24129 no abstract methods (while it could have had them)).
24131 (RootContext::CreateType): Record the order in which we define the
24134 2001-10-02 Miguel de Icaza <miguel@ximian.com>
24136 * class.cs (TypeContainer::Populate): Also method definitions can
24137 fail now, keep track of this.
24139 (TypeContainer::FindMembers): Implement support for
24140 DeclaredOnly/noDeclaredOnly flag.
24142 (Constructor::Emit) Return the ConstructorBuilder.
24144 (Method::Emit) Return the MethodBuilder.
24145 Check for abstract or virtual methods to be public.
24147 * rootcontext.cs (RootContext::CreateType): Register all the
24148 abstract methods required for the class to be complete and the
24149 interface methods that must be implemented.
24151 * cs-parser.jay: Report error 501 (method requires body if it is
24152 not marked abstract or extern).
24154 * expression.cs (TypeOf::Emit): Implement.
24156 * typemanager.cs: runtime_handle_type, new global type.
24158 * class.cs (Property::Emit): Generate code for properties.
24160 2001-10-02 Ravi Pratap <ravi@ximian.com>
24162 * expression.cs (Unary::ResolveOperator): Find operators on base type
24163 too - we now conform exactly to the spec.
24165 (Binary::ResolveOperator): Same here.
24167 * class.cs (Operator::Define): Fix minor quirk in the tests.
24169 * ../errors/cs0215.cs : Added.
24171 * ../errors/cs0556.cs : Added.
24173 * ../errors/cs0555.cs : Added.
24175 2001-10-01 Miguel de Icaza <miguel@ximian.com>
24177 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
24178 single integer which is really efficient
24180 2001-10-01 Ravi Pratap <ravi@ximian.com>
24182 * expression.cs (Expression::ImplicitUserConversion): Use location
24183 even in the case when we are examining True operators.
24185 * class.cs (Operator::Define): Perform extensive checks to conform
24186 with the rules for operator overloading in the spec.
24188 * expression.cs (Expression::ImplicitReferenceConversion): Implement
24189 some of the other conversions mentioned in the spec.
24191 * typemanager.cs (array_type): New static member for the System.Array built-in
24194 (cloneable_interface): For System.ICloneable interface.
24196 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
24197 we start resolving the tree and populating types.
24199 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
24201 2001-10-01 Miguel de Icaza <miguel@ximian.com>
24203 * expression.cs (Expression::ExprClassFromMemberInfo,
24204 Expression::Literalize): Create literal expressions from
24205 FieldInfos which are literals.
24207 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
24208 type casts, because they were wrong. The test suite in tests
24211 (ImplicitNumericConversion): ushort to ulong requires a widening
24214 Int32 constant to long requires widening cast as well.
24216 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
24217 for integers because the type on the stack is not i4.
24219 2001-09-30 Miguel de Icaza <miguel@ximian.com>
24221 * expression.cs (report118): require location argument.
24223 * parameter.cs: Do not dereference potential null value.
24225 * class.cs: Catch methods that lack the `new' keyword when
24226 overriding a name. Report warnings when `new' is used without
24227 anything being there to override.
24229 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
24231 * class.cs: Only add constructor to hashtable if it is non-null
24232 (as now constructors can fail on define).
24234 (TypeManager, Class, Struct): Take location arguments.
24236 Catch field instance initialization in structs as errors.
24238 accepting_filter: a new filter for FindMembers that is static so
24239 that we dont create an instance per invocation.
24241 (Constructor::Define): Catch errors where a struct constructor is
24244 * cs-parser.jay: Pass location information for various new
24247 * delegate.cs (Delegate): take a location argument.
24249 * driver.cs: Do not call EmitCode if there were problesm in the
24250 Definition of the types, as many Builders wont be there.
24252 * decl.cs (Decl::Decl): Require a location argument.
24254 * cs-tokenizer.cs: Handle properly hex constants that can not fit
24255 into integers, and find the most appropiate integer for it.
24257 * literal.cs: Implement ULongLiteral.
24259 * rootcontext.cs: Provide better information about the location of
24260 failure when CreateType fails.
24262 2001-09-29 Miguel de Icaza <miguel@ximian.com>
24264 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
24267 * expression.cs (Binary::CheckShiftArguments): Add missing type
24269 (Binary::ResolveOperator): Add type to the logical and and logical
24270 or, Bitwise And/Or and Exclusive Or code paths, it was missing
24273 (Binary::DoNumericPromotions): In the case where either argument
24274 is ulong (and most signed types combined with ulong cause an
24275 error) perform implicit integer constant conversions as well.
24277 2001-09-28 Miguel de Icaza <miguel@ximian.com>
24279 * expression.cs (UserImplicitCast): Method should always be
24281 (Invocation::BetterConversion): Simplified test for IntLiteral.
24283 (Expression::ImplicitNumericConversion): Split this routine out.
24284 Put the code that performs implicit constant integer conversions
24287 (Expression::Resolve): Become a wrapper around DoResolve so we can
24288 check eclass and type being set after resolve.
24290 (Invocation::Badness): Remove this dead function
24292 (Binary::ResolveOperator): Do not compute the expensive argumnets
24293 unless we have a union for it.
24295 (Probe::Emit): Is needs to do an isinst and then
24296 compare against null.
24298 (::CanConvert): Added Location argument. If the Location argument
24299 is null (Location.Null), then we do not report errors. This is
24300 used by the `probe' mechanism of the Explicit conversion. We do
24301 not want to generate an error for something that the user
24302 explicitly requested to be casted. But the pipeline for an
24303 explicit cast first tests for potential implicit casts.
24305 So for now, if the Location is null, it means `Probe only' to
24306 avoid adding another argument. Might have to revise this
24309 (ClassCast): New class used to type cast objects into arbitrary
24310 classes (used in Explicit Reference Conversions).
24312 Implement `as' as well.
24314 Reverted all the patches from Ravi below: they were broken:
24316 * The use of `level' as a mechanism to stop recursive
24317 invocations is wrong. That was there just to catch the
24318 bug with a strack trace but not as a way of addressing
24321 To fix the problem we have to *understand* what is going
24322 on and the interactions and come up with a plan, not
24323 just get things going.
24325 * The use of the type conversion cache that I proposed
24326 last night had an open topic: How does this work across
24327 protection domains. A user defined conversion might not
24328 be public in the location where we are applying the
24329 conversion, a different conversion might be selected
24330 (ie, private A->B (better) but public B->A (worse),
24331 inside A, A->B applies, but outside it, B->A will
24334 * On top of that (ie, even if the above is solved),
24335 conversions in a cache need to be abstract. Ie, `To
24336 convert from an Int to a Short use an OpcodeCast', not
24337 `To convert from an Int to a Short use the OpcodeCast on
24338 the variable 5' (which is what this patch was doing).
24340 2001-09-28 Ravi Pratap <ravi@ximian.com>
24342 * expression.cs (Invocation::ConversionExists): Re-write to use
24343 the conversion cache
24345 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
24346 cache all conversions done, not just user-defined ones.
24348 (Invocation::BetterConversion): The real culprit. Use ConversionExists
24349 to determine if a conversion exists instead of acutually trying to
24350 perform the conversion. It's faster too.
24352 (Expression::ConvertExplicit): Modify to use ConversionExists to check
24353 and only then attempt the implicit conversion.
24355 2001-09-28 Ravi Pratap <ravi@ximian.com>
24357 * expression.cs (ConvertImplicit): Use a cache for conversions
24358 already found. Check level of recursion and bail out if necessary.
24360 2001-09-28 Miguel de Icaza <miguel@ximian.com>
24362 * typemanager.cs (string_concat_string_string, string_concat_object_object):
24363 Export standard methods that we expect for string operations.
24365 * statement.cs (Block::UsageWarning): Track usage of variables and
24366 report the errors for not used variables.
24368 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
24371 2001-09-27 Miguel de Icaza <miguel@ximian.com>
24373 * codegen.cs: remove unnneded code
24375 * expression.cs: Removed BuiltinTypeAccess class
24377 Fix the order in which implicit conversions are
24380 The previous fixed dropped support for boxed conversions (adding a
24381 test to the test suite now)
24383 (UserImplicitCast::CanConvert): Remove test for source being null,
24384 that code is broken. We should not feed a null to begin with, if
24385 we do, then we should track the bug where the problem originates
24386 and not try to cover it up here.
24388 Return a resolved expression of type UserImplicitCast on success
24389 rather than true/false. Ravi: this is what I was talking about,
24390 the pattern is to use a static method as a "constructor" for
24393 Also, do not create arguments until the very last minute,
24394 otherwise we always create the arguments even for lookups that
24395 will never be performed.
24397 (UserImplicitCast::Resolve): Eliminate, objects of type
24398 UserImplicitCast are born in a fully resolved state.
24400 * typemanager.cs (InitCoreTypes): Init also value_type
24401 (System.ValueType).
24403 * expression.cs (Cast::Resolve): First resolve the child expression.
24405 (LValue): Add new method AddressOf to be used by
24408 Change the argument of Store to take an EmitContext instead of an
24409 ILGenerator, because things like FieldExpr need to be able to call
24410 their children expression to generate the instance code.
24412 (Expression::Error, Expression::Warning): Sugar functions for
24415 (Expression::MemberLookup): Accept a TypeContainer instead of a
24416 Report as the first argument.
24418 (Expression::ResolvePrimary): Killed. I still want to improve
24419 this as currently the code is just not right.
24421 (Expression::ResolveMemberAccess): Simplify, but it is still
24424 (Unary::Resolve): Catch errors in AddressOf operators.
24426 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
24427 index to a byte for the short-version, or the compiler will choose
24428 the wrong Emit call, which generates the wrong data.
24430 (ParameterReference::Emit, ::Store): same.
24432 (FieldExpr::AddressOf): Implement.
24434 * typemanager.cs: TypeManager: made public variable instead of
24437 * driver.cs: document --fatal.
24439 * report.cs (ErrorMessage, WarningMessage): new names for the old
24440 Error and Warning classes.
24442 * cs-parser.jay (member_access): Turn built-in access to types
24443 into a normal simplename
24445 2001-09-27 Ravi Pratap <ravi@ximian.com>
24447 * expression.cs (Invocation::BetterConversion): Fix to cope
24448 with q being null, since this was introducing a bug.
24450 * expression.cs (ConvertImplicit): Do built-in conversions first.
24452 2001-09-27 Ravi Pratap <ravi@ximian.com>
24454 * expression.cs (UserImplicitCast::Resolve): Fix bug.
24456 2001-09-27 Ravi Pratap <ravi@ximian.com>
24458 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
24459 I had introduced long ago (what's new ?).
24461 * expression.cs (UserImplicitCast::CanConvert): Static method to do
24462 the work of all the checking.
24463 (ConvertImplicit): Call CanConvert and only then create object if necessary.
24464 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
24466 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
24467 that is the right way.
24469 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
24470 overloading resolution. Use everywhere instead of cutting and pasting code.
24472 (Binary::ResolveOperator): Use MakeUnionSet.
24474 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
24475 we have to convert to bool types. Not complete yet.
24477 2001-09-27 Miguel de Icaza <miguel@ximian.com>
24479 * typemanager.cs (TypeManager::CSharpName): support ushort.
24481 * expression.cs (Expression::TryImplicitIntConversion): Attempts
24482 to provide an expression that performsn an implicit constant int
24483 conversion (section 6.1.6).
24484 (Expression::ConvertImplicitRequired): Reworked to include
24485 implicit constant expression conversions.
24487 (Expression::ConvertNumericExplicit): Finished.
24489 (Invocation::Emit): If InstanceExpression is null, then it means
24490 that we perform a call on this.
24492 2001-09-26 Miguel de Icaza <miguel@ximian.com>
24494 * expression.cs (Unary::Emit): Remove some dead code.
24495 (Probe): Implement Resolve and Emit for `is'.
24496 (Expression::ConvertImplicitRequired): Attempt to do constant
24497 expression conversions here. Maybe should be moved to
24498 ConvertImplicit, but I am not sure.
24499 (Expression::ImplicitLongConstantConversionPossible,
24500 Expression::ImplicitIntConstantConversionPossible): New functions
24501 that tell whether is it possible to apply an implicit constant
24502 expression conversion.
24504 (ConvertNumericExplicit): Started work on explicit numeric
24507 * cs-parser.jay: Update operator constants.
24509 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
24510 (Parameters::GetSignature): Hook up VerifyArgs here.
24511 (Parameters::VerifyArgs): Verifies that no two arguments have the
24514 * class.cs (Operator): Update the operator names to reflect the
24515 ones that the spec expects (as we are just stringizing the
24518 * expression.cs (Unary::ResolveOperator): Fix bug: Use
24519 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
24520 previous usage did only work for our methods.
24521 (Expression::ConvertImplicit): Handle decimal implicit numeric
24522 conversions as well.
24523 (Expression::InternalTypeConstructor): Used to invoke constructors
24524 on internal types for default promotions.
24526 (Unary::Emit): Implement special handling for the pre/post
24527 increment/decrement for overloaded operators, as they need to have
24528 the same semantics as the other operators.
24530 (Binary::ResolveOperator): ditto.
24531 (Invocation::ConversionExists): ditto.
24532 (UserImplicitCast::Resolve): ditto.
24534 2001-09-26 Ravi Pratap <ravi@ximian.com>
24536 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
24537 operator, return after emitting body. Regression tests pass again !
24539 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
24540 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
24541 (Invocation::OverloadResolve): Ditto.
24542 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
24544 * everywhere : update calls to the above methods accordingly.
24546 2001-09-26 Miguel de Icaza <miguel@ximian.com>
24548 * assign.cs (Assign): Make it inherit from ExpressionStatement.
24550 * expression.cs (ExpressionStatement): New base class used for
24551 expressions that can appear in statements, so that we can provide
24552 an alternate path to generate expression that do not leave a value
24555 (Expression::Emit, and all the derivatives): We no longer return
24556 whether a value is left on the stack or not. Every expression
24557 after being emitted leaves a single value on the stack.
24559 * codegen.cs (EmitContext::EmitStatementExpression): Use the
24560 facilties of ExpressionStatement if possible.
24562 * cs-parser.jay: Update statement_expression.
24564 2001-09-25 Miguel de Icaza <miguel@ximian.com>
24566 * driver.cs: Change the wording of message
24568 2001-09-25 Ravi Pratap <ravi@ximian.com>
24570 * expression.cs (Binary::ResolveOperator): Had forgottten to set
24571 the type of the expression to the return type of the method if
24572 we have an overloaded operator match ! The regression tests pass again !
24573 (Unary::ResolveOperator): Ditto.
24575 * expression.cs (Invocation::ConversionExists): Correct the member lookup
24576 to find "op_Implicit", not "implicit" ;-)
24577 (UserImplicitCast): New class to take care of user-defined implicit conversions.
24578 (ConvertImplicit, ForceConversion): Take TypeContainer argument
24580 * everywhere : Correct calls to the above accordingly.
24582 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
24583 (ConvertImplicit): Do user-defined conversion if it exists.
24585 2001-09-24 Miguel de Icaza <miguel@ximian.com>
24587 * assign.cs: track location.
24588 (Resolve): Use implicit conversions on assignment.
24590 * literal.cs: Oops. Not good, Emit of short access values should
24591 pass (Bytes) or the wrong argument will be selected.
24593 * expression.cs (Unary::Emit): Emit code for -expr.
24595 (Unary::ResolveOperator): Handle `Substract' for non-constants
24596 (substract from zero from the non-constants).
24597 Deal with Doubles as well.
24599 (Expression::ConvertImplicitRequired): New routine that reports an
24600 error if no implicit conversion exists.
24602 (Invocation::OverloadResolve): Store the converted implicit
24603 expressions if we make them
24605 2001-09-24 Ravi Pratap <ravi@ximian.com>
24607 * class.cs (ConstructorInitializer): Take a Location argument.
24608 (ConstructorBaseInitializer): Same here.
24609 (ConstructorThisInitializer): Same here.
24611 * cs-parser.jay : Update all calls accordingly.
24613 * expression.cs (Unary, Binary, New): Take location argument.
24614 Update accordingly everywhere.
24616 * cs-parser.jay : Update all calls to the above to take a location
24619 * class.cs : Ditto.
24621 2001-09-24 Ravi Pratap <ravi@ximian.com>
24623 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
24624 (Invocation::BetterConversion): Same here
24625 (Invocation::ConversionExists): Ditto.
24627 (Invocation::ConversionExists): Implement.
24629 2001-09-22 Ravi Pratap <ravi@ximian.com>
24631 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
24632 Also take an additional TypeContainer argument.
24634 * All over : Pass in TypeContainer as argument to OverloadResolve.
24636 * typemanager.cs (CSharpName): Update to check for the string type and return
24639 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
24642 2001-09-21 Ravi Pratap <ravi@ximian.com>
24644 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
24645 (Invocation::BetterFunction): Implement.
24646 (Invocation::BetterConversion): Implement.
24647 (Invocation::ConversionExists): Skeleton, no implementation yet.
24649 Okay, things work fine !
24651 2001-09-21 Miguel de Icaza <miguel@ximian.com>
24653 * typemanager.cs: declare and load enum_type, delegate_type and
24656 * expression.cs (Expression::Emit): Now emit returns a value that
24657 tells whether a value is left on the stack or not. This strategy
24658 might be reveted tomorrow with a mechanism that would address
24659 multiple assignments.
24660 (Expression::report118): Utility routine to report mismatches on
24663 (Unary::Report23): Report impossible type/operator combination
24666 (Unary::IsIncrementableNumber): Whether the type can be
24667 incremented or decremented with add.
24668 (Unary::ResolveOperator): Also allow enumerations to be bitwise
24670 (Unary::ResolveOperator): Implement ++, !, ~,
24672 (Invocation::Emit): Deal with new Emit convetion.
24674 * All Expression derivatives: Updated their Emit method to return
24675 whether they leave values on the stack or not.
24677 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
24678 stack for expressions that are statements.
24680 2001-09-20 Miguel de Icaza <miguel@ximian.com>
24682 * expression.cs (LValue): New interface. Must be implemented by
24684 (LocalVariableReference, ParameterReference, FieldExpr): Implement
24687 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
24688 interface for generating code, simplifies the code.
24690 2001-09-20 Ravi Pratap <ravi@ximian.com>
24692 * expression.cs (everywhere): Comment out return statements in ::Resolve
24693 methods to avoid the warnings.
24695 2001-09-20 Miguel de Icaza <miguel@ximian.com>
24697 * driver.cs (parse): Report error 2001 if we can not open the
24700 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
24703 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
24706 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
24707 otherwise nested blocks end up with the same index.
24709 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
24711 * expression.cs: Instead of having FIXMEs in the Resolve
24712 functions, throw exceptions so it is obvious that we are facing a
24715 * cs-parser.jay (invocation_expression): Pass Location information.
24717 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
24718 Use a basename for those routines because .NET does not like paths
24721 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
24724 2001-09-19 Miguel de Icaza <miguel@ximian.com>
24726 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
24727 are loading the correct data types (throws an exception if not).
24728 (TypeManager::InitCoreTypes): Use CoreLookupType
24730 * expression.cs (Unary::ResolveOperator): return the child
24731 expression for expressions which are just +expr.
24732 (Unary::ResolveOperator): Return negative literals for -LITERAL
24733 expressions (otherwise they are Unary {Literal}).
24734 (Invocation::Badness): Take into account `Implicit constant
24735 expression conversions'.
24737 * literal.cs (LongLiteral): Implement long literal class.
24738 (IntLiteral): export the `Value' of the intliteral.
24740 2001-09-19 Ravi Pratap <ravi@ximian.com>
24742 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
24744 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
24745 instead of 'Operator'
24747 * expression.cs (Binary::ResolveOperator): Update accordingly.
24748 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
24751 * cs-parser.jay (unary_expression): Update to use the new names.
24753 * gen-treedump.cs (GetUnary): Same here.
24755 * expression.cs (Unary::Resolve): Implement.
24756 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
24757 operators are found instead of making noise ;-)
24758 (Unary::ResolveOperator): New method to do precisely the same thing which
24759 Binary::ResolveOperator does for Binary expressions.
24760 (Unary.method, .Arguments): Add.
24761 (Unary::OperName): Implement.
24762 (Unary::ForceConversion): Copy and Paste !
24764 * class.cs (Operator::Define): Fix a small bug for the case when we have
24767 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
24768 for the inbuilt operators. Only overloading works for now ;-)
24770 2001-09-18 Miguel de Icaza <miguel@ximian.com>
24772 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
24773 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
24775 * expression.cs (This::Emit): Implement.
24776 (This::Resolve): Implement.
24777 (TypeOf:Resolve): Implement.
24778 (Expression::ResolveSimpleName): Add an implicit this to instance
24780 (MemberAccess::Resolve): Deal with Parameters and Fields.
24781 Bind instance variable to Field expressions.
24782 (FieldExpr::Instance): New field used to track the expression that
24783 represents the object instance.
24784 (FieldExpr::Resolve): Track potential errors from MemberLookup not
24786 (FieldExpr::Emit): Implement.
24788 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
24789 the last instruction contains a return opcode to avoid generating
24790 the last `ret' instruction (this generates correct code, and it is
24791 nice to pass the peverify output).
24793 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
24794 initializer for static and instance variables.
24795 (Constructor::Emit): Allow initializer to be null in the case of
24796 static constructors. Only emit initializer for instance
24799 (TypeContainer::FindMembers): Return a null array if there are no
24802 Also fix the code for the MemberTypes.Method branch, as it was not
24803 scanning that for operators (or tried to access null variables before).
24805 * assign.cs (Assign::Emit): Handle instance and static fields.
24809 * driver.cs: Stop compilation if there are parse errors.
24811 * cs-parser.jay (constructor_declaration): Provide default base
24812 initializer for non-static constructors.
24813 (constructor_declarator): Do not provide a default base
24814 initializers if none was specified.
24815 Catch the fact that constructors should not have parameters.
24817 * class.cs: Do not emit parent class initializers for static
24818 constructors, that should be flagged as an error.
24820 2001-09-18 Ravi Pratap <ravi@ximian.com>
24822 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
24823 Move back code into TypeContainer::Populate.
24825 2001-09-18 Ravi Pratap <ravi@ximian.com>
24827 * class.cs (TypeContainer::AddConstructor): Fix the check to
24828 compare against Name, not Basename.
24829 (Operator::OpType): Change Plus and Minus to Add and Subtract.
24831 * cs-parser.jay : Update accordingly.
24833 * class.cs (TypeContainer::FindMembers): For the case where we are searching
24834 for methods, don't forget to look into the operators too.
24835 (RegisterMethodBuilder): Helper method to take care of this for
24836 methods, constructors and operators.
24837 (Operator::Define): Completely revamp.
24838 (Operator.OperatorMethod, MethodName): New fields.
24839 (TypeContainer::Populate): Move the registering of builders into
24840 RegisterMethodBuilder.
24841 (Operator::Emit): Re-write.
24843 * expression.cs (Binary::Emit): Comment out code path to emit method
24844 invocation stuff for the case when we have a user defined operator. I am
24845 just not able to get it right !
24847 2001-09-17 Miguel de Icaza <miguel@ximian.com>
24849 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
24852 (Expression::MemberLookup): Provide a version that allows to
24853 specify the MemberTypes and BindingFlags.
24855 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
24856 so it was not fetching variable information from outer blocks.
24858 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
24859 Beforefieldinit as it was buggy.
24861 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
24862 that Ravi put here.
24864 * class.cs (Constructor::Emit): Only emit if block is not null.
24865 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
24866 deal with this by semantically definining it as if the user had
24869 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
24870 constructors as we now "emit" them at a higher level.
24872 (TypeContainer::DefineDefaultConstructor): Used to define the
24873 default constructors if none was provided.
24875 (ConstructorInitializer): Add methods Resolve and Emit.
24877 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
24879 2001-09-17 Ravi Pratap <ravi@ximian.com>
24881 * class.cs (TypeContainer::EmitDefaultConstructor): Register
24882 the default constructor builder with our hashtable for methodbuilders
24885 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24886 and argument_count is 0 in which case we have a match.
24887 (Binary::ResolveOperator): More null checking and miscellaneous coding
24890 2001-09-17 Ravi Pratap <ravi@ximian.com>
24892 * rootcontext.cs (IsNameSpace): Compare against null.
24894 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24896 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24897 and Unary::Operator.
24899 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24902 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24903 we have overloaded operators.
24904 (Binary::ResolveOperator): Implement the part which does the operator overload
24907 * class.cs (Operator::Emit): Implement.
24908 (TypeContainer::Emit): Emit the operators we have too.
24910 * expression.cs (Binary::Emit): Update to emit the appropriate code for
24911 the case when we have a user-defined operator.
24913 2001-09-17 Miguel de Icaza <miguel@ximian.com>
24915 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24917 2001-09-16 Ravi Pratap <ravi@ximian.com>
24919 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24920 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24921 (Constructor::Emit): Implement.
24922 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24923 if we have no work to do.
24924 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
24927 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24928 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24930 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24933 2001-09-15 Ravi Pratap <ravi@ximian.com>
24935 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24937 (Tree::RecordNamespace): Method to do what the name says ;-)
24938 (Tree::Namespaces): Property to get at the namespaces hashtable.
24940 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
24943 * rootcontext.cs (IsNamespace): Fixed it :-)
24945 2001-09-14 Miguel de Icaza <miguel@ximian.com>
24947 * class.cs (TypeContainer::FindMembers): Add support for
24949 (MethodCore): New class that encapsulates both the shared aspects
24950 of a Constructor and a Method.
24951 (Method, Constructor): Factored pieces into MethodCore.
24953 * driver.cs: Added --fatal which makes errors throw exceptions.
24954 Load System assembly as well as part of the standard library.
24956 * report.cs: Allow throwing exceptions on errors for debugging.
24958 * modifiers.cs: Do not use `parent', instead use the real type
24959 container to evaluate permission settings.
24961 * class.cs: Put Ravi's patch back in. He is right, and we will
24962 have to cope with the
24964 2001-09-14 Ravi Pratap <ravi@ximian.com>
24966 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
24967 FamORAssem, not FamANDAssem.
24969 2001-09-14 Miguel de Icaza <miguel@ximian.com>
24971 * driver.cs: Added --parse option that only parses its input files
24974 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
24975 incorrect. IsTopLevel is not used to tell whether an object is
24976 root_types or not (that can be achieved by testing this ==
24977 root_types). But to see if this is a top-level *class* (not
24978 necessarly our "toplevel" container).
24980 2001-09-14 Ravi Pratap <ravi@ximian.com>
24982 * enum.cs (Enum::Define): Modify to call the Lookup method on the
24983 parent instead of a direct call to GetType.
24985 2001-09-14 Ravi Pratap <ravi@ximian.com>
24987 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
24988 Modifiers.TypeAttr. This should just be a call to that method.
24990 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
24991 object so that we can determine if we are top-level or not.
24993 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
24996 * enum.cs (Enum::Define): Ditto.
24998 * modifiers.cs (FieldAttr): Re-write.
25000 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
25001 (TypeContainer::HaveStaticConstructor): New property to provide access
25002 to precisely that info.
25004 * modifiers.cs (MethodAttr): Re-write.
25005 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
25007 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
25008 of top-level types as claimed.
25010 2001-09-13 Miguel de Icaza <miguel@ximian.com>
25012 * expression.cs (MemberLookup): Fruitless attempt to lookup
25013 constructors. Maybe I need to emit default constructors? That
25014 might be it (currently .NET emits this for me automatically).
25015 (Invocation::OverloadResolve): Cope with Arguments == null.
25016 (Invocation::EmitArguments): new function, shared by the new
25017 constructor and us.
25018 (Invocation::Emit): Handle static and instance methods. Emit
25019 proper call instruction for virtual or non-virtual invocations.
25020 (New::Emit): Implement.
25021 (New::Resolve): Implement.
25022 (MemberAccess:Resolve): Implement.
25023 (MethodGroupExpr::InstanceExpression): used conforming to the spec
25024 to track instances.
25025 (FieldExpr::Resolve): Set type.
25027 * support.cs: Handle empty arguments.
25029 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
25030 SimpleLookup): Auxiliary routines to help parse a qualifier
25033 Update qualifier_identifier rule.
25035 * codegen.cs: Removed debugging messages.
25037 * class.cs: Make this a global thing, this acts just as a "key" to
25038 objects that we might have around.
25040 (Populate): Only initialize method_builders_to_methods once.
25042 * expression.cs (PropertyExpr): Initialize type from the
25045 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
25046 Resolve pattern. Attempt to implicitly convert value to boolean.
25049 * expression.cs: Set the type for the int32/int32 argument case.
25050 (Binary::ResolveOperator): Set the return type to boolean for
25051 comparission operators
25053 * typemanager.cs: Remove debugging print code.
25055 (Invocation::Resolve): resolve type.
25057 * class.cs: Allocate a MemberInfo of the correct size, as the code
25058 elsewhere depends on the test to reflect the correct contents.
25060 (Method::) Keep track of parameters, due to System.Reflection holes
25062 (TypeContainer::Populate): Keep track of MethodBuilders to Method
25065 (TypeContainer::FindMembers): Use ArrayList and then copy an array
25066 of the exact size and return that.
25068 (Class::LookupMethodByBuilder): New function that maps
25069 MethodBuilders to its methods. Required to locate the information
25070 on methods because System.Reflection bit us again.
25072 * support.cs: New file, contains an interface ParameterData and
25073 two implementations: ReflectionParameters and InternalParameters
25074 used to access Parameter information. We will need to grow this
25077 * expression.cs (Invocation::GetParameterData): implement a cache
25078 and a wrapper around the ParameterData creation for methods.
25079 (Invocation::OverloadResolve): Use new code.
25081 2001-09-13 Ravi Pratap <ravi@ximian.com>
25083 * class.cs (TypeContainer::EmitField): Remove and move into
25084 (Field::Define): here and modify accordingly.
25085 (Field.FieldBuilder): New member.
25086 (TypeContainer::Populate): Update accordingly.
25087 (TypeContainer::FindMembers): Implement.
25089 2001-09-13 Miguel de Icaza <miguel@ximian.com>
25091 * statement.cs: (VariableInfo::VariableType): New field to be
25092 initialized with the full type once it is resolved.
25094 2001-09-12 Miguel de Icaza <miguel@ximian.com>
25096 * parameter.cs (GetParameterInfo): Use a type cache to compute
25097 things only once, and to reuse this information
25099 * expression.cs (LocalVariableReference::Emit): Implement.
25100 (OpcodeCast::Emit): fix.
25102 (ParameterReference::Resolve): Implement.
25103 (ParameterReference::Emit): Implement.
25105 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
25106 that are expressions need to stay as Expressions.
25108 * typemanager.cs (CSharpName): Returns the C# name of a type if
25111 * expression.cs (Expression::ConvertImplicit): New function that
25112 implements implicit type conversions.
25114 (Expression::ImplicitReferenceConversion): Implements implicit
25115 reference conversions.
25117 (EmptyCast): New type for transparent casts.
25119 (OpcodeCast): New type for casts of types that are performed with
25120 a sequence of bytecodes.
25122 (BoxedCast): New type used for casting value types into reference
25123 types. Emits a box opcode.
25125 (Binary::DoNumericPromotions): Implements numeric promotions of
25126 and computation of the Binary::Type.
25128 (Binary::EmitBranchable): Optimization.
25130 (Binary::Emit): Implement code emission for expressions.
25132 * typemanager.cs (TypeManager): Added two new core types: sbyte
25135 2001-09-12 Ravi Pratap <ravi@ximian.com>
25137 * class.cs (TypeContainer::FindMembers): Method which does exactly
25138 what Type.FindMembers does, only we don't have to use reflection. No
25139 implementation yet.
25141 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
25142 typecontainer objects as we need to get at them.
25143 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
25145 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
25146 typecontainer object.
25148 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
25149 of just a Report object.
25151 2001-09-11 Ravi Pratap <ravi@ximian.com>
25153 * class.cs (Event::Define): Go back to using the prefixes "add_" and
25155 (TypeContainer::Populate): Now define the delegates of the type too.
25156 (TypeContainer.Delegates): Property to access the list of delegates defined
25159 * delegates.cs (Delegate::Define): Implement partially.
25161 * modifiers.cs (TypeAttr): Handle more flags.
25163 2001-09-11 Ravi Pratap <ravi@ximian.com>
25165 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
25167 (Operator::Define): Re-write logic to get types by using the LookupType method
25168 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
25169 (Indexer::Define): Ditto.
25170 (Event::Define): Ditto.
25171 (Property::Define): Ditto.
25173 2001-09-10 Ravi Pratap <ravi@ximian.com>
25175 * class.cs (TypeContainer::Populate): Now define operators too.
25176 (TypeContainer.Operators): New property to access the list of operators
25178 (Operator.OperatorMethodBuilder): New member to hold the method builder
25179 for the operator we are defining.
25180 (Operator::Define): Implement.
25182 2001-09-10 Ravi Pratap <ravi@ximian.com>
25184 * class.cs (Event::Define): Make the prefixes of the accessor methods
25185 addOn_ and removeOn_
25187 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
25188 of the location being passed in too. Ideally, this should go later since all
25189 error reporting should be done through the Report object.
25191 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
25192 (Populate): Iterate thru the indexers we have and define them too.
25193 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
25194 for the get and set accessors.
25195 (Indexer::Define): Implement.
25197 2001-09-09 Miguel de Icaza <miguel@ximian.com>
25199 * expression.cs (Binary::Resolve): Beginning of it. I scratched
25200 my previous implementation, did not work.
25202 * typemanager.cs: Add a couple of missing types (the longs).
25204 * literal.cs: Use TypeManager.bool_type instead of getting it.
25206 * expression.cs (EventExpr): New kind of expressions.
25207 (Expressio::ExprClassFromMemberInfo): finish
25209 2001-09-08 Miguel de Icaza <miguel@ximian.com>
25211 * assign.cs: Emit stores to static fields differently.
25213 2001-09-08 Ravi Pratap <ravi@ximian.com>
25215 * Merge in changes and adjust code to tackle conflicts. Backed out my
25216 code in Assign::Resolve ;-)
25218 2001-09-08 Ravi Pratap <ravi@ximian.com>
25220 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
25221 instead Report.Error and also pass in the location.
25222 (CSharpParser::Lexer): New readonly property to return the reference
25223 to the Tokenizer object.
25224 (declare_local_variables): Use Report.Error with location instead of plain
25228 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
25229 (Operator.CheckBinaryOperator): Ditto.
25231 * cs-parser.jay (operator_declarator): Update accordingly.
25233 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
25234 (CheckBinaryOperator): Same here.
25236 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
25237 on the name without any prefixes of namespace names etc. This is because we
25238 already might have something already fully qualified like
25239 'System.Console.WriteLine'
25241 * assign.cs (Resolve): Begin implementation. Stuck ;-)
25243 2001-09-07 Ravi Pratap <ravi@ximian.com>
25245 * cs-tokenizer.cs (location): Return a string which also contains
25248 * expression.cs (ElementAccess): New class for expressions of the
25249 type 'element access.'
25250 (BaseAccess): New class for expressions of the type 'base access.'
25251 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
25254 * cs-parser.jay (element_access): Implement action.
25255 (base_access): Implement actions.
25256 (checked_expression, unchecked_expression): Implement.
25258 * cs-parser.jay (local_variable_type): Correct and implement.
25259 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
25261 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
25263 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
25264 name and the specifiers.
25266 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
25268 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
25269 making them all public ;-)
25271 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
25274 2001-09-07 Miguel de Icaza <miguel@ximian.com>
25276 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
25278 (FieldExpr, PropertyExprs): New resolved expressions.
25279 (SimpleName::MemberStaticCheck): Perform static checks for access
25280 to non-static fields on static methods. Maybe this should be
25281 generalized for MemberAccesses.
25282 (SimpleName::ResolveSimpleName): More work on simple name
25285 * cs-parser.jay (primary_expression/qualified_identifier): track
25286 the parameter index.
25288 * codegen.cs (CodeGen::Save): Catch save exception, report error.
25289 (EmitContext::EmitBoolExpression): Chain to expression generation
25290 instead of temporary hack.
25291 (::EmitStatementExpression): Put generic expression code generation.
25293 * assign.cs (Assign::Emit): Implement variable assignments to
25294 local variables, parameters and fields.
25296 2001-09-06 Miguel de Icaza <miguel@ximian.com>
25298 * statement.cs (Block::GetVariableInfo): New method, returns the
25299 VariableInfo for a variable name in a block.
25300 (Block::GetVariableType): Implement in terms of GetVariableInfo
25302 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
25303 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
25305 2001-09-06 Ravi Pratap <ravi@ximian.com>
25307 * cs-parser.jay (operator_declaration): Continue on my quest : update
25308 to take attributes argument.
25309 (event_declaration): Ditto.
25310 (enum_declaration): Ditto.
25311 (indexer_declaration): Ditto.
25313 * class.cs (Operator::Operator): Update constructor accordingly.
25314 (Event::Event): Ditto.
25316 * delegate.cs (Delegate::Delegate): Same here.
25318 * enum.cs (Enum::Enum): Same here.
25320 2001-09-05 Ravi Pratap <ravi@ximian.com>
25322 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
25324 * ../tests/cs0658.cs : New file to demonstrate error 0658.
25326 * attribute.cs (Attributes): New class to encapsulate all attributes which were
25327 being passed around as an arraylist.
25328 (Attributes::AddAttribute): Method to add attribute sections.
25330 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
25331 (struct_declaration): Update accordingly.
25332 (constant_declaration): Update.
25333 (field_declaration): Update.
25334 (method_header): Update.
25335 (fixed_parameter): Update.
25336 (parameter_array): Ditto.
25337 (property_declaration): Ditto.
25338 (destructor_declaration): Ditto.
25340 * class.cs (Struct::Struct): Update constructors accordingly.
25341 (Class::Class): Ditto.
25342 (Field::Field): Ditto.
25343 (Method::Method): Ditto.
25344 (Property::Property): Ditto.
25345 (TypeContainer::OptAttribute): update property's return type.
25347 * interface.cs (Interface.opt_attributes): New member.
25348 (Interface::Interface): Update to take the extra Attributes argument.
25350 * parameter.cs (Parameter::Parameter): Ditto.
25352 * constant.cs (Constant::Constant): Ditto.
25354 * interface.cs (InterfaceMemberBase): New OptAttributes field.
25355 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
25356 the attributes as a parameter.
25357 (InterfaceProperty): Update constructor call.
25358 (InterfaceEvent): Ditto.
25359 (InterfaceMethod): Ditto.
25360 (InterfaceIndexer): Ditto.
25362 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
25363 pass the attributes too.
25364 (interface_event_declaration): Ditto.
25365 (interface_property_declaration): Ditto.
25366 (interface_method_declaration): Ditto.
25367 (interface_declaration): Ditto.
25369 2001-09-05 Miguel de Icaza <miguel@ximian.com>
25371 * class.cs (Method::Define): Track the "static Main" definition to
25372 create an entry point.
25374 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
25375 EntryPoint if we find it.
25377 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
25378 (EmitContext::ig): Make this variable public.
25380 * driver.cs: Make the default output file be the first file name
25381 with the .exe extension.
25383 Detect empty compilations
25385 Handle various kinds of output targets. Handle --target and
25386 rename -t to --dumper.
25388 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
25389 methods inherited from Expression return now an Expression. This
25390 will is used during the tree rewriting as we resolve them during
25393 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
25394 the spec. Missing entirely is the information about
25395 accessability of elements of it.
25397 (Expression::ExprClassFromMemberInfo): New constructor for
25398 Expressions that creates a fully initialized Expression based on
25399 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
25402 (Invocation::Resolve): Begin implementing resolution of invocations.
25404 * literal.cs (StringLiteral): Implement Emit.
25406 2001-09-05 Ravi Pratap <ravi@ximian.com>
25408 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
25411 2001-09-04 Ravi Pratap <ravi@ximian.com>
25413 * cs-parser.jay (attribute_arguments): Implement actions.
25414 (attribute): Fix bug in production. Implement action.
25415 (attribute_list): Implement.
25416 (attribute_target): Implement.
25417 (attribute_target_specifier, opt_target_specifier): Implement
25418 (CheckAttributeTarget): New method to check if the attribute target
25420 (attribute_section): Implement.
25421 (opt_attributes): Implement.
25423 * attribute.cs : New file to handle attributes.
25424 (Attribute): Class to hold attribute info.
25426 * cs-parser.jay (opt_attribute_target_specifier): Remove production
25427 (attribute_section): Modify production to use 2 different rules to
25428 achieve the same thing. 1 s/r conflict down !
25429 Clean out commented, useless, non-reducing dimension_separator rules.
25431 * class.cs (TypeContainer.attributes): New member to hold list
25432 of attributes for a type.
25433 (Struct::Struct): Modify to take one more argument, the attribute list.
25434 (Class::Class): Ditto.
25435 (Field::Field): Ditto.
25436 (Method::Method): Ditto.
25437 (Property::Property): Ditto.
25439 * cs-parser.jay (struct_declaration): Update constructor call to
25440 pass in the attributes too.
25441 (class_declaration): Ditto.
25442 (constant_declaration): Ditto.
25443 (field_declaration): Ditto.
25444 (method_header): Ditto.
25445 (fixed_parameter): Ditto.
25446 (parameter_array): Ditto.
25447 (property_declaration): Ditto.
25449 * constant.cs (Constant::Constant): Update constructor similarly.
25450 Use System.Collections.
25452 * parameter.cs (Parameter::Parameter): Update as above.
25454 2001-09-02 Ravi Pratap <ravi@ximian.com>
25456 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
25457 (TypeContainer.delegates): New member to hold list of delegates.
25459 * cs-parser.jay (delegate_declaration): Implement the action correctly
25460 this time as I seem to be on crack ;-)
25462 2001-09-02 Miguel de Icaza <miguel@ximian.com>
25464 * rootcontext.cs (RootContext::IsNamespace): new function, used to
25465 tell whether an identifier represents a namespace.
25467 * expression.cs (NamespaceExpr): A namespace expression, used only
25468 temporarly during expression resolution.
25469 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
25470 utility functions to resolve names on expressions.
25472 2001-09-01 Miguel de Icaza <miguel@ximian.com>
25474 * codegen.cs: Add hook for StatementExpressions.
25476 * class.cs: Fix inverted test for static flag in methods.
25478 2001-09-02 Ravi Pratap <ravi@ximian.com>
25480 * class.cs (Operator::CheckUnaryOperator): Correct error number used
25481 to make it coincide with MS' number.
25482 (Operator::CheckBinaryOperator): Ditto.
25484 * ../errors/errors.txt : Remove error numbers added earlier.
25486 * ../errors/cs1019.cs : Test case for error # 1019
25488 * ../errros/cs1020.cs : Test case for error # 1020
25490 * cs-parser.jay : Clean out commented cruft.
25491 (dimension_separators, dimension_separator): Comment out. Ostensibly not
25492 used anywhere - non-reducing rule.
25493 (namespace_declarations): Non-reducing rule - comment out.
25495 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
25496 with TypeContainer::AddEnum.
25498 * delegate.cs : New file for delegate handling classes.
25499 (Delegate): Class for declaring delegates.
25501 * makefile : Update.
25503 * cs-parser.jay (delegate_declaration): Implement.
25505 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
25507 * class.cs (Event::Define): Implement.
25508 (Event.EventBuilder): New member.
25510 * class.cs (TypeContainer::Populate): Update to define all enums and events
25512 (Events): New property for the events arraylist we hold. Shouldn't we move to using
25513 readonly fields for all these cases ?
25515 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
25517 * class.cs (Property): Revamp to use the convention of making fields readonly.
25518 Accordingly modify code elsewhere.
25520 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
25521 the Define method of the Property class.
25523 * class.cs : Clean up applied patch and update references to variables etc. Fix
25525 (TypeContainer::Populate): Update to define all the properties we have. Also
25526 define all enumerations.
25528 * enum.cs (Define): Implement.
25530 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
25532 * cs-parser.jay (overloadable_operator): The semantic value is an
25533 enum of the Operator class.
25534 (operator_declarator): Implement actions.
25535 (operator_declaration): Implement.
25537 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
25538 validity of definitions.
25539 (Operator::CheckBinaryOperator): Static method to check for binary operators
25540 (TypeContainer::AddOperator): New method to add an operator to a type.
25542 * cs-parser.jay (indexer_declaration): Added line to actually call the
25543 AddIndexer method so it gets added ;-)
25545 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
25546 already taken care of by the MS compiler ?
25548 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
25550 * class.cs (Operator): New class for operator declarations.
25551 (Operator::OpType): Enum for the various operators.
25553 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
25555 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
25556 ostensibly handle this in semantic analysis.
25558 * cs-parser.jay (general_catch_clause): Comment out
25559 (specific_catch_clauses, specific_catch_clause): Ditto.
25560 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
25561 (catch_args, opt_catch_args): New productions.
25562 (catch_clause): Rewrite to use the new productions above
25563 (catch_clauses): Modify accordingly.
25564 (opt_catch_clauses): New production to use in try_statement
25565 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
25566 and re-write the code in the actions to extract the specific and
25567 general catch clauses by being a little smart ;-)
25569 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
25570 Hooray, try and catch statements parse fine !
25572 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
25574 * statement.cs (Block::GetVariableType): Fix logic to extract the type
25575 string from the hashtable of variables.
25577 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
25578 I end up making that mistake ;-)
25579 (catch_clauses): Fixed gross error which made Key and Value of the
25580 DictionaryEntry the same : $1 !!
25582 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
25584 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
25586 * cs-parser.jay (event_declaration): Correct to remove the semicolon
25587 when the add and remove accessors are specified.
25589 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
25591 * cs-parser.jay (IndexerDeclaration): New helper class to hold
25592 information about indexer_declarator.
25593 (indexer_declarator): Implement actions.
25594 (parsing_indexer): New local boolean used to keep track of whether
25595 we are parsing indexers or properties. This is necessary because
25596 implicit_parameters come into picture even for the get accessor in the
25597 case of an indexer.
25598 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
25600 * class.cs (Indexer): New class for indexer declarations.
25601 (TypeContainer::AddIndexer): New method to add an indexer to a type.
25602 (TypeContainer::indexers): New member to hold list of indexers for the
25605 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
25607 * cs-parser.jay (add_accessor_declaration): Implement action.
25608 (remove_accessor_declaration): Implement action.
25609 (event_accessors_declaration): Implement
25610 (variable_declarators): swap statements for first rule - trivial.
25612 * class.cs (Event): New class to hold information about event
25614 (TypeContainer::AddEvent): New method to add an event to a type
25615 (TypeContainer::events): New member to hold list of events.
25617 * cs-parser.jay (event_declaration): Implement actions.
25619 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
25621 * cs-parser.jay (dim_separators): Implement. Make it a string
25622 concatenating all the commas together, just as they appear.
25623 (opt_dim_separators): Modify accordingly
25624 (rank_specifiers): Update accordingly. Basically do the same
25625 thing - instead, collect the brackets here.
25626 (opt_rank_sepcifiers): Modify accordingly.
25627 (array_type): Modify to actually return the complete type string
25628 instead of ignoring the rank_specifiers.
25629 (expression_list): Implement to collect the expressions
25630 (variable_initializer): Implement. We make it a list of expressions
25631 essentially so that we can handle the array_initializer case neatly too.
25632 (variable_initializer_list): Implement.
25633 (array_initializer): Make it a list of variable_initializers
25634 (opt_array_initializer): Modify accordingly.
25636 * expression.cs (New::NType): Add enumeration to help us
25637 keep track of whether we have an object/delegate creation
25638 or an array creation.
25639 (New:NewType, New::Rank, New::Indices, New::Initializers): New
25640 members to hold data about array creation.
25641 (New:New): Modify to update NewType
25642 (New:New): New Overloaded contructor for the array creation
25645 * cs-parser.jay (array_creation_expression): Implement to call
25646 the overloaded New constructor.
25648 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
25650 * class.cs (TypeContainer::Constructors): Return member
25651 constructors instead of returning null.
25653 2001-08-26 Miguel de Icaza <miguel@ximian.com>
25655 * typemanager.cs (InitCoreTypes): Initialize the various core
25656 types after we have populated the type manager with the user
25657 defined types (this distinction will be important later while
25658 compiling corlib.dll)
25660 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
25661 on Expression Classification. Now all expressions have a method
25662 `Resolve' and a method `Emit'.
25664 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
25665 generation from working. Also add some temporary debugging
25668 2001-08-24 Miguel de Icaza <miguel@ximian.com>
25670 * codegen.cs: Lots of code generation pieces. This is only the
25671 beginning, will continue tomorrow with more touches of polish. We
25672 handle the fundamentals of if, while, do, for, return. Others are
25673 trickier and I need to start working on invocations soon.
25675 * gen-treedump.cs: Bug fix, use s.Increment here instead of
25678 * codegen.cs (EmitContext): New struct, used during code
25679 emission to keep a context. Most of the code generation will be
25682 * cs-parser.jay: Add embedded blocks to the list of statements of
25683 this block. So code generation proceeds in a top down fashion.
25685 2001-08-23 Miguel de Icaza <miguel@ximian.com>
25687 * statement.cs: Add support for multiple child blocks.
25689 2001-08-22 Miguel de Icaza <miguel@ximian.com>
25691 * codegen.cs (EmitCode): New function, will emit the code for a
25692 Block of code given a TypeContainer and its ILGenerator.
25694 * statement.cs (Block): Standard public readonly optimization.
25695 (Block::Block constructors): Link children.
25696 (Block::Child): Child Linker.
25697 (Block::EmitVariables): Emits IL variable declarations.
25699 * class.cs: Drop support for MethodGroups here, delay until
25701 (Method::): Applied the same simplification that I did before, and
25702 move from Properties to public readonly fields.
25703 (Method::ParameterTypes): Returns the parameter types for the
25704 function, and implements a cache that will be useful later when I
25705 do error checking and the semantic analysis on the methods is
25707 (Constructor::GetCallingConvention): Renamed from CallingConvetion
25708 and made a method, optional argument tells whether this is a class
25709 or a structure to apply the `has-this' bit.
25710 (Method::GetCallingConvention): Implement, returns the calling
25712 (Method::Define): Defines the type, a second pass is performed
25713 later to populate the methods.
25715 (Constructor::ParameterTypes): implement a cache similar to the
25716 one on Method::ParameterTypes, useful later when we do semantic
25719 (TypeContainer::EmitMethod): New method. Emits methods.
25721 * expression.cs: Removed MethodGroup class from here.
25723 * parameter.cs (Parameters::GetCallingConvention): new method.
25725 2001-08-21 Miguel de Icaza <miguel@ximian.com>
25727 * class.cs (TypeContainer::Populate): Drop RootContext from the
25730 (Constructor::CallingConvention): Returns the calling convention.
25731 (Constructor::ParameterTypes): Returns the constructor parameter
25734 (TypeContainer::AddConstructor): Keep track of default constructor
25735 and the default static constructor.
25737 (Constructor::) Another class that starts using `public readonly'
25738 instead of properties.
25740 (Constructor::IsDefault): Whether this is a default constructor.
25742 (Field::) use readonly public fields instead of properties also.
25744 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
25745 track of static constructors; If none is used, turn on
25746 BeforeFieldInit in the TypeAttributes.
25748 * cs-parser.jay (opt_argument_list): now the return can be null
25749 for the cases where there are no arguments.
25751 (constructor_declarator): If there is no implicit `base' or
25752 `this', then invoke the default parent constructor.
25754 * modifiers.cs (MethodAttr): New static function maps a set of
25755 modifiers flags into a MethodAttributes enum
25756 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
25757 MethodAttr, TypeAttr to represent the various mappings where the
25758 modifiers are used.
25759 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
25761 2001-08-19 Miguel de Icaza <miguel@ximian.com>
25763 * parameter.cs (GetParameterInfo): Fix bug where there would be no
25766 * interface.cs (PopulateIndexer): Implemented the code generator
25767 for interface indexers.
25769 2001-08-17 Miguel de Icaza <miguel@ximian.com>
25771 * interface.cs (InterfaceMemberBase): Now we track the new status
25774 (PopulateProperty): Implement property population. Woohoo! Got
25775 Methods and Properties going today.
25777 Removed all the properties for interfaces, and replaced them with
25778 `public readonly' fields.
25780 2001-08-16 Miguel de Icaza <miguel@ximian.com>
25782 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
25783 initialize their hashtables/arraylists only when they are needed
25784 instead of doing this always.
25786 * parameter.cs: Handle refs and out parameters.
25788 * cs-parser.jay: Use an ArrayList to construct the arguments
25789 instead of the ParameterCollection, and then cast that to a
25792 * parameter.cs: Drop the use of ParameterCollection and use
25793 instead arrays of Parameters.
25795 (GetParameterInfo): Use the Type, not the Name when resolving
25798 2001-08-13 Miguel de Icaza <miguel@ximian.com>
25800 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
25801 and instead use public readonly fields.
25803 * class.cs: Put back walking code for type containers.
25805 2001-08-11 Miguel de Icaza <miguel@ximian.com>
25807 * class.cs (MakeConstant): Code to define constants.
25809 * rootcontext.cs (LookupType): New function. Used to locate types
25812 2001-08-08 Miguel de Icaza <miguel@ximian.com>
25814 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
25815 this System.Reflection code is. Kudos to Microsoft
25817 * typemanager.cs: Implement a type cache and avoid loading all
25818 types at boot time. Wrap in LookupType the internals. This made
25819 the compiler so much faster. Wow. I rule!
25821 * driver.cs: Make sure we always load mscorlib first (for
25822 debugging purposes, nothing really important).
25824 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
25825 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
25827 * rootcontext.cs: Lookup types on their namespace; Lookup types
25828 on namespaces that have been imported using the `using' keyword.
25830 * class.cs (TypeContainer::TypeAttr): Virtualize.
25831 (Class::TypeAttr): Return attributes suitable for this bad boy.
25832 (Struct::TypeAttr): ditto.
25833 Handle nested classes.
25834 (TypeContainer::) Remove all the type visiting code, it is now
25835 replaced with the rootcontext.cs code
25837 * rootcontext.cs (GetClassBases): Added support for structs.
25839 2001-08-06 Miguel de Icaza <miguel@ximian.com>
25841 * interface.cs, statement.cs, class.cs, parameter.cs,
25842 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
25843 Drop use of TypeRefs, and use strings instead.
25845 2001-08-04 Miguel de Icaza <miguel@ximian.com>
25849 * class.cs (Struct::Struct): set the SEALED flags after
25850 checking the modifiers.
25851 (TypeContainer::TypeAttr): new property, returns the
25852 TypeAttributes for a class.
25854 * cs-parser.jay (type_list): Oops, list production was creating a
25855 new list of base types.
25857 * rootcontext.cs (StdLib): New property.
25858 (GetInterfaceTypeByName): returns an interface by type name, and
25859 encapsulates error handling here.
25860 (GetInterfaces): simplified.
25861 (ResolveTree): Encapsulated all the tree resolution here.
25862 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
25865 * driver.cs: Add support for --nostdlib, to avoid loading the
25866 default assemblies.
25867 (Main): Do not put tree resolution here.
25869 * rootcontext.cs: Beginning of the class resolution.
25871 2001-08-03 Miguel de Icaza <miguel@ximian.com>
25873 * rootcontext.cs: Provide better error reporting.
25875 * cs-parser.jay (interface_base): set our $$ to be interfaces.
25877 * rootcontext.cs (CreateInterface): Handle the case where there
25878 are no parent interfaces.
25880 (CloseTypes): Routine to flush types at the end.
25881 (CreateInterface): Track types.
25882 (GetInterfaces): Returns an array of Types from the list of
25883 defined interfaces.
25885 * typemanager.c (AddUserType): Mechanism to track user types (puts
25886 the type on the global type hash, and allows us to close it at the
25889 2001-08-02 Miguel de Icaza <miguel@ximian.com>
25891 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25892 RecordInterface instead.
25894 * cs-parser.jay: Updated to reflect changes above.
25896 * decl.cs (Definition): Keep track of the TypeBuilder type that
25897 represents this type here. Not sure we will use it in the long
25898 run, but wont hurt for now.
25900 * driver.cs: Smaller changes to accomodate the new code.
25902 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25905 * rootcontext.cs (CreateInterface): New method, used to create
25906 the System.TypeBuilder type for interfaces.
25907 (ResolveInterfaces): new entry point to resolve the interface
25909 (CodeGen): Property, used to keep track of the code generator.
25911 2001-07-26 Miguel de Icaza <miguel@ximian.com>
25913 * cs-parser.jay: Add a second production for delegate_declaration
25916 (enum_body): Put an opt_comma here instead of putting it on
25917 enum_body or enum_member_declarations so we can handle trailing
25918 commas on enumeration members. Gets rid of a shift/reduce.
25920 (type_list): Need a COMMA in the middle.
25922 (indexer_declaration): Tell tokenizer to recognize get/set
25924 * Remove old targets.
25926 * Re-add the parser target.
25928 2001-07-13 Simon Cozens <simon@simon-cozens.org>
25930 * cs-parser.jay: Add precendence rules for a number of operators
25931 ot reduce the number of shift/reduce conflicts in the grammar.
25933 2001-07-17 Miguel de Icaza <miguel@ximian.com>
25935 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25938 Get rid of old crufty code.
25940 * rootcontext.cs: Use this to keep track of the parsed
25941 representation and the defined types available to the program.
25943 * gen-treedump.cs: adjust for new convention.
25945 * type.cs: Split out the type manager, and the assembly builder
25948 * typemanager.cs: the type manager will live here now.
25950 * cil-codegen.cs: And the code generator here.
25952 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
25954 * makefile: Fixed up for easy making.
25956 2001-07-13 Simon Cozens <simon@simon-cozens.org>
25958 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25961 (unary_expression): Expand pre_increment_expression and
25962 post_decrement_expression to reduce a shift/reduce.
25964 2001-07-11 Simon Cozens
25966 * cs-tokenizer.cs: Hex numbers should begin with a 0.
25968 Improve allow_keyword_as_indent name.
25970 2001-06-19 Miguel de Icaza <miguel@ximian.com>
25972 * Adjustments for Beta2.
25974 2001-06-13 Miguel de Icaza <miguel@ximian.com>
25976 * decl.cs: Added `Define' abstract method.
25977 (InTransit): new property, used to catch recursive definitions.
25979 * interface.cs: Implement `Define'.
25981 * modifiers.cs: Map Modifiers.constants to
25982 System.Reflection.TypeAttribute flags.
25984 * class.cs: Keep track of types and user-defined types.
25985 (BuilderInit): New method for creating an assembly
25986 (ResolveType): New function to launch the resolution process, only
25987 used by interfaces for now.
25989 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
25990 that are inserted into the name space.
25992 2001-06-08 Miguel de Icaza <miguel@ximian.com>
25994 * ARGH. I have screwed up my tree so many times due to the use of
25995 rsync rather than using CVS. Going to fix this at once.
25997 * driver.cs: Objetify driver. Load assemblies, use assemblies to
26000 2001-06-07 Miguel de Icaza <miguel@ximian.com>
26002 * Experiment successful: Use System.Type rather that our own
26005 2001-05-25 Miguel de Icaza <miguel@ximian.com>
26007 * cs-parser.jay: Removed nsAliases from here.
26009 Use new namespaces, handle `using XXX;'
26011 * namespace.cs: Reimplemented namespace handling, use a recursive
26012 definition of the class. Now we can keep track of using clauses
26013 and catch invalid using clauses.
26015 2001-05-24 Miguel de Icaza <miguel@ximian.com>
26017 * gen-treedump.cs: Adapted for all the renaming.
26019 * expression.cs (Expression): this class now has a Type property
26020 which returns an expression Type.
26022 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
26023 `Type', as this has a different meaning now in the base
26025 2001-05-22 Miguel de Icaza <miguel@ximian.com>
26027 * interface.cs, class.cs: Removed from all the sources the
26028 references to signature computation, as we can not do method
26029 signature computation during the parsing time, as we are not
26030 trying to solve at that point distinguishing:
26034 void a (NS.Blah x) {}
26037 Which depending on the context might be valid or not, as we do not
26038 know if Blah is the same thing as NS.Blah at that point.
26040 * Redid everything so the code uses TypeRefs now instead of
26041 Types. TypeRefs are just temporary type placeholders, that need
26042 to be resolved. They initially have a pointer to a string and the
26043 current scope in which they are used. This is used later by the
26044 compiler to resolve the reference to an actual Type.
26046 * DeclSpace is no longer a CIR.Type, and neither are
26047 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
26048 are all DeclSpaces, but no Types.
26050 * type.cs (TypeRefManager): This implements the TypeRef manager,
26051 which keeps track of all the types that need to be resolved after
26052 the parsing has finished.
26054 2001-05-13 Miguel de Icaza <miguel@ximian.com>
26056 * ARGH. We are going to have to store `foreach' as a class rather
26057 than resolving it, as we need to verify error 1579 after name
26058 resolution. *OR* we could keep a flag that says `This request to
26059 IEnumerator comes from a foreach statement' which we can then use
26060 to generate the error.
26062 2001-05-10 Miguel de Icaza <miguel@ximian.com>
26064 * class.cs (TypeContainer.AddMethod): we now add methods to the
26065 MethodGroup instead of the method hashtable.
26067 * expression.cs: Add MethodGroup abstraction, which gets us one
26068 step closer to the specification in the way we handle method
26071 * cs-parser.jay (primary_expression): qualified_identifier now
26072 tried to match up an identifier to a local variable reference or
26073 to a parameter reference.
26075 current_local_parameters is now a parser global variable that
26076 points to the current parameters for the block, used during name
26079 (property_declaration): Now creates an implicit `value' argument to
26082 2001-05-09 Miguel de Icaza <miguel@ximian.com>
26084 * parameter.cs: Do not use `param' arguments as part of the
26085 signature, per the spec.
26087 2001-05-08 Miguel de Icaza <miguel@ximian.com>
26089 * decl.cs: Base class for classes, structs and interfaces. This
26090 is the "Declaration Space"
26092 * cs-parser.jay: Use CheckDef for checking declaration errors
26093 instead of having one on each function.
26095 * class.cs: Factor out some code for handling error handling in
26096 accordance to the "Declarations" section in the "Basic Concepts"
26097 chapter in the ECMA C# spec.
26099 * interface.cs: Make all interface member classes derive from
26100 InterfaceMemberBase.
26102 2001-05-07 Miguel de Icaza <miguel@ximian.com>
26104 * Many things: all interfaces are parsed and generated in
26105 gen-treedump. Support for member variables, constructors,
26106 destructors, properties, constants is there.
26108 Beginning of the IL backend, but very little done, just there for
26111 2001-04-29 Miguel de Icaza <miguel@ximian.com>
26113 * cs-parser.jay: Fix labeled statement.
26115 * cs-tokenizer.cs (escape): Escape " and ' always.
26116 ref_line, ref_name: keep track of the line/filename as instructed
26117 by #line by the compiler.
26120 2001-04-27 Miguel de Icaza <miguel@ximian.com>
26122 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
26123 to match the values in System.CodeDOM.
26125 Divid renamed to Divide.
26127 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
26129 (Statements.set): remove.
26131 * System.CodeDOM/CodeCatchClause.cs: always have a valid
26134 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
26135 falseStatements always have valid values.
26137 * cs-parser.jay: Use System.CodeDOM now.