1 2006-05-03 Raja R Harinath <rharinath@novell.com>
3 * flowanalysis.cs (FlowBranching.IsLoop): Remove.
4 (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter. It's
5 always true at the only non-recursive entry point.
6 (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
7 FlowBranchingBreakable.
8 (FlowBranchingLoop): Remove.
9 * statement.cs (Return.DoResolve): Update to changes.
12 * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
13 (FlowBranching.CreateBranching): Handle it: create a
14 FlowBranchingContinuable.
15 (FlowBranching.BreakCrossesExceptionBoundary): Remove.
16 (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
17 except that it handles the 'continue' command.
18 (FlowBranching.UsageVector.MergeOrigins): Rename from
20 (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
21 except that it overrides AddContinueOrigin.
22 (FlowBranchingException): Override AddContinueOrigin, similar to
24 * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
25 Create a new branching around the embedded statement.
26 (Do.Resolve, For.Resolve): Likewise. Do reachability analysis for
27 control flow after the embedded statement.
28 (Continue.Resolve): Move all error checking to AddContinueOrigin.
30 * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
31 (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
32 FlowBranchingBreakable.
33 (FlowBranchingSwitch): Remove.
36 * statement.cs (Break.Resolve): Simplify. Move responsibility for
37 error reporting to ...
38 * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
39 Rename from 'AddBreakVector'. Add new location argument. Return
40 a bool indicating whether the 'break' crosses an unwind-protect.
41 (FlowBranchingException.AddBreakOrigin): Add.
42 (FlowBranchingException.Merge): Propagate 'break's to surrounding
43 flowbranching after updating with the effects of the 'finally'
45 (FlowBranchingBreakable): New common base class for
46 FlowBranchingLoop and FlowBranchingSwitch.
48 * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
50 (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
52 2006-05-02 Raja R Harinath <rharinath@novell.com>
54 * statement.cs (Do.Resolve): If the loop is infinite, set the
56 (While.Resolve, For.Resolve): Set a barrier after the embedded
57 statement. There's no direct control flow that goes from the end
58 of the embedded statement to the end of the loop.
59 * flowanalysis.cs (FlowBranching.Infinite): Remove.
60 (FlowBranchingLoop.Merge): Don't look at 'Infinite'. The changes
61 above ensure that the reachability is correctly computed.
63 * flowanalysis.cs (Reachability.ResetBarrier): Remove.
64 (UsageVector.MergeBreakOrigins): If the current path is
65 unreachable, treat it as if all parameters/locals are initialized.
66 (FlowBranchingLoop.Merge): Don't clear any barriers. Handle
67 infinite loops before merging-in break origins.
69 * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
70 (Reachability.Reachable): Split part into ...
71 (Reachability.Unreachable): ... this. Simplify.
72 (Reachability.IsUnreachable): Use 'Unreachable' instead.
74 * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
75 (Reachability.SetThrowsSometimes): Likewise.
76 (FlowBranchingBlock.MergeTopBlock): Don't compare against
77 TriState.Always, use corresponding property.
78 * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
79 (Block.Resolve): Likewise. Remove some redundant checks.
81 2006-05-02 Raja R Harinath <harinath@gmail.com>
83 * flowanalysis.cs (UsageVector.Throw): Set barrier too.
84 (Reachability.Meet): Don't bother checking AlwaysThrows --
85 barrier is always set.
86 (FlowBranchingBlock.Merge): Likewise.
88 2006-05-01 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
90 * attribute.cs: fixed_buffer_cache is declared only if NET_2_0 is
91 defined, so it's references should also compile only for NET_2_0
92 (as occurs in mcs version)
94 2006-05-01 Raja R Harinath <harinath@gmail.com>
96 * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
97 checks for unreachable.
99 2006-05-01 Marek Safar <marek.safar@seznam.cz>
102 *flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
104 * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
105 whether field is really assigned.
107 2006-04-30 Raja R Harinath <harinath@gmail.com>
109 * flowanalysis.cs (Reachability): Make 4-argument constructor
111 (Reachability.Meet): Rename from 'And'. Remove static variant.
112 (Reachability.Always): Rename from the highly misleading
113 'Reachability.Never'.
114 (FlowBranching.Merge): Update to changes. Mark an impossible
115 situation with a 'throw'.
116 (*): Update to changes.
118 2006-04-29 Raja R Harinath <harinath@gmail.com>
120 * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
122 (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
123 (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
124 (*): Update to changes.
125 * statement.cs: Update to changes.
127 2006-04-28 Marek Safar <marek.safar@seznam.cz>
130 *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
132 2006-04-28 Raja R Harinath <harinath@gmail.com>
134 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
137 * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
138 argument to two arguments: an usage-vector and a bool. Move call
139 to FlowBranching.Merge () ...
140 (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
142 * flowanalysis.cs (UsageVector.MergeChild): Move special-case
143 handling of loop and switch reachability to ...
144 (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
146 2006-04-27 Raja R Harinath <harinath@gmail.com>
148 * flowanalysis.cs (FlowBranching.InLoop): Move special-case
149 handling to FlowBranchingLoop.InLoop.
150 (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
152 2006-04-26 Marek Safar <marek.safar@seznam.cz>
155 anonymous.cs.cs (AnonymousMethod.DoResolve): Moved the check whether
156 anonymous method is allowed from AnonymousContainer here.
158 * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
160 2006-04-24 Raja R Harinath <rharinath@novell.com>
163 * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
165 2006-04-23 Marek Safar <marek.safar@seznam.cz>
168 constant.cs (FloatConstant.Reduce): Add range checking for checked context.
169 (DoubleConstant.Reduce): Ditto.
171 2006-04-23 Raja R Harinath <rharinath@novell.com>
173 * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
174 Remove 'lvalue_right_side' argument. Move parts to ...
175 (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
176 (LocalVariable.DoResolveLValue): ... these.
178 2006-04-21 Raja R Harinath <rharinath@novell.com>
181 * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
182 * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
183 (LocalVariableReference.DoResolveBase): Use it to implement new
185 (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
186 (Argument.Resolve): Simplify. Move CS1510 check ...
187 * ecore.cs (Expression.ResolveLValue): ... here.
188 (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
189 (PropertyExpr.DoResolveLValue): Likewise.
190 (FieldExpr.Report_AssignToReadonly): Likewise.
191 (FieldExpr.DoResolve): Add 'out_access' argument. Use
192 LValueMemberAccess or LValueMemberOutAccess on instance depending
194 (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
195 DoResolve as appropriate.
197 2006-04-20 Raja R Harinath <rharinath@novell.com>
200 * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
201 implicit conversions on 'out' and 'ref' arguments.
203 * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
204 improve clarity. Remove dead code.
207 * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
208 (Catch.Resolve): Resolve VarBlock if it exists.
210 2006-04-19 Miguel de Icaza <miguel@novell.com>
212 * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
213 twice, this was some residual code, the enumerator was emitted
214 properly in the two branche of if later.
218 Thanks to Martin for finding the source of the problem
220 2006-04-19 Raja R Harinath <rharinath@novell.com>
222 * expression.cs (Cast.ResolveLValue): Remove. The result of a
223 cast is never an lvalue.
224 (Cast.DoResolve, Cast.ResolveRest): Combine.
225 (Argument.Emit): Simplify slightly. Move 'Expr is
226 IMemoryLocation' check ...
227 (Argument.Resolve): ... here.
228 (Argument.Error_LValueRequired): Remove. Inline into only user.
230 Simplifications. Fix cs0191-2.cs
231 * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
232 CS1649 and CS1651 to ...
233 (FieldExpr.Report_AssignToReadonly): ... this. Simplify by moving
234 the actual selection of the error code and message to a lookup
235 table. Add a dummy return value to simplify callsites.
236 (FieldExpr.ResolveLValue): Don't allow a constructor to write to
237 readonly fields of other instances of the same type. Move CS0197
239 * expression.cs (Argument.Resolve): ... here. Simplify code.
240 Ensure that ec.InRefOutArgumentResolving is only set during LValue
241 resolution of an out or ref argument. The code simplification
242 above uses this invariant.
244 2006-04-18 Raja R Harinath <rharinath@novell.com>
246 Possibly fix #77752. Fix cs1690-[4-7].cs.
247 * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
248 CheckMarshallByRefAccess. Drop parameter.
249 (FieldExpr.CheckMarshalByRefAccess): Update. Change CS1690 to a
251 (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
253 * report.cs (AllWarnings): Add CS1690.
254 * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
256 (LocalVariableReference.DoResolveBase): Update.
258 2006-04-09 Marek Safar <marek.safar@seznam.cz>
260 class.cs (MethodOrOperator): Moved common parts from method class.
261 detect obsolete attributes.
262 (Method.Define): Simplified as it reuses code from base.
263 (Constructor.ValidAttributeTargets): Fixed issue found during
265 (Destructor.ValidAttributeTargets): Fixed issue found during
267 (Operator): Finished refactoring set off by #78020. Operator class is now
268 ordinary method class.
270 * anonymous.cs: Updated.
272 2006-04-09 Marek Safar <marek.safar@seznam.cz>
274 (Constructor.Emit): Don't emit the attributes twice.
276 2006-04-09 Marek Safar <marek.safar@seznam.cz>
278 class.cs (Operator.Emit): Extracted code from MethodData to correctly
279 detect obsolete attributes.
280 (Method.CreateEmitContext): Moved to MethodOrOperator.
282 2006-04-09 Marek Safar <marek.safar@seznam.cz>
285 class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
286 customized exception to make crash detection easier.
287 (MethodOrOperator): Started to work on new base class for methods and
289 (Method): Derives from MethodOrOperator.
290 (Constructor.Emit): Emits its own attributes.
291 (AbstractPropertyEventMethod.Emit): Ditto.
292 (Operator): Derives from MethodOrOperator, will refactor fully in extra
294 (Operator.Emit): It's temporary more tricky than should be.
296 * doc.cs (GetMethodDocCommentName): Updated after operator changes.
298 * report.cs (InternalErrorException): Add ctor with inner exception.
300 2006-04-08 Marek Safar <marek.safar@seznam.cz>
303 ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
306 2006-04-07 Marek Safar <marek.safar@seznam.cz>
309 expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
312 2006-04-06 Marek Safar <marek.safar@seznam.cz>
314 * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
315 attribute is present and Guid not.
316 (Interface.ApplyAttributeBuilder): Ditto.
318 * attribute.cs: Add error message.
320 2006-04-06 Marek Safar <marek.safar@seznam.cz>
324 * attribute.cs (Attribute.AttachTo): The attribute can have multiple
325 sources (it's composite) so hold them in extra array as they are used in
326 Emit phase only. It worked in the previous versions by mistake.
327 (Attribute.Emit): Emit attribute for more owners when exist.
329 * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
330 it has now different behaviour.
332 2006-04-04 Marek Safar <marek.safar@seznam.cz>
334 * constant.cs (Constant.IsDefaultInitializer): New method.
338 * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
339 re-initialize default values. It saves KBs almost for every assembly.
340 Thanks Zoltan for the idea.
341 (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
342 (ArrayCreation.DoResolve): Resolve only once.
343 (ArrayCreation.Emit): Emit static initializer only when it is faster.
344 (ArrayCreation.GetAttributableValue): Cope with optimized values.
346 2006-04-03 Zoltan Varga <vargaz@gmail.com>
348 * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
351 2006-04-01 Marek Safar <marek.safar@seznam.cz>
353 * assign.cs (Assign.DoResolve): Assignment to same variable can occur
354 in an embedded statement too.
356 2006-04-01 Raja R Harinath <rharinath@novell.com>
359 * typemanager.cs (IsNestedChildOf): Drop generic arguments before
363 * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
366 * report.cs (SymbolRelatedToPreviousError): Drop generic type
367 arguments before checking whether a type is reflected or not.
370 * expression.cs (Invocation.IsApplicable): Ensure a generic method
371 definition doesn't take part in overload resolution.
372 (Invocation.IsParamsMethodApplicable): Likewise.
373 (Invocation.OverloadResolve): When replacing a reflected override
374 method with its base definition, ensure that type arguments are
377 2006-04-01 Marek Safar <marek.safar@seznam.cz>
381 * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
384 * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
386 2006-03-31 Marek Safar <marek.safar@seznam.cz>
388 * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
391 * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
392 LocalTemporary change.
394 * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
396 (ClassOrStruct.DefineFieldInitializers): Implemented static field
397 initializers optimization.
398 (ClassOrStruct.TypeAttr): Moved from modifiers.
399 (Constructor.CheckBase): Don't crash when static ctor has parameters.
400 (FieldBase.ResolveInitializer): Resolves initializer.
401 (FieldBase.HasDefaultInitializer): New property.
403 * cs-parser.jay: Removed message.
405 * expression.cs (CompilerGeneratedThis): New specialization.
407 * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
409 2006-03-28 Marek Safar <marek.safar@seznam.cz>
411 * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
413 2006-03-27 Marek Safar <marek.safar@seznam.cz>
415 * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
416 be now EnumConstants only.
418 2006-03-27 Marek Safar <marek.safar@seznam.cz>
420 * attribute.cs, driver.cs: Reset more caches.
422 2006-03-26 Marek Safar <marek.safar@seznam.cz>
424 * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
426 2006-03-26 Marek Safar <marek.safar@seznam.cz>
428 * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
429 for easier reuse. Updated all overrides.
430 (IntegralConstant): New base class for all integral constants.
431 (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
432 of the constant range, report custom error.
433 (UIntConstant.Reduce): Fixed uint conversion.
435 * ecore.cs, literal.cs: Reduce updates.
437 2006-03-26 Marek Safar <marek.safar@seznam.cz>
441 * class.cs (Constructor.Define): Removed extra if for default ctors.
442 A patch from Atsushi Enomoto.
444 2006-03-26 Marek Safar <marek.safar@seznam.cz>
446 * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
447 GetAttributableValue.
449 * constant.cs (Constant.GetAttributableValue): Does implicit conversion
452 * convert.cs (ImplicitConversionRequired): Error message moved to
455 * ecore.cs (Expression.GetAttributableValue): Add type parameter for
456 automatic implicit conversion of an output value.
457 (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
459 * expression.cs (ArrayCreation.GetAttributableValue): Add element type
461 (TypeOf.GetAttributableValue): Add extra handling for object type.
463 * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
464 special error message.
466 2006-03-25 Marek Safar <marek.safar@seznam.cz>
468 * class.cs (Constructor.Emit): Don't crash when struct ctor is
470 (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
471 compatible with MS runtime.
473 2006-03-23 Marek Safar <marek.safar@seznam.cz>
475 * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
476 attribute arguments here.
478 * class.cs (Indexer.Define): The check was moved to attribute class.
480 2006-03-21 Marek Safar <marek.safar@seznam.cz>
482 * expression.cs (StringConcat.Append): Reverted back to no warning state.
484 2006-03-21 Marek Safar <marek.safar@seznam.cz>
486 * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
488 * statement.cs (Block.ResolveMeta): Look for wrong object constants in
491 2006-03-21 Atsushi Enomoto <atsushi@ximian.com>
493 * doc-bootstrap.cs : fix build.
495 2006-03-20 Marek Safar <marek.safar@seznam.cz>
497 * expression.cs (StringConcat.Append): Issue a warning when empty string
500 2006-03-20 Marek Safar <marek.safar@seznam.cz>
502 * assign.cs (CompoundAssign.ResolveSource): Removed.
504 * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
507 * class.cs (TypeContainer.FindMethods): Removed.
508 (TypeContainer.CheckMemberUsage): Made static.
510 * codegen.cs (GetAssemblyName): Uses Length for empty string test.
512 * constant.cs (CheckRange): Removed unused type argument.
513 (CheckUnsigned): Removed unused type argument.
515 * cs-parser.jay: Updated after MemberAccess clean up.
516 Uses Length for empty string test.
518 * cs-tokenizer.cs: Uses Length for empty string test.
519 (IsCastToken): Made static.
520 (is_hex): Made static.
521 (real_type_suffix): Made static.
523 * decl.cs (SetupCache): Made static.
524 (OnGenerateDocComment): Removed unused ds argument.
526 * delegate.cs (VerifyDelegate): Removed unused argument.
528 * doc.cs: Uses Length for empty string test.
530 * driver.cs: Uses Length for empty string test.
532 * enum.cs (IsValidEnumType): Made static
534 * expression.cs (EnumLiftUp): Removed unused argument.
535 (ResolveMethodGroup): Ditto.
536 (BetterConversion): Ditto.
537 (GetVarargsTypes): Ditto.
538 (UpdateIndices): Ditto.
539 (ValidateInitializers): Ditto.
540 (MemberAccess.ctor): Ditto.
541 (GetIndexersForType): Ditto.
543 * flowanalysis.cs: (MergeFinally): Removed unused argument.
545 * iterators.cs: Updated after MemberAccess clean up.
547 * location.cs: Uses Length for empty string test.
549 * namespace.cs: Uses Length for empty string test.
551 * report.cs (CheckWarningCode): Made static.
553 * statement.cs (LabeledStatement): Removed unused argument.
555 * typemanager.cs (FilterNone): Removed.
557 2006-03-18 Marek Safar <marek.safar@seznam.cz>
559 * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
564 2006-03-18 Marek Safar <marek.safar@seznam.cz>
566 * cs-parser.jay.cs: __arglist is not allowed for delegates.
568 2006-03-18 Marek Safar <marek.safar@seznam.cz>
572 * anonymous.cs.cs (AnonymousMethod): Add host to allow access to
574 (AnonymousMethod.ImplicitStandardConversionExists): New method.
575 (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
576 Add more error reporting; Fixed issue with params.
578 * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
580 * cs-parser.jay: AnonymousMethod requires host container.
582 * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
584 2006-03-18 Raja R Harinath <harinath@gmail.com>
586 * class.cs: Change 'TypeContainer ds' constructor argument to
587 'DeclSpace parent'. Some classes were missed below due to
588 different naming convention.
590 * class.cs (MemberCore.Parent): Delete. This makes the
591 ParentContainer changes below enforceable by the compiler.
593 Treat pointers to enclosing declaration space as 'DeclSpace', not
595 * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
596 'TypeContainer parent' constructor argument to 'DeclSpace parent'.
598 * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
600 (Block.AddThisVariable): Likewise.
601 * class.cs (MethodData.Define, MethodData.Emit): Likewise.
602 (AbstractPropertyEventMethod.Emit): Likewise.
603 (AbstractPropertyEventMethod.EmitMethod): Likewise.
604 (GetMethod.Define, SetMethod.Define): Likewise.
605 (PropertyMethod.Define, DelegateMethod.Define): Likewise.
606 (DelegateMethod.EmitMethod): Likewise.
608 Fix regression test-partial-13.cs.
609 Rationalize use of PartialContainer. Ensure that the partial
610 class semantics can be tied to type-correctness, i.e., any
611 violation will cause a compile error.
612 * class.cs, const.cs: Access all fields that belong to class
613 TypeContainer via ParentContainer. Arguments of EmitContexts and
614 Resolve()-like functions still use 'Parent'.
616 * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
617 (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
618 (PropertyMethod.CheckModifiers): Remove unused argument.
619 * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
622 2006-03-28 Raja R Harinath <rharinath@novell.com>
624 * decl.cs (DeclSpace.LookupGeneric): Update to changes.
626 2006-03-17 Raja R Harinath <harinath@gmail.com>
628 Make semantics of PartialContainer simpler.
629 * decl.cs (DeclSpace.IsPartial): Remove.
630 * class.cs (TypeContainer.IsPartial): Likewise.
631 (TypeContainer..ctor): Set PartialContainer to point to self.
632 (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
633 (TypeContainer.FindNestedType): Likewise.
634 (MemberCore.ParentContainer): Simplify. Remove deprecation.
636 2006-03-17 Marek Safar <marek.safar@seznam.cz>
638 * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
640 2006-03-15 Marek Safar <marek.safar@seznam.cz>
642 * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
645 2006-03-15 Marek Safar <marek.safar@seznam.cz>
647 * class.cs (Operator.Define): An error for base conversion was not
650 2006-03-13 Marek Safar <marek.safar@seznam.cz>
652 A fix for #77593, #77574.
654 * class.cs (MethodCore.CheckBase): Another if for operator.
656 2006-03-18 Marek Safar <marek.safar@seznam.cz>
660 * expression.cs (VerifyArgumentsCompat): Reverted to double error
661 reporting, it's more tricky than I thought.
663 2006-03-09 Marek Safar <marek.safar@seznam.cz>
665 * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
668 * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
669 (DelegateCreation.ImplicitStandardConversionExists): New method for just
672 * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
675 2006-03-04 Marek Safar <marek.safar@seznam.cz>
679 * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
680 (Event.Define): ditto
681 (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
683 * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
684 Removed redundant code and set NewSlot for Invoke method too.
686 * parameter.cs (Parameters.ctor): Add custom, type ctor.
687 (Parameters.MergeGenerated): New method. Use this method when you merge
688 compiler generated argument with user arguments.
690 2006-03-03 Marek Safar <marek.safar@seznam.cz>
692 * attribute.cs (ResolveAsTypeTerminal): Removed.
694 * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
695 specialization for predefined types; 30% speed up.
696 Finally placed obsolete check to right place.
697 (Expression.ResolveType): Removed.
699 * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
700 Updated after ResolveType was removed.
702 * expression.cs (Cast.ctor): Check void cast.
703 (Binary.ResolveAsTypeTerminal): Is never type.
704 (Conditional.ResolveAsTypeTerminal): Is never type.
706 * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
708 2006-03-26 Marek Safar <marek.safar@seznam.cz>
710 * rootcontext.cs (ResolveCore): Removed System.INullableValue.
712 2006-03-23 Martin Baulig <martin@ximian.com>
714 * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
715 type check if either of the types is an open generic type.
717 2006-03-23 Martin Baulig <martin@ximian.com>
720 (Convert.ExplicitTypeParameterConversion): New method; implement
721 explicit type parameter conversions.
723 2006-03-23 Martin Baulig <martin@ximian.com>
725 * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
726 blindly allow all conversions if we do not have any constraints.
728 2006-02-27 Marek Safar <marek.safar@seznam.cz>
730 * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
731 these two separated members to simplify the code.
732 (Attribute.Resolve): Refactored to use new fields and methods.
733 (Attribute.ResolveConstructor): Extracted from ResolveArguments and
734 implemented obsolete attribute checking.
735 (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
736 implemented obsolete checking again. It look line never ending quest ;-)
737 (GlobalAttribute.ResolveConstructor): Need to override as the rest.
739 * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
741 * constanct.cs (TryReduce): Throws OverflowException to indicate error.
743 *class.cs (Property.Define): Add RegisterProperty call.
745 * cs-parser.jay: Replaced ArrayList with fixed array for attribute
746 argument groups (only 2).
748 * ecore.cs (Expression.GetAttributableValue): New virtual method used for
749 encoding expression to arguments.
750 (Expression.ExprClassToResolveFlags): Just turned to property.
752 * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
753 (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
754 optimized as well as implemented support for zero-length attributes.
756 * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
757 Add caching of PropertyInfo's.
759 2006-02-25 Marek Safar <marek.safar@seznam.cz>
761 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
762 error multiple times.
764 2006-02-25 Marek Safar <marek.safar@seznam.cz>
766 New partial class implementation.
767 A fix for #77027, #77029, #77403
769 * attribute.cs (Attributable): Made attributes protected.
771 * class.cs (TypeContainer): Add PartialContainer and partial_parts as
772 the replacements of ClassPart and PartialContainer.
773 (TypeContainer.AddClassOrStruct): Call RecordDecl here.
774 (TypeContainer.AddInterface): Ditto.
775 (TypeContainer.AddPartial): The main method for partial classes. It checks
776 for errors and merges ModFlags and attributes. At the end class is added to
778 (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
780 (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
781 (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
782 from the rest of partial classes.
783 (TypeContainer.GetClassBases): Simplified.
784 (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
786 (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
787 (TypeContainer.HasExplicitLayout): Uses Flags now.
788 (PartialContainer): Removed.
789 (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
790 (StaticClass): Was merged with Class.
791 (Class.GetClassBases): class and static class bases are verified here.
792 (Class.TypeAttr): Added static attributes when class is static.
793 (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
794 (MemberBase): In some cases we need to call parent container for partial
795 class. It should be eliminated but it's not easy now.
797 * cs-parser.jay: Replaced all PartialContainer with AddPartial.
799 * decls.cs (MemberCore.DocComment): Introduced new property as is used by
800 partial classed to accumulate class comments.
801 (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
803 * doc.cs (GenerateTypeDocComment): Partial classes clean up.
805 * driver.cs (MainDriver): Tree.GetDecl was removed.
807 * modifiers.cs (Modifiers): Add partial modifier.
809 * tree.cs (Tree.decl): Removed.
810 (RootTypes): Started to use this class more often for root types
813 2006-03-23 Raja R Harinath <rharinath@novell.com>
815 * generic.cs (TypeParameter.UpdateConstraints): Update
816 'constraints' if null.
818 2006-02-22 Marek Safar <marek.safar@seznam.cz>
822 * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
823 external interface does not have an attribute.
825 2006-02-22 Marek Safar <marek.safar@seznam.cz>
827 Another prerequisites for new partial classs implementation.
829 * attribute.cs (Attribute.Equal): Implemented.
830 (Attribute.Emit): Changed as attributes can be applied more than twice.
831 (Attributes.Emit): Check for duplicate attributes here.
833 * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
834 as a parameter, clean-up.
836 2006-02-11 Marek Safar <marek.safar@seznam.cz>
840 * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
841 contains obsolete attribute check which can in some cases look for base
842 type of current class which is not initialized yet.
843 (TypeContainer.BaseType): Replacement of ptype.
845 * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
847 2006-02-11 Marek Safar <marek.safar@seznam.cz>
849 First of prerequisites for new partial classs implemention.
851 * attribute.cs (Attributable): Extended by ResolveContext;
852 Attributes finally have correct context for resolving in all cases.
853 (AttachTo): Attribute owner is assigned here.
855 * codegen.cs (IResolveContext): Introduce new interface to hold
856 all information needed in resolving phase.
857 (EmitContext): Implements IResolveContext; more clean-up needed here.
859 * decl.cs (MemberCore): Implemented IResolveContext.
861 * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
862 decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
863 parameter.cs, statement.cs, tree.cs, typemanager.cs:
864 Refactored to use new IResolveContext instead of EmitContext; cleanup
866 2006-03-22 Raja R Harinath <rharinath@novell.com>
868 Support ParameterDefaultValueAttribute in gmcs. Also applied to
869 mcs to keep code differences small.
870 * attribute.cs (Attribute.GetParameterDefaultValue): New.
871 * typemanager.cs (parameter_default_value_attribute_type): New.
872 * parameter.cs (Parameter.ApplyAttributeBuilder): Use them. Add
875 2006-03-22 Martin Baulig <martin@ximian.com>
878 (Nullable.NullableLiteral): Derive from `NullLiteral'.
881 (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
882 instead of the normal `NullLiteral'.
884 2006-03-21 Martin Baulig <martin@ximian.com>
887 * generic.cs (TypeManager.InferType): If `pt' is a generic
888 parameter, don't check whether `pt == at'.
890 2006-03-20 Raja R Harinath <rharinath@novell.com>
893 * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
894 (TypeParameter.Resolve): Update to change.
895 (ConstraintChecker.CheckConstraints): Resolve type-argument
896 constraints before use.
898 2006-03-16 Martin Baulig <martin@ximian.com>
901 (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
902 and don't have any instance constructors, also lookup in the base class.
903 (TypeManager.IsNullableValueType): New public method.
905 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
906 `BindingFlags.DeclaredOnly' flag and set `used_cache'.
907 (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
909 * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
910 instead of just TypeManager.IsNullableType() to determine whether
911 a lifted operator exists.
912 (UnaryMutator.DoResolve): Likewise.
913 (Conditional.DoResolve): Likewise.
914 (Binary.DoResolve): A lifted operator only exists if both operands
915 are valuetypes and at least one of them is a nullable type.
917 2006-03-14 Atsushi Enomoto <atsushi@ximian.com>
919 * iterator.cs : yield break is allowed in try statement which has
920 catch clauses. Fixed bug #77767.
922 2006-03-12 Martin Baulig <martin@ximian.com>
924 * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
925 private IsSignatureEqual() to compare types; see the comment in
926 that method; fixes #77674.
928 2006-03-10 Raja R Harinath <rharinath@novell.com>
930 * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
931 (Expression.ResolveAsTypeTerminal): Likewise.
932 * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
933 * expression.cs, generic.cs, iterators.cs: Likewise.
934 * parameter.cs, statement.cs, typemanager.cs: Likewise.
936 2006-03-09 Martin Baulig <martin@ximian.com>
938 * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
939 TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
941 2006-03-09 Martin Baulig <martin@ximian.com>
943 * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
944 `prepared' flag is set.
946 * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
947 (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
948 issues; see gtest-254.cs.
950 2006-03-07 Martin Baulig <martin@ximian.com>
952 * generic.cs (TypeManager.InferType): Allow infering
953 `IEnumerable<T>' with an array of T; see gtest-251.cs.
955 2006-03-06 Martin Baulig <martin@ximian.com>
958 (TypeManager.InferType): Fix gtest-250.cs.
961 (TypeManager.IsSubclassOf): Also check the base class.
964 (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
967 2006-03-01 Raja R Harinath <rharinath@novell.com>
970 * expression.cs (ParameterReference.DoResolveBase): Change return
972 (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
976 * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
979 * typemanager.cs (GetFullNameSignature): Don't nullref on
982 2006-02-16 Martin Baulig <martin@ximian.com>
985 (TypeManager.GetGenericFieldDefinition): New public method; use it
986 instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
988 2006-02-14 Martin Baulig <martin@ximian.com>
990 * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
992 2006-02-14 Martin Baulig <martin@ximian.com>
995 (TypeManager.DropGenericMethodArguments): New public method; don't
996 use GetGenericMethodDefinition() on something which is not a
999 2006-02-14 Martin Baulig <martin@ximian.com>
1002 (ConstraintChecker.CheckConstraints): If a type parameter has the
1003 `struct' constraint, the type must be a non-nullable valuetype.
1005 2006-02-10 Martin Baulig <martin@ximian.com>
1008 (TypeManager.IsOverride): Make this work for instantiated methods
1009 in a generic class; fixes #77509.
1010 (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
1011 rather than calling it directly; fixes #77488.
1013 2006-02-08 Martin Baulig <martin@ximian.com>
1015 * generic.cs (ConstraintChecker.CheckConstraints): Move the error
1016 reporting into CheckConstraint() so we can use the correctly
1019 2006-02-08 Martin Baulig <martin@ximian.com>
1021 * expression.cs (BaseAccess): Add support for generic methods.
1023 * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
1024 the new MethodGroupExpr.
1026 2006-02-07 Martin Baulig <martin@ximian.com>
1028 * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
1029 also reference types; fixes #77483.
1031 2006-02-07 Martin Baulig <martin@ximian.com>
1034 (TypeManager.IsGenericMethod): We now return whether something is
1035 an instantiated generic method (and not a generic method def).
1036 (TypeManager.IsGenericMethodDefinition): New public method.
1039 (TypeManager.CSharpSignature): Only include type arguments for
1040 "real" generic methods, not for any instantiated method.
1041 (TypeManager.GetMethodName): Likewise, but also allow generic
1042 method definitions here.
1044 2006-02-06 Miguel de Icaza <miguel@novell.com>
1046 * codegen.cs (EmitScopeInitFromBlock): check here the
1047 capture_context, there is no need to make two calls to the
1050 * anonymous.cs: Add some debugging messages that might help me
1051 track other instances of this problem in the future (the
1052 regression of test 467).
1054 * cs-parser.jay: track the variable block, as we need to initalize
1055 any captured variables declared in this block for the "catch"
1056 portion of the "Try" statement.
1058 * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
1059 scope initialization for captured variables.
1061 Also, move the emit for the variables after the block location has
1064 2006-02-06 Marek Safar <marek.safar@seznam.cz>
1066 * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
1068 2006-02-06 Martin Baulig <martin@ximian.com>
1070 * class.cs (TypeContainer.DefineType): If we're a struct, pass
1071 `TypeManager.value_type' as parent type to
1072 ModuleBuilder.DefineType(). Fixes #77358.
1074 2006-02-02 Miguel de Icaza <miguel@novell.com>
1076 * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
1077 commit yesterday, the initialization for the roots is necessary.
1078 What is not necessary is the scope activation.
1080 2006-02-02 Raja R Harinath <rharinath@novell.com>
1082 * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
1083 * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
1085 (Argument.Resolve): Remove CS0206 checks.
1087 2006-02-01 Miguel de Icaza <miguel@novell.com>
1089 * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
1090 scopes for all the roots, the scopes will now be emitted when the
1091 Blocks are entered. [This change was wrong, fixed on 2006-02-02]
1093 (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
1094 code. This reduces a lot of existing cruft.
1096 * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
1097 that the ScopeInfo is generated as we enter the scope, not at the
1098 time of use, which is what we used to do before.
1100 * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
1101 every time a Block is about to be emitted if we have a
1104 2006-02-01 Raja R Harinath <rharinath@novell.com>
1106 * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
1107 attribute for mscorlib too.
1109 * typemanager.cs (NoTypes, NoTypeExprs): Remove.
1111 * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
1113 * typemanager.cs (cons_param_array_attribute): Make private.
1114 (Reset): Set it to null.
1115 (InitCoreHelpers): Don't initialize it.
1116 (ConsParamArrayAttribute): New. Initialize it as needed.
1117 * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
1119 2006-01-31 Miguel de Icaza <miguel@novell.com>
1121 * expression.cs: There might be errors reported during the
1122 selection of applicable methods. If there are errors, do not
1123 continue execution as it will lead the compiler to crash.
1125 2006-01-30 Miguel de Icaza <miguel@novell.com>
1127 * expression.cs: Member access is not allowed on anonymous
1128 methods. Fixes #77402.
1130 2006-01-30 Raja R Harinath <rharinath@novell.com>
1133 * cs-parser.jay (VariableDeclaration): Don't set
1134 current_array_type to null.
1135 (field_declaration, event_declaration, declaration_statement):
1136 Set it to null here.
1138 2006-01-29 Raja R Harinath <harinath@gmail.com>
1141 * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
1143 2006-01-28 Raja R Harinath <harinath@gmail.com>
1145 * typemanager.cs (GenericParameterPosition): New.
1148 2006-01-28 Atsushi Enomoto <atsushi@ximian.com>
1150 * doc.cs : To process "include" elements, first we should create
1151 another list than XmlNodeList, because it could result in node
1152 removal, which could result in that the XmlNodeList gives up
1155 2006-01-25 Miguel de Icaza <miguel@novell.com>
1157 * expression.cs: Introduce an error report that we were not
1158 catching before. Gonzalo ran into it.
1160 2006-01-23 Miguel de Icaza <miguel@novell.com>
1162 A fix for bug: #76957
1164 * iterators.cs (MoveNextMethod.CreateMethodHost): call
1165 ComputeMethodHost before creating the method, this is a new
1168 * anonymous.cs (AnonymousContainer): Now we track all the scopes
1169 that this method references (RegisterScope). The actual scope
1170 where the method is hosted is computed with the ComputeMethodHost
1171 before we create the method.
1173 Moved the Deepest routine here.
1175 (AnonymousContainer.ComputeMethodHost): New routine used to
1176 compute the proper ScopeInfo that will host the anonymous method.
1178 (ScopeInfo): Deal with multiple roots. The problem was that we
1179 did not have a unique root where all ScopeInfos could be hanged
1180 from. Remove `topmost' ScopeInfo, and instead keep an arraylist
1183 Remove AdjustMethodScope which is now computed at the end. Remove
1184 LinkScope which did a partial link, instead link all ScopeInfos
1185 before code generation from the new "LinkScopes" routine.
1187 Simplify all the Add* routines as they no longer need to maintain
1188 the tree, they just need to record that they are using variables
1191 (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1192 routines to produce the forest of ScopeInfo trees.
1194 * class.cs (TypeContainer.AppendMethod): This is just like
1195 AddMethod, but ensures that an interface implementation method
1196 (IEnumerable.XXX) is not inserted at the beginning of the queue of
1197 methods, but at the end.
1199 We use this functionality to ensure that the generated MoveNext
1200 method in the iterator class is resolved/emitted before the
1201 enumerator methods created.
1203 This is required because the MoveNext method computes the right
1204 ScopeInfo for the method. And the other methods will eventually
1205 need to resolve and fetch information computed from the anonymous
1209 2006-01-23 Raja R Harinath <rharinath@novell.com>
1211 Improve implementation of section 14.4.2.2 (Better function member).
1212 * expression.cs (Invocation.MoreSpecific): Compare all type
1213 arguments before deciding if one type is more specific than
1214 another. Handle array types too. Return the more specific type.
1215 (Invocation.BetterFunction): Add more tie-breaking rules from
1216 section 14.4.2.2. Perform "more specific" check after
1217 other tie-breaking rules. Compare all parameter types before
1218 choosing the "more specific" method.
1220 2006-01-21 Raja R Harinath <harinath@gmail.com>
1221 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1224 * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
1226 (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
1227 (NamespaceEntry.VerifyUsing): Resolve external aliases too.
1229 2006-01-18 Martin Baulig <martin@ximian.com>
1231 * class.cs (TypeContainer.AddToMemberContainer): Use
1232 `symbol.MemberName.MethodName' instead of just `symbol.Name';
1235 2006-01-18 Martin Baulig <martin@ximian.com>
1237 Fix #76417: a generic class may now have methods which may unify
1238 for some type parameter substitutions.
1240 * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
1241 for methods which may unify anymore.
1243 * expression.cs (Invocation.MoreSpecific): New private static
1244 method; checks whether one method is more specific than another
1245 according to 14.4.2.2 of the spec.
1246 (Invocation.BetterFunction): Implement the tie-breaking rules from
1247 14.4.2.2 of the spec: if two methods unify for some type parameter
1248 substitution, we need to pick the more specific one.
1250 2006-01-18 Raja R Harinath <rharinath@novell.com>
1252 Fix #76656, cs0231-2.cs.
1253 * cs-parser.jay (formal_parameter_list): Make error case catch
1255 (parenthesized_expression_0): Add CS1026 check.
1256 (invocation_expression): Remove unused { $$ = lexer.Location }.
1258 2006-01-17 Raja R Harinath <rharinath@novell.com>
1261 * cs-parser.jay (statement_expression): Don't list out the
1262 individual statement-expressions. Convert syntax error into
1265 2006-01-16 Raja R Harinath <rharinath@novell.com>
1268 * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
1269 (UnboxCast.DoResolveLValue): New. Move CS0445 check from
1270 CheckIntermediateModification.
1271 (FieldExpr.DoResolve): Add new two-argument version that
1272 allows us to resolve the InstanceExpression as an lvalue.
1273 The one-argument variant is now just a wrapper.
1274 (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
1275 Resolve the lhs as an lvalue if the it has a value type.
1276 (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
1277 from Assign.DoResolve.
1278 (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
1279 resolved as an lvalue.
1280 (PropertyExpr.DoResolve): Update.
1281 (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
1282 has a value type. Move CS1612 check here from
1283 CheckIntermediateModification.
1284 * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
1285 * expression.cs (EmptyExpression.OutAccess): New. Used as the
1286 'right_side' of a ResolveLValue on an 'out' argument.
1287 (EmptyExpression.LValueMemberAccess): New. Used as the
1288 'right_side' of a propagated ResolveLValue on a value type.
1289 (LocalVariableReference.DoResolveBase): Recognize
1290 EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
1292 (Argument.Resolve): Use EmptyExpression.OutAccess rather than
1293 EmptyExpression.Null.
1295 2006-01-16 Atsushi Enomoto <atsushi@ximian.com>
1297 * typemanager.cs : added IsGenericParameter(). In gmcs it returns
1298 Type.IsGenericParameter(). Fixed bug #77183.
1299 * doc.cs : it is now identical to doc.cs in mcs.
1301 2006-01-16 Martin Baulig <martin@ximian.com>
1303 * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
1305 2006-01-16 Martin Baulig <martin@ximian.com>
1307 * typemanager.cs (TypeManager.CSharpSignature): Make this work for
1308 ctors; fixes #77250.
1310 2006-01-12 Miguel de Icaza <miguel@novell.com>
1312 This fixes the problem where we used ldfld instead of ldflda to
1313 load the "THIS" pointer on captured parameters, when THIS is a
1314 value type. See bug #77205.
1316 * iterators.cs (CapturedThisReference.Emit): Pass false to
1317 EmitThis (we do not need the address).
1319 * codegen.cs (EmitThis): it needs to know whether we need the
1320 address of `this' or not. This is used by value types.
1322 * expression.cs (This.AddressOf): Pass true to the EmitThis call,
1323 every other call passes false.
1325 2006-01-12 Raja R Harinath <rharinath@novell.com>
1328 * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
1330 * expression.cs (Invocation.OverloadResolve): Update.
1331 (Invocation.DoResolve): Avoid double resolution of invocation.
1333 2006-01-11 Raja R Harinath <rharinath@novell.com>
1336 * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
1337 unary negation of floating point types as 0-expr; negation cannot
1338 overflow in floating point types.
1341 * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
1342 on operands of 'void' type.
1345 * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
1346 and ExclusiveOr for boolean constants too.
1348 2006-01-12 Ben Maurer <bmaurer@andrew.cmu.edu>
1350 * expression.cs: Fix Console.WriteLine ((this = x).foo);
1352 2006-01-12 Miguel de Icaza <miguel@novell.com>
1354 * cs-tokenizer.cs (Position): New class used to save and restore
1355 the position state in the tokenizer. Before this patch the save
1356 and restore was not complete enough so the line and columns would
1357 start to drift and the debugger and stack traces will get the
1360 2006-01-10 Martin Baulig <martin@ximian.com>
1363 (TypeParameter.InflateConstraints): New public method.
1365 * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
1366 constraints; fixes #77042.
1368 2006-01-10 Martin Baulig <martin@ximian.com>
1370 * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
1371 instead of the `TypeBuilder' for this "<>THIS" variable; fixes
1374 2006-01-09 Raja R Harinath <rharinath@novell.com>
1377 * expression.cs (Invocation.OverloadResolve): Replace reflected
1378 override methods with their base virtual methods, rather than
1380 * typemanager.cs (TypeManager.GetOverride): New.
1382 2005-12-21 Miguel de Icaza <miguel@novell.com>
1384 * driver.cs: Report the case of no source files and no -out:
1387 2005-12-20 Raja R Harinath <rharinath@novell.com>
1390 * expression.cs (ComposedCast.GetSignatureForError): Define.
1392 2006-01-05 Jb Evain <jbevain@gmail.com>
1394 * class.cs (Property.Define, Indexer.Define): do not tag the
1395 properties as SpecialName | RTSpecialName.
1397 2006-01-04 Miguel de Icaza <miguel@novell.com>
1399 * class.cs (MethodCore.IsDuplicateImplementation): This method was
1400 doing a low-level comparission of parameter types. It was lacking
1401 a check for __argslist.
1403 2005-12-30 Miguel de Icaza <miguel@novell.com>
1405 * expression.cs (ParameterReference.DoResolveBase): Allow
1406 reference parameters if they are local to this block.
1408 This allows the ref and out parameters of a delegate to be used in
1409 an anonymous method, for example:
1411 delegate void set (out int x);
1413 set s = delegate (out int x){
1417 This is used by functionality introduced late in the C# language.
1419 * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1420 method that take ref and out parameters.
1422 Fixes #77119 which was a late change in the spec.
1424 2005-12-23 Miguel de Icaza <miguel@novell.com>
1426 * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1427 parent if its the same scope. Fixes #77060.
1429 2005-12-22 Marek Safar <marek.safar@seznam.cz>
1431 * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
1433 2005-12-21 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1435 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
1436 errors 1726 for strong named assemblies with InternalsVisibleToAttribute
1437 that doesn't contain the full public key. This is a update of the
1438 friend assemblies in .Net 2.0 release.
1440 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1444 * namespace.cs (NamespaceEntry): Add extern_aliases as a
1445 ListDictionary, to contain the ExternAliasEntry entries (in
1446 addition to the NamespaceEntry.aliases hashtable). This field is
1447 shared between the original entry and its doppelganger (bodyless
1449 (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1450 extern_aliases field.
1451 (NamespaceEntry.Lookup): Move the IsImplicit check after the
1452 lookup in extern_aliases.
1454 2005-12-16 Raja R Harinath <rharinath@novell.com>
1457 * class.cs (TypeContainer.Mark_HasEquals): New.
1458 (TypeContainer.Mark_HasGetHashCode): New.
1459 (ClassPart): Override them.
1460 (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1462 * generic.cs (GenericMethod.DefineMembers): Update to changes.
1463 (TypeParameter.TypeParameter): Change type of 'parent' argument to
1467 * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1468 'parent' argument to the base constructor.
1470 Remove all mention of TypeContainer from decl.cs.
1471 * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1472 (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1473 (DeclSpace.DeclSpace): Likewise.
1474 (DeclSpace.DefineMembers): Remove unused argument.
1475 * cs-parser.jay (pop_current_class): Update to changes. Simplify
1476 debugging check -- we don't care if the debug code throws an
1477 InvalidCastException instead of an InternalErrorException.
1478 * class.cs (TypeContainer.DefineMembers): Update to changes.
1479 (TypeContainer.DoDefineMembers): Likewise.
1480 (TypeContainer.GetMethods): Likewise.
1481 (PropertyMember.Define): Likewise.
1482 (MemberBase.Parent): New property that forwards to
1483 MemberCore.Parent, but ensures that we get a TypeContainer.
1484 * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1485 (RootContext.PopulateTypes): Likewise. Remove special case code
1486 for !RootContext.StdLib: DefineMembers is idempotent.
1488 2005-12-13 Marek Safar <marek.safar@seznam.cz>
1490 * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1492 2005-12-11 Atsushi Enomoto <atsushi@ximian.com>
1494 * doc.cs : The search for referenced namespace was insufficient to
1495 get global one as it used to do. Fixed bug #76965.
1497 2005-12-10 Atsushi Enomoto <atsushi@ximian.com>
1499 * doc.cs : check name in cref in the last phase that whether it is
1502 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1504 * cs-tokenizer.cs : reverted the latest change: it somehow broke
1507 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1509 * doc.cs : so it turned out that we cannot skip override check for
1510 interface members. Fixed bug #76954.
1512 2005-12-09 Atsushi Enomoto <atsushi@ximian.com>
1514 * cs-tokenizer.cs : fixed bug #75984:
1515 - #warning and #error should not be handled when the source line
1517 - #line is not checked strictly when the source line is disabled.
1518 - #define and #undef is on the other hand checked strictly at any
1521 2005-12-08 Atsushi Enomoto <atsushi@ximian.com>
1523 * cs-tokenizer.cs : missing Location (actually, filename) in one of
1526 2005-12-15 Raja R Harinath <rharinath@novell.com>
1528 * generic.cs (TypeManager.IsGeneric): Remove unused method.
1530 * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
1533 2005-12-14 Martin Baulig <martin@ximian.com>
1535 * typemanager.cs (TypeManager.GetFullName): Make this public;
1536 `Type.Fullname' now never returns null.
1538 * class.cs (Method.Define): Use TypeManager.GetFullName() for
1539 explicit interface implementations; we're now using the same
1540 naming convention than csc does.
1542 2005-12-14 Miguel de Icaza <miguel@novell.com>
1544 * convert.cs (ExplicitConversionCore): Check the return value from
1545 ExplicitConversionCore which can return null on failure. Fixes #76914
1547 2005-12-09 Raja R Harinath <rharinath@novell.com>
1549 * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
1550 instead of IsGenericInstance.
1551 * generic.cs (TypeManager.IsEqual): Likewise. Delete redundant
1552 code that's now covered by the more general test.
1553 * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
1555 * generic.cs (DropGenericTypeArguments): New. Captures the common
1556 pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
1557 * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
1558 * generic.cs, report.cs, typemanager.cs: Likewise.
1560 2005-12-08 Martin Baulig <martin@ximian.com>
1562 * generic.cs (TypeArguments.Resolve): Added CS1547 check.
1564 * typemanager.cs (TypeManager.CSharpSignature): Include type
1565 arguments in the signature of a generic method.
1567 2005-12-07 Martin Baulig <martin@ximian.com>
1569 Add support for custom attributes on type parameters.
1571 * cs-parser.jay (type_arguments): Added `opt_attributes'.
1573 * generic.cs (TypeParameterName): New public class; we use this
1574 instead of a `string' to store the name of a type parameter, so we
1575 can also have `Attributes'.
1576 (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
1577 array instead of a `string[]' array.
1578 (TypeParameter.ctor): We now also take an `Attributes' argument.
1579 (TypeParameter.EmitAttributes): New public method; emit our
1580 `OptAttributes' here.
1581 (GenericMethod.EmitAttributes): New public method; emit the custom
1582 attributes on all our type parameters.
1584 * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
1585 our type parameters.
1586 (MethodData.Define): If we're a generic method, call
1587 EmitAttributes() on it.
1589 2005-12-07 Martin Baulig <martin@ximian.com>
1592 (ConstraintChecker): New public abstract class; move the
1593 constraint checking here from `ConstructedType' and also do
1594 constraint checking for generic methods here.
1596 * expression.cs (Invocation.OverloadResolve): Use
1597 ConstraintChecker.CheckConstraints() if we resolved to a generic
1600 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1602 * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1604 * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1606 (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1607 (FieldBase.Initializer): Initializer is now optional.
1608 (EventField.Define): Only event field can have initializer.
1610 * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1612 * const.cs (Const): Reuse initializer.
1614 * cs-parser.jay: Updated after FieldBase changes.
1615 Added current_array_type to simplify array initializers.
1617 * ecore.cs (NullCast.IsDefaultValue): Implemented.
1619 * expression.cs, iterators.cs: Updated.
1621 * namespace.cs (NamespaceEntry): Made UsingFound private.
1623 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1625 * parameterCollection.cs: Obsolete, removed.
1626 * parser.cs: Obsolete, removed.
1628 2005-12-05 Marek Safar <marek.safar@seznam.cz>
1631 * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1633 * enum.cs (Enum.Define): Set obsolete context here.
1635 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
1638 - FindDocumentedMember() now expects 1) paramList as null
1639 when "we don't have to check the number of parameters" and
1640 2) Type.EmptyTypes when "there is no arguments".
1641 - Introduced FoundMember struct to hold the exact type which was
1642 used to find the documented member (the above change broke
1643 test-xml-044; it might be better just to use DeclaringType than
1644 what MS does, like this change does, but it depends on usage.)
1646 2005-12-05 Atsushi Enomoto <atsushi@ximian.com>
1648 * doc.cs : documented member might be from DeclaringType for nested
1649 types. Fixed bug #76782.
1651 2005-12-03 Ben Maurer <bmaurer@ximian.com>
1653 * anonymous.cs: Have the param code handle leaving copies on the
1654 stack etc. Allows anonymous params to take part in the assignment
1655 code (++, +=, etc). Fixes bug #76550
1657 * expression.cs: Handle the prepare_for_load/leave_copy by passing
1658 it down to the anon code.
1660 * iterators.cs: Use dummy var here
1662 * codegen.cs: Handle new vars
1664 2005-12-01 Marek Safar <marek.safar@seznam.cz>
1667 * class.cs (MethodData.Define): Set proper Obsolete context.
1669 * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1671 (FieldExpr.DoResolve): Ditto.
1673 2005-12-01 Marek Safar <marek.safar@seznam.cz>
1676 * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1677 parent is not obsolete.
1679 2005-12-01 Atsushi Enomoto <atsushi@ximian.com>
1681 * doc.cs : (FindDocumentedMember) find parameterless members first
1682 and get CS0419 in the early stage. Fixed first case of bug #76727.
1684 2005-11-30 Marek Safar <marek.safar@seznam.cz>
1687 * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1688 no error was reported.
1690 *expression.cs (Binary.DoResolve): left can be null.
1692 2005-12-06 Raja R Harinath <rharinath@novell.com>
1694 * class.cs (MethodCore.CheckGenericOverride): Delete unused
1695 abstract method and all overrides.
1696 * support.cs (ParameterData.GenericConstraints): Delete.
1697 (ReflectionParameters.type_params): Delete.
1698 (ReflectionParameters.ReflectionParameters): Make private.
1699 (ReflectionParameters.GetConstaints): New factory method.
1700 * generic.cs (TypeParameterDefineType): Use it.
1701 (TypeManager.GetTypeParameterConstraints): Likewise.
1703 2005-11-22 Marek Safar <marek.safar@seznam.cz>
1706 * class.cs (MethodData.Emit): Parameters should be labeled first.
1708 2005-11-21 Marek Safar <marek.safar@seznam.cz>
1711 * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1713 2005-11-18 Marek Safar <marek.safar@seznam.cz>
1715 * attribute.cs (AreParametersCompliant): Moved to Parameter.
1717 * class.cs (MethodCore): Parameter clean up.
1718 (IMethodData): Added ParameterInfo.
1719 (MethodData): Parameter clean up.
1720 (Indexer.Define): Parameter clean up.
1732 * typemanager.cs: Parameter clean up.
1734 * delegate.cs (Define): Get rid of duplicated code.
1736 * expression.cs (ParameterReference): Removed useless parameters
1738 (Invocation): Ditto.
1740 * parameter.cs (ParamsParameter): New class, params specialization.
1741 (ArglistParameter): Attemp to separate arglist.
1742 (Parameter): Refactored to be reusable and faster.
1743 (Parameter.Modifier): Made understandable.
1744 (Parameters): Changed to be used as a class for `this' assembly
1745 parameters. Refactored to use new specialized classes.
1747 * support.cs (ParameterData): Added Types property.
1748 (InternalParameters): Deleted.
1750 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1752 * doc.cs : the previous patch does not actually fix the bug.
1753 PropertyInfo override check is now implemented and really fixed it.
1754 * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
1756 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1758 * doc.cs : apply "override filter" also to properties.
1761 2005-11-16 Atsushi Enomoto <atsushi@ximian.com>
1763 * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
1764 no need to check overrides. For classes, omit those results from
1765 interfaces since they must exist in the class. Fixed bug #76726.
1767 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1769 * typemanager.cs : (GetFullNameSignature) differentiate indexers
1770 with different parameters. Fixed the second problem in #76685.
1772 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1774 * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
1775 get expected 'protected' access in CheckValidFamilyAccess()).
1778 2005-11-15 Atsushi Enomoto <atsushi@ximian.com>
1780 * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
1781 Fixed bug #76705. CS1569 was incorrectly commented out.
1783 2005-11-23 Martin Baulig <martin@ximian.com>
1785 * generic.cs (Constraints.Define): Removed.
1786 (TypeParameter.DefineConstraints): Removed.
1787 (TypeParameter.DefineType): Call SetGenericParameterAttributes()
1788 on the GenericTypeParameterBuilder here.
1790 2005-11-23 Martin Baulig <martin@ximian.com>
1792 * typemanager.cs (TypeManager.GetProperty): Make this public.
1794 * generic.cs (Nullable.NullableInfo.ctor): Use
1795 TypeManager.GetProperty() rather than using reflection directly.
1797 2005-11-17 Martin Baulig <martin@ximian.com>
1799 * expression.cs (Indexers.GetIndexersForType): Added support for
1800 generic parameters; fixes #76587.
1802 2005-11-17 Martin Baulig <martin@ximian.com>
1805 (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
1806 inherit the scope from our parent. Fixes #76653.
1808 2005-11-15 Martin Baulig <martin@ximian.com>
1810 * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
1811 instead of `ScopeTypeBuilder' to refer to the "current" type.
1812 (AnonymousMethod.CreateScopeType): Correctly create the helper
1813 class if we're inside a generic type definition.
1815 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
1817 * doc.cs : use Invocation.IsOverride() to do real override check.
1818 * expression.cs : made Invocation.IsOverride() internal.
1820 2005-11-14 Atsushi Enomoto <atsushi@ximian.com>
1822 * doc.cs : use TypeManager.FindMembers() instead of (possible)
1823 TypeBuilder.FindMembers() and filter overriden base members out.
1826 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1828 * doc.cs : ref/out parameters are represented as '@' (instead of
1829 '&' in type FullName). Fixed bug #76630 (additionally crefs).
1831 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1833 * doc.cs : when there was no '.' in cref to methods in doc comment,
1834 then parameters were missing in the output. Fixed bug #76691.
1836 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1838 * driver.cs : don't output docs when there is an error.
1841 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1844 Now it should detect indexers. Fixed primary concern in bug #76685.
1845 Fixed CS0419 message to not show the identical member signature in
1848 2005-11-13 Atsushi Enomoto <atsushi@ximian.com>
1850 * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
1851 instead of Type.FindMembers() since it does not handle events.
1854 2005-11-12 Gert Driesen <drieseng@users.sourceforge.net>
1856 * codegen.cs: Fixed typo (speficied -> specified).
1858 2005-11-11 Marek Safar <marek.safar@seznam.cz>
1861 * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
1863 2005-11-11 Marek Safar <marek.safar@seznam.cz>
1865 * attribute.cs: Changed error message.
1867 * cs-tokenizer.cs: One more check.
1869 2005-11-10 Marek Safar <marek.safar@seznam.cz>
1871 * statement.cs (Block.Resolve): Ignore empty statement.
1873 2005-11-10 Marek Safar <marek.safar@seznam.cz>
1875 * report.cs: Made error/warning methods more strict to avoid
1878 * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
1879 convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
1880 doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
1881 namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
1883 2005-11-11 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1885 * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute):
1886 Use the more explicit AssemblyName.FullName instead of
1887 AssemblyName.Name to report errors.
1889 2005-11-11 Marek Safar <marek.safar@seznam.cz>
1891 * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
1894 2005-11-10 Marek Safar <marek.safar@seznam.cz>
1904 * report.cs: Fixed error reporting and typos.
1906 * generic.cs (TypeParameter.GetSignatureForError): New method.
1907 (ConstructedType.GetSignatureForError): Instead of DeclarationName.
1909 * typemanager.cs (GetFullName): Refactored.
1911 2005-11-08 Marek Safar <marek.safar@seznam.cz>
1913 * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
1914 (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
1916 * class.cs (TypeContainer.IsComImport): New property.
1917 (Constructor.Define): Create proper ctor for ComImport types.
1919 * expression.cs (New.CheckComImport): Fixed.
1921 2005-11-07 Miguel de Icaza <miguel@novell.com>
1923 * anonymous.cs (CaptureContext.AddParameterToContext): The fact
1924 that a parameter has been captured does not mean that we do not
1925 have to do the rest of the processing. This fixes the second part
1926 of #76592. If there was another anonymous method capturing
1927 values in the past, the Scope would never be set for the second
1928 method that captured the same parameter.
1930 (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
1931 properly manipulate the stack. Second part of fix for #76592.
1933 * expression.cs (New): Add support for invoking "new" on
1934 interfaces that have been flagged with the ComImport attribute and
1935 the CoClass. Fixes #76637
1937 * statement.cs (Try.DoEmit): When a variable is captured, do not
1938 try to emit the vi.LocalBuilder variable as it has been captured.
1939 Create a temporary variable and store the results on the
1940 FieldBuilder. Fixes #76642
1942 2005-11-07 Marek Safar <marek.safar@seznam.cz>
1944 * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
1946 * ecore.cs (InstanceResolve): Fixed CS1540 detection.
1948 * expression.cs (Binary.DoResolve): Added && optimalization.
1950 * typemanager.cs (AddUserType): Removed useless argument.
1952 2005-11-04 Marek Safar <marek.safar@seznam.cz>
1954 * statement.cs (Block.variables): Uses ListDictionary.
1956 2005-11-03 Marek Safar <marek.safar@seznam.cz>
1959 * class.cs (PartialContainer.EmitType): Customized to emit
1960 security attributes.
1961 (ClassPart.ApplyAttributeBuilder): Transform security attribute
1962 for partial classes.
1964 2005-11-03 Marek Safar <marek.safar@seznam.cz>
1967 * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
1968 access has to be fixed.
1970 * typemanager.cs (IsUnmanagedType): Wrong common field type.
1972 2005-11-01 Marek Safar <marek.safar@seznam.cz>
1975 * ecore.cs (NullCast.Reduce): Implemented.
1977 * expression.cs (ArrayCreation.CheckIndices): Correcly check
1980 * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
1982 (Foreach.Resolve): Catch null properly.
1984 2005-10-29 Marek Safar <marek.safar@seznam.cz>
1986 * cs-tokenizer.cs: Warning text fix.
1988 * driver.cs: AllWarningNumbers exposed on public interface.
1990 * report.cs (): Reviewed warning numbers.
1991 (IsValidWarning): Use binary search.
1993 2005-10-29 Marek Safar <marek.safar@seznam.cz>
1995 * driver.cs: Implemeted resource visibility.
1996 (Resources): New class for code sharing between /res: and
1999 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2001 decl.cs (CurrentTypeParameters): Fixed to be public.
2003 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2005 generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
2007 2005-11-07 Marek Safar <marek.safar@seznam.cz>
2009 gmcs.exe.sources: Use CryptoConvert.cs from corlib.
2011 2005-11-05 Kornél Pál <kornelpal@hotmail.com>
2013 * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
2015 2005-11-04 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2017 Add friend assembly access support.
2018 * typemanager.cs: assembly_internals_vis_attrs
2019 cache for friend assembly access.
2020 (TypeManager.IsFriendAssembly): New method for
2021 checking friend assembly access.
2022 (TypeManager.Error_FriendAccessNameNotMatching): New
2024 (TypeManager.CompareKeyTokens): Likewise.
2025 (TypeManager.Filter): Handle friend accessible
2028 * namespace.cs (RootNamespace.GetTypeInAssembly): Return
2029 friend accessible types.
2031 * ecore.cs (Expression.IsAccessorAccessible): Handle
2032 friend accessible properties.
2034 * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
2037 2005-10-28 Marek Safar <marek.safar@seznam.cz>
2040 * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
2043 * convert (Convert.ImplicitReferenceConversion): NullCast holds
2046 * ecore.cs (NullCast): Child is contant only.
2048 * literal.cs (NullLiteral.Reduce): null can be converted to any
2051 2005-10-28 Kornél Pál <kornelpal@hotmail.com>
2053 * driver.cs: Use Encoding.Default as default code page instead
2056 2005-10-27 Raja R Harinath <rharinath@novell.com>
2059 * expression.cs (Invocation.Error_InvalidArguments): Handle
2060 __arglist parameters.
2061 (Invocation.VerifyArgumentsCompat): Likewise.
2062 * support.cs (ReflectionParameters.GetSignatureForError): Print
2063 __arglist parameters.
2064 (InternalParamters.GetSignatureForError): Likewise.
2065 * parameter.cs (Parameters.GetSignatureForError): Likewise.
2067 2005-10-26 Marek Safar <marek.safar@seznam.cz>
2069 * attribute.cs (GetPropertyValue): Made public.
2071 * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
2073 Add new property WrapNonExceptionThrows to handle 2.0 assembly
2075 (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
2078 * driver.cs: Reflect method name change.
2080 * statement.cs (Try.Resolve): Warn when try has both general
2083 * typemanager.cs: runtime_compatibility_attr_type new predefined
2086 2005-10-26 Raja R Harinath <harinath@gmail.com>
2089 * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
2090 treat it as an empty parameter list.
2092 2005-10-26 Raja R Harinath <rharinath@novell.com>
2095 * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back
2096 ResolveAsTypeStep silent.
2097 * statement.cs (Block.AddConstant): Mark block as used.
2098 (Block.ResolveMeta): Avoid piling on error messages
2099 if a constant initializer resolution fails.
2101 2005-10-25 Raja R Harinath <rharinath@novell.com>
2103 * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
2105 (NamespaceEntry.VerifyAllUsing): New.
2106 (NamespaceEntry.AliasEntry.Resolve): New. Handles common error
2107 behaviour. Delegates actual resolution of alias to ...
2108 (NamespaceEntry.DoResolve): ... this. Renamed from Resolve.
2109 (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
2111 * driver.cs (Driver.MainDriver): Update.
2113 * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
2114 (NamespaceEntry.SymbolFileID): Make into a on-demand computed
2116 (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
2118 * symbolwriter.cs (SymbolWriter.Initialize): Don't call
2119 RootNamespace.DefineNamespacesForAll.
2121 2005-10-24 Raja R Harinath <harinath@gmail.com>
2123 * typemanager.cs (assemblies, external_aliases, modules)
2124 (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
2125 (ComputeNamespaces, GetRootNamespace): Remove extra staging
2126 overhead. Move resposibility ...
2127 * namespace.cs (GlobalRootNamespace): ... here. Update to changes.
2128 * driver.cs, attribute.cs, codegen.cs: Update to changes.
2130 2005-10-23 Raja R Harinath <harinath@gmail.com>
2132 * namespace.cs (RootNamespace.all_namespaces): Renamed from
2133 cached_namespaces. Improve usage.
2134 (RootNamespace.Reset, RootNamespace.RegisterNamespace)
2135 (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
2136 Move from GlobalRootNamespace and simplify.
2137 (RootNamespace.Global): Make instance variable.
2138 (RootNamespace.RootNamespace): Add "alias name" parameter.
2139 (GlobalRootNamespace): Simplify drastically.
2140 (Namespace.Lookup): Don't use GetNamespace.
2141 * typemanager.cs (GetRootNamespace): Rename from
2142 ComputeNamespaceForAlias.
2143 (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2145 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2147 * anonymous.cs (AnonymousContainer): Don't crash when container
2150 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2152 * expression.cs (Binary.DoResolve): Warn when comparing same
2155 2005-10-23 Marek Safar <marek.safar@seznam.cz>
2158 * expression.cs (Binary.DoResolve): It looks like there are no
2159 convetsion rules in enum context.
2161 2005-10-19 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2163 Add support for extern alias qualifiers.
2164 * typemanager.cs: Move some LookupTypeReflection code
2165 to namespace.cs, to have cleaner code. Added some methods
2166 to help us keep track of the extern aliased references.
2167 * driver.cs: Add suport for extern alias assemblies on command
2168 line and check for their warnings/errors. Also keep track of the
2169 extern aliased assemblies.
2170 * namespace.cs: Move the global functionality of Namespace
2171 to GlobalRootNamespace/RootNamespace. Now the global namespace
2172 is GlobalRootNamespace.Globa. Also the code moved from
2173 typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs.
2174 Finally added LocalAliasEntry (AliasEntry before) and
2175 ExternAliasEntry, to handle alias statements.
2176 * cs-parser.jay: Add support in the grammar for extern alias
2178 * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs:
2179 Update callings to Namespace (now in GlobalRootNamespace).
2181 2005-10-25 Martin Baulig <martin@ximian.com>
2183 * convert.cs (ImplicitTypeParameterConversion): Make base
2184 interfaces actually work; fixes #76557.
2186 2005-10-25 Martin Baulig <martin@ximian.com>
2189 (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
2190 all the type parameters; fixes #76551.
2192 2005-10-25 Martin Baulig <martin@ximian.com>
2197 (GenericMethod.ctor): Added `Expression return_type' and
2198 `Parameters parameters' arguments.
2199 (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
2200 parameter and return types to check their constraints if they're
2203 * codegen.cs (EmitContext.ResolvingGenericMethod): New public
2206 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
2207 constraints of a generic type if `ec.ResolvingGenericMethod'.
2209 * class.cs (MethodCore.DoDefineParameters): Set
2210 `ec.ResolvingGenericMethod' if we're a generic method.
2211 (MemberBase.MemberType): Likewise.
2213 2005-10-25 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2215 * typemanager.cs (TypeManager): Added
2216 TypeManager.internals_visible_attr_type to cache
2217 S.R.CompilerServices.InternalsVisibleToAttribute.
2219 * codegen.cs (AssemblyClass): Added checks for
2220 InternalsVisibleToAttribute in new method
2221 CheckInternalsVisibleAttribute () and also cache the
2222 AssemblyName in AssemblyClass.Name.
2224 2005-10-24 Martin Baulig <martin@ximian.com>
2227 (TypeManager.ExpandInterfaces): Added overloaded version which
2228 just takes a `Type[]' array.
2231 (Constraints.Resolve): Don't expand the interfaces here; ie. we
2232 just use the interfaces which were explicitly specified and not
2233 the interfaces they inherit. Fixes #76482.
2234 (TypeParameter.FindMembers): Expand the interfaces here.
2236 2005-10-21 Martin Baulig <martin@ximian.com>
2239 (Constraints.Resolve): Also resolve the actual types here.
2240 (Constraints.ResolveTypes): Just check the constraints here.
2241 Fixes #76363; see gtest-218.cs.
2243 2005-10-21 Martin Baulig <martin@ximian.com>
2246 (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
2247 instead of a `BoxedCast'; fixes gtest-217.cs.
2249 2005-10-20 Atsushi Enomoto <atsushi@ximian.com>
2251 * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
2252 1) "new()" is specified as generic parameter constraint and 2) the
2253 type is TypeBuilder and 3) the type is abstract even if it has a
2254 default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
2256 2005-10-20 Martin Baulig <martin@ximian.com>
2259 (GenericConstraints.TypeParameter): New public property.
2260 (TypeParameter.ctor): Also take a `DeclSpace' argument.
2261 (TypeParameter.DeclSpace): New public property.
2262 (TypeParameter.DefineType): Inflate the constraints if our
2263 `DeclSpace' is an `Iterator'.
2265 2005-10-19 Atsushi Enomoto <atsushi@ximian.com>
2267 * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added
2268 GenericMethod argument to compare methods' generic type arguments.
2271 2005-10-19 Martin Baulig <martin@ximian.com>
2273 * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
2274 not ResolveType() when resolving the base type, so we're not
2275 checking the constraints here.
2276 (TypeContainer.ResolveType): Call ResolveType() on our base_type
2279 2005-10-19 Martin Baulig <martin@ximian.com>
2281 * generic.cs (ConstructedType.CheckConstraints): Committing
2282 untested fix for #76441.
2284 2005-10-18 Raja R Harinath <rharinath@novell.com>
2287 * class.cs (TypeContainer.DefineType): Move updating of
2288 topological sort earlier in the code.
2289 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2291 2005-10-18 Marek Safar <marek.safar@seznam.cz>
2294 * cfold.cs (BinaryFold): Reduce constant in enum conversion.
2296 * constant.cs (Constant.TryReduce): Moved from Cast class.
2297 (Reduce): Made little bit more OO and fixed missing conversions.
2299 * ecore.cs (Reduce): Implemented.
2300 (Binary.EnumLiftUp): New method to upgrade values to enum values.
2302 * literal.cs (Reduce): Implemented.
2304 * class.cs: Reverted Miguel's wrong commit.
2306 2005-10-14 Miguel de Icaza <miguel@novell.com>
2308 * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2310 2005-10-14 Atsushi Enomoto <atsushi@ximian.com>
2312 * cs-parser.jay, expression.cs : CS0214 was missing error location
2313 for constants. Fixed bug #76404.
2315 2005-10-10 Raja R Harinath <rharinath@novell.com>
2317 * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2319 (PropertyExpr.EmitCall): Likewise.
2320 * expression.cs (Invocation.EmitArguments): Handle case where
2322 (Invocation.EmitCall): Avoid allocating temporary variable if
2323 there are no arguments.
2325 2005-10-11 Marek Safar <marek.safar@seznam.cz>
2328 * convert.cs (ExplicitConversionCore): Fixed object->enum
2331 2005-10-07 Raja R Harinath <rharinath@novell.com>
2334 * convert.cs (ImplicitConversionStandard): Move conversion of
2335 void* to arbitrary pointer types ...
2336 (ExplicitConversionStandard): .. here.
2337 * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2338 error to always print typenames.
2340 2005-10-07 Raja R Harinath <rharinath@novell.com>
2342 * convert.cs (GetConversionOperator): Rename from
2343 GetConversionOperators. Move operator selection code from ...
2344 (UserDefinedConversion): ... here.
2346 2005-10-06 Marek Safar <marek.safar@seznam.cz>
2348 * convert.cs (ExplicitConversionCore): Removed duplicate enum
2351 2005-10-05 Marek Safar <marek.safar@seznam.cz>
2353 * assign.cs (Assign.DoResolve): Error method changed.
2355 * cfold.cs (DoConstantNumericPromotions): Error method changed.
2357 * const.cs (ResolveValue): Reset in_transit immediately.
2359 * constant.cs: Error method changed.
2361 * convert.cs: Removed useless location parameter.
2362 (ExplicitNumericConversion): Don't do double enum check.
2363 (ExplicitConversionCore): Renamed from ExplicitConversion.
2364 (ExplicitUnsafe): Extracted from ExplicitConversion.
2365 (ExplicitConversion): Uses for error reporting.
2367 * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2369 (ResolveBoolean): Uses common error method.
2370 (CastToDecimal): Get rid of ec.
2371 (CastFromDecimal): Optimized.
2372 (ConvCast): Get rid of ec.
2374 * enum.cs (ResolveValue): Reset in_transit immediately.
2375 (Emit): Return after first error.
2377 * expression.cs: Convert changes.
2379 * literal.cs: Error method changed.
2381 * statement.cs: Error method changed.
2383 2005-10-06 Raja R Harinath <rharinath@novell.com>
2385 Fix gtest-131.cs and gtest-211.cs.
2386 * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
2387 Only emit code for a label if it is used. Unreachable code can
2388 violate ECMA evaluation stack invariants.
2390 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2392 * anonymous.cs: Implemented ExprClassName.
2394 * assign.cs (Assign.DoResolve): Don't chrash when type is not
2397 * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2400 * class.cs (StaticClass.DefineContainerMembers): Report protected
2403 * codegen.cs: if(ed) PRODUCTION.
2405 * convert.cs (Error_CannotImplicitConversion): Better error
2408 * cs-parser.jay: More error checks.
2410 * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2412 * driver.cs (CSCParseOption): Enabled wrong option check.
2414 * ecore.cs (Expression.ExprClassName): Turned to property.
2415 (MemberExpr.CheckIntermediateModification): For checking boxed
2416 value types modification.
2418 * statement.cs (Fixed.Resolve): Expression type must be
2419 convertible to fixed type.
2420 (CollectionForeach.GetEnumeratorFilter,TryType):
2421 Small refactoring for easier error checking.
2423 2005-09-26 Marek Safar <marek.safar@seznam.cz>
2425 * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2428 * class.cs (GeneratedBaseInitializer): New class for customization
2429 compiler generated initializers.
2430 (MemberBase.DoDefine): Check Obsolete attribute here.
2431 (FieldMember.DoDefine): Ditto.
2433 * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2436 * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2437 (MemberCore.GetObsoleteAttribute): Removed argument.
2438 (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2439 (MemberCore.CheckObsoleteType): New helper.
2443 * statement.cs: Updates after MemberCore changes.
2445 * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2446 (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2448 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2449 obsolete attribute for compiler construct.
2450 (As.DoResolve): Cache result.
2452 * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2454 2005-10-01 Miguel de Icaza <miguel@novell.com>
2456 * expression.cs (Probe): instead of having a "Type probe_type"
2457 keep the extra information as a TypeExpr probe_type_expr since the
2458 "As" operator needs to perform some type checks.
2460 * (As.DoResolve): If the type is a type parameter, ensure that it
2461 is constrained by a class.
2463 2005-09-22 Miguel de Icaza <miguel@novell.com>
2465 * statement.cs (Lock): Use the TemporaryVariable class instead of
2466 manually using local variables as those do not work when variables
2469 * ecore.cs: Moved the TemporaryVariable class from being a nested
2470 class inside Foreach to be a public class that can be employed in
2473 2005-09-19 Marek Safar <marek.safar@seznam.cz>
2475 * cs-parser.jay: interface_accessors replaced by
2476 accessor_declarations.
2478 * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2481 * statement.cs (GotoCase.Resolve): Convert null constant to
2483 (SwitchLabel.ResolveAndReduce): Ditto.
2484 (SwitchLabel.NullStringCase): Custom null stamp.
2485 (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2487 typemanager.cs (CSharpSignature): Don't skip first argument
2490 2005-09-16 Marek Safar <marek.safar@seznam.cz>
2492 * cfold.cs, constant.cs, convert.cs, ecore.cs,
2493 expression.cs, iterators.cs, literal.cs: Store constants and
2496 * class.cs (MemberBase.ShortName): Pass location.
2498 * cs-parser.jay: Some location fixes.
2500 * ecore.cs (Expression.Location): Made virtual.
2502 2005-09-27 Marek Safar <marek.safar@seznam.cz>
2505 * const.cs (Const.ResolveValue): Check for assigning non-null
2506 value to reference type.
2508 2005-09-26 Raja R Harinath <rharinath@novell.com>
2511 * expression.cs (This.VerifyFixed): In a value type T, the type of
2512 'this' is T&, iow, 'this' is either an out or ref parameter. In a
2513 value type R, 'this' is treated as a value parameter.
2515 2005-09-05 Miguel de Icaza <miguel@novell.com>
2517 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2518 if the underlying types are the same, otherwise we need to produce
2519 code that will do the proper cast.
2521 This was exposed by Marek's constant rewrite which produced
2522 invalid code for the call site:
2525 void Method (X v) {}
2529 This fixes test-49.cs
2531 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2533 * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2534 Type/Object should be allowed as well. Fixed bug #75968.
2536 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2538 * expression.cs : (Binary.DoResolve): when one is enum constant and
2539 another is constant 0, then return enum one *as enum type*.
2542 2005-10-04 Martin Baulig <martin@ximian.com>
2544 * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
2545 `SetMemberIsUsed()' work for generics, too.
2547 2005-10-04 Martin Baulig <martin@ximian.com>
2549 * expression.cs (DelegateInvocation.EmitStatement): Make this work
2550 for corlib. Fixes #75691.
2552 2005-09-28 Marek Safar <marek.safar@seznam.cz>
2555 * driver.cs: Fix compilation files with full root path.
2557 2005-09-25 Miguel de Icaza <miguel@novell.com>
2559 * report.cs (SymbolRelatedToPreviousError): Format the output so
2560 it does not use an open parenthesis that is never closed.
2562 * driver.cs: Follow coding guidelines
2564 2005-09-18 Miguel de Icaza <miguel@novell.com>
2566 * driver.cs: Set InEmacs based on the environment variable EMACS.
2568 * location.cs (InEmacs): in this mode, do not report column
2569 location as it confuses Emacs.
2571 2005-10-03 Raja R Harinath <rharinath@novell.com>
2573 * support.cs (SeekableStreamReader.Position): Don't error out when
2574 the requested position is just beyond the end of the current
2577 2005-09-28 Raja R Harinath <rharinath@novell.com>
2579 * support.cs (SeekableStreamReader): Simplify drastically. Don't
2580 try to keep in sync with the byte count of the underlying Stream.
2581 However, this limits us to a window size of 2048 characters: i.e.,
2582 the maximum lookahead of our lexer/parser can be 2048 characters.
2584 2005-09-22 Martin Baulig <martin@ximian.com>
2586 * driver.cs: Removed a debugging FIXME.
2588 2005-09-21 Raja R Harinath <rharinath@novell.com>
2590 * cs-parser.jay (type_arguments): Add CS1644 check.
2591 * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
2593 2005-09-15 Raja R Harinath <rharinath@novell.com>
2595 * Makefile (PROGRAM): Make profile specific.
2596 (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
2597 the current directory.
2600 * expression.cs (Invocation.EmitCall): Remove optimization on
2601 this_call since it doesn't handle 'this' being a value type.
2603 2005-09-05 Geoff Norton <gnorton@customerdna.com>
2605 * driver.cs: Ensure file handles are closed after parsing
2607 2005-09-05 Miguel de Icaza <miguel@novell.com>
2609 * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2610 if the underlying types are the same, otherwise we need to produce
2611 code that will do the proper cast.
2613 This was exposed by Marek's constant rewrite which produced
2614 invalid code for the call site:
2617 void Method (X v) {}
2621 This fixes test-49.cs
2623 2005-09-05 Martin Baulig <martin@ximian.com>
2625 * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
2626 instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
2628 * cs-parser.jay (delegate_declaration): Small fix for #75852.
2630 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2632 * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
2633 to be a pointer type due to the spec 25.2, so check if declaring
2634 type is generic type definition. Fixed bug #75772.
2636 2005-09-05 Atsushi Enomoto <atsushi@ximian.com>
2639 * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
2640 both types are not defined by methods.
2641 * expression.cs : (Invocation.IsApplicable): it should work when
2642 the argument type is equal to the parameter type, not only when
2643 ImplicitConversionExists() returns true.
2645 2005-09-02 Raja R Harinath <rharinath@novell.com>
2647 * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2651 * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2652 flow-branching for LocalVariableReferences in case we were invoked
2653 from a MemberAccess.
2654 * expression.cs (LocalVariableReference.VerifyAssigned): New.
2656 (LocalVariableReference.DoResolveBase): ... this.
2657 (MemberAccess.Resolve): Do the check that was disabled during
2660 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
2663 (PartialContainer.Create): check abstract/sealed/static strictly
2664 but abstract/sealed can exist only at one side. Fixed bug #75883.
2666 2005-09-01 Kornél Pál <kornelpal@hotmail.com>
2669 * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2670 specified, don't default to UnmanagedType.I4.
2672 2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
2674 * expression.cs : conditional operator should check possibly
2675 incorrect assign expression. Fixed bug #75946.
2677 2005-08-30 Raja R Harinath <rharinath@novell.com>
2680 * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2681 (ScopeInfo.EmitScopeType): Use it to construct field names from
2682 names of captured locals.
2685 * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2686 * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2687 Pass 'target_type' to BoxedCast. Don't default to 'object'.
2688 (ExplicitConversion): Remove enum cases already handled by
2689 implicit conversion. Move implicit conversion check to the beginning.
2690 * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2691 * expression.cs (ArrayCreation.EmitDynamicInitializers):
2692 Don't treat System.Enum as a struct.
2694 2005-08-30 Jb Evain <jbevain@gmail.com>
2696 * attribute.cs: handles as expression in parameters.
2698 2005-08-30 Raja R Harinath <rharinath@novell.com>
2701 * class.cs (TypeContainer.VerifyClsName): Don't use a
2702 PartialContainer when verifying CLS compliance.
2703 (AbstractPropertyEventMethod): Set Parent here, ...
2704 (PropertyMethod): ... not here.
2706 2005-08-30 Atsushi Enomoto <atsushi@ximian.com>
2708 * attribute.cs : escaped attribute name should not be allowed to be
2709 resolved (e.g. @class as classAttribute). Fixed bug #75930.
2711 2005-08-29 Raja R Harinath <rharinath@novell.com>
2714 * convert.cs (ImplicitStandardConversionExists): Allow zero also
2715 when converting a long constant to unsigned long.
2716 * expression.cs (Invocation.OverloadResolve): Add sanity check to
2717 detect where IsApplicable and VerifyArgumentsCompat disagree.
2719 2005-08-29 Raja R Harinath <rharinath@novell.com>
2720 and Carlos Alberto Cortez <carlos@unixmexico.org>
2723 * class.cs (TypeContainer.CanElideInitializer): New helper.
2724 (TypeContainer.EmitFieldInitializers): Use it to determine if we
2725 can safely emitting the initializer of a field.
2727 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2729 * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2730 allowed inside a switch (without loop). Fixed bug #75433.
2732 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
2734 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2735 * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2737 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2739 * driver.cs : kinda reverting the default encoding changes (not exact
2740 revert since I noticed that "codepage:reset" might not work fine).
2742 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2744 * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2745 Location. Now getter and setter store location correctly.
2746 (errors/cs0111-12.cs now reports the expected location.)
2748 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
2750 * driver.cs : Use default encoding on the environment.
2751 Removed (now that) extra parameter for SeekableStreamReader.
2752 * support.cs : (SeekableStreamReader) third .ctor() argument for
2753 StreamReader is not required (always true). preamble size could
2754 be acquired in simpler and safe way.
2756 2005-08-24 Atsushi Enomoto <atsushi@ximian.com>
2758 * cs-parser.jay: report CS0642 at warning level 3
2759 and report CS0642 for an if else statement also
2760 fixes bug #74745. Patch by John Luke (and a bit
2762 Removed extra CS0642 warning check for "while",
2764 * statement.cs: In Block.Resolve(), CS0642 check
2765 is reimplemented to check a sequence of an empty
2766 statement and a block.
2768 Both fix bug #66777.
2770 2005-08-24 Marek Safar <marek.safar@seznam.cz>
2772 * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2773 detection until I fix it.
2775 * cs-tokenizer.cs: Changed error message.
2777 * cs-parser.jay: Fixed 2 error locations.
2779 * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2780 (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2783 * enum.cs (GetSignatureForError): Fixed.
2785 * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2789 * typemanager.cs (RegisterProperty): Removed.
2791 * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2793 2005-08-24 Raja R Harinath <rharinath@novell.com>
2796 * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2797 (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2799 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2801 * expression.cs : tiny fix is required for not warning positive ulong.
2804 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2806 * expression.cs : add CS0652 check for constant and integral
2807 expression. Fixed bug #53974.
2809 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2811 * expression.cs : in DoNumericPromotions(), check if there is implicit
2812 conversion overload for string (to check CS0034). Fixed bug #52492.
2814 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2816 * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2818 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2820 * ecore.cs : report location when it is *not* Null.
2822 2005-08-23 Atsushi Enomoto <atsushi@ximian.com>
2828 Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2829 correctly. Fixed bug #75721.
2831 2005-08-23 Raja R Harinath <rharinath@novell.com>
2833 * support.cs (SeekableStreamReader.Position): Avoid an expensive
2834 loop that performs 'min (pos, char_count)'.
2837 * expression.cs (Unary.ResolveOperator): Don't discard implicit
2838 converted value in Operator.OnesComplement.
2840 2005-08-22 Ben Maurer <bmaurer@ximian.com>
2842 * anonymous.cs: If the anon method is pulled into a helper class,
2843 it needs to be `internal' not `private'. Fixes runtime behavior on
2846 2005-08-17 Marek Safar <marek.safar@seznam.cz>
2849 * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2852 2005-08-16 Marek Safar <marek.safar@seznam.cz>
2854 The big constants rewrite
2855 Fix #75746, #75685 and more
2856 As a side effect saved 1MB for MWF ;-)
2858 * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2859 (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2860 enum based for corlib compilation.
2862 * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2865 * class.cs (FixedField.Define): Use ResolveAsConstant.
2867 * const.cs (IConstant): Interface constants and enums.
2868 (Const.ResolveValue): New method for constant resolvning.
2869 (ExternalConstant): Constants from imported assemblies.
2871 * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2872 conversion; like enums.
2873 (Constant.ToType): Converts this constant to different type.
2874 (Constant.Increment): Adds 1.
2876 * convert.cs (ImplicitConversionRequired): Simplified.
2878 * cs-parser.jay: Create EnumMember directly.
2880 * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
2882 * doc.cs (GenerateEnumDocComment): Removed.
2884 * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
2885 (ConvertIntLiteral): Removed.
2886 (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
2888 * enum.cs (EnumMember): Implement IConstant.
2889 (Enum.IsValidEnumConstant): Removed.
2890 (Enum.GetNextDefaultValue): Removed.
2891 (Enum.FindMembers): Updated.
2892 (Enum.GenerateDocComment): Iterate enum members.
2894 * expression.cs (Cast.TryReduce): Handle enums correctly.
2895 (New.Constantify): Made public.
2896 (MemberAccess.DoResolve): Removed contant specific if(s).
2898 * literal.cs (NullLiteral): Implement new abstract methods.
2900 * statement.cs (GotoCase.Resolve): Use new constant methods.
2901 (SwitchLabel.ResolveAndReduce): Use new constant methods.
2903 * typemanager.cs (LookupEnum): Removed.
2904 (IsEnumType): Fixed to work with corlib.
2905 (RegisterConstant): Removed.
2906 (LookupConstant): Removed.
2907 (GetConstant): Changed to work with IConstant.
2909 2005-08-04 Atsushi Enomoto <atsushi@ximian.com>
2911 * location.cs : Fixed overflown (>255) column number.
2913 2005-08-03 Raja R Harinath <rharinath@novell.com>
2915 First cut of the qualified-alias-member feature.
2916 * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
2918 * cs-parser.jay (DOUBLE_COLON): New token.
2919 (namespace_or_type_name): Add rule for recognizing
2920 qualified-alias-members.
2921 (primary_expression): Likewise.
2922 (element_access): Allow QualifiedAliasMember as a possible
2923 type-bearing expression.
2924 (local_variable_type, local_variable_pointer_type): Likewise.
2925 * namespace.cs (NamespaceEntry.LookupAlias): New. Looks up
2926 aliases in the current and enclosing namespace declarations.
2927 (NamespaceEntry.UsingAlias): Add CS0440 warning.
2928 * decl.cs (MemberName.is_double_colon): New.
2929 (MemberName.MemberName): Add new constructor for alias-member.
2930 (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2931 * expression.cs (QualifiedAliasMember): New expression type.
2933 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2935 * location.cs : it borked when no argument was specified.
2937 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2939 * location.cs : tiny ToString() format fix.
2941 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2943 * statement.cs : oops, it was missing.
2945 2005-08-02 Atsushi Enomoto <atsushi@ximian.com>
2947 A set of fixes for precise line/column location.
2950 "token" field now holds a file/line "delta", a line number offset
2951 from the segment, and a column number. See also:
2952 http://lists.ximian.com/pipermail/mono-devel-list/2004-
2953 December/009508.html
2954 Removed static IsNull. Use instance IsNull property instead.
2956 For some tokens it stores Location. For Identifier it stores
2957 LocatedToken which is a pair of string name and location.
2958 Column numbers are adjusted only at getChar().
2960 Use Location.ToString() for reporting (it now contains column).
2962 Largely modified to use LocatedToken instead of
2963 string (IDENTIFIER), and to acquire Location from some tokens.
2964 * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2965 iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2967 Now MemberName holds Location. DeclSpace.ctor() receives Location
2968 as a parameter. Removed extra parameters to all derived classes.
2969 Replaced Location.IsNull() with instance property.
2970 * assign.cs, expression.cs :
2971 Added .ctor() overload that omits Location.
2973 Added "nameEscaped" flag that indicates the identifier was escaped
2974 in the source file. This fixes bug #57047.
2976 2005-09-02 Martin Baulig <martin@ximian.com>
2978 * class.cs: Make CS3005 a warning, not an error.
2980 2005-08-02 Marek Safar <marek.safar@seznam.cz>
2982 * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2983 New method, looking for lo-case imported cls type.
2985 * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2988 * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2990 * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2992 * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2994 (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2996 Optimized to save 3.5 MB for SWF compilation.
2998 2005-08-01 Marek Safar <marek.safar@seznam.cz>
3000 * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
3001 (PartialContainer.Create): Moved logic AddToContainer.
3002 (PartialContainer.MarkForDuplicationCheck): Shares name.
3004 * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
3007 * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3009 (Namespace.GetSignatureForError): New method.
3011 * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3012 (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3014 2005-08-01 Raja R Harinath <rharinath@novell.com>
3017 * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3018 member lookup rather than qualifier_type, since qualifier_type can
3021 2005-08-01 Marek Safar <marek.safar@seznam.cz>
3023 * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3026 2005-07-31 Miguel de Icaza <miguel@novell.com>
3028 * statement.cs: Copy the local exception into the exception
3029 captured local. Fixes 75674
3031 2005-07-31 Raja R Harinath <harinath@gmail.com>
3034 * expression.cs (Invocation.OverloadResolve): Don't report error
3035 CS1501 if error CS1502 has been reported.
3036 (New.DoResolve): Delegate CS1501 reporting to
3037 Invocation.OverloadResolve.
3040 * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3041 invariant-meaning-in-block property in an enclosing block if
3044 2005-07-29 Marek Safar <marek.safar@seznam.cz>
3046 * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3047 (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3048 (Switch.CheckSwitch): Just save 50kb for SWF.
3050 2005-07-27 Martin Baulig <martin@ximian.com>
3052 * anonymous.cs (CaptureContext.AddField): Added
3053 `AnonymousContainer am' argument; compute its toplevel scope if
3054 it's not already computed. Fixes #75649.
3056 2005-07-26 Raja R Harinath <rharinath@novell.com>
3059 * class.cs (Constructor.Emit): Reset block to null if the block
3062 2005-07-25 Marek Safar <marek.safar@seznam.cz>
3064 * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3066 2005-07-25 Marek Safar <marek.safar@seznam.cz>
3068 * class.cs (MethodData.Define): Check whether accessor implementing
3069 interface is public.
3071 * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3073 2005-07-22 Marek Safar <marek.safar@seznam.cz>
3076 * namespace.cs (LookupType): Moved same type check to...
3078 * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3081 2005-07-21 Raja R Harinath <rharinath@novell.com>
3083 * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3084 already found a typebuilder.
3085 * class.cs (MethodCore.IsDuplicateImplementation): Compare
3086 MemberNames, not strings.
3088 * const.cs (Error_ExpressionMustBeConst):
3089 Rename from Error_EpressionMustBeConst.
3090 * const.cs, class.cs, statement.cd: Update.
3092 2005-07-21 Marek Safar <marek.safar@seznam.cz>
3096 * const.cs (Const.LookupConstantValue): Report missing contant expression
3098 (Error_EpressionMustBeConstant): Only one error method.
3100 * class.cs, statement.c: Updated.
3102 2005-07-20 Raja R Harinath <rharinath@novell.com>
3104 * statement.cs (Block.Flags): Add back HasVarargs.
3105 (Block.flags): Make protected.
3106 (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3108 * typemanager.cs (types, typecontainers, user_types): Remove.
3109 (UserTypes, TypeContainers): Likewise.
3110 (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3111 (CleanUp, Reset): Update.
3112 (AddUserType): Combine variants. Now, only updates builder_to_declspace.
3113 (GetNestedType): Use Type.GetNestedType.
3114 (CoreLookupType): Take two arguments, the namespace and the
3115 basename of the type. Update to use the Namespace.Lookup
3117 (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3118 (RealMemberLookup): Use IsNestedChildOf instead of playing with
3119 string concatenation and substring matches.
3120 * class.cs, enum.cs, delegate.cs: Update to changes.
3122 2005-07-20 Marek Safar <marek.safar@seznam.cz>
3124 * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3125 Expression and made virtual.
3127 * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3128 (ImplicitStandardConversionExists): Fixed `byte' typo ?
3130 * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3132 * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3135 * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3138 2005-07-18 Marek Safar <marek.safar@seznam.cz>
3141 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3142 AssemblyCultureAttribute is not used on executable.
3145 * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3147 2005-07-16 Raja R Harinath <rharinath@novell.com>
3150 * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3151 New. Reports CS0252/CS0253.
3152 Mostly taken from preliminary patch by Duncak Mak.
3153 (Binary.DoResolveOperator): Store results of operator lookup.
3154 Use them to detect if we need to warn about unintended reference
3157 2005-07-15 Raja R Harinath <rharinath@novell.com>
3160 * namespace.cs (Namespace.Lookup): Add back location parameter.
3161 (Namespace.LookupType): Add CS0436 report. Add location parameter.
3162 * delegate.cs, ecore.cs, expression.cs: Update to changes.
3164 * codegen.cs (EmitContext.DeclSpace): Make readonly.
3165 * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3166 (Namespace.LookupType): ... this.
3167 (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3169 * typemanager.cs (LookupTypeReflection): Remove buggy code that
3170 purported to handle pointers.
3171 (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3174 2005-07-15 Marek Safar <marek.safar@seznam.cz>
3176 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3179 2005-07-15 Raja R Harinath <rharinath@novell.com>
3181 * namespace.cs (Namespace.Lookup): Drop location parameter.
3182 (NamespaceEntry.LookupAlias): Remove. Merge into ...
3183 (NamespaceEntry.Lookup): ... this.
3184 (NamespaceEntry.Error_AmbiguousTypeReference):
3185 Move here from DeclSpace.
3186 (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3188 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3189 * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3190 Move to NamespaceEntry.
3191 * delegate.cs, expression.cs: Update to changes.
3193 2005-08-31 Martin Baulig <martin@ximian.com>
3195 Committing a patch from Atsushi Enomoto for #75850.
3197 * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
3198 Prefer a generic enumerator over a non-generic one.
3200 2005-08-26 Kornél Pál <kornelpal@hotmail.com>
3202 * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3203 * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3205 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3207 * driver.cs : reverting default encoding change as well as mcs.
3209 2005-08-25 Atsushi Enomoto <atsushi@ximian.com>
3211 * driver.cs, support.cs : merged r48826.
3213 > could you integrate your mcs changes to gmcs otherwise
3214 > gmcs cannot compile some files.
3216 2005-08-20 Martin Baulig <martin@ximian.com>
3218 * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3219 scope if we don't already have it.
3221 * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
3222 than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
3225 2005-07-31 Miguel de Icaza <miguel@novell.com>
3227 * statement.cs: Copy the local exception into the exception
3228 captured local. Fixes 75674
3230 2005-07-15 Marek Safar <marek.safar@seznam.cz>
3232 * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3235 2005-08-12 Martin Baulig <martin@ximian.com>
3237 * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
3238 for nested types here to avoid hitting the cache too early.
3240 2005-08-09 Miguel de Icaza <miguel@novell.com>
3242 * enum.cs: On the new compiler CLS error 3005 is now a warning not
3245 2005-08-03 Martin Baulig <martin@ximian.com>
3247 Make iterators in generic methods work; see gtest-191.cs.
3250 (Constraints.Resolve): Protect against being called twice.
3253 (TypeContainer.GetClassBases): Make this `protected virtual'.
3255 * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
3256 (Iterator.GetClassBases): Override this and compute the base
3258 (Iterator.DefineNestedTypes): If we're a generic method, all our
3259 method type parameters become class type parameters on the proxy
3263 (ToplevelBlock.Parameters): Make this a property, not a field.
3264 (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
3266 2005-08-03 Martin Baulig <martin@ximian.com>
3268 * typemanager.cs (TypeManager.IsSubclassOf): Use
3269 `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
3270 (TypeManager.GetFullName_recursed): Improved.
3272 2005-07-27 Carlos Alberto Cortez <calberto.cortez@gmail.com>
3275 * ecore.cs (Expression.IsAccessorAccessible): Change the check for
3276 Private accessor case, using TypeManager.IsPrivateAccessible instead of
3277 invocation_type == mi.DeclaringType, since the first one also checks
3278 other condition used by generic instances.
3280 2005-07-27 Martin Baulig <martin@ximian.com>
3282 * anonymous.cs (CaptureContext.AddField): Added
3283 `AnonymousContainer am' argument; compute its toplevel scope if
3284 it's not already computed. Fixes #75649.
3286 2005-07-14 Marek Safar <marek.safar@seznam.cz>
3288 * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3289 CheckAttributeType and refactored.
3290 (Attribute.ResolvePossibleAttributeType): Changed to reuse
3291 ResolveAsTypeTerminal error handling.
3292 (ResolveAsTypeTerminal): Introduced because of global attributes extra
3294 (GetSignatureForError): Print errors in same way.
3297 * codegen.cs: Reflect attribute GetSignatureForError change.
3300 * expression.cs: Add silent parameter to ResolveAsTypeStep.
3302 * namespace.cs (UsingEntry): Refactored to make fields private.
3305 statement.cs: Error_UnexpectedKind has extra parameter.
3307 2005-07-14 Raja R Harinath <rharinath@novell.com>
3309 * ecore.cs (IAlias): Remove.
3310 * decl.cs (DeclSpace): Don't derive from IAlias. Remove members
3311 that implement the interface.
3312 * namespace.cs (Namespace): Likewise.
3313 (Namespace.declspaces): Renamed from 'defined_names'.
3314 (Namespace.AddDeclSpace): Renamed from 'DefineName'. Take a
3315 DeclSpace instead of an IAlias.
3316 * tree.cs (Tree.AddDecl): Update.
3318 2005-07-12 Raja R Harinath <rharinath@novell.com>
3320 * statement.cs (Block.Flags); Remove HasVarargs.
3321 (Block.HasVarargs): Move to ToplevelBlock.
3322 (Block.ThisVariable, Block.AddThisVariable): Likewise.
3323 (Block.Variables): Make protected. Initialize variable hashtable
3325 (Block.AddVariable): Update.
3326 (Block.Resolve): Update to changes.
3327 (ToplevelBlock.HasVarargs): New boolean.
3328 (ToplevelBlock.ThisVariable): Move here from Block.
3329 (ToplevelBlock.AddThisVariable): Likewise.
3330 (ToplevelBlock.IsThisAssigned): New. Forwards call to this_variable.
3331 * expression.cs (This.ResolveBase): Update to changes.
3332 (ArglistAccess.DoResolve): Likewise.
3334 2005-07-11 Marek Safar <marek.safar@seznam.cz>
3337 * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3339 * class.cs (TypeContainer.VerifyMembers): Distinguish between
3340 not used and not used & assigned.
3341 (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3343 2005-07-11 Marek Safar <marek.safar@seznam.cz>
3346 * expression.cs (Is.DoResolve): null is never provided type.
3348 2005-07-08 Marek Safar <marek.safar@seznam.cz>
3351 * cs-parser.jay: Less strict event error rule to catch more errors.
3353 2005-07-11 Martin Baulig <martin@ximian.com>
3355 * generic.cs (ConstructedType.CheckConstraints): Improve the check
3356 for the constructor constraint: we do not only have to check
3357 whether the class has a public constructor, but also ensure that
3358 it's parameterless. Fixes #75492.
3360 2005-07-11 Martin Baulig <martin@ximian.com>
3362 * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
3363 between type parameters if they either have the reference type
3364 constraint or the class constraint.
3366 2005-07-10 Kamil Skalski <nazgul@nemerle.org>
3368 * generic.cs: Use MakeGenericType instead of BindGenericParameters.
3370 2005-07-07 Marek Safar <marek.safar@seznam.cz>
3373 * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3374 (ExtractSecurityPermissionSet): Cope with self referencing security
3375 attributes properly.
3377 * driver.cs (SetOutputFile): Made public property OutputFile.
3379 2005-07-07 Raja R Harinath <rharinath@novell.com>
3382 * class.cs (TypeContainer.first_nonstatic_field): Rename from
3383 has_nonstatic_fields. Make into a FieldBase pointer.
3384 (TypeContainer.AddField): Add CS0282 check.
3385 (TypeContainer.EmitType): Update.
3387 2005-07-06 Miguel de Icaza <miguel@novell.com>
3389 * cs-tokenizer.cs (consume_identifier): Do not create strings to
3390 compare if they start with __.
3392 2005-07-06 Raja R Harinath <rharinath@novell.com>
3394 * statement.cs (Switch.SwitchGoverningType): Only look at
3395 UserCasts that don't need implicit standard conversions to one of
3396 the allowed switch types (Fixes test-322.cs).
3397 (LocalInfo.Resolve): Re-enable sanity-test.
3399 2005-07-06 Marek Safar <marek.safar@seznam.cz>
3401 * cs-tokenizer.cs (consume_identifier): Detect double undescores
3403 * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3405 * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3407 2005-07-06 Raja R Harinath <rharinath@novell.com>
3410 * ecore.cs (SimpleName.GetSignatureForError): Add.
3411 * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3412 (MemberAccess.GetSignatureForError): Add.
3414 2005-07-05 Marek Safar <marek.safar@seznam.cz>
3416 The big error and warning messages review.
3446 * typemanager.cs: Updated.
3448 * class.cs: (MethodCore.SetYields): Moved here to share.
3449 (PropertyMethod.Define): Moved iterator setup here.
3451 * iterators.cs: Add orig_method to have full access to parent
3454 2005-07-05 Raja R Harinath <rharinath@novell.com>
3456 Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3457 * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3458 (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3459 variable of struct type.
3460 * expression.cs (Unary.ResolveOperator): Update to change.
3461 (Indirection.VerifyFixed): Likewise.
3462 (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3463 (ParameterReference.VerifyFixed): Value parameters are fixed.
3464 (This.VerifyFixed): Treat 'this' as a value parameter.
3465 * statement.cs (LocalInfo.IsFixed): Remove.
3467 2005-07-01 Martin Baulig <martin@ximian.com>
3469 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3470 `ec.EmitThis ()' to get the correct scope.
3472 2005-07-01 Martin Baulig <martin@ximian.com>
3474 * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3475 instance is a ParameterReference; fixes #75299.
3477 2005-06-30 Raja R Harinath <rharinath@novell.com>
3480 * expression.cs (Indexers.map): Remove.
3481 (Indexers.Append): Filter out inaccessible setters and getters.
3482 (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3485 * ecore.cs (MemberExpr.EmitInstance): New. Add CS0120 check.
3487 (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3488 (FieldExpr.Emit, PropertyExpr.Emit): Update.
3489 (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3490 * expression.cs (Invocation.EmitCall): Add CS0120 check.
3492 2005-06-30 Marek Safar <marek.safar@seznam.cz>
3495 * class.cs (FieldBase.GetInitializerExpression): One more field
3498 2005-06-28 Miguel de Icaza <miguel@novell.com>
3500 * pending.cs: Do not define a proxy if the base method is virtual,
3501 it will be picked up by the runtime (bug 75270).
3503 2005-07-08 Martin Baulig <martin@ximian.com>
3505 * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3506 handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3508 2005-07-07 Martin Baulig <martin@ximian.com>
3510 * generic.cs (ConstructedType.CheckConstraint): Use
3511 ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
3512 called recursively; fixes #75329.
3514 2005-07-06 Martin Baulig <martin@ximian.com>
3516 * generic.cs (TypeManager.InferTypeArguments): Added support for
3517 anonymous methods; fixes #75461.
3519 2005-07-01 Martin Baulig <martin@ximian.com>
3521 * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3522 `ec.EmitThis ()' to get the correct scope.
3524 2005-07-01 Martin Baulig <martin@ximian.com>
3526 * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
3527 instance is `This'; fixes #75299.
3529 2005-06-30 Martin Baulig <martin@ximian.com>
3531 * class.cs (Indexer): Implement IIteratorContainer; added support
3532 for iterators in indexers.
3535 (EmitContext.CurrentIterator): Make this a property, not a field.
3537 * anonymous.cs (AnonymousContainer.Iterator): New public property.
3539 2005-06-28 Miguel de Icaza <miguel@novell.com>
3541 * pending.cs: Do not define a proxy if the base method is virtual,
3542 it will be picked up by the runtime (bug 75270).
3544 2005-06-28 Martin Baulig <martin@ximian.com>
3546 * cs-parser.jay (interface_method_declaration): Avoid a
3547 reduce/reduce conflict by moving some of the code into a separate
3548 `interface_method_declaration_body' rule; fixes #75368.
3550 2005-06-28 Martin Baulig <martin@ximian.com>
3552 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
3553 array check after the check for TypeBuilder's.
3555 2005-06-21 Raja R Harinath <rharinath@novell.com>
3557 * convert.cs (FindMostEncompassedType): Add two trivial special
3558 cases (number_of_types == 0 || number_of_types == 1).
3559 (FindMostEncompasingType): Likewise.
3561 2005-06-17 Raja R Harinath <rharinath@novell.com>
3563 Some cleanups preparing for the fix of #75283.
3564 * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3566 (EventExpr.InstanceResolve): Likewise.
3567 (EventExpr.DoResolve): Remove redundant checks.
3569 2005-06-08 Miguel de Icaza <miguel@novell.com>
3571 * class.cs: Small fix.
3573 2005-06-08 Raja R Harinath <rharinath@novell.com>
3576 * class.cs (GetPartialBases): Fix return value check of
3579 2005-06-07 Raja R Harinath <rharinath@novell.com>
3581 Ensure that partial classes are registered in their enclosing
3582 namespace. Initial part of fix of #75160.
3583 * tree.cs (Tree.RecordDecl): Add new namespace argument.
3584 Register declspace with namespace here, not in
3585 DeclSpace.RecordDecl.
3586 * cs-parser.jay: Pass namespace to RecordDecl.
3587 * class.cs (PartialContainer.Create): Likewise.
3588 (ClassPart.DefineType): New sanity-check. Throws an exception if
3590 * decl.cs (Declspace.RecordDecl): Remove.
3591 * namespace.cs (NamespaceEntry.DefineName): Remove.
3593 2005-06-06 Marek Safar <marek.safar@seznam.cz>
3595 * rootcontext.cs: Reset TargetExt as well.
3597 2005-06-03 Raja R Harinath <rharinath@novell.com>
3599 * ecore.cs (Expression.Resolve): Emit CS0654 error when
3602 2005-06-02 Raja R Harinath <rharinath@novell.com>
3604 Fix #75080, cs0119.cs.
3605 * ecore.cs (Expression.ExprClassToResolveFlags): New. Broken out
3607 (Expression.Resolve): ... this. Use it. Remove bogus code
3608 allowing ExprClass.Type and ExprClass.Namespace for
3609 ResolveFlags.VariableOrValue.
3610 (Expression.Resolve) [1-argument variant]: Change default resolve
3611 flags based on language version.
3612 (Expression.Error_UnexpectedKind): Use a simple string array
3613 rather than an ArrayList.
3614 * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3616 (TypeOfVoid.DoResolve): Likewise.
3617 (MemberAccess.DoResolve) [3-argument variant]: Make private. Drop
3618 flags argument -- it always has the same value.
3620 2005-05-31 Raja R Harinath <rharinath@novell.com>
3623 * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3624 Use it in the error message.
3625 * assign.cs, expression.cs, statement.cs: Update.
3627 2005-05-30 Raja R Harinath <rharinath@novell.com>
3630 * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3631 the "almostMatchedMember" case too.
3632 * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3633 that failed the accessibility checks to 'almost_match'.
3635 2005-05-27 Vladimir Vukicevic <vladimir@pobox.com>
3637 * attribute.cs: Use internal MethodBuilder methods to set
3638 ExactSpelling and SetLastError on PInvoke methods, instead
3639 of passing them via charset. Fixes #75060.
3641 2005-05-27 Raja R Harinath <rharinath@novell.com>
3643 * parameter.cs (Parameter): Remove TODO comment.
3644 (Parameter.DefineParameter): Remove Location parameter.
3645 (Parameters.LabelParameters): Likewise.
3646 * class.cs (Constructor.Emit): Update to change.
3647 (MethodData.Emit): Likewise.
3648 * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.
3649 * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3651 2005-05-27 Atsushi Enomoto <atsushi@ximian.com>
3654 Removed Parameters.Location and added Parameter.Location instead.
3655 Removed Location parameter from Emit() and GetSignature().
3662 Modified all related calls.
3664 2005-06-21 Martin Baulig <martin@ximian.com>
3666 * generic.cs (NullCoalescingOperator.Emit): Make this work if the
3667 left-hand side is not a nullable type; fixes #75328.
3669 2005-06-21 Martin Baulig <martin@ximian.com>
3672 (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
3673 (TypeManager.GetFullNameSignature): Likewise.
3675 * convert.cs (Convert.Error_CannotImplicitConversion): Compare
3676 `source.FullName' and `target.FullName' to check whether there are
3677 two conflicting definitions.
3679 2005-06-21 Martin Baulig <martin@ximian.com>
3681 * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
3682 a BoxedCast - also for reference types - to be compatible with csc.
3684 2005-06-21 Martin Baulig <martin@ximian.com>
3686 * expression.cs (MemberAccess.DoResolve): Add support for nested
3687 types in a generic instance; fixes #75320.
3689 2005-06-20 Martin Baulig <martin@ximian.com>
3691 * generic.cs (TypeManager.InferType): Also walk the class
3692 hierarchy for generic instances; fixes #75261.
3694 2005-06-17 Martin Baulig <martin@ximian.com>
3696 * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
3697 to make things work for corlib.
3699 2005-06-15 Martin Baulig <martin@ximian.com>
3701 * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
3702 obsolete `SecurityAction' values.
3704 2005-06-06 Marek Safar <marek.safar@seznam.cz>
3706 * rootcontext.cs: Reset TargetExt as well.
3708 2005-06-09 Martin Baulig <martin@ximian.com>
3710 * delegate.cs (Delegate.VerifyMethod): Added
3711 `MethodGroupExpr old_mg' argument; inherit its
3712 `HasTypeParameters'; fix #75085.
3714 2005-06-09 Martin Baulig <martin@ximian.com>
3716 * expression.cs (Invocation.OverloadResolve): Correctly handle
3717 generic methods for the SetMemberIsUsed(); fix #75064.
3719 2005-06-09 Martin Baulig <martin@ximian.com>
3721 * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
3724 2005-06-08 Martin Baulig <martin@ximian.com>
3726 * cs-parser.jay (nullable_type_or_conditional): If we put the
3727 nullable back and our `type' is a `ComposedCast', remove the
3728 nullable from it. Fixes #75156.
3730 * expression.cs (ComposedCast.RemoveNullable): New public method.
3732 2005-06-08 Martin Baulig <martin@ximian.com>
3734 The big Iterators rewrite :-)
3736 * iterators.cs: Rewrite this to use the anonymous methods framework.
3738 * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3739 before the TypeContainers; see 2test-21.cs.
3742 (TypeContainer.DefineType): Don't create a new EmitContext if we
3743 already have one (this only happens if we're an Iterator).
3744 (TypeContainer.Define): Also call Define() on all our iterators.
3745 (Method.CreateEmitContext): Added support for iterators.
3748 (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3749 (AnonymousContainer.CreateMethodHost): Moved here from
3750 AnonymousMethod and made abstract.
3751 (AnonymousContainer.CreateScopeType): New abstract method.
3752 (AnonymousContainer.IsIterator): New public property.
3753 (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3754 get the ScopeTypeBuilder rather than manually defining it here.
3755 (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3758 * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3759 before RootContext.DefineTypes().
3761 * codegen.cs (EmitContext.RemapToProxy): Removed.
3762 (EmitContext.CurrentAnonymousMethod): Changed type from
3763 AnonymousMethod -> AnonymousContainer.
3764 (EmitContext.ResolveTopBlock): Protect from being called twice.
3765 (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3766 (EmitContext.EmitThis): Removed the iterators hacks; use the
3767 anonymous methods framework for that.
3770 (ToplevelBlock.Container): Make this a property, not a field.
3771 (ToplevelBlock.ReParent): New public method; move the
3772 ToplevelBlock into a new container.
3773 (Foreach.TemporaryVariable): Simplify.
3775 2005-06-05 Martin Baulig <martin@ximian.com>
3777 * statement.cs (LocalInfo.CompilerGenerated): New flag.
3778 (Block.AddTemporaryVariable): New public method; creates a new
3779 `LocalInfo' for a temporary variable.
3780 (Block.EmitMeta): Create the LocalBuilders for all the temporary
3782 (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3783 non-iterator variables.
3785 2005-06-05 Martin Baulig <martin@ximian.com>
3787 * statement.cs (Foreach.TemporaryVariable): Create the
3788 LocalBuilder in the Emit phase and not in Resolve since in some
3789 situations, we don't have an ILGenerator during Resolve; see
3790 2test-19.cs for an example.
3792 2005-06-04 Martin Baulig <martin@ximian.com>
3794 The big Foreach rewrite - Part II.
3796 * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3797 with `PropertyInfo ienumerator_getcurrent'.
3799 * codegen.cs (VariableStorage): Removed.
3802 (Foreach): Derive from Statement, not ExceptionStatement.
3803 (Foreach.CollectionForeach): New nested class. Moved all the code
3804 dealing with collection foreach here.
3805 (Foreach.ForeachHelperMethods): Removed.
3806 (Foreach.TemporaryVariable): Implement IMemoryLocation.
3808 2005-05-23 Martin Baulig <martin@ximian.com>
3810 * statement.cs (Try.DoResolve): Don't create a `finally' if we
3811 don't need to. Fix #75014.
3813 2005-05-26 Raja R Harinath <rharinath@novell.com>
3815 Improve user-defined conversion handling.
3816 * convert.cs (GetConversionOperators): Rewrite. Return only the
3817 applicable operators.
3818 (AddConversionOperators): New. Helper for GetConversionOperators.
3819 (FindMostEncompassedType, FindMostEncompassingType): Verify that
3820 there is only one most encompassed/encompassing type.
3821 (FindMostSpecificSource, FindMostSpecificTarget): Remove
3822 "applicable operator" handling.
3823 (UserConversion): Move cache here from GetConversionOperators.
3824 Directly cache the chosen operator, rather than the whole
3826 (ExplicitNumericConversion): Fix buggy implementation of Decimal
3827 case. Allow conversion of decimal to sbyte and byte too.
3828 * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3829 New static methods. Used to avoid allocating EmptyExpressions in
3832 2005-05-24 Duncan Mak <duncan@novell.com>
3834 * ecore.cs (CastFromDecimal): New class for casting a decimal to
3835 another class, used in Convert.ExplicitNumericConversion.
3836 (CastToDecimal): New class, similar to above, but casts to
3837 System.Decimal, used in Convert.ImplicitNumericConversion and also
3838 in explicit convesion from double/float to decimal.
3840 * convert.cs (ImplicitNumericConversion): Handle implicit
3841 conversions to System.Decimal.
3842 (ExplicitNumericConversion): handle explicit conversions to
3847 2005-05-20 Miguel de Icaza <miguel@novell.com>
3849 * typemanager.cs: Do not throw an exception in the TypeBuilder
3850 case, we take care of it on the TypeCode.
3852 2005-05-17 Marek Safar <marek.safar@seznam.cz>
3854 * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3857 * cs-parser.jay: Catch more lexical errors.
3859 * report.cs: Add one more Error method.
3862 * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3864 2005-05-20 Martin Baulig <martin@ximian.com>
3866 * class.cs (TypeContainer.CircularDepException): Removed.
3867 (TypeContainer.DefineType): Removed the `InTransit' stuff.
3868 (TypeContainer.CheckRecursiveDefinition): Check for circular class
3869 (CS0146) and interface (CS0529) dependencies here.
3871 2005-05-20 Martin Baulig <martin@ximian.com>
3873 * expression.cs (New.DoResolve): Move the CS0712 check above the
3874 CS0144 check; otherwise it can never be reached.
3876 2005-05-20 Martin Baulig <martin@ximian.com>
3878 * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
3880 2005-05-20 Martin Baulig <martin@ximian.com>
3882 * class.cs (TypeContainer.DefineType): Fix CS0698 check.
3884 * typemanager.cs (TypeManager.IsAttributeType): New public method.
3886 2005-05-19 Martin Baulig <martin@ximian.com>
3889 (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3890 to disable error reporting.
3892 * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3893 here since we don't want to report an error; see the new test-336.cs.
3895 2005-05-19 Raja R Harinath <rharinath@novell.com>
3897 * statement.cs (ToplevelBlock.GetParameterReference)
3898 (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3899 Move here from class Block.
3900 * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3901 * expression.cs (ParameterReference.DoResolveBase): Likewise.
3903 2005-05-18 Martin Baulig <martin@ximian.com>
3908 (FlowBranching.Reachability): Add non-static public And() and Or()
3910 (FlowBranchingSwitch): New class; do the `break_origins' thing
3911 like in FlowBranchingLoop.
3912 (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3913 reachability, not just locals and parameters.
3914 (FlowBranching.MergeChild): Remove some of the hacks for loop and
3915 switch; MergeBreakOrigins() now takes care of that.
3917 2005-05-18 Martin Baulig <martin@ximian.com>
3919 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3920 a loop and may leave it, reset the barrier; fixes #74974.
3922 2005-05-16 Raja R Harinath <rharinath@novell.com>
3924 Fix test-382.cs. Emit values of decimal constants.
3925 * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3927 (TypeContainer.AddField): ... this.
3928 (TypeContainer.EmitFieldInitializers): Allow the list of fields
3929 with initializers to include 'Const's.
3930 (ClassPart.RegisterFieldForInitialization): Forward to
3932 * const.cs (Const.Const): Pass initializer to base class.
3933 (Const.Define): In case of decimal constants, register them for
3934 initialization in a static constructor.
3936 2005-05-14 Martin Baulig <martin@ximian.com>
3938 * statement.cs (Block.Resolve): Correctly handle unreachable code;
3939 do not call ResolveUnreachable() on unreachable statements in
3940 here, see the comment in the source code.
3942 2005-05-13 Raja R Harinath <rharinath@novell.com>
3945 * expression.cs (BinaryResolveOperator): If one of the operands of
3946 an equality comparison is 'null' and the other is a pointer type,
3947 convert the null to a NullPointer.
3948 * convert.cs (ImplicitReferenceConversion): If the expression is a
3949 NullLiteral and the target type is a pointer type, return a
3950 NullPointer instead.
3951 (ImplicitConversionStandard): Likewise.
3953 2005-05-13 Marek Safar <marek.safar@seznam.cz>
3955 * cs-parser.jay: Set readonly context based on special constructs.
3957 * expression.cs (LocalVariableReference.DoResolveBase): Improved
3958 readonly variable error handling.
3960 * rootcontext.cs (EmitCode): Don't verify members when error
3963 * statement.cs (LocalInfo): Add reaodnly context information.
3964 (SetReadOnlyContext, GetReadOnlyContext): New methods.
3966 2005-05-17 Martin Baulig <martin@ximian.com>
3968 * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3971 2005-05-13 Martin Baulig <martin@ximian.com>
3973 * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
3974 handle unreachable blocks.
3976 2005-05-13 Martin Baulig <martin@ximian.com>
3979 (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
3980 (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
3983 2005-05-13 Martin Baulig <martin@ximian.com>
3985 * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3986 instance variable, not a local. Fix #74873.
3987 (Block.ResolveUnreachable): Set it to true here.
3989 2005-05-12 Martin Baulig <martin@ximian.com>
3991 * cs-parser.jay (property_declaration): Pass the `current_class',
3992 not the `current_container' to Property's .ctor. Fixes #74912.
3994 2005-05-11 Martin Baulig <martin@ximian.com>
3996 * typemanager.cs (Closure): Copy this from MCS and merge all the
3997 GMCS-specific changes into it.
3999 2005-05-12 Raja R Harinath <harinath@gmail.com>
4002 * typemanager.cs (unmanaged_enclosing_types): New.
4003 (IsUnmanagedType): Avoid infloops by using
4004 'unmanaged_enclosing_types' to talk with recursive invocations.
4006 2005-05-11 Duncan Mak <duncan@novell.com>
4008 * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
4009 continuing to process for 'arg'.
4010 (handle_preprocessing_directive): Check the argument of the #endif
4011 directive and report error CS1025 if there are any trailing
4014 According to the C# spec, having even whitespace after the #endif
4015 directive is illegal; however, because we call arg.TrimEnd ()
4016 beforehand, we have the same behavior as csc, allowing whitespace
4017 after the directive.
4021 2005-05-11 Marek Safar <marek.safar@seznam.cz>
4025 * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
4026 (Constructor.GetObsoleteAttribute): Implemented correctly.
4028 2005-05-10 Martin Baulig <martin@ximian.com>
4030 * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
4031 resolve the type; fixes #74864.
4032 (DefaultValueExpression): Create the LocalTemporary in Emit(), not
4033 in DoResolve(); fixes #74862.
4035 2005-05-10 Martin Baulig <martin@ximian.com>
4037 * support.cs (ReflectionParameters.ParameterModifier): Use
4038 `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
4039 and `ParameterAttributes.In'. Fixes #74884.
4041 2005-05-10 Martin Baulig <martin@ximian.com>
4043 * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
4044 the cache if we're just looking for `MemberTypes.NestedType' in a
4047 * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
4048 constraints if we're still resolving the type tree.
4049 (Expression.MemberLookup): If we're resolving the type tree, only
4050 look for `MemberTypes.NestedType' since we're only interested in
4053 * class.cs (TypeContainer.DefineType): Don't resolve the type
4054 parameters here; do this later in ResolveType() after the type
4055 tree has been resolved.
4056 (TypeContainer.ResolveType): New public method; this is called
4057 after the type tree is resolved and before the types are being
4058 populated. We resolve the generic constraints here.
4059 (TypeContainer.DoDefineMember): Check the constraints on our base
4060 class and interfaces.
4062 * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
4063 set the `ResolvingTypeTree' flag on the EmitContext.
4065 * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
4067 2005-05-10 Marek Safar <marek.safar@seznam.cz>
4069 * class.cs (Method.Define): Catch attempt for Finalizer declaration.
4071 * expression.cs (Argument.GetParameterModifier): Turned to property.
4072 (Invocation.Error_InvalidArguments): Add more descriptive errors.
4074 * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
4077 2005-05-09 Raja R Harinath <rharinath@novell.com>
4080 * decl.cs (MemberCache.AddMethods): Register override methods,
4081 rather than non-override methods.
4082 * typemanager.cs (RegisterOverride): New.
4083 (IsOverride): Update.
4085 2005-05-09 Marek Safar <marek.safar@seznam.cz>
4087 * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
4089 2005-05-06 Martin Baulig <martin@ximian.com>
4092 (Attributable.IsClsComplianceRequired): Fix typo in the method name.
4093 (AttributeTester.AnalyzeTypeCompliance): Add generics support.
4095 2005-05-09 Marek Safar <marek.safar@seznam.cz>
4099 * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
4100 recursive declaration.
4102 * statement.cs (Block.ResolveMeta): Report any error in resolving.
4104 2005-05-06 Marek Safar <marek.safar@seznam.cz>
4106 * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
4108 * expression.cs (Binary.DoResolve): (x && 0) is always 0.
4110 2005-05-05 Raja R Harinath <rharinath@novell.com>
4113 * decl.cs (DeclSpace.FamilyAccessible):
4114 Use TypeManager.IsNestedFamilyAccessible.
4116 Fix reopened #64812.
4117 * typemanager.cs (Closure.Filter): Introduce checks for 'protected
4120 2005-05-04 Raja R Harinath <rharinath@novell.com>
4121 Abin Thomas <projectmonokochi@rediffmail.com>
4122 Anoob V E <projectmonokochi@rediffmail.com>
4123 Harilal P R <projectmonokochi@rediffmail.com>
4126 * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
4127 allow access to all static members.
4129 2005-05-04 Martin Baulig <martin@ximian.com>
4131 * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
4133 2005-05-04 Martin Baulig <martin@ximian.com>
4137 * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
4138 section at the end; make things work if `default' is not the last
4141 2005-05-04 Martin Baulig <martin@ximian.com>
4145 * statement.cs (Switch): Replaced the `got_default' field with a
4146 `default_section' one.
4147 (Switch.CheckSwitch): Set `default_section' here.
4148 (Switch.Resolve): If we're a constant switch and the constant is
4149 not found, use the default section.
4151 2005-05-03 Martin Baulig <martin@ximian.com>
4153 * expression.cs (ArrayAccess.EmitGetLength): New public method.
4155 * statement.cs (Foreach.ArrayForeach): New nested class.
4156 (Foreach.TemporaryVariable): New nested class.
4157 (Foreach.EmitArrayForeach): Removed; this is now in the new
4160 2005-05-03 Raja R Harinath <rharinath@novell.com>
4162 * pending.cs (BaseImplements): Move the #74773 fix here. This is
4164 (VerifyPendingMethods): Revert change below.
4166 * typemanager.cs (IsOverride, RegisterNonOverride): New.
4167 * decl.cs (MemberCache.AddMethod): Register "non-override" methods
4168 that used to trigger warning -28. Remove warning -28.
4169 * expression.cs (Invocation.OverloadResolve): Use
4170 TypeManager.IsOverride to distinguish override methods.
4173 * pending.cs (VerifyPendingMethods): If a base type implements the
4174 requested interface, don't bother checking individual methods of
4175 the base type. As a side-effect, this prevents the creation of
4176 unnecessary proxies.
4178 2005-05-02 Martin Baulig <martin@ximian.com>
4182 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4183 Also `And' the locals if the old vector is null.
4184 (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
4185 null; in this case we basically reset all the variables.
4187 2005-05-02 Martin Baulig <martin@ximian.com>
4191 * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
4192 Added `FlowBranching branching' argument; always `and' the
4193 variables instead of `or'ing them unless we're an infinite loop.
4195 * statement.cs (While.Resolve): Create a new sibling unless we're
4198 2005-05-02 Martin Baulig <martin@ximian.com>
4202 * class.cs (ConstructorInitializer.Resolve): Added `Block block'
4203 arguments; use it instead of creating a new TopLevelBlock.
4204 (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
4205 our ConstructorInitializer.
4208 (TopLevelBlock.TopLevelBranching): New public property.
4209 (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
4210 and create our `TopLevelBranching'.
4212 * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
4213 anonymous method host, use `block.TopLevelBranching' rather than
4214 creating a new branching.
4216 2005-04-20 Miguel de Icaza <miguel@novell.com>
4218 * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
4219 a ScopeInfo, if any of the current children is a child of the new
4220 entry, move those children there.
4222 2005-04-30 Martin Baulig <martin@ximian.com>
4224 * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
4225 at the beginning of a SwitchSection. Fix #73335.
4227 2005-04-27 Marek Safar <marek.safar@seznam.cz>
4230 * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
4232 * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
4233 (FieldExpr.DoResolve): Obsolete members are ignored for field
4236 2005-04-26 Marek Safar <marek.safar@seznam.cz>
4238 * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
4239 of arrays detection.
4241 * class.cs (Interface.VerifyClsCompliance): Add base interfaces
4243 (Field.VerifyClsCompliance): Volatile fields are not compliant.
4245 * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
4248 2005-04-25 Ben Maurer <bmaurer@ximian.com>
4250 * cs-parser.jay: Use the prefered version of -unsafe in error
4253 2005-04-22 Marek Safar <marek.safar@seznam.cz>
4255 * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4258 2005-04-20 John Luke <john.luke@gmail.com>
4260 * driver.cs: fix typo in error message, --outout to --output
4262 2005-04-30 Martin Baulig <martin@ximian.com>
4264 * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
4265 handle the .NET 2.x security attributes.
4267 2005-04-30 Martin Baulig <martin@ximian.com>
4270 (TypeManager.ExpandInterfaces): Don't add things twice.
4273 (TypeContainer.VerifyClsCompliance): Allow generic instances.
4275 2005-04-29 Martin Baulig <martin@ximian.com>
4277 * generic.cs (Constraints.ResolveTypes): Expand interfaces.
4279 * anonymous.cs: Added support for anonymous generic methods.
4281 2005-04-29 Martin Baulig <martin@ximian.com>
4283 * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
4286 2005-04-29 Martin Baulig <martin@ximian.com>
4288 * generic.cs (TypeManager.HasConstructorConstraint): Removed.
4290 * expression.cs (New.DoResolve): Fix the CS0304 check.
4292 2005-04-29 Martin Baulig <martin@ximian.com>
4294 * typemanager.cs (TypeManager.GetFullName): Updated to the new
4297 * class.cs (MethodCore.IsDuplicateImplementation): If we're an
4298 explicit interface implementation, compare the interface types.
4299 (MethodData.Define): Use the new naming scheme from the latest
4301 (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
4303 * decl.cs (MemberName.GetMemberName): Removed.
4304 (MemberName.MethodName, FullName): New properties.
4306 2005-04-25 Raja R Harinath <rharinath@novell.com>
4308 * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
4310 2005-04-22 Martin Baulig <martin@ximian.com>
4312 * generic.cs (GenericMethod): Create the EmitContext in the
4313 `Define()'; in `Define(MethodBuilder)', create the type parameters
4314 before calling `Define()'. Fixes #73933.
4316 2005-04-22 Martin Baulig <martin@ximian.com>
4319 (Constraints.Resolve): Make things work wrt. the new type lookup system.
4320 (ConstructedType.ResolveAsTypeTerminal): Don't override this.
4322 * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
4323 ConstructedType, check its constraints.
4325 2005-04-20 Marek Safar <marek.safar@seznam.cz>
4327 * codegen.cs (InRefOutArgumentResolving): New field.
4329 * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4330 fields outside contructor.
4332 * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4334 2005-04-19 Miguel de Icaza <miguel@novell.com>
4336 * anonymous.cs (CaptureContext.EmitParameterInstance): The
4337 parameter code was not completed ever, so it was not as up-to-date
4338 as local variables. Must finish it.
4340 The bug fix was to compare the Toplevel of the block, not the
4341 current block. Thanks for Ben for pointing this out.
4343 2005-04-19 Raja R Harinath <rharinath@novell.com>
4345 * decl.cs (AddMethods): Use the declaring type of the problem
4346 method to determine if we want to squash a warning.
4348 2005-04-19 Marek Safar <marek.safar@seznam.cz>
4350 * attribute.cs: Removed debug output.
4352 * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4354 * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4357 2005-04-18 Raja R Harinath <rharinath@novell.com>
4360 * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4361 (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4362 all null comparisons against reference types.
4364 2005-04-18 Marek Safar <marek.safar@seznam.cz>
4367 * class.cs (TypeContainer.CircularDepException) New nested
4369 (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4370 (TypeContainer.DefineType): Removed error, reset InTransit before
4372 (Class.DefineType): Throw exception when is in Transit.
4373 Catch exception and report error.
4374 (Struct.DefineType): Throw exception when is in Transit.
4375 Catch exception and report error.
4376 (Interface.DefineType): Throw exception when is in Transit.
4377 Catch exception and report error.
4379 * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4380 handle nested exception handlers.
4382 * flowanalysis.cs (InTryWithCatch): New method, search for try with
4385 * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4386 InFinally and InCatch storage.
4388 * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4389 (Catch.Resolve): Set and Restore ec.InCatch.
4390 (Try.Resolve): Set and Restore ec.InFinally.
4391 (Try.HasCatch): True when try has catch.
4393 2005-04-17 Atsushi Enomoto <atsushi@ximian.com>
4395 * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4396 for the same event member, so exclude such cases from warning 419.
4399 2005-04-16 Miguel de Icaza <miguel@novell.com>
4401 * expression.cs (Binary.ResolveOperator): Apply patch from John
4402 Luke to fix bug 59864: operators &, | and ^ on enumerations
4403 require that the same enum type on both sides.
4405 * driver.cs: Add warnings to old flag usage, this is to assist
4406 people who produce Makefiles and hope that the Makefiles will be
4409 * class.cs (TypeContainer.EmitType): Moved the definition of the
4410 special $PRIVATE$ field from the resolve phase to the Emit phase.
4411 During resolve we do not know if we are a struct with
4412 HasExplicitLayout, we know this only after the attributes for the
4415 Set the FieldOffset to zero on the dummy field that we create for
4416 the class. Fixes 74590.
4418 2005-04-16 Raja R Harinath <rharinath@novell.com>
4421 * ecore.cs (PropertyExpr.resolved): New.
4422 (DoResolve): Use it to handle a case of double resolution here.
4423 Handle a case of identical-name-and-type-name.
4424 * expression.cs (ArrayCreation.CheckIndices): Avoid double
4425 resolution by storing the results of expression resolution back
4426 into the "probes" array.
4428 2005-04-15 Raja R Harinath <rharinath@novell.com>
4430 Fix cs0208-7.cs and cs0208-8.cs.
4431 * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4432 (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0). Improve
4433 error reporting to point out the reason a struct is not unmanaged.
4435 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4437 * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and
4438 just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4440 2005-04-13 Raja R Harinath <rharinath@novell.com>
4443 * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4444 IdenticalNameAndTypeName here.
4445 (EventExpr.InstanceResolve): Likewise.
4447 2005-04-13 Marek Safar <marek.safar@seznam.cz>
4449 C# 2.0 DefaultCharSetAttribute implementation
4451 * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4452 which allows us to set GlobalNamespace for every resolve.
4453 (Attribute.ResolveArguments): Cut from Resolve.
4454 (Attribute.GetCharSetValue): Returns CharSet named argument.
4455 (Attribute.DefinePInvokeMethod): Gets default charset from
4457 (GlobalAttribute.ResolveAsTypeStep): Override.
4458 (GlobalAttribute.ResolveArguments): Override.
4460 * class.cs (TypeAttr): Is protected.
4462 * codegen.cs (ModuleClass.DefaultCharSet): New member.
4463 (ModuleClass.DefaultCharSetType): New memeber.
4464 (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4466 * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4467 charset from module.
4469 * delegate.cs (TypeAttr): Override.
4470 (Delegate.DefineType): Use this TypeAttr.
4472 * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4473 at very early stage (before types are defined) to resolve model
4474 module attributes. It will probably not work with corlib but it
4477 * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4478 charset from module.
4480 * typemanager.cs (default_charset_type): New type.
4482 2005-04-13 Raja R Harinath <rharinath@novell.com>
4484 * decl.cs (MemberCache.AddMethods): Don't warn if
4485 System.Object.Finalize has buggy MethodAttributes.
4487 * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4490 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4492 * doc.cs : detect ambiguous reference to overloaded members.
4493 Fixed bug #71603. MS 1.1 csc does not detect it.
4495 2005-04-13 Atsushi Enomoto <atsushi@ximian.com>
4497 * doc.cs : delegates must not be referenced with parameters.
4500 2005-04-12 Miguel de Icaza <miguel@novell.com>
4502 * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4504 2005-04-10 Miguel de Icaza <miguel@novell.com>
4506 * driver.cs (MainDriver): Stop processing if the CLS stage found
4509 (CompilerCallableEntryPoint.InvokeCompiler): Always
4510 reset after execution; Take a TextWriter argument for the
4513 * report.cs: Use the error stream instead of hardcoding stderr.
4515 2005-04-09 Miguel de Icaza <miguel@novell.com>
4517 * class.cs: Reduce code paths to test, too small of an
4518 optimization to make it worth the extra testing. Always perform
4521 2005-04-08 Raja R Harinath <rharinath@novell.com>
4524 * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4525 operators that had errors reported on them.
4527 2005-04-08 Marek Safar <marek.safar@seznam.cz>
4529 * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4531 (Attribute.Resolve): Add named argument type checking.
4533 * class.cs (FixedField.Define): Use IsPrimitiveType
4535 * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4537 * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4538 unsafe parameter types.
4540 * statement.cs (Using.ResolveExpression): Add better error description.
4542 * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4544 2005-04-08 Raja R Harinath <rharinath@novell.com>
4547 * attribute.cs (Attribute.GetAttributeUsage): Resolve
4548 AttributeUsageAttribute in the emitcontext of the attribute class,
4549 not in the emitcontext of the attributable entity it was attached to.
4550 * cs-parser.jay: Use 'current_class', not 'current_container',
4551 when creating a GlobalAttribute.
4553 2005-04-08 Alp Toker <alp@atoker.com>
4555 * pending.cs: The fix to #58413 failed to compile methods implementing
4556 interfaces with/without params modifiers and vice versa, even though
4557 params modifiers aren't part of the signature. Make the modifier check
4558 less strict as in csc.
4560 2005-04-07 Abin Thomas <projectmonokochi@rediffmail.com>
4561 Anoob V E <projectmonokochi@rediffmail.com>
4562 Harilal P R <projectmonokochi@rediffmail.com>
4565 * pending.cs (TypeAndMethods.mods): New. Store the parameter
4566 modifiers of pending methods.
4567 (PendingImplementation.PendingImplementation): Initialize it.
4568 Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4569 (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4570 with ParameterData. Add check for modifiers.
4571 * class.cs (MethodData.Define): Update to changes.
4573 2005-04-07 Raja R Harinath <rharinath@novell.com>
4575 * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4577 2005-04-07 Marek Safar <marek.safar@seznam.cz>
4579 * class.cs (PropertyMethod.Define): Check private accessor in abstract
4582 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4585 * typemanager.cs: Registered RequiredAttributeAttribute.
4587 2005-04-06 Marek Safar <marek.safar@seznam.cz>
4589 * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4590 Warning CS0169 is back at level 3.
4591 (IMethodData.SetMemberIsUsed): New method.
4593 * decl.cs (IsUsed): New value; moved from FieldBase.Status
4594 (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4596 * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4598 * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4600 (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4603 * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4606 * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4607 to avoid the problems with nested types.
4609 2005-04-05 Abin Thomas <projectmonokochi@rediffmail.com>
4610 Anoob V.E <projectmonokochi@rediffmail.com>
4611 Harilal P.R <projectmonokochi@rediffmail.com>
4612 Raja R Harinath <rharinath@novell.com>
4615 * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4617 * typemanager (GetConstructor): Make public.
4619 2005-04-05 John Luke <john.luke@gmail.com>
4620 Raja R Harinath <rharinath@novell.com>
4623 * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4624 struct too. Return false quicker in a few cases.
4625 (VerifyUnManaged): Use it.
4627 2005-04-05 Raja R Harinath <rharinath@novell.com>
4630 * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4631 not 'unreachable_seen'.
4633 2005-04-04 Marek Safar <marek.safar@seznam.cz>
4635 * attribute.cs (Attribute.GetValue): Removed unused.
4637 * codegen.cs (CodeGen.TrimExt): Removed unused.
4639 * cs-parser.jay (output): Removed unused.
4641 * cs-tokenizer.cs (hex_digits): Removed unused.
4643 * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4645 * expression.cs (Indirection.LoadExprValue): Removed unused.
4646 (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4648 * iterators.cs (Iterator.param_types): Removed unused.
4650 * statement.cs (Goto.block): Removed unused.
4651 (ToplevelBlock.did): Removed unused.
4652 (Switch.ResolveConstantSwitch): Removed unused.
4654 2005-04-01 Ben Maurer <bmaurer@ximian.com>
4656 * rootcontext.cs: Allow mcs to bootstrap with the compilation
4659 2005-04-19 Martin Baulig <martin@ximian.com>
4661 Merged r42462 from MCS and made it work for GMCS.
4663 * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
4665 * generic.cs (GenericMethod.Define): Removed `return_type' argument.
4667 2005-04-01 Raja R Harinath <rharinath@novell.com>
4669 Fix #74232 and cs0208-3.cs.
4670 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4671 * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4672 unmanaged type. Don't use FieldBuilders when 't' is a
4673 TypeBuilder. Use ModFlags and MemberType fields.
4674 * class.cs (MemberBase.member_type): Rename from MemberType.
4675 (MemberBase.MemberType): New property. Determines member_type on
4677 (MemberBase.DoDefine): Don't initialize MemberType here.
4678 (FieldMember.Define): Likewise.
4680 2005-04-01 Marek Safar <marek.safar@seznam.cz>
4683 * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4684 Attributes are emitted there.
4686 2005-04-01 Raja R Harinath <rharinath@novell.com>
4688 * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4689 keyword in 'partial enum' too.
4690 * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4692 Report from Kamil Skalski <nazgul@omega.pl>.
4695 * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4696 have partial containers too.
4698 * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4699 in block' checks to Block.CheckInvariantMeaningInBlock.
4700 * statement.cs (Block.GetKnownVariableInfo): Make private.
4701 (Block.IsVariableUsedInChildBlock): Remove.
4702 (Block.IsVariableUsedInBlock): Likewise.
4703 (Block.CheckInvariantMeaningInBlock): New. Show location of
4704 conflicting declaration.
4705 (Block.AddVariable): Make error messages less long-winded and more
4706 specific. Show location of conflicting declaration.
4707 * parameter.cs (Parameters.Location): New readonly property.
4709 2005-03-31 Raja R Harinath <rharinath@novell.com>
4711 Clean up semantics of invoking ResolveMemberAccess.
4712 * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4713 can have an instance, ensure that we pass in a non-TypeExpression
4714 to ResolveMemberAccess. Tighten up IdenticalNameAndTypeName checks.
4715 (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4716 argument. Update to changes and simplify.
4717 (FieldExpr.Emitinstance): Remove CS0120 check.
4718 (PropertyExpr.EmitInstance): Likewise.
4719 * expression.cs (Argument.Resolve): Likewise.
4720 (Invocation.DoResolve): Update to changes in semantics of
4723 2005-03-31 Marek Safar <marek.safar@seznam.cz>
4726 * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4729 * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4731 2005-03-31 Raja R Harinath <rharinath@novell.com>
4733 Fix difference in behaviour with commandline invocation.
4734 * driver.cs (Driver.Reset): New.
4735 (CompilerCallableEntryPoint): Call it.
4737 * statement.cs (If.Resolve): Avoid spurious "uninitialized
4738 variable" warnings if the boolean expression failed to resolve.
4740 2005-03-30 Sebastien Pouliot <sebastien@ximian.com>
4742 * attribute.cs: Fix the union of several permissions when some of them
4743 are unrestricted (so the result isn't an unrestricted permission set).
4746 2005-03-30 Raja R Harinath <rharinath@novell.com>
4748 * ecore.cs (MemberExpr): New class. Convert from interface
4750 (MemberExpr.ResolveMemberAccess): Refactor and move here from
4751 MemberAccess.ResolveMemberAccess. Tighten up pre-conditions and
4753 (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4754 (MethodGroupExpr.IsExplicitImpl): Remove.
4755 (Expression.GetFieldFromEvent): Remove.
4756 (SimpleName.MemberStaticCheck): Remove.
4757 (SimpleName.DoSimpleNameResolve): Update to changes.
4758 * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4759 (MemberAccess.IdenticalNameAndTypeName): Remove.
4760 (MemberAccess.error176): Move to MemberExpr.
4761 (MemberAccess.DoResolve): Update to changes.
4762 (BaseAccess.DoResolve): Likewise.
4764 2005-03-30 Marek Safar <marek.safar@seznam.cz>
4766 C# 2.0 Conditional attribute class implementation
4768 * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4769 Analyzes class whether it has attribute which has ConditionalAttribute
4770 and its condition is not defined.
4772 * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4773 (Class.IsExcluded): New method. Search for at least one defined
4774 condition in ConditionalAttribute of attribute class.
4776 2005-03-30 Raja R Harinath <rharinath@novell.com>
4778 * ecore.cs (PropertyExpr): Derive from Expression, not
4779 ExpressionStatement.
4780 (PropertyExpr.EmitStatement): Remove.
4782 2005-03-29 Raja R Harinath <rharinath@novell.com>
4785 * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4786 internal field "value__" of an enum be private. The examples for
4787 "value__" that I found on MSDN all used FieldAttributes.Private.
4789 * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4790 Don't mention IL method attribute names.
4792 Fix #47991. Remove a TODO.
4793 * statement.cs (Block.Toplevel): Make into a field.
4794 (Block.Parameters): Move into ToplevelBlock.
4795 (Block.known_variables): Rename from child_variable_names.
4796 (Block.Block): Remove variants that take Parameters. Initialize
4797 'Toplevel' with the immediately surrounding toplevel block.
4798 (Block.AddKnownVariable): Rename from AddChildVariableName. Add a
4799 LocalInfo parameter.
4800 (Block.GetKnownVariableInfo): New.
4801 (Block.IsVariableNameUsedInChildBlock): Update.
4802 (Block.IsVariableNameUsedInBlock): New. Checks if a name is used in
4803 the block, even though it may not be in scope.
4804 (Block.AddVariable): Remove Parameters parameter. Use
4805 Toplevel.Parameters instead.
4806 (Block.AddConstant): Remove Parameters parameter.
4807 (Block.GetParameterReference): Update to use Toplevel.Parameters.
4808 (Block.IsParamaterReference): Likewise.
4809 (Block.IsLocalParameter): Likewise. Simplify a lot.
4810 (ToplevelBlock.Parameters): New. Moved from Block.
4811 (ToplevelBlock.ToplevelBlock): Update to changes. Always
4812 initialize Parameters to a non-null value.
4813 * cs-parser.jay: Update to changes.
4814 * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4815 simple names that mean different things in the same block. Use
4816 Block.IsVariableNameUsedInBlock.
4818 2005-03-28 Raja R Harinath <rharinath@novell.com>
4820 * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4822 2005-03-26 Raja R Harinath <harinath@acm.org>
4825 * assign.cs (Assign.DoResolve): When the RHS of an assignment
4826 fails to resolve, ensure that the LHS is still resolved as an
4829 2005-03-25 Raja R Harinath <harinath@acm.org>
4831 * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4833 (Enum.current_ec): Remove.
4834 (Enum.LookupEnumValue): Remove EmitContext argument.
4835 Just uses the one created during DefineType.
4836 (Enum.FindMembers): Update.
4837 * expression.cs (MemberAccess.DoResolve): Update.
4839 2005-03-22 Marek Safar <marek.safar@seznam.cz>
4841 * assign.cs (Assign.DoResolve): Check for CS1717 when
4842 source and target are same (uses Equals).
4844 * expression.cs (LocalVariableReference, ParameterReference,
4845 This): Implemented Equals, GetHashCode.
4847 * statement.cs (Block.GetParameterReference): Removed useless
4850 2005-03-22 Raja R Harinath <rharinath@novell.com>
4853 * statement.cs (Block.AddVariable): Ensure that we skip implicit
4854 blocks before deciding whether the error is cs0136 or cs0128.
4856 * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4857 (using_alias_directive, using_namespace_directive): Pass
4858 MemberName, not an expression to Namespace.UsingAlias and
4860 (MakeName): Use the MemberName of the namespace.
4861 * namespace.cs (Namespace.MemberName): New.
4862 (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4863 (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4865 * decl.cs (MemberName.Name): Make readonly.
4866 (MemberName.FromDotted): New "constructor".
4867 (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4868 (MemberCore.Name): Compute from MemberName on demand.
4869 (MemberCore.SetMemberName): Provide a way to change the
4871 (MemberCore.AddToContainer): Don't take a fullname parameter.
4872 * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4873 fully qualified name of the container to the member name.
4874 (TypeContainer.AddToTypeContainer): Use a fully qualified name
4875 only if the type is a member of the root container.
4876 (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4877 MemberName.Left rather than searching for an embedded ".".
4878 (PartialContainer.CreatePart): Update to changes in RootContext.
4879 (MemberBase.ShortName): Turn into a property. Use
4880 MemberCore.SetMemberName.
4881 (MemberBase.ExplicitInterfaceName): Remove.
4882 (MemberBase.UpdateMemberName): Remove.
4883 (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4884 (PropertyBase.SetMemberName): New override.
4885 * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4886 (Tree.GetDecl): New.
4887 (Tree.AllDecls): Rename from Decls.
4888 * attribute.cs, enum.cs, report.cs: Update to changes.
4889 * driver.cs (MainDriver): Use MemberName.FromDotted on
4890 RootContext.MainClass.
4892 2005-03-21 Marek Safar <marek.safar@seznam.cz>
4894 * class.cs (FixedField.Define): Check for CS1664 and more sanity
4897 * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4899 2005-03-18 Marek Safar <marek.safar@seznam.cz>
4901 * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4902 property accessor modifiers.
4904 * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4905 fixed buffer attribute (CS1716).
4906 (PropertyMethod.HasCustomAccessModifier): When property accessor
4907 has custom modifier.
4909 * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4911 (PropertyExpr.DoResolveLValue): Add CS0272.
4913 2005-03-17 Miguel de Icaza <miguel@novell.com>
4915 * convert.cs: When converting to a pointer, use the proper Conv.U
4916 or Conv.I depending on the source data type.
4918 * cs-tokenizer.cs: Make the size for large decimal constants,
4921 2005-03-17 Martin Baulig <martin@ximian.com>
4923 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4924 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
4926 2005-03-17 Martin Baulig <martin@ximian.com>
4928 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4929 to bool so we can return an error condition.
4930 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4933 2005-03-16 Zoltan Varga <vargaz@freemail.hu>
4935 * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4938 2005-03-16 Raja R Harinath <rharinath@novell.com>
4940 Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4941 Refactor to avoid traversing the list of assemblies, and to avoid
4942 string concatenation.
4943 * typemanager.cs (guid_attr_type): Remove.
4944 (negative_hits, pointers, references): Remove hashes.
4946 (GetConstructedType): New. Uses type_hash to handle constructed
4947 types (arrays, references, pointers).
4948 (GetReferenceType, GetPointerType): Use it.
4949 (GetNestedType): New. Uses type_hash to handle nested types of
4951 (LookupType, LookupTypeDirect): Remove.
4952 (CoreLookupType): Inline parts of old LookupTypeDirect code. Use
4953 'types' hash and LookupTypeReflection directly.
4954 (params_string, params_object): Use GetConstructedType.
4955 * namespace.cs (Namespace.cached_types): New. Cache of reflected
4957 (Namespace.Lookup): Use cached_types.
4958 (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4959 provided by old TypeManager.LookupType.
4960 * rootcontext.cs (MakeFQN): Remove.
4961 * decl.cs (DeclSpace.MakeFQN): Likewise.
4962 (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4963 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4964 TypeManager.GetConstructedType.
4965 * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4967 2005-04-16 Zoltan Varga <vargaz@freemail.hu>
4969 * cs-parser.jay: Fix build.
4971 2005-03-15 Marek Safar <marek.safar@seznam.cz>
4973 * class.cs (TypeContainer.CircularDepException) New nested
4974 (MethodCore.CheckBase): Report CS1715 for properties and indexers.
4976 * cs-parser.jay: Reports CS1527 for any namespace element.
4978 * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4981 * expression.cs (ParameterReference.IsAssigned): Changed error to
4983 (Error_WrongNumArguments): Moved CS0245 detection here.
4985 * statement.cs (Return.Resolve): Add CS1622 report.
4987 2005-03-11 Marek Safar <marek.safar@seznam.cz>
4989 * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4991 2005-03-11 Zoltan Varga <vargaz@freemail.hu>
4993 * attribute.cs expression.cs: Get rid of some allocations.
4995 2004-03-11 Atsushi Enomoto <atsushi@ximian.com>
4997 * doc.cs : just eliminate the latest change.
4999 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5001 * doc.cs : commented out the latest change. It breaks xml-030.cs
5003 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5005 * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
5006 fail. So invoke CreateType() in FindDocumentedType().
5008 2004-03-10 Atsushi Enomoto <atsushi@ximian.com>
5010 * cs-tokenizer.cs : added IsKeyword().
5011 * doc.cs : Detect keyword incorrectly used as identifier.
5012 Allow identifiers prefixed by @.
5014 2005-03-10 Marek Safar <marek.safar@seznam.cz>
5016 * attributes.cs (Attributes.Emit): Continue after CheckTargets.
5017 It caused exception in namespace resolving (again!).
5019 * class.cs (Class.ctor): Removed exit.
5020 (PropertyMethod.ctor): ditto.
5022 * codegen.cs (Codegen.Reset): Reset static data.
5023 (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
5025 * cs-tokenizer.cs (Cleanup): Removed.
5027 * driver.cs (GetSystemDir): Rewrote to one line command.
5028 It caused problem with unloaded dynamic modules.
5029 (UnixParseOption): Removed Exit.
5030 (CompilerCallableEntryPoint.InvokeCompiler): Make static.
5031 (CompilerCallableEntryPoint.Reset): Reset suitable static data.
5032 Now can be mcs used as library.
5034 * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
5037 * location.cs (Reset): Reset static data.
5039 * namespace.cs (Reset): Reset static data.
5041 * report.cs (Report.Reset): Reset static data.
5043 * rootcontext.cs (RootContext.Reset): Reset static data.
5045 * tree.cs (RootTypes.ctor): Use Location.Null
5047 * typemanager.cs (TypeManager.Reset): Reset static data.
5048 (CoreLookupType): Removed Exit.
5049 (TypeHandle.Reset): Reset static data.
5051 2005-03-10 Raja R Harinath <rharinath@novell.com>
5054 * typemanager.cs (ComputeNamespaces): Import namespaces from
5055 referenced modules too.
5057 2005-03-09 Raja R Harinath <rharinath@novell.com>
5059 * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
5062 2005-03-09 Raja R Harinath <rharinath@novell.com>
5064 * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
5065 enclosing DeclSpace. This ensures that a name-lookup populates
5066 more caches and there are fewer 'TypeExpression's. Carve out
5067 nested type lookup into ...
5068 (LookupNestedTypeInHierarchy): ... this.
5070 2005-04-15 Martin Baulig <martin@ximian.com>
5072 Merged r41590 from MCS and make it work in the generics land.
5074 * generic.cs (TypeParameter.UpdateConstraints): Removed the
5077 * class.cs (PartialContainer.UpdateConstraints): Removed.
5078 (PartialContainer.CheckConstraints): Removed.
5079 (PartialContainer.SetParameterInfo): Store the constraints here.
5080 (PartialContainer.DefineTypeParameters): New public method;
5081 resolve the type parameter's constraints here. Note that the
5082 PartialContainer doesn't have an EmitContext anymore, so we must
5083 do this in the ClassPart.
5085 2005-03-09 Raja R Harinath <rharinath@novell.com>
5087 Clean up a few partial-class semantics.
5088 Fixes test-357.cs and cs1618-2.cs.
5089 * cs-parser.jay (struct_declaration): Use 'current_class' as
5090 parent of newly-created struct. Remove call to Register ().
5091 Use 'pop_current_class' to complete handing the current struct.
5092 (interface_declaration): Likewise.
5093 (class_declaration): Likewise.
5094 (enum_declaration): Use 'current_class' as parent of newly created
5096 (delegate_declaration): Likewise.
5097 (pop_current_class): New function. This is used to handle closing
5098 up the 'current_class' and 'current_container', and pointing them
5099 to the enclosing class/container.
5100 (CSharpParser): Initialize 'current_class' too.
5101 * decl.cs (MemberCore): Add check for invariant: a partial
5102 container is not a parsed entity, and thus does not enclose any
5104 (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
5105 (DeclSpace.BaseTypeExpr): Use it.
5106 (DeclSpace.LookupType): Add check for invariant.
5107 * class.cs (TypeContainer): Add check for invariant: a nested
5108 class should have the same NamespaceEntry as its enclosing class.
5109 (TypeContainer.EmitFieldInitializers): Make virtual.
5110 (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
5112 (TypeContainer.Register): Remove.
5113 (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
5114 null. Use TypeResolveEmitContext for resolving base types and
5115 interfaces. Move initialization of Parts.TypeBuilder here from
5117 (TypeContainer.DefineNestedTypes): ... here.
5118 (PartialContainer): Take a Namespace not a NamespaceEntry.
5119 (PartialContainer.Create): Don't use Register. Call the
5120 appropriate Add... function directly.
5121 (ClassPart): Take both the PartialContainer and the enclosing
5122 class as constructor arguments.
5123 (ClassPart.EmitFieldInitializers): Override.
5124 (ClassPart.PartFindNestedTypes): Remove.
5125 (FieldBase.GetInitializerExpression): Resolve the initializer
5126 expression in the emit context of the enclosing class.
5127 * tree.cs (RootTypes): Remove Register ().
5129 2005-03-08 Marek Safar <marek.safar@seznam.cz>
5131 * cs-parser.jay: Removed CS0134.
5133 * driver.cs: Removed CS1901.
5135 * expression.cs (SizeOf.DoResolve): Don't report CS0233
5136 for predefined types.
5138 2005-03-07 Duncan Mak <duncan@novell.com>
5140 * codegen.cs (Save): Catch UnauthorizedAccessException as
5141 well. Fixes bug #73454.
5143 2005-03-07 Marek Safar <marek.safar@seznam.cz>
5145 * cs-tokenizer.cs (xtoken): Add CS1035.
5147 * class.cs (MethodData.Define): Add CS0683.
5148 (FieldMember.ctor): Add CS0681.
5150 2005-03-07 Raja R Harinath <rharinath@novell.com>
5152 * ecore.cs (SimpleName.DoResolve): Rename from
5153 SimpleName.DoResolveAllowStatic.
5154 (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
5155 Pass 'intermediate' flag to MemberStaticCheck.
5156 (SimpleName.MemberStaticCheck): Skip "static check" only in case
5157 of "intermediate" lookups via MemberAccess.
5158 (SimpleName.IdenticalNameAndTypeName): New. Carved out of ...
5159 * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
5161 2005-03-07 Raja R Harinath <rharinath@novell.com>
5164 * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
5165 slipped in because of variable names that are identical to a
5166 builtin type's BCL equivalent ('string String;', 'int Int32;').
5167 (PropertyExpr.EmitInstance): Likewise.
5169 2005-03-04 Marek Safar <marek.safar@seznam.cz>
5171 * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
5173 * report.cs (warning_ignore_table): Made public.
5175 2005-03-04 Raja R Harinath <rharinath@novell.com>
5178 * class.cs (MethodData.Emit): Pass 'container' to
5179 container.GetObsoleteAttribute instead of 'container.Parent'.
5181 2005-03-03 Marek Safar <marek.safar@seznam.cz>
5183 * cs-parser.jay: Add 1534 error test.
5185 * iterators.cs (Yield.CheckContext): Add error 1629.
5186 (Iterator.ctor): Save unsafe modifier.
5187 (MoveNextMethod.DoEmit): Restore unsafe context.
5189 * namespace.cs (UsingAlias): Better error message.
5191 2005-03-03 Dan Winship <danw@novell.com>
5193 * convert.cs (Error_CannotImplicitConversion): fix two bugs in
5194 the warning message [#73219]
5196 2005-03-03 Raja R Harinath <rharinath@novell.com>
5198 Fix compile with MCS 1.0.0.0.
5199 * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
5200 w_restore to not depend on string constant folding.
5202 2005-03-03 Raja R Harinath <rharinath@novell.com>
5204 * decl.cs (DeclSpace.LookupType): Remove 'silent' argument. Move
5205 CS0246 check to users who passed 'silent = false'.
5206 * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
5208 (SimpleName.SimpleNameResolve): Update.
5209 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
5210 (MemberAccess.IdenticalNameAndTypeName): Update.
5211 * doc.cs (FindDocumentedTypeNonArray): Update.
5213 2005-03-03 Raja R Harinath <rharinath@novell.com>
5215 * codegen.cs (EmitContext): Remove ResolvingTypeTree.
5216 * parameters.cs (ComputeAndDefineParameters): Remove.
5217 * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
5218 * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
5219 Use GetParameterInfo.
5221 2005-03-02 Marek Safar <marek.safar@seznam.cz>
5223 * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
5225 2005-03-02 Raja R Harinath <rharinath@novell.com>
5227 Unify DeclSpace.LookupType and DeclSpace.FindType.
5228 * decl.cs (DeclSpace.FindNestedType): New virtual function. This
5229 is in charge of defining nested types on demand.
5230 (DeclSpace.LookupType): Use it when the current_type is a
5231 TypeBuilder. Use LookupTypeDirect for reflected types.
5232 (DeclSpace.FindType): Remove.
5233 (DeclSpace.LookupInterfaceOrClass): Likewise.
5234 (DeclSpace.DefineTypeAndParents): Likewise.
5235 * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
5236 DeclSpace.LookupType.
5237 * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
5238 * typemanager.cs (LookupType): Simplify.
5239 (AddUserType): Remove type from negative_hits.
5240 * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
5241 * class.cs (TypeContainer.FindMembers): Move handling of nested
5243 (TypeContainer.FindMembers_NestedTypes): ... here.
5244 (TypeContainer.FindNestedType): Implement override.
5245 (ClassPart.FindNestedType): Delegate to PartialContainer.
5246 (ClassPart.PartFindNestedType): Looks up the nested types of the
5249 2005-04-14 Martin Baulig <martin@ximian.com>
5251 * generic.cs (ConstructedType): Moved all the type lookup and
5252 nested class logic into SimpleName.
5253 (ConstructedType.ResolveConstructedType): Our underlying type is
5254 already fully resolved; all the type lookup stuff is in
5257 * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
5258 constructed types here instead of in ConstructedType.
5260 * decl.cs (MemberName.GetTypeExpression): Always create a
5261 SimpleName, not a ConstructedType.
5262 (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
5264 2005-03-02 Martin Baulig <martin@ximian.com>
5266 * class.cs (TypeContainer.DoDefineMembers): We also need a default
5267 static constructor in static classes.
5269 2005-03-01 Zoltan Varga <vargaz@freemail.hu>
5271 * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
5272 sizeParamIndex is not specified.
5274 2005-03-01 Marek Safar <marek.safar@seznam.cz>
5277 * report.cs (WarningMessage.IsEnabled): Missing null check.
5279 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5281 * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
5282 in the fields and not in the properties.
5284 2005-02-28 Zoltan Varga <vargaz@freemail.hu>
5286 * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex
5289 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5291 * attribute.cs: Small refactoring (improved robustness).
5292 (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
5293 (ValidateGuid): Removed.
5294 (Resolve): Removed referenced to above mentioned.
5295 (GetAttributeUsage): Made private and changed to work without
5297 (GetIndexerAttributeValue): Don't crash.
5298 (GetConditionalAttributeValue): Ditto.
5299 (GetClsCompliantAttributeValue): Ditto.
5300 (ExtractSecurityPermissionSet): All attributes exceptions are
5302 (GetPropertyValue): New helper.
5303 (GetMethodImplOptions): New method.
5304 (DefinePInvokeMethod): Reuse common code. Implemented handling of
5305 some missing properties.
5307 * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5308 (Method.ApplyAttributeBuilder): Updated.
5310 * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5313 2005-02-28 Raja R Harinath <rharinath@novell.com>
5316 * report.cs (Report.SymbolRelatedToPreviousError): Handle
5317 non-simple types (array, pointer, reference).
5319 2005-02-28 Marek Safar <marek.safar@seznam.cz>
5321 * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5323 * class.cs (MethodCore.IsDuplicateImplementation): Special error
5325 (Method.CheckBase): Catch wrong destructor here.
5326 (MethodData.Define): Add errors 550, 668.
5328 * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5330 * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5332 * pending.cs (VerifyPendingMethods): Add error 551.
5334 * typemanager.cs (CSharpName): Next error report helper.
5336 2005-02-25 Marek Safar <marek.safar@seznam.cz>
5338 * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5339 attributes. Removed useless attribute double check.
5340 It saves almost 2MBs for corlib.
5342 2005-02-25 Raja R Harinath <rharinath@novell.com>
5345 * statement.cs (ExpressionStatement.Resolve): Make robust to being
5346 called twice in case of error.
5348 2005-02-23 Chris Toshok <toshok@ximian.com>
5350 Fix compiler portions of #72827.
5351 * statement.cs (Block.Emit): call Begin/EndScope on the
5352 EmitContext instead of the ILGenerator.
5354 * codegen.cs (EmitContext.BeginScope): new method, call
5355 ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5357 (EmitContext.BeginScope): same, but EndScope and CloseScope
5359 * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5360 offset and call the superclass's OpenScope(int) with it.
5361 (SymbolWriter.CloseScope): get the current il
5362 offset and call superclass's CloseScope(int) with it.
5364 2005-02-23 Marek Safar <marek.safar@seznam.cz>
5366 * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5367 CS1677 for out and ref as well.
5369 * class.cs (Method.Define): Add error CS1599 detection.
5371 * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5373 * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5375 * delegate.cs (Delegate.Define): Add error CS1599 detection.
5377 * support.cs.cs (ModifierDesc): New helper method.
5379 2005-02-23 Raja R Harinath <rharinath@novell.com>
5380 Abin Thomas <projectmonokochi@rediffmail.com>
5381 Anoob V E <projectmonokochi@rediffmail.com>
5382 Harilal P R <projectmonokochi@rediffmail.com>
5385 * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5386 MemberLookup (used for error reporting) actually returns a result.
5387 Fix error report number (122, not 112).
5389 2005-02-22 Abin Thomas <projectmonokochi@rediffmail.com>
5390 Anoob V E <projectmonokochi@rediffmail.com>
5391 Harilal P R <projectmonokochi@rediffmail.com>
5394 * pending.cs (PendingImplementation.GetAbstractMethods):
5395 Find NonPublic members too.
5397 2005-02-22 Marek Safar <marek.safar@seznam.cz>
5399 * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5402 * class.cs (MethodCore.CheckMethodAgainstBase):
5403 Add error 239 report.
5405 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5407 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5409 * class.cs (Operator.Define): Add error 217 report.
5411 2005-02-21 Raja R Harinath <rharinath@novell.com>
5414 * expression.cs (Invocation.IsApplicable): Make public.
5415 (Invocation.IsParamsMethodApplicable): Likewise.
5416 * delegate.cs (Delegate.VerifyApplicability): Don't use
5417 Invocation.VerifyArgumentCompat for parameter applicability
5418 testing. Use Invocation.IsApplicable and
5419 Invocation.IsParamsMethodApplicable.
5421 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5423 * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5425 * class.cs (Operator.Define): Add error 217 report.
5427 2005-02-21 Raja R Harinath <rharinath@novell.com>
5429 * namespace.cs (UsingEntry.Resolve): Undo change below.
5431 2005-02-21 Raja R Harinath <rharinath@novell.com>
5434 * ecore.cs (Expression.MemberLookupFailed): Add argument to
5435 disable the error message when the extended MemberLookup also
5437 (Expression.MemberLookupFinal): Update.
5438 (SimpleName.DoSimpleNameResolve): Update.
5439 * expression.cs (MemberAccess.ResolveNamespaceOrType):
5440 Don't use MemberLookupFinal.
5441 (New.DoResolve): Update.
5442 (BaseAccess.CommonResolve): Update.
5444 2005-02-21 Raja R Harinath <rharinath@novell.com>
5447 * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5448 occured previously, don't resolve again.
5450 2005-02-21 Marek Safar <marek.safar@seznam.cz>
5453 * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5454 argument. Call ResolveAttributeUsage for unresolved.
5455 when types doesn't match ctor arguments.
5457 * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5458 for nested attribute classes.
5459 (Class.attribute_usage): Removed.
5460 (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5461 for attribute class.
5463 * ecore.cs (IsAttribute): Removed.
5465 * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5467 * rootcontext.cs (RegisterAttribute): Removed, attributes are
5469 (attribute_types): Removed.
5470 (EmitCode): Global attributes are emited as the latest.
5472 2005-02-18 Marek Safar <marek.safar@seznam.cz>
5474 * class.cs (EmitFieldInitializers): Don't emit field initializer
5475 for default values when optimilization is on.
5477 * constant.cs (Constant.IsDefaultValue): New property.
5479 * driver.cs: Add /optimize handling.
5483 * literal.cs: Implement new IsDefaultValue property.
5485 * rootcontext.cs (Optimize): New field, holds /optimize option.
5487 2005-02-18 Raja R Harinath <rharinath@novell.com>
5489 Fix crasher in re-opened #72347.
5490 * namespace.cs (Namespace.Lookup): Return null if
5491 DeclSpace.DefineType returns null.
5494 * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5496 2005-02-18 Raja R Harinath <rharinath@novell.com>
5498 Fix remainder of #63202. Change semantics of DoResolveLValue: it
5499 now returns null if it cannot resolve to an lvalue.
5500 * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5501 (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5502 returned null. Remove check for SimpleName.
5503 (EventExpr.DoResolveLValue): New.
5504 * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5505 * expression.cs (Argument.Error_LValueRequired): New. Move CS1510
5507 (Argument.Resolve): ... here. Use it. Use DoResolveLValue to
5509 (Unary.ResolveOperator): Move CS0211 check ...
5510 (Unary.DoResolve): ... here. Use DoResolveLValue to avoid
5512 (Unary.DoResolveLValue): Simplify.
5513 (AddressOf.DoResolveLValue): New.
5514 (ArrayAccess.DoResolveLValue): New.
5516 2005-02-16 Marek Safar <marek.safar@seznam.cz>
5518 * attribute.cs (Attribute.Resolve): Add arguments casting for
5519 when types doesn't match ctor arguments.
5521 2005-02-16 Raja R Harinath <rharinath@novell.com>
5523 Fix parts of #63202.
5524 * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5525 lookup of operator in base type. Ensure that all checks happen
5526 when the operator resolves to an "op_..." method.
5528 2005-02-15 Raja R Harinath <rharinath@novell.com>
5531 * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5532 'ignore_cs0104' parameter. Pass it to ...
5533 (NamespaceEntry.Lookup): ... this.
5534 * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5535 * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5536 (TypeLookupExpression.DoResolveAsTypeStep): Update.
5537 * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5538 Update. Request that cs0104 errors be ignored.
5539 (ComposedCast.ResolveAsTypeStep): Update.
5541 2005-02-14 Raja R Harinath <rharinath@novell.com>
5544 * expression.cs (Invocation.BetterFunction): Remove support for
5545 comparing virtual functions and their overrides.
5546 (Invocation.IsOverride): New.
5547 (Invocation.OverloadResolve): Don't consider 'override' functions
5548 during candidate selection. Store them in a lookaside list.
5549 If the selected method is a 'virtual' function, use the list to
5550 find any overrides that are closer to the LHS type.
5552 2005-02-14 Marek Safar <marek.safar@seznam.cz>
5554 * expression.cs (New.DoResolve): Add complex core type reduction.
5555 (New.Constantify): Converts complex core type syntax like 'new int ()'
5558 2005-02-14 Raja R Harinath <rharinath@novell.com>
5560 * decl.cs (EntryType.EntryType): New constructor to create an
5561 updated copy of a cache entry.
5562 (MemberCache.AddMethods): Use it.
5563 (MemberCache.ClearDeclaredOnly): Remove.
5564 (MemberCache.MemberCache): Update.
5566 2005-02-11 Miguel de Icaza <miguel@novell.com>
5568 * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5569 variable. This one is represents the actual low-level declaration
5570 of the method, as opposed to the semantic level `IsStatic'.
5572 An anonymous method which is hosted into a static method might be
5573 actually an instance method. IsStatic would reflect the
5574 container, while MethodIsStatic represents the actual code
5577 * expression.cs (ParameterReference): Use the new MethodIsStatic
5578 instead of IsStatic.
5580 * anonymous.cs (AnonymousMethod.Compatible): Pass the
5581 Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5582 set on the current EmitContext.
5584 * expression.cs (Cast): Overload DoResolveLValue so we can pass
5585 resolve our casted expression as an LValue. This triggers the
5586 proper LValue processing that is later required by Assign.
5590 * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5592 2005-02-11 Marek Safar <marek.safar@seznam.cz>
5594 C# 2.0 Fixed buffer implementation
5596 * anonymous.cs: Update after RegisterHelperClass renaming.
5598 * attribute.cs (AttributeTester.fixed_buffer_cache):
5599 Cache of external fixed buffers.
5600 (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5601 implementation if field is fixed buffer else null.
5604 (TypeContainer.AddField): Accept FieldMember instead of Field.
5605 (FieldBase.IsFieldClsCompliant): Extracted code from
5606 VerifyClsCompliance descendant customization.
5607 (FixedField): New class handles fixed buffer fields.
5608 (FixedFieldExternal): Keeps information about imported fixed
5610 (IFixedField): Make access to internal or external fixed buffer
5613 * cs-parser.jay: Add fixed buffer parsing.
5615 * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5618 * expression.cs (Indirection): Extended implementation to accept
5620 (PointerArithmetic.Emit): Get element from fixed buffer as well.
5621 (ElementAccess.MakePointerAccess): Get type as parameter.
5622 (DoResolve): Add fixed buffer field expression conversion.
5623 (DoResolveLValue): Ditto.
5624 (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5625 (ArrayPtr): Derives from FixedBufferPtr.
5626 (ArrayPtr.Emit): Add extra emit for array elements.
5628 * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5630 * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5631 for compiler generated types.
5632 (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5634 * statement.cs (Fixed): Refactored to be easier add fixed buffer
5635 and consume less memory.
5636 (Fixed.Resolve): Add fixed buffer case.
5638 * typemanager.cs (compiler_generated_attr_ctor,
5639 fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5640 (HasElementType): Add our own implementation to work on every
5643 2005-02-11 Miguel de Icaza <miguel@novell.com>
5645 * anonymous.cs (CaptureContext): Track whether `this' has been
5648 * expression.cs (This.ResolveBase): Call CaptureThis. Before we
5649 only captured `this' if it was implicitly done (instance
5650 methods/variables were used).
5652 * codegen.cs (EmitContext.CaptureThis): New method to flag that
5653 `this' must be captured.
5655 2005-01-30 Miguel de Icaza <miguel@novell.com>
5657 * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5658 is null it means that there has been no need to capture anything,
5659 so we just create a sibling.
5661 Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5663 Just a partial fix. The other half is fairly elusive.
5665 2005-02-10 Raja R Harinath <rharinath@novell.com>
5667 Fix #52586, cs0121-4.cs.
5668 * decl.cs (MemberCache.DeepCopy): Rename from SetupCache. Take
5669 and return a hashtable.
5670 (MemberCache.ClearDeclaredOnly): New.
5671 (MemberCache.MemberCache): Update to change. Make a deep copy of
5672 the method_hash of a base type too.
5673 (MemberCache.AddMethods): Adapt to having a deep copy of the base
5674 type methods. Overwrite entries with the same MethodHandle so
5675 that the ReflectedType is correct. The process leaves in base
5676 virtual functions and their overrides as distinct entries.
5677 (CacheEntry): Now a class instead of a struct. It shouldn't alter
5678 matters since it was boxed in a ArrayList before.
5679 (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5681 * expression.cs (Invocation.BetterFunction): Simplify. Handle the
5682 case of a virtual function and its override (choose the overload
5684 (Invocation.OverloadResolve): Avoid 'override' members during
5685 'applicable_type' calculation.
5687 2005-03-28 Raja R Harinath <rharinath@novell.com>
5689 * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5690 (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5691 GetTypeHandle. It is possible for a reflected type to derive from
5692 a TypeBuilder (e.g., int[] derives from the TypeBuilder
5693 System.Array during mscorlib compilation).
5694 * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5695 contain a method_hash, don't create one either. Don't create a
5696 deep copy of the base cache's method_hash.
5697 (MemberCache.SetupCache): Rename back from DeepCopy.
5698 (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5699 already initialized. If we see an override function, add its
5700 underlying base virtual function to the member_hash too.
5702 2005-02-09 Raja R Harinath <rharinath@novell.com>
5704 Combine two near-redundant caches.
5705 * typemanager.cs (method_params): Rename from method_internal_params.
5706 (TypeManager.GetParameterData): New. Replace
5707 Invocation.GetParameterData.
5708 (TypeManager.LookupParametersByBuilder): Remove.
5709 * expression.cs (Invocation.method_parameter_cache): Remove.
5710 (Invocation.GetParameterData): Remove.
5712 * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5715 2005-02-08 Raja R Harinath <rharinath@novell.com>
5718 * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5719 TypeManager.multicast_delegate_type is null, resolve it by looking
5720 up "System.MulticastDelegate".
5721 * rootcontext.cs (RootContext.ResolveCore): Simplify.
5723 2005-02-07 Abin Thomas (NOSIP) <projectmonokochi@rediffmail.com>
5724 Anoob V.E (NOSIP) <projectmonokochi@rediffmail.com>
5725 Harilal P.R (NOSIP) <projectmonokochi@rediffmail.com>
5728 * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5729 (LabeledStatement.AddReference): New. Set 'referenced'.
5730 (Goto.Resolve): Use it.
5732 2005-02-05 John Luke <john.luke@gmail.com>
5734 * driver.cs: remove duplicate -doc line in Usage ()
5736 2005-02-04 Raja R Harinath <rharinath@novell.com>
5738 * location.cs (Location.AddFile): Fix CS2002 error report.
5740 2005-02-02 Martin Baulig <martin@ximian.com>
5742 * delegate.cs (Delegate.DefineType): Report an internal error if
5743 TypeManager.multicast_delegate_type is null. See bug #72015 for
5746 2005-02-02 Raja R Harinath <rharinath@novell.com>
5748 Fix a crasher in a variant of #31984.
5749 * const.cs (Constant.CheckBase): New override that defers the
5750 new-or-override check in case the base type hasn't been populated
5752 (Constant.Define): Ensure the new-or-override check is performed.
5754 2005-02-01 Duncan Mak <duncan@ximian.com>
5756 * const.cs (LookupConstantValue): Check that `ce' is not null
5757 before calling GetValue ().
5759 2005-02-01 Raja R Harinath <rharinath@novell.com>
5761 Fix test-334.cs (#69519).
5762 * cs-parser.jay (using_alias_directive): Pass in an expression to
5763 NamespaceEntry.UsingAlias.
5764 (using_namespace_directive): Pass in an expression to
5765 NamespaceEntry.Using.
5766 (namespace_name): Don't flatten to a string.
5767 * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5768 (NamespaceEntry.AliasEntry.Resolve): Lookup using
5770 (NamespaceEntry.UsingEntry): Likewise.
5771 (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5773 (NamespaceEntry.LookupForUsing): Remove.
5774 (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5776 (NamespaceEntry.Lookup): Remove support for dotted names.
5778 2005-02-01 Raja R Harinath <rharinath@novell.com>
5780 * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5782 (NamespaceEntry.ImplicitParent): Compute on demand.
5783 (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5784 parallels the current.
5785 (NamespaceEntry.LookupForUsing): Use it.
5786 (NamespaceEntry.Lookup): If the current namespace-entry is
5787 implicit, don't search aliases and using tables.
5789 2005-02-01 Raja R Harinath <rharinath@novell.com>
5792 * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5794 (TypeContainer.BaseCache): Compute on demand.
5795 (TypeContainer.FindMembers): Define constants and types if they're
5796 not already created.
5797 (FieldMember.Define): Move resetting of ec.InUnsafe before error
5799 * const.cs (Constant.Define): Make idempotent.
5801 2005-01-29 Miguel de Icaza <miguel@novell.com>
5803 * pending.cs: Produce better code (no nops produced by using Ldarg
5806 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5807 i - 1' it should be arg + 1.
5811 2005-01-28 Raja R Harinath <rharinath@novell.com>
5813 * attribute.cs (Attribute.CheckAttributeType): Make private
5815 (Attribute.ResolveType): Make virtual.
5816 (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5817 handling of RootContext.Tree.Types.
5819 2005-01-27 Raja R Harinath <rharinath@novell.com>
5821 Update attribute-handling to use the SimpleName/MemberAccess
5823 * cs-parser.jay (attribute): Pass in an expression to the
5824 constructors of Attribute and GlobalAttribute.
5825 * attribute.cs (Attribute): Take an expression for the name.
5826 (Attribute.ResolvePossibleAttributeTypes): New. Resolves the
5827 passed in attribute name expression.
5828 (Attribute.CheckAttributeType): Use it.
5829 * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5830 * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5831 (MemberAccess.ResolveNamespaceOrType): ... here. Add 'silent'
5832 argument to prevent error messages if the lookup fails.
5834 2005-01-27 Marek Safar <marek.safar@seznam.cz>
5836 * expression.cs (Indirection): Implemented IVariable interface
5837 to support indirection in AddressOf operator.
5838 (PointerArithmetic.Emit): Add optimalization for case where
5839 result can be precomputed.
5841 2005-01-26 Martin Baulig <martin@ximian.com>
5843 * class.cs (TypeContainer.AttributeTargets): Return the correct
5844 AttributeTargets depending on our `Kind' instead of throwing an
5845 exception; fixes #71632.
5847 2005-01-26 Marek Safar <marek.safar@seznam.cz>
5850 * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5853 2005-03-17 Martin Baulig <martin@ximian.com>
5855 * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5856 from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'. Fixes #73260.
5858 2005-03-17 Martin Baulig <martin@ximian.com>
5860 * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5861 to bool so we can return an error condition.
5862 (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5865 2005-03-17 Martin Baulig <martin@ximian.com>
5867 * generic.cs (TypeMananager.IsIEnumerable): New public method.
5869 * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
5870 converting from an array-type of T to `IEnumerable<T>'.
5872 2005-03-16 Martin Baulig <martin@ximian.com>
5874 * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
5875 (Nullable.LiftedUnaryMutator): New public class.
5877 * expression.cs (UnaryMutator.DoResolve): Added support for
5880 2005-03-14 Martin Baulig <martin@ximian.com>
5882 * generic.cs (Nullable.NullCoalescingOperator): Implemented.
5884 2005-03-14 Martin Baulig <martin@ximian.com>
5886 * generic.cs (Nullable.LiftedBinaryOperator): Added support for
5887 the comparision operators `<', `>', `<=' and `>='.
5889 2005-03-13 Martin Baulig <martin@ximian.com>
5892 (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
5893 avoid confusion with the `NullLiteral'.
5894 (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
5896 2005-03-13 Martin Baulig <martin@ximian.com>
5898 * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
5899 comparing arbitrary types with the null literal.
5901 2005-03-13 Martin Baulig <martin@ximian.com>
5903 * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
5904 boolean operators '&&', '||', '&' and '|'.
5905 (Nullable.OperatorTrueOrFalse): New public class.
5907 * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
5908 instead of a `StaticCallExpr'; added support for nullables.
5910 2005-03-10 Martin Baulig <martin@ximian.com>
5913 (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
5914 rather than `etype.IsSubclassOf (TypeManager.value_type)'.
5916 2005-03-07 Martin Baulig <martin@ximian.com>
5918 * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
5919 it work if `expr' is not an IMemoryLocation.
5920 (Nullable.Lifted): Implement IMemoryLocation.
5921 (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
5924 2005-03-05 Martin Baulig <martin@ximian.com>
5926 * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
5927 (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
5928 (Nullable): Added support for lifted unary and binary operators.
5930 * expression.cs (Unary.DoResolve): Added support for nullable types.
5931 (Binary.DoResolve): Likewise.
5932 (Conditional.DoResolve): Likewise.
5934 2005-03-02 Martin Baulig <martin@ximian.com>
5936 * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
5938 * class.cs (ClassPart.SetParameterInfo): Override this.
5939 (PartialContainer.SetParameterInfo): Override this.
5940 (TypeContainer.CheckConstraints): New protected method.
5941 (PartialContainer.CheckConstraints): Override this and check
5942 whether the same contraints were specified in all parts of a
5943 partial generic type definition.
5944 (PartialContainer.UpdateConstraints): New public method.
5946 * generic.cs (TypeParameter.UpdateConstraints): New public method.
5948 2005-03-02 Martin Baulig <martin@ximian.com>
5950 Committing a patch from Carlos Alberto Cortez to fix #72887.
5952 * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
5953 casts from `T []' to `int []'.
5955 2005-03-02 Martin Baulig <martin@ximian.com>
5957 * generic.cs (TypeManager.IsEqual): Make this symmetric.
5959 * expression.cs (Binary.ResolveOperator): When resolving a
5960 BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
5961 `=='. Fixes #71866. See gen-127.cs.
5963 2005-03-02 Martin Baulig <martin@ximian.com>
5965 * class.cs (TypeContainer.DoDefineMembers): We also need a default
5966 static constructor in static classes.
5968 2005-03-02 Martin Baulig <martin@ximian.com>
5971 (NullableType.Name, NullableType.FullName): Add a "?" to the name.
5972 (Nullable.LiftedConversion): Added support for user-defined
5975 * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
5977 * cs-parser.jay: Use ComposedCast everywhere instead of
5978 NullableType, so we don't need to check for NullableType
5980 (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
5981 case where we'll be resolved into a `parenthesized_expression_0'
5985 (Convert.UserDefinedConversion): Added nullable conversions.
5987 2005-02-28 Martin Baulig <martin@ximian.com>
5989 * generic.cs (TypeManager.IsNullableType): New static method.
5990 (Nullable): New abstract class.
5991 (Nullable.NullLiteral): New public class.
5992 (Nullable.LiftedConversion): New public class.
5994 * cs-parser.jay (non_expression_type): Changed `builtin_types' to
5995 `builtin_types opt_nullable'.
5998 (Convert.ImplicitConversionStandard): Added nullable conversions.
5999 (Convert.ExplicitConversionStandard): Likewise.
6000 (Convert.ExplicitConversion): Likewise.
6002 2005-02-26 Martin Baulig <martin@ximian.com>
6004 * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
6005 begin with a "?", for instance "?[]". Don't do a type lookup if
6008 2005-02-25 Martin Baulig <martin@ximian.com>
6010 The first part of Nullable Types :-)
6012 * generic.cs (NullableType): New public class.
6013 (NullCoalescingOperator): New public class.
6014 (TypeArguments.Resolve): Add a CS0306 check.
6016 * cs-parser.jay (opt_error_modifier): Removed, this was unused.
6017 (opt_nullable): New rule.
6018 (type): Added `opt_nullable' to `namespace_or_type_name',
6019 `builtin_types' and `pointer_type'.
6020 (array_type): Added `opt_nullable'.
6021 (opt_rank_specifier_or_nullable): New rule; this is the
6022 combination of `opt_rank_specifier' and `opt_nullable'.
6023 (opt_error): New rule; catch errors here.
6024 (nullable_type_or_conditional): New rule; we use this to check for
6025 nullable and still detect the conditional operator.
6026 (local_variable_type): Use `opt_rank_specifier_or_nullable'
6027 instead `opt_rank_specifier'.
6029 * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
6032 2005-02-24 Martin Baulig <martin@ximian.com>
6034 * README, README.Changes: Removed; they're old and obsolete.
6036 2005-02-22 Martin Baulig <martin@ximian.com>
6038 * generic.cs (TypeParameter.Resolve): If resolving the constraints
6039 returned an error, set `constraints' to null to avoid a crash
6041 (TypeParameter.ResolveType): Likewise.
6043 2005-02-22 Martin Baulig <martin@ximian.com>
6046 (Constraints.ResolveTypes): Protect against being called twice.
6047 (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
6048 (TypeParameter.ResolveType): New public method; calls
6049 constraints.ResolveTypes().
6050 (TypeParameter.DefineType): Moved constraints.ResolveType() out
6051 into the new ResolveType().
6052 (GenericMethod.Define): Call ResolveType() on all our
6055 2005-02-21 Martin Baulig <martin@ximian.com>
6058 (TypeManager.generic_nullable_type): New static public field.
6059 (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
6062 (RootContext.ResolveCore): Resolve "System.Nullable`1".
6064 2005-02-15 Martin Baulig <martin@ximian.com>
6066 * generic.cs (ConstructedType.Constraints): Correctly check
6067 constraints if the argument type is a type parameter; fixes
6070 2005-02-02 Martin Baulig <martin@ximian.com>
6072 * delegate.cs (Delegate.DefineType): Report an internal error if
6073 TypeManager.multicast_delegate_type is null. See bug #72015 for
6076 2005-01-29 Miguel de Icaza <miguel@novell.com>
6078 * pending.cs: Produce better code (no nops produced by using Ldarg
6081 * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6082 i - 1' it should be arg + 1.
6086 2005-01-26 Martin Baulig <martin@ximian.com>
6088 * cs-parser.jay (indexer_declarator): Don't report an error if we
6089 have type parameters since we can be an explicit interface
6090 implementation; fixes #71449.
6092 2005-01-26 Martin Baulig <martin@ximian.com>
6094 * class.cs (TypeContainer.AttributeTargets): Return the correct
6095 AttributeTargets depending on our `Kind' instead of throwing an
6096 exception; fixes #71632.
6098 2005-01-26 Martin Baulig <martin@ximian.com>
6100 * delegate.cs (Delegate.DefineType): Correctly define our type
6101 parameters. Fixes #71483.
6103 2005-01-25 Raja R Harinath <rharinath@novell.com>
6106 * expression.cs (MemberAccess.DoResolve): Don't complain with
6107 cs0572 when the LHS of a member access has identical name and type
6110 2005-01-25 Marek Safar <marek.safar@seznam.cz>
6113 * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
6115 Create custom PermissionSet only for PermissionSetAttribute.
6117 2005-01-24 Marek Safar <marek.safar@seznam.cz>
6120 * class.cs (StaticClass.DefineContainerMembers): Enable enums and
6121 delegates in static class.
6123 2005-01-24 Martin Baulig <martin@ximian.com>
6125 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6126 merging an implicit block, just use its reachability.
6128 * statement.cs (Block.Resolve): Make the unreachable code check
6129 work wrt. implicit blocks; see test-337 from #63842.
6131 2005-01-21 Alp Toker <alp@atoker.com>
6133 * cs-parser.jay: destructor_declaration's container is PartialContainer
6134 not Class when partial types are used, so use Kind prop instead of
6137 2005-01-22 Miguel de Icaza <miguel@ximian.com>
6139 * cs-parser.jay: Improve error reporting when an interface
6142 2005-01-20 Dick Porter <dick@ximian.com>
6144 * support.cs: SeekableStreamReader fix from Sandor Dobos
6145 (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
6146 chars are read. Fixes bug 70369.
6148 2005-01-20 Raja R Harinath <rharinath@novell.com>
6150 * cs-parser.jay (catch_clause): Simplify current_block handling
6153 2005-01-17 Miguel de Icaza <miguel@ximian.com>
6155 * convert.cs (ImplicitStandardConversionExists): Synchronize the
6156 code with ImplicitStandardConversion to handle the implicit
6157 conversion of method groups into valid delegate invocations.
6159 The problem is that in parameter handling we were using this code
6160 path. Fixes bug #64698
6162 2005-01-19 Raja R Harinath <rharinath@novell.com>
6164 * cs-parser.jay: Fix several infelicities.
6165 - Avoid assigning to the parser value stack. Code like
6166 '$3 = null' is unclean. Synthesize a value for the code block
6168 - Avoid using oob_stack for storing location information. Use ...
6169 (_mark_): ... this. New (empty) rule. Saves the current location
6171 (foreach_statement): Avoid using oob_stack for current_block
6172 handling. Use technique used in for_statement and
6173 using_statement. Synthesize a value for the code block to store
6174 additional intermediate information.
6176 2005-01-13 Miguel de Icaza <miguel@ximian.com>
6178 * ecore.cs (IsAccessorAccessible): Accessibility to private fields
6179 of a different type is only allowed to private fields of a
6180 containing type, not on fields of a base class.
6182 See test-174.cs and error cs0122-9.cs
6184 2005-01-13 Raja R Harinath <rharinath@novell.com>
6186 Fix test-335.cs (bug #58126).
6187 * cs-parser.jay (argument): Split out non-expression parts of the
6188 rule into 'non_simple_argument'.
6189 (invocation_expression): Support parenthesized invocations with
6190 multiple arguments, and with single non-simple arguments.
6192 2005-01-13 Raja R Harinath <rharinath@novell.com>
6194 * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
6197 2005-01-12 Raja R Harinath <rharinath@novell.com>
6199 Fix cs0038-1.cs, cs1640-6.cs.
6200 * ecore.cs (Expression.Resolve): Remove special-case for
6201 SimpleName in error-handling.
6202 (Expression.almostMatchedMembers): Relax access permission to
6204 (Expression.MemberLookupFailed): Handle duplicates in
6205 almostMatchedMembers list.
6206 (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
6207 * expression.cs (New.DoResolve): Report CS1540 for more cases.
6208 * typemanager.cs (GetFullNameSignature): Use the MethodBase
6209 overload if the passed in MemberInfo is a MethodBase.
6211 2005-01-25 Martin Baulig <martin@ximian.com>
6214 (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
6216 2005-01-12 Marek Safar <marek.safar@seznam.cz>
6219 * attribute.cs (ExtractSecurityPermissionSet): Don't report error
6220 for non-CAS & merge permission sets properly.
6222 2005-01-11 Raja R Harinath <rharinath@novell.com>
6224 Improve standard-compliance of simple name and member access
6225 resolution. Fixes bugs #52697, #57200, #67520, #69519.
6226 * ecore.cs (FullNamedExpression): New abstract base class
6227 for Namespaces and TypeExpressions.
6228 (ResolveFlags.SimpleName): Remove.
6229 (SimpleName): Remove support for dotted names.
6230 (SimpleName.ResolveAsTypeStep): Simplify. Now just a wrapper to
6231 DeclSpace.FindType and DeclSpace.LookupType.
6232 (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
6233 (Expression.ExprClassName): Make member function.
6234 * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
6235 a namespace. Remove creation of dotted "SimpleName"s.
6236 (MemberAccess.DoResolve): Likewise.
6237 * decl.cs (DeclSpace.Cache): Make private.
6238 (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
6239 (DeclSpace.FindType): Update.
6240 (DeclSpace.LookupType): Move here from RootContext. Return a
6241 FullNamedExpression.
6242 * namespace.cs (Namespace): Derive from FullNamedExpression
6243 so that it can be part of expression resolution.
6244 (Namespace.Lookup): Return an FullNamedExpression.
6245 (NamespaceEntry.LookupAlias): Lookup aliases only in current
6247 * rootcontext.cs (NamespaceLookup): Remove.
6248 (LookupType): Move to DeclSpace.
6249 * attribute.cs (CheckAttributeType): Update.
6250 * doc.cs (FindDocumentedType): Remove allowAlias argument.
6251 (FindDocumentedTypeNonArray): Likewise.
6253 2005-01-11 Raja R Harinath <rharinath@novell.com>
6255 Fix cs0509.cs, cs1632.cs.
6256 * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
6257 is the same as IsInterface.
6258 (TypeContainer.GetClassBases): Likewise.
6259 * statement.cs (LabeledStatement.ig): New field.
6260 (LabeledStatement.LabelTarget): Save ILGenerator which created the
6262 (LabeledStatement.DoEmit): Check that the label was created with
6263 the same ILGenerator.
6265 2005-01-10 Marek Safar <marek.safar@seznam.cz>
6268 * attribute.cs (GetMethodObsoleteAttribute): Need to transform
6269 accessors to its properties.
6271 * ecore.cs (PropertyExpr): Add AccessorTable to help track back
6272 from accessors to property.
6274 2005-01-10 Marek Safar <marek.safar@seznam.cz>
6277 * class.cs (MethodCore.CheckBase): Test base method obsoleteness
6280 2005-01-08 Miguel de Icaza <miguel@ximian.com>
6282 * attribute.cs: Check for null and empty strings.
6284 I have lost another battle to Paolo.
6286 2005-01-07 Marek Safar <marek.safar@seznam.cz>
6289 * class.cs (PropertyMethod): Set Parent field in ctors.
6290 (SetMethod.InternalParameters): Add unsafe switch hack.
6291 Override MarkForDuplicationCheck where it is appropriate.
6293 * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
6294 It says whether container allows members with the same name.
6296 (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
6297 Removed is_method parameter.
6299 2005-01-06 Duncan Mak <duncan@ximian.com>
6301 * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6302 because the previous change led to incorrect reporting of CS1032
6303 ("Cannot define/undefine preprocessor symbols after first token in
6304 file"). Instead of using `tokens_seen' as the only flag that
6305 triggers CS1040, introduce `comments_seen'. This new flag is used
6306 to signify having seen comments on the current line, so it is
6307 unset after a newline.
6309 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
6311 * doc.cs : When searching for a type, find nested type too.
6312 This fixes bug #71040.
6314 2005-01-06 Atsushi Enomoto <atsushi@ximian.com>
6317 - Warn missing member comment on those classes which also does not
6318 have doc comments. Fixed bug #71041.
6319 - Don't warn missing doc comment on default constructor.
6322 2005-01-06 Duncan Mak <duncan@ximian.com>
6324 * cs-tokenizer.cs (xtoken): After handling traditional C-style
6325 comments, set `tokens_seen' to true. This allows us to detect
6326 misplaced preprocessor directives (i.e. not at the beginning of
6327 the a line, nor after whitespaces). In that case, report error
6328 CS1040. This fixes bug #56460.
6330 * cs-parser.jay (interface_member_declaration): Add checks for
6331 IsExplicitImpl, and report CS0541 error if an interface member is
6332 defined as an explicit interface declaration.
6334 2005-01-06 Marek Safar <marek.safar@seznam.cz>
6337 * class.cs (PropertyMethod): Set Parent field in ctors.
6338 (SetMethod.InternalParameters): Add unsafe switch hack.
6340 * decl.cs (MemberCore.Parent): Cannot be readonly.
6342 2005-01-06 Raja R Harinath <rharinath@novell.com>
6344 * decl.cs (DeclSpace.ResolveType): Remove.
6345 (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
6346 Merge in code from ...
6347 (DeclSpace.GetTypeResolvingEmitContext): ... here. Remove.
6348 * class.cs, enum.cs: Update to changes.
6350 2005-01-06 Miguel de Icaza <miguel@ximian.com>
6352 * anonymous.cs: Ensure that we init the scope of our parent if it
6353 has not been initialized yet.
6355 2004-12-30 Duncan Mak <duncan@ximian.com>
6357 * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6358 if field.FieldBuilder is null. Fixes #70758.
6360 * convert.cs: Fixed some typos and updated some of the comments.
6361 (ImplicitStandardConversionExists):
6362 (TryImplicitIntConversion): If `target_type' is an interface and
6363 the type of `ic' implements this interface, return true or a new
6364 BoxedCast instead of null. This fixes #70468.
6366 2004-12-29 Duncan Mak <duncan@ximian.com>
6368 * expression.cs (Argument.Emit): Check that Expr is
6369 IMemoryLocation before casting to it, and report CS1510 otherwise.
6373 2004-12-21 Ben Maurer <bmaurer@ximian.com>
6375 * statement.cs (Block.ThisVariable): remove the recursion here, to
6376 make the --profile more sane.
6378 2004-12-17 Carlos Cortez <calberto.cortez@gmail.com>
6380 * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6381 assembly, by JB Evain.
6383 2004-12-17 Raja R Harinath <rharinath@novell.com>
6385 * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs,
6386 rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6387 "parent" refers to enclosing type/class. "base" refers to superclass.
6389 2004-12-17 Raja R Harinath <rharinath@novell.com>
6391 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6392 Ensure that we only have GlobalAttributes.
6393 * attribute.cs (Attribute.Emit): Make non-virtual.
6394 (GlobalAttribute.Emit): Remove.
6395 (Attribute.Resolve): Make virtual.
6396 (GlobalAttribute.Resolve): New. Set Rootcontext.Tree.Types.NamespaceEntry.
6397 (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6398 the argument. Don't create one.
6399 (Attribute.GetObsoleteAttribute): Likewise.
6400 (Attribute.GetClsCompliantAttributeValue): Likewise.
6401 * class.cs, decl.cs: Update to changes.
6403 2004-12-17 Marek Safar <marek.safar@seznam.cz>
6405 * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6407 * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6409 * statement.cs (Foreach.Resolve): Add error 186 report.
6411 2004-12-16 Marek Safar <marek.safar@seznam.cz>
6413 * expression.cs (Conditional.DoResolve): Add warning 429.
6415 * statement.cs (If.Resolve): Add warning 665.
6417 2004-12-16 Raja R Harinath <rharinath@novell.com>
6419 New invariant: RootContext.Tree.Types.NamespaceEntry == null
6420 except when in the parser, and in GlobalAttribute.
6421 * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6422 * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6423 RootContext.Tree.Types.NamespaceEntry once work is done.
6424 (GlobalAttribute.Emit): New. Wrapper for Attribute.Emit, but sets
6425 and resets RootContext.Tree.Types.NamespaceEntry.
6427 2004-12-15 Marek Safar <marek.safar@seznam.cz>
6429 * cs-parser.jay: Don't create a block for every variable.
6431 2004-12-14 Miguel de Icaza <miguel@ximian.com>
6433 * location.cs: Provide extra information.
6435 * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6436 variables from the captured environment, it is the ldarg_0.
6438 2004-12-14 Marek Safar <marek.safar@seznam.cz>
6440 * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6443 * class.cs: Changed warning level for 169 to avoid developer
6444 displeasure from warning flooding. It will be changed back when they
6445 fix most of current BCL warnings.
6447 * RootContext.cs: Pushed default WarningLevel to 3.
6449 * statement.cs: Removed unused variable.
6451 2004-12-14 Marek Safar <marek.safar@seznam.cz>
6453 * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6454 (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6455 Add error 502 report.
6456 (StaticClass.DefineType): Add error 441 report.
6457 (Class.AllowedModifiersProp): New virtual property as temporary
6458 extension to AllowedModifiers.
6459 (Class.DefineType): Add error 418 report. Moved ModFlags check here
6460 to share implementation with StaticClass and don't call virtual
6463 * driver.cs (MainDriver): Add error 1558 test.
6465 * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6466 report. Moved error 36 test here.
6468 * statement.cs (Throw.Resolve): Add error 724 report.
6470 * typemanager.cs: Add out_attribute_type core type.
6472 2004-12-13 Marek Safar <marek.safar@seznam.cz>
6474 * class.cs (TypeContainer.VerifyClsCompliance): Add error
6476 (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6478 * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6481 * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6483 * parameter.cs (ReturnParameter.ApplyAttributeBuilder):
6484 Add error 3023 report.
6485 (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6487 * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6490 2004-12-12 John Luke <john.luke@gmail.com>
6492 * driver.cs (AddArgs): take -- into account when
6493 adding arguments, fixes bug 65710
6495 2004-12-12 Martin Baulig <martin@ximian.com>
6497 * expression.cs (Unary.TryReduceNegative): Added support for
6498 SByteConstant and ByteConstant.
6499 (Unary.Reduce): Check error values from TryReduceNegative().
6501 2004-12-10 Marek Safar <marek.safar@seznam.cz>
6503 * attributes.cs (Attribute.Resolve): Avoid multiple error report
6504 and report exception as error 182.
6506 2004-12-10 Raja R Harinath <rharinath@novell.com>
6508 * driver.cs (Main): Fix message when there are warnings.
6510 2004-12-09 Miguel de Icaza <miguel@ximian.com>
6512 * delegate.cs: Fixed my fix from yesterday, sorry about that.
6514 2004-12-09 Marek Safar <marek.safar@seznam.cz>
6516 * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs:
6517 Reduced number of warnings.
6519 * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6521 2004-12-08 Miguel de Icaza <miguel@ximian.com>
6523 * driver.cs: Removed message.
6525 * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6527 2004-12-08 <vargaz@freemail.hu>
6529 * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6531 2004-12-08 Martin Baulig <martin@ximian.com>
6533 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6534 instead of a CS3002 for properties and indexer.
6536 2004-12-08 Martin Baulig <martin@ximian.com>
6538 * decl.cs (MemberName.ToString): Make this work again.
6540 2004-12-08 Marek Safar <marek.safar@seznam.cz>
6542 * attribute.cs (Resolve): Add error 591 detection.
6544 * class.cs (FieldMember.Define): Add error 1547 detection.
6545 (Indexer.Define): Add error 620 detection.
6546 (Operator.Define): Add error 590 detection.
6548 * ecore.cs: Missing argument for error 79.
6550 * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6553 2004-12-07 Marek Safar <marek.safar@seznam.cz>
6556 * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6559 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
6561 * cs-parser.jay : handle doc comments on implicit/explicit operators.
6562 Some operator comments were suppressed.
6563 * doc.cs : Implicit/explicit operator name in doc comments are like
6564 "op_Explicit(type)~returnType", so added suffix handling.
6566 2005-01-21 Alp Toker <alp@atoker.com>
6568 * cs-parser.jay: destructor_declaration's container is PartialContainer
6569 not Class when partial types are used, so use Kind prop instead of 'is'.
6571 2004-12-12 Martin Baulig <martin@ximian.com>
6573 * expression.cs (Unary.TryReduceNegative): Added support for
6574 SByteConstant and ByteConstant.
6575 (Unary.Reduce): Check error values from TryReduceNegative().
6577 2004-12-11 Martin Baulig <martin@ximian.com>
6579 * support.cs (ReflectionParameters.ParameterName): If we have a
6580 `gpd', call `ParameterName' on it.
6582 * parameter.cs (Parameter.GetParameterAttributes): New static method.
6584 * pending.cs (PendingImplementation.DefineProxy): Call
6585 DefineParameter() for all of the MethodBuilder's arguments.
6587 2004-12-09 Martin Baulig <martin@ximian.com>
6589 * doc.cs (DocUtil): Make this a static class.
6591 2004-12-09 Martin Baulig <martin@ximian.com>
6593 * expression.cs (Invocation.InferType): Moved the type inference
6594 implementation into TypeManager.
6596 * generics.cs (TypeManager): Moved the type inference
6597 implementation here.
6599 2004-12-09 Martin Baulig <martin@ximian.com>
6601 * typemanager.cs (TypeManager): Make this a partial class.
6604 (TypeManager): Move the generics part of `TypeManager' here.
6606 2004-12-08 Martin Baulig <martin@ximian.com>
6608 * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6609 instead of a CS3002 for properties and indexer. Added CS3024
6610 check for generic interfaces.
6612 * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
6613 instances are not CLS-compliant.
6615 2004-12-08 Martin Baulig <martin@ximian.com>
6618 (void_pointer_expression): New rule for `void*', `void**' etc.
6619 (typeof_expression): Add `void_pointer_expression'; fixes #66846.
6621 2004-12-08 Martin Baulig <martin@ximian.com>
6623 * expression.cs (Invocation.InferType): Removed the hack for
6624 MethodCore.MayUnify().
6626 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
6629 * class.cs (MethodCore.MayUnify): Use
6630 TypeManager.MayBecomeEqualGenericTypes().
6632 2004-12-08 Martin Baulig <martin@ximian.com>
6634 * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
6635 parameter, box it. Fixes #69233.
6637 2004-12-08 Martin Baulig <martin@ximian.com>
6639 * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
6640 have the ctor constraint. Fixes #68326.
6642 2004-12-07 Atsushi Enomoto <atsushi@ximian.com>
6644 * cs-parser.jay : interface comment was not consumed because of
6645 extra opt_semicolon before doc handling.
6647 2004-12-03 Raja R Harinath <rharinath@novell.com>
6649 Fix test-327.cs, test-328.cs, and put in early infrastructure
6650 for eventually fixing #52697.
6651 * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6652 (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6654 (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6655 (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6656 (VerifyUsing, error246): Update.
6657 * rootcontext.cs (RootContext.NamespaceLookup): Just use
6658 'NamespaceEntry.LookupNamespaceOrType'.
6660 2004-12-07 Martin Baulig <martin@ximian.com>
6662 * driver.cs: Call it "BETA SOFTWARE" :-)
6664 2004-12-06 Raja R Harinath <rharinath@novell.com>
6666 Fix crash on cs0657-17.cs.
6667 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6668 Use RootContext.Tree.Types, not 'new RootTypes ()'.
6669 * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6670 the case where the NamespaceEntry gets overwritten.
6672 2004-12-06 Marek Safar <marek.safar@seznam.cz>
6674 Fixed #69195, #56821
6675 * ecore.cs (ResolveBoolean): Tiny refactoring.
6677 * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6678 of right expression resolving when left is false constant and
6679 operator is LogicalAnd OR true constant and operator is LogicalOr.
6681 * statement.cs (ResolveUnreachable): Always reports warning.
6683 2004-12-05 Miguel de Icaza <miguel@ximian.com>
6685 * class.cs: Distinguish between 1721 and 1722 (just a little help
6686 for the programmer).
6688 2004-12-03 Miguel de Icaza <miguel@ximian.com>
6690 * delegate.cs: Only allow this on new versions of the language.
6692 2004-12-02 Duncan Mak <duncan@ximian.com>
6694 * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6696 (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6697 here as a static method. Take an additional bool out parameter
6698 `must_do_cs1540_check' for signaling to InstanceResolve.
6699 (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6700 member field from PropertyExpr class and made it an argument of
6702 (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6703 check for MarshalByRefObject, and report CS0122 instead of CS1540.
6704 (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6705 and `remove_accessor' as well as InstanceResolve: report CS0122
6710 2004-12-07 Martin Baulig <martin@ximian.com>
6712 * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
6713 and CS0692 where appropriate.
6715 2004-12-06 Martin Baulig <martin@ximian.com>
6717 * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
6718 IsDuplicateImplementation() and improved it.
6720 * expression.cs (Invocation.InferTypeArguments): Added
6721 `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
6722 and removed the "ref" modifier from `infered_types'.
6724 * decl.cs (MemberName.ToString): Removed the exception.
6726 2004-12-03 Atsushi Enomoto <atsushi@ximian.com>
6728 * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6729 comments are allowed.
6731 2004-12-03 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6733 * delegate.cs: Add checks for subtypes in paramaters and return values
6734 in VerifyMethod () to add support for Covariance/Contravariance
6737 2004-12-02 Miguel de Icaza <miguel@ximian.com>
6739 * report.cs: Remove extra closing parenthesis.
6741 * convert.cs (Error_CannotImplicitConversion): If the name of the
6742 types are the same, provide some extra information.
6744 2004-12-02 Marek Safar <marek.safar@seznam.cz>
6747 * attribute.cs (Resolve): Improved implementation of params
6748 attribute arguments.
6750 * support.cs (ParameterData): Add HasParams to be faster.
6752 2004-12-02 Atsushi Enomoto <atsushi@ximian.com>
6754 all things are for /doc support:
6756 * doc.cs: new file that supports XML documentation generation.
6757 * mcs.exe.sources: added doc.cs.
6759 Handle /doc command line option.
6760 Report error 2006 instead of 5 for missing file name for /doc.
6761 Generate XML documentation when required, after type resolution.
6763 Added support for picking up documentation (/// and /** ... */),
6764 including a new XmlCommentState enumeration.
6766 Added lines to fill Documentation element for field, constant,
6767 property, indexer, method, constructor, destructor, operator, event
6768 and class, struct, interface, delegate, enum.
6769 Added lines to warn incorrect comment.
6771 Added Documentation field (passed only when /doc was specified).
6773 Added DocComment, DocCommentHeader, GenerateDocComment() and
6774 OnGenerateDocComment() and some supporting private members for
6775 /doc feature to MemberCore.
6777 Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6779 Added overriden DocCommentHeader.
6781 Added overriden DocCommentHeader and GenerateDocComment().
6783 2004-12-01 Miguel de Icaza <miguel@ximian.com>
6785 * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6786 unwrapping the enumeration values, chain to
6787 DoConstantNumericPromotions again, so we can promote things to the
6788 fundamental types (takes care of enums that are bytes, sbytes).
6792 2004-12-01 Raja R Harinath <rharinath@novell.com>
6794 * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6795 Fix long-standing bug in type-lookup. Use FindType instead of
6796 LookupType when ec.ResolvingTypeTree.
6797 (Attribute.ResolveType, Attribute.Resolve)
6798 (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6800 (Attributes.Search): Remove internal version. Update.
6801 (Attributes.SearchMulti): Update.
6802 (Attributes.GetClsCompliantAttribute): Remove.
6803 (Attributes.GetIndexerNameAttribute): Remove.
6804 * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6805 (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6806 * class.cs (Indexer.Define): Likewise.
6808 2004-12-01 Marek Safar <marek.safar@seznam.cz>
6811 * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6812 MarshallByReference members access.
6814 * expression.cs: Use CheckMarshallByRefAccess;
6815 Better error CS0197 message.
6817 * report.cs: Print whole related error message.
6819 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6821 * class (GetClassBases): Better error 60 report.
6822 (EventProperty): Disabled warning 67 detection.
6824 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6827 * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6829 * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6832 2004-11-29 Marek Safar <marek.safar@seznam.cz>
6835 * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6837 * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6839 2004-11-26 Miguel de Icaza <miguel@ximian.com>
6841 * attribute.cs (Attribute.Resolve): Refine error reporting and
6842 report a cs0117 if the identifier does not exist, to distinguish
6843 from 0617 which is a miss-use of the actual identifier.
6845 * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6846 between cs0070 and cs0079.
6848 * class.cs (MemberBase.DoDefine): When reporting a wrong
6849 accessibility level, we use MethodCore to compare instead of
6850 Method (this was a regression in some refactoring effort).
6852 So now we correctly report cs0056 again.
6854 * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6855 testing the target_type (which was known to be object_type) and
6856 not the source type (which is anonymous_method).
6858 Fixed reporting of error cs1660.
6860 * expression.cs (UserCast.Source): Expose the underlying cast.
6862 * statement.cs (Switch.SwitchGoverningType): Sort the list of
6863 allowed types to find a match to int32 first (most common).
6865 In addition, it ignores any ImplicitUserConversions that did an
6866 internal implicit conversion (as the switch statement allows only
6867 one integral conversion to exist).
6869 * class.cs (PartialContainer.Create): rename `name' to
6870 `member_name' for clarity. Then replace the string calls with a
6871 call to MemberName.GetPartialName, as now using
6872 MemberName.ToString is an error (this is due to the side effects
6873 it had, that were fixed in the past).
6875 This will restore the error reporting on a number of partial class
6876 errors that were missusing this (and getting an exception as a
6877 results, which is now just a plain textual warning, because
6878 yyparse debug output would crash otherwise).
6880 2004-11-26 Raja R Harinath <rharinath@novell.com>
6882 * Makefile (PROGRAM_INSTALL_DIR): Remove.
6884 2004-11-25 Ben Maurer <bmaurer@ximian.com>
6886 * rootcontext.cs (LookupType): Make sure to cache lookups that
6887 don't give us a negative result. This saves about 5% of corlib
6890 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6892 * report.cs (AbstractMessage.Print): messages are sent to stderr
6894 * class.cs (TypeContainer.GetClassBases): It is an error to have a
6895 non-interface in the list of interfaces (at this point, either
6896 parent was properly set, or a base class is being listed in the
6897 interfaces section).
6899 This flags error 1722, and resolves the crash from bug 69259.
6901 2004-11-25 Ben Maurer <bmaurer@ximian.com>
6903 * statement.cs (Using.EmitExpressionFinally): make this work right
6904 for valuetypes. Fixes 69926.
6906 2004-11-25 Miguel de Icaza <miguel@ximian.com>
6908 * const.cs (Const.ChangeType): Cope with the "0 literal can be
6909 converted to an enum" here, before we try to change the underlying
6910 type. This code exists, but it is a different code path than the
6911 one used while encoding constants.
6913 (ImplicitReferenceConversionExists): In addition, resynchronized
6914 the code here, so it matches the same code in
6915 ImplicitReferenceConversionExists for the `from any class-type S
6916 to any interface-type T'.
6918 2004-11-25 Marek Safar <marek.safar@seznam.cz>
6920 * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6922 2004-11-24 Miguel de Icaza <miguel@ximian.com>
6924 * cs-parser.jay: Use verbosity accordingly.
6926 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6928 * expression.cs (Unary.ResolveOperator): Do not report warning;
6929 AddressOf reads from variable.
6931 (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6933 2004-11-24 Marek Safar <marek.safar@seznam.cz>
6937 * attribute.cs (Attributable): Removed CheckTargets.
6938 (Attributes.Emit): Explicit attribute targets are tested here.
6940 * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6941 not enabled for interfaces.
6943 * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6944 (GetAssemblyName): Ouch next bug there.
6946 2004-11-23 Carlos Alberto Cortez <calberto.cortez@gmail.com>
6948 * expression.cs: Error 275 added.
6950 2004-11-23 Marek Safar <marek.safar@seznam.cz>
6952 Fix bug #69177 (Implemented decimal constant support)
6954 * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6955 (BinaryFold): Add DecimalConstant.
6957 * const.cs (Define): Decimal constant
6959 (ChangeType): Add decimal type handling.
6960 (LookupConstantValue): Don't set value for decimal type but
6961 emit DecimalConstantAttribute. Needed for constant optimization.
6963 * constant.cs (ToDecimal): New method.
6964 (ConvertToDecimal): New method.
6965 (IntConstant): Implemented ConvertToDecimal.
6966 (DecimalConstant.Emit): Emit optimized version for decimals in
6969 * expression.cs (ResolveOperator): Changed order of constant
6970 reduction to work correctly with native types which have
6971 overloaded operators.
6972 (ResolveMemberAccess): Extract constant value from attribute
6975 * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6977 * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6978 void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6979 (ChangeType): Decimal is special.
6980 (TypeToCoreType): Add decimal type.
6982 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6984 * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6987 2004-11-22 Marek Safar <marek.safar@seznam.cz>
6989 * class.cs (EventField.ApplyAttributeBuilder): Fix error
6992 2004-11-19 Marek Safar <marek.safar@seznam.cz>
6994 * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6996 * pending.cs (PendingImplementation): Grab only interfaces.
6998 2004-11-19 Marek Safar <marek.safar@seznam.cz>
7000 * statement.cs (ForeachHelperMethods): Add location member and
7001 error 202 detection.
7003 2004-11-18 Marek Safar <marek.safar@seznam.cz>
7005 * expression.cs (DoResolveBase): Fixed wrong warning for out
7008 2004-12-04 Martin Baulig <martin@ximian.com>
7010 * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
7011 to check whether the conversion is ok.
7013 * typemanager.cs (TypeManager.GetTypeArguments): Just return
7014 `Type.EmptyTypes' if we're not a generic TypeContainer.
7016 2004-11-25 Miguel de Icaza <miguel@ximian.com>
7018 * convert.cs (ImplicitReferenceConversionExists): A surprisingly
7019 old bug: when converting from the null literal to a pointer,
7020 return an EmptyCast, not the NullLiteral.
7022 This fixes #69921, the recent null_type changes probably made this
7025 2004-12-03 Martin Baulig <martin@ximian.com>
7027 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7028 method as our child, call AnonymousMethod.Compatible() on it.
7030 2004-12-02 Miguel de Icaza <miguel@ximian.com>
7032 * class.cs (FieldBase): Use an unused bit field from the field to
7033 encode the `has_offset' property from the FieldMember. This saves
7034 a couple of Ks on bootstrap compilation.
7036 * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7037 method as our child, return the AnonymousMethod resolved
7040 * expression.cs (New.DoResolve): Allow return values from
7041 NewDelegate to also include AnonymousMethods.
7045 2004-11-29 Raja R Harinath <rharinath@novell.com>
7047 * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
7049 * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
7050 System.Runtime.InteropServices._Exception, since it's a base
7051 interface of the core type System.Exception in the net_2_0 profile.
7053 2004-11-27 Martin Baulig <martin@ximian.com>
7055 * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
7057 2004-11-26 Raja R Harinath <rharinath@novell.com>
7059 * Makefile: Convert to use executable.make.
7060 * gmcs.exe.sources: New.
7062 2004-11-25 Martin Baulig <martin@ximian.com>
7064 * expression.cs (Invocation.InferType): Added support for byref types.
7066 2004-11-25 Martin Baulig <martin@ximian.com>
7068 * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
7069 in TypeManager.TypeToCoreType().
7071 2004-11-25 Martin Baulig <martin@ximian.com>
7073 * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
7074 "Dispose" method from the `current_type'.
7075 (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
7076 DoDefineMembers() instead of using the MethodBuilder; this is
7077 required for generic iterators.
7079 * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
7081 2004-11-24 Martin Baulig <martin@ximian.com>
7083 * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
7085 2004-11-20 Martin Baulig <martin@ximian.com>
7087 * expression.cs (Invocation.InferType): Correctly infer generic
7088 instances; see gen-103.cs.
7089 (Invocation.InferTypeArguments): If a generic method doesn't have
7090 any unbound type parameters, we don't need to infer anything.
7092 2004-11-19 Raja R Harinath <rharinath@novell.com>
7094 * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
7096 2004-11-17 Raja R Harinath <rharinath@novell.com>
7098 * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
7099 (TypeHandle.GetMemberCache): New.
7100 (TypeHandle.TypeHandle): Update.
7101 (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
7102 (TypeManager.LookupParentInterfacesCache):
7103 Rename from LookupInterfaceCache. Optimize slightly.
7104 (TypeManager.MemberLookup_FindMembers): Update.
7105 * decl.cs (MemberCache.MemberCache): Set Container to null in the
7107 (AddCacheContents): Rename from AddHashtable.
7108 * class.cs (TypeContainer.parent_container): Remove.
7109 (TypeContainer.VerifyClsCompliance): Don't use parent_container.
7110 (TypeContainer.DoDefineMembers): Don't initialize it.
7111 Update to name changes.
7113 2004-11-17 Miguel de Icaza <miguel@ximian.com>
7115 * class.cs (MethodCore.CheckAccessModifiers): New helper routine
7116 that factors the code to check access modifiers on override.
7118 (PropertyBase): Use the code here.
7120 Patch from Lluis S'anchez, fixes bug #69361.
7122 2004-11-15 Miguel de Icaza <miguel@ximian.com>
7124 * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
7125 routine that is used to report the use of a captured variable
7126 whose address has been taken.
7128 There are two checks: one when variables are being captured and
7129 the other check is when the address of a variable is taken.
7131 (because an anonymous methods might be resolved before *or* after
7132 the address has been taken) and
7134 * expression.cs (Conditional.DoResolve): Remove the special
7135 casing that Martin added to trueExpr and falseExpr being both
7136 NullLiteral. We get the right behavior now just by introducing
7137 the null_type into the compiler.
7139 * convert.cs (ExplicitConversion): Change the code to use
7140 null_type instead of testing `expr is NullLiteral'.
7141 (ImplicitConversionStandard): use null_type too.
7142 (ImplicitReferenceConversionExists): use null_type too.
7143 (ImplicitReferenceConversion): use null_type too.
7145 * literal.cs: The type of `NullLiteral' is now null_type instead
7147 (Resolve): Set the type here.
7149 * typemanager.cs: Introduce null_type.
7151 2004-11-18 Martin Baulig <martin@ximian.com>
7154 (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
7156 2004-11-18 Martin Baulig <martin@ximian.com>
7158 * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
7160 2004-11-18 Martin Baulig <martin@ximian.com>
7162 * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
7163 of a `DeclSpace'. If one of our constraints is a `ConstructedType',
7164 call ResolveConstructedType() on it to resolve it without checking
7166 (Constraints.ResolveTypes): Check them here.
7167 (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
7168 but don't check constraints.
7169 (ConstructedType.ResolveAsTypeTerminal): Override this and also
7170 check constraints here.
7171 (ConstructedType.ResolveConstructedType): New public method. This
7172 is called from DoResolveAsTypeStep() and Constraints.Resolve() to
7173 resolve ourselves without checking constraints.
7175 * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
7177 2004-11-18 Martin Baulig <martin@ximian.com>
7180 (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
7182 * delegate.cs (Delegate.DefineType): Always create the EmitContext.
7184 2004-11-18 Martin Baulig <martin@ximian.com>
7186 * ecore.cs (TypeExpr.ResolveType): Removed.
7187 (Expression.ResolveAsTypeTerminal): We always return a fully
7188 resolved `TypeExpr', so we can just access its `Type'.
7190 * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
7192 2004-11-17 Martin Baulig <martin@ximian.com>
7194 * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
7195 sure we don't return any unresolved TypeExpr's.
7196 (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
7198 (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
7200 * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
7201 unresolved `ConstructedType's.
7203 2004-11-17 Martin Baulig <martin@ximian.com>
7205 * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
7207 2004-11-17 Martin Baulig <martin@ximian.com>
7210 (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
7212 * decl.cs (DeclSpace.ResolveType): Removed.
7213 (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
7215 2004-11-17 Martin Baulig <martin@ximian.com>
7217 * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
7218 direction, like FindMembers() does. Fixes #69546, testcase is in
7221 2004-11-16 Martin Baulig <martin@ximian.com>
7223 This is based on a patch from Marek Safar, see bug #69082.
7224 Fixes bugs #63705 and #67130.
7226 * typemanager.cs (TypeManager.LookupInterfaceCache): New public
7227 method; create a MemberCache for an interface type and cache the
7230 * decl.cs (IMemberContainer.ParentContainer): Removed.
7231 (IMemberContainer.ParentCache): New property.
7232 (MemberCache.SetupCacheForInterface): Removed.
7233 (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
7234 to create a cache for an interface's "parent".
7236 * class.cs (TypeContainer.DoDefineMembers): Setup cache for
7239 2004-11-14 Ben Maurer <bmaurer@ximian.com>
7241 * statement.cs: Avoid adding bools to a hashtable.
7243 2004-11-15 Martin Baulig <martin@ximian.com>
7245 * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
7247 2004-11-11 Martin Baulig <martin@ximian.com>
7249 * typemanager.cs (TypeManager.GetMethodName): New method.
7251 * class.cs (MethodData.Define): Include the generic arity in the
7252 name of an explicit interface; also add it to the method name.
7254 * pending.cs (PendingImplementation.InterfaceMethod): The method
7255 name now includes the generic arity.
7257 2004-11-07 Miguel de Icaza <miguel@ximian.com>
7259 * expression.cs (Invocation.OverloadResolve): Flag error if we are
7260 calling an unsafe method from a safe location.
7262 2004-11-06 Marek Safar <marek.safar@seznam.cz>
7265 * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
7267 2004-11-06 Miguel de Icaza <miguel@ximian.com>
7269 * namespace.cs (VerifyUsing): use GetPartialName instead of
7272 2004-11-05 Miguel de Icaza <miguel@ximian.com>
7274 * statement.cs (Return.Resolve): Fix regression in typo: if
7275 `in_exc', we have to request a NeedReturnLabel, this was a typo
7276 introduced in the anonymous method check-in. Fixes #69131.
7278 * Indexers were using the ShortName when defining themselves,
7279 causing a regression in the compiler bootstrap when applying the
7280 patch from 2004-11-02 (first part), now they use their full name
7281 and the bug is gone.
7283 2004-11-04 Zoltan Varga <vargaz@freemail.hu>
7285 * driver.cs: Strip the path from the names of embedded resources. Fixes
7288 2004-11-04 Raja R Harinath <rharinath@novell.com>
7290 Fix error message regression: cs0104-2.cs.
7291 * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
7292 (AliasEntry.Resolve): Update.
7293 * rootcontext.cs (RootContext.NamespaceLookup): Update. Remove
7295 (RootContext.LookupType): Update.
7297 2004-11-03 Carlos Alberto Cortez <carlos@unixmexico.org>
7299 * cs-parser.jay: Add support for handling accessor modifiers
7300 * class: Add support port accessor modifiers and error checking,
7301 define PropertyMethod.Define as virtual (not abstract anymore)
7302 * ecore.cs: Add checking for proeprties access with access modifiers
7303 * iterators.cs: Modify Accessor constructor call based in the modified
7305 2004-11-02 Ben Maurer <bmaurer@ximian.com>
7307 * expression.cs (StringConcat): Handle being called twice,
7308 as when we have a concat in a field init with more than two
7311 2004-11-02 Miguel de Icaza <miguel@ximian.com>
7313 * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
7314 special case explicit implementations, we should always produce
7315 the .property or .event declaration.
7317 * decl.cs (MemberName): Renamed GetFullName to GetPartialName
7318 since it will not return correct data if people use this
7319 unresolved in the presence of using statements (see test-313).
7321 * class.cs (MethodData.Define): If we are an explicit interface
7322 implementation, set the method name to the full name of the
7323 interface plus the name of the method.
7325 Notice that using the method.MethodName.GetFullName() does not
7326 work, as it will only contain the name as declared on the source
7327 file (it can be a shorthand in the presence of using statements)
7328 and not the fully qualifed type name, for example:
7332 class D : ICloneable {
7333 object ICloneable.Clone () {
7337 Would produce a method called `ICloneable.Clone' instead of
7338 `System.ICloneable.Clone'.
7340 * namespace.cs (Alias.Resolve): Use GetPartialName.
7342 2004-11-01 Marek Safar <marek.safar@seznam.cz>
7344 * cs-parser.jay: Add error 1055 report.
7346 2004-11-01 Miguel de Icaza <miguel@ximian.com>
7348 * assign.cs (Assign.DoResolve): Only do the transform of
7349 assignment into a New if the types are compatible, if not, fall
7350 through and let the implicit code deal with the errors and with
7351 the necessary conversions.
7353 2004-11-01 Marek Safar <marek.safar@seznam.cz>
7355 * cs-parser.jay: Add error 1031 report.
7357 * cs-tokenizer.cs: Add location for error 1038.
7359 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7361 * cs-parser.jay: Add error 1016 report.
7363 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7365 * cs-parser.jay: Add errors 1575,1611 report.
7367 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7369 * cs-parser.jay: Add error 1001 report.
7371 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7374 * attribute.cs (GetMarshal): Add method argument for
7375 caller identification.
7377 * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7378 agument for GetMarshal and RuntimeMissingSupport.
7380 2004-10-31 Marek Safar <marek.safar@seznam.cz>
7382 * attribute.cs (ExtractSecurityPermissionSet): Removed
7383 TypeManager.code_access_permission_type.
7385 * typemanager.cs: Removed TypeManager.code_access_permission_type.
7387 2004-10-27 Miguel de Icaza <miguel@ximian.com>
7389 * expression.cs (LocalVariableReference.DoResolveLValue): Check
7390 for obsolete use of a variable here. Fixes regression on errors
7391 cs0619-25 and cs0619-26.
7393 2004-10-27 Marek Safar <marek.safar@seznam.cz>
7395 Fix #62358, implemented security attribute encoding.
7397 * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7398 Tests permitted SecurityAction for assembly or other types.
7399 (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7400 data from SecurityPermissionAttribute to PermisionSet class.
7402 * class.cs (ApplyAttributeBuilder): Added special handling
7403 for System.Security.Permissions.SecurityAttribute based types.
7405 * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7406 special handling for System.Security.Permissions.SecurityAttribute
7409 * enum.cs (ApplyAttributeBuilder): Added special handling
7410 for System.Security.Permissions.SecurityAttribute based types.
7412 * parameter.cs (ApplyAttributeBuilder): Added special handling
7413 for System.Security.Permissions.SecurityAttribute based types.
7415 * rootcontext.cs: Next 2 core types.
7417 * typemanager.cs (TypeManager.security_permission_attr_type):
7418 Built in type for the SecurityPermission Attribute.
7419 (code_access_permission_type): Build in type.
7421 2004-10-17 Miguel de Icaza <miguel@ximian.com>
7423 * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7424 Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7425 all of this information into
7426 EmitContext.EmitCapturedVariableInstance.
7428 * codegen.cs (EmitCapturedVariableInstance): move here the
7429 funcionality of emitting an ldarg.0 in the presence of a
7430 remapping. This centralizes the instance emit code.
7432 (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7433 then emit a load of this: it means that we have reached the
7434 topmost ScopeInfo: the one that contains the pointer to the
7435 instance of the class hosting the anonymous method.
7437 * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7438 captures to the topmost CaptureContext.
7440 2004-10-12 Miguel de Icaza <miguel@ximian.com>
7442 * expression.cs (LocalVariableReference): Move the knowledge about
7443 the iterators into codegen's EmitCapturedVariableInstance.
7445 2004-10-11 Miguel de Icaza <miguel@ximian.com>
7447 * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7448 all code paths return a value from an anonymous method (it is the
7449 same as the 161 error, but for anonymous methods).
7451 2004-10-08 Miguel de Icaza <miguel@ximian.com>
7453 The introduction of anonymous methods in the compiler changed
7454 various ways of doing things in the compiler. The most
7455 significant one is the hard split between the resolution phase
7456 and the emission phases of the compiler.
7458 For instance, routines that referenced local variables no
7459 longer can safely create temporary variables during the
7460 resolution phase: they must do so from the emission phase,
7461 since the variable might have been "captured", hence access to
7462 it can not be done with the local-variable operations from the runtime.
7466 (Block.Flags): New flag `IsTopLevel' to indicate that this block
7467 is a toplevel block.
7469 (ToplevelBlock): A new kind of Block, these are the blocks that
7470 are created by the parser for all toplevel method bodies. These
7471 include methods, accessors and anonymous methods.
7473 These contain some extra information not found in regular blocks:
7474 A pointer to an optional CaptureContext (for tracking captured
7475 local variables and parameters). A pointer to the parent
7478 (Return.Resolve): Catch missmatches when returning a value from an
7479 anonymous method (error 1662).
7480 Invoke NeedReturnLabel from the Resolve phase instead of the emit
7483 (Break.Resolve): ditto.
7485 (SwitchLabel): instead of defining the labels during the
7486 resolution phase, we now turned the public ILLabel and ILLabelCode
7487 labels into methods called GetILLabelCode() and GetILLabel() that
7488 only define the label during the Emit phase.
7490 (GotoCase): Track the SwitchLabel instead of the computed label
7491 (its contained therein). Emit the code by using
7492 SwitchLabel.GetILLabelCode ().
7494 (LocalInfo.Flags.Captured): A new flag has been introduce to track
7495 whether the Local has been captured or not.
7497 (LocalInfo.IsCaptured): New property, used to tell whether the
7498 local has been captured.
7500 * anonymous.cs: Vastly updated to contain the anonymous method
7503 The main classes here are: CaptureContext which tracks any
7504 captured information for a toplevel block and ScopeInfo used to
7505 track the activation frames for various local variables.
7507 Each toplevel block has an optional capture context associated
7508 with it. When a method contains an anonymous method both the
7509 toplevel method and the anonymous method will create a capture
7510 context. When variables or parameters are captured, they are
7511 recorded on the CaptureContext that owns them, for example:
7515 MyDelegate d = delegate {
7520 Here `a' will be recorded as captured on the toplevel
7521 CapturedContext, the inner captured context will not have anything
7522 (it will only have data if local variables or parameters from it
7523 are captured in a nested anonymous method.
7525 The ScopeInfo is used to track the activation frames for local
7526 variables, for example:
7528 for (int i = 0; i < 10; i++)
7529 for (int j = 0; j < 10; j++){
7530 MyDelegate d = delegate {
7535 At runtime this captures a single captured variable `i', but it
7536 captures 10 different versions of the variable `j'. The variable
7537 `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7538 recorded on a child.
7540 The toplevel ScopeInfo will also track information like the `this'
7541 pointer if instance variables were referenced (this is necessary
7542 as the anonymous method lives inside a nested class in the host
7543 type of the method).
7545 (AnonymousMethod): Expanded to track the Toplevel, implement
7546 `AnonymousMethod.Compatible' to tell whether an anonymous method
7547 can be converted to a target delegate type.
7549 The routine now also produces the anonymous method content
7551 (AnonymousDelegate): A helper class that derives from
7552 DelegateCreation, this is used to generate the code necessary to
7553 produce the delegate for the anonymous method that was created.
7555 * assign.cs: API adjustments for new changes in
7556 Convert.ImplicitStandardConversionExists.
7558 * class.cs: Adjustments to cope with the fact that now toplevel
7559 blocks are of type `ToplevelBlock'.
7561 * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7562 insteda of standard blocks.
7564 Flag errors if params arguments are passed to anonymous methods.
7566 * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7567 `CurrentAnonymousMethod' which points to the current Anonymous
7568 Method. The variable points to the AnonymousMethod class that
7569 holds the code being compiled. It is set in the new EmitContext
7570 created for the anonymous method.
7572 (EmitContext.Phase): Introduce a variable and an enumeration to
7573 assist in enforcing some rules about when and where we are allowed
7574 to invoke certain methods (EmitContext.NeedsReturnLabel is the
7575 only one that enfonces this right now).
7577 (EmitContext.HaveCaptureInfo): new helper method that returns
7578 whether we have a CapturedContext initialized.
7580 (EmitContext.CaptureVariable): New method used to register that a
7581 LocalInfo must be flagged for capturing.
7583 (EmitContext.CapturedParameter): New method used to register that a
7584 parameters must be flagged for capturing.
7586 (EmitContext.CapturedField): New method used to register that a
7587 field must be flagged for capturing.
7589 (EmitContext.HaveCapturedVariables,
7590 EmitContext.HaveCapturedFields): Return whether there are captured
7591 variables or fields.
7593 (EmitContext.EmitMethodHostInstance): This is used to emit the
7594 instance for the anonymous method. The instance might be null
7595 (static methods), this (for anonymous methods that capture nothing
7596 and happen to live side-by-side with the current method body) or a
7597 more complicated expression if the method has a CaptureContext.
7599 (EmitContext.EmitTopBlock): Routine that drives the emission of
7600 code: it will first resolve the top block, then emit any metadata
7601 and then emit the code. The split is done so that we can extract
7602 any anonymous methods and flag any captured variables/parameters.
7604 (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7605 during this phase, the ILGenerator should not be used as labels
7606 and local variables declared here might not be accessible to any
7607 code that is part of an anonymous method.
7609 Exceptions to this include the temporary variables that are
7610 created by some statements internally for holding temporary
7613 (EmitContext.EmitMeta): New routine, in charge of emitting all the
7616 (EmitContext.TemporaryReturn): This method is typically called
7617 from the Emit phase, and its the only place where we allow the
7618 ReturnLabel to be defined other than the EmitMeta. The reason is
7619 that otherwise we would have to duplicate a lot of logic in the
7620 Resolve phases of various methods that today is on the Emit
7623 (EmitContext.NeedReturnLabel): This no longer creates the label,
7624 as the ILGenerator is not valid during the resolve phase.
7626 (EmitContext.EmitThis): Extended the knowledge in this class to
7627 work in anonymous methods in addition to iterators.
7629 (EmitContext.EmitCapturedVariableInstance): This emits whatever
7630 code is necessary on the stack to access the instance to a local
7631 variable (the variable will be accessed as a field).
7633 (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7634 EmitContext.EmitAddressOfParameter): Routines to support
7635 parameters (not completed at this point).
7637 Removals: Removed RemapLocal and RemapLocalLValue. We probably
7638 will also remove the parameters.
7640 * convert.cs (Convert): Define a `ConstantEC' which points to a
7641 null. This is just to prefity some code that uses
7642 ImplicitStandardConversion code and do not have an EmitContext
7645 The idea is to flag explicitly that at that point in time, it is
7646 known that the conversion will not trigger the delegate checking
7647 code in implicit conversions (which requires a valid
7650 Everywhere: pass new EmitContext parameter since
7651 ImplicitStandardConversionExists now requires it to check for
7652 anonymous method conversions.
7654 (Convert.ImplicitStandardConversionExists): If the type of an
7655 expression is the anonymous_method_type, and the type is a
7656 delegate, we invoke the AnonymousMethod.Compatible method to check
7657 whether an implicit conversion is possible.
7659 (Convert.ImplicitConversionStandard): Only do implicit method
7660 group conversions if the language level is not ISO_1.
7662 * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7663 MethodInfo for the Invoke method. used by Delegate and
7666 * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7667 method conversions if the target type is a delegate.
7669 Removed extra debugging nops.
7671 (LocalVariableReference): Turn the `local_info' into a public
7674 Add `prepared' field, the same hack used for FieldExprs to cope
7675 with composed assignments, as Local variables do not necessarily
7676 operate purely on the stack as they used to: they can be captured
7679 Add `temp' for a temporary result, like fields.
7681 Refactor DoResolve and DoResolveLValue into DoResolveBase.
7683 It now copes with Local variables that are captured and emits the
7684 proper instance variable to load it from a field in the captured
7687 (ParameterReference.DoResolveBase): During the resolve phase,
7688 capture parameters if we are in an anonymous method.
7690 (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7691 anonymous method, use the EmitContext helper routines to emit the
7692 parameter reference.
7694 * iterators.cs: Set RemapToProxy to true/false during the
7697 * parameters.cs (GetParameterByName): New helper method.
7699 * typemanager.cs (anonymous_method_type) a new type that
7700 represents an anonyous method. This is always an internal type,
7701 used as a fencepost to test against the anonymous-methodness of an
7704 2004-10-20 Marek Safar <marek.safar@seznam.cz>
7706 * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7708 (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7710 2004-11-10 Martin Baulig <martin@ximian.com>
7712 * expression.cs (Invocation.BetterFunction): If two methods have
7713 equal parameter types, but only one of them is generic, the
7714 non-generic one wins.
7715 (New.DoResolve): Don't set `is_struct' to false if we're a generic
7716 instance; just use `Type.IsValueType' to determine whether
7717 something is a struct or not.
7718 (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
7719 so we can be called multiple times.
7721 2004-11-10 Martin Baulig <martin@ximian.com>
7723 * generic.cs (TypeParameter.DefineConstraints): New public method.
7724 (TypeParameter.CheckAccessLevel): Override this and return true.
7725 (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
7726 override ResolveType() anymore.
7727 (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
7729 2004-11-10 Martin Baulig <martin@ximian.com>
7731 * rootcontext.cs (RootContext.LookupType): If we're a nested type,
7732 call DeclSpace.ResolveNestedType() on it.
7734 2004-11-10 Martin Baulig <martin@ximian.com>
7736 * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
7737 non-null, call ParameterModifier() on it.
7739 2004-11-10 Martin Baulig <martin@ximian.com>
7742 (Iterators): Added `current_type' and `this_type' fields.
7743 (Iterators.DefineIterator): Create a new EmitContext and store it
7744 in `ec'; compute `this_type'.
7746 2004-11-10 Martin Baulig <martin@ximian.com>
7749 (TypeManager.IsPrivateAccessible): New public method.
7750 (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
7752 2004-11-10 Martin Baulig <martin@ximian.com>
7754 * class.cs (TypeContainer.DefineType): Call
7755 TypeBuilder.DefineGenericParameters() before resolving the type
7757 (MethodData.parent_method): New protected field.
7758 (MethodData..ctor): Added `MethodInfo parent_method' argument.
7759 (MethodData.Define): Compute `parent_method'.
7762 (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7763 (MemberCore.GetClsCompliantAttributeValue): Likewise.
7764 (DeclSpace.ec): New protected field; store the EmitContext here.
7765 (DeclSpace.EmitContext): New public property.
7766 (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
7767 (DeclSpace.ResolveNestedType): New public method.
7768 (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
7769 (DeclSpace.NestedAccessible): Added `Type tb' argument.
7770 (DeclSpace.FamilyAccessible): Likewise.
7771 (DeclSpace.FindType): Call ResolveNestedType() for nested types.
7772 (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7775 * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
7778 * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7779 (Enum.Emit): Don't create a new EmitContext.
7781 2004-10-18 Martin Baulig <martin@ximian.com>
7783 * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7784 `Type' directly, but call ResolveType() on it.
7785 (Catch.Resolve): Likewise.
7786 (Foreach.Resolve): Likewise.
7788 2004-10-18 Martin Baulig <martin@ximian.com>
7790 * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7791 `Type' directly, but call ResolveType() on it.
7792 (Probe.DoResolve): Likewise.
7793 (ArrayCreation.LookupType): Likewise.
7794 (TypeOf.DoResolve): Likewise.
7795 (SizeOf.DoResolve): Likewise.
7797 2004-10-18 Raja R Harinath <rharinath@novell.com>
7799 * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7802 2004-10-17 John Luke <john.luke@gmail.com>
7804 * class.cs (Operator.GetSignatureForError): use CSharpName
7806 * parameter.cs (Parameter.GetSignatureForError): Returns
7807 correct name even if was not defined.
7809 2004-10-13 Raja R Harinath <rharinath@novell.com>
7812 * class.cs (TypeContainer.EmitContext): New property.
7813 (DefineNestedTypes): Create an emitcontext for each part.
7814 (MethodCore.DoDefineParameters): Use container's emitcontext.
7815 Pass type array to InternalParameters.
7816 (MemberBase.DoDefine): Use container's emitcontext.
7817 (FieldMember.Define): Likewise.
7818 (Event.Define): Likewise.
7819 (SetMethod.GetParameterInfo): Change argument to EmitContext.
7820 Pass type array to InternalParameters.
7821 (SetIndexerMethod.GetParameterInfo): Likewise.
7822 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7823 * delegate.cs (Define): Pass emitcontext to
7824 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
7825 array to InternalParameters.
7826 * expression.cs (ParameterReference.DoResolveBase): Pass
7827 emitcontext to GetParameterInfo.
7828 (ComposedCast.DoResolveAsTypeStep): Remove check on
7829 ec.ResolvingTypeTree.
7830 * parameter.cs (Parameter.Resolve): Change argument to
7831 EmitContext. Use ResolveAsTypeTerminal.
7832 (Parameter.GetSignature): Change argument to EmitContext.
7833 (Parameters.ComputeSignature): Likewise.
7834 (Parameters.ComputeParameterTypes): Likewise.
7835 (Parameters.GetParameterInfo): Likewise.
7836 (Parameters.ComputeAndDefineParameterTypes): Likewise.
7837 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
7838 * support.cs (InternalParameters..ctor): Remove variant that takes
7840 * typemanager.cs (system_intptr_expr): New.
7841 (InitExpressionTypes): Initialize it.
7843 2004-10-12 Chris Toshok <toshok@ximian.com>
7845 * cs-parser.jay: fix location for try_statement and catch_clause.
7847 2004-10-18 Martin Baulig <martin@ximian.com>
7849 * class.cs (FieldMember.Define): Don't access the TypeExpr's
7850 `Type' directly, but call ResolveType() on it.
7851 (MemberBase.DoDefine): Likewise.
7853 * expression.cs (New.DoResolve): Don't access the TypeExpr's
7854 `Type' directly, but call ResolveType() on it.
7855 (ComposedCast.DoResolveAsTypeStep): Likewise.
7857 * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7858 `Type' directly, but call ResolveType() on it.
7860 2004-10-17 John Luke <john.luke@gmail.com>
7862 * class.cs (Operator.GetSignatureForError): use CSharpName
7864 * parameter.cs (Parameter.GetSignatureForError): Returns
7865 correct name even if was not defined.
7867 2004-10-13 Raja R Harinath <rharinath@novell.com>
7870 * class.cs (TypeContainer.EmitContext): New property.
7871 (DefineNestedTypes): Create an emitcontext for each part.
7872 (MethodCore.DoDefineParameters): Use container's emitcontext.
7873 Pass type array to InternalParameters.
7874 (MemberBase.DoDefine): Use container's emitcontext.
7875 (FieldMember.Define): Likewise.
7876 (Event.Define): Likewise.
7877 (SetMethod.GetParameterInfo): Change argument to EmitContext.
7878 Pass type array to InternalParameters.
7879 (SetIndexerMethod.GetParameterInfo): Likewise.
7880 (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7881 * delegate.cs (Define): Pass emitcontext to
7882 ComputeAndDefineParameterTypes and GetParameterInfo. Pass type
7883 array to InternalParameters.
7884 * expression.cs (ParameterReference.DoResolveBase): Pass
7885 emitcontext to GetParameterInfo.
7886 (ComposedCast.DoResolveAsTypeStep): Remove check on
7887 ec.ResolvingTypeTree.
7888 * parameter.cs (Parameter.Resolve): Change argument to
7889 EmitContext. Use ResolveAsTypeTerminal.
7890 (Parameter.GetSignature): Change argument to EmitContext.
7891 (Parameters.ComputeSignature): Likewise.
7892 (Parameters.ComputeParameterTypes): Likewise.
7893 (Parameters.GetParameterInfo): Likewise.
7894 (Parameters.ComputeAndDefineParameterTypes): Likewise.
7895 Re-use ComputeParameterTypes. Set ec.ResolvingTypeTree.
7896 * support.cs (InternalParameters..ctor): Remove variant that takes
7898 * typemanager.cs (system_intptr_expr): New.
7899 (InitExpressionTypes): Initialize it.
7901 2004-10-12 Chris Toshok <toshok@ximian.com>
7903 * cs-parser.jay: fix location for try_statement and catch_clause.
7905 2004-10-07 Raja R Harinath <rharinath@novell.com>
7907 More DeclSpace.ResolveType avoidance.
7908 * decl.cs (MemberCore.InUnsafe): New property.
7909 * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal
7910 with newly created EmitContext.
7911 (FieldMember.Define): Likewise.
7912 * delegate.cs (Delegate.Define): Likewise.
7913 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7914 only if normal name-lookup fails.
7915 (TypeExpr.DoResolve): Enable error-checking.
7916 * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7917 (SizeOf.DoResolve): Likewise.
7918 (ComposedCast.DoResolveAsTypeStep): Likewise.
7919 (StackAlloc.DoResolve): Likewise.
7920 * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7921 (Block.Unsafe): New property.
7922 (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7923 (Unsafe): Set 'unsafe' flag of contained block.
7924 (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7925 (Fixed.Resolve): Likewise.
7926 (Catch.Resolve): Likewise.
7927 (Using.ResolveLocalVariableDecls): Likewise.
7928 (Foreach.Resolve): Likewise.
7930 2004-10-05 John Luke <john.luke@gmail.com>
7932 * cs-parser.jay: add location to error CS0175
7934 2004-10-04 Miguel de Icaza <miguel@ximian.com>
7936 * ecore.cs (Expression.Constantity): Add support for turning null
7939 * const.cs (Const.Define): Allow constants to be reference types
7940 as long as the value is Null.
7942 2004-10-04 Juraj Skripsky <js@hotfeet.ch>
7944 * namespace.cs (NamespaceEntry.Using): No matter which warning
7945 level is set, check if this namespace name has already been added.
7947 2004-10-03 Ben Maurer <bmaurer@ximian.com>
7949 * expression.cs: reftype [!=]= null should always use br[true,false].
7952 2004-10-03 Marek Safar <marek.safar@seznam.cz>
7955 * attribute.cs: Enum conversion moved to
7956 GetAttributeArgumentExpression to be applied to the all
7959 2004-10-01 Raja R Harinath <rharinath@novell.com>
7961 Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7962 * class.c (TypeContainer.DefineType): Flag error if
7963 base types aren't accessible due to access permissions.
7964 * decl.cs (DeclSpace.ResolveType): Move logic to
7965 Expression.ResolveAsTypeTerminal.
7966 (DeclSpace.ResolveTypeExpr): Thin layer over
7967 Expression.ResolveAsTypeTerminal.
7968 (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7969 Refactor code into NestedAccess. Use it.
7970 (DeclSpace.NestedAccess): New.
7971 * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7972 argument to silence errors. Check access permissions.
7973 (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7974 * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7975 (Cast.DoResolve): Likewise.
7976 (New.DoResolve): Likewise.
7977 (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7978 (TypeOf.DoResolve): Likewise.
7980 * expression.cs (Invocation.BetterConversion): Return the Type of
7981 the better conversion. Implement section 14.4.2.3 more faithfully.
7982 (Invocation.BetterFunction): Make boolean. Make correspondence to
7983 section 14.4.2.2 explicit.
7984 (Invocation.OverloadResolve): Update.
7985 (Invocation): Remove is_base field.
7986 (Invocation.DoResolve): Don't use is_base. Use mg.IsBase.
7987 (Invocation.Emit): Likewise.
7989 2004-09-24 Marek Safar <marek.safar@seznam.cz>
7991 * cs-parser.jay: Reverted 642 warning fix.
7993 2004-09-23 Marek Safar <marek.safar@seznam.cz>
7996 * decl.cs (FindMemberWithSameName): Indexer can have more than
7999 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8001 * expression.cs (LocalVariableReference.DoResolveLValue):
8002 Do not report warning 219 for out values.
8003 (EmptyExpression.Null): New member to avoid extra allocations.
8005 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8007 * cs-parser.jay: Fix wrong warning 642 report.
8009 * cs-tokenizer.cs (CheckNextToken): New helper;
8010 Inspect next character if is same as expected.
8012 2004-09-23 Martin Baulig <martin@ximian.com>
8014 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8015 (Convert.ImplicitReferenceConversionExists): Likewise.
8017 2004-11-09 Raja R Harinath <rharinath@novell.com>
8019 * Makefile (DISTFILES): Comment out a few missing files.
8021 2004-10-29 Raja R Harinath <rharinath@novell.com>
8023 * Makefile (bootstrap_libs,bootstrap_libfiles): New.
8024 (bootstrap-libs): New target. Invokes the net_2_0_bootstrap profile.
8025 (gmcs.exe): Invoke bootstrap-libs.
8026 (clean-local): Clean the net_2_0_bootstrap profile too.
8027 (PROGRAM_INSTALL_DIR): New.
8028 (install-local): Use it.
8030 2004-10-13 Martin Baulig <martin@ximian.com>
8032 * generic.cs (TypeManager.InflatedConstraints): New nested class.
8033 (TypeParameter.DefineType): If we're a method type parameter and
8034 that method is overriding something, "inflate" its constraints.
8036 2004-10-12 Martin Baulig <martin@ximian.com>
8038 * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
8039 and have type arguments, create and resolve a ConstructedType.
8041 2004-10-12 Martin Baulig <martin@ximian.com>
8043 * decl.cs (MemberCache.FindMemberToOverride): Use
8044 TypeManager.IsEqual() to compare the parameters and Type.Equals()
8045 to compare the invocationType.
8047 * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
8048 When comparing two type parameters, only do the signature-only
8049 comparision for method type parameters.
8051 2004-10-11 Martin Baulig <martin@ximian.com>
8053 * report.cs: Don't make --fatal abort on warnings, we have
8054 -warnaserror for that.
8056 2004-10-11 Martin Baulig <martin@ximian.com>
8059 (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
8060 (TypeManager.IsEqual): Call ourself recursively instead of using
8063 2004-10-11 Martin Baulig <martin@ximian.com>
8065 * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
8066 on our own type parameters, not on the ones we inherit from a containing
8069 * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
8072 * generic.cs (TypeParameter.Define): We may only be called once.
8074 * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
8075 instead of TypeManager.IsEqual().
8077 2004-09-28 Martin Baulig <martin@ximian.com>
8080 (GenericConstraints.EffectiveBaseClass): New public property.
8081 (TypeParameter.GenericConstraints): New public property.
8082 (ConstructedType.CheckConstraints): Improved.
8084 * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
8085 (Convert.TypeParameterConversion): New private method; use this in
8086 ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
8087 for all conversions related to type parameters.
8089 2004-09-24 Martin Baulig <martin@ximian.com>
8091 * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
8092 type parameter conversions for type parameters which are known to
8095 2004-09-24 Martin Baulig <martin@ximian.com>
8097 * generic.cs (GenericConstraints): Added `IsReferenceType' and
8098 `IsValueType' properties.
8100 * support.cs (ReflectionConstraints): Use
8101 Type.GetGenericParameterConstraints() instead of the old hack.
8103 2004-09-24 Martin Baulig <martin@ximian.com>
8105 * generic.cs (GenericConstraints): Moved here and made it an
8108 * support.cs (GenericConstraints): Moved to generic.cs.
8110 2004-09-24 Martin Baulig <martin@ximian.com>
8113 (ReflectionConstraints): Un-nested this class and made it public.
8116 (TypeManager.GetTypeParameterConstraints): New public method.
8117 (TypeManager.HasConstructorConstraint): Use the attributes.
8119 2004-09-24 Martin Baulig <martin@ximian.com>
8121 * support.cs (GenericConstraints): Replaced `HasConstructor',
8122 `IsReferenceType' and `IsValueType' with `Attributes'.
8123 (ReflectionParameters.ReflectionConstraints): Removed the Create()
8124 method and made the .ctor public.
8126 * generic.cs (Constraints.Attributes): New public property.
8127 (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
8128 `IsReferenceType' -> `HasReferenceTypeConstraint' and
8129 `IsValueType' -> `HasValueTypeConstraint'.
8131 2004-09-23 Martin Baulig <martin@ximian.com>
8133 * generic.cs (Constraints): Reflect latest runtime changes.
8135 2004-09-23 Martin Baulig <martin@ximian.com>
8137 * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8138 (Convert.ImplicitReferenceConversionExists): Likewise.
8140 2004-09-23 Marek Safar <marek.safar@seznam.cz>
8142 * class.cs (Operator.Define): Add error 448 and 559 report.
8144 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8146 * class.cs (MemberBase.IsTypePermitted): New protected
8147 method for checking error CS0610.
8149 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8151 * class.cs (TypeContainer.HasExplicitLayout): New property
8152 Returns whether container has StructLayout attribute set Explicit.
8153 (FieldMember): New abstract class for consts and fields.
8154 (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
8155 (Field): Reuse FieldMember.
8157 * const.cs (Const): Reuse FieldMember.
8159 * rootcontext.cs: EmitConstants call moved to class.
8161 2004-09-22 Martin Baulig <martin@ximian.com>
8163 Marek and me just fixed one of our oldest bugs: #28562 :-)
8165 * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
8167 * attribute.cs (Attribute.GetAttributeArgumentExpression): If
8168 we're an EnumConstant, just return that.
8169 (Attribute.Resolve): GetAttributeArgumentExpression() may give us
8170 an EnumConstant. In this case, we need to use GetValueAsEnumType()
8171 to get the value which'll actually be written into the attribute.
8172 However, we have to use GetValue() to access the attribute's value
8175 2004-09-22 Marek Safar <marek.safar@seznam.cz>
8177 * constant.cs (Constant.IsNegative): New abstract property
8180 * expression.cs (ArrayAccess.DoResolve): Add warning 251.
8181 (StackAlloc.DoResolve): Reused IsNegative.
8183 2004-09-22 Martin Baulig <martin@ximian.com>
8185 * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
8186 public method; like LookupTypeContainer, but also works for
8189 * report.cs (Report.SymbolRelatedToPreviousError): Use
8190 TypeManager.LookupGenericTypeContainer().
8192 2004-09-22 Martin Baulig <martin@ximian.com>
8194 Thanks to Peter Sestoft for this bug report.
8196 * expression.cs (Conditional): If both the `trueExpr' and the
8197 `falseExpr' is a NullLiteral, return a NullLiteral.
8199 2004-09-22 Martin Baulig <martin@ximian.com>
8201 * statement.cs (Foreach.EmitCollectionForeach): If we're in an
8202 iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
8203 for the "get_Current" call.
8205 2004-09-21 Martin Baulig <martin@ximian.com>
8207 * convert.cs (Convert.ImplicitReferenceConversion): When
8208 converting to an interface type, first check whether we're
8209 converting from a reference type.
8211 2004-09-14 Martin Baulig <martin@ximian.com>
8213 * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
8215 2004-09-14 Marek Safar <marek.safar@seznam.cz>
8218 * codegen.cs (TestObsoleteMethodUsage): Trace when method is
8219 called and is obsolete then this member suppress message
8220 when call is inside next [Obsolete] method or type.
8222 * expression.cs: Use TestObsoleteMethodUsage member.
8224 2004-09-14 Martin Baulig <martin@ximian.com>
8226 * genericparser.cs: Removed.
8228 2004-09-13 Marek Safar <marek.safar@seznam.cz>
8230 * class.cs (MethodCore.CheckBase): Fix bug #65757.
8232 2004-09-12 Marek Safar <marek.safar@seznam.cz>
8234 * attribute.cs (Attribute.Resolve): Add error 653 report.
8236 * class.cs (Class.ApplyAttributeBuilder): Add error 641
8238 (Method.ApplyAttributeBuilder): Add error 685 report.
8239 (Operator.Define): Add error 564 report.
8241 * cs-tokenizer.cs (handle_hex): Add error 1013 report.
8243 * expression.cs (Invocation.DoResolve): Add error
8246 * parameter.cs (Parameter.ApplyAttributeBuilder): Add
8249 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8251 * class.cs (ConstructorInitializer.Resolve):
8252 Wrong error number (515->516).
8254 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8256 * class.cs (Indexer.Define): Add error 631 report.
8258 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8260 * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
8262 2004-09-11 Marek Safar <marek.safar@seznam.cz>
8264 * expression.cs (Probe.DoResolve): Add error CS0241 report.
8266 2004-09-10 Marek Safar <marek.safar@seznam.cz>
8268 * cs-parser.jay: Added error CS0241 report.
8270 2004-09-10 Raja R Harinath <rharinath@novell.com>
8272 * cs-parser.jay (fixed_statement): Introduce a scope for the
8273 declaration in the 'fixed' statement.
8275 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8277 * cs-parser.jay: Added CS0230 error report.
8279 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8281 * cs-parser.jay: Added errors CS0231 and CS0257 report.
8283 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8285 * expression.cs (Argument.Resolve): Added error CS0192 and
8288 2004-09-09 Marek Safar <marek.safar@seznam.cz>
8290 C# 2.0 #pragma warning feature
8292 * cs-tokenizer.cs (PreProcessPragma): New method;
8293 Handles #pragma directive.
8295 * report.cs (WarningRegions): New class; Support
8296 class for #pragma warning directive. It tests whether
8297 warning is enabled for a given line.
8299 2004-09-08 Miguel de Icaza <miguel@ximian.com>
8301 * const.cs: Add more descriptive error report, tahnks to
8304 2004-09-08 Marek Safar <marek.safar@seznam.cz>
8306 * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
8308 2004-09-07 Miguel de Icaza <miguel@ximian.com>
8310 * expression.cs: Apply patch from Ben: Remove dead code from
8311 ArrayCreation, and remove the TurnintoConstant call in const.cs,
8312 as that code just threw an exception anwyays.
8314 * const.cs: Remove the call to the turnintoconstant, for details
8317 * literal.cs: The type of the null-literal is the null type; So
8318 we use a placeholder type (literal.cs:System.Null, defined here)
8321 * expression.cs (Conditional.DoResolve): Remove some old code that
8322 is no longer needed, conversions have been fixed.
8324 (ArrayCreationExpression.DoResolve): Return false if we fail to
8325 resolve the inner expression.
8327 2004-09-07 Raja R Harinath <rharinath@novell.com>
8330 * cs-parser.jay (delegate_declaration): Record a delegate
8331 declaration as a type declaration.
8332 Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
8334 2004-09-06 Miguel de Icaza <miguel@ximian.com>
8336 * parameter.cs: Do not crash if the type can not be resolved.
8338 * expression.cs: Report errors with unsafe pointers, fixes #64896
8340 2004-09-06 Ben Maurer <bmaurer@users.sourceforge.net>
8342 * expression.cs: Pointer arith always needs to do a conv.i
8343 if the operand is a long. fix 65320
8345 2004-09-04 Marek Safar <marek.safar@seznam.cz>
8347 Fixed cs0619-37.cs, cs0619-38.cs
8349 * enum.cs (GetObsoleteAttribute): Removed.
8351 * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
8352 on Enum member is double staged. The first is tested member
8355 2004-09-04 Marek Safar <marek.safar@seznam.cz>
8357 Fixed #56986, #63631, #65231
8359 * class.cs: (TypeContainer.AddToMemberContainer): New method,
8360 adds member to name container.
8361 (TypeContainer.AddToTypeContainer): New method, adds type to
8363 (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8364 AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8365 AddOperator): Simplified by reusing AddToMemberContainer.
8366 (TypeContainer.UserDefinedStaticConstructor): Changed to property
8368 (Method.CheckForDuplications): Fixed implementation to test all
8370 (MemberBase): Detection whether member is explicit interface
8371 implementation is now in constructor.
8372 (MemberBase.UpdateMemberName): Handles IndexerName.
8373 (Accessor): Changed to keep also location information.
8374 (AbstractPropertyEventMethod): Is derived from MemberCore.
8375 (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8376 will be emited or not.
8377 (PropertyBase.AreAccessorsDuplicateImplementation):
8378 Tests whether accessors are not in collision with some method.
8379 (Operator): Is derived from MethodCore to simplify common
8382 * decl.cs (Flags.TestMethodDuplication): Test for duplication
8384 (DeclSpace.AddToContainer): Adds the member to defined_names
8385 table. It tests for duplications and enclosing name conflicts.
8387 * enum.cs (EnumMember): Clean up to reuse the base structures
8389 2004-09-03 Martin Baulig <martin@ximian.com>
8391 Merged latest changes into gmcs. Please keep this comment in
8392 here, it makes it easier for me to see what changed in MCS since
8393 the last time I merged.
8395 2004-09-03 Martin Baulig <martin@ximian.com>
8397 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8398 into TypeContainer, to make partial classes work again.
8400 2004-09-03 Martin Baulig <martin@ximian.com>
8402 * rootcontext.cs (RootContext.V2): Removed.
8404 2004-03-23 Martin Baulig <martin@ximian.com>
8406 * expression.cs (Invocation.OverloadResolve): Added `bool
8407 may_fail' argument and use it instead of the Location.IsNull() hack.
8409 2004-09-09 Martin Baulig <martin@ximian.com>
8411 * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
8413 2004-09-09 Martin Baulig <martin@ximian.com>
8415 * generic.cs (TypeParameter.DefineType): Added support for
8416 explicit interface methods.
8418 2004-09-09 Martin Baulig <martin@ximian.com>
8420 * README.Changes: New document. Started to list important changes
8421 between MCS and GMCS here.
8423 2004-09-08 Martin Baulig <martin@ximian.com>
8426 (TypeContainer.CheckRecursiveDefinition): New protected method.
8427 (TypeContainer.DefineType): Move the CS0146 check into
8428 CheckRecursiveDefinition().
8430 2004-09-06 Martin Baulig <martin@ximian.com>
8432 * generic.cs (ConstructedType.CheckConstraints): Allow builtin
8433 types for the constructor constraint.
8435 2004-09-03 Martin Baulig <martin@ximian.com>
8437 * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8438 into TypeContainer, to make partial classes work again.
8440 2004-09-03 Martin Baulig <martin@ximian.com>
8442 * rootcontext.cs (RootContext.V2): Removed.
8444 2004-03-23 Martin Baulig <martin@ximian.com>
8446 * expression.cs (Invocation.OverloadResolve): Added `bool
8447 may_fail' argument and use it instead of the Location.IsNull() hack.
8449 2004-09-03 Martin Baulig <martin@ximian.com>
8451 Merged latest changes into gmcs. Please keep this comment in
8452 here, it makes it easier for me to see what changed in MCS since
8453 the last time I merged.
8455 2004-09-03 Raja R Harinath <rharinath@novell.com>
8458 * expression.cs (BetterConversion): Don't allow either conversion
8459 to be null. Remove redundant implicit conversion test when 'q ==
8460 null' -- when this function is invoked, we already know that the
8461 implicit conversion exists.
8462 (BetterFunction): Assume that 'best' is non-null. Remove
8463 redundant reimplementation of IsApplicable when 'best' is null.
8464 (IsParamsMethodApplicable, IsApplicable): Add new parameter for
8465 number of arguments.
8466 (IsAncestralType): Extract from OverloadResolve.
8467 (OverloadResolve): Make robust to the MethodGroupExpr being
8468 unsorted. Implement all the logic of Section 14.5.5.1, and
8469 support overloading of methods from multiple applicable types.
8470 Clean up logic somewhat. Don't pass null methods to BetterFunction.
8472 * report.cs (SymbolRelatedToPreviousError): Cleanup output.
8473 (RealError, Warning): Append type of report to related symbol.
8475 2004-09-03 Marek Safar <marek.safar@seznam.cz>
8477 * enum.cs: Fixed CLS-Compliance checks for enum members.
8478 Error tests cs3008-8.cs, cs3014-8.cs
8480 2004-09-02 Marek Safar <marek.safar@seznam.cz>
8482 Fixed bug #62342, #63102
8483 * class.cs: ImplementIndexer uses member.IsExplicitImpl
8484 like ImplementMethod.
8486 2004-09-02 Marek Safar <marek.safar@seznam.cz>
8488 * attribute.cs (Attribute.GetAttributeArgumentExpression):
8491 2004-09-02 Martin Baulig <martin@ximian.com>
8493 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8494 TypeManager.GetArgumentTypes() rather than calling GetParameters()
8497 2004-09-01 Marek Safar <marek.safar@seznam.cz>
8499 C# 2.0 Static classes implemented
8501 * class.cs (TypeContainer): instance_constructors,
8502 initialized_fields, initialized_static_fields,
8503 default_constructor, base_inteface_types are protected to be
8504 accessible from StaticClass.
8505 (TypeContainer.DefineDefaultConstructor): New virtual method
8506 for custom default constructor generating
8507 (StaticClass): New class to handle "Static classes" feature.
8509 * cs-parser.jay: Handle static keyword on class like instance
8512 * driver.cs: Added "/langversion" command line switch with two
8513 options (iso-1, default).
8515 2004-08-31 Marek Safar <marek.safar@seznam.cz>
8517 * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8519 2004-08-31 Miguel de Icaza <miguel@ximian.com>
8521 * delegate.cs: Style.
8523 2004-08-31 Ben Maurer <bmaurer@users.sourceforge.net>
8525 * delegate.cs: Add seperate instance expr field for miguel.
8527 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
8529 * PointerArithmetic (Resolve): make sure we are not doing
8530 pointer arith on void*. Also, make sure we are resolved
8531 by not setting eclass until resolve.
8533 All callers: Make sure that PointerArithmetic gets resolved.
8535 2004-08-29 Ben Maurer <bmaurer@users.sourceforge.net>
8537 * ArrayCreation (LookupType): If the type does not resolve
8538 to an array, give an error.
8540 2004-08-27 Marek Safar <marek.safar@seznam.cz>
8542 * statement.cs (Try.Resolve): Fixed bug #64222
8544 2004-08-27 Martin Baulig <martin@ximian.com>
8547 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8550 2004-08-26 Marek Safar <marek.safar@seznam.cz>
8552 * ecore.cs (Constantify): Get underlying type via
8553 System.Enum.GetUnderlyingType to avoid StackOverflow on the
8554 Windows in special cases.
8556 2004-08-26 Marek Safar <marek.safar@seznam.cz>
8558 * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8559 for obtaining also private methods.
8560 (GetRemoveMethod): Used GetRemoveMethod (true)
8561 for obtaining also private methods.
8563 2004-09-02 Martin Baulig <martin@ximian.com>
8565 * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8566 TypeManager.GetArgumentTypes() rather than calling GetParameters()
8569 2004-08-27 Martin Baulig <martin@ximian.com>
8572 (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8575 2004-08-25 Martin Baulig <martin@ximian.com>
8577 * support.cs (ReflectionParameters..ctor): If this is a generic
8578 method, retrieve and store its type parameters.
8579 (InternalParameters..ctor): Added `TypeParameter[]' argument.
8580 (ReflectionParameters.GenericConstraints): The argument specifies
8581 the type parameter, not the method parameter.
8582 (InternalParameters.GenericConstraints): Likewise.
8584 * generic.cs (TypeParameter.DefineType): Correctly handle
8585 constraints wrt. generic methods in interfaces and their
8588 2004-08-24 Martin Baulig <martin@ximian.com>
8590 * generic.cs (TypeParameter.IsSubclassOf): New public method.
8591 (Constraints.IsSubclassOf): New internal method.
8593 * typemanager.cs (TypeManager.FindMembers): Added special support
8594 for GenericTypeParameterBuilder's.
8595 (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
8598 2004-08-24 Martin Baulig <martin@ximian.com>
8601 (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8602 this for accessibility checks.
8603 (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8604 IsNestedFamilyAccessible.
8605 (TypeManager.IsSubclassOf): New method, do what the name actually
8608 2004-08-24 Martin Baulig <martin@ximian.com>
8610 * expression.cs (MemberAccess.DoResolve): When resolving ourselves
8611 as a SimpleName, include the generic arity.
8613 2004-08-24 Martin Baulig <martin@ximian.com>
8615 * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8616 MethodAttributes.HideBySig for operators.
8618 2004-08-23 Martin Baulig <martin@ximian.com>
8620 Back to the old error reporting system :-)
8622 * report.cs (Message): Removed.
8623 (Report.MessageData, ErrorData, WarningData): Removed.
8624 (Report.Error, Warning): Back to the old system.
8626 2004-08-23 Martin Baulig <martin@ximian.com>
8628 * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8630 * class.cs (TypeContainer.ParentContainer): New public virtual
8631 method; replaces the explicit interface implementation.
8632 (ClassPart.ParentContainer): Override.
8634 2004-08-23 Martin Baulig <martin@ximian.com>
8636 * statement.cs (Switch): Added support for constant switches; see
8637 #59428 or test-285.cs.
8639 2004-08-22 Marek Safar <marek.safar@seznam.cz>
8642 * statement.cs (GetEnumeratorFilter): Removed useless
8643 logic because C# specs is strict. GetEnumerator must be
8646 2004-08-22 Martin Baulig <martin@ximian.com>
8648 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8649 a switch and may break, reset the barrier. Fixes #59867.
8651 2004-08-22 Marek Safar <marek.safar@seznam.cz>
8653 CLS-Compliance speed up (~5% for corlib)
8655 * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8656 New method. Tests container for CLS-Compliant names
8658 * class.cs (TypeContainer.VerifyClsName): New method.
8659 Checks whether container name is CLS Compliant.
8660 (Constructor): Implements IMethodData.
8662 * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8663 low-case table for CLS Compliance test.
8664 (MemberCache.VerifyClsParameterConflict): New method.
8665 Checks method parameters for CS3006 error.
8667 * enum.cs (EnumMember): Is derived from MemberCore.
8668 (Enum.VerifyClsName): Optimized for better performance.
8670 2004-08-06 Marek Safar <marek.safar@seznam.cz>
8672 * report.cs: Renamed Error_T to Error and changed all
8675 2004-08-06 Marek Safar <marek.safar@seznam.cz>
8677 * class.cs (TypeContainer.IndexerArrayList): New inner class
8678 container for indexers.
8679 (TypeContainer.DefaultIndexerName): New constant for default
8680 indexer name. Replaced all "Item" with this constant.
8681 (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8683 * typemanager.cs (TypeManager.default_member_ctor): Cache here
8684 DefaultMemberAttribute constructor.
8686 2004-08-05 Martin Baulig <martin@ximian.com>
8688 * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8691 2004-08-05 Marek Safar <marek.safar@seznam.cz>
8693 * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8694 multi platforms problem.
8696 * compiler.csproj: Included shared files.
8698 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8700 Fix bug 60333, 55971 in the more general way
8701 * attribute.cs (Attribute.GetAttributeArgumentExpression):
8702 Added arg_type argument for constant conversion.
8703 (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8705 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8708 * class.cs (TypeContainer ): New inner classes MethodArrayList,
8709 OperatorArrayList, MethodCoreArrayList for typecontainer
8710 containers. Changed class member types to these new types.
8711 (MethodArrayList.DefineMembers): Added test for CS0659.
8713 2004-08-04 Miguel de Icaza <miguel@ximian.com>
8715 * cfold.cs: Synchronize the folding with the code in expression.cs
8716 Binary.DoNumericPromotions for uint operands.
8718 * attribute.cs: Revert patch from Raja, it introduced a regression
8719 while building Blam-1.2.1 (hard to isolate a test case).
8721 2004-08-04 Marek Safar <marek.safar@seznam.cz>
8725 (TypeContainer.Define): Renamed to DefineContainerMembers because of
8727 (MethodCore.parent_method): New member. The method we're overriding
8728 if this is an override method.
8729 (MethodCore.CheckBase): Moved from Method class and made common.
8730 (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8732 (MethodCore.CheckForDuplications): New abstract method. For custom
8733 member duplication search in a container
8734 (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8735 method and its return type.
8736 (Event.conflict_symbol): New member. Symbol with same name in the
8740 (MemberCache.FindMemberWithSameName): New method. The method
8741 is looking for conflict with inherited symbols.
8743 2004-08-04 Martin Baulig <martin@ximian.com>
8745 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8747 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8749 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8751 * report.cs (Message): New enum for better error, warning reference in
8753 (MessageData): New inner abstract class. It generally handles printing of
8754 error and warning messages.
8755 Removed unused Error, Warning, Message methods.
8757 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8759 Fix for cs0592-8.cs test
8761 (Attributable.ValidAttributeTargets): Made public.
8762 (Attribute.ExplicitTarget): New member for explicit target value.
8763 (Attribute.CheckTargets): Now we translate explicit attribute
8764 target to Target here.
8766 2004-08-03 Ben Maurer <bmaurer@ximian.com>
8768 * ecore.cs (MethodGroupExpr): new IsBase property.
8770 * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8772 * delegate.cs (DelegateCreation): store a MethodGroupExpr
8773 rather than an instance expr.
8775 (DelegateCreation.Emit): Use the method group rather than
8776 the instance expression. Also, if you have base.Foo as the
8777 method for a delegate, make sure to emit ldftn, not ldftnvirt.
8779 (ResolveMethodGroupExpr): Use the MethodGroupExpr.
8781 (NewDelegate.DoResolve): Only check for the existance of Invoke
8782 if the method is going to be needed. Use MethodGroupExpr.
8784 (NewDelegate.Emit): Remove, DelegateCreation implements this.
8786 * expression.cs: For pointer arith., make sure to use
8787 the size of the type, not the size of the pointer to
8790 2004-08-03 Marek Safar <marek.safar@seznam.cz>
8793 * class.cs (Class): Added error CS0502 test.
8795 2004-08-03 John Luke <jluke@cfl.rr.com>
8796 Raja R Harinath <rharinath@novell.com>
8799 * attribute.cs (Attribute.complained_before): New flag.
8800 (Attribute.ResolveType, Attribute.Resolve),
8801 (Attribute.DefinePInvokeMethod): Set it.
8802 (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8804 2004-08-03 Martin Baulig <martin@ximian.com>
8806 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8807 use a user-defined operator; we still need to do numeric
8808 promotions in case one argument is a builtin type and the other
8809 one has an implicit conversion to that type. Fixes #62322.
8811 2004-08-18 Martin Baulig <martin@ximian.com>
8813 * class.cs (Method.Define): Use the correct method name when
8814 creating the MethodBuilder for a generic method.
8816 2004-08-17 Martin Baulig <martin@ximian.com>
8818 * generic.cs (Constraints): Support type parameter constraints.
8820 2004-08-16 Martin Baulig <martin@ximian.com>
8822 * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
8823 (Token.GENERIC_DIMENSION): New token; this is returned if we
8824 encounter an unbound generic type in a typeof() expression.
8826 * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
8827 this token is only generated while parsing a typeof() expression.
8828 (typeof_expression): Removed the old unbound_type hack.
8830 * generic.cs (TypeArguments.IsUnbound): New public property.
8832 * decl.cs (MemberName): Added support for unbound types.
8834 2004-08-14 Martin Baulig <martin@ximian.com>
8837 (TypeManager.IsEqualGenericInstance): New static method.
8838 (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
8839 just used to check accessibility, so follow the rules of 26.1.6.
8841 * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
8842 ConstructedType instead of a TypeExpression if we have type arguments.
8844 * cs-parser.jay (typeof_expression): Support unbound generic types.
8846 * ecore.cs (UnboundTypeExpression): New public class.
8848 2004-08-12 Martin Baulig <martin@ximian.com>
8850 * typemanager.cs (TypeManager.IsNestedChildOf): Use
8851 TypeManager.IsEqual() rather than `=='.
8853 * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
8854 generic instances as well.
8856 2004-08-12 Martin Baulig <martin@ximian.com>
8858 * expression.cs (Invocation.InferType): We can only infer method
8859 type parameters. Fixes #62647.
8861 2004-08-11 Martin Baulig <martin@ximian.com>
8863 * class.cs (TypeContainer.DefineType): Create the TypeBuilder
8864 before resolving the base classes.
8866 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8868 * Makefile: install .mdb file too.
8870 2004-08-05 Martin Baulig <martin@ximian.com>
8872 * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
8873 initializer, the current type is just the TypeBuilder, not the
8874 instantiated generic type.
8875 (FieldExpr.IsFieldInitializer): New public property.
8877 2004-08-04 Martin Baulig <martin@ximian.com>
8879 * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8881 * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8883 2004-08-03 Martin Baulig <martin@ximian.com>
8885 * class.cs (MethodData.Define): If we're an explicit
8886 implementation, remove the generic arity from the type name.
8888 2004-08-03 Martin Baulig <martin@ximian.com>
8890 * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8891 use a user-defined operator; we still need to do numeric
8892 promotions in case one argument is a builtin type and the other
8893 one has an implicit conversion to that type. Fixes #62322.
8895 2004-08-02 Martin Baulig <martin@ximian.com>
8897 * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
8899 (TypeContainer.GetClassBases): Return the unexpanded list of
8900 interfaces; we expand them later.
8901 (TypeContainer.DefineType): After creating the TypeBuilder, call
8902 TypeManager.ExpandInterfaces() to get an expanded and resolved
8905 * ecore.cs (TypeExpr.GetInterfaces): Removed
8907 * generics.cs (Constraints.InterfaceConstraints): Remove.
8908 (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
8909 register the interface constraints.
8912 (TypeManager.AddUserType): Removed the `ifaces' argument.
8913 (TypeManager.AddTypeParameter): Likewise.
8914 (TypeManager.AddUserInterface): Removed, was unused.
8915 (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
8916 `TypeExpr[]' array for the interfaces.
8917 (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
8918 has been defined, returns a list of the resolved interfaces types.
8919 (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
8920 (TypeManager.GetExplicitInterfaces): Likewise.
8922 2004-08-02 Martin Baulig <martin@ximian.com>
8924 * expression.cs (Invocation.EmitCall): If we're invoking a method
8925 on a type parameter, use the new `Constrained' prefix opcode.
8927 2004-08-02 Martin Baulig <martin@ximian.com>
8929 * statement.cs (LocalInfo.Flags): Added `IsThis'.
8930 (LocalInfo.IsThis): New public property.
8931 (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8933 2004-08-01 Martin Baulig <martin@ximian.com>
8935 * class.cs (TypeContainer.GetClassBases): Don't set the default
8936 here since we may get called from GetPartialBases().
8937 (TypeContainer.DefineType): If GetClassBases() didn't return a
8938 parent, use the default one.
8940 2004-07-30 Martin Baulig <martin@ximian.com>
8942 * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8944 * class.cs (SourceMethod): New public class, derive from the
8945 symbol writer's ISourceMethod.
8946 (Method): Use the new symbol writer API.
8948 * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8949 as argument and use the new symbol writer.
8952 (SourceFile): Implement the symbol writer's ISourceFile.
8953 (Location.SymbolDocument): Removed.
8954 (Location.SourceFile): New public property.
8956 * symbolwriter.cs: Use the new symbol writer API.
8958 2004-07-30 Raja R Harinath <rharinath@novell.com>
8960 * Makefile (install-local): Remove. Functionality moved to
8963 2004-07-28 Lluis Sanchez Gual <lluis@novell.com>
8965 * Makefile: Install mcs.exe.config file together with mcs.exe.
8966 * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8967 correct runtime version.
8969 2004-07-25 Martin Baulig <martin@ximian.com>
8972 (TypeContainer.RegisterOrder): Removed, this was unused.
8973 (TypeContainer, interface_order): Removed.
8974 (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8975 TypeContainer as argument since we can also be called with a
8976 `PartialContainer' for a partial class/struct/interface.
8977 (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8978 of checking whether we're an `Interface' - we could be a
8980 (PartialContainer.Register): Override; call
8981 AddClass()/AddStruct()/AddInterface() on our parent.
8983 * cs-parser.jay (interface_member_declaration): Add things to the
8984 `current_container', not the `current_class'.
8986 * rootcontext.cs (RegisterOrder): The overloaded version which
8987 takes an `Interface' was unused, removed.
8989 * typemanager.cs (TypeManager.LookupInterface): Return a
8990 `TypeContainer', not an `Interface'.
8991 (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8992 contain a `PartialContainer' for an interface, so check it's
8993 `Kind' to figure out what it is.
8995 2004-07-25 Martin Baulig <martin@ximian.com>
8997 * class.cs (Class.DefaultTypeAttributes): New public constant.
8998 (Struct.DefaultTypeAttributes): Likewise.
8999 (Interface.DefaultTypeAttributes): Likewise.
9000 (PartialContainer.TypeAttr): Override this and add the
9001 DefaultTypeAttributes.
9003 2004-07-25 Martin Baulig <martin@ximian.com>
9005 * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
9006 we can just use the `Parent' field instead.
9008 2004-07-25 Martin Baulig <martin@ximian.com>
9010 * class.cs (TypeContainer.Emit): Renamed to EmitType().
9012 2004-07-25 Martin Baulig <martin@ximian.com>
9014 * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
9015 our parts before defining any methods.
9016 (TypeContainer.VerifyImplements): Make this virtual.
9017 (ClassPart.VerifyImplements): Override and call VerifyImplements()
9018 on our PartialContainer.
9020 2004-07-25 Martin Baulig <martin@ximian.com>
9022 * iterators.cs (Iterator.Define): Renamed to DefineIterator().
9024 * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
9025 argument, we can just use the `Parent' field instead.
9028 (MemberBase.CheckBase): Removed the `TypeContainer' argument.
9029 (MemberBase.DoDefine): Likewise.
9031 2004-07-24 Martin Baulig <martin@ximian.com>
9033 * decl.cs (MemberCore.Parent): New public field.
9034 (DeclSpace.Parent): Moved to MemberCore.
9036 * class.cs (MethodCore.ds): Removed; use `Parent' instead.
9037 (MemberBase.ctor): Added TypeContainer argument, pass it to our
9039 (FieldBase, Field, Operator): Likewise.
9040 (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
9041 (EventField, Event): Likewise.
9043 2004-07-23 Martin Baulig <martin@ximian.com>
9045 * class.cs (PartialContainer): New public class.
9046 (ClassPart): New public class.
9047 (TypeContainer): Added support for partial classes.
9048 (TypeContainer.GetClassBases): Splitted some of the functionality
9049 out into GetNormalBases() and GetPartialBases().
9051 * cs-tokenizer.cs (Token.PARTIAL): New token.
9052 (Tokenizer.consume_identifier): Added some hacks to recognize
9053 `partial', but only if it's immediately followed by `class',
9054 `struct' or `interface'.
9056 * cs-parser.jay: Added support for partial clases.
9058 2004-07-23 Martin Baulig <martin@ximian.com>
9060 * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
9061 a `DeclSpace' and also made it readonly.
9062 (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
9063 (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
9064 (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
9066 * cs-parser.jay: Pass the `current_class', not the
9067 `current_container' (at the moment, this is still the same thing)
9068 to a new Method, Property, Event, Indexer or Constructor.
9070 2004-07-23 Martin Baulig <martin@ximian.com>
9072 * cs-parser.jay (CSharpParser): Added a new `current_class' field
9073 and removed the `current_interface' one.
9074 (struct_declaration, class_declaration, interface_declaration):
9075 Set `current_class' to the newly created class/struct/interface;
9076 set their `Bases' and call Register() before parsing their body.
9078 2004-07-23 Martin Baulig <martin@ximian.com>
9080 * class.cs (Kind): New public enum.
9081 (TypeContainer): Made this class abstract.
9082 (TypeContainer.Kind): New public readonly field.
9083 (TypeContainer.CheckDef): New public method; moved here from
9085 (TypeContainer.Register): New public abstract method.
9086 (TypeContainer.GetPendingImplementations): New public abstract
9088 (TypeContainer.GetClassBases): Removed the `is_class' and
9089 `is_iface' parameters.
9090 (TypeContainer.DefineNestedTypes): Formerly known as
9092 (ClassOrStruct): Made this class abstract.
9094 * tree.cs (RootTypes): New public type.
9096 2004-07-20 Martin Baulig <martin@ximian.com>
9098 * tree.cs (Tree.RecordNamespace): Removed.
9099 (Tree.Namespaces): Removed.
9101 * rootcontext.cs (RootContext.IsNamespace): Removed.
9103 * cs-parser.jay (namespace_declaration): Just create a new
9104 NamespaceEntry here.
9106 2004-07-21 Lluis Sanchez Gual <lluis@novell.com>
9108 * Makefile: Install gmcs.exe.config file together with gmcs.exe.
9109 * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
9110 entry to make sure it runs in the correct runtime version.
9112 2004-07-18 Martin Baulig <martin@ximian.com>
9114 * generic.cs (ConstructedType.CheckConstraints): Improved
9115 constraints checking.
9117 2004-07-18 Martin Baulig <martin@ximian.com>
9119 * expression.cs (Invocation.BetterMethod): Call
9120 TypeManager.TypeToCoreType() on all types and removed my previous
9121 hack; we're already doig the right thing here.
9123 2004-07-17 Martin Baulig <martin@ximian.com>
9125 * decl.cs (MemberName.MakeName): Create the "class`1" names here.
9127 2004-07-16 Martin Baulig <martin@ximian.com>
9129 * iterators.cs: Added generics support.
9131 2004-07-16 Martin Baulig <martin@ximian.com>
9133 * iterators.cs: Rewrote this. We're now using one single Proxy
9134 class for both the IEnumerable and the IEnumerator interface and
9135 `Iterator' derives from Class so we can use the high-level API.
9137 * class.cs (TypeContainer.AddIterator): New method.
9138 (TypeContainer.DoDefineType): New protected virtual method, which
9139 is called from DefineType().
9140 (TypeContainer.DoDefineMembers): Call DefineType() and
9141 DefineMembers() on all our iterators.
9142 (TypeContainer.Emit): Call Emit() on all our iterators.
9143 (TypeContainer.CloseType): Call CloseType() on all our iterators.
9145 * codegen.cs (EmitContext.CurrentIterator): New public field.
9147 2004-07-15 Martin Baulig <martin@ximian.com>
9150 (TypeManager.not_supported_exception_type): New type.
9152 2004-07-14 Martin Baulig <martin@ximian.com>
9155 (TypeManager.generic_ienumerable_type): New type.
9156 (TypeManager.generic_ienumerator_type): New type.
9159 (RootContext.interfaces_first_stage): Added
9160 "System.Collections.Generic.IEnumerator`1" and
9161 "System.Collections.Generic.IEnumerable`1".
9163 2004-07-14 Martin Baulig <martin@ximian.com>
9165 * iterators.cs: Use real error numbers.
9167 2004-07-14 Martin Baulig <martin@ximian.com>
9169 * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
9170 requires this to be a System.Collection.IEnumerable and not a
9171 class implementing that interface.
9172 (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.
9174 2004-07-13 Marek Safar <marek.safar@seznam.cz>
9176 * class.cs: Fixed previous fix, it broke some error tests.
9178 2004-07-12 Martin Baulig <martin@ximian.com>
9180 * enum.cs (Enum.Define): Call Emit() to emit the attributes.
9183 2004-07-14 Martin Baulig <martin@ximian.com>
9185 * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
9186 an exclamation mark (!) for the generic arity to reflect the
9187 latest spec changes; ie. use "System.Collections.Generic.IList`1".
9189 2004-07-13 Martin Baulig <martin@ximian.com>
9191 * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
9192 specifiers being part of a type argument.
9194 2004-07-13 Martin Baulig <martin@ximian.com>
9196 * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
9197 name for generic types.
9199 2004-07-13 Martin Baulig <martin@ximian.com>
9201 * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
9204 2004-07-09 Miguel de Icaza <miguel@ximian.com>
9206 * assign.cs (LocalTemporary): Add new argument: is_address,If
9207 `is_address' is true, then the value that we store is the address
9208 to the real value, and not the value itself.
9210 * ecore.cs (PropertyExpr): use the new local temporary
9211 stuff to allow us to handle X.Y += z (where X is a struct)
9213 2004-07-08 Martin Baulig <martin@ximian.com>
9215 * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
9216 not always return, just like we're doing in Using.Resolve().
9218 2004-07-07 Miguel de Icaza <miguel@ximian.com>
9220 * cs-parser.jay (fixed_statement): flag this as Pinned.
9222 2004-07-06 Miguel de Icaza <miguel@ximian.com>
9224 * typemanager.cs (TypeManager): Removed MakePinned method, this
9225 mechanism is replaced with the .NET 2.x compatible mechanism of
9226 calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
9228 * statement.cs (LocalInfo): Remove MakePinned, add Pinned property
9229 Rename `Fixed' to `Pinned' as a flag, to distinguish from the
9230 `IsFixed' property which has a different meaning.
9232 2004-07-02 Raja R Harinath <rharinath@novell.com>
9234 * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
9235 visible from inside a nested class, not just the names of the
9236 immediately enclosing class.
9239 2004-06-24 Raja R Harinath <rharinath@novell.com>
9241 * expression.cs (BetterConversion): Remove buggy special-case
9242 handling of "implicit constant expression conversions". At this
9243 point, we already know that the conversion is possible -- we're
9244 only checking to see which is better.
9246 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9248 * cs-parser.jay: Added error CS0210 test.
9250 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9252 * cs-parser.jay: Added error CS0134 test.
9254 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9257 * cs-parser.jay: Added error CS0145 test.
9259 2004-06-24 Marek Safar <marek.safar@seznam.cz>
9261 * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
9263 2004-06-23 Ben Maurer <bmaurer@ximian.com>
9265 * expression.cs (StackAlloc.Resolve): The argument may not
9266 be a constant; deal with this case.
9268 2004-06-23 Marek Safar <marek.safar@seznam.cz>
9270 * attribute.cs (IndexerName_GetIndexerName): Renamed to
9271 GetIndexerAttributeValue.
9272 (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
9274 * class.cs (Indexer.Define): Added error tests for CS0415,
9277 2004-06-23 Miguel de Icaza <miguel@ximian.com>
9279 * attribute.cs (Attribute.Resolve): Keep field code in sync with
9282 2004-06-23 Martin Baulig <martin@ximian.com>
9284 * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
9285 neither return nor throw, reset the barrier as well. Fixes #60457.
9287 2004-06-22 Atsushi Enomoto <atsushi@ximian.com>
9289 * class.cs : EventAttributes is now set to None by default.
9290 This fixes bug #60459.
9292 2004-06-18 Marek Safar <marek.safar@seznam.cz>
9295 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9296 Don't throw exception but return null (it's sufficient now).
9298 2004-06-18 Marek Safar <marek.safar@seznam.cz>
9300 * typemanager.cs (GetArgumentTypes): Faster implementation.
9302 2004-06-18 Martin Baulig <martin@ximian.com>
9304 * attribute.cs (Attribute.Resolve): Check whether we're an
9305 EmptyCast which a Constant child. Fixes #60333.
9307 2004-06-17 Ben Maurer <bmaurer@ximian.com>
9309 * statement.cs (EmitCollectionForeach): Account for the fact that
9310 not all valuetypes are in areas which we can take the address of.
9311 For these variables, we store to a temporary variable. Also, make
9312 sure that we dont emit a `callvirt' on a valuetype method.
9314 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9316 * expression.cs (StackAlloc.DoReSolve): Added test for
9317 negative parameter (CS0247).
9319 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9322 * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
9324 2004-06-15 Marek Safar <marek.safar@seznam.cz>
9327 * expression.cs: (Binary.DoNumericPromotions): Added conversion for
9330 2004-06-14 Marek Safar <marek.safar@seznam.cz>
9332 Fix bug #58254 & cs1555.cs, cs1556.cs
9333 * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
9335 2004-06-14 Marek Safar <marek.safar@seznam.cz>
9337 * cs-parser.jay: Added error CS1669 test for indexers.
9339 2004-06-18 Martin Baulig <martin@ximian.com>
9341 * generics.cs (GenericMethod.ctor): Don't take an Attributes
9342 argument. Fixes #60441.
9344 2004-06-16 Ben Maurer <bmaurer@ximian.com>
9345 * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
9346 The name needs to have the actual name of the method in order
9347 for other tests (such as the one in OverloadResolve for Invoke
9348 on a delegate) to work. As well, it does not really help
9349 error reporting because the method group had multiple methods.
9350 * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
9351 Make profiling work.
9353 2004-06-13 Martin Baulig <martin@ximian.com>
9355 * cs-parser.jay: Don't allow generic attributes.
9357 2004-06-13 Martin Baulig <martin@ximian.com>
9359 * class.cs (MemberBase.DoDefineBase): New protected method.
9360 (MemberBase.DoDefine): Compute the `flags' in the new
9361 DoDefineBase() which must be called first.
9362 (Method.Define): Call DoDefineBase() first so we have the flags
9363 when defining the generic method.
9365 * cs-parser.jay (interface_method_declaration): Support generic methods.
9367 2004-06-13 Martin Baulig <martin@ximian.com>
9369 * decl.cs (TypeName): Removed.
9370 (MemberName): Removed TypeName and MemberNow; now we just have
9373 * cs-parser.jay: Don't distinguish between type arguments and type
9374 parameters in the grammar and simplified the rules a bit. The
9375 reduce/reduce conflicts are now gone (except the one we inherited
9378 2004-06-11 Martin Baulig <martin@ximian.com>
9380 * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9381 call this twice: for params and varargs methods.
9383 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9386 (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9388 2004-06-11 Marek Safar <marek.safar@seznam.cz>
9390 * attribute.cs (Attribute.GetValidTargets): Made public.
9393 (AbstractPropertyEventMethod): New class for better code sharing.
9394 (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
9396 (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
9398 2004-06-09 Martin Baulig <martin@ximian.com>
9400 * cs-parser.jay: Removed a reduce/reduce conflict.
9402 2004-06-03 Martin Baulig <martin@ximian.com>
9404 * generic.cs (ConstructedType.GetMemberAccess): Renamed to
9405 GetSimpleName() and return a SimpleName.
9407 * ecore.cs (SimpleName.Arguments): New public field.
9408 (SimpleName): Added overloaded ctor which takes an additional
9409 TypeArguments argument.
9410 (SimpleName.SimpleNameResolve): Added support for generic methods.
9411 (MethodGroupExpr.ResolveGeneric): New public method. The code was
9412 formerly in MemberAccess.DoResolve(), but we also need it in
9413 SimpleNameResolve().
9415 * expression.cs (MemberAccess.DoResolve): Use the new
9416 MethodGroupExpr.ResolveGeneric().
9418 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9420 * decl.cs: If possible, use lookuptypedirect here. We can only do
9421 this if there is no `.' after the namespace. Avoids using
9422 LookupType, which does lots of slow processing.
9423 (FindNestedType) New method, does what it says :-).
9424 * namespace.cs: use LookupTypeDirect.
9425 * rootcontext.cs: use membercache, if possible.
9426 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9428 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9431 According to the spec,
9433 In a member access of the form E.I, if E is a single identifier,
9434 and if the meaning of E as a simple-name (§7.5.2) is a constant,
9435 field, property, localvariable, or parameter with the same type as
9436 the meaning of E as a type-name (§3.8), then both possible
9437 meanings of E are permitted.
9439 We did not check that E as a simple-name had the same type as E as
9442 This trivial check gives us 5-7% on bootstrap time.
9444 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9446 * expression.cs (Invocation.OverloadResolve): Avoid the
9447 use of hashtables and boxing here by allocating on demand.
9449 2004-05-30 Martin Baulig <martin@ximian.com>
9451 * rootcontext.cs (RootContext.LookupType): Don't cache things if
9452 we're doing a silent lookup. Don't try to lookup nested types in
9453 TypeManager.object_type (thanks to Ben Maurer).
9455 2004-05-30 Martin Baulig <martin@ximian.com>
9457 Committing a patch from Ben Maurer.
9459 * rootcontext.cs (RootContext.LookupType): Cache negative results.
9461 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9463 * convert.cs: add a trivial cache for overload operator resolution.
9465 2004-05-31 Marek Safar <marek.safar@seznam.cz>
9468 (AttributeTester.GetObsoleteAttribute): Returns instance of
9469 ObsoleteAttribute when type is obsolete.
9472 (TypeContainer.VerifyObsoleteAttribute): Override.
9473 (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
9474 (MethodCode.VerifyObsoleteAttribute): Override.
9475 (MemberBase.VerifyObsoleteAttribute): Override.
9478 (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
9479 and report proper error.
9482 (Delegate.VerifyObsoleteAttribute): Override.
9485 (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
9486 and report proper error.
9487 (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
9490 (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
9494 (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
9495 New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
9496 Added test for ObsoleteAttribute.
9499 (Catch): Derived from Statement.
9501 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9503 * decl.cs: If possible, use lookuptypedirect here. We can only do
9504 this if there is no `.' after the namespace. Avoids using
9505 LookupType, which does lots of slow processing.
9506 (FindNestedType) New method, does what it says :-).
9507 * namespace.cs: use LookupTypeDirect.
9508 * rootcontext.cs: use membercache, if possible.
9509 * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9511 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9514 According to the spec,
9516 In a member access of the form E.I, if E is a single identifier,
9517 and if the meaning of E as a simple-name (§7.5.2) is a constant,
9518 field, property, localvariable, or parameter with the same type as
9519 the meaning of E as a type-name (§3.8), then both possible
9520 meanings of E are permitted.
9522 We did not check that E as a simple-name had the same type as E as
9525 This trivial check gives us 5-7% on bootstrap time.
9527 2004-05-30 Marek Safar <marek.safar@seznam.cz>
9529 Fixed bug #59071 & cs0160.cs
9530 * statement.cs (Try.Resolve): Check here whether order of catch
9531 clauses matches their dependencies.
9533 2004-05-30 Marek Safar <marek.safar@seznam.cz>
9536 * ecore.cs (SimpleName.SimpleNameResolve): Added test for
9539 2004-05-30 Ben Maurer <bmaurer@users.sourceforge.net>
9541 * expression.cs (Invocation.OverloadResolve): Avoid the
9542 use of hashtables and boxing here by allocating on demand.
9544 2004-05-30 Martin Baulig <martin@ximian.com>
9546 * rootcontext.cs (RootContext.LookupType): Don't cache things if
9547 we're doing a silent lookup. Don't try to lookup nested types in
9548 TypeManager.object_type (thanks to Ben Maurer).
9550 2004-05-30 Martin Baulig <martin@ximian.com>
9552 Committing a patch from Ben Maurer.
9554 * rootcontext.cs (RootContext.LookupType): Cache negative results.
9556 2004-05-29 Martin Baulig <martin@ximian.com>
9558 * class.cs (IMethodData.ShouldIgnore): New method.
9560 * typemanager.cs (TypeManager.MethodFlags): Don't take a
9561 `Location' argument, we don't need it anywhere. Use
9562 `IMethodData.ShouldIgnore ()' instead of
9563 `MethodData.GetMethodFlags ()'.
9564 (TypeManager.AddMethod): Removed.
9565 (TypeManager.AddMethod2): Renamed to AddMethod.
9567 2004-05-29 Martin Baulig <martin@ximian.com>
9569 Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9571 * convert.cs (Convert.ImplicitReferenceConversion): If we're
9572 converting from a class type S to an interface type and we already
9573 have an object on the stack, don't box it again. Fixes #52578.
9575 2004-05-29 Martin Baulig <martin@ximian.com>
9577 * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9578 Added support for `params' parameters. Fixes #59267.
9580 2004-05-29 Martin Baulig <martin@ximian.com>
9582 * literal.cs (NullPointer): Provide a private .ctor which sets
9583 `type' to TypeManager.object_type. Fixes #59048.
9585 2004-05-29 Martin Baulig <martin@ximian.com>
9587 * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9588 EventExpr, set `ee.InstanceExpression = left'. Fixes #59188.
9590 * ecore.cs (EventExpr.instance_expr): Make the field private.
9592 2004-05-26 Marek Safar <marek.safar@seznam.cz>
9594 Fixed bug #50080 & cs0214-2.cs
9595 * expression.cs (Cast.DoResolve): Check unsafe context here.
9597 * statement.cs (Resolve.DoResolve): Likewise.
9599 2004-05-26 Martin Baulig <martin@ximian.com>
9601 * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9603 * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9604 (RootContext.LookupType): Pass down the `silent' flag.
9606 2004-05-25 Martin Baulig <martin@ximian.com>
9609 (MethodGroupExpr.IdenticalTypeName): New public property.
9610 (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9611 expression actually refers to a type.
9613 2004-05-25 Martin Baulig <martin@ximian.com>
9615 * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9616 for #56176 and made it actually work.
9618 2004-05-25 Martin Baulig <martin@ximian.com>
9620 * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9621 (FieldExpr, PropertyExpr): Override and implement
9622 CacheTemporaries. Fixes #52279.
9624 2004-05-25 Miguel de Icaza <miguel@ximian.com>
9626 * location.cs: In the new compiler listing a file twice is a
9627 warning, not an error.
9629 2004-05-24 Martin Baulig <martin@ximian.com>
9631 * enum.cs (Enum.DefineType): For the `BaseType' to be a
9632 TypeLookupExpression; otherwise, report a CS1008. Fixes #58571.
9634 2004-05-24 Martin Baulig <martin@ximian.com>
9636 * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9637 walking the `using' list. Fixes #53921.
9639 2004-05-24 Martin Baulig <martin@ximian.com>
9641 * const.cs (Const.LookupConstantValue): Added support for
9642 EmptyCast's; fixes #55251.
9644 2004-05-24 Martin Baulig <martin@ximian.com>
9646 * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9647 DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9648 which does the CS0135 check. The reason is that we first need to
9649 check whether the variable actually exists.
9651 2004-05-24 Martin Baulig <martin@ximian.com>
9653 * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9654 than RootContext.LookupType() to find the explicit interface
9657 2004-05-24 Raja R Harinath <rharinath@novell.com>
9659 * Makefile: Simplify. Use executable.make.
9660 * mcs.exe.sources: New file. List of sources of mcs.exe.
9662 2004-05-24 Anders Carlsson <andersca@gnome.org>
9666 Use the invariant culture when doing String.Compare for CLS case
9669 2004-05-23 Martin Baulig <martin@ximian.com>
9671 * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9672 don't have any dots. Fixes #52622, added cs0246-8.cs.
9674 * namespace.cs (NamespaceEntry.Lookup): Likewise.
9676 2004-05-23 Marek Safar <marek.safar@seznam.cz>
9678 * class.cs (MemberBase.Define): Reuse MemberType member for
9679 resolved type. Other methods can use it too.
9681 2004-05-23 Martin Baulig <martin@ximian.com>
9683 * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9684 the variable also exists in the current block (otherwise, we need
9685 to report a CS0103). Fixes #58670.
9687 2004-05-23 Martin Baulig <martin@ximian.com>
9689 * flowanalysis.cs (Reachability.Reachable): Compute this
9690 on-the-fly rather than storing it as a field.
9692 2004-05-23 Martin Baulig <martin@ximian.com>
9694 * flowanalysis.cs (Reachability.And): Manually compute the
9695 resulting `barrier' from the reachability.
9697 2004-05-23 Marek Safar <marek.safar@seznam.cz>
9700 * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9701 instance of ObsoleteAttribute when symbol is obsolete.
9704 (IMethodData): Extended interface for ObsoleteAttribute support.
9706 2004-05-22 Marek Safar <marek.safar@seznam.cz>
9708 * attribute.cs: Fix bug #55970
9710 2004-05-22 Marek Safar <marek.safar@seznam.cz>
9714 (GetObsoleteAttribute): New method. Creates the instance of
9716 (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9717 ObsoleteAttribute when member is obsolete.
9718 (AttributeTester.Report_ObsoleteMessage): Common method for
9719 Obsolete error/warning reporting.
9722 (TypeContainer.base_classs_type): New member for storing parent type.
9725 (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9726 for this MemberCore.
9728 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9730 * attribute.cs, const.cs: Fix bug #58590
9732 2004-05-21 Martin Baulig <martin@ximian.com>
9734 * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9735 out parameters if the end of the method is unreachable. Fixes
9738 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9740 * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9741 Hari was right, why extra method.
9743 2004-05-21 Marek Safar <marek.safar@seznam.cz>
9745 * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9747 2004-05-20 Martin Baulig <martin@ximian.com>
9749 * delegate.cs: Convert this file to Unix mode - like the original
9752 2004-05-20 Martin Baulig <martin@ximian.com>
9754 * attribute.cs: Convert this file to Unix mode - like the original
9757 2004-05-19 Marek Safar <marek.safar@seznam.cz>
9759 Fix bug #58688 (MCS does not report error when the same attribute
9762 * attribute.cs (Attribute.Emit): Distinction between null and default.
9764 2004-05-19 Raja R Harinath <rharinath@novell.com>
9766 * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9767 of a top-level attribute without an attribute target.
9768 * attribute.cs (Attribute.Error_AttributeConstructorMismatch):
9770 (Attribute.Conditional_GetConditionName),
9771 (Attribute.Obsolete_GetObsoleteMessage): Update.
9772 (Attribute.IndexerName_GetIndexerName): New. Attribute-specific
9773 part of ScanForIndexerName.
9774 (Attribute.CanIgnoreInvalidAttribute): New function.
9775 (Attribute.ScanForIndexerName): Move to ...
9776 (Attributes.ScanForIndexerName): ... here.
9777 (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9778 (Attributes.Search): New internal variant that can choose not to
9779 complain if types aren't resolved. The original signature now
9781 (Attributes.GetClsCompliantAttribute): Use internal variant, with
9782 complaints suppressed.
9783 (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9784 only if it not useful.
9785 (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9786 top-level for attributes that are shared between the assembly
9787 and a top-level class.
9788 * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9789 * class.cs: Update to reflect changes.
9790 (DefineIndexers): Fuse loops.
9791 * codegen.cs (GetAssemblyName): Update to reflect changes. Accept
9792 a couple more variants of attribute names.
9794 2004-05-18 Marek Safar <marek.safar@seznam.cz>
9796 Fix bug #52585 (Implemented explicit attribute declaration)
9799 (Attributable.ValidAttributeTargets): New abstract method. It gets
9800 list of valid attribute targets for explicit target declaration.
9801 (Attribute.Target): It holds target itself.
9802 (AttributeSection): Removed.
9803 (Attribute.CheckTargets): New method. It checks whether attribute
9804 target is valid for the current element.
9807 (EventProperty): New class. For events that are declared like
9808 property (with add and remove accessors).
9809 (EventField): New class. For events that are declared like field.
9812 * cs-parser.jay: Implemented explicit attribute target declaration.
9814 * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:
9815 Override ValidAttributeTargets.
9818 (ReturnParameter): Class for applying custom attributes on
9820 (ParameterAtribute): New class. Class for applying custom
9821 attributes on the parameter type.
9823 2004-05-17 Miguel de Icaza <miguel@ximian.com>
9825 * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9828 (Method): Allow UNSAFE here.
9830 * modifiers.cs: Support unsafe reporting.
9832 2004-05-17 Marek Safar <marek.safar@seznam.cz>
9834 * decl.cs: Fix bug #58478.
9836 2004-05-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9838 * statement.cs: When checking for unreachable code on an EmptyStatement,
9839 set the location. Fixes bug #58488.
9841 2004-05-13 Miguel de Icaza <miguel@ximian.com>
9843 * driver.cs: Add -pkg handling.
9845 From Gonzalo: UseShelLExecute=false
9847 2004-05-12 Marek Safar <marek.safar@seznam.cz>
9850 (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9852 (Attribute.IsClsCompliaceRequired): Moved to base for better
9854 (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9855 when attribute is AttributeUsageAttribute.
9856 (Attribute.GetValidTargets): Simplified.
9857 (Attribute.GetAttributeUsage): New method returns AttributeUsage
9858 attribute for this type.
9859 (Attribute.ApplyAttributes): Method renamed to Emit and make
9861 (GlobalAttributeSection): New class for special handling of global
9862 attributes (assembly, module).
9863 (AttributeSection.Emit): New method.
9865 * class.cs: Implemented Attributable abstract methods.
9866 (MethodCore.LabelParameters): Moved to Parameter class.
9867 (Accessor): Is back simple class.
9868 (PropertyMethod): Implemented Attributable abstract class.
9869 (DelegateMethod): Implemented Attributable abstract class.
9870 (Event): New constructor for disctintion between normal Event
9871 and Event with accessors.
9873 * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9875 * codegen.cs, const.cs, decl.cs, delegate.cs:
9876 (CommonAssemblyModulClass): Implemented Attributable abstract class
9879 * enum.cs: Implement IAttributeSupport interface.
9880 (EnumMember): New class for emum members. Implemented Attributable
9884 (ParameterBase): Is abstract.
9885 (ReturnParameter): New class for easier [return:] attribute handling.
9887 * typemanager.cs: Removed builder_to_attr.
9889 2004-05-11 Raja R Harinath <rharinath@novell.com>
9892 * attribute.cs (Attribute.GetPositionalValue): New function.
9893 * class.cs (TypeContainer.VerifyMembers): New function.
9894 (TypeContainer.Emit): Use it.
9895 (ClassOrStruct): New base class for Class and Struct.
9896 (ClassOrStruct.ApplyAttributeBuilder): New function. Note if
9897 StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9899 (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9900 then each non-static field should have a FieldOffset attribute.
9901 Otherwise, none of the fields should have a FieldOffset attribute.
9902 * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout
9903 and FieldOffset attributes.
9904 * typemanager.cs (TypeManager.struct_layout_attribute_type)
9905 (TypeManager.field_offset_attribute_type): New core types.
9906 (TypeManager.InitCoreTypes): Initialize them.
9908 2004-05-11 Michal Moskal <malekith@pld-linux.org>
9910 * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9911 Return correct type.
9914 2004-05-09 Miguel de Icaza <miguel@ximian.com>
9916 * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9917 be implicitly converted to ulong.
9919 * expression.cs: The logic for allowing operator &, | and ^ worked
9920 was wrong, it worked before because we did not report an error in
9921 an else branch. Fixes 57895.
9923 * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9924 allow volatile fields to be reference types.
9926 2004-05-07 Miguel de Icaza <miguel@ximian.com>
9928 * driver.cs: Add support for /debug-
9930 2004-05-07 Raja R Harinath <rharinath@novell.com>
9932 * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType):
9933 Add a 'complain' parameter to silence errors.
9934 (Attribute.Resolve): Update to changes. Put in sanity check to catch
9935 silently overlooked type-resolutions.
9936 (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9938 (Attributes.Search): New function.
9939 (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9940 (Attributes.GetAttributeFullName): Remove hack.
9941 * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes):
9942 Update to reflect changes.
9943 * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9944 Use Attributes.Search instead of nested loops.
9946 2004-05-07 Marek Safar <marek.safar@seznam.cz>
9949 (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9950 (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9951 (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9953 * report.cs: (Report.Warning): Renamed to Warning_T because of
9954 parameter collision.
9956 2004-05-05 Raja R Harinath <rharinath@novell.com>
9958 * expression.cs (MemberAccess.ResolveMemberAccess):
9959 Exit with non-zero status after Report.Error.
9960 * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9962 * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9964 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9966 * support.cs: Don't hang when the file is empty.
9968 2004-05-04 Lluis Sanchez Gual <lluis@ximian.com>
9970 * support.cs: In SeekableStreamReader, compute the preamble size of the
9971 underlying stream. Position changes should take into account that initial
9974 2004-05-03 Todd Berman <tberman@sevenl.net>
9976 * driver.cs: remove unused GetSysVersion function.
9978 2004-05-03 Todd Berman <tberman@sevenl.net>
9980 * driver.cs: Remove the hack from saturday, as well as the hack
9981 from jackson (LoadAssemblyFromGac), also adds the CWD to the
9982 link_paths to get that bit proper.
9984 2004-05-01 Todd Berman <tberman@sevenl.net>
9986 * driver.cs: Try a LoadFrom before a Load, this checks the current
9987 path. This is currently a bug in mono that is be fixed, however, this
9988 provides a workaround for now. This will be removed when the bug
9991 2004-05-01 Sebastien Pouliot <sebastien@ximian.com>
9993 * CryptoConvert.cs: Updated to latest version. Fix issue with
9994 incomplete key pairs (#57941).
9996 2004-05-01 Todd Berman <tberman@sevenl.net>
9998 * driver.cs: Remove '.' from path_chars, now System.* loads properly
10001 2004-04-30 Jackson Harper <jackson@ximian.com>
10003 * codegen.cs: Open keys readonly.
10005 2004-04-30 Gonzalo Paniagua Javier <gonzalo@ximian.com>
10007 * typemanager.cs: don't report cyclic struct layout when a struct
10008 contains 2 or more fields of the same type. Failed for Pango.AttrShape
10009 which has 2 Pango.Rectangle fields.
10011 2004-04-29 Ben Maurer <bmaurer@users.sourceforge.net>
10013 * expression.cs: Handle IntPtr comparisons with IL code
10014 rather than a method call.
10016 2004-04-29 Martin Baulig <martin@ximian.com>
10018 * ecore.cs (PropertyExpr.FindAccessor): New private method. Walk
10019 the list of PropertyInfo's in class hierarchy and find the
10020 accessor. Fixes #56013.
10022 2004-04-29 Martin Baulig <martin@ximian.com>
10024 * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
10026 2004-04-29 Martin Baulig <martin@ximian.com>
10028 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10030 * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
10032 2004-04-29 Martin Baulig <martin@ximian.com>
10034 * class.cs (ConstructorInitializer.Resolve): Check whether the
10035 parent .ctor is accessible. Fixes #52146.
10037 2004-04-29 Martin Baulig <martin@ximian.com>
10039 Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10041 * statement.cs (Using.EmitLocalVariableDecls): Use
10042 TypeManager.idisposable_type, not typeof (IDisposable).
10043 (Foreach.EmitCollectionForeach): Added support for valuetypes.
10045 2004-04-29 Martin Baulig <martin@ximian.com>
10047 * class.cs (Event.Define): Don't emit the field and don't set
10048 RTSpecialName and SpecialName for events on interfaces. Fixes
10051 2004-04-29 Raja R Harinath <rharinath@novell.com>
10053 Refactor Attribute.ApplyAttributes.
10054 * attribute.cs (Attributable): New base class for objects that can
10055 have Attributes applied on them.
10056 (Attribute): Make AttributeUsage fields public.
10057 (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
10058 (Attribute.IsInternalCall): New property.
10059 (Attribute.UsageAttr): Convert to a public read-only property.
10060 (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
10061 (Attribute.ResolveType, Attribute.Resolve)
10062 (Attribute.ScanForIndexerName): Update to reflect changes.
10063 (Attribute.CheckAttributeTarget): Re-format.
10064 (Attribute.ApplyAttributes): Refactor, to various
10065 Attributable.ApplyAttributeBuilder methods.
10066 * decl.cs (MemberCore): Make Attributable.
10067 * class.cs (Accessor): Make Attributable.
10068 (MethodData.ApplyAttributes): Use proper attribute types, not
10070 (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
10071 (TypeContainer.ApplyAttributeBuilder)
10072 (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
10073 (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)
10074 (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
10075 (Operator.ApplyAttributeBuilder): New factored-out methods.
10076 * const.cs (Const.ApplyAttributeBuilder): Likewise.
10077 * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
10078 * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
10079 * parameter.cs (ParameterBase): New Attributable base class
10080 that can also represent Return types.
10081 (Parameter): Update to the changes.
10083 2004-04-29 Jackson Harper <jackson@ximian.com>
10085 * driver.cs: Prefer the corlib system version when looking for
10086 assemblies in the GAC. This is still a hack, but its a better hack
10089 2004-04-29 Marek Safar <marek.safar@seznam.cz>
10091 * decl.cs, enum.cs: Improved error 3005 reporting.
10093 * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
10094 (related_symbols): New private member for list of symbols
10095 related to reported error/warning.
10097 * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
10099 2004-04-29 Martin Baulig <martin@ximian.com>
10101 * ecore.cs (Expression.Constantify): If we're an enum and
10102 TypeManager.TypeToCoreType() doesn't give us another type, use
10103 t.UnderlyingSystemType. Fixes #56178.
10105 2004-04-29 Martin Baulig <martin@ximian.com>
10107 * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
10108 interfaces and for each interface, only add members directly
10109 declared in that interface. Fixes #53255.
10111 2004-04-28 Martin Baulig <martin@ximian.com>
10113 * expression.cs (ConditionalLogicalOperator): Use a temporary
10114 variable for `left' to avoid that we evaluate it more than once;
10117 2004-04-28 Martin Baulig <martin@ximian.com>
10119 * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
10122 2004-04-28 Martin Baulig <martin@ximian.com>
10124 * statement.cs (LocalInfo.Resolve): Check whether the type is not
10127 * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
10128 whether the type is not void (CS1547).
10130 2004-04-28 Martin Baulig <martin@ximian.com>
10132 * expression.cs (Unary.DoResolveLValue): Override this and report
10133 CS0131 for anything but Operator.Indirection.
10135 2004-04-28 Martin Baulig <martin@ximian.com>
10137 Committing a patch from Ben Maurer; see bug #50820.
10139 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10142 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10145 2004-04-28 Martin Baulig <martin@ximian.com>
10147 Committing a patch from Ben Maurer; see bug #50820.
10149 * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10152 * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10155 2004-04-28 Martin Baulig <martin@ximian.com>
10157 * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
10158 (Block.AddLabel): Call DoLookupLabel() to only search in the
10161 2004-04-28 Martin Baulig <martin@ximian.com>
10163 * cfold.cs (ConstantFold.BinaryFold): Added special support for
10164 comparing StringConstants and NullLiterals in Equality and Inequality.
10166 2004-04-28 Jackson Harper <jackson@ximian.com>
10168 * driver.cs: Attempt to load referenced assemblies from the
10169 GAC. This is the quick and dirty version of this method that
10170 doesnt take into account versions and just takes the first
10171 canidate found. Will be good enough for now as we will not have more
10172 then one version installed into the GAC until I update this method.
10174 2004-04-28 Martin Baulig <martin@ximian.com>
10176 * typemanager.cs (TypeManager.CheckStructCycles): New public
10177 static method to check for cycles in the struct layout.
10179 * rootcontext.cs (RootContext.PopulateTypes): Call
10180 TypeManager.CheckStructCycles() for each TypeContainer.
10181 [Note: We only need to visit each type once.]
10183 2004-04-28 Martin Baulig <martin@ximian.com>
10185 * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
10187 * const.cs (Const.LookupConstantValue): Return a `bool' signalling
10188 success and added `out object value'. Use a `bool resolved' field
10189 to check whether we've already been called rather than
10190 `ConstantValue != null' since this breaks for NullLiterals.
10192 2004-04-28 Raja R Harinath <rharinath@novell.com>
10194 * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
10195 setting of this flag, since the 'set' method may be non-public.
10197 2004-04-28 Raja R Harinath <rharinath@novell.com>
10199 * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
10200 check on current_vector.Block.
10202 2004-04-27 Martin Baulig <martin@ximian.com>
10204 * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
10205 a field initializer. Fixes #56459.
10207 2004-04-27 Martin Baulig <martin@ximian.com>
10209 * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
10210 we're not attempting to use an indexer. Fixes #52154.
10212 2004-04-27 Martin Baulig <martin@ximian.com>
10214 * statement.cs (Return): Don't create a return label if we don't
10215 need it; reverts my change from January 20th. Thanks to Ben
10218 2004-04-27 Martin Baulig <martin@ximian.com>
10220 According to the spec, `goto' can only leave a nested scope, but
10223 * statement.cs (Block.LookupLabel): Only lookup in the current
10224 block, don't recurse into parent or child blocks.
10225 (Block.AddLabel): Check in parent and child blocks, report
10226 CS0140/CS0158 if we find a duplicate.
10227 (Block): Removed this indexer for label lookups.
10228 (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
10229 this already does the error reporting for us.
10232 (FlowBranching.UsageVector.Block): New public variable; may be null.
10233 (FlowBranching.CreateSibling): Added `Block' argument.
10234 (FlowBranching.LookupLabel): New public virtual method. Lookup a
10235 label for the target of a `goto' and check whether we're not
10236 leaving a `finally'.
10238 2004-04-27 Martin Baulig <martin@ximian.com>
10240 * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10241 a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
10244 2004-04-27 Martin Baulig <martin@ximian.com>
10246 * statement.cs (Block.AddLabel): Also check for implicit blocks
10247 and added a CS0158 check.
10249 2004-04-27 Martin Baulig <martin@ximian.com>
10251 * flowanalysis.cs (FlowBranchingLoop): New class.
10252 (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
10253 UsageVector's instead of an ArrayList.
10254 (FlowBranching.Label): Likewise.
10255 (FlowBranching.UsageVector.MergeBreakOrigins): New method.
10256 (FlowBranching.AddBreakVector): New method.
10258 2004-04-27 Miguel de Icaza <miguel@ximian.com>
10260 * attribute.cs: Small regression fix: only convert the type if we
10261 the type is different, fixes System.Drawing build.
10263 2004-04-27 Martin Baulig <martin@ximian.com>
10265 * attribute.cs (Attribute.Resolve): If we have a constant value
10266 for a named field or property, implicity convert it to the correct
10269 2004-04-27 Raja R Harinath <rharinath@novell.com>
10271 * statement.cs (Block.Block): Implicit blocks share
10272 'child_variable_names' fields with parent blocks.
10273 (Block.AddChildVariableNames): Remove.
10274 (Block.AddVariable): Mark variable as "used by a child block" in
10275 every surrounding block.
10276 * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
10277 been used in a child block, complain about violation of "Invariant
10278 meaning in blocks" rule.
10279 * cs-parser.jay (declare_local_variables): Don't use
10280 AddChildVariableNames.
10281 (foreach_statement): Don't create an implicit block: 'foreach'
10282 introduces a scope.
10284 2004-04-23 Miguel de Icaza <miguel@ximian.com>
10286 * convert.cs (ImplicitNumericConversion): 0 is also positive when
10287 converting from 0L to ulong. Fixes 57522.
10289 2004-04-22 Marek Safar <marek.safar@seznam.cz>
10291 * decl.cs (FindMemberToOverride): Fix wrong warning for case when
10292 derived class hides via 'new' keyword field from base class (test-242.cs).
10293 TODO: Handle this in the more general way.
10295 * class.cs (CheckBase): Ditto.
10297 2004-04-22 Marek Safar <marek.safar@seznam.cz>
10299 * decl.cs (caching_flags): New member for storing cached values
10301 (MemberCore.Flags): New enum where bit flags for caching_flags
10303 (MemberCore.cls_compliance): Moved to caching_flags.
10304 (DeclSpace.Created): Moved to caching_flags.
10306 * class.cs: Use caching_flags instead of DeclSpace.Created
10308 2004-04-21 Miguel de Icaza <miguel@ximian.com>
10310 * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
10311 if we are only a derived class, not a nested class.
10313 * typemanager.cs: Same as above, but do this at the MemberLookup
10314 level (used by field and methods, properties are handled in
10315 PropertyExpr). Allow for the qualified access if we are a nested
10318 2004-04-21 Marek Safar <marek.safar@seznam.cz>
10320 * class.cs: Refactoring.
10321 (IMethodData): New inteface; Holds links to parent members
10322 to avoid member duplication (reduced memory allocation).
10323 (Method): Implemented IMethodData interface.
10324 (PropertyBase): New inner classes for get/set methods.
10325 (PropertyBase.PropertyMethod): Implemented IMethodData interface
10326 (Event): New inner classes for add/remove methods.
10327 (Event.DelegateMethod): Implemented IMethodData interface.
10329 * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
10330 EmitContext (related to class.cs refactoring).
10332 2004-04-21 Raja R Harinath <rharinath@novell.com>
10334 * delegate.cs (Delegate.VerifyApplicability): If the number of
10335 arguments are the same as the number of parameters, first try to
10336 verify applicability ignoring any 'params' modifier on the last
10340 2004-04-08 Martin Baulig <martin@ximian.com>
10342 Merged latest changes into gmcs. Please keep this comment in
10343 here, it makes it easier for me to see what changed in MCS since
10344 the last time I merged.
10346 2004-04-16 Raja R Harinath <rharinath@novell.com>
10348 * class.cs (TypeContainer.AddIndexer): Use
10349 'ExplicitInterfaceName' to determine if interface name was
10350 explicitly specified. 'InterfaceType' is not initialized at this time.
10351 (TypeContainer.DefineIndexers): Remove use of temporary list. The
10352 Indexers array is already in the required order. Initialize
10353 'IndexerName' only if there are normal indexers.
10354 (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10355 (TypeContainer.Emit): Emit DefaultMember attribute only if
10356 IndexerName is initialized.
10359 2004-04-15 Benjamin Jemlich <pcgod@gmx.net>
10361 * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10364 2004-04-15 Raja R Harinath <rharinath@novell.com>
10366 * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10370 * attribute.cs (Attribute.Resolve): Check for duplicate named
10374 2004-04-15 Miguel de Icaza <miguel@ximian.com>
10376 * iterators.cs (MarkYield): track whether we are in an exception,
10377 and generate code accordingly. Use a temporary value to store the
10378 result for our state.
10380 I had ignored a bit the interaction of try/catch with iterators
10381 since their behavior was not entirely obvious, but now it is
10382 possible to verify that our behavior is the same as MS .NET 2.0
10386 2004-04-14 Miguel de Icaza <miguel@ximian.com>
10388 * iterators.cs: Avoid creating temporaries if there is no work to
10391 * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10392 Enumerations, use TypeManager.EnumToUnderlying and call
10395 Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10398 (This.Emit): Use EmitContext.EmitThis to emit our
10401 (This.EmitAssign): Ditto.
10403 * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
10404 codepaths, we will move all the functionality into
10407 (FieldExpr.EmitAssign): Ditto.
10409 This fixes several hidden bugs that I uncovered while doing a code
10410 review of this today.
10412 * codegen.cs (EmitThis): reworked so the semantics are more clear
10413 and also support value types "this" instances.
10415 * iterators.cs: Changed so that for iterators in value types, we
10416 do not pass the value type as a parameter.
10418 Initialization of the enumerator helpers is now done in the caller
10419 instead of passing the parameters to the constructors and having
10420 the constructor set the fields.
10422 The fields have now `assembly' visibility instead of private.
10424 2004-04-11 Miguel de Icaza <miguel@ximian.com>
10426 * expression.cs (Argument.Resolve): Check if fields passed as ref
10427 or out are contained in a MarshalByRefObject.
10429 * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
10430 another compiler type.
10432 2004-04-06 Ben Maurer <bmaurer@users.sourceforge.net>
10434 * class.cs (Indexer.Define): use the new name checking method.
10435 Also, return false on an error.
10436 * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
10437 (is_identifier_[start/part]_character): make static.
10439 2004-04-10 Miguel de Icaza <miguel@ximian.com>
10441 * expression.cs (Binary.ResolveOperator): Do no append strings
10442 twice: since we can be invoked more than once (array evaluation)
10443 on the same concatenation, take care of this here. Based on a fix
10444 from Ben (bug #56454)
10446 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
10448 * codegen.cs: Fix another case where CS1548 must be reported (when
10449 delay-sign isn't specified and no private is available #56564). Fix
10450 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
10451 error when MCS is used on the MS runtime and we need to delay-sign
10452 (which seems unsupported by AssemblyBuilder - see #56621).
10454 2004-04-08 Marek Safar <marek.safar@seznam.cz>
10456 * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
10457 (TypeManager.ComputeNamespaces): Faster implementation for
10460 * compiler.csproj: Updated AssemblyName to mcs.
10462 2004-05-11 Jackson Harper <jackson@ximian.com>
10464 * Makefile: Preserve MONO_PATH
10466 2004-05-11 Jackson Harper <jackson@ximian.com>
10468 * Makefile: Use mono and mcs to build gmcs
10470 2004-05-03 Miguel de Icaza <miguel@ximian.com>
10472 * codegen.cs: Add patch from Robert Shade
10473 <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
10476 2004-05-02 Sebastien Pouliot <sebastien@ximian.com>
10478 * CryptoConvert.cs: Updated to latest version. Fix issue with
10479 incomplete key pairs (#57941).
10481 2004-04-08 Sebastien Pouliot <sebastien@ximian.com>
10483 * codegen.cs: Fix another case where CS1548 must be reported (when
10484 delay-sign isn't specified and no private is available #56564). Fix
10485 loading the ECMA "key" to delay-sign an assembly. Report a CS1548
10486 error when MCS is used on the MS runtime and we need to delay-sign
10487 (which seems unsupported by AssemblyBuilder - see #56621).
10489 2004-04-29 Jackson Harper <jackson@ximian.com>
10491 * Makefile: Set MONO_PATH to use the bootstrap corlib
10492 * driver.cs: Check the GAC for referenced assemblies.
10494 2004-04-29 Martin Baulig <martin@ximian.com>
10496 * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
10498 2004-04-07 Martin Baulig <martin@ximian.com>
10500 * expression.cs (Binary.ResolveOperator): Added special case for
10501 Equality/Inequality between a type parameter and a null literal.
10503 2004-04-07 Martin Baulig <martin@ximian.com>
10505 * convert.cs: Check null literal -> type parameter conversions.
10507 2004-04-07 Martin Baulig <martin@ximian.com>
10509 * generic.cs (ConstructedType.CheckConstraints): Enforce the
10510 `class' and `struct' constraints.
10512 2004-04-07 Martin Baulig <martin@ximian.com>
10514 * generic.cs (SpecialConstraint): New public enum.
10515 (Constraints.Resolve): Added support for the `class' and `struct'
10518 * cs-parser.jay (type_parameter_constraint): Added support for the
10519 `class' and `struct' constraints.
10521 2004-04-07 Martin Baulig <martin@ximian.com>
10523 * support.cs (GenericConstraints): Replaced `Types' by
10524 `ClassConstraint' and `InterfaceConstraints'; added
10525 `HasClassConstraint'.
10527 2004-04-07 Martin Baulig <martin@ximian.com>
10530 (Constraints.InterfaceConstraints): New public property.
10531 (Constraints.Types): Make this property public
10532 (TypeParameter): Implement IMemberContainer.
10533 (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
10534 instead of a TypeBuilder/MethodBuilder; pass the interface
10535 constraints to TypeManager.AddTypeParameter().
10536 (TypeParameter.DefineType): Just take an EmitContext and no
10537 TypeBuilder/MethodBuilder. Use the new public API.
10539 * typemanager.cs (TypeManager.AddTypeParameter): Added
10540 `TypeExpr[]' argument; add the interfaces to the
10541 `builder_to_ifaces' hash.
10542 (TypeManager.LookupMemberContainer): For
10543 GenericTypeParameterBuilders, get the TypeParameter from the
10544 `builder_to_type_param'.
10545 (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
10546 the TypeParameter and call FindMembers on it.
10548 2004-04-07 Martin Baulig <martin@ximian.com>
10551 (MethodCore.GenericMethod): Moved this field here from Method.
10552 (MethodCore.IsDuplicateImplementation): Take the number of type
10553 parameters into account if we're a generic method.
10555 * expression.cs (Invocation.InferTypeArguments): Don't return true
10556 if `arguments' is null; we still need to check whether we actually
10557 don't need to infer anything in this case.
10558 (MemberAccess): Merged the functionality from GenericMemberAccess
10561 * generic.cs (GenericMemberAccess): Removed.
10563 2004-04-05 Martin Baulig <martin@ximian.com>
10565 * decl.cs (MemberCore): For generic classes, interfaces and
10566 structs, `Name' now includes the number of type parameters
10567 ("Stack!1.Node!1").
10568 (DeclSpace.FindType): Removed the `num_type_args' argument; we now
10569 encode the number of type arguments in the type name.
10571 * expression.cs (Expression.MemberLookup): Removed the
10572 `num_type_args' argument; we now encode the number of type
10573 arguments in the type name.
10575 * ecore.cs (SimpleName): Encode the number of type arguments in
10576 the type name itself.
10578 * generic.cs (ConstructedType): Likewise.
10580 * tree.cs (Tree.RecordDecl): Take a `string' instead of a
10581 `MemberName'; we now include the number of type parameters in the
10584 * typemanager.cs (TypeManager.CheckGeneric): Removed.
10585 (TypeManager.MemberLookup): Removed the
10586 `num_type_args' argument; we now encode the number of type
10587 arguments in the type name.
10589 2004-04-03 Martin Baulig <martin@ximian.com>
10591 * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
10592 (MemberCore.MemberName): Moved here from MemberBase.
10593 (DeclSpace.SetParameterInfo): Just take the constraints as an
10594 ArrayList; we already have the type parameters in our
10595 `MemberName'; also do the CS0080 reporting here.
10597 * cs-parser.jay (struct_declaration): Use `member_name' instead of
10598 `IDENTIFIER opt_type_parameter_list'; when constructing our
10599 `MemberName', it'll already include our type parameters.
10600 (class_declaration, interface_declaration): Likewise.
10601 (delegate_declaration): Likewise.
10602 (MakeName): Take a MemberName and return a MemberName.
10603 The following two changes are required to avoid shift/reduce conflicts:
10604 (member_name): Don't include a TypeName anymore; ie. this is now
10605 just 'IDENTIFIER opt_type_parameter_list'.
10606 (property_declaration, event_declaration): Use a
10607 `namespace_or_type_name' instead of a `member_name'.
10609 2004-04-03 Martin Baulig <martin@ximian.com>
10611 * decl.cs (MemberName): Renamed to `TypeName' and created a new
10612 `MemberName' class.
10613 (TypeName): Formerly known as MemberName.
10615 * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
10616 instead of a `MemberName'.
10618 * cs-parser.jay (namespace_or_type_name): Create a TypeName.
10619 (member_name): New rule; create a MemberName.
10621 2004-04-02 Martin Baulig <martin@ximian.com>
10623 * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
10624 (CS0305 and CS0308).
10626 2004-04-02 Martin Baulig <martin@ximian.com>
10628 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
10629 support for nested types.
10631 2004-04-02 Martin Baulig <martin@ximian.com>
10633 * ecore.cs (IAlias): New public interface.
10634 (TypeExpr, TypeExpression): Implement IAlias.
10635 (TypeAliasExpression): New public class.
10637 * namespace.cs (Namespace): Implement IAlias.
10638 (Namespace.Lookup): Return an IAlias instead on an object.
10639 (Namespace.DefineName): Take an IAlias instead of an object.
10640 (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
10642 (NamespaceEntry.UsingAlias): Take a Membername instead of an
10644 (NamespaceEntry.LookupAlias): Return an IAlias instead on an
10646 (NamespaceEntry.Lookup): Likewise.
10648 * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
10651 * decl.cs (DeclSpace): Implement IAlias.
10652 (DeclSpace.LookupAlias): Return an IAlias instead of a string.
10654 * generic.cs (ConstructedType): Improved error checking.
10656 2004-04-02 Martin Baulig <martin@ximian.com>
10658 * convert.cs: Added type parameter conversions.
10661 (UnboxCast.Emit): Emit an `unbox.any' for type params.
10662 (ClassCast.Emit): If the source type is a type parameter, box it.
10663 If the target type is a type parameter, emit an `unbox.any'
10664 instead of a `classcast'.1
10666 2004-04-01 Martin Baulig <martin@ximian.com>
10668 * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
10670 2004-04-01 Martin Baulig <martin@ximian.com>
10672 * generic.cs (ConstructedType.CheckConstraints): Use
10673 Convert.ImplicitStandardConversionExists(); user-defined implicit
10674 conversions are not allowed according to the spec.
10676 2004-03-30 Martin Baulig <martin@ximian.com>
10678 * expression.cs (New): Added support for type parameters.
10681 (TypeManager.activator_type): New public static field.
10682 (TypeManager.activator_create_instance): Likewise.
10684 2004-03-30 Martin Baulig <martin@ximian.com>
10686 * typemanager.cs (TypeManager.HasConstructorConstraint): New
10689 2004-03-30 Martin Baulig <martin@ximian.com>
10691 * generic.cs (ConstructedType.CheckConstraints): Actually follow
10692 the spec here: the argument type must be convertible to the
10695 2004-03-30 Martin Baulig <martin@ximian.com>
10698 (TypeParameter.Define, TypeParameter.DefineMethod): Call
10699 TypeManager.AddTypeParameter().
10700 (ConstructedType.CheckConstraints): Re-enable this and actually
10701 check whether we have a constructor constraint.
10704 (TypeManager.builder_to_type_param): New static field.
10705 (TypeManager.AddTypeParameter): New static method.
10706 (TypeManager.LookupTypeParameter): New public method.
10708 2004-03-30 Martin Baulig <martin@ximian.com>
10710 * generic.cs (TypeParameter.DefineType): Return a boolean and use
10711 the new API to actually define the constructor constraint.
10714 (TypeManager.new_constraint_attr_type): New static field.
10715 (TypeManager.InitCoreTypes): Initialize it.
10717 2004-03-30 Martin Baulig <martin@ximian.com>
10719 * generic.cs (Constraints): Completed error checking, use correct
10722 2004-03-29 Martin Baulig <martin@ximian.com>
10724 * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
10726 * expression.cs (Invocation.InferTypeArguments): Added overloaded
10727 public version which takes a `ParameterData pd' instead of an
10730 2004-03-29 Martin Baulig <martin@ximian.com>
10732 * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
10735 2004-03-29 Martin Baulig <martin@ximian.com>
10737 * expression.cs (Argument.ResolveMethodGroup): If we're a
10738 ConstructedType, call GetMemberAccess() on it.
10740 2004-03-29 Martin Baulig <martin@ximian.com>
10742 * class.cs (MethodBase.CheckGenericOverride): New abstract method.
10743 (MethodCore.CheckGenericOverride): When overriding a generic
10744 method, check whether the constraints match.
10746 * support.cs (GenericConstraints): New public interface.
10747 (ParameterData.GenericConstraints): New public method.
10749 * parameter.cs (Parameter.Resolve): Check whether we're a generic
10750 method parameter and compute our constraints if appropriate.
10751 (Parameter.GenericConstraints): New public property.
10753 * generic.cs (Constraints): Implement GenericConstraints.
10755 2004-03-29 Martin Baulig <martin@ximian.com>
10757 * decl.cs (MemberCache.FindMemberToOverride): Use
10758 `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
10760 2004-03-29 Martin Baulig <martin@ximian.com>
10762 * generic.cs (GenericMethod.Define): Resolve our type parameters.
10764 2004-03-29 Martin Baulig <martin@ximian.com>
10766 * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
10767 not allowed on non-generic declarations").
10769 2004-03-29 Martin Baulig <martin@ximian.com>
10771 * expression.cs (Invocation.InferTypeArguments): Added overloaded
10772 public version of this method.
10774 * class.cs (MethodCore.IsDuplicateImplementation): Use
10775 Invocation.InferTypeArguments() to check this.
10777 2004-03-29 Martin Baulig <martin@ximian.com>
10779 * convert.cs: Use TypeManager.IsDelegateType() instead of
10780 comparing types correctly.
10782 2004-03-29 Martin Baulig <martin@ximian.com>
10784 * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
10785 types directly to make it work for generic instances.
10787 * typemanager.cs (TypeManager.IsSubclassOf): New static method.
10789 2004-03-29 Martin Baulig <martin@ximian.com>
10791 * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
10792 support for arrays.
10794 2004-03-24 Martin Baulig <martin@ximian.com>
10796 * decl.cs (DeclSpace.FindType): Also use
10797 TypeManager.CheckGeneric() for types from the using clauses.
10799 2004-03-23 Martin Baulig <martin@ximian.com>
10801 * expression.cs (Invocation.OverloadResolve): Added `bool
10802 may_fail' argument and use it instead of the Location.IsNull() hack.
10804 2004-03-23 Martin Baulig <martin@ximian.com>
10806 * expression.cs (Invocation.InferType): Use correct type inference
10809 2004-03-23 Martin Baulig <martin@ximian.com>
10811 * ecore.cs (MethodGroupExpr.Name): Use
10812 TypeManager.CSharpSignature() instead of just the name.
10814 * expression.cs (Invocation.OverloadResolve): Provide better error
10816 (Invocation.DoResolve): OverloadResolve() never returns null
10817 without reporting an error, so removed the error -6 reporting here.
10819 2004-03-23 Martin Baulig <martin@ximian.com>
10821 * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
10824 * cs-parser.jay (delegate_declaration): Support generic delegates.
10826 * delegate.cs: Support generic delegates.
10828 2004-03-22 Martin Baulig <martin@ximian.com>
10830 * expression.cs (Invocation.InferParamsTypeArguments): New static
10831 method; does type inference for params arguments.
10833 2004-03-21 Martin Baulig <martin@ximian.com>
10835 * typemanager.cs (TypeManager.IsGenericMethod): New public static
10836 method; checks whether a method is a generic method.
10838 * expression.cs (Invocation.InferTypeArguments): New static method;
10839 infer type arguments for generic method invocation.
10841 * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
10842 property; we set this to true if we're resolving a generic method
10843 invocation and the user specified type arguments, ie. we're not
10844 doing type inference.
10846 2004-03-20 Martin Baulig <martin@ximian.com>
10848 * class.cs (MethodData.DeclaringType): New public property.
10849 (MethodData.Define): Set DeclaringType here.
10850 (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
10851 instead of OperatorMethodBuilder.DeclaringType.
10853 2004-03-20 Martin Baulig <martin@ximian.com>
10855 * cs-tokenizer.cs (xtoken): Return a special
10856 Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
10858 * cs-parser.jay (default_value_expression): Switch to the new
10861 2004-03-19 Martin Baulig <martin@ximian.com>
10863 * decl.cs (MemberName): New class. We use this to "construct"
10864 namespace_or_type_name's.
10866 * generics.cs (TypeArguments.GetDeclarations): New public method;
10867 returns the type arguments as a string[] and reports a CS0081 if
10868 one of them is not an identifier.
10870 * class.cs (MemberBase): The .ctor now takes the name as a
10871 MemberName instead of a string.
10872 (MemberBase.ExplicitInterfaceName): Changed type from string to
10874 (MemberBase.DoDefine): If we're an explicit implementation, the
10875 InterfaceType may be a generic instance.
10877 * cs-parser.jay (namespace_or_type_name): Return a MemberName.
10878 (namespace_name): Call MemberName.GetName () to transform the
10879 MemberName into a string and ensure we don't have any type
10881 (type_name): Call MemberName.GetTypeExpression() to transfrom the
10882 MemberName into an expression.
10883 (method_header): Use namespace_or_type_name instead of member_name.
10885 2004-04-07 Miguel de Icaza <miguel@ximian.com>
10887 * rootcontext.cs: Add new types to the boot resolution.
10889 * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10890 MulticastDelegate is not allowed.
10892 * typemanager.cs: Add new types to lookup: System.TypedReference
10895 * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10896 check for TypedReference or ArgIterator, they are not allowed.
10898 * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10899 makes us properly catch 1510 in some conditions (see bug 56016 for
10902 2004-04-06 Bernie Solomon <bernard@ugsolutions.com>
10904 * CryptoConvert.cs: update from corlib version
10907 2004-04-05 Miguel de Icaza <miguel@ximian.com>
10909 * class.cs (Indexer.Define): Check indexername declaration
10911 2004-04-05 Marek Safar <marek.safar@seznam.cz>
10913 * attribute.cs (IsClsCompliant): Fixed problem with handling
10914 all three states (compliant, not-compliant, undetected).
10916 2004-03-30 Marek Safar <marek.safar@seznam.cz>
10918 * attribute.cs (Attribute): Location is now public.
10919 (Resolve): Store resolved arguments (pos_values) in attribute class.
10920 Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10921 (GetClsCompliantAttributeValue): New method that gets
10922 CLSCompliantAttribute value.
10923 (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10924 if exists else null.
10925 (AttributeTester): New class for CLS-Compliant verification routines.
10927 * class.cs (Emit): Add CLS-Compliant verification.
10928 (Method.GetSignatureForError): Implemented.
10929 (Constructor.GetSignatureForError): Implemented
10930 (Constructor.HasCompliantArgs): Returns if constructor has
10931 CLS-Compliant arguments.
10932 (Constructor.Emit): Override.
10933 (Construcor.IsIdentifierClsCompliant): New method; For constructors
10934 is needed to test only parameters.
10935 (FieldBase.GetSignatureForError): Implemented.
10936 (TypeContainer): New member for storing base interfaces.
10937 (TypeContainer.FindMembers): Search in base interfaces too.
10939 * codegen.cs (GetClsComplianceAttribute): New method that gets
10940 assembly or module CLSCompliantAttribute value.
10941 (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10943 (ModuleClass.Emit): Add error 3012 test.
10945 * const.cs (Emit): Override and call base for CLS-Compliant tests.
10947 * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10948 state for all decl types.
10949 (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10950 if CLS-Compliant tests are required.
10951 (IsClsCompliaceRequired): New method. Analyze whether code
10952 must be CLS-Compliant.
10953 (IsExposedFromAssembly): New method. Returns true when MemberCore
10954 is exposed from assembly.
10955 (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10956 value or gets cached value.
10957 (HasClsCompliantAttribute): New method. Returns true if MemberCore
10958 is explicitly marked with CLSCompliantAttribute.
10959 (IsIdentifierClsCompliant): New abstract method. This method is
10960 used to testing error 3005.
10961 (IsIdentifierAndParamClsCompliant): New method. Common helper method
10962 for identifier and parameters CLS-Compliant testing.
10963 (VerifyClsCompliance): New method. The main virtual method for
10964 CLS-Compliant verifications.
10965 (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10966 null. I don't know why is null (too many public members !).
10967 (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10968 and get value of first CLSCompliantAttribute that found.
10970 * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10971 (VerifyClsCompliance): Override and add extra tests.
10973 * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10974 clscheck- disable CLS-Compliant verification event if assembly is has
10975 CLSCompliantAttribute(true).
10977 * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10978 ApllyAttribute is now called in emit section as in the other cases.
10979 Possible future Emit integration.
10980 (IsIdentifierClsCompliant): New override.
10981 (VerifyClsCompliance): New override.
10982 (GetEnumeratorName): Returns full enum name.
10984 * parameter.cs (GetSignatureForError): Implemented.
10986 * report.cs (WarningData): New struct for Warning message information.
10987 (LocationOfPreviousError): New method.
10988 (Warning): New method. Reports warning based on the warning table.
10989 (Error_T): New method. Reports error based on the error table.
10991 * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10992 verifications are done here.
10994 * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10996 * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10997 CLSCompliantAttribute.
10998 (all_imported_types): New member holds all imported types from other
11000 (LoadAllImportedTypes): New method fills static table with exported types
11001 from all referenced assemblies.
11002 (Modules): New property returns all assembly modules.
11004 2004-03-30 Miguel de Icaza <miguel@ximian.com>
11006 * cs-parser.jay: Add a rule to catch wrong event syntax instead of
11007 throwing a parser error.
11009 * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
11010 which removes the hardcoded get_/set_ prefixes for properties, as
11011 IL allows for the properties to be named something else.
11015 * expression.cs: Do not override operand before we know if it is
11016 non-null. Fix 56207
11018 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
11020 * typemanager.cs: support for pinned variables.
11022 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
11024 * decl.cs, typemanager.cs: Avoid using an arraylist
11025 as a buffer if there is only one result set.
11027 2004-03-29 Ben Maurer <bmaurer@users.sourceforge.net>
11029 * expression.cs: Make sure you cant call a static method
11030 with an instance expression, bug #56174.
11032 2004-03-29 Miguel de Icaza <miguel@ximian.com>
11034 * class.cs (IsDuplicateImplementation): Improve error reporting to
11035 flag 663 (method only differs in parameter modifier).
11037 * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
11038 in preprocessor directives.
11040 * location.cs (LookupFile): Allow for the empty path.
11042 * attribute.cs (DefinePInvokeMethod): Fix 56148; I would like a
11043 better approach for some of that patch, but its failing with the
11044 CharSet enumeration. For now try/catch will do.
11046 * typemanager.cs: Do not crash if a struct does not have fields.
11049 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
11051 * expression.cs: cs0213, cant fix a fixed expression.
11054 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
11056 * cs-parser.jay: detect invalid embeded statements gracefully.
11059 2004-03-28 Ben Maurer <bmaurer@users.sourceforge.net>
11061 * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
11064 the invocation type may not be a subclass of the tye of the item/
11065 The type of the item must be a subclass of the invocation item.
11070 2004-03-25 Sebastien Pouliot <sebastien@ximian.com>
11072 * attribute.cs: Added methods to get a string and a bool from an
11073 attribute. Required to information from AssemblyKeyFileAttribute,
11074 AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
11075 * codegen.cs: Modified AssemblyName creation to include support for
11076 strongnames. Catch additional exceptions to report them as CS1548.
11077 * compiler.csproj: Updated include CryptoConvert.cs.
11078 * compiler.csproj.user: Removed file - user specific configuration.
11079 * CryptoConvert.cs: New. A COPY of the class CryptoConvert from
11080 Mono.Security assembly. The original class is maintained and tested in
11081 /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
11082 * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
11083 like CSC 8.0 (C# v2) supports.
11084 * Makefile: Added CryptoConvert.cs to mcs sources.
11085 * rootcontext.cs: Added new options for strongnames.
11087 2004-03-24 Ben Maurer <bmaurer@users.sourceforge.net>
11089 * driver.cs: For --expect-error, report error code `2'
11090 if the program compiled with no errors, error code `1' if
11091 it compiled with an error other than the one expected.
11093 2004-03-24 Sebastien Pouliot <sebastien@ximian.com>
11095 * compiler.csproj: Updated for Visual Studio .NET 2003.
11096 * compiler.csproj.user: Updated for Visual Studio .NET 2003.
11097 * compiler.sln: Updated for Visual Studio .NET 2003.
11099 2004-03-24 Ravi Pratap M <ravi@ximian.com>
11101 * expression.cs: Fix bug #47234. We basically need to apply the
11102 rule that we prefer the conversion of null to a reference type
11103 when faced with a conversion to 'object' (csc behaviour).
11105 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11107 * statement.cs: Shorter form for foreach, eliminates
11108 a local variable. r=Martin.
11110 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11112 * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
11113 checks if we can use brtrue/brfalse to test for 0.
11114 * expression.cs: use the above in the test for using brtrue/brfalse.
11115 cleanup code a bit.
11117 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11119 * expression.cs: Rewrite string concat stuff. Benefits:
11121 - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
11122 - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
11123 rather than a concat chain.
11125 * typemanager.cs: Add lookups for more concat overloads.
11127 2004-03-23 Ben Maurer <bmaurer@users.sourceforge.net>
11129 * expression.cs: Emit shorter il code for array init.
11146 2004-03-22 Ben Maurer <bmaurer@users.sourceforge.net>
11148 * statement.cs: Before, two switch blocks would be merged if the
11149 total size of the blocks (end_item - begin_item + 1) was less than
11150 two times the combined sizes of the blocks.
11152 Now, it will only merge if after the merge at least half of the
11157 2004-03-20 Atsushi Enomoto <atsushi@ximian.com>
11159 * class.cs : csc build fix for GetMethods(). See bug #52503.
11161 2004-03-20 Ben Maurer <bmaurer@users.sourceforge.net>
11163 * expression.cs: Make sure fp comparisons work with NaN.
11164 This fixes bug #54303. Mig approved this patch a long
11165 time ago, but we were not able to test b/c the runtime
11168 2004-03-19 Miguel de Icaza <miguel@ximian.com>
11170 * ecore.cs (TypExpr.GetHashCode): implement this overload.
11172 2004-03-19 Martin Baulig <martin@ximian.com>
11174 * class.cs (MemberCore.IsDuplicateImplementation): Check whether
11175 two overloads may unify for some type parameter substitutions and
11176 report a CS0408 if appropriate.
11178 2004-03-19 Martin Baulig <martin@ximian.com>
11180 * class.cs (MemberCore.IsDuplicateImplementation): Report the
11181 error here and not in our caller.
11183 2004-03-19 Martin Baulig <martin@ximian.com>
11185 * interface.cs: Completely killed this file.
11186 (Interface): We're now a TypeContainer and live in class.cs.
11188 * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
11189 argument; we're now also called for interfaces.
11190 (TypeContainer.DefineMembers): Allow this method being called
11192 (TypeContainer.GetMethods): New public method; formerly known as
11193 Interface.GetMethod(). This is used by PendingImplementation.
11194 (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
11195 it's now private and non-static.
11196 (Interface): Moved this here; it's now implemented similar to
11198 (Method, Property, Event, Indexer): Added `bool is_interface'
11199 argument to their .ctor's.
11200 (MemberBase.IsInterface): New public field.
11202 * cs-parser.jay: Create normal Method, Property, Event, Indexer
11203 instances instead of InterfaceMethod, InterfaceProperty, etc.
11204 (opt_interface_base): Removed; we now use `opt_class_base' instead.
11205 (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
11207 2004-03-19 Martin Baulig <martin@ximian.com>
11209 * class.cs (MethodCore.IsDuplicateImplementation): New private
11210 method which does the CS0111 checking.
11211 (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
11212 Use IsDuplicateImplementation().
11214 2004-03-17 Ben Maurer <bmaurer@users.sourceforge.net>
11216 * decl.cs (FindMemberToOverride): New method to find the correct
11217 method or property to override in the base class.
11219 - Make Method/Property use the above method to find the
11220 version in the base class.
11221 - Remove the InheritableMemberSignatureCompare as it is now
11224 This patch makes large code bases much faster to compile, as it is
11225 O(n) rather than O(n^2) to do this validation.
11227 Also, it fixes bug 52458 which is that nested classes are not
11228 taken into account when finding the base class member.
11230 Reviewed/Approved by Martin.
11232 2004-03-17 Martin Baulig <martin@ximian.com>
11234 * expression.cs (MemberAccess.DoResolve): Take the parent's number
11235 of type arguments into account; use the `real_num_type_args'
11236 approach like in DoResolveAsTypeStep().
11238 * generic.cs (GenericMemberAccess.DoResolve): Make this work for
11241 2004-03-17 Marek Safar <marek.safar@seznam.cz>
11243 * interface.cs: In all interface classes removed redundant
11244 member initialization.
11246 2004-03-16 Martin Baulig <martin@ximian.com>
11248 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11250 2004-03-15 Miguel de Icaza <miguel@ximian.com>
11252 * decl.cs (DefineTypeAndParents): New helper method to define a
11253 type's containers before the type itself is defined; This is a
11254 bug exposed by the recent changes to Windows.Forms when an
11255 implemented interface was defined inside a class that had not been
11258 * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
11260 (Check): Loop correctly to report errors modifiers
11261 (UNSAFE was not in the loop, since it was the same as TOP).
11263 * interface.cs: Every interface member now takes a ModFlags,
11264 instead of a "is_new" bool, which we set on the base MemberCore.
11266 Every place where we called "UnsafeOk" in the interface, now we
11267 call the proper member (InterfaceMethod.UnsafeOK) instead to get
11268 the unsafe settings from the member declaration instead of the
11269 container interface.
11271 * cs-parser.jay (opt_new): Allow unsafe here per the spec.
11273 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11274 `set_indexer_name' to the pending bits (one per type).
11276 We fixed a bug today that was picking the wrong method to
11277 override, since for properties the existing InterfaceMethod code
11278 basically ignored the method name. Now we make sure that the
11279 method name is one of the valid indexer names.
11281 2004-03-14 Gustavo Giráldez <gustavo.giraldez@gmx.net>
11283 * support.cs (SeekableStreamReader): Keep track of stream byte
11284 positions and don't mix them with character offsets to the buffer.
11286 Patch from Gustavo Giráldez
11288 2004-03-15 Marek Safar <marek.safar@seznam.cz>
11290 * interface.cs (InterfaceSetGetBase): Removed double member
11291 initialization, base class does it as well.
11293 2004-03-13 Martin Baulig <martin@ximian.com>
11295 * class.cs: Reverted Miguel's latest commit; it makes mcs crash
11296 when compiling corlib.
11298 2004-03-13 Miguel de Icaza <miguel@ximian.com>
11300 * convert.cs (ExplicitConversion): We were reporting an error on
11301 certain conversions (object_type source to a value type, when the
11302 expression was `null') before we had a chance to pass it through
11303 the user defined conversions.
11305 * driver.cs: Replace / and \ in resource specifications to dots.
11308 * class.cs: Add check for duplicate operators. Fixes 52477
11310 2004-03-11 Miguel de Icaza <miguel@ximian.com>
11312 * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
11313 that are in the middle of the statements, not only at the end.
11316 * class.cs (TypeContainer.AddField): No longer set the
11317 `HaveStaticConstructor' flag, now we call it
11318 `UserDefineStaticConstructor' to diferentiate the slightly
11319 semantic difference.
11321 The situation is that we were not adding BeforeFieldInit (from
11322 Modifiers.TypeAttr) to classes that could have it.
11323 BeforeFieldInit should be set to classes that have no static
11328 http://www.yoda.arachsys.com/csharp/beforefieldinit.html
11330 And most importantly Zoltan's comment:
11332 http://bugzilla.ximian.com/show_bug.cgi?id=44229
11334 "I think beforefieldinit means 'it's ok to initialize the type sometime
11335 before its static fields are used', i.e. initialization does not need
11336 to be triggered by the first access to the type. Setting this flag
11337 helps the JIT to compile better code, since it can run the static
11338 constructor at JIT time, and does not need to generate code to call it
11339 (possibly lots of times) at runtime. Unfortunately, mcs does not set
11340 this flag for lots of classes like String.
11342 csc sets this flag if the type does not have an explicit static
11343 constructor. The reasoning seems to be that if there are only static
11344 initalizers for a type, and no static constructor, then the programmer
11345 does not care when this initialization happens, so beforefieldinit
11348 This bug prevents the AOT compiler from being usable, since it
11349 generates so many calls to mono_runtime_class_init that the AOT code
11350 is much slower than the JITted code. The JITted code is faster,
11351 because it does not generate these calls if the vtable is type is
11352 already initialized, which is true in the majority of cases. But the
11353 AOT compiler can't do this."
11355 2004-03-10 Miguel de Icaza <miguel@ximian.com>
11357 * class.cs (MethodData.Emit): Refactor the code so symbolic
11358 information is generated for destructors; For some reasons we
11359 were taking a code path that did not generate symbolic information
11362 2004-03-11 Ben Maurer <bmaurer@users.sourceforge.net>
11364 * class.cs: Create a Constructor.CheckBase method that
11365 takes care of all validation type code. The method
11366 contains some code that was moved from Define.
11368 It also includes new code that checks for duplicate ctors.
11369 This fixes bug #55148.
11371 2004-03-09 Joshua Tauberer <tauberer@for.net>
11373 * expression.cs (ArrayCreation): Fix: More than 6 nulls in
11374 a { ... }-style array creation invokes EmitStaticInitializers
11375 which is not good for reference-type arrays. String, decimal
11376 and now null constants (NullCast) are not counted toward
11377 static initializers.
11379 2004-03-05 Martin Baulig <martin@ximian.com>
11381 * location.cs (SourceFile.HasLineDirective): New public field;
11382 specifies whether the file contains or is referenced by a "#line"
11384 (Location.DefineSymbolDocuments): Ignore source files which
11385 either contain or are referenced by a "#line" directive.
11387 2004-02-29 Ben Maurer <bmaurer@users.sourceforge.net>
11389 * class.cs (Method.CheckBase): Avoid using FindMembers, we have
11390 direct access to our parent, so check the method inline there.
11392 2004-02-27 Ben Maurer <bmaurer@users.sourceforge.net>
11394 * expression.cs (Invocation.EmitCall): Miguel's last commit
11395 caused a regression. If you had:
11400 In Foo the implict this would be null.
11402 2004-02-27 Miguel de Icaza <miguel@ximian.com>
11404 * expression.cs (Invocation.EmitCall): If the method is not
11405 virtual, do not emit a CallVirt to it, use Call.
11407 * typemanager.cs (GetFullNameSignature): Improve the method to
11408 cope with ".ctor" and replace it with the type name.
11410 * class.cs (ConstructorInitializer.Resolve): Now the method takes
11411 as an argument the ConstructorBuilder where it is being defined,
11412 to catch the recursive constructor invocations.
11414 2004-03-16 Martin Baulig <martin@ximian.com>
11416 * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
11417 ConstructedType, call ResolveType() on it to get the type rather
11418 than just using `expr.Type'.
11420 2004-03-16 Martin Baulig <martin@ximian.com>
11422 * generics.cs (ConstructedType.GetMemberAccess): Take the
11423 EmitContext instead on the TypeExpr and use
11424 ec.TypeContainer.CurrentType/ec.ContainerType.
11426 2004-03-16 Martin Baulig <martin@ximian.com>
11428 * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
11429 parameters before aliases.
11431 2004-03-16 Martin Baulig <martin@ximian.com>
11433 * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
11434 New oublic function; checks whether two generic instances may become
11435 equal under some instantiations (26.3.1).
11437 * class.cs (TypeContainer.Define): Call
11438 TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
11441 2004-03-16 Martin Baulig <martin@ximian.com>
11443 * class.cs (TypeContainer.GetClassBases): Moved
11444 Error_TypeParameterAsBase() here and also check whether the base
11445 class is not an attribute.
11447 2004-03-16 Martin Baulig <martin@ximian.com>
11449 * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11451 2004-03-16 Martin Baulig <martin@ximian.com>
11453 * class.cs (Error_TypeParameterAsBase): Use correct error number
11456 2004-03-16 Martin Baulig <martin@ximian.com>
11458 * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
11461 * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
11464 2004-03-15 Martin Baulig <martin@ximian.com>
11466 * typemanager.cs (TypeManager.GetFullName): New public method.
11467 (TypeManager.MemberLookup): Added `int_num_type_arguments'
11468 argument; only return members with the correct number of type
11470 (TypeManager.CheckGeneric): Allow -1 to bypass the check.
11471 (TypeManager.FilterWithClosure): Call CheckGeneric() to check
11472 whether the number of type arguments matches.
11474 * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
11475 not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
11477 * expression.cs (MemberAccess): Added public `NumTypeArguments'
11478 field; it's set by the protected .ctor when we're actually a
11479 GenericMemberAccess.
11480 (MemberAccess.ResolveAsTypeStep): Compute the total number of type
11481 arguments and pass it to MemberLookupFinal ().
11483 * ecore.cs (Expression.MemberLookup): Added `int
11484 num_type_arguments' argument; only return members with the correct
11485 number of type arguments.
11486 (Expression.MemberLookupFailed): Check whether the MemberLookup
11487 failed because we did not have the correct number of type
11488 arguments; report CS0305 in this case.
11490 * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
11491 `e.ResolveAsTypeTerminal()' already did so.
11493 2004-03-15 Martin Baulig <martin@ximian.com>
11495 * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
11496 we're a ConstructedType; in this case, the caller must report an
11497 error (for instance CS0131).
11499 * generic.cs (TypeArguments): Added Location argument to the .ctor.
11500 (TypeArguments.Resolve): Actually report errors here.
11502 2004-03-15 Miguel de Icaza <miguel@ximian.com>
11504 * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11505 `set_indexer_name' to the pending bits (one per type).
11507 We fixed a bug today that was picking the wrong method to
11508 override, since for properties the existing InterfaceMethod code
11509 basically ignored the method name. Now we make sure that the
11510 method name is one of the valid indexer names.
11512 2004-03-15 Martin Baulig <martin@ximian.com>
11514 * typemanager.cs (TypeManager.IndexerPropertyName): Added support
11515 for generic instances.
11517 2004-03-13 Martin Baulig <martin@ximian.com>
11519 * class.cs (TypeContainer.DefineType): Call
11520 TypeManager.AddUserType() immediately after creating the
11521 TypeBuilder; pass all type parameters when creating the
11524 * decl.cs (DeclSpace.FindNestedType): New public method.
11525 (DeclSpace.FindType): Added `int num_type_args' argument; only
11526 return types with the correct number of type parameters.
11527 (DeclSpace.CountTypeParams): New public property.
11529 * ecore.cs (SimpleName.ctor): Added overloaded version which takes
11530 the number of type parameters; defaults to zero.
11532 * generic.cs (TypeArguments.Count): New public property.
11533 (ConstructedType.DoResolveAsTypeStep): First call
11534 ds.FindNestedType() to find out whether we're nested in the
11535 current generic type; in this case, we inherit all type parameters
11536 from the current class.
11538 * rootcontext.cs (RootContext.NamespaceLookup): Added `int
11539 num_type_args' argument.
11540 (RootContext.LookupType): Added overloaded version which takes the
11541 number of type arguments; only return types with the correct
11542 number of type arguments.
11544 * typemanager.cs (TypeManager.CheckGeneric): New public function;
11545 checks whether `Type t' has `int num_type_args'.
11547 2004-03-13 Martin Baulig <martin@ximian.com>
11549 * generic.cs (GenericMethod.DefineType): New method; calls
11550 DefineType() on all the type parameters.
11552 * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
11553 (MethodData.Define): If we're a generic method, call
11554 GenericMethod.DefineType() to define the type parameters.
11556 2004-03-10 Martin Baulig <martin@ximian.com>
11558 * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
11559 instead of IsAssignableFrom.
11561 2004-03-10 Martin Baulig <martin@ximian.com>
11563 * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
11565 * support.cs (ParameterData.HasArrayParameter): New property.
11566 (ReflectionParameters.ctor): Take a MethodBase instead of a
11567 ParameterInfo[]. If we have any type parameters, get the generic
11568 method definition and ask it whether we have variable arguments.
11570 2004-02-26 Miguel de Icaza <miguel@ximian.com>
11572 * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11573 routines to check if a type is an enumerable/enumerator allow
11574 classes that implement the IEnumerable or IEnumerator interfaces.
11576 * class.cs (Property, Operator): Implement IIteratorContainer, and
11577 implement SetYields.
11579 (Property.Define): Do the block swapping for get_methods in the
11580 context of iterators. We need to check if Properties also
11581 include indexers or not.
11583 (Operator): Assign the Block before invoking the
11584 OperatorMethod.Define, so we can trigger the Iterator code
11587 * cs-parser.jay (SimpleIteratorContainer): new helper class. Both
11588 Property and Operator classes are not created when we parse the
11589 declarator but until we have the block completed, so we use a
11590 singleton SimpleIteratorContainer.Simple to flag whether the
11591 SetYields has been invoked.
11593 We propagate this setting then to the Property or the Operator to
11594 allow the `yield' to function.
11596 2004-02-25 Marek Safar <marek.safar@seznam.cz>
11598 * codegen.cs: Implemented attribute support for modules.
11599 New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11600 Assembly/Module functionality.
11602 * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11603 interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11604 Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11606 2004-02-16 Marek Safar <marek.safar@seznam.cz>
11608 * interface.cs (FindMembers): The operation is performed on all base
11609 interfaces and not only on the first. It is required for future CLS Compliance patch.
11611 2004-02-12 Ben Maurer <bmaurer@users.sourceforge.net>
11613 * statement.cs, codegen.cs:
11614 This patch deals with patterns such as:
11616 public class List : IEnumerable {
11618 public MyEnumerator GetEnumerator () {
11619 return new MyEnumerator(this);
11622 IEnumerator IEnumerable.GetEnumerator () {
11626 public struct MyEnumerator : IEnumerator {
11631 Before, there were a few things we did wrong:
11632 1) we would emit callvirt on a struct, which is illegal
11633 2) we emited ldarg when we needed to emit ldarga
11634 3) we would mistakenly call the interface methods on an enumerator
11635 type that derived from IEnumerator and was in another assembly. For example:
11637 public class MyEnumerator : IEnumerator
11639 Would have the interface methods called, even if there were public impls of the
11640 method. In a struct, this lead to invalid IL code.
11642 2004-02-11 Marek Safar <marek.safar@seznam.cz>
11644 * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11647 * delegate.cs (Define): Fixed crash when delegate type is undefined.
11649 2004-02-11 Miguel de Icaza <miguel@ximian.com>
11651 * cs-parser.jay: Fix small regression: we were not testing V2
11652 compiler features correctly.
11654 * interface.cs: If the emit context is null, then create one
11656 2004-02-09 Marek Safar <marek.safar@seznam.cz>
11658 * decl.cs (GetSignatureForError): New virtual method to get full name
11659 for error messages.
11661 * attribute.cs (IAttributeSupport): New interface for attribute setting.
11662 Now it is possible to rewrite ApplyAttributes method to be less if/else.
11664 * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11665 Duplicated members and code in these classes has been removed.
11666 Better encapsulation in these classes.
11668 2004-02-07 Miguel de Icaza <miguel@ximian.com>
11670 * assign.cs (Assign.DoResolve): When dealing with compound
11671 assignments, there is a new rule in ECMA C# 2.4 (might have been
11672 there before, but it is documented here) that states that in:
11676 If b is of type int, and the `op' is a shift-operator, then the
11677 above is evaluated as:
11681 * expression.cs (Binary.ResolveOperator): Instead of testing for
11682 int/uint/long/ulong, try to implicitly convert to any of those
11683 types and use that in pointer arithmetic.
11685 * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11686 method to print information for from the type, not from the
11687 null-method we were given.
11689 2004-02-01 Duncan Mak <duncan@ximian.com>
11691 * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11692 parsing for cmd, fixes bug #53694.
11694 2004-02-04 Marek Safar <marek.safar@seznam.cz>
11696 * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11697 in the member name duplication tests. Property and operator name duplication
11698 was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11700 2004-02-03 Marek Safar <marek.safar@seznam.cz>
11702 * interface.cs (PopulateMethod): Fixed crash when interface method
11703 returns not existing type (error test cs0246-3.cs).
11705 2004-02-02 Ravi Pratap M <ravi@ximian.com>
11707 * cs-parser.jay (interface_accessors): Re-write actions to also
11708 store attributes attached to get and set methods. Fix spelling
11711 (inteface_property_declaration): Modify accordingly.
11713 (InterfaceAccessorInfo): New helper class to store information to pass
11714 around between rules that use interface_accessors.
11716 * interface.cs (Emit): Apply attributes on the get and set
11717 accessors of properties and indexers too.
11719 * attribute.cs (ApplyAttributes): Modify accordingly to use the
11720 right MethodBuilder when applying attributes to the get and set accessors.
11722 2004-01-31 Miguel de Icaza <miguel@ximian.com>
11724 * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11726 2004-01-26 Miguel de Icaza <miguel@ximian.com>
11728 * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11730 2004-01-25 Miguel de Icaza <miguel@ximian.com>
11732 * cs-parser.jay: Remove YIELD token, instead use the new grammar
11733 changes that treat `yield' specially when present before `break'
11734 or `return' tokens.
11736 * cs-tokenizer.cs: yield is no longer a keyword.
11738 2004-01-23 Marek Safar <marek.safar@seznam.cz>
11740 * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11741 setting for default constructors.
11742 For default constructors are almost every time set wrong Modifier. The
11743 generated IL code has been alright. But inside mcs this values was
11744 wrong and this was reason why several of my CLS Compliance tests
11747 2004-02-27 Martin Baulig <martin@ximian.com>
11749 * generics.cs (ConstructedType.ResolveType): Make the nested type
11750 stuff actually work.
11752 2004-02-25 Martin Baulig <martin@ximian.com>
11754 * decl.cs (DeclSpace.CurrentTypeParameters): New protected
11755 property; returns the type parameters just from the current type,
11756 ie. with the ones from outer classes.
11757 (DeclSpace.LookupGeneric): First search in the current class, then
11759 (DeclSpace.initialize_type_params): When hiding a type parameter
11760 from an outer class, put it into the `type_param_list' anyways.
11762 * expression.cs (MemberAccess.expr): Made this field protected.
11764 * class.cs (TypeContainer.Define): The `CurrentType' just contains
11765 the type parameters from the current class.
11767 * generic.cs (ConstructedType.ResolveType): Support nested generic
11768 types by taking the type parameters which we inherit from outer
11769 classes into account.
11770 (GenericMemberAccess.ResolveAsTypeStep): Override this and added
11771 support for nested generic types.
11773 2004-02-23 Martin Baulig <martin@ximian.com>
11775 * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
11776 field and check whether we're nested inside a generic type.
11777 (DeclSpace.ResolveType): If we're resolving to a generic type
11778 definition, create a ConstructedType and return its resolved type.
11779 (DeclSpace.initialize_type_params): New private method;
11780 initializes the `type_param_list' field from the type parameters
11781 from this and all enclosing classes.
11782 (DeclSpace.TypeParameters): Call initialize_type_params() unless
11783 we're already initialized.
11785 2004-02-23 Martin Baulig <martin@ximian.com>
11787 * class.cs (Method.Define): Create the generic method before
11788 calling DoDefine().
11789 (Memberbase.DoDefine): Added DeclSpace argument (in addition to
11790 the TypeContainer one); we use this for generic methods.
11792 * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
11793 parent's TypeBuilder.
11795 2004-02-18 Martin Baulig <martin@ximian.com>
11797 * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
11798 to check for equality.
11800 2004-02-05 Martin Baulig <martin@ximian.com>
11802 * ecore.cs (FieldExpr.DoResolveLValue): If we have an
11803 `ec.TypeContainer.CurrentType', use it instead of
11804 `ec.ContainerType' to check whether we're in the type's ctor.
11806 2004-01-29 Martin Baulig <martin@ximian.com>
11808 * expression.cs (Invocation.DoResolve): If we're a
11809 `ConstructedType', then we're actually a generic method, so
11810 rewrite the expr as a GenericMemberAccess.
11812 * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
11813 here; manually parse it into a string.
11815 2004-01-28 Martin Baulig <martin@ximian.com>
11817 * typemanager.cs (TypeManager.IsEqual): New static method.
11818 (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
11819 check for equality instead of using `=='.
11821 2004-01-26 Martin Baulig <martin@ximian.com>
11823 * decl.cs (DeclSpace.CurrentType): New public field.
11825 * expression.cs (This.ResolveBase): If we have an
11826 `ec.TypeContainer.CurrentType', use it instead of
11827 `ec.ContainerType'.
11829 * class.cs (TypeContainer.DefineType): If we're a generic type,
11830 create the `CurrentType' (unresolved).
11831 (TypeContainer.GenericType): New private field.
11832 (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
11833 it and store it in `GenericType' before creating the MemberCache.
11834 (TypeContainer.GetMembers): If we have a `GenericType', call
11835 TypeManager.FindMembers() on it.
11837 * interface.cs (Interface.GenericType): New private field.
11838 (Interface.DefineType): If we're a generic type, create the
11839 `CurrentType' (unresolved).
11840 (Interface.DefineMembers): If we have a `CurrentType', resolve it
11841 and store it in `GenericType' before creating the MemberCache.
11842 (Interface.GetMembers): If we have a `GenericType', call
11843 TypeManager.FindMembers() on it.
11845 2004-01-22 Martin Baulig <martin@ximian.com>
11847 * cs-parser.jay (namespace_or_type_name): Return an Expression,
11848 not a QualifiedIdentifier. This is what `type_name_expression'
11849 was previously doing.
11850 (type_name_expression): Removed; the code is now in
11851 `namespace_or_type_name'.
11852 (qualified_identifier): Removed, use `namespace_or_type_name'
11854 (QualifiedIdentifier): Removed this class.
11856 2004-01-22 Martin Baulig <martin@ximian.com>
11858 * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11859 not a string as alias name.
11861 2004-01-21 Miguel de Icaza <miguel@ximian.com>
11863 * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11864 #52730 bug, and instead compute correctly the need to use a
11865 temporary variable when requesting an address based on the
11866 static/instace modified of the field and the constructor.
11868 2004-01-21 Martin Baulig <martin@ximian.com>
11870 * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11871 class and namespace before looking up aliases. Fixes #52517.
11873 2004-01-21 Martin Baulig <martin@ximian.com>
11875 * flowanalysis.cs (UsageVector.Merge): Allow variables being
11876 assinged in a 'try'; fixes exception4.cs.
11878 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11879 * class.cs : Implemented parameter-less constructor for TypeContainer
11881 * decl.cs: Attributes are now stored here. New property OptAttributes
11883 * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11885 * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11887 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11889 * typemanager.cs (CSharpSignature): Now reports also inner class name.
11890 (CSharpSignature): New method for indexer and property signature.
11892 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11894 * pending.cs (IsVirtualFilter): Faster implementation.
11896 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11898 * typemanager.cs: Avoid inclusion of same assembly more than once.
11900 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11902 * cs-parser.jay: Fixed problem where the last assembly attribute
11903 has been applied also to following declaration (class, struct, etc.)
11905 2004-01-21 Marek Safar <marek.safar@seznam.cz>
11907 * class.cs: Added error CS0538, CS0539 reporting.
11908 Fixed crash on Microsoft runtime when field type is void.
11910 * cs-parser.jay: Added error CS0537 reporting.
11912 * pending.cs: Added error CS0535 reporting.
11913 Improved error report for errors CS0536, CS0534.
11915 2004-01-20 Miguel de Icaza <miguel@ximian.com>
11917 Merge a few bits from the Anonymous Method MCS tree.
11919 * statement.cs (ToplevelBlock): New class for toplevel methods,
11920 will hold anonymous methods, lifted variables.
11922 * cs-parser.jay: Create toplevel blocks for delegates and for
11923 regular blocks of code.
11925 2004-01-20 Martin Baulig <martin@ximian.com>
11927 * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11928 `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11929 and `NeedExplicitReturn'; added `IsLastStatement'.
11930 (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11931 have a `ReturnLabel' or we're not unreachable.
11933 * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11934 child's reachability; don't just override ours with it. Fixes
11935 #58058 (lluis's example).
11936 (FlowBranching): Added public InTryOrCatch(), InCatch(),
11937 InFinally(), InLoop(), InSwitch() and
11938 BreakCrossesTryCatchBoundary() methods.
11940 * statement.cs (Return): Do all error checking in Resolve().
11941 Unless we are the last statement in a top-level block, always
11942 create a return label and jump to it.
11943 (Break, Continue): Do all error checking in Resolve(); also make
11944 sure we aren't leaving a `finally'.
11945 (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11946 statement in a top-level block.
11947 (Block.Flags): Added `IsDestructor'.
11948 (Block.IsDestructor): New public property.
11950 2004-01-20 Martin Baulig <martin@ximian.com>
11952 * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11954 2004-01-20 Martin Baulig <martin@ximian.com>
11956 * statement.cs (Statement.ResolveUnreachable): New public method.
11957 (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11958 (Block.Resolve): Resolve unreachable statements.
11960 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
11962 * expression.cs: We need to fix the case where we do
11963 not have a temp variable here.
11965 * assign.cs: Only expression compound assignments need
11966 temporary variables.
11968 2004-01-19 Ben Maurer <bmaurer@users.sourceforge.net>
11970 * flowanalysis.cs: Reduce memory allocation in a few ways:
11971 - A block with no variables should not allocate a bit
11973 - A method with no out parameters does not need any tracking
11974 for assignment of the parameters, so we need not allocate
11977 public readonly Type[] VariableTypes;
11978 public readonly string[] VariableNames;
11979 Are redundant. The data is already stored in the variable
11980 map, so we need not allocate another array for it.
11981 - We need to add alot of checks for if (params | locals) == null
11982 due to the first two changes.
11984 2004-01-18 Miguel de Icaza <miguel@ximian.com>
11986 * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11987 implement IMemoryLocation, we store a copy on a local variable and
11988 take the address of it. Patch from Benjamin Jemlich
11990 * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11991 to use a special "type_name_expression" rule which reduces the
11992 number of "QualifiedIdentifier" classes created, and instead
11993 directly creates MemberAccess expressions.
11995 2004-01-17 Miguel de Icaza <miguel@ximian.com>
11997 * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11998 that fixes #52853. Null literal assignment to ValueType
12000 * class.cs (MethodData.Emit): Instead of checking the name of the
12001 method to determine if its a destructor, create a new derived
12002 class from Method called Destructor, and test for that.
12004 * cs-parser.jay: Create a Destructor object instead of a Method.
12006 Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
12010 2004-01-16 Miguel de Icaza <miguel@ximian.com>
12012 * expression.cs (Binary.ResolveOperator): Perform an implicit
12013 conversion from MethodGroups to their delegate types on the
12014 Addition operation.
12016 * delegate.cs: Introduce a new class DelegateCreation that is the
12017 base class for `NewDelegate' and `ImplicitDelegateCreation',
12018 factor some code in here.
12020 * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
12021 conversion from MethodGroups to compatible delegate types.
12023 * ecore.cs (Expression.Resolve): Do not flag error 654
12024 (Methodgroupd needs parenthesis) if running on the V2 compiler, as
12025 we allow conversions from MethodGroups to delegate types now.
12027 * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
12028 assignments in v2 either.
12030 2004-01-10 Miguel de Icaza <miguel@ximian.com>
12032 * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
12033 static read-only fields in ctors.
12035 Applied patch from Benjamin Jemlich
12037 * expression.cs (UnaryMutator): Avoid leaking local variables.
12039 2004-01-09 Miguel de Icaza <miguel@ximian.com>
12041 * cs-tokenizer.cs (IsCastToken): Allow the various native types
12042 here to return true, as they can be used like this:
12044 (XXX) int.MEMBER ()
12046 Fixed 49836 and all the other dups
12048 2004-01-09 Zoltan Varga <vargaz@freemail.hu>
12050 * driver.cs: Implement /win32res and /win32icon.
12052 2004-01-08 Miguel de Icaza <miguel@ximian.com>
12054 * cs-parser.jay: Add a rule to improve error handling for the
12055 common mistake of placing modifiers after the type.
12057 2004-01-07 Miguel de Icaza <miguel@ximian.com>
12059 * cs-parser.jay (interface_event_declaration): Catch
12060 initialization of events on interfaces, and report cs0068
12062 * cs-parser.jay (interface_event_declaration): Catch
12063 initialization of events.
12065 * ecore.cs: Better report missing constructors.
12067 * expression.cs (Binary.ResolveOperator): My previous bug fix had
12068 the error reporting done in the wrong place. Fix.
12070 * expression.cs (Binary.ResolveOperator): Catch the
12071 operator + (E x, E y) error earlier, and later allow for implicit
12072 conversions in operator +/- (E e, U x) from U to the underlying
12075 * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
12076 52596, if the container class is abstract, the default constructor
12077 is protected otherwise its public (before, we were always public).
12079 * statement.cs (Fixed.Resolve): Catch a couple more errors in the
12082 (Using.EmitLocalVariableDecls): Applied patch from Benjamin
12083 Jemlich that fixes bug #52597, MCS was generating invalid code for
12084 idisposable structs. Thanks to Ben for following up with this
12087 2004-01-06 Miguel de Icaza <miguel@ximian.com>
12089 * driver.cs: Allow assemblies without code to be generated, fixes
12092 2004-01-07 Nick Drochak <ndrochak@gol.com>
12094 * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
12096 2004-01-05 Miguel de Icaza <miguel@ximian.com>
12098 * cs-parser.jay: Add rules to improve error reporting if fields or
12099 methods are declared at the namespace level (error 116)
12101 * Add rules to catch event add/remove
12103 2004-01-04 David Sheldon <dave-mono@earth.li>
12105 * expression.cs: Added matching ")" to error message for
12108 2004-01-03 Todd Berman <tberman@gentoo.org>
12110 * ecore.cs, attribute.cs:
12111 Applying fix from #52429.
12113 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12115 * ecore.cs, expression.cs, statement.cs:
12116 Total rewrite of how we handle branching. We
12117 now handle complex boolean expressions with fewer
12118 jumps. As well if (x == 0) no longer emits a ceq.
12120 if (x is Foo) is much faster now, because we generate
12123 Overall, we get a pretty big improvement on our benchmark
12124 tests. The code we generate is smaller and more readable.
12126 I did a full two-stage bootstrap. The patch was reviewed
12127 by Martin and Miguel.
12129 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12131 * cs-parser.jay: Make primary_expression not take a QI.
12132 we dont need this because the member_access rule covers
12133 us here. So we replace the rule with just IDENTIFIER.
12135 This has two good effects. First, we remove a s/r conflict.
12136 Second, we allocate many fewer QualifiedIdentifier objects.
12138 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12140 * attribute.cs: Handle MarshalAs attributes as pseudo, and
12141 set the correct information via SRE. This prevents
12142 hanging on the MS runtime. Fixes #29374.
12144 2004-01-03 Ben Maurer <bmaurer@users.sourceforge.net>
12146 * convert.cs: correctly handle conversions to value types
12147 from Enum and ValueType as unboxing conversions.
12149 Fixes bug #52569. Patch by Benjamin Jemlich.
12151 2004-01-02 Ravi Pratap <ravi@ximian.com>
12153 * expression.cs (BetterConversion): Prefer int -> uint
12154 over int -> ulong (csc's behaviour). This fixed bug #52046.
12156 2004-01-02 Ben Maurer <bmaurer@users.sourceforge.net>
12158 * decl.cs (MemberCache.FindMembers): now returns a
12161 * typemanager.cs: In general, go with with ^^.
12162 (CopyNewMethods): take an IList.
12163 (RealMemberLookup): Only allocate an arraylist
12164 if we copy from two sets of methods.
12166 This change basically does two things:
12167 1) Fewer array lists allocated due to CopyNewMethods.
12168 2) the explicit cast in MemberList costed ALOT.
12170 2004-01-02 Zoltan Varga <vargaz@freemail.hu>
12172 * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
12173 a hashtable to avoid needless string allocations when an identifier is
12174 used more than once (the common case).
12176 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
12178 * pending.cs: MS's TypeBuilder.GetInterfaces ()
12179 is broken, it will not return anything. So, we
12180 have to use the information we have in mcs to
12183 * typemanager.cs: Add a cache for GetInterfaces,
12184 since this will now be used more often (due to ^^)
12186 (GetExplicitInterfaces) New method that gets the
12187 declared, not effective, interfaces on a type
12188 builder (eg, if you have interface IFoo, interface
12189 IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
12192 This patch makes MCS able to bootstrap itself on
12195 2004-01-01 Ben Maurer <bmaurer@users.sourceforge.net>
12197 * expression.cs: Remove the Nop's that Miguel put
12200 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12202 * report.cs, codegen.cs: Give the real stack trace to
12203 the error when an exception is thrown.
12205 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12207 * decl.cs: only allocate hashtables for ifaces if
12210 2003-12-31 Ben Maurer <bmaurer@users.sourceforge.net>
12212 * expression.cs: fix the error from cs0121-2.cs
12213 (a parent interface has two child interfaces that
12214 have a function with the same name and 0 params
12215 and the function is called through the parent).
12217 2003-12-30 Ben Maurer <bmaurer@users.sourceforge.net>
12219 * class.cs, rootcontext.cs, typmanager.cs: do not
12222 2003-12-28 Ben Maurer <bmaurer@users.sourceforge.net>
12224 * codegen.cs: remove stack for the ec flow branching.
12225 It is already a linked list, so no need.
12227 2003-12-27 Ben Maurer <bmaurer@users.sourceforge.net>
12229 * Makefile: Allow custom profiler here.
12231 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
12233 * typemanager.cs (LookupType):
12234 - Use a static char [], because split takes
12235 a param array for args, so it was allocating
12237 - Do not store true in a hashtable, it boxes.
12239 2003-12-26 Ben Maurer <bmaurer@users.sourceforge.net>
12241 * flowanalysis.cs: bytify common enums.
12243 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12245 * modifiers.cs: Add a new set of flags for the
12246 flags allowed on explicit interface impls.
12247 * cs-parser.jay: catch the use of modifiers in
12248 interfaces correctly.
12249 * class.cs: catch private void IFoo.Blah ().
12251 All related to bug #50572.
12253 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12255 * decl.cs: Rewrite the consistant accessability checking.
12256 Accessability is not linear, it must be implemented in
12257 a tableish way. Fixes #49704.
12259 2003-12-25 Ben Maurer <bmaurer@users.sourceforge.net>
12261 * expression.cs: Handle negation in a checked context.
12262 We must use subtraction from zero. Fixes #38674.
12264 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
12266 * class.cs: Ignore static void main in DLLs.
12267 * rootcontext.cs: Handle the target type here,
12268 since we are have to access it from class.cs
12269 * driver.cs: account for the above.
12271 2003-12-23 Ben Maurer <bmaurer@users.sourceforge.net>
12273 * report.cs: Give line numbers and files if available.
12275 2003-12-20 Zoltan Varga <vargaz@freemail.hu>
12277 * driver.cs: Implement /addmodule.
12279 * typemanager.cs: Change 'modules' field so it now contains Modules not
12282 2003-12-20 Martin Baulig <martin@ximian.com>
12284 * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
12285 (FieldBase.IsAssigned): Removed this field.
12286 (FieldBase.SetAssigned): New public method.
12287 (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
12289 2003-12-20 Martin Baulig <martin@ximian.com>
12291 * expression.cs (LocalVariableReference.DoResolve): Don't set
12292 `vi.Used' if we're called from DoResolveLValue().
12294 * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
12295 returns the usage vector it just merged into the current one -
12296 pass this one to UsageWarning().
12297 (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
12298 of the `EmitContext', don't call this recursively on our children.
12300 2003-12-19 Zoltan Varga <vargaz@freemail.hu>
12302 * driver.cs: Implement /target:module.
12304 2003-12-18 Zoltan Varga <vargaz@freemail.hu>
12306 * support.cs (CharArrayHashtable): New helper class.
12308 * cs-tokenizer.cs: Store keywords in a hashtable indexed by
12309 char arrays, not strings, so we can avoid creating a string in
12310 consume_identifier if the identifier is a keyword.
12312 2003-12-16 Martin Baulig <martin@ximian.com>
12314 * statement.cs (LocalInfo.Assigned): Removed this property.
12315 (LocalInfo.Flags): Removed `Assigned'.
12316 (LocalInfo.IsAssigned): New public method; takes the EmitContext
12317 and uses flow analysis.
12318 (Block.UsageWarning): Made this method private.
12319 (Block.Resolve): Call UsageWarning() if appropriate.
12321 * expression.cs (LocalVariableReference.DoResolve): Always set
12322 LocalInfo.Used here.
12324 2003-12-13 Martin Baulig <martin@ximian.com>
12326 * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
12327 any value here; we're now using flow analysis to figure out
12328 whether a statement/block returns a value.
12330 2003-12-13 Martin Baulig <martin@ximian.com>
12332 * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
12334 (FlowBranching.MergeFinally): Don't call
12335 `branching.CheckOutParameters()' here, this is called in
12337 (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
12338 when adding the `finally' vector.
12340 2003-12-13 Martin Baulig <martin@ximian.com>
12343 (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
12344 actually work and also fix #48962.
12346 2003-12-12 Ben Maurer <bmaurer@users.sourceforge.net>
12348 * decl.cs: Do not check System.Object for nested types,
12349 since we know it does not have any. Big bang for buck:
12352 Run 1: 8.35 seconds
12353 Run 2: 8.32 seconds
12354 corlib: 17.99 seconds
12356 Run 1: 8.17 seconds
12357 Run 2: 8.17 seconds
12358 corlib: 17.39 seconds
12360 2003-12-11 Ben Maurer <bmaurer@users.sourceforge.net>
12362 * class.cs (FindMembers): Allocate arraylists on demand. Most of the
12363 time we are returning 0 members, so we save alot here.
12365 2003-12-11 Martin Baulig <martin@ximian.com>
12367 * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
12368 `MergeChild()', also just take the `FlowBranching' as argument;
12369 call Merge() on it and return the result.
12370 (FlowBranching.Merge): We don't need to do anything if we just
12373 2003-12-11 Martin Baulig <martin@ximian.com>
12375 * flowanalysis.cs: Use a list of `UsageVector's instead of storing
12376 them in an `ArrayList' to reduce memory usage. Thanks to Ben
12377 Maurer for this idea.
12379 2003-12-11 Martin Baulig <martin@ximian.com>
12381 * flowanalysis.cs (MergeResult): This class is now gone; we now
12382 use the `UsageVector' for this. The reason for this is that if a
12383 branching just has one sibling, we don't need to "merge" them at
12384 all - that's the next step to do.
12385 (FlowBranching.Merge): We now return a `UsageVector' instead of a
12388 2003-12-11 Martin Baulig <martin@ximian.com>
12390 Reworked flow analyis and made it more precise and bug-free. The
12391 most important change is that we're now using a special `Reachability'
12392 class instead of having "magic" meanings of `FlowReturns'. I'll
12393 do some more cleanups and optimizations and also add some more
12394 documentation this week.
12396 * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
12397 largely reworked this class.
12398 (FlowReturns): Removed `Unreachable' and `Exception'; we now use
12399 the new `Reachability' class instead of having "magic" values here.
12400 (FlowBranching): We're now using an instance of `Reachability'
12401 instead of having separate `Returns', `Breaks' etc. fields.
12403 * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
12404 based on flow analysis; ignore the return value of block.Emit ().
12406 2003-12-10 Zoltan Varga <vargaz@freemail.hu>
12408 * driver.cs typemanager.cs: Find the mono extensions to corlib even
12409 if they are private.
12411 2003-12-09 Martin Baulig <martin@ximian.com>
12413 * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
12414 call them directly on the UsageVector.
12416 2003-12-09 Martin Baulig <martin@ximian.com>
12418 * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
12419 Changed return type from `FlowReturns' to `Reachability'.
12421 2003-12-09 Martin Baulig <martin@ximian.com>
12423 * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
12424 (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
12425 `Reachable' fields with a single `Reachability' one.
12427 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12429 * class.cs (FindMembers): Remove foreach's.
12434 Run 1: 8.74 seconds
12435 Run 2: 8.71 seconds
12438 Run 1: 8.64 seconds
12439 Run 2: 8.58 seconds
12442 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12447 This patch does a few things:
12448 1. EmptyStatement is now a singleton, so it is never reallocated.
12449 2. All blah is EmptyStatement constructs have been changed to
12450 blah == EmptyStatement.Value, which is much faster and valid
12451 now that EmptyStatement is a singleton.
12452 3. When resolving a block, rather than allocating a new array for
12453 the non-empty statements, empty statements are replaced with
12454 EmptyStatement.Value
12455 4. Some recursive functions have been made non-recursive.
12456 Mainly the performance impact is from (3), however (1) and (2) are needed for
12457 this to work. (4) does not make a big difference in normal situations, however
12458 it makes the profile look saner.
12463 9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12464 9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12465 Total memory allocated: 56397 KB
12468 9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
12469 8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
12470 Total memory allocated: 55666 KB
12472 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12474 * support.cs: Rewrite DoubleHash to use its own impl. Is faster
12475 than the hashtable in a hashtable version
12477 * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
12478 we always end up concating a string. This results in a huge perf
12479 loss, because many strings have to be tracked by the GC. In this
12480 patch, we first use a hashtable that works with two keys, so that
12481 the strings do not need to be concat'ed.
12485 Run 1: 8.74 seconds
12486 Run 2: 8.71 seconds
12489 Run 1: 8.65 seconds
12490 Run 2: 8.56 seconds
12492 2003-12-08 Ben Maurer <bmaurer@users.sourceforge.net>
12494 * Makefile: Add a new target `do-time' that does a quick and simple
12495 profile, leaving easy to parse output.
12497 2003-12-08 Zoltan Varga <vargaz@freemail.hu>
12499 * codegen.cs (Init): Create the dynamic assembly with
12500 AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
12502 2003-12-02 Ben Maurer <bmaurer@users.sourceforge.net>
12504 * support.cs: Make the PtrHashtable use only one
12505 instance of its comparer.
12507 2003-11-30 Zoltan Varga <vargaz@freemail.hu>
12509 * typemanager.cs: Fix lookup of GetNamespaces.
12511 2003-11-29 Miguel de Icaza <miguel@ximian.com>
12513 * expression.cs: Removed redundant line.
12515 * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
12516 ArrayLists, use for loops with bounds.
12518 * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
12521 * expression.cs (Invocation.OverloadResolve): Avoid foreach on
12522 arraylists, use for loop with bounds.
12524 The above three changes give us a 0.071 second performance
12525 improvement out of 3.294 seconds down to 3.223. On my machine
12526 the above changes reduced the memory usage by 1,387 KB during
12527 compiler bootstrap.
12529 * cs-parser.jay (QualifiedIdentifier): New class used to represent
12530 QualifiedIdentifiers. Before we created a new string through
12531 concatenation, and mostly later on, the result would be
12532 manipulated by DecomposeQI through string manipulation.
12534 This reduced the compiler memory usage for bootstrapping from
12535 59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
12536 compile times in 0.05 seconds.
12538 2003-11-28 Dick Porter <dick@ximian.com>
12540 * support.cs: Do string compares with the Invariant culture.
12548 * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
12549 the comparison is done with the Invariant culture.
12551 2003-11-27 Miguel de Icaza <miguel@ximian.com>
12553 * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
12554 GetEnumerator method.
12556 (ProbeCollectionType): Iterate starting at the most specific type
12557 upwards looking for a GetEnumerator
12559 * expression.cs: Shift count can be up to 31 for int/uint and 63
12562 2003-11-26 Miguel de Icaza <miguel@ximian.com>
12564 * statement.cs (Block.LookupLabel): Also look for the label on the
12565 children blocks. Use a hash table to keep track of visited
12568 * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12569 we actually did transform the other operand, otherwise fall back
12570 to the common codepath that casts to long.
12572 * cs-tokenizer.cs: Use the same code pattern as the int case.
12573 Maybe I should do the parsing myself, and avoid depending on the
12574 Parse routines to get this done.
12576 2003-11-25 Miguel de Icaza <miguel@ximian.com>
12578 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
12579 which fixes bug 51347. This time test it.
12581 * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12582 attributes for example can not tell the difference between these.
12583 The difference was only a syntax feature of the language.
12585 * attribute.cs: Apply attributes to delegates.
12587 * delegate.cs: Call the apply attributes method.
12589 2003-11-24 Miguel de Icaza <miguel@ximian.com>
12591 * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12592 comparing 0 vs Byte.MinValue, not the value
12594 (ImplicitConversionRequired): When reporting a conversion error,
12595 use error 31 to print out the constant error instead of the
12598 * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),
12599 which fixes bug 51347.
12601 2003-11-22 Miguel de Icaza <miguel@ximian.com>
12603 * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen)
12604 which fixes the -warnaserror command line option.
12606 2003-11-21 Miguel de Icaza <miguel@ximian.com>
12608 * cfold.cs (DoNumericPromotions): During constant folding of
12609 additions on UIntConstant, special case intconstants with
12610 IntConstants like we do on the expression binary operator.
12612 2003-11-12 Miguel de Icaza <miguel@ximian.com>
12614 * convert.cs (ImplicitReferenceConversion): We were missing a case
12615 (System.Enum are not value types or class types, so we need to
12616 classify them separatedly).
12618 * driver.cs: We do not support error 2007.
12620 2003-11-12 Jackson Harper <jackson@ximian.com>
12622 * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
12623 system directory. Also use the full file name so users can
12624 libraries names mscorlib-o-tron.dll in a non system dir.
12626 2004-01-04 David Sheldon <dave-mono@earth.li>
12628 * expression.cs: Added matching ")" to error message for CS0077.
12630 2003-12-19 Martin Baulig <martin@ximian.com>
12632 * typemanager.cs (TypeManager.IsEqualGenericType): New public
12633 static method; see documentation in the method.
12634 (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
12636 * convert.cs (Convert.ImplicitReferenceConversion,
12637 Convert.ImplicitReferenceConversionExists): Add support for
12638 generic type declarations; see gen-36.cs.
12640 2003-12-19 Martin Baulig <martin@ximian.com>
12642 * pending.cs (Pending.InterfaceMethod): Use
12643 `Type.IsAssignableFrom()' instead of `=='.
12645 2003-12-18 Martin Baulig <martin@ximian.com>
12647 * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
12650 * convert.cs (Convert.ImplicitStandardConversionExists): Use
12651 `expr_type.Equals (target_type)' instead of `=='.
12653 2003-12-08 Martin Baulig <martin@ximian.com>
12655 * generics.cs (Constraints.Types): Removed.
12656 (Constraints.Resolve): Just resolve everything to TypeExpr's, not
12658 (Constraints.ResolveTypes): New public method; resolves the
12659 TypeExpr's to Type's.
12660 (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
12661 longer takes the constraints.
12662 (TypeParameter.DefineMethod): Likewise.
12663 (TypeParameter.DefineType): New public method. Calls
12664 `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
12667 2003-12-08 Martin Baulig <martin@ximian.com>
12669 * convert.cs (Convert.ImplicitConversionStandard): Use
12670 `expr_type.Equals (target_type)' instead of `=='.
12672 2003-12-08 Martin Baulig <martin@ximian.com>
12674 * typemanager.cs (TypeManager.GetReferenceType): Call
12675 `Type.MakeByRefType ()'.
12677 2003-12-08 Martin Baulig <martin@ximian.com>
12679 * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
12680 just has some special meaning in some situations. For instance,
12681 it is allowed to use `where' as the name of a variable etc.
12683 2003-12-04 Martin Baulig <martin@ximian.com>
12685 * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12686 `Type.MakeArrayType()' for array types.
12688 2003-11-18 Miguel de Icaza <miguel@ximian.com>
12690 * expression.cs (Invocation.VerifyArgumentsCompat): Remove
12693 (SizeOf.DoResolve): assign the `type_queried' field. This gets
12696 2003-11-16 Martin Baulig <martin@ximian.com>
12698 * codegen.cs (EmitContext.IsGeneric): Removed.
12700 * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
12701 ResolveGeneric() on the DeclSpace.
12703 2003-11-16 Martin Baulig <martin@ximian.com>
12705 * generic.cs (TypeArguments.Resolve):
12706 `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
12707 `ResolveType()' on it to get the Type.
12709 2003-11-15 Martin Baulig <martin@ximian.com>
12711 * generic.cs (ConstructedType.GetInterfaces): Override this.
12713 2003-11-14 Martin Baulig <martin@ximian.com>
12715 * interface.cs (Interface.DefineType): Define all type parameters
12716 before adding the interfaces we inherit.
12718 2003-11-11 Martin Baulig <martin@ximian.com>
12720 * generic.cs (ConstructedType.ResolveType): Always call
12721 `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
12723 2003-11-10 Martin Baulig <martin@ximian.com>
12725 * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12726 (TypeManager.InitCoreTypes): Initialize them here, but instead of
12727 calling `ResolveType()' on them, directly assign their `Type'.
12729 2003-11-08 Martin Baulig <martin@ximian.com>
12731 * generic.cs (ConstructedType): Override `IsClass' etc.
12733 2003-11-08 Martin Baulig <martin@ximian.com>
12735 * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12736 return value and the `out parent' parameter.
12737 (TypeContainer.DefineType): Moved the CS0644 check into
12738 GetClassBases(). Don't pass the interface types to the
12739 `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12740 them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12742 * ecore.cs (TypeExpr.IsAttribute): New property.
12743 (TypeExpr.GetInterfaces): New method.
12745 * interface.cs (Interface.GetInterfaceTypeByName): Return a
12746 TypeExpr instead of a Type.
12747 (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12748 (Interface.DefineType): Don't pass the interface types to the
12749 `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12750 them later and then call `TypeBulider.AddInterfaceImplementation()'.
12752 * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12753 instead of a `Type[]'.
12754 (TypeManager.RegisterBuilder): Likewise.
12755 (TypeManager.AddUserInterface): Likewise.
12756 (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12757 `Type[]' and also return a `TypeExpr[]'.
12758 (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12760 2003-11-08 Martin Baulig <martin@ximian.com>
12762 * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12765 2003-11-08 Martin Baulig <martin@ximian.com>
12767 * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12768 TypeManager.ResolveExpressionTypes().
12770 * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12771 instead of an Expression.
12772 (TypeExpr): This is now an abstract base class for `TypeExpression'.
12773 (TypeExpression): New public class; formerly known as `TypeExpr'.
12775 * expression.cs (ComposedCast): Derive from TypeExpr.
12777 * typemanager.cs (TypeManager.system_*_expr): These are now
12778 TypExpr's instead of Expression's.
12779 (TypeManager.ResolveExpressionTypes): New public static function;
12780 called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12783 2003-11-06 Miguel de Icaza <miguel@ximian.com>
12785 * expression.cs (New.DoResolve): Do not dereference value that
12786 might be a null return.
12788 * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12789 sure that the constant value has the right type. Fixes an
12790 unreported bug, similar to 50425.
12792 * const.cs (Const.LookupConstantValue): Call
12793 ImplicitStandardConversionExists before doing a conversion to
12794 avoid havng the TypeManager.ChangeType do conversions.
12796 Reduced the number of casts used
12798 (Const.ChangeType): New routine to enable reuse of the constant
12799 type changing code from statement.
12801 * typemanager.cs (ChangeType): Move common initialization to
12802 static global variables.
12806 * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12807 every value type to go through, even if it was void. Fix that.
12809 * cs-tokenizer.cs: Use is_identifier_start_character on the start
12810 character of the define, and the is_identifier_part_character for
12811 the rest of the string.
12813 2003-11-05 Miguel de Icaza <miguel@ximian.com>
12815 * expression.cs (UnaryMutator.EmitCode): When I updated
12816 LocalVariableReference.DoResolve, I overdid it, and dropped an
12817 optimization done on local variable references.
12819 2003-11-04 Miguel de Icaza <miguel@ximian.com>
12821 * ecore.cs: Convert the return from Ldlen into an int.
12823 2003-10-20 Miguel de Icaza <miguel@ximian.com>
12825 * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12826 the accessibility, this is a special case for toplevel non-public
12827 classes (internal for instance).
12829 2003-10-20 Nick Drochak <ndrochak@gol.com>
12831 * ecore.cs: Fix typo and build. Needed another right paren.
12833 2003-10-19 Miguel de Icaza <miguel@ximian.com>
12835 * ecore.cs: Applied fix from Ben Maurer. We were handling in the
12836 `internal' case regular and protected, but not allowing protected
12837 to be evaluated later. Bug 49840
12839 2003-10-15 Miguel de Icaza <miguel@ximian.com>
12841 * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12842 to kb.Nlast, and not the kb.nFirst to isolate the switch
12845 Extract the underlying type, so enumerations of long/ulong are
12846 treated like long/ulong.
12848 2003-10-14 Miguel de Icaza <miguel@ximian.com>
12850 * expression.cs (New): Overload the meaning of RequestedType to
12851 track the possible creation of the NewDelegate type, since
12852 DoResolve is invoked more than once for new constructors on field
12855 See bugs: #48800 and #37014
12857 * cs-parser.jay (declare_local_constants): Take an arraylist
12858 instead of a single constant.
12860 (local_constant_declaration): It should take a
12861 constant_declarators, not a constant_declarator. Fixes 49487
12863 * convert.cs: Fix error report.
12865 2003-10-13 Jackson Harper <jackson@ximian.com>
12867 * typemanager.cs (TypeToCoreType): Add float and double this fixes
12870 2003-11-03 Martin Baulig <martin@ximian.com>
12872 * expression.cs (ArrayAccess.GetStoreOpcode): Added
12873 `out bool has_type_arg'; if set, we need to pass the type to
12875 (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
12876 Stelem_Any/Ldelem_Any for generic parameters.
12878 2003-11-02 Martin Baulig <martin@ximian.com>
12880 * expression.cs (Invocation.EmitCall): Use
12881 `TypeManager.IsValueType()' to check whether it's a value type.
12882 Don't set `struct_call' when calling a method on a type parameter.
12884 2003-11-02 Martin Baulig <martin@ximian.com>
12886 * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
12887 and removed the TypeBuilder argument.
12889 * typemanager.cs (TypeManager.IsValueType): Return
12890 `t.IsGenericParameter || t.IsValueType'.
12892 2003-10-25 Martin Baulig <martin@ximian.com>
12894 * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
12895 call ConstructedType.Resolve() on it.
12897 * generic.cs (ConstructedType.Resolve): Set `type' on success.
12899 2003-10-25 Martin Baulig <martin@ximian.com>
12901 * class.cs (TypeContainer.GetClassBases): Changed
12902 `out Type parent' into `out TypeExpr parent'. Moved CS0644 and
12903 CS8214 reporting here.
12904 (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
12905 instead of a `Type' for our parent. In case of a recursive
12906 declaration (see tests/gen-23.cs for an example), our parent is a
12907 ConstructedType and it doesn't have its type set. So, first
12908 create our own TypeBuilder, then call constructed.Resolve() to get
12909 the parent's type and finally TypeBuilder.SetParent() it.
12911 * ecore.cs (TypeExpr.Name): New public virtual property.
12914 (ConstructedType): We're now a TypeExpr and not just an Expression.
12915 (ConstructedType.ResolveAsTypeStep): Don't resolve our type
12916 arguments here; this is done later.
12917 (ConstructedType.Resolve): New public method to resolve the type
12918 arguments and bind them.
12920 2003-10-21 Martin Baulig <martin@ximian.com>
12922 * convert.cs: Use `TypeManager.IsValueType' instead of
12923 'type.IsValueType' everywhere.
12925 * typemanager.cs (TypeManager.IsValueType): Return true for type
12926 parameters. The reason for this is that we need to box a type
12927 parameter when converting it to a reference type.
12929 * cs-parser.jay: Added support for default value expressions.
12931 * generics.cs (DefaultValueExpression): New public class.
12933 2003-10-17 Martin Baulig <martin@ximian.com>
12935 * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
12936 TypeContainer so we can also use this for Interfaces.
12937 (TypeParameter.Resolve): Likewise.
12939 * interface.cs (Interface.DefineType): Added support for generic
12942 * cs-parser.jay: Added support for generic structs and interfaces.
12944 2003-10-17 Martin Baulig <martin@ximian.com>
12946 * generic.cs (GenericMemberAccess.DoResolve): We can now actually
12947 call generic methods :-)
12949 2003-10-16 Martin Baulig <martin@ximian.com>
12951 * cs-parser.jay (namespace_or_type_name): Only create a
12952 GenericMemberAccess if we actually have type arguments.
12954 2003-10-13 Martin Baulig <martin@ximian.com>
12956 * class.cs (Method.Define): If we're a generic method, call
12957 TypeBuilder.DefineGenericMethod () before resolving
12959 (MethodData): Added .ctor which takes an additional MethodBuilder
12960 argument; this is used for generic methods.
12961 (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
12962 we already have a MethodBuilder.
12964 2003-10-10 Martin Baulig <martin@ximian.com>
12966 * class.cs (Method): Added .ctor which takes a `GenericMethod'
12967 instead of a `DeclSpace'. This is used for generic methods.
12969 * cs-parser.jay (method_header): Added support for generic
12970 methods; create a `GenericMethod' instance and pass it to the
12971 `Method's .ctor; it'll be used as the `DeclSpace' to lookup
12972 parameters and locals.
12974 * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
12975 since we already have the location. Check whether we're a generic
12976 type declaration or a generic method and create the correct type
12979 * generic.cs (TypeParameter.DefineMethod): New public method.
12980 (GenericMethod): New public class; derives from DeclSpace and is
12981 used for generic methods.
12983 2003-10-09 Martin Baulig <martin@ximian.com>
12985 * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12987 (MethodCore.DoDefineParameters): Removed the TypeContainer
12988 argument; use the DeclSpace which was passed to the .ctor instead.
12989 (MethodCore.CheckParameter): Take a DeclSpace instead of a
12990 TypeContainer; we only need a DeclSpace here.
12992 2003-10-09 Martin Baulig <martin@ximian.com>
12994 * class.cs (MethodData): Added additional `DeclSpace ds' argument
12996 (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12997 EmitContext's .ctor.
12999 2003-10-09 Martin Baulig <martin@ximian.com>
13001 * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
13002 (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
13003 AsAccessible(), moved them as well.
13005 * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
13007 2003-10-07 Miguel de Icaza <miguel@ximian.com>
13009 * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
13010 generation for >=, as spotted by Paolo, bug 48679.
13011 Patch from David Waite.
13013 * cs-tokenizer.cs: Add handling for #pragma.
13015 * cs-parser.jay: Allow for both yield and yield return in the
13016 syntax. The anti-cobolization of C# fight will go on!
13018 * class.cs (TypeBuilder.DefineType): Catch error condition here
13019 (Parent.DefineType erroring out and returning null).
13021 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13022 coping with enumerations variables, we were mistakenly processing
13023 them as a regular value type instead of built-in types. Fixes the
13026 * typemanager.cs (IsBuiltinOrEnum): New method.
13028 2003-09-30 Miguel de Icaza <miguel@ximian.com>
13030 * cs-parser.jay: Upgrade: yield now needs the return clause.
13032 2003-10-08 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
13034 * cs-parser.jay : Renamed yyName to yyNames related to jay.
13036 2003-09-29 Martin Baulig <martin@ximian.com>
13038 * typemanager.cs (TypeManager.GetMethodFlags): Added support for
13039 inflated generic methods.
13041 * generics.cs (ConstructedType): Distinguish between open and
13042 closed constructed types; correctly resolve the arguments.
13044 2003-09-22 Martin Baulig <martin@ximian.com>
13046 * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
13047 all type arguments meet their constraints.
13049 2003-09-19 Martin Baulig <martin@ximian.com>
13051 * decl.cs (MemberCache.SetupCacheForInterface): Take a
13052 `MemberCache parent' argument. Normally, an interface doesn't
13053 have a parent type except System.Object, but we use this in gmcs
13054 for generic type parameters.
13056 2003-09-18 Martin Baulig <martin@ximian.com>
13058 * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
13059 on `type.IsInterface'; don't check whether the type has a parent
13060 to determine whether it's an interface.
13062 2003-09-17 Martin Baulig <martin@ximian.com>
13064 * generic.cs (ConstructedType.ToString): Always use `name' as the
13067 2003-09-15 Martin Baulig <martin@ximian.com>
13069 * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
13071 * generic.cs (Constraints.Resolve): New public method; this is
13072 called to resolve the constraint types and to check whether all
13073 the constraints are correct.
13074 (Constraints.Types): New public property.
13075 (TypeParameter.Resolve): New public method; resolves all the
13076 type's constraints.
13078 * class.cs (TypeContainer.DefineType): Call
13079 TypeParameter.Resolve() before actually defining the type.
13081 2003-09-15 Martin Baulig <martin@ximian.com>
13083 * class.cs (TypeContainer.DefineType): Added an error flag to
13084 avoid reporting duplicate CS0146's ("class definition is
13087 * driver.cs (Driver.MainDriver): Abort if
13088 RootContext.ResolveTree() reported any errors.
13090 2003-09-07 Martin Baulig <martin@ximian.com>
13092 * report.cs (Error, Warning): Added overloaded versions which take
13093 a `params object[] args' and call String.Format().
13095 2003-09-07 Martin Baulig <martin@ximian.com>
13097 * decl.cs (DeclSpace..ctor): Don't call
13098 NamespaceEntry.DefineName() here; do it in RecordDecl() which is
13099 called from Tree.RecordDecl(). Fixes the CS0101 reporting.
13100 (DeclSpace.RecordDecl): New method.
13102 * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
13104 2003-09-02 Ravi Pratap <ravi@ximian.com>
13106 * attribute.cs (CheckAttributeTarget): Ensure that we allow return
13107 value attributes to be applied to ParameterBuilders.
13109 * class.cs (MethodCore.LabelParameters): Make static and more
13110 generic so that it can be used from other places - like interface
13111 methods, for instance.
13113 * interface.cs (Interface.Emit): Call LabelParameters before
13114 emitting attributes on the InterfaceMethod.
13116 2003-09-07 Martin Baulig <martin@ximian.com>
13118 * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
13119 if the number of type parameters doesn't match.
13121 2003-09-04 Martin Baulig <martin@ximian.com>
13123 * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
13124 for arrays of generic type params (ie. `!0[]').
13126 2003-09-04 Martin Baulig <martin@ximian.com>
13128 * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
13131 2003-09-04 Martin Baulig <martin@ximian.com>
13133 * decl.cs (DeclSpace.LookupGeneric): New method.
13134 (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
13137 * generic.cs (TypeParameterExpr): Take a TypeParameter as
13138 argument, not just a string.
13139 (TypeParameter.Define): New public method; this is called to
13140 actually define the generic parameter; after this, you can use the
13141 new `Type' property to get the type.
13143 2003-09-04 Martin Baulig <martin@ximian.com>
13145 * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
13146 is now an ArrayList; initialize the result of the `TypeParameters'
13148 (DeclSpace.GetGenericData): Removed.
13149 (DeclSpace.LookupGeneric): Temporarily removed; we need to
13150 implement this in a different way.
13151 (DeclSpace.GetTypeParameters): Removed; there's now a
13152 `TypeParameters' property.
13153 (DeclSpace.TypeParameters): New public property.
13155 * generic.cs (Constraints): Make this class public.
13156 (TypeParameter): New public class.
13158 2003-09-04 Martin Baulig <martin@ximian.com>
13160 * decl.cs (DeclSpace.GetTypeParameters): New method to return the
13161 generic parameters.
13163 * class.cs (TypeContainer.DefineType): Call
13164 TypeBuilder.DefineGenericParameter () on all generic parameters if
13165 this is a generic type.
13167 2003-08-28 Martin Baulig <martin@ximian.com>
13169 * sample-stack.il: Compile this with ilasm: "ilasm /dll
13172 * sample-hello.cs: Compile this with gmcs: "gmcs
13173 /r:sample-stack.dll sample-hello.cs".
13175 2003-08-28 Martin Baulig <martin@ximian.com>
13177 * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
13178 the parameters to the generic type.
13180 2003-08-28 Martin Baulig <martin@ximian.com>
13182 * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
13184 2003-08-28 Martin Baulig <martin@ximian.com>
13186 * cs-parser.jay (opt_type_argument_list): Use
13187 `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
13188 (primary_expression): Replace `qualified_identifier' with `type_name'.
13189 (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
13191 * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
13192 parser to check whether it is syntactically a type parameter list;
13193 return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
13196 2003-08-26 Martin Baulig <martin@ximian.com>
13198 * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
13199 resolving aliases; fixes #47927.
13201 2003-08-26 Martin Baulig <martin@ximian.com>
13203 * statement.cs (Using.DoResolve): This is internally emitting a
13204 try/finally clause, so we need to set ec.NeedExplicitReturn if we
13205 do not always return. Fixes #47681.
13207 2003-08-26 Martin Baulig <martin@ximian.com>
13209 * decl.cs (MemberCore): Moved WarningNotHiding(),
13210 Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
13212 (AdditionResult): Make this nested in DeclSpace.
13213 (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
13214 argument; call NamespaceEntry.Define() unless we're nested in a
13217 * namespace.cs (Namespace.DefineName): New public function. This
13218 is called from DeclSpace's .ctor to add
13219 (Namespace.Lookup): Include DeclSpaces in the lookup.
13221 * class.cs (Operator): Derive from MemberBase, not MemberCore.
13223 * const.cs (Const): Derive from MemberBase, not MemberCore.
13225 2003-08-25 Martin Baulig <martin@ximian.com>
13227 * convert.cs (Convert.ExplicitReferenceConversion): When
13228 converting from an interface type to a class, unbox if the target
13229 type is a struct type. Fixes #47822.
13231 2003-08-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13233 * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
13236 2003-08-22 Martin Baulig <martin@ximian.com>
13238 * class.cs (TypeManager.DefineType): When defining a nested type,
13239 call DefineType() on our parent; fixes #47801.
13241 2003-08-22 Martin Baulig <martin@ximian.com>
13243 * class.cs (MethodData.Define): While checking if a method is an
13244 interface implementation, improve the test a bit more to fix #47654.
13246 2003-08-22 Martin Baulig <martin@ximian.com>
13248 * expression.cs (Probe.DoResolve): Check whether `expr' resolved
13249 correctly; fixes #47722.
13251 2003-08-22 Martin Baulig <martin@ximian.com>
13253 * expression.cs (UnaryMutator.ResolveVariable): If the target is a
13254 LocalVariableReference, ensure it's not read-only. Fixes #47536.
13256 * statement.cs (Fixed.DoResolve): Make all variables read-only.
13258 2003-08-22 Martin Baulig <martin@ximian.com>
13260 * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
13261 can only be assigned in static constructors. Fixes #47161.
13263 2003-08-22 Martin Baulig <martin@ximian.com>
13265 Rewrote and improved the flow analysis code.
13267 * flowbranching.cs (FlowBranching): Make this class abstract.
13268 (FlowBranching.CreateBranching): New static function to create a
13269 new flow branching.
13270 (FlowBranchingBlock, FlowBranchingException): New classes.
13271 (FlowBranching.UsageVector.Type): New public readonly field.
13272 (FlowBranching.UsageVector.Breaks): Removed the setter.
13273 (FlowBranching.UsageVector.Returns): Removed the setter.
13274 (FlowBranching.UsageVector): Added Break(), Return(),
13275 NeverReachable() and Throw() methods to modify the reachability.
13276 (FlowBranching.UsageVector.MergeChildren): Removed, this is now
13277 done by FlowBranching.Merge().
13278 (FlowBranching.UsageVector.MergeChild): New method; merges the
13279 merge result into the current vector.
13280 (FlowBranching.Merge): New abstract method to merge a branching.
13282 2003-08-12 Martin Baulig <martin@ximian.com>
13284 * expression.cs (Indirection.CacheTemporaries): Create the
13285 LocalTemporary with the pointer type, not its element type.
13287 2003-08-10 Miguel de Icaza <miguel@ximian.com>
13289 * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
13290 token was a keyword or not.
13292 Add `error' options where an IDENTIFIER was expected; Provide
13293 CheckToken and CheckIdentifierToken convenience error reporting
13296 Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
13298 * decl.cs: Rename `NamespaceEntry Namespace' public field into
13299 NameSpaceEntry NameSpaceEntry.
13301 (LookupInterfaceOrClass): Avoid creating a full qualified name
13302 from namespace and name: avoid doing lookups when we know the
13303 namespace is non-existant. Use new Tree.LookupByNamespace which
13304 looks up DeclSpaces based on their namespace, name pair.
13306 * driver.cs: Provide a new `parser verbose' to display the
13307 exception thrown during parsing. This is turned off by default
13308 now, so the output of a failure from mcs is more graceful.
13310 * namespace.cs: Track all the namespaces defined in a hashtable
13313 (IsNamespace): New method
13315 2003-08-09 Miguel de Icaza <miguel@ximian.com>
13317 * namespace.cs: Remove redundant call; Avoid using MakeFQN when
13318 we know that we need to concatenate (full typename can never be
13323 * statement.cs: Use a bitfield; Do not initialize to null things
13324 which are done by the constructor by default.
13326 * cs-parser.jay: bug fix, parameter was 4, not 3.
13328 * expression.cs: Just use the property;
13330 * statement.cs: No need for GetVariableInfo method.
13332 2003-08-08 Martin Baulig <martin@ximian.com>
13334 * flowanalysis.cs (FlowReturns): This is now nested in the
13335 `FlowBranching' class.
13336 (MyBitVector): Moved this here from statement.cs.
13337 (FlowBranching.SiblingType): New enum type.
13338 (FlowBranching.CreateSibling): Added `SiblingType' argument.
13340 2003-08-07 Martin Baulig <martin@ximian.com>
13342 * flowanalysis.cs (FlowBranchingType): This is now nested in the
13343 `FlowBranching' class and called `BranchingType'.
13345 2003-08-07 Martin Baulig <martin@ximian.com>
13347 * flowanalysis.cs: Moved all the control flow analysis code into
13350 2003-08-07 Martin Baulig <martin@ximian.com>
13352 * assign.cs (Assign.DoResolve): `target' must either be an
13353 IAssignMethod or an EventAccess; report a CS0131 otherwise. Fixes
13356 2003-08-07 Miguel de Icaza <miguel@ximian.com>
13358 * expression.cs (BinaryMethod): This kind of expression is created by the
13359 Binary class if it determines that the operator has to be handled
13362 (BinaryDelegate): This kind of expression is created if we are
13363 dealing with a + or - operator on delegates.
13365 (Binary): remove method, argumetns, and DelegateOperator: when
13366 dealing with methods,
13368 * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
13370 * statement.cs (Block): use bitfields for the three extra booleans
13371 we had in use. Remove unused topblock parameter.
13373 * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
13375 * assign.cs: Drop extra unneeded tests.
13377 2003-08-06 Miguel de Icaza <miguel@ximian.com>
13379 * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
13381 * statement.cs (Foreach): Use VariableStorage instead of
13384 * codegen.cs (VariableStorage): New class used by clients that
13385 require a variable stored: locals or fields for variables that
13386 need to live across yield.
13388 Maybe provide a convenience api for EmitThis+EmitLoad?
13390 (GetTemporaryLocal, FreeTemporaryLocal): Recycle
13393 2003-08-05 Miguel de Icaza <miguel@ximian.com>
13395 * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
13396 RemapParameterLValue): New methods that are used to turn a
13397 precomputed FieldInfo into an expression like this:
13401 The idea is to use this instead of making LocalVariableReference
13402 have more than one meaning.
13404 * cs-parser.jay: Add error production to BASE.
13406 * ecore.cs: Deal with TypeManager.GetField returning null, which
13407 is now a valid return value.
13409 (FieldExprNoAddress): New expression for Fields whose address can
13412 * expression.cs (LocalVariableReference): During the resolve
13413 phases, create new expressions if we are in a remapping context.
13414 Remove code that dealt with remapping here.
13416 (ParameterReference): same.
13418 (ProxyInstance): New expression, like the `This' expression, but
13419 it is born fully resolved. We know what we are doing, so remove
13420 the errors that are targeted to user-provided uses of `this'.
13422 * statement.cs (Foreach): our variable is now stored as an
13423 Expression; During resolution, follow the protocol, dont just
13424 assume it will return this.
13426 2003-08-06 Martin Baulig <martin@ximian.com>
13428 * support.cs (SeekableStreamReader.cs): New public class.
13430 * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
13431 SeekableStreamReader instead of the normal StreamReader.
13433 2003-08-04 Martin Baulig <martin@ximian.com>
13435 * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
13436 CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
13437 deambiguate casts and delegate invocations.
13438 (parenthesized_expression): Use the new tokens to ensure this is
13439 not a cast of method invocation.
13441 * cs-tokenizer.cs (is_punct): Return one of the new special tokens
13442 when reading a `)' and Deambiguate_CloseParens () was previously
13445 * expression.cs (ParenthesizedExpression): New class. This is
13446 just used for the CS0075 test.
13447 (Binary.DoResolve): Check for CS0075.
13449 2003-07-29 Ravi Pratap <ravi@ximian.com>
13451 * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
13452 Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
13453 reference comparison.
13455 (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
13456 examine the ReturnType for equality - this is necessary in the
13457 cases of implicit and explicit operators whose signature also
13458 includes the return type.
13460 2003-07-26 Miguel de Icaza <miguel@ximian.com>
13462 * namespace.cs: Cache the result of the namespace computation,
13463 instead of computing it every time.
13465 2003-07-24 Miguel de Icaza <miguel@ximian.com>
13467 * decl.cs: Use a global arraylist that we reuse over invocations
13468 to avoid excesive memory consumption. Reduces memory usage on an
13469 mcs compile by one meg (45 average).
13471 * typemanager.cs (LookupTypeReflection): In .NET pointers are
13472 private, work around that.
13474 2003-07-23 Miguel de Icaza <miguel@ximian.com>
13476 * literal.cs (IntLiteral): Define Zero and One static literals.
13478 * cs-parser.jay (integer_literal): use static literals to reduce
13479 memory usage for the most used literals (0, 1 and -1). 211kb
13480 reduced in memory usage.
13482 Replace all calls to `new ArrayList' with `new
13483 ArrayList(4)' which is a good average number for most allocations,
13484 and also requires only 16 bytes of memory for its buffer by
13487 This reduced MCS memory usage in seven megabytes for the RSS after
13490 2003-07-28 Ravi Pratap <ravi@ximian.com>
13492 * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
13493 handle params methods the correct way by forming only one
13494 applicable set with params and normal methods in them. Earlier we
13495 were looking at params methods only if we found no normal methods
13496 which was not the correct thing to do.
13498 (Invocation.BetterFunction): Take separate arguments indicating
13499 when candidate and the best method are params methods in their
13502 This fixes bugs #43367 and #46199.
13504 * attribute.cs: Documentation updates.
13506 (CheckAttribute): Rename to CheckAttributeTarget.
13507 (GetValidPlaces): Rename to GetValidTargets.
13509 * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
13510 bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
13514 2003-07-28 Miguel de Icaza <miguel@ximian.com>
13516 * codegen.cs: Compute IsGeneric correctly.
13518 * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
13521 Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
13522 OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN. There were too many
13523 regressions, and I was chasing more bugs than I required.
13525 * interface.cs: Use expressions for base type names (like classes
13526 and structs have been doing for a while now), and resolve that.
13527 This patch should probably go into head as well.
13529 This makes it one less user of FindType.
13531 2003-07-24 Miguel de Icaza <miguel@ximian.com>
13533 This compiler can not self host currently. Need to fix that.
13535 * Makefile: compile to `gmcs.exe'
13537 * driver.cs: Turn on v2 by default on gmcs.
13539 * generic.cs (ConstructedType): Does no longer take a container
13540 type argument; That will be taken care of later.
13542 (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
13543 Use SimpleName to resolve for now, so we can continue the work on
13544 the parser, until we get Type.GetType that understands generics.
13546 (ConstructedType.ToString): Implement
13548 (TypeArguments.Resolve): Resolve the child expressions as types.
13550 * cs-parser.jay: Rename interface_constraints to
13551 type_parameter_constraints
13553 (namespace_or_type_name): Only use constructed types for the basic
13554 construction, we will deal with identifier<...> later.
13556 (type/type_name): No longer call DecomposeQI, as
13557 namespace_or_type_name is always decoded now.
13559 2003-07-22 Ravi Pratap <ravi@ximian.com>
13561 * expression.cs (Invocation.OverloadResolve): Follow the spec more
13562 closely: we eliminate methods in base types when we have an
13563 applicable method in a top-level type.
13565 Please see section 14.5.5.1 for an exact description of what goes
13568 This fixes bug #45127 and a host of other related to corlib compilation.
13570 * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13571 array is the method corresponding to the top-level type (this is
13572 because of the changes made to icall.c) so we change this
13575 (MethodGroupExpr.Name): This too.
13577 * typemanager.cs (GetElementType): New method which does the right
13578 thing when compiling corlib.
13580 * everywhere: Make use of the above in the relevant places.
13582 2003-07-22 Martin Baulig <martin@ximian.com>
13584 * cs-parser.jay (invocation_expression): Moved
13585 `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
13586 `cast_expression', but create a InvocationOrCast which later
13587 resolves to either an Invocation or a Cast.
13589 * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
13590 method; call this before EmitStatement() to make sure that this
13591 expression can be used as a statement.
13593 * expression.cs (InvocationOrCast): New class; resolves to either
13594 an Invocation or a Cast.
13596 * statement.cs (StatementExpression): Call ResolveStatement() on
13597 the ExpressionStatement before emitting it.
13599 2003-07-21 Martin Baulig <martin@ximian.com>
13601 * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
13602 `ref' and `out' attributes match; fixes #46220.
13603 (MemberAccess.ResolveMemberAccess): You can't reference a type
13604 through an expression; fixes #33180.
13605 (Indexers.GetIndexersForType): Don't return the indexers from
13606 interfaces the class implements; fixes #46502.
13608 2003-07-21 Martin Baulig <martin@ximian.com>
13610 * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
13611 CS0661 checks; fixes bug #30442.
13613 2003-07-21 Martin Baulig <martin@ximian.com>
13615 * decl.cs (AdditionResult): Added `Error'.
13617 * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
13619 * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
13620 cs0031.cs actually work.
13622 2003-07-20 Miguel de Icaza <miguel@ximian.com>
13624 * cs-parser.jay (namespace_name): do not use
13625 namespace_or_type_name, use qualified_identifier, because
13626 namespace_or_type_name will soon return a composed expression
13627 instead of a string.
13629 (namespace_or_type_name): Instead of returning a string, now this
13630 production returns an expression.
13632 * codegen.cs (EmitContext): Setup IsGeneric property based on
13633 whether our DeclSpace is generic, our the method is generic.
13635 * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
13636 the method is generic.
13638 * cs-parser.jay (type_arguments, opt_type_argument_list,
13639 type_parameters, type_parameter_list, opt_type_parameter_list,
13640 type_parameter,, opt_type_parameter_constraints_clauses,
13641 type_parameter_constraints_clauses,
13642 type_parameter_constraint_clause, type_parameter_constraint,
13643 interface_constraints): Add new production
13645 * decl.cs (DeclSpace): IsGeneric, flag to track whether this
13646 DeclSpace is generic or not.
13648 (DeclSpace.SetParameterInfo): New routine, used to set the
13649 parameter info for a type.
13651 (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
13652 returns a GenericTypeExpr
13654 * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
13655 generic, lookup the generic argument.
13657 * attribute.cs: Do not allow TypeParameterExpressions in
13660 * class.cs: Do not allow the Main method to be defined in a
13663 * expression.cs (SizeOf): Do not allow generic types to be used as
13664 arguments to sizeof.
13666 * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
13667 it: whether a type is generic or not. Only works for types we are
13668 currently building for now.
13670 2003-07-20 Martin Baulig <martin@ximian.com>
13672 * namespace.cs: Fixed that bug which caused a crash when compiling
13673 the debugger's GUI.
13675 2003-07-20 Miguel de Icaza <miguel@ximian.com>
13677 * typemanager.cs (LookupTypeReflection): Never expose types which
13678 are NotPublic, NestedPrivate, NestedAssembly, or
13679 NestedFamANDAssem. We used to return these, and later do a check
13680 that would report a meaningful error, but the problem is that we
13681 would not get the real match, if there was a name override.
13683 2003-07-18 Miguel de Icaza <miguel@ximian.com>
13685 * namespace.cs (Namespace, Name): Do not compute the namespace
13686 name dynamically, compute it in the constructor. This reduced
13687 memory usage by 1697 KB.
13689 * driver.cs: Use --pause to pause at the end.
13691 2003-07-17 Peter Williams <peter@newton.cx>
13693 * Makefile: Change the name of the test target so that it doesn't
13694 conflict with the recursive test target.
13696 2003-07-17 Miguel de Icaza <miguel@ximian.com>
13698 * expression.cs (LocalVariableReference.Emit, EmitAssign,
13699 AddressOf): Do not use EmitThis, that was wrong, use the actual
13702 2003-07-15 Miguel de Icaza <miguel@ximian.com>
13704 * class.cs (MethodData.Define): While checking if a method is an
13705 interface implementation, improve the test: If we are not public
13706 (use new test here: use the computed MethodAttributes directly,
13707 instead of the parsed modifier flags) check if the `implementing'
13708 method comes from an interface or not.
13710 * pending.cs (VerifyPendingMethods): Slightly better error
13713 * makefile: add test target that does the mcs bootstrap.
13715 2003-07-16 Ravi Pratap <ravi@ximian.com>
13717 * interface.cs (Define): Do nothing here since there are no
13718 members to populate etc. Move the attribute emission out of here
13719 since this was just totally the wrong place to put it. Attribute
13720 application happens during the 'Emit' phase, not in the 'Define'
13723 (Emit): Add this method and move the attribute emission here
13725 * rootcontext.cs (EmitCode): Call the Emit method on interface
13728 2003-07-14 Ravi Pratap M <ravi@ximian.com>
13730 * expression.cs (OverloadResolve): Report error only if Location
13731 is not 'Null' which means that there was a probe going on.
13733 2003-07-14 Martin Baulig <martin@ximian.com>
13735 * expression.cs (ConditionalLogicalOperator): New public class to
13736 implement user defined conditional logical operators.
13737 This is section 14.11.2 in the spec and bug #40505.
13739 2003-07-14 Martin Baulig <martin@ximian.com>
13741 * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13743 2003-07-14 Martin Baulig <martin@ximian.com>
13745 * codegen.cs (EmitContext.InFixedInitializer): New public field.
13747 * ecore.cs (IVariable.VerifyFixed): New interface method.
13749 * expression.cs (Unary.ResolveOperator): When resolving the `&'
13750 operator, check whether the variable is actually fixed. Fixes bug
13751 #36055. Set a variable definitely assigned when taking its
13752 address as required by the spec.
13754 * statement.cs (LocalInfo.IsFixed): New field.
13755 (LocalInfo.MakePinned): Set `IsFixed' to true.
13757 2003-07-14 Ravi Pratap M <ravi@ximian.com>
13759 * attribute.cs (Attribute.Resolve): While doing a Member lookup
13760 for .ctors, ensure that we only ask for members declared in the
13761 attribute type (BindingFlags.DeclaredOnly).
13765 * expression.cs (Error_WrongNumArguments): Report error 1501
13766 correctly the way CSC does.
13768 2003-07-13 Martin Baulig <martin@ximian.com>
13770 * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13771 lookup on the fully qualified name, to make things like "X.X" work
13772 where "X.X" is a fully qualified type name, but we also have a
13773 namespace "X" in the using list. Fixes #41975.
13775 2003-07-13 Martin Baulig <martin@ximian.com>
13777 * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13778 function. If we're a CompoundAssign, we need to create an embedded
13779 CompoundAssign, not an embedded Assign.
13780 (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13783 2003-07-13 Martin Baulig <martin@ximian.com>
13785 * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13786 work to fix bug #46088.
13788 2003-07-13 Ravi Pratap <ravi@ximian.com>
13790 * class.cs (Operator.Emit): Do not emit attributes here - it is
13791 taken care of by the Method class that we delegate too. This takes
13792 care of bug #45876.
13794 2003-07-10 Martin Baulig <martin@ximian.com>
13796 * expression.cs (TypeOfVoid): New class.
13797 (TypeOf): Report a CS0673 if it's System.Void. Fixes #42264.
13799 2003-07-10 Martin Baulig <martin@ximian.com>
13801 * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13804 2003-07-10 Martin Baulig <martin@ximian.com>
13806 * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13807 not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13809 * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13811 * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13813 2003-07-10 Martin Baulig <martin@ximian.com>
13815 * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13816 of decimal. Fixes #42850.
13818 NOTE: I also fixed the created byte blob, but this doesn't work on
13819 the MS runtime and csc never produces any byte blobs for decimal
13822 2003-07-10 Martin Baulig <martin@ximian.com>
13824 * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13825 structs; fixes #32068.
13826 (Block.AddChildVariableNames): Fixed #44302.
13828 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13830 * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
13832 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13834 * attribute.cs: And this test is onger needed.
13836 2003-07-08 Martin Baulig <martin@ximian.com>
13838 * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13839 inaccessible types. Fixes #36313.
13841 * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13843 * namespace.cs (NamespaceEntry): Create implicit entries for all
13844 namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13845 implicit entries for N1.N2 and N1.
13847 2003-07-08 Martin Baulig <martin@ximian.com>
13849 Rewrote the handling of namespaces to fix a lot of the issues
13850 wrt. `using' aliases etc.
13852 * namespace.cs (Namespace): Splitted this class into a
13853 per-assembly `Namespace' and a per-file `NamespaceEntry'.
13855 * typemanager.cs (TypeManager.IsNamespace): Removed.
13856 (TypeManager.ComputeNamespaces): Only compute namespaces from
13857 loaded assemblies here, not the namespaces from the assembly we're
13858 currently compiling.
13860 2003-07-08 Martin Baulig <martin@ximian.com>
13862 * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13864 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13866 * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13869 I thought about the memory savings here, but LookupTypeReflection
13870 is used under already very constrained scenarios. Compiling
13871 corlib or mcs only exposes one hit, so it would not really reduce
13872 any memory consumption.
13874 2003-07-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
13876 * typemanager.cs: fixes bug #45889 by only adding public types from
13877 other assemblies to the list of known types.
13879 2003-07-07 Miguel de Icaza <miguel@ximian.com>
13881 * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13882 on the type we resolved.
13884 2003-07-05 Martin Baulig <martin@ximian.com>
13886 * pending.cs (PendingImplementation.ParentImplements): Don't
13887 create the proxy if the parent is abstract.
13889 * class.cs (TypeContainer.DefineIndexers): Process explicit
13890 interface implementations first. Fixes #37714.
13892 2003-07-04 Miguel de Icaza <miguel@ximian.com>
13894 * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13895 defined recursively; but since we modify the input parameters
13896 (left is set to `this' temporarily), we reset this value if the
13897 left_is_explicit is false, which gives the original semantics to
13900 * literal.cs (NullPointer): new class used to represent a null
13901 literal in a pointer context.
13903 * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13904 type is a pointer, use a NullPointer object instead of a
13905 NullLiteral. Closes 43687
13907 (ExplicitConversion): Convert pointer values using
13908 the conv opcode to the proper type.
13910 * ecore.cs (New): change ValueTypeVariable property into a method,
13911 that returns whether the valuetype is suitable for being used.
13913 * expression.cs (Binary.DoNumericPromotions): Only return if we
13914 the int constant was a valid uint, and we can return both left and
13915 right as uints. If not, we continue processing, to trigger the
13916 type conversion. This fixes 39018.
13918 * statement.cs (Block.EmitMeta): During constant resolution, set
13919 the CurrentBlock property on the emitcontext, so that we resolve
13920 constants propertly.
13922 2003-07-02 Martin Baulig <martin@ximian.com>
13924 * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13925 (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13927 * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13928 than emitting it here.
13930 * statement.cs: Fixed some more flow analysis bugs.
13932 2003-07-02 Martin Baulig <martin@ximian.com>
13934 * class.cs (MethodData.Define): When implementing interface
13935 methods, set Final unless we're Virtual.
13937 * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
13938 check work for interface methods.
13940 2003-07-01 Martin Baulig <martin@ximian.com>
13942 * ecore.cs (EmitContext.This): Replaced this property with a
13943 GetThis() method which takes a Location argument. This ensures
13944 that we get the correct error location for a CS0188.
13946 2003-07-01 Miguel de Icaza <miguel@ximian.com>
13948 * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13949 ImplicitStandardConversion.
13951 * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13953 2003-07-01 Zoltan Varga <vargaz@freemail.hu>
13955 * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13958 2003-06-30 Miguel de Icaza <miguel@ximian.com>
13960 * class.cs (Constructor.Define): Turn off initlocals for unsafe
13963 (MethodData.Define): Turn off initlocals for unsafe methods.
13965 2003-06-29 Miguel de Icaza <miguel@ximian.com>
13967 * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13968 complete; Fixes #37521.
13970 * delegate.cs: Use Modifiers.TypeAttr to compute the
13971 TypeAttributes, instead of rolling our own. This makes the flags
13972 correct for the delegates.
13974 2003-06-28 Miguel de Icaza <miguel@ximian.com>
13976 * class.cs (Constructor.Define): Set the private flag for static
13977 constructors as well.
13979 * cs-parser.jay (statement_expression): Set the return value to
13980 null, to avoid a crash when we catch an error.
13982 2003-06-24 Miguel de Icaza <miguel@ximian.com>
13984 * cs-parser.jay: Applied patch from Jackson that adds support for
13985 extern and unsafe modifiers to destructor declarations.
13987 * expression.cs: Report error 21 if the user is trying to index a
13990 * driver.cs: Add an error message, suggested by the bug report.
13992 * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13993 if we do not have a ": this ()" constructor initializer. Fixes 45149
13995 2003-06-14 Miguel de Icaza <miguel@ximian.com>
13997 * namespace.cs: Add some information to reduce FAQs.
13999 2003-06-13 Miguel de Icaza <miguel@ximian.com>
14001 * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
14002 underlying enumeration types. Fixes #43915.
14004 * expression.cs: Treat ushort/short as legal values to be used in
14005 bitwise operations.
14007 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
14009 * delegate.cs: transfer custom attributes for paramenters from
14010 the delegate declaration to Invoke and BeginInvoke.
14012 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
14014 * attribute.cs: handle custom marshalers and emit marshal info
14017 2003-05-28 Hector E. Gomez Morales <hgomez_36@flashmail.com>
14019 * makefile.gnu: Added anonymous.cs to the compiler sources.
14021 2003-05-28 Miguel de Icaza <miguel@ximian.com>
14023 * iterators.cs: Change the name of the proxy class to include two
14026 * cs-parser.jay: Update grammar to include anonymous methods.
14028 * anonymous.cs: new file.
14030 2003-05-27 Miguel de Icaza <miguel@ximian.com>
14032 * class.cs (Field.Define): Add missing test for pointers and
14035 2003-05-27 Ravi Pratap <ravi@ximian.com>
14037 * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
14038 we use the stobj opcode.
14040 (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
14041 since it wasn't the correct fix.
14043 It still is puzzling that we are required to use stobj for IntPtr
14044 which seems to be a ValueType.
14046 2003-05-26 Miguel de Icaza <miguel@ximian.com>
14048 * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
14049 during regular simple name resolution. Now, the trick is that
14050 instead of returning for processing the simplename, we do a
14051 TypeManager.LookupType (ie, a rooted lookup as opposed to a
14052 contextual lookup type). If a match is found, return that, if
14053 not, return for further composition.
14055 This fixes long-standing 30485.
14057 * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14058 using the address to initialize an object, do an Stobj instead of
14059 using the regular Stelem.
14061 (IndexerAccess.Emit, IndexerAccess.EmitAssign):
14062 Pass `is_base_indexer' to Invocation.EmitCall instead of false.
14063 Because if we are a BaseIndexerAccess that value will be true.
14066 * statement.cs (GotoCase.Resolve): Return after reporting an
14067 error, do not attempt to continue.
14069 * expression.cs (PointerArithmetic.Emit): If our operand is a
14070 long, convert our constants to match the operand before
14071 multiplying. Convert to I type before adding. Fixes 43670.
14073 2003-05-14 Ravi Pratap <ravi@ximian.com>
14075 * enum.cs (ImplicitConversionExists) : Rename to
14076 ImplicitEnumConversionExists to remove ambiguity.
14078 * ecore.cs (NullCast): New type of cast expression class which
14079 basically is very similar to EmptyCast with the difference being
14080 it still is a constant since it is used only to cast a null to
14082 (eg. (string) null)
14084 * convert.cs (ImplicitReferenceConversion): When casting a null
14085 literal, we return a NullCast.
14087 * literal.cs (NullLiteralTyped): Remove - I don't see why this
14088 should be around anymore.
14090 The renaming (reported was slightly wrong). Corrections:
14092 ConvertImplicitStandard -> ImplicitConversionStandard
14093 ConvertExplicitStandard -> ExplicitConversionStandard
14095 * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
14096 before passing them in !
14098 * convert.cs (ImplicitConversionStandard): When comparing for
14099 equal expr and target types, ensure that expr is not a
14102 In general, we must not be checking (expr_type ==
14103 target_type) in the top level conversion methods
14104 (ImplicitConversion, ExplicitConversion etc). This checking is
14105 done in the methods that they delegate to.
14107 2003-05-20 Miguel de Icaza <miguel@ximian.com>
14109 * convert.cs: Move Error_CannotConvertType,
14110 ImplicitReferenceConversion, ImplicitReferenceConversionExists,
14111 ImplicitNumericConversion, ImplicitConversionExists,
14112 ImplicitUserConversionExists, StandardConversionExists,
14113 FindMostEncompassedType, FindMostSpecificSource,
14114 FindMostSpecificTarget, ImplicitUserConversion,
14115 ExplicitUserConversion, GetConversionOperators,
14116 UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
14117 TryImplicitIntConversion, Error_CannotConvertImplicit,
14118 ConvertImplicitRequired, ConvertNumericExplicit,
14119 ExplicitReferenceConversionExists, ConvertReferenceExplicit,
14120 ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
14123 Perform the following renames:
14125 StandardConversionExists -> ImplicitStandardConversionExists
14126 ConvertImplicit -> ImplicitConversion
14127 ConvertImplicitStandard -> ImplicitStandardConversion
14128 TryImplicitIntConversion -> ImplicitIntConversion
14129 ConvertImplicitRequired -> ImplicitConversionRequired
14130 ConvertNumericExplicit -> ExplicitNumericConversion
14131 ConvertReferenceExplicit -> ExplicitReferenceConversion
14132 ConvertExplicit -> ExplicitConversion
14133 ConvertExplicitStandard -> ExplicitStandardConversion
14135 2003-05-19 Martin Baulig <martin@ximian.com>
14137 * statement.cs (TypeInfo.StructInfo): Made this type protected.
14138 (TypeInfo): Added support for structs having structs as fields.
14140 * ecore.cs (FieldExpr): Implement IVariable.
14141 (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
14142 VariableInfo for the field.
14144 2003-05-18 Martin Baulig <martin@ximian.com>
14146 * expression.cs (This.DoResolve): Report a CS0027 if we're
14147 emitting a field initializer.
14149 2003-05-18 Martin Baulig <martin@ximian.com>
14151 * expression.cs (This.ResolveBase): New public function.
14152 (This.DoResolve): Check for CS0188.
14154 * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
14157 * ecore.cs (MethodGroupExpr.DoResolve): Set the
14158 `instance_expression' to null if we don't have any non-static
14161 2003-05-18 Martin Baulig <martin@ximian.com>
14163 Reworked the way how local variables and parameters are handled by
14164 the flow analysis code.
14166 * statement.cs (TypeInfo, VariableMap): New public classes.
14167 (VariableInfo): New public class. This is now responsible for
14168 checking whether a variable has been assigned. It is used for
14169 parameters and local variables.
14170 (Block.EmitMeta): Take the InternalParameters as argument; compute
14171 the layout of the flow vectors here.
14172 (Block.LocalMap, Block.ParameterMap): New public properties.
14173 (FlowBranching): The .ctor doesn't get the InternalParameters
14174 anymore since Block.EmitMeta() now computes the layout of the flow
14176 (MyStructInfo): This class is now known as `StructInfo' and nested
14177 in `TypeInfo'; we don't access this directly anymore.
14179 * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
14180 property and removed IsAssigned(), IsFieldAssigned(),
14181 SetAssigned() and SetFieldAssigned(); we now call them on the
14182 VariableInfo so we don't need to duplicate this code everywhere.
14184 * expression.cs (ParameterReference): Added `Block block' argument
14186 (LocalVariableReference, ParameterReference, This): The new
14187 VariableInfo class is now responsible for all the definite
14190 * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
14191 IsParameterAssigned, SetParameterAssigned): Removed.
14193 2003-05-18 Martin Baulig <martin@ximian.com>
14195 * typemanager.cs (InitCoreTypes): Try calling
14196 SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
14197 the 3-args-version. Corlib now also needs our `void_type'.
14198 (GetMethod): Added overloaded version which takes an optional
14199 `bool report_errors' to allow lookups of optional methods.
14201 2003-05-12 Martin Baulig <martin@ximian.com>
14203 * statement.cs (VariableInfo): Renamed to LocalInfo since it's
14204 only used for locals and not for parameters.
14206 2003-05-12 Miguel de Icaza <miguel@ximian.com>
14208 * support.cs (InternalParameters.ParameterType): Return the
14209 ExternalType of the parameter.
14211 * parameter.cs (Parameter.ExternalType): drop the two arguments,
14214 2003-05-11 Miguel de Icaza <miguel@ximian.com>
14216 * class.cs (MethodData.Define): Do not set the `newslot' on
14217 interface members, if they are also flagged as "override".
14219 * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
14220 better code for ++i and i++. This only works for static fields
14221 and local variables.
14223 * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
14224 want to pull the DeclSpace out of the builder_to_declspace instead
14225 of the TypeBuilder (like in TypeContainer.FindMembers).
14227 * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
14228 instead of LookupTypeContainer. Fixes the crash on .NET for
14229 looking up interface members.
14231 * const.cs: Create our own emit context during the Definition
14232 stage, so that constants are evaluated in the proper context, when
14233 a recursive definition happens.
14235 2003-05-11 Martin Baulig <martin@ximian.com>
14237 * statement.cs (Block.CreateSwitchBlock): New method. Creates a
14238 new block for a switch section.
14239 (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
14240 the adding/lookup in the switch block. Fixes #39828.
14242 2003-05-09 Miguel de Icaza <miguel@ximian.com>
14244 * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
14245 functionality: I needed to convert the data after I had performed
14246 the add/sub operation into the operands type size.
14248 * ecore.cs (ImplicitReferenceConversion): When boxing an interface
14249 pass the type for the box operation, otherwise the resulting
14250 object would have been of type object.
14252 (BoxedCast): Add constructor to specify the type to box as.
14254 2003-05-07 Miguel de Icaza <miguel@ximian.com>
14256 * iterators.cs: I was reusing the `count' variable inadvertently,
14257 take steps to not allow this to happen.
14259 2003-05-06 Miguel de Icaza <miguel@ximian.com>
14261 * attribute.cs (Attribute.Resolve): Params attributes are encoded
14262 by creating an array at the point where the params starts and
14263 putting all those arguments there, then adjusting the size of the
14266 2003-05-05 Miguel de Icaza <miguel@ximian.com>
14268 * expression.cs (New.AddressOf): Implement interface
14269 IMemoryLocation. This is used when the `new' operator is used in
14270 the context of an invocation to a method on a value type.
14272 See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
14275 * namespace.cs: Also check the using aliases here.
14277 * driver.cs: Move the test for using validity after the types have
14278 been entered, so we do a single pass that also includes the using
14281 * statement.cs (Try.Resolve): Avoid crashing if there is a failure
14282 in the regular case. CreateSiblingForFinally is doing extra
14285 * attribute.cs (GetAttributeArgumentExpression): Store the result
14286 on an out value, and use the return value to indicate failure
14287 instead of using null (which is a valid return for Constant.GetValue).
14289 * statement.cs: Perform the analysis flow for the increment
14290 portion after the statement, because this will be the real flow of
14291 execution. Fixes #42385
14293 * codegen.cs (EmitContext.EmitArgument,
14294 EmitContext.EmitStoreArgument): New helper functions when the
14295 RemapToProxy flag is set.
14297 * expression.cs (ParameterReference.EmitLdarg): Expose this useful
14300 Add support for remapping parameters.
14302 * iterators.cs: Propagate parameter values; Store parameter
14303 values in the proxy classes.
14305 2003-05-04 Miguel de Icaza <miguel@ximian.com>
14307 * ecore.cs (FieldExpr): Fix an obvious bug. static fields do not
14308 need a proxy reference; I do not know what I was thinking
14310 * cs-parser.jay (constructor_initializer): catch another error,
14311 and display nice message.
14313 (field_declaration): catch void field declaration
14314 to flag a better error.
14316 * class.cs (MemberBase.CheckBase): Report an error instead of a
14317 warning if a new protected member is declared in a struct.
14318 (Field.Define): catch the error of readonly/volatile.
14320 * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
14322 (FieldExpr.AddressOf): ditto. Catch error where the address of a
14323 volatile variable is taken
14325 2003-05-02 Miguel de Icaza <miguel@ximian.com>
14327 * statement.cs (Fixed.Resolve): Report an error if we are not in
14330 2003-05-01 Miguel de Icaza <miguel@ximian.com>
14332 * typemanager.cs: reuse the code that handles type clashes for
14333 delegates and enumerations.
14335 * class.cs (Report28): Always report.
14337 * expression.cs (EncodeAsAttribute): Allow nulls here.
14339 2003-04-28 Miguel de Icaza <miguel@ximian.com>
14341 * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
14342 the functionality for testing whether an expression is valid for
14343 an attribute here. Also handle the case of arrays of elements
14346 * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
14347 encoding a linear array into an array of objects that are suitable
14348 to be passed to an CustomAttributeBuilder.
14350 * delegate.cs: Check unsafe types being used outside of an Unsafe context.
14352 * ecore.cs: (FieldExpr): Handle field remapping here.
14354 * iteratators.cs: Pass the instance variable (if the method is an
14355 instance method) to the constructors, so we can access the field
14356 variables on the class.
14358 TODO: Test this with structs. I think the THIS variable on
14359 structs might have to be a pointer, and not a refenrece
14361 2003-04-27 Miguel de Icaza <miguel@ximian.com>
14363 * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
14364 local variables to fields in a proxy class.
14366 * iterators.cs (PopulateProxy): Rename our internal fields to
14368 Create a <THIS> field if we are an instance method, so we can
14369 reference our parent container variables.
14370 (MapVariable): Called back from the EmitContext code to enter a
14371 new variable to field mapping into the proxy class (we just create
14375 (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
14376 for using the remapped locals to fields.
14378 I placed the code here, because that gives the same semantics to
14379 local variables, and only changes the Emit code.
14381 * statement.cs (Fixed.Resolve): it is not allowed to have fixed
14382 statements inside iterators.
14383 (VariableInfo): Add a FieldBuilder for the cases when we are
14384 remapping local variables to fields in a proxy class
14386 * ecore.cs (SimpleNameResolve): Avoid testing two times for
14387 current_block != null.
14389 * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
14390 not cope with strings, as it has been moved to the
14391 TableSwitchEmit. Fixed bug in switch generation.
14393 * expression.cs (New.DoResolve): Provide more context for the user
14394 when reporting an error.
14396 * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
14399 * expression.cs (MemberAccess.DoResolve): When we get a type back,
14400 check the permissions for it. Note than in a type-resolution
14401 context the check was already present in DeclSpace.ResolveType,
14402 but was missing from the MemberAccess.
14404 (ArrayCreation.CheckIndices): warn if the user has
14405 more nested levels of expressions, but there are no more
14406 dimensions specified. Avoids crash on bug 41906.
14408 2003-04-26 Miguel de Icaza <miguel@ximian.com>
14410 * statement.cs (Block): replace Implicit bool, for a generic
14412 New flag: `Unchecked'. This is used during the EmitMeta phase
14413 (which is out-of-line with the regular Resolve/Emit process for a
14414 statement, as this is done ahead of time, but still gets a chance
14415 to call constant resolve).
14417 (Block.Flags): new enum for adding a new flag.
14419 (Block.EmitMeta): track the state of unchecked.
14421 (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
14422 to enable constant resolution to work there as well.
14424 2003-04-22 Miguel de Icaza <miguel@ximian.com>
14426 * typemanager.cs (ienumerable_type): Also look up
14427 System.Collections.IEnumerable.
14429 2003-04-21 Miguel de Icaza <miguel@ximian.com>
14431 TODO: Test more than one conditional per method.
14433 * class.cs (Indexer.Define): Report the location where the user is
14434 referencing the unsupported feature.
14436 (MethodData): Overload the use of `conditionals' to
14437 minimize the creation of needless ArrayLists. This saves roughly
14438 212kb on my machine.
14440 (Method): Implement the new IIteratorContainer interface.
14441 (Method.SetYields): Implement the method by setting the ModFlags
14442 to contain METHOD_YIELDS.
14444 * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
14445 which just got set to null.
14447 * iterators.cs: New file.
14449 (Yield, YieldBreak): New statements.
14451 * statement.cs (Return.Resolve): Flag an error if we are used in
14452 an iterator method.
14454 * codegen.cs (InIterator): New flag set if the code is being
14455 compiled in an iterator method.
14457 * modifiers.cs: New flag METHOD_YIELDS. This modifier is an
14458 internal modifier, and we just use it to avoid adding extra
14459 fields, as this is seldom used.
14461 * cs-parser.jay: Add yield_statement (yield and yield break).
14463 * driver.cs: New flag -v2 to turn on version 2 features.
14465 * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
14466 hashtable when v2 is enabled.
14468 2003-04-20 Miguel de Icaza <miguel@ximian.com>
14470 * typemanager.cs (TypeManager.NamespaceClash): Use to check if
14471 there is already a namespace defined with this name.
14473 (TypeManager.InitCoreTypes): Remove the temporary workaround, as
14474 people upgraded their corlibs.
14476 (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
14477 always use fully qualified types, no need to use the compiler
14480 (TypeManager.IsNamespace): Use binarysearch.
14482 * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
14483 AddDelegate): I did not quite use the new IsValid API properly: I
14484 have to pass the short-name and the fullname. I was passing only
14485 the basename instead of the fullname sometimes.
14487 (TypeContainer.DefineType): call NamespaceClash.
14489 * interface.cs (Interface.DefineType): use NamespaceClash before
14492 * delegate.cs (Delegate.DefineType): use NamespaceClash before
14495 * enum.cs: (Enum.DefineType): use NamespaceClash before
14498 * typemanager.cs (: 3-line patch that gives us some tasty 11%
14499 speed increase. First, use the negative_hits cache when we get a
14500 negative. Second, add the type with its full original name
14501 instead of the new . and + encoded name (reflection uses + to
14502 separate type from a nested type). Use LookupTypeReflection
14503 directly which bypasses the type->name hashtable (that we already
14504 know does not contain the type.
14506 * decl.cs (DeclSpace.ResolveTypeExpr): track the
14507 location/container type.
14509 * driver.cs: When passing utf8, use directly the UTF8Encoding.
14511 2003-04-19 Miguel de Icaza <miguel@ximian.com>
14513 * decl.cs (ResolveTypeExpr): Mirror check acess here too.
14515 * delegate.cs (NewDelegate.Resolve): Test whether an instance
14516 method is being referenced in the method group from a static
14517 context, and report error 120 if so.
14519 * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
14522 * typemanager.cs: Add intermediate namespaces (if a namespace A.B
14523 is created, we create the A namespace).
14525 * cs-parser.jay: A namespace also introduces a DeclarationFound.
14528 2003-04-18 Miguel de Icaza <miguel@ximian.com>
14530 * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
14531 invocation to ModuleBuilder.GetType with the same values will
14532 return a new type instance, so we need to cache its return
14535 * expression.cs (Binary.ResolveOperator): Only allow the compare
14536 operators on enums if they are of the same type.
14538 * ecore.cs (Expression.ImplicitReferenceConversion): handle target
14539 types of ValueType on their own case. Before we were giving them
14540 the same treatment as objects.
14542 * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
14543 fullname. Short name is used to compare against container name.
14544 Fullname is used to check against defined namespace names.
14546 * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
14547 AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
14549 (Method.CheckBase): Call parent.
14550 (MemberBase.CheckBase): Check for protected members on sealed
14552 (PropertyBase.CheckBase): Call parent.
14553 (Field.Define): Call parent.
14555 * report.cs: Negative error codes are now mapped to 8000 - code,
14556 so that the display is render more nicely.
14558 * typemanager.cs: Do not use try/catch, instead report a regular
14561 (GetPointerType, GetReferenceType): These methods provide
14562 mechanisms to obtain the T* and T& from a T. We had the code
14563 previously scattered around the code base, and it also used
14564 TypeManager.LookupType that would go through plenty of caches.
14565 This one goes directly to the type source.
14567 In some places we did the Type.GetType followed by
14568 ModuleBuilder.GetType, but not in others, so this unifies the
14569 processing as well.
14571 * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14572 statements now that we have namespace information.
14574 * typemanager.cs (IsNamespace): New method, returns whether the
14575 string presented is a namespace or not.
14577 (ComputeNamespaces): New public entry point, computes the list of
14578 available namespaces, using the GetNamespaces API call in Mono, or
14579 the slower version in MS.NET.
14581 Now before we start the semantic analysis phase, we have a
14582 complete list of namespaces including everything that the user has
14585 Deleted old code to cache namespaces in .nsc files.
14587 2003-04-17 Miguel de Icaza <miguel@ximian.com>
14589 * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14590 class/struct location definition Location for the implicit
14591 constructor location.
14593 (Operator.Define): Use the location of the operator for the
14594 implicit Method definition.
14596 (Constructor.Emit): use the constructor location for the implicit
14597 base initializer constructor.
14599 * ecore.cs: Remove ITypeExpression. This interface is now gone,
14600 and the Expression class now contains two new methods:
14602 ResolveAsTypeStep and ResolveAsTypeTerminal. This is used to
14603 isolate type lookup from the rest of the resolution process.
14605 Since we use Expressions to hold type definitions due to the way
14606 we parse the input we have historically overloaded Resolve to
14607 perform the Type lookups if a special flag is passed. Now this is
14608 eliminated and two methods take their place.
14610 The differences in the two methods between xStep and xTerminal is
14611 that xStep is involved in our current lookup system that uses
14612 SimpleNames to compose a name, while xTerminal is used just to
14613 catch the case where the simplename lookup failed.
14615 2003-04-16 Miguel de Icaza <miguel@ximian.com>
14617 * expression.cs (ResolveMemberAccess): Remove redundant code.
14618 TypeExpr expressions are always born fully resolved.
14620 * interface.cs (PopulateMethod): Do not lookup the types twice.
14621 We were doing it once during SemanticAnalysis and once during
14624 * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
14625 in local variable type definitions, were being returned as a
14626 SimpleName (we decomposed everything into a string), that is
14627 because primary_expression was being used instead of a type in the
14628 grammar (reduce/reduce conflicts).
14630 The part that was wrong is that we converted the expression into a
14631 string (an oversimplification in one hand, compounded with primary
14632 expressions doing string concatenation).
14638 Would return "A.B.C[]" as a SimpleName. This stopped things like
14639 using clauses from working on this particular context. And a type
14640 was being matched directly against "A.B.C[]".
14642 We now use the correct approach, and allow for ComposedCast to be
14643 part of the unary expression. So the "A.B.C []" become a composed
14644 cast of "A.B.C" (as a nested group of MemberAccess with a
14645 SimpleName at the end) plus the rank composition "[]".
14649 2003-04-10 Miguel de Icaza <miguel@ximian.com>
14651 * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
14652 for the access level checking.
14654 * class.cs: Cosmetic changes. Renamed `TypeContainer parent' to
14655 `TypeContainer container', because I kept getting confused when I
14656 was debugging this code.
14658 * expression.cs (Indexers): Instead of tracking getters/setters,
14659 we now track them in parallel. We create one arraylist less, but
14660 most importantly it is possible now for the LValue code to find a
14661 matching get for a set.
14663 (IndexerAccess.DoResolveLValue): Update the code.
14664 GetIndexersForType has been modified already to extract all the
14665 indexers from a type. The code assumed it did not.
14667 Also make the code set the correct return type for the indexer.
14668 This was fixed a long time ago for properties, but was missing for
14669 indexers. It used to be void_type.
14671 (Binary.Emit): Test first for doubles instead of
14672 floats, as they are more common.
14674 (Binary.EmitBranchable): Use the .un version of the branch opcodes
14675 when dealing with floats and the <=, >= operators. This fixes bug
14678 * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14679 to load the array value by emitting a load on the foreach variable
14680 type. This was incorrect.
14682 We now emit the code to load an element using the the array
14683 variable type, and then we emit the conversion operator.
14687 2003-04-10 Zoltan Varga <vargaz@freemail.hu>
14689 * attribute.cs: Avoid allocation of ArrayLists in the common case.
14691 2003-04-09 Miguel de Icaza <miguel@ximian.com>
14693 * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14694 test for protection before we test for signatures.
14696 (MethodSignature.ToString): implement.
14698 * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14699 to the case where we reduced into a LongConstant.
14701 * decl.cs (CheckAccessLevel): If the type is an array, we can not
14702 depend on whether the information is acurrate, because the
14703 Microsoft runtime will always claim that the array type is public,
14704 regardless of the real state.
14706 If the type is a pointer, another problem happens: the type is
14707 reported as non-public in Microsoft.
14709 In both cases we have to call CheckAccessLevel recursively with
14710 the underlying type as the argument to be tested.
14712 2003-04-08 Miguel de Icaza <miguel@ximian.com>
14714 * assign.cs (Assign.Emit): If we are dealing with a compound
14715 assignment expression, we should use the code path that stores the
14716 intermediate result in a temporary value. This fixes #40903.
14718 *expression.cs (Indirection.ToString): Provide ToString method for
14721 2003-04-08 Zoltan Varga <vargaz@freemail.hu>
14723 * class.cs: Null out fields holding references to Block objects so
14724 they can be garbage collected.
14726 * expression.cs (OverloadResolve): Remove unused local.
14728 2003-04-07 Martin Baulig <martin@ximian.com>
14730 * codegen.cs (EmitContext.CurrentFile): New public field.
14731 (EmitContext.Mark): Use the CurrentFile to check whether the
14732 location is in the correct file.
14733 (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14735 2003-04-07 Martin Baulig <martin@ximian.com>
14737 * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14739 * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14740 location. [FIXME: The location argument which gets passed to this
14741 method is sometimes wrong!]
14743 2003-04-07 Nick Drochak <ndrochak@gol.com>
14745 * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14747 2003-04-07 Miguel de Icaza <miguel@ximian.com>
14749 * expression.cs (Indirection.EmitAssign): We were using the
14750 temporary, but returning immediately instead of continuing the
14753 2003-04-06 Martin Baulig <martin@ximian.com>
14755 * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14756 if it's a nested child, but also deriving from the outer class.
14759 * typemanager.cs (IsNestedChildOf): Make this work if it's a
14760 nested child, but also deriving from the outer class. See
14762 (FilterWithClosure): We may access private members of the outer
14763 class if we're a nested child and deriving from the outer class.
14764 (RealMemberLookup): Only set `closure_private_ok' if the
14765 `original_bf' contained BindingFlags.NonPublic.
14767 2003-04-05 Martin Baulig <martin@ximian.com>
14769 * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
14770 probe if its a type parameter, and if so, flag an error.
14772 * decl.cs: Move here the SetParameterInfo code from class.cs.
14773 Handle IsGeneric here.
14775 Handle a variety of errors in the parameter info definition.
14777 * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
14778 type parameters here.
14780 * cs-parser.jay (class_declaration): report errors for parameters
14783 2003-01-21 Miguel de Icaza <miguel@ximian.com>
14785 * generic.cs: New file, contains support code for generics.
14787 * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
14788 OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
14790 Update parser for the above removals.
14792 * cs-tokenizer.cs: Do not handle <<= or >>= specially. This is
14793 now taken care of in the parser.
14795 2003-04-02 Miguel de Icaza <miguel@ximian.com>
14797 * class.cs (Event.Define): Do not allow abstract events to have
14800 2003-04-01 Miguel de Icaza <miguel@ximian.com>
14802 * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14803 block in event declarations.
14805 * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14806 value type, get its address.
14808 * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14809 leaving a class on the stack instead of a boolean value (int
14810 0/1). Change the code so we compare against null, and then the
14811 result against zero.
14813 * class.cs (TypeContainer.GetClassBases): We were checking for the
14814 parent class being sealed too late.
14816 * expression.cs (Binary.Emit): For <= and >= when dealing with
14817 floating point values, use cgt.un and clt.un instead of cgt and
14820 2003-04-01 Zoltan Varga <vargaz@freemail.hu>
14822 * statement.cs: Apply the same optimization as MS: skip the
14823 GetEnumerator returning an IEnumerator, and use the one returning a
14824 CharEnumerator instead. This allows us to avoid the try-finally block
14827 2003-03-31 Gaurav Vaish <gvaish_mono@lycos.com>
14829 * cs-parser.jay: Attributes cannot be applied to
14830 namespaces. Fixes #40473
14832 2003-03-31 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14835 (Add*): check if the name is valid using the full name for constants,
14836 fields, properties and events.
14838 2003-03-28 Miguel de Icaza <miguel@ximian.com>
14840 * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
14841 char constants to be part of the enumeration.
14843 * expression.cs (Conditional.DoResolve): Add support for operator
14844 true. Implements the missing functionality from 14.12
14846 * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
14847 operator true/false as required by the spec.
14849 * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
14850 implicit conversion to boolean.
14852 * statement.cs (Statement.ResolveBoolean): A boolean expression is
14853 also one where the type implements `operator true'.
14855 * ecore.cs (Expression.GetOperatorTrue): New helper routine to
14856 get an expression that will invoke operator true based on an
14859 (GetConversionOperators): Removed the hack that called op_True
14862 (Expression.ResolveBoolean): Move this from Statement.
14864 2003-03-17 Miguel de Icaza <miguel@ximian.com>
14866 * ecore.cs (FieldExpr): do not allow initialization of initonly
14867 fields on derived classes
14869 2003-03-13 Martin Baulig <martin@ximian.com>
14871 * statement.cs (Block.Emit): Call ig.BeginScope() and
14872 ig.EndScope() when compiling with debugging info; call
14873 LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14875 2003-03-08 Miguel de Icaza <miguel@ximian.com>
14877 * expression.cs (Indexers): Do not construct immediately, allow
14878 for new members to be appended as we go. Fixes 38143
14880 2003-03-07 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14882 * expression.cs: save/restore context when resolving an unchecked
14885 2003-03-05 Miguel de Icaza <miguel@ximian.com>
14887 * cfold.cs: Catch division by zero in modulus operator during
14890 2003-03-03 Miguel de Icaza <miguel@ximian.com>
14892 * interface.cs (Interface.DefineMembers): Avoid defining members
14895 2003-02-27 Miguel de Icaza <miguel@ximian.com>
14897 * driver.cs: handle the +/- options for -noconfig
14899 * statement.cs (Unckeched.Resolve): Also track the state of
14900 unchecked in the Resolve phase.
14902 2003-02-27 Martin Baulig <martin@ximian.com>
14904 * ecore.cs (Expression.MemberLookup): Don't create a
14905 MethodGroupExpr for something which is not a method. Fixes #38291.
14907 2003-02-25 Miguel de Icaza <miguel@ximian.com>
14909 * class.cs (MemberBase.CheckParameters): Also check that the type
14910 is unmanaged if it is a pointer.
14912 * expression.cs (SizeOf.Resolve): Add location information.
14914 * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14915 a managed type is declared.
14917 * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14918 parameter modifiers as well. Fixes bug 38606
14920 * class.cs: Very sad. Am backing out the speed up changes
14921 introduced by the ArrayList -> Array in the TypeContainer, as they
14922 were not actually that much faster, and introduced a bug (no error
14923 reports on duplicated methods).
14925 * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14926 source first, this will guarantee that we have a valid expression
14927 before calling in lower levels functions that will require a
14928 resolved object. Then use this original_source in the
14929 target.ResolveLValue instead of the original source that was
14932 Another change. Use target.Resolve instead of LValueResolve.
14933 Although we are resolving for LValues, we will let the Assign code
14934 take care of that (it will be called again from Resolve). This
14935 basically allows code like this:
14937 class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14938 class Y { void A (X x) { x [0] += o; }
14940 The problem was that the indexer was trying to resolve for
14941 set_Item (idx, object o) and never finding one. The real set_Item
14942 was set_Item (idx, X). By delaying the process we get the right
14947 2003-02-23 Martin Baulig <martin@ximian.com>
14949 * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14950 while calling DoEmit ().
14952 * codegen.cs (EmitContext.Mark): Don't mark locations in other
14953 source files; if you use the #line directive inside a method, the
14954 compiler stops emitting line numbers for the debugger until it
14955 reaches the end of the method or another #line directive which
14956 restores the original file.
14958 2003-02-23 Martin Baulig <martin@ximian.com>
14960 * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14962 2003-02-23 Martin Baulig <martin@ximian.com>
14964 * statement.cs (Block.AddChildVariableNames): We need to call this
14965 recursively, not just for our immediate children.
14967 2003-02-23 Martin Baulig <martin@ximian.com>
14969 * class.cs (Event.Define): Always make the field private, like csc does.
14971 * typemanager.cs (TypeManager.RealMemberLookup): Make events
14972 actually work, fixes bug #37521.
14974 2003-02-23 Miguel de Icaza <miguel@ximian.com>
14976 * delegate.cs: When creating the various temporary "Parameters"
14977 classes, make sure that we call the ComputeAndDefineParameterTypes
14978 on those new parameters (just like we do with the formal ones), to
14979 allow them to be resolved in the context of the DeclSpace.
14981 This fixes the bug that Dick observed in Bugzilla #38530.
14983 2003-02-22 Miguel de Icaza <miguel@ximian.com>
14985 * expression.cs (ResolveMemberAccess): When resolving a constant,
14986 do not attempt to pull a constant if the value was not able to
14987 generate a valid constant.
14989 * const.cs (LookupConstantValue): Do not report more errors than required.
14991 2003-02-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
14993 * expression.cs: fixes bug #38328.
14995 2003-02-18 Miguel de Icaza <miguel@ximian.com>
14997 * class.cs: Changed all the various members that can be part of a
14998 class from being an ArrayList to be an Array of the right type.
14999 During the DefineType type_list, interface_list, delegate_list and
15000 enum_list are turned into types, interfaces, delegates and enums
15003 And during the member population, indexer_list, event_list,
15004 constant_list, field_list, instance_constructor_list, method_list,
15005 operator_list and property_list are turned into their real arrays.
15007 Although we could probably perform this operation earlier, for
15008 good error reporting we need to keep the lists and remove the
15009 lists for longer than required.
15011 This optimization was triggered by Paolo profiling the compiler
15012 speed on the output of `gen-sample-program.pl' perl script.
15014 * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
15015 not crash in methods like MemberLookupFailed that use this field.
15017 This problem arises when the compiler fails to resolve a type
15018 during interface type definition for example.
15020 2003-02-18 Miguel de Icaza <miguel@ximian.com>
15022 * expression.cs (Indexers.GetIndexersForType): Interfaces do not
15023 inherit from System.Object, so we have to stop at null, not only
15024 when reaching System.Object.
15026 2003-02-17 Miguel de Icaza <miguel@ximian.com>
15028 * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
15029 DeclaredOnly because the parent indexer might have had a different
15030 name, but did not loop until the top of the hierarchy was reached.
15032 The problem this one fixes is 35492: when a class implemented an
15033 indexer from an interface, we were getting the interface method
15034 (which was abstract) and we were flagging an error (can not invoke
15037 This also keeps bug 33089 functioning, and test-148 functioning.
15039 * typemanager.cs (IsSpecialMethod): The correct way of figuring
15040 out if a method is special is to see if it is declared in a
15041 property or event, or whether it is one of the predefined operator
15042 names. This should fix correctly #36804.
15044 2003-02-15 Miguel de Icaza <miguel@ximian.com>
15046 The goal here is to remove the dependency on EmptyCast.Peel ().
15047 Killing it completely.
15049 The problem is that currently in a number of places where
15050 constants are expected, we have to "probe" for an EmptyCast, and
15051 Peel, which is not the correct thing to do, as this will be
15052 repetitive and will likely lead to errors.
15054 The idea is to remove any EmptyCasts that are used in casts that
15055 can be reduced to constants, so we only have to cope with
15058 This bug hunt was triggered by Bug 37363 and the desire to remove
15059 the duplicate pattern where we were "peeling" emptycasts to check
15060 whether they were constants. Now constants will always be
15063 * ecore.cs: Use an enumconstant here instead of wrapping with
15066 * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
15067 throwing me off. By handling this we can get rid of a few hacks.
15069 * statement.cs (Switch): Removed Peel() code.
15071 2003-02-14 Miguel de Icaza <miguel@ximian.com>
15073 * class.cs: Location information for error 508
15075 * expression.cs (New.DoResolve): Add a guard against double
15076 resolution of an expression.
15078 The New DoResolve might be called twice when initializing field
15079 expressions (see EmitFieldInitializers, the call to
15080 GetInitializerExpression will perform a resolve on the expression,
15081 and later the assign will trigger another resolution
15083 This leads to bugs (#37014)
15085 * delegate.cs: The signature for EndInvoke should contain any ref
15086 or out parameters as well. We were not doing this in the past.
15088 * class.cs (Field.Define): Do not overwrite the type definition
15089 inside the `volatile' group. Turns out that volatile enumerations
15090 were changing the type here to perform a validity test, which
15093 2003-02-12 Miguel de Icaza <miguel@ximian.com>
15095 * ecore.cs (FieldExpr.AddressOf): In the particular case of This
15096 and structs, we do not want to load the instance variable
15098 (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
15099 enum_type has to be handled like an object reference (implicit
15100 conversions exists from this to object), but the regular IsClass
15101 and IsValueType tests will never return true for this one.
15103 Also we use TypeManager.IsValueType instead of type.IsValueType,
15104 just for consistency with the rest of the code (this is only
15105 needed if we ever use the construct exposed by test-180.cs inside
15106 corlib, which we dont today).
15108 2003-02-12 Zoltan Varga <vargaz@freemail.hu>
15110 * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
15113 2003-02-09 Martin Baulig <martin@ximian.com>
15115 * namespace.cs (Namespace..ctor): Added SourceFile argument.
15116 (Namespace.DefineNamespaces): New static public method; this is
15117 called when we're compiling with debugging to add all namespaces
15118 to the symbol file.
15120 * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
15121 pass it to the Namespace's .ctor.
15123 * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
15124 and MethodBase arguments; pass the namespace ID to the symwriter;
15125 pass the MethodBase instead of the token to the symwriter.
15126 (SymbolWriter.DefineNamespace): New method to add a namespace to
15129 2003-02-09 Martin Baulig <martin@ximian.com>
15131 * symbolwriter.cs: New file. This is a wrapper around
15132 ISymbolWriter with a cleaner API. We'll dynamically Invoke()
15133 methods here in near future.
15135 2003-02-09 Martin Baulig <martin@ximian.com>
15137 * codegen.cs (EmitContext.Mark): Just pass the arguments to
15138 ILGenerator.MarkSequencePoint() which are actually used by the
15141 2003-02-09 Martin Baulig <martin@ximian.com>
15143 * location.cs (SourceFile): New public sealed class. This
15144 contains the name and an index which is used in the location's token.
15145 (Location): Reserve an appropriate number of bits in the token for
15146 the source file instead of walking over that list, this gives us a
15147 really huge performance improvement when compiling with debugging.
15149 * driver.cs (Driver.parse, Driver.tokenize_file): Take a
15150 `SourceFile' argument instead of a string.
15151 (Driver.ProcessFile): Add all the files via Location.AddFile(),
15152 but don't parse/tokenize here, we need to generate the list of all
15153 source files before we do that.
15154 (Driver.ProcessFiles): New static function. Parses/tokenizes all
15157 * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
15158 instead of a string.
15160 * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
15163 2003-02-09 Martin Baulig <martin@ximian.com>
15165 * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
15166 filename on `#line default'.
15168 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
15170 * statement.cs: don't clear the pinned var when the fixed statement
15171 returns from the method (fixes bug#37752).
15173 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
15175 * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban)
15178 2003-02-07 Martin Baulig <martin@ximian.com>
15180 * driver.cs: Removed the `--debug-args' command line argument.
15182 * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
15183 automatically by the AsssemblyBuilder.
15184 (CodeGen.InitializeSymbolWriter): We don't need to call any
15185 initialization function on the symbol writer anymore. This method
15186 doesn't take any arguments.
15188 2003-02-03 Miguel de Icaza <miguel@ximian.com>
15190 * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
15191 from referenced assemblies as well.
15193 2003-02-02 Martin Baulig <martin@ximian.com>
15195 * class.cs (MethodData.Emit): Generate debugging info for external methods.
15197 2003-02-02 Martin Baulig <martin@ximian.com>
15199 * class.cs (Constructor.Emit): Open the symbol writer before
15200 emitting the constructor initializer.
15201 (ConstructorInitializer.Emit): Call ec.Mark() to allow
15202 single-stepping through constructor initializers.
15204 2003-01-30 Miguel de Icaza <miguel@ximian.com>
15206 * class.cs: Handle error 549: do not allow virtual methods in
15209 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
15211 * decl.cs: Check access levels when resolving types
15213 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
15215 * statement.cs: Add parameters and locals set in catch blocks that might
15216 return to set vector
15218 2003-01-29 Miguel de Icaza <miguel@ximian.com>
15220 * class.cs (Operator): Set the SpecialName flags for operators.
15222 * expression.cs (Invocation.DoResolve): Only block calls to
15223 accessors and operators on SpecialName methods.
15225 (Cast.TryReduce): Handle conversions from char constants.
15228 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
15230 * statement.cs: small memory and time optimization in FlowBranching.
15232 2003-01-28 Pedro Mart <yoros@wanadoo.es>
15234 * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
15235 problem that the last fix but in the other sid (Set).
15237 * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
15238 access when there is no indexer in the hierarchy.
15240 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
15242 * class.cs: Combine some if statements.
15244 2003-01-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15246 * driver.cs: fixed bug #37187.
15248 2003-01-27 Pedro Martinez Juliá <yoros@wanadoo.es>
15250 * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
15251 any indexer, it's needed to build a list with all the indexers in the
15252 hierarchy (AllGetters), else we have problems. Fixes #35653.
15254 2003-01-23 Miguel de Icaza <miguel@ximian.com>
15256 * class.cs (MethodData.Define): It is wrong for an interface
15257 implementation to be static in both cases: explicit and implicit.
15258 We were only handling this in one case.
15260 Improve the if situation there to not have negations.
15262 * class.cs (Field.Define): Turns out that we do not need to check
15263 the unsafe bit on field definition, only on usage. Remove the test.
15265 2003-01-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15267 * driver.cs: use assembly.Location instead of Codebase (the latest
15268 patch made mcs fail when using MS assemblies).
15270 2003-01-21 Tim Haynes <thaynes@openlinksw.com>
15272 * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
15273 get the path to *corlib.dll.
15275 2003-01-21 Nick Drochak <ndrochak@gol.com>
15279 * typemanager.cs: Remove compiler warnings
15281 2003-01-20 Duncan Mak <duncan@ximian.com>
15283 * AssemblyInfo.cs: Bump the version number to 0.19.
15285 2003-01-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15287 * cs-tokenizer.cs: little fixes to line numbering when #line is used.
15289 2003-01-18 Zoltan Varga <vargaz@freemail.hu>
15291 * class.cs (Constructor::Emit): Emit debugging info for constructors.
15293 2003-01-17 Miguel de Icaza <miguel@ximian.com>
15295 * cs-parser.jay: Small fix: we were not comparing the constructor
15296 name correctly. Thanks to Zoltan for the initial pointer.
15298 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
15300 * cs-tokenizer.cs: Set file name when specified with #line
15302 2003-01-15 Miguel de Icaza <miguel@ximian.com>
15304 * cs-parser.jay: Only perform the constructor checks here if we
15305 are named like the class; This will help provider a better
15306 error. The constructor path is taken when a type definition is
15307 not found, but most likely the user forgot to add the type, so
15308 report that rather than the constructor error.
15310 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
15312 * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
15315 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15317 * cs-parser.jay: Add cleanup call.
15319 2003-01-13 Duncan Mak <duncan@ximian.com>
15321 * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
15322 consistent with other methods.
15324 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15326 * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
15328 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
15330 * attribute.cs: only set GuidAttr to true when we have a
15333 2003-01-09 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15337 * typemanager.cs: fixes to allow mcs compile corlib with the new
15338 Type.IsSubclassOf fix.
15340 2003-01-08 Miguel de Icaza <miguel@ximian.com>
15342 * expression.cs (LocalVariableReference.DoResolve): Classify a
15343 constant as a value, not as a variable. Also, set the type for
15346 * cs-parser.jay (fixed_statement): take a type instead of a
15347 pointer_type, so we can produce a better error message later.
15349 * statement.cs (Fixed.Resolve): Flag types that are not pointers
15352 (For.DoEmit): Make inifinite loops have a
15353 non-conditional branch back.
15355 (Fixed.DoEmit): First populate the pinned variables, then emit the
15356 statement, then clear the variables. Before I was emitting the
15357 code once for each fixed piece.
15360 2003-01-08 Martin Baulig <martin@ximian.com>
15362 * statement.cs (FlowBranching.MergeChild): A break in a
15363 SWITCH_SECTION does not leave a loop. Fixes #36155.
15365 2003-01-08 Martin Baulig <martin@ximian.com>
15367 * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
15368 lives in the same number space than `param_map'. Fixes #36154.
15370 2003-01-07 Miguel de Icaza <miguel@ximian.com>
15372 * cs-parser.jay (constructor_declaration): Set the
15373 Constructor.ModFlags before probing for it. This makes the
15374 compiler report 514, 515 and 132 (the code was there, but got
15377 * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
15378 (GotoDefault.Resolve): Set `Returns' to ALWAYS.
15379 (GotoCase.Resolve): Set `Returns' to ALWAYS.
15381 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
15383 * enum.cs: create the enum static fields using the enum type.
15385 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
15387 * class.cs: don't try to create the ParamBuilder for the return
15388 type if it's not needed (and handle it breaking for the ms runtime
15391 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
15393 * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
15395 2002-12-29 Miguel de Icaza <miguel@ximian.com>
15397 * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
15398 the command. This showed up while compiling the JANET source
15399 code, which used \r as its only newline separator.
15401 2002-12-28 Miguel de Icaza <miguel@ximian.com>
15403 * class.cs (Method.Define): If we are an operator (because it
15404 reuses our code), then set the SpecialName and HideBySig. #36128
15406 2002-12-22 Miguel de Icaza <miguel@ximian.com>
15408 * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
15409 exception, report error 120 `object reference required'.
15411 * driver.cs: Add --pause option, used during to measure the size
15412 of the process as it goes with --timestamp.
15414 * expression.cs (Invocation.DoResolve): Do not allow methods with
15415 SpecialName to be invoked.
15417 2002-12-21 Miguel de Icaza <miguel@ximian.com>
15419 * cs-tokenizer.cs: Small fix to the parser: compute the ascii
15420 number before adding it.
15422 2002-12-21 Ravi Pratap <ravi@ximian.com>
15424 * ecore.cs (StandardImplicitConversion): When in an unsafe
15425 context, we allow conversion between void * to any other pointer
15426 type. This fixes bug #35973.
15428 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
15430 * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
15431 is not thrown when extensionless outputs are used
15433 2002-12-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15435 * rootcontext.cs: fixed compilation of corlib.
15437 2002-12-19 Miguel de Icaza <miguel@ximian.com>
15439 * attribute.cs (Attributes.Contains): Add new method.
15441 * class.cs (MethodCore.LabelParameters): if the parameter is an
15442 `out' parameter, check that no attribute `[In]' has been passed.
15444 * enum.cs: Handle the `value__' name in an enumeration.
15446 2002-12-14 Jaroslaw Kowalski <jarek@atm.com.pl>
15448 * decl.cs: Added special case to allow overrides on "protected
15451 2002-12-18 Ravi Pratap <ravi@ximian.com>
15453 * attribute.cs (Attributes.AddAttributeSection): Rename to this
15454 since it makes much more sense.
15456 (Attributes.ctor): Don't require a Location parameter.
15458 * rootcontext.cs (AddGlobalAttributeSection): Rename again.
15460 * attribute.cs (ApplyAttributes): Remove extra Location parameters
15461 since we already have that information per attribute.
15463 * everywhere : make appropriate changes.
15465 * class.cs (LabelParameters): Write the code which actually
15466 applies attributes to the return type. We can't do this on the MS
15467 .NET runtime so we flag a warning in the case an exception is
15470 2002-12-18 Miguel de Icaza <miguel@ximian.com>
15472 * const.cs: Handle implicit null conversions here too.
15474 2002-12-17 Ravi Pratap <ravi@ximian.com>
15476 * class.cs (MethodCore.LabelParameters): Remove the extra
15477 Type [] parameter since it is completely unnecessary. Instead
15478 pass in the method's attributes so that we can extract
15479 the "return" attribute.
15481 2002-12-17 Miguel de Icaza <miguel@ximian.com>
15483 * cs-parser.jay (parse): Use Report.Error to flag errors instead
15484 of ignoring it and letting the compile continue.
15486 * typemanager.cs (ChangeType): use an extra argument to return an
15487 error condition instead of throwing an exception.
15489 2002-12-15 Miguel de Icaza <miguel@ximian.com>
15491 * expression.cs (Unary.TryReduce): mimic the code for the regular
15492 code path. Perform an implicit cast in the cases where we can
15493 implicitly convert to one of the integral types, and then reduce
15494 based on that constant. This fixes bug #35483.
15496 2002-12-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15498 * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
15500 2002-12-13 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15502 * namespace.cs: fixed bug #35489.
15504 2002-12-12 Miguel de Icaza <miguel@ximian.com>
15506 * class.cs: Remove some dead code.
15508 * cs-parser.jay: Estimate the number of methods needed
15509 (RootContext.MethodCount);
15511 * cs-tokenizer.cs: Use char arrays for parsing identifiers and
15512 numbers instead of StringBuilders.
15514 * support.cs (PtrHashtable): Add constructor with initial size;
15515 We can now reduce reallocations of the method table.
15517 2002-12-10 Ravi Pratap <ravi@ximian.com>
15519 * attribute.cs (ApplyAttributes): Keep track of the emitted
15520 attributes on a per-target basis. This fixes bug #35413.
15522 2002-12-10 Miguel de Icaza <miguel@ximian.com>
15524 * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
15525 default to the Windows 1252 encoding.
15527 (UnixParseOption): Support version, thanks to Alp for the missing
15530 * AssemblyInfo.cs: Add nice assembly information.
15532 * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
15535 * cs-parser.jay: Allow a trailing comma before the close bracked
15536 in the attribute_section production.
15538 * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
15539 address of the instance was being taken, I will take this out,
15540 because we take the address of the object immediately here.
15542 2002-12-09 Ravi Pratap <ravi@ximian.com>
15544 * typemanager.cs (AreMultipleAllowed): Take care of the most
15545 obvious case where attribute type is not in the current assembly -
15548 2002-12-08 Miguel de Icaza <miguel@ximian.com>
15550 * ecore.cs (SimpleName.DoResolve): First perform lookups on using
15551 definitions, instead of doing that afterwards.
15553 Also we use a nice little hack, depending on the constructor, we
15554 know if we are a "composed" name or a simple name. Hence, we
15555 avoid the IndexOf test, and we avoid
15557 * codegen.cs: Add code to assist in a bug reporter to track down
15558 the source of a compiler crash.
15560 2002-12-07 Ravi Pratap <ravi@ximian.com>
15562 * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
15563 types have been emitted for a given element and flag an error
15564 if something which does not have AllowMultiple set is used more
15567 * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15568 attribute types and their corresponding AllowMultiple properties
15570 (AreMultipleAllowed): Check the property for a given type.
15572 * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15573 property in the case we have a TypeContainer.
15575 (Attributes.AddAttribute): Detect duplicates and just skip on
15576 adding them. This trivial fix catches a pretty gross error in our
15577 attribute emission - global attributes were being emitted twice!
15579 Bugzilla bug #33187 is now fixed.
15581 2002-12-06 Miguel de Icaza <miguel@ximian.com>
15583 * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15584 instead of pp_and).
15586 * expression.cs (Binary.ResolveOperator): I can only use the
15587 Concat (string, string, string) and Concat (string, string,
15588 string, string) if the child is actually a concatenation of
15591 2002-12-04 Miguel de Icaza <miguel@ximian.com>
15593 * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15594 context where we need a 2-character lookahead.
15596 * pending.cs (PendingImplementation): Rework so we can keep track
15597 of interface types all the time, and flag those which were
15598 implemented by parents as optional.
15600 2002-12-03 Miguel de Icaza <miguel@ximian.com>
15602 * expression.cs (Binary.ResolveOperator): Use
15603 String.Concat(string,string,string) or
15604 String.Concat(string,string,string,string) when possible.
15606 * typemanager: More helper methods.
15609 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15611 * pending.cs: remove the bogus return from GetMissingInterfaces()
15612 (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15614 2002-12-02 Gonzalo Paniagua Javier <gonzalo@ximian.com>
15616 * namespace.cs: avoid duplicated 'using xxx' being added to
15617 using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15618 when we get more than one 'using' statement for the same namespace.
15619 Report a CS0105 warning for it.
15621 2002-11-30 Miguel de Icaza <miguel@ximian.com>
15623 * cs-tokenizer.cs (consume_identifier): use read directly, instead
15624 of calling getChar/putback, uses internal knowledge of it.
15626 (xtoken): Reorder tokenizer so most common patterns are checked
15627 first. This reduces the compilation time in another 5% (from 8.11s
15628 average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15630 The parsing time is 22% of the compilation in mcs, and from that
15631 64% is spent on the tokenization process.
15633 I tried using a binary search for keywords, but this is slower
15634 than the hashtable. Another option would be to do a couple of
15637 * Not use a StringBuilder, instead use an array of chars,
15638 with a set value. Notice that this way we could catch
15639 the 645 error without having to do it *afterwards*.
15641 * We could write a hand-parser to avoid the hashtable
15642 compares altogether.
15644 The identifier consumption process takes 37% of the tokenization
15645 time. Another 15% is spent on is_number. 56% of the time spent
15646 on is_number is spent on Int64.Parse:
15648 * We could probably choose based on the string length to
15649 use Int32.Parse or Int64.Parse and avoid all the 64-bit
15652 Another 3% is spend on wrapping `xtoken' in the `token' function.
15654 Handle 0xa0 as whitespace (#34752)
15656 2002-11-26 Miguel de Icaza <miguel@ximian.com>
15658 * typemanager.cs (IsCLRType): New routine to tell whether a type
15659 is one of the builtin types.
15661 Maybe it needs to use TypeCodes to be faster. Maybe we could use
15662 typecode in more places instead of doing pointer comparissions.
15663 We could leverage some knowledge about the way the typecodes are
15666 New code to cache namespaces in assemblies, it is currently not
15667 invoked, to be used soon.
15669 * decl.cs (DeclSpace.MakeFQN): Simple optimization.
15671 * expression.cs (Binary.ResolveOperator): specially handle
15672 strings, and do not perform user-defined operator overloading for
15675 2002-11-24 Miguel de Icaza <miguel@ximian.com>
15677 * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15678 internalcall as it is a pretty simple operation; Avoid whenever
15679 possible to call Char.IsLetter.
15681 (consume_identifier): Cut by half the number of
15682 hashtable calls by merging the is_keyword and GetKeyword behavior.
15684 Do not short-circuit, because if we do, we
15685 report errors (ie, #if false && true would produce an invalid
15689 2002-11-24 Martin Baulig <martin@ximian.com>
15691 * expression.cs (Cast.TryReduce): If we're in checked syntax,
15692 check constant ranges and report a CS0221. Fixes #33186.
15694 2002-11-24 Martin Baulig <martin@ximian.com>
15696 * cs-parser.jay: Make this work for uninitialized variable
15697 declarations in the `for' initializer. Fixes #32416.
15699 2002-11-24 Martin Baulig <martin@ximian.com>
15701 * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15702 System.Enum actually work. Fixes bug #32269, added verify-6.cs.
15704 2002-11-24 Martin Baulig <martin@ximian.com>
15706 * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15707 argument; if true, we also check for user-defined conversions.
15708 This is only needed if both arguments are of a user-defined type.
15709 Fixes #30443, added test-175.cs.
15710 (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15712 * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15714 2002-11-24 Martin Baulig <martin@ximian.com>
15716 * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15717 function to get the store opcode.
15718 (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15719 only emit the Ldelema if the store opcode is Stobj. You must run
15720 both test-34 and test-167 to test this. Fixes #34529.
15722 2002-11-23 Martin Baulig <martin@ximian.com>
15724 * ecore.cs (Expression.MemberLookup): Added additional
15725 `qualifier_type' argument which is used when we're being called
15726 from MemberAccess.DoResolve() and null if we're called from a
15728 (Expression.MemberLookupFailed): New method to report errors; this
15729 does the CS1540 check and reports the correct error message.
15731 * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15732 argument for the CS1540 check and redone the way how we're dealing
15733 with private members. See the comment in the source code for details.
15734 (FilterWithClosure): Reverted this back to revision 1.197; renamed
15735 `closure_start_type' to `closure_qualifier_type' and check whether
15736 it's not null. It was not this filter being broken, it was just
15737 being called with the wrong arguments.
15739 * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15740 and pass it the correct `qualifier_type'; this also does the error
15743 2002-11-22 Miguel de Icaza <miguel@ximian.com>
15745 * expression.cs (Invocation.EmitParams): If the we are dealing
15746 with a non-built-in value type, load its address as well.
15748 (ArrayCreation): Use a a pretty constant instead
15749 of the hardcoded value 2. Use 6 instead of 2 for the number of
15750 static initializers.
15752 (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15753 because they are not really value types, just glorified integers.
15755 * driver.cs: Do not append .exe, the CSC compiler does not do it.
15757 * ecore.cs: Remove redundant code for enumerations, make them use
15758 the same code path as everything else, fixes the casting issue
15759 with enumerations in Windows.Forms.
15761 * attribute.cs: Do only cast to string if it is a string, the
15762 validation happens later.
15764 * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15765 people upgrade their corlibs.
15767 * ecore.cs: Oops, enumerations were not following the entire code path
15769 2002-11-21 Miguel de Icaza <miguel@ximian.com>
15771 * typemanager.cs (FilterWithClosure): Commented out the test for
15772 1540 in typemanager.cs, as it has problems when accessing
15773 protected methods from a parent class (see test-174.cs).
15775 * attribute.cs (Attribute.ValidateGuid): new method.
15776 (Attribute.Resolve): Use above.
15778 2002-11-19 Miguel de Icaza <miguel@ximian.com>
15780 * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15782 * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15783 handling for enumerations, as we only needed the TypeContainer
15784 functionality to begin with (this is required for the fix below to
15785 work for enums that reference constants in a container class for
15788 * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15790 * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15791 a valid TypeBuilder to perform lookups on.o
15793 * class.cs (InheritableMemberSignatureCompare): Use true in the
15794 call to GetGetMethod and GetSetMethod, because we are comparing
15795 the signature, and we need to get the methods *even* if they are
15798 (PropertyBase.CheckBase): ditto.
15800 * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15801 GotoCase.Resolve): Use Peel on EmpytCasts.
15803 * ecore.cs (EmptyCast): drop child, add Peel method.
15805 2002-11-17 Martin Baulig <martin@ximian.com>
15807 * ecore.cs (EmptyCast.Child): New public property.
15809 * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15810 label resolved to an EmptyCast. Fixes #34162.
15811 (GotoCase.Resolve): Likewise.
15812 (Block.EmitMeta): Likewise.
15814 2002-11-17 Martin Baulig <martin@ximian.com>
15816 * expression.cs (Invocation.BetterConversion): Prefer int over
15817 uint; short over ushort; long over ulong for integer literals.
15818 Use ImplicitConversionExists instead of StandardConversionExists
15819 since we also need to check for user-defined implicit conversions.
15820 Fixes #34165. Added test-173.cs.
15822 2002-11-16 Martin Baulig <martin@ximian.com>
15824 * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15825 with the `true' and `false' literals. Fixes #33151.
15827 2002-11-16 Martin Baulig <martin@ximian.com>
15829 * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
15830 October 22nd; don't do the cs1540 check for static members.
15832 * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
15833 now using our own filter here and doing the cs1540 check again.
15835 2002-11-16 Martin Baulig <martin@ximian.com>
15837 * support.cs (InternalParameters): Don't crash if we don't have
15838 any fixed parameters. Fixes #33532.
15840 2002-11-16 Martin Baulig <martin@ximian.com>
15842 * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
15843 when looking up static methods to make this work on Windows.
15846 2002-11-16 Martin Baulig <martin@ximian.com>
15848 * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
15849 a setter rather than using PropertyInfo.CanWrite.
15851 2002-11-15 Nick Drochak <ndrochak@gol.com>
15853 * class.cs: Allow acces to block member by subclasses. Fixes build
15856 2002-11-14 Martin Baulig <martin@ximian.com>
15858 * class.cs (Constructor.Emit): Added the extern/block check.
15861 2002-11-14 Martin Baulig <martin@ximian.com>
15863 * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15864 iteration while looking for indexers, this is needed because the
15865 indexer may have a different name in our base classes. Fixed the
15866 error reporting (no indexers at all, not get accessor, no
15867 overloaded match). Fixes bug #33089.
15868 (IndexerAccess.DoResolveLValue): Likewise.
15870 2002-11-14 Martin Baulig <martin@ximian.com>
15872 * class.cs (PropertyBase.CheckBase): Make this work for multiple
15873 indexers. Fixes the first part of bug #33089.
15874 (MethodSignature.InheritableMemberSignatureCompare): Added support
15877 2002-11-13 Ravi Pratap <ravi@ximian.com>
15879 * attribute.cs (Attribute.Resolve): Catch the
15880 NullReferenceException and report it since it isn't supposed to
15883 2002-11-12 Miguel de Icaza <miguel@ximian.com>
15885 * expression.cs (Binary.EmitBranchable): Also handle the cases for
15886 LogicalOr and LogicalAnd that can benefit from recursively
15887 handling EmitBranchable. The code now should be nice for Paolo.
15889 2002-11-08 Miguel de Icaza <miguel@ximian.com>
15891 * typemanager.cs (LookupType): Added a negative-hit hashtable for
15892 the Type lookups, as we perform quite a number of lookups on
15893 non-Types. This can be removed once we can deterministically tell
15894 whether we have a type or a namespace in advance.
15896 But this might require special hacks from our corlib.
15900 * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15901 and double which avoids a conversion from an integer to a double.
15903 * expression.cs: tiny optimization, avoid calling IsConstant,
15904 because it effectively performs the lookup twice.
15906 2002-11-06 Miguel de Icaza <miguel@ximian.com>
15908 But a bogus return here to keep the semantics of the old code
15909 until the Mono runtime is fixed.
15911 * pending.cs (GetMissingInterfaces): New method used to remove all
15912 the interfaces that are already implemented by our parent
15913 classes from the list of pending methods.
15915 * interface.cs: Add checks for calls after ResolveTypeExpr.
15917 2002-11-05 Miguel de Icaza <miguel@ximian.com>
15919 * class.cs (Class.Emit): Report warning 67: event not used if the
15920 warning level is beyond 3.
15922 * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15923 being a NullLiteral.
15925 * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15928 * class.cs (TypeContainer.GetClassBases): Cover a missing code
15929 path that might fail if a type can not be resolved.
15931 * expression.cs (Binary.Emit): Emit unsigned versions of the
15934 * driver.cs: use error 5.
15936 2002-11-02 Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15938 * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15940 2002-11-01 Miguel de Icaza <miguel@ximian.com>
15942 * cs-parser.jay (switch_section): A beautiful patch from Martin
15943 Baulig that fixed 33094.
15945 2002-10-31 Miguel de Icaza <miguel@ximian.com>
15947 * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15948 Check whether the base is abstract and report an error if so.
15950 * expression.cs (IndexerAccess.DoResolveLValue,
15951 IndexerAccess.DoResolve): ditto.
15953 (Invocation.DoResolve): ditto.
15955 (Invocation.FullMethodDesc): Improve the report string.
15957 * statement.cs (Block): Eliminate IsVariableDefined as it is
15958 basically just a wrapper for GetVariableInfo.
15960 * ecore.cs (SimpleName): Use new
15962 * support.cs (ReflectionParamter.ParameterType): We unwrap the
15963 type, as we return the actual parameter ref/unref state on a
15966 2002-10-30 Miguel de Icaza <miguel@ximian.com>
15968 * support.cs: Return proper flags REF/OUT fixing the previous
15971 * expression.cs: Reverted last patch, that was wrong. Is_ref is
15972 not used to mean `ref' but `ref or out' in ParameterReference
15974 * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15975 full type signature instead of calling TypeManger.CSharpName
15978 * support.cs (InternalParameters.ParameterDesc): Do not compare
15979 directly to the modflags, because REF/OUT will actually be bitsets
15982 * delegate.cs (VerifyMethod): Check also the modifiers.
15984 * cs-tokenizer.cs: Fix bug where floating point values with an
15985 exponent where a sign was missing was ignored.
15987 * driver.cs: Allow multiple assemblies to be specified in a single
15990 2002-10-28 Miguel de Icaza <miguel@ximian.com>
15992 * cs-parser.jay: Ugly. We had to add a multiplicative_expression,
15993 because identifiers after a parenthesis would end up in this kind
15994 of production, and we needed to desamiguate it for having casts
15997 (UserDefinedType *) xxx
15999 2002-10-24 Miguel de Icaza <miguel@ximian.com>
16001 * typemanager.cs (RealMemberLookup): when we deal with a subclass,
16002 we should set on the Bindingflags.NonPublic, but not turn on
16003 private_ok. private_ok controls whether a Private member is
16004 returned (this is chekced on the filter routine), while the
16005 BindingFlags.NonPublic just controls whether private/protected
16006 will be allowed. This fixes the problem part of the problem of
16007 private properties being allowed to be used in derived classes.
16009 * expression.cs (BaseAccess): Provide an DoResolveLValue method,
16010 so we can call the children DoResolveLValue method (this will
16011 properly signal errors on lvalue assignments to base properties)
16013 * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
16014 getter are null, and we have a property info, we know that this
16015 happened because the lookup failed, so we report an error 122 for
16016 protection level violation.
16018 We also silently return if setter and getter are null in the
16019 resolve functions, this condition only happens if we have flagged
16020 the error before. This is the other half of the problem.
16022 (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
16023 not have accessibility information, that is why we were returning
16024 true in the filter function in typemanager.cs.
16026 To properly report 122 (property is inaccessible because of its
16027 protection level) correctly, we report this error in ResolveAccess
16028 by failing if both the setter and the getter are lacking (ie, the
16031 DoResolve and DoLResolve have been modified to check for both
16032 setter/getter being null and returning silently, the reason being
16033 that I did not want to put the knowledge about this error in upper
16036 int old = Report.Errors;
16037 x = new PropertyExpr (...);
16038 if (old != Report.Errors)
16043 So the property expr is returned, but it is invalid, so the error
16044 will be flagged during the resolve process.
16046 * class.cs: Remove InheritablePropertySignatureCompare from the
16047 class, as we no longer depend on the property signature to compute
16048 whether it is possible to implement a method or not.
16050 The reason is that calling PropertyInfo.GetGetMethod will return
16051 null (in .NET, in Mono it works, and we should change this), in
16052 cases where the Get Method does not exist in that particular
16057 class X { public virtual int A { get { return 1; } } }
16059 class Z : Y { public override int A { get { return 2; } } }
16061 Would fail in Z because the parent (Y) would not have the property
16062 defined. So we avoid this completely now (because the alternative
16063 fix was ugly and slow), and we now depend exclusively on the
16066 (PropertyBase.CheckBase): Use a method-base mechanism to find our
16067 reference method, instead of using the property.
16069 * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
16070 routines are gone now.
16072 * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
16073 names, they were incorrectly named.
16075 * cs-tokenizer.cs: Return are more gentle token on failure.
16077 * pending.cs (PendingImplementation.InterfaceMethod): This routine
16078 had an out-of-sync index variable, which caused it to remove from
16079 the list of pending methods the wrong method sometimes.
16081 2002-10-22 Miguel de Icaza <miguel@ximian.com>
16083 * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
16084 CanWrite, because those refer to this particular instance of the
16085 property, and do not take into account the fact that we can
16086 override single members of a property.
16088 Constructor requires an EmitContext. The resolution process does
16089 not happen here, but we need to compute the accessors before,
16090 because the resolution does not always happen for properties.
16092 * typemanager.cs (RealMemberLookup): Set private_ok if we are a
16093 subclass, before we did not update this flag, but we did update
16096 (GetAccessors): Drop this routine, as it did not work in the
16097 presence of partially overwritten set/get methods.
16099 Notice that this broke the cs1540 detection, but that will require
16102 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16106 * driver.cs: issue a warning instead of an error if we don't support
16107 debugging for the platform. Also ignore a couple of errors that may
16108 arise when trying to write the symbols. Undo my previous patch.
16110 2002-10-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16112 * driver.cs: ignore /debug switch except for Unix platforms.
16114 2002-10-23 Nick Drochak <ndrochak@gol.com>
16116 * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
16118 2002-10-21 Miguel de Icaza <miguel@ximian.com>
16120 * driver.cs: Do not make mcs-debug conditional, so we do not break
16121 builds that use it.
16123 * statement.cs (UsageVector.MergeChildren): I would like Martin to
16124 review this patch. But basically after all the children variables
16125 have been merged, the value of "Breaks" was not being set to
16126 new_breaks for Switch blocks. I think that it should be set after
16127 it has executed. Currently I set this to the value of new_breaks,
16128 but only if new_breaks is FlowReturn.ALWAYS, which is a bit
16129 conservative, but I do not understand this code very well.
16131 I did not break anything in the build, so that is good ;-)
16133 * cs-tokenizer.cs: Also allow \r in comments as a line separator.
16135 2002-10-20 Mark Crichton <crichton@gimp.org>
16137 * cfold.cs: Fixed compile blocker. Really fixed it this time.
16139 2002-10-20 Nick Drochak <ndrochak@gol.com>
16141 * cfold.cs: Fixed compile blocker.
16143 2002-10-20 Miguel de Icaza <miguel@ximian.com>
16145 * driver.cs: I was chekcing the key, not the file.
16147 2002-10-19 Ravi Pratap <ravi@ximian.com>
16149 * ecore.cs (UserDefinedConversion): Get rid of the bogus error
16150 message that we were generating - we just need to silently return
16153 2002-10-19 Miguel de Icaza <miguel@ximian.com>
16155 * class.cs (Event.Define): Change my previous commit, as this
16156 breaks the debugger. This is a temporary hack, as it seems like
16157 the compiler is generating events incorrectly to begin with.
16159 * expression.cs (Binary.ResolveOperator): Added support for
16160 "U operator - (E x, E y)"
16162 * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
16165 * ecore.cs (FieldExpr.AddressOf): We had a special code path for
16166 init-only variables, but this path did not take into account that
16167 there might be also instance readonly variables. Correct this
16170 This fixes bug 32253
16172 * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
16175 * driver.cs: Change the extension for modules to `netmodule'
16177 * cs-parser.jay: Improved slightly the location tracking for
16178 the debugger symbols.
16180 * class.cs (Event.Define): Use Modifiers.FieldAttr on the
16181 modifiers that were specified instead of the hardcoded value
16182 (FamAndAssem). This was basically ignoring the static modifier,
16183 and others. Fixes 32429.
16185 * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
16186 fixed a bug in the process (32476)
16188 * expression.cs (ArrayAccess.EmitAssign): Patch from
16189 hwang_rob@yahoo.ca that fixes bug 31834.3
16191 2002-10-18 Miguel de Icaza <miguel@ximian.com>
16193 * driver.cs: Make the module extension .netmodule.
16195 2002-10-16 Miguel de Icaza <miguel@ximian.com>
16197 * driver.cs: Report an error if the resource file is not found
16198 instead of crashing.
16200 * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
16201 false, like Emit does.
16203 2002-10-16 Nick Drochak <ndrochak@gol.com>
16205 * typemanager.cs: Remove unused private member. Also reported mcs
16206 bug to report this as a warning like csc.
16208 2002-10-15 Martin Baulig <martin@gnome.org>
16210 * statement.cs (Statement.Emit): Made this a virtual method; emits
16211 the line number info and calls DoEmit().
16212 (Statement.DoEmit): New protected abstract method, formerly knows
16213 as Statement.Emit().
16215 * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
16217 2002-10-11 Miguel de Icaza <miguel@ximian.com>
16219 * class.cs: Following the comment from 2002-09-26 to AddMethod, I
16220 have fixed a remaining problem: not every AddXXXX was adding a
16221 fully qualified name.
16223 Now everyone registers a fully qualified name in the DeclSpace as
16224 being defined instead of the partial name.
16226 Downsides: we are slower than we need to be due to the excess
16227 copies and the names being registered this way.
16229 The reason for this is that we currently depend (on the corlib
16230 bootstrap for instance) that types are fully qualified, because
16231 we dump all the types in the namespace, and we should really have
16232 types inserted into the proper namespace, so we can only store the
16233 basenames in the defined_names array.
16235 2002-10-10 Martin Baulig <martin@gnome.org>
16237 * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
16238 from bug #31834, see the bug report for a testcase which is
16241 2002-10-10 Martin Baulig <martin@gnome.org>
16243 * codegen.cs (EmitContext.Breaks): Removed, we're now using the
16244 flow analysis code for this.
16246 * statement.cs (Do, While, For): Tell the flow analysis code about
16248 (FlowBranching.UsageVector): Added support for infinite loops.
16249 (Block.Resolve): Moved the dead code elimination here and use flow
16252 2002-10-09 Miguel de Icaza <miguel@ximian.com>
16254 * class.cs (Field.Define): Catch cycles on struct type
16257 * typemanager.cs (IsUnmanagedtype): Do not recursively check
16258 fields if the fields are static. We only need to check instance
16261 * expression.cs (As.DoResolve): Test for reference type.
16263 * statement.cs (Using.ResolveExpression): Use
16264 ConvertImplicitRequired, not ConvertImplicit which reports an
16266 (Using.ResolveLocalVariableDecls): ditto.
16268 * expression.cs (Binary.ResolveOperator): Report errors in a few
16269 places where we had to.
16271 * typemanager.cs (IsUnmanagedtype): Finish implementation.
16273 2002-10-08 Miguel de Icaza <miguel@ximian.com>
16275 * expression.cs: Use StoreFromPtr instead of extracting the type
16276 and then trying to use Stelem. Patch is from hwang_rob@yahoo.ca
16278 * ecore.cs (ImplicitReferenceConversion): It is possible to assign
16279 an enumeration value to a System.Enum, but System.Enum is not a
16280 value type, but an class type, so we need to box.
16282 (Expression.ConvertExplicit): One codepath could return
16283 errors but not flag them. Fix this. Fixes #31853
16285 * parameter.cs (Resolve): Do not allow void as a parameter type.
16287 2002-10-06 Martin Baulig <martin@gnome.org>
16289 * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
16290 if it's a class type and not a struct. Fixes #31815.
16292 2002-10-06 Martin Baulig <martin@gnome.org>
16294 * statement.cs: Reworked the flow analysis code a bit to make it
16295 usable for dead code elimination.
16297 2002-10-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16299 * cs-parser.jay: allow empty source files. Fixes bug #31781.
16301 2002-10-04 Miguel de Icaza <miguel@ximian.com>
16303 * expression.cs (ComposedCast.DoResolveType): A quick workaround
16304 to fix the test 165, will investigate deeper.
16306 2002-10-04 Martin Baulig <martin@gnome.org>
16308 * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
16309 finally blocks actually work.
16310 (Try.Resolve): We don't need to create a sibling for `finally' if
16311 there is no finally block.
16313 2002-10-04 Martin Baulig <martin@gnome.org>
16315 * class.cs (Constructor.Define): The default accessibility for a
16316 non-default constructor is private, not public.
16318 2002-10-04 Miguel de Icaza <miguel@ximian.com>
16320 * class.cs (Constructor): Make AllowedModifiers public, add
16323 * cs-parser.jay: Perform the modifiers test here, as the
16324 constructor for the Constructor class usually receives a zero
16325 because of the way we create it (first we create, later we
16326 customize, and we were never checking the modifiers).
16328 * typemanager.cs (Typemanager.LookupTypeDirect): This new function
16329 is a version of LookupTypeReflection that includes the type-name
16330 cache. This can be used as a fast path for functions that know
16331 the fully qualified name and are only calling into *.GetType() to
16332 obtain a composed type.
16334 This is also used by TypeManager.LookupType during its type
16337 (LookupType): We now also track the real type name, as sometimes
16338 we can get a quey for the real type name from things like
16339 ComposedCast. This fixes bug 31422.
16341 * expression.cs (ComposedCast.Resolve): Since we are obtaining a
16342 complete type fullname, it does not have to go through the type
16343 resolution system to obtain the composed version of the type (for
16344 obtaining arrays or pointers).
16346 (Conditional.Emit): Use the EmitBoolExpression to
16347 generate nicer code, as requested by Paolo.
16349 (ArrayCreation.CheckIndices): Use the patch from
16350 hwang_rob@yahoo.ca to validate the array initializers.
16352 2002-10-03 Miguel de Icaza <miguel@ximian.com>
16354 * class.cs (ConstructorInitializer.Emit): simplify code by using
16355 Invocation.EmitCall, and at the same time, fix the bugs in calling
16356 parent constructors that took variable arguments.
16358 * ecore.cs (Expression.ConvertNumericExplicit,
16359 Expression.ImplicitNumericConversion): Remove the code that
16360 manually wrapped decimal (InternalTypeConstructor call is now gone
16363 * expression.cs (Cast.TryReduce): Also handle decimal types when
16364 trying to perform a constant fold on the type.
16366 * typemanager.cs (IsUnmanagedtype): Partially implemented.
16368 * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
16369 that only turned off an error report, and did nothing else.
16371 2002-10-02 Miguel de Icaza <miguel@ximian.com>
16373 * driver.cs: Handle and ignore /fullpaths
16375 2002-10-01 Miguel de Icaza <miguel@ximian.com>
16377 * expression.cs (Binary.ResolveOperator): Catch the case where
16378 DoNumericPromotions returns true,
16380 (Binary.DoNumericPromotions): Simplify the code, and the tests.
16382 2002-09-27 Miguel de Icaza <miguel@ximian.com>
16384 * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
16387 2002-09-26 Miguel de Icaza <miguel@ximian.com>
16389 * ecore.cs (ConvertNumericExplicit): It is not enough that the
16390 conversion exists, but it is also required that the conversion be
16391 performed. This manifested in "(Type64Enum) 2".
16393 * class.cs (TypeManager.AddMethod): The fix is not to change
16394 AddEnum, because that one was using a fully qualified name (every
16395 DeclSpace derivative does), but to change the AddMethod routine
16396 that was using an un-namespaced name. This now correctly reports
16397 the duplicated name.
16399 Revert patch until I can properly fix it. The issue
16400 is that we have a shared Type space across all namespaces
16401 currently, which is wrong.
16403 Options include making the Namespace a DeclSpace, and merge
16404 current_namespace/current_container in the parser.
16406 2002-09-25 Miguel de Icaza <miguel@ximian.com>
16408 * cs-parser.jay: Improve error reporting when we get a different
16409 kind of expression in local_variable_type and
16410 local_variable_pointer_type.
16412 Propagate this to avoid missleading errors being reported.
16414 * ecore.cs (ImplicitReferenceConversion): treat
16415 TypeManager.value_type as a target just like object_type. As
16420 Is valid, and needs to result in the int 1 being boxed before it
16421 is assigned to the value type v.
16423 * class.cs (TypeContainer.AddEnum): Use the basename, not the name
16424 to validate the enumeration name.
16426 * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
16427 EmitDynamicInitializers for the criteria to use Ldelema. Thanks
16428 to hwang_rob@yahoo.ca for finding the bug and providing a patch.
16430 * ecore.cs (TryImplicitIntConversion): When doing an
16431 implicit-enumeration-conversion, check if the type is 64-bits and
16432 perform a conversion before passing to EnumConstant.
16434 2002-09-23 Miguel de Icaza <miguel@ximian.com>
16436 * decl.cs (Error_AmbiguousTypeReference); New routine used to
16437 report ambiguous type references. Unlike the MS version, we
16438 report what the ambiguity is. Innovation at work ;-)
16440 (DeclSpace.FindType): Require a location argument to
16441 display when we display an ambiguous error.
16443 * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
16445 * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
16447 * expression.cs (EmitDynamicInitializers): Apply patch from
16448 hwang_rob@yahoo.ca that fixes the order in which we emit our
16451 2002-09-21 Martin Baulig <martin@gnome.org>
16453 * delegate.cs (Delegate.VerifyApplicability): Make this work if the
16454 delegate takes no arguments.
16456 2002-09-20 Miguel de Icaza <miguel@ximian.com>
16458 * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
16461 * expression.cs: Extract the underlying type.
16463 * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
16465 * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
16467 2002-09-19 Miguel de Icaza <miguel@ximian.com>
16469 * class.cs (TypeContainer.DefineType): We can not use the nice
16470 PackingSize with the size set to 1 DefineType method, because it
16471 will not allow us to define the interfaces that the struct
16474 This completes the fixing of bug 27287
16476 * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
16477 means also structs. This fixes part of the problem.
16478 (Expresion.ImplicitReferenceConversionExists): ditto.
16480 * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
16481 error if there were no errors reported during the type lookup
16482 process, to avoid duplicates or redundant errors. Without this
16483 you would get an ambiguous errors plus a type not found. We have
16484 beaten the user enough with the first error.
16486 (DeclSparce.FindType): Emit a warning if we have an ambiguous
16489 * ecore.cs (SimpleName.DoResolveType): If an error is emitted
16490 during the resolution process, stop the lookup, this avoids
16491 repeated error reports (same error twice).
16493 * rootcontext.cs: Emit a warning if we have an ambiguous reference.
16495 * typemanager.cs (LookupType): Redo the type lookup code to match
16496 the needs of System.Reflection.
16498 The issue is that System.Reflection requires references to nested
16499 types to begin with a "+" sign instead of a dot. So toplevel
16500 types look like: "NameSpace.TopLevelClass", and nested ones look
16501 like "Namespace.TopLevelClass+Nested", with arbitrary nesting
16504 2002-09-19 Martin Baulig <martin@gnome.org>
16506 * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
16507 says that a method always returns or always throws an exception,
16508 don't report the CS0161.
16510 * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
16511 set `Returns = new_returns'.
16513 2002-09-19 Martin Baulig <martin@gnome.org>
16515 * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
16516 to an enum constant, check for a CS0176.
16518 2002-09-18 Miguel de Icaza <miguel@ximian.com>
16520 * class.cs (TypeContainer.CheckPairedOperators): Now we check
16521 for operators that must be in pairs and report errors.
16523 * ecore.cs (SimpleName.DoResolveType): During the initial type
16524 resolution process, when we define types recursively, we must
16525 check first for types in our current scope before we perform
16526 lookups in the enclosing scopes.
16528 * expression.cs (MakeByteBlob): Handle Decimal blobs.
16530 (Invocation.VerifyArgumentsCompat): Call
16531 TypeManager.TypeToCoreType on the parameter_type.GetElementType.
16532 I thought we were supposed to always call this, but there are a
16533 few places in the code where we dont do it.
16535 2002-09-17 Miguel de Icaza <miguel@ximian.com>
16537 * driver.cs: Add support in -linkres and -resource to specify the
16538 name of the identifier.
16540 2002-09-16 Miguel de Icaza <miguel@ximian.com>
16542 * ecore.cs (StandardConversionExists): Sync with the conversion
16543 code: allow anything-* to void* conversions.
16545 (FindMostSpecificSource): Use an Expression argument
16546 instead of a Type, because we might be handed over a Literal which
16547 gets a few more implicit conversions that plain types do not. So
16548 this information was being lost.
16550 Also, we drop the temporary type-holder expression when not
16553 2002-09-17 Martin Baulig <martin@gnome.org>
16555 * class.cs (PropertyBase.CheckBase): Don't check the base class if
16556 this is an explicit interface implementation.
16558 2002-09-17 Martin Baulig <martin@gnome.org>
16560 * class.cs (PropertyBase.CheckBase): Make this work for indexers with
16561 different `IndexerName' attributes.
16563 * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
16564 (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
16565 virtual CommonResolve().
16567 2002-09-16 Miguel de Icaza <miguel@ximian.com>
16569 * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16570 and convert that to the UnderlyingType.
16572 * statement.cs (Foreach.Resolve): Indexers are just like variables
16573 or PropertyAccesses.
16575 * cs-tokenizer.cs (consume_string): Track line numbers and columns
16576 inside quoted strings, we were not doing this before.
16578 2002-09-16 Martin Baulig <martin@gnome.org>
16580 * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16581 resolve it. This is needed for the definite assignment check of the
16582 instance expression, fixes bug #29846.
16583 (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16585 2002-09-16 Nick Drochak <ndrochak@gol.com>
16587 * parameter.cs: Fix compile error. Cannot reference static member
16588 from an instance object. Is this an mcs bug?
16590 2002-09-14 Martin Baulig <martin@gnome.org>
16592 * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16593 multiple times. Fixes bug #30295, added test-166.cs.
16595 2002-09-14 Martin Baulig <martin@gnome.org>
16597 * statement.cs (Block.Emit): Don't emit unreachable code.
16598 (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16599 `break' statements.
16600 (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16602 2002-09-14 Martin Baulig <martin@gnome.org>
16604 * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16607 2002-09-14 Martin Baulig <martin@gnome.org>
16609 * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16610 if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16611 be false on the ms runtime.
16613 2002-09-13 Martin Baulig <martin@gnome.org>
16615 * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16616 the CS0038 error message.
16618 2002-09-12 Miguel de Icaza <miguel@ximian.com>
16620 * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16621 constant inside, return it.
16623 2002-09-12 Martin Baulig <martin@gnome.org>
16625 * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16626 implicit conversion can be done between enum types.
16628 * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16629 check whether an implicit conversion to the current enum's UnderlyingType
16630 exists and report an error if not.
16632 * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16633 without debugging support.
16635 * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16636 Fixes bug #30235. Thanks to Ricardo Fernández Pascual.
16638 2002-09-12 Martin Baulig <martin@gnome.org>
16640 * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16642 * ecore.cs (IMemberExpr.DeclaringType): New property.
16643 (SimpleName.SimpleNameResolve): Check whether we're accessing a
16644 nonstatic member of an outer type (CS0038).
16646 2002-09-11 Miguel de Icaza <miguel@ximian.com>
16648 * driver.cs: Activate the using-error detector at warning level
16649 4 (at least for MS-compatible APIs).
16651 * namespace.cs (VerifyUsing): Small buglett fix.
16653 * pending.cs (PendingImplementation): pass the container pointer.
16655 * interface.cs (GetMethods): Allow for recursive definition. Long
16656 term, I would like to move every type to support recursive
16657 definitions, not the current ordering mechanism that we have right
16660 The situation is this: Attributes are handled before interfaces,
16661 so we can apply attributes to interfaces. But some attributes
16662 implement interfaces, we will now handle the simple cases
16663 (recursive definitions will just get an error).
16665 * parameter.cs: Only invalidate types at the end if we fail to
16668 2002-09-09 Martin Baulig <martin@gnome.org>
16670 * ecore.cs (PropertyExpr.Emit): Also check for
16671 TypeManager.system_int_array_get_length so this'll also work when
16672 compiling corlib. Fixes #30003.
16674 2002-09-09 Martin Baulig <martin@gnome.org>
16676 * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16677 and throw an exception if we can't get the type's size. Fixed #30040,
16680 2002-09-09 Martin Baulig <martin@gnome.org>
16682 * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16684 * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16685 context. Fixes bug #30027.
16687 * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16688 virtual functions. Fixes bug #30043, added test-164.cs.
16690 2002-09-08 Ravi Pratap <ravi@ximian.com>
16692 * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16694 2002-09-08 Nick Drochak <ndrochak@gol.com>
16696 * driver.cs: Use an object to get the windows codepage since it's not a
16699 2002-09-08 Miguel de Icaza <miguel@ximian.com>
16701 * statement.cs (For.Emit): for infinite loops (test == null)
16702 return whether there is a break inside, not always "true".
16704 * namespace.cs (UsingEntry): New struct to hold the name of the
16705 using definition, the location where it is defined, and whether it
16706 has been used in a successful type lookup.
16708 * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16713 2002-09-06 Ravi Pratap <ravi@ximian.com>
16715 * attribute.cs : Fix incorrect code which relied on catching
16716 a NullReferenceException to detect a null being passed in
16717 where an object was expected.
16719 2002-09-06 Miguel de Icaza <miguel@ximian.com>
16721 * statement.cs (Try): flag the catch variable as assigned
16723 * expression.cs (Cast): Simplified by using ResolveType instead of
16724 manually resolving.
16726 * statement.cs (Catch): Fix bug by using ResolveType.
16728 2002-09-06 Ravi Pratap <ravi@ximian.com>
16730 * expression.cs (BetterConversion): Special case for when we have
16731 a NullLiteral as the argument and we have to choose between string
16732 and object types - we choose string the way csc does.
16734 * attribute.cs (Attribute.Resolve): Catch the
16735 NullReferenceException and report error #182 since the Mono
16736 runtime no more has the bug and having this exception raised means
16737 we tried to select a constructor which takes an object and is
16740 2002-09-05 Ravi Pratap <ravi@ximian.com>
16742 * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16743 message (1502, 1503) when we can't locate a method after overload
16744 resolution. This is much more informative and closes the bug
16747 * interface.cs (PopulateMethod): Return if there are no argument
16748 types. Fixes a NullReferenceException bug.
16750 * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16751 expressions too. Previously we were checking only in one place for
16752 positional arguments leaving out named arguments.
16754 * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16755 type to the enum type is not allowed. Remove code corresponding to
16758 (ConvertNumericExplicit): Allow explicit conversions from
16759 the underlying type to enum type. This precisely follows the spec
16760 and closes a bug filed by Gonzalo.
16762 2002-09-04 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16765 * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16767 2002-09-03 Miguel de Icaza <miguel@ximian.com>
16769 * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16770 it was important that we stored the right value after the
16771 reduction in `converted'.
16773 2002-09-04 Martin Baulig <martin@gnome.org>
16775 * location.cs (Location.SymbolDocument): Use full pathnames for the
16778 2002-08-30 Miguel de Icaza <miguel@ximian.com>
16780 * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16781 of the expression resolve mechanism, because that will catch the
16782 SimpleName error failures.
16784 (Conditional): If we can not resolve the
16785 expression, return, do not crash.
16787 2002-08-29 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16790 (location): display token name instead of its number.
16792 2002-08-28 Martin Baulig <martin@gnome.org>
16794 * expression.cs (Binary.ResolveOperator): Don't silently return
16795 but return an error if an operator cannot be applied between two
16798 2002-08-28 Martin Baulig <martin@gnome.org>
16800 * class.cs (Constructor.Define): Set the permission attributes
16801 correctly instead of making all constructors public.
16803 2002-08-28 Martin Baulig <martin@gnome.org>
16805 * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16806 for private members before reporting a CS0103; if we find anything,
16809 2002-08-28 Martin Baulig <martin@gnome.org>
16811 * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16812 to check whether `closure_start_type == closure_invocation_type',
16813 we also need to check whether `m.DeclaringType == closure_invocation_type'
16814 before bypassing the permission checks. We might be accessing
16815 protected/private members from the base class.
16816 (TypeManager.RealMemberLookup): Only set private_ok if private
16817 members were requested via BindingFlags.NonPublic.
16819 * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16821 * expression.cs (MemberAccess.ResolveMemberAccess): Set
16822 MethodGroupExpr.IsExplicitImpl if appropriate.
16823 (Invocation.DoResolve): Don't report the CS0120 for explicit
16824 interface implementations.
16826 2002-08-27 Martin Baulig <martin@gnome.org>
16828 * expression.cs (Invocation.DoResolve): If this is a static
16829 method and we don't have an InstanceExpression, we must report
16832 2002-08-25 Martin Baulig <martin@gnome.org>
16834 * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
16835 `==' between a valuetype and an object.
16837 2002-08-25 Miguel de Icaza <miguel@ximian.com>
16839 * ecore.cs (TypeExpr): Provide a ToString method.
16841 2002-08-24 Martin Baulig <martin@gnome.org>
16843 * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
16844 now called proggie.dbg and it's a binary file.
16846 2002-08-23 Martin Baulig <martin@gnome.org>
16848 * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
16850 2002-08-23 Martin Baulig <martin@gnome.org>
16852 * struct.cs (MyStructInfo.ctor): Make this work with empty
16853 structs; it's not allowed to use foreach() on null.
16855 2002-08-23 Martin Baulig <martin@gnome.org>
16857 * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
16858 writer the full pathname of the generated assembly.
16860 2002-08-23 Martin Baulig <martin@gnome.org>
16862 * statements.cs (FlowBranching.UsageVector.MergeChildren):
16863 A `finally' block never returns or breaks; improved handling of
16866 2002-08-23 Martin Baulig <martin@gnome.org>
16868 * statement.cs (Throw.Resolve): Allow `throw null'.
16870 2002-08-23 Martin Baulig <martin@gnome.org>
16872 * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16873 EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16874 `ee.EventInfo.DeclaringType == ec.ContainerType'. The
16875 MemberLookup would return a wrong event if this is an explicit
16876 interface implementation and the class has an event with the same
16879 2002-08-23 Martin Baulig <martin@gnome.org>
16881 * statement.cs (Block.AddChildVariableNames): New public method.
16882 (Block.AddChildVariableName): Likewise.
16883 (Block.IsVariableNameUsedInChildBlock): Likewise.
16884 (Block.AddVariable): Check whether a variable name has already
16885 been used in a child block.
16887 * cs-parser.jay (declare_local_variables): Mark all variable names
16888 from the current block as being used in a child block in the
16891 2002-08-23 Martin Baulig <martin@gnome.org>
16893 * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16894 find the symbol writer.
16896 * driver.cs: csc also allows the arguments to /define being
16897 separated by commas, not only by semicolons.
16899 2002-08-23 Martin Baulig <martin@gnome.org>
16901 * interface.cs (Interface.GetMembers): Added static check for events.
16903 2002-08-15 Martin Baulig <martin@gnome.org>
16905 * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16906 call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16908 * ecore.cs (Expression.MemberLookup): Added documentation and explained
16909 why the MethodData.EmitDestructor() change was necessary.
16911 2002-08-20 Martin Baulig <martin@gnome.org>
16913 * class.cs (TypeContainer.FindMembers): Added static check for events.
16915 * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16917 * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16918 use Type.GetEvents(), not Type.FindMembers().
16920 2002-08-20 Martin Baulig <martin@gnome.org>
16922 * decl.cs (MemberCache): Added a special method cache which will
16923 be used for method-only searched. This ensures that a method
16924 search will return a MethodInfo with the correct ReflectedType for
16927 2002-08-20 Martin Baulig <martin@gnome.org>
16929 * decl.cs (DeclSpace.FindMembers): Made this public.
16931 2002-08-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
16933 * delegate.cs: fixed build on windows.
16934 [FIXME: Filed as bug #29150: MCS must report these errors.]
16936 2002-08-19 Ravi Pratap <ravi@ximian.com>
16938 * ecore.cs (StandardConversionExists): Return a false
16939 if we are trying to convert the void type to anything else
16940 since that is not allowed.
16942 * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16943 we flag error 70 in the event an event is trying to be accessed
16944 directly from outside the declaring type.
16946 2002-08-20 Martin Baulig <martin@gnome.org>
16948 * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16949 MemberCache from typemanager.cs to decl.cs.
16951 2002-08-19 Martin Baulig <martin@gnome.org>
16953 * class.cs (TypeContainer): Implement IMemberContainer.
16954 (TypeContainer.DefineMembers): Create the MemberCache.
16955 (TypeContainer.FindMembers): Do better BindingFlags checking; only
16956 return public members if BindingFlags.Public was given, check
16957 whether members are static.
16959 2002-08-16 Martin Baulig <martin@gnome.org>
16961 * decl.cs (DeclSpace.Define): Splitted this in Define and
16962 DefineMembers. DefineMembers is called first and initializes the
16965 * rootcontext.cs (RootContext.DefineMembers): New function. Calls
16966 DefineMembers() on all our DeclSpaces.
16968 * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16969 but call DefineMembers() on all nested interfaces. We call their
16970 Define() in our new Define() function.
16972 * interface.cs (Interface): Implement IMemberContainer.
16973 (Interface.Define): Moved all code except the attribute stuf to
16975 (Interface.DefineMembers): Initialize the member cache.
16977 * typemanager.cs (IMemberFinder): Removed this interface, we don't
16978 need this anymore since we can use MemberCache.FindMembers directly.
16980 2002-08-19 Martin Baulig <martin@gnome.org>
16982 * typemanager.cs (MemberCache): When creating the cache for an
16983 interface type, add all inherited members.
16984 (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16985 to `out bool used_cache' and documented it.
16986 (TypeManager.MemberLookup): If we already used the cache in the first
16987 iteration, we don't need to do the interfaces check.
16989 2002-08-19 Martin Baulig <martin@gnome.org>
16991 * decl.cs (DeclSpace.FindMembers): New abstract method. Moved this
16992 here from IMemberFinder and don't implement this interface anymore.
16993 (DeclSpace.MemberCache): Moved here from IMemberFinder.
16995 * typemanager.cs (IMemberFinder): This interface is now only used by
16996 classes which actually support the member cache.
16997 (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16998 since we only put DeclSpaces into this Hashtable.
16999 (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
17000 a dynamic type and TypeHandle.GetTypeHandle() otherwise.
17002 2002-08-16 Martin Baulig <martin@gnome.org>
17004 * typemanager.cs (ICachingMemberFinder): Removed.
17005 (IMemberFinder.MemberCache): New property.
17006 (TypeManager.FindMembers): Merged this with RealFindMembers().
17007 This function will never be called from TypeManager.MemberLookup()
17008 so we can't use the cache here, just the IMemberFinder.
17009 (TypeManager.MemberLookup_FindMembers): Check whether the
17010 IMemberFinder has a MemberCache and call the cache's FindMembers
17012 (MemberCache): Rewrote larger parts of this yet another time and
17013 cleaned it up a bit.
17015 2002-08-15 Miguel de Icaza <miguel@ximian.com>
17017 * driver.cs (LoadArgs): Support quoting.
17019 (Usage): Show the CSC-like command line arguments.
17021 Improved a few error messages.
17023 2002-08-15 Martin Baulig <martin@gnome.org>
17025 * typemanager.cs (IMemberContainer.Type): New property.
17026 (IMemberContainer.IsInterface): New property.
17028 The following changes are conditional to BROKEN_RUNTIME, which is
17029 defined at the top of the file.
17031 * typemanager.cs (MemberCache.MemberCache): Don't add the base
17032 class'es members, but add all members from TypeHandle.ObjectType
17033 if we're an interface.
17034 (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
17035 is the current type.
17036 (MemberCache.CacheEntry.Container): Removed this field.
17037 (TypeHandle.GetMembers): Include inherited members.
17039 2002-08-14 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17041 * typemanager.cs: fixed compilation and added a comment on a field that
17044 2002-08-15 Martin Baulig <martin@gnome.org>
17046 * class.cs (ConstructorInitializer.Resolve): In the
17047 Expression.MemberLookup call, use the queried_type as
17050 * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
17051 declared' attribute, it's always true.
17052 (IMemberContainer.Parent, IMemberContainer.Name): New properties.
17053 (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
17054 temporary wrapper for FindMembers which tells MemberLookup whether
17055 members from the base classes are included in the return value.
17056 This will go away soon.
17057 (TypeManager.MemberLookup): Use this temporary hack here; once the
17058 new MemberCache is completed, we don't need to do the DeclaredOnly
17059 looping here anymore since the MemberCache will take care of this.
17060 (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
17061 (MemberCache): When creating the MemberCache for a class, get
17062 members from the current class and all its base classes.
17063 (MemberCache.CacheEntry.Container): New field. This is a
17064 temporary hack until the Mono runtime is fixed to distinguish
17065 between ReflectedType and DeclaringType. It allows us to use MCS
17066 with both the MS runtime and the unfixed Mono runtime without
17067 problems and without accecting performance.
17068 (MemberCache.SearchMembers): The DeclaredOnly looping from
17069 TypeManager.MemberLookup is now done here.
17071 2002-08-14 Martin Baulig <martin@gnome.org>
17073 * statement.cs (MyStructInfo.MyStructInfo): Don't call
17074 Type.GetFields on dynamic types but get the fields from the
17075 corresponding TypeContainer.
17076 (MyStructInfo.GetStructInfo): Added check for enum types.
17078 * typemanager.cs (MemberList.IsSynchronized): Implemented.
17079 (MemberList.SyncRoot): Implemented.
17080 (TypeManager.FilterWithClosure): No need to check permissions if
17081 closure_start_type == closure_invocation_type, don't crash if
17082 closure_invocation_type is null.
17084 2002-08-13 Martin Baulig <martin@gnome.org>
17086 Rewrote TypeContainer.FindMembers to use a member cache. This
17087 gives us a speed increase of about 35% for the self-hosting MCS
17088 build and of about 15-20% for the class libs (both on GNU/Linux).
17090 * report.cs (Timer): New class to get enhanced profiling. This
17091 whole class is "TIMER" conditional since it remarkably slows down
17094 * class.cs (MemberList): New class. This is an IList wrapper
17095 which we're now using instead of passing MemberInfo[]'s around to
17096 avoid copying this array unnecessarily.
17097 (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
17098 (ICachingMemberFinder, IMemberContainer): New interface.
17099 (TypeManager.FilterWithClosure): If `criteria' is null, the name
17100 has already been checked, otherwise use it for the name comparision.
17101 (TypeManager.FindMembers): Renamed to RealMemberFinder and
17102 provided wrapper which tries to use ICachingMemberFinder.FindMembers
17103 if possible. Returns a MemberList, not a MemberInfo [].
17104 (TypeHandle): New class, implements IMemberContainer. We create
17105 one instance of this class per type, it contains a MemberCache
17106 which is used to do the member lookups.
17107 (MemberCache): New class. Each instance of this class contains
17108 all members of a type and a name-based hash table.
17109 (MemberCache.FindMembers): This is our new member lookup
17110 function. First, it looks up all members of the requested name in
17111 the hash table. Then, it walks this list and sorts out all
17112 applicable members and returns them.
17114 2002-08-13 Martin Baulig <martin@gnome.org>
17116 In addition to a nice code cleanup, this gives us a performance
17117 increase of about 1.4% on GNU/Linux - not much, but it's already
17118 half a second for the self-hosting MCS compilation.
17120 * typemanager.cs (IMemberFinder): New interface. It is used by
17121 TypeManager.FindMembers to call FindMembers on a TypeContainer,
17122 Enum, Delegate or Interface.
17123 (TypeManager.finder_to_member_finder): New PtrHashtable.
17124 (TypeManager.finder_to_container): Removed.
17125 (TypeManager.finder_to_delegate): Removed.
17126 (TypeManager.finder_to_interface): Removed.
17127 (TypeManager.finder_to_enum): Removed.
17129 * interface.cs (Interface): Implement IMemberFinder.
17131 * delegate.cs (Delegate): Implement IMemberFinder.
17133 * enum.cs (Enum): Implement IMemberFinder.
17135 * class.cs (TypeContainer): Implement IMemberFinder.
17137 2002-08-12 Martin Baulig <martin@gnome.org>
17139 * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
17141 2002-08-12 Martin Baulig <martin@gnome.org>
17143 * ecore.cs (ITypeExpression): New interface for expressions which
17145 (TypeExpression): Renamed to TypeLookupExpression.
17146 (Expression.DoResolve): If we're doing a types-only lookup, the
17147 expression must implement the ITypeExpression interface and we
17148 call DoResolveType() on it.
17149 (SimpleName): Implement the new ITypeExpression interface.
17150 (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
17151 hack, the situation that we're only looking up types can't happen
17152 anymore when this method is called. Moved the type lookup code to
17153 DoResolveType() and call it.
17154 (SimpleName.DoResolveType): This ITypeExpression interface method
17155 is now doing the types-only lookup.
17156 (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
17157 (ResolveFlags): Added MaskExprClass.
17159 * expression.cs (MemberAccess): Implement the ITypeExpression
17161 (MemberAccess.DoResolve): Added support for a types-only lookup
17162 when we're called via ITypeExpression.DoResolveType().
17163 (ComposedCast): Implement the ITypeExpression interface.
17165 * codegen.cs (EmitContext.OnlyLookupTypes): Removed. Call
17166 Expression.Resolve() with ResolveFlags.Type instead.
17168 2002-08-12 Martin Baulig <martin@gnome.org>
17170 * interface.cs (Interface.Define): Apply attributes.
17172 * attribute.cs (Attribute.ApplyAttributes): Added support for
17173 interface attributes.
17175 2002-08-11 Martin Baulig <martin@gnome.org>
17177 * statement.cs (Block.Emit): Only check the "this" variable if we
17178 do not always throw an exception.
17180 * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
17181 whether the property has a set accessor.
17183 2002-08-11 Martin Baulig <martin@gnome.org>
17185 Added control flow analysis support for structs.
17187 * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
17188 with control flow analysis turned off.
17189 (IVariable): New interface.
17190 (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
17191 returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
17192 (FieldExpr.DoResolve): Resolve the instance expression with flow
17193 analysis turned off and do the definite assignment check after the
17194 resolving when we know what the expression will resolve to.
17196 * expression.cs (LocalVariableReference, ParameterReference):
17197 Implement the new IVariable interface, only call the flow analysis
17198 code if ec.DoFlowAnalysis is true.
17199 (This): Added constructor which takes a Block argument. Implement
17200 the new IVariable interface.
17201 (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
17202 DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
17203 This does the definite assignment checks for struct members.
17205 * class.cs (Constructor.Emit): If this is a non-static `struct'
17206 constructor which doesn't have any initializer, call
17207 Block.AddThisVariable() to tell the flow analysis code that all
17208 struct elements must be initialized before control returns from
17211 * statement.cs (MyStructInfo): New public class.
17212 (UsageVector.this [VariableInfo vi]): Added `int field_idx'
17213 argument to this indexer. If non-zero, check an individual struct
17214 member, not the whole struct.
17215 (FlowBranching.CheckOutParameters): Check struct members.
17216 (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
17217 overloaded versions of these methods which take an additional
17218 `int field_idx' argument to check struct members.
17219 (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
17220 overloaded versions of these methods which take an additional
17221 `string field_name' argument to check struct member.s
17222 (VariableInfo): Implement the IVariable interface.
17223 (VariableInfo.StructInfo): New public property. Returns the
17224 MyStructInfo instance of the variable if it's a struct or null.
17225 (Block.AddThisVariable): New public method. This is called from
17226 Constructor.Emit() for non-static `struct' constructor which do
17227 not have any initializer. It creates a special variable for the
17228 "this" instance variable which will be checked by the flow
17229 analysis code to ensure that all of the struct's fields are
17230 initialized before control returns from the constructor.
17231 (UsageVector): Added support for struct members. If a
17232 variable/parameter is a struct with N members, we reserve a slot
17233 in the usage vector for each member. A struct is considered fully
17234 initialized if either the struct itself (slot 0) or all its
17235 members are initialized.
17237 2002-08-08 Martin Baulig <martin@gnome.org>
17239 * driver.cs (Driver.MainDriver): Only report an error CS5001
17240 if there were no compilation errors.
17242 * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
17243 `UnsafeContext' property to determine whether the parent is in
17244 unsafe context rather than checking the parent's ModFlags:
17245 classes nested in an unsafe class are unsafe as well.
17247 2002-08-08 Martin Baulig <martin@gnome.org>
17249 * statement.cs (UsageVector.MergeChildren): Distinguish between
17250 `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
17251 we return. Added test17() and test18() to test-154.cs.
17253 2002-08-08 Martin Baulig <martin@gnome.org>
17255 * typemanager.cs (TypeManager.FilterWithClosure): If we have
17256 Family access, make sure the invoking type isn't a subclass of the
17257 queried type (that'd be a CS1540).
17259 * ecore.cs (Expression.MemberLookup): Added overloaded version of
17260 this method which takes an additional `Type invocation_type'.
17262 * expression.cs (BaseAccess.DoResolve): Use the base type as
17263 invocation and query type.
17264 (MemberAccess.DoResolve): If the lookup failed and we're about to
17265 report a CS0122, try a lookup with the ec.ContainerType - if this
17266 succeeds, we must report a CS1540.
17268 2002-08-08 Martin Baulig <martin@gnome.org>
17270 * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
17271 (MethodGroupExpr): Implement the IMemberExpr interface.
17273 * expression (MemberAccess.ResolveMemberAccess): No need to have
17274 any special code for MethodGroupExprs anymore, they're now
17277 2002-08-08 Martin Baulig <martin@gnome.org>
17279 * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
17280 Family, FamANDAssem and FamORAssem permissions.
17281 (TypeManager.IsSubclassOrNestedChildOf): New public method.
17283 2002-08-08 Martin Baulig <martin@gnome.org>
17285 * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
17286 (UsageVector.MergeChildren): `break' breaks unless we're in a switch
17289 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
17291 * driver.cs: implemented /resource option to embed managed resources.
17293 2002-08-07 Martin Baulig <martin@gnome.org>
17295 * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
17296 (FieldBase.HasFieldInitializer): New public property.
17297 (FieldBase.GetInitializerExpression): New public method. Resolves and
17298 returns the field initializer and makes sure it is only resolved once.
17299 (TypeContainer.EmitFieldInitializers): Call
17300 FieldBase.GetInitializerExpression to get the initializer, this ensures
17301 that it isn't resolved multiple times.
17303 * codegen.cs (EmitContext): Added `bool IsFieldInitialier'. This tells
17304 the resolving process (SimpleName/MemberLookup) that we're currently
17305 emitting a field initializer (which must not access any instance members,
17306 this is an error CS0236).
17308 * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
17309 argument, if the `IsFieldInitializer' flag is set, we must report and
17310 error CS0236 and not an error CS0120.
17312 2002-08-07 Martin Baulig <martin@gnome.org>
17314 * ecore.cs (IMemberExpr): New public interface.
17315 (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
17316 (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
17317 if the expression is an IMemberExpr.
17319 * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
17320 to be null, implicitly default to `this' if we're non-static in
17321 this case. Simplified the code a lot by using the new IMemberExpr
17322 interface. Also fixed bug #28176 here.
17324 2002-08-06 Martin Baulig <martin@gnome.org>
17326 * cs-parser.jay (SimpleLookup): Removed. We need to create
17327 ParameterReferences during semantic analysis so that we can do a
17328 type-only search when resolving Cast, TypeOf and SizeOf.
17329 (block): Pass the `current_local_parameters' to the Block's
17332 * class.cs (ConstructorInitializer): Added `Parameters parameters'
17333 argument to the constructor.
17334 (ConstructorInitializer.Resolve): Create a temporary implicit
17335 block with the parameters.
17337 * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
17338 references here if we aren't doing a type-only search.
17340 * statement.cs (Block): Added constructor which takes a
17341 `Parameters parameters' argument.
17342 (Block.Parameters): New public property.
17344 * support.cs (InternalParameters.Parameters): Renamed `parameters'
17345 to `Parameters' and made it public readonly.
17347 2002-08-06 Martin Baulig <martin@gnome.org>
17349 * ecore.cs (Expression.Warning): Made this public as well.
17351 * report.cs (Report.Debug): Print the contents of collections.
17353 2002-08-06 Martin Baulig <martin@gnome.org>
17355 * ecore.cs (Expression.ResolveFlags): New [Flags] enum. This is
17356 used to tell Resolve() which kinds of expressions it may return.
17357 (Expression.Resolve): Added overloaded version of this method which
17358 takes a `ResolveFlags flags' argument. This can be used to tell
17359 Resolve() which kinds of expressions it may return. Reports a
17361 (Expression.ResolveWithSimpleName): Removed, use Resolve() with
17362 ResolveFlags.SimpleName.
17363 (Expression.Error118): Added overloaded version of this method which
17364 takes a `ResolveFlags flags' argument. It uses the flags to determine
17365 which kinds of expressions are allowed.
17367 * expression.cs (Argument.ResolveMethodGroup): New public method.
17368 Resolves an argument, but allows a MethodGroup to be returned.
17369 This is used when invoking a delegate.
17371 * TODO: Updated a bit.
17373 2002-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17375 Fixed compilation with csc.
17377 * ecore.cs: Expression.Error made public. Is this correct? Should
17378 Warning be made public too?
17380 * expression.cs: use ea.Location instead of ea.loc.
17381 [FIXME: Filed as bug #28607: MCS must report these errors.]
17383 2002-08-06 Martin Baulig <martin@gnome.org>
17385 * ecore.cs (Expression.loc): Moved the location here instead of
17386 duplicating it in all derived classes.
17387 (Expression.Location): New public property.
17388 (Expression.Error, Expression.Warning): Made them non-static and
17389 removed the location argument.
17390 (Expression.Warning): Added overloaded version which takes an
17391 `int level' argument.
17392 (Expression.Error118): Make this non-static and removed the
17393 expression and location arguments.
17394 (TypeExpr): Added location argument to the constructor.
17396 * expression.cs (StaticCallExpr): Added location argument to
17398 (Indirection, PointerArithmetic): Likewise.
17399 (CheckedExpr, UnCheckedExpr): Likewise.
17400 (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
17401 (StringPtr): Likewise.
17404 2002-08-05 Martin Baulig <martin@gnome.org>
17406 * expression.cs (BaseAccess.DoResolve): Actually report errors.
17408 * assign.cs (Assign.DoResolve): Check whether the source
17409 expression is a value or variable.
17411 * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
17412 while resolving the corresponding blocks.
17414 * interface.cs (Interface.GetInterfaceTypeByName): Actually report
17415 an error, don't silently return null.
17417 * statement.cs (Block.AddVariable): Do the error reporting here
17418 and distinguish between CS0128 and CS0136.
17419 (Block.DoResolve): Report all unused labels (warning CS0164).
17420 (LabeledStatement): Pass the location to the constructor.
17421 (LabeledStatement.HasBeenReferenced): New property.
17422 (LabeledStatement.Resolve): Set it to true here.
17424 * statement.cs (Return.Emit): Return success even after reporting
17425 a type mismatch error (CS0126 or CS0127), this is what csc does and
17426 it avoids confusing the users with any consecutive errors.
17428 2002-08-05 Martin Baulig <martin@gnome.org>
17430 * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
17432 * const.cs (Const.LookupConstantValue): Catch circular definitions.
17434 * expression.cs (MemberAccess.DoResolve): Silently return if an
17435 error has already been reported.
17437 * ecore.cs (Expression.MemberLookupFinal): Silently return if an
17438 error has already been reported.
17440 2002-08-05 Martin Baulig <martin@gnome.org>
17442 * statement.cs (UsageVector): Only initialize the `parameters'
17443 vector if we actually have any "out" parameters.
17445 2002-08-05 Martin Baulig <martin@gnome.org>
17447 * expression.cs (Binary.ResolveOperator): When combining delegates,
17448 they must have the same type.
17450 2002-08-05 Martin Baulig <martin@gnome.org>
17452 * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
17453 PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
17454 work with the ms runtime and we also don't need it: if we're a
17455 PropertyBuilder and not in the `indexer_arguments' hash, then we
17456 are a property and not an indexer.
17458 * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
17459 Type.IsPointer and Type.IsByRef instead of Type.HasElementType
17460 since the latter one doesn't work with the ms runtime.
17462 2002-08-03 Martin Baulig <martin@gnome.org>
17464 Fixed bugs #27998 and #22735.
17466 * class.cs (Method.IsOperator): New public field.
17467 (Method.CheckBase): Report CS0111 if there's already a method
17468 with the same parameters in the current class. Report CS0508 when
17469 attempting to change the return type of an inherited method.
17470 (MethodData.Emit): Report CS0179 if a method doesn't have a body
17471 and it's not marked abstract or extern.
17472 (PropertyBase): New abstract base class for Property and Indexer.
17473 (PropertyBase.CheckBase): Moved here from Property and made it work
17475 (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
17476 the same so we can reuse it there.
17477 (Property, Indexer): Derive from PropertyBase.
17478 (MethodSignature.inheritable_property_signature_filter): New delegate
17479 to find properties and indexers.
17481 * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
17482 argument and improved error reporting.
17484 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
17485 EmptyReadOnlyParameters and made it a property.
17487 * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
17488 version of this method which takes a `PropertyInfo indexer'.
17489 (TypeManager.RegisterIndexer): New method.
17491 * class.cs: Added myself as author of this file :-)
17493 2002-08-03 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17495 * class.cs: fixed compilation on windoze.
17497 2002-08-03 Martin Baulig <martin@gnome.org>
17499 * interface.cs (Interface.GetInterfaceBases): Check whether all
17500 base interfaces are at least as accessible than the current one.
17502 * class.cs (TypeContainer.GetClassBases): Check whether base types
17503 are at least as accessible than the current type.
17504 (TypeContainer.AsAccessible): Implemented and made non-static.
17505 (MemberBase.CheckParameters): Report errors if the accessibility
17508 * delegate.cs (Delegate.Delegate): The default visibility is
17509 internal for top-level types and private for nested types.
17510 (Delegate.Define): Report errors if the accessibility checks fail.
17512 * enum.cs (Enum.Enum): The default visibility is internal for
17513 top-level types and private for nested types.
17514 (Enum.DefineType): Compute the correct visibility.
17516 * modifiers.cs (Modifiers.TypeAttr): Added a version of this
17517 function which takes a `bool is_toplevel' instead of a TypeContainer.
17519 * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
17522 2002-08-02 Martin Baulig <martin@gnome.org>
17524 * expression.cs (LocalVariableReferenc): Added constructor which
17525 takes additional `VariableInfo vi' and `bool is_readonly' arguments.
17526 (LocalVariableReference.IsReadOnly): New property.
17527 (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
17528 variable is readonly, use our own readonly flag to do this; you can
17529 use the new constructor to get a writable reference to a read-only
17532 * cs-parser.jay (foreach_statement, using_statement): Get a writable
17533 reference to the local variable.
17535 2002-08-01 Miguel de Icaza <miguel@ximian.com>
17537 * rootcontext.cs (ResolveCore): Also include System.Exception
17539 * statement.cs (Block.Emit): Do not emit the dead-code warnings if
17540 we reach an EmptyStatement.
17542 (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
17545 * expression.cs (Binary.ResolveOperator): Check error result in
17548 use brtrue/brfalse directly and avoid compares to null.
17550 2002-08-02 Martin Baulig <martin@gnome.org>
17552 * class.cs (TypeContainer.Define): Define all nested interfaces here.
17553 Fixes bug #28407, added test-155.cs.
17555 2002-08-01 Martin Baulig <martin@gnome.org>
17557 * class.cs (Event.EmitDefaultMethod): Make this work with static
17558 events. Fixes #28311, added verify-3.cs.
17560 2002-08-01 Martin Baulig <martin@gnome.org>
17562 * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
17563 `is_disposable' fields.
17564 (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
17565 `hm.is_disposable' if we're using the collection pattern.
17566 (Foreach.EmitCollectionForeach): Use the correct type for the
17567 enumerator's local variable, only emit the try/finally block if
17568 necessary (fixes #27713).
17570 2002-08-01 Martin Baulig <martin@gnome.org>
17572 * ecore.cs (Expression.report118): Renamed to Error118 and made
17575 * statement.cs (Throw.Resolve): Check whether the expression is of
17576 the correct type (CS0118) and whether the type derives from
17577 System.Exception (CS0155).
17578 (Catch.Resolve): New method. Do the type lookup here and check
17579 whether it derives from System.Exception (CS0155).
17580 (Catch.CatchType, Catch.IsGeneral): New public properties.
17582 * typemanager.cs (TypeManager.exception_type): Added.
17584 2002-07-31 Miguel de Icaza <miguel@ximian.com>
17586 * driver.cs: Updated About function.
17588 2002-07-31 Martin Baulig <martin@gnome.org>
17590 Implemented Control Flow Analysis.
17592 * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17593 (EmitContext.CurrentBranching): Added.
17594 (EmitContext.StartFlowBranching): Added.
17595 (EmitContext.EndFlowBranching): Added.
17596 (EmitContext.KillFlowBranching): Added.
17597 (EmitContext.IsVariableAssigned): Added.
17598 (EmitContext.SetVariableAssigned): Added.
17599 (EmitContext.IsParameterAssigned): Added.
17600 (EmitContext.SetParameterAssigned): Added.
17601 (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17602 Added control flow analysis stuff here.
17604 * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17605 resolve the expression as lvalue.
17606 (LocalVariableReference.DoResolve): Check whether the variable has
17607 already been assigned.
17608 (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17609 the parameter as assigned here.
17610 (ParameterReference.DoResolve): Check whether the parameter has already
17612 (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17613 expression as lvalue.
17615 * statement.cs (FlowBranching): New class for the flow analysis code.
17616 (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17617 (LabeledStatement.IsDefined): New public property.
17618 (LabeledStatement.AddUsageVector): New public method to tell flow
17619 analyis that the label may be reached via a forward jump.
17620 (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17622 (VariableInfo.Number): New public field. This is used by flow analysis
17623 to number all locals of a block.
17624 (Block.CountVariables): New public property. This is the number of
17625 local variables in this block (including the locals from all parent
17627 (Block.EmitMeta): Number all the variables.
17629 * statement.cs: Added flow analysis support to all classes.
17631 2002-07-31 Martin Baulig <martin@gnome.org>
17633 * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
17634 To get debugging messages, compile mcs with /define:MCS_DEBUG and
17635 then use this argument.
17637 * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17639 * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17640 use this to specify /define options.
17642 2002-07-29 Martin Baulig <martin@gnome.org>
17644 * statement.cs (Fixed): Moved all code that does variable lookups
17645 and resolvings from Emit to Resolve.
17647 * statement.cs (For): Moved all code that does variable lookups
17648 and resolvings from Emit to Resolve.
17650 * statement.cs (Using): Moved all code that does variable lookups
17651 and resolvings from Emit to Resolve.
17653 2002-07-29 Martin Baulig <martin@gnome.org>
17655 * attribute.cs (Attribute.Resolve): Explicitly catch a
17656 System.NullReferenceException when creating the
17657 CustromAttributeBuilder and report a different warning message.
17659 2002-07-29 Martin Baulig <martin@gnome.org>
17661 * support.cs (ParameterData.ParameterName): Added method to
17662 get the name of a parameter.
17664 * typemanager.cs (TypeManager.IsValueType): New public method.
17666 2002-07-29 Martin Baulig <martin@gnome.org>
17668 * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'. This
17669 is a flag which specifies that it's either ref or out.
17670 (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
17671 the out parameter to `out Parameter.Modifier mod', also set the
17672 Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17674 * support.cs (InternalParameters.ParameterModifier): Distinguish
17675 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17676 Parameter.Modifier.ISBYREF flag if it's either ref or out.
17678 * expression.cs (Argument.GetParameterModifier): Distinguish
17679 between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17680 Parameter.Modifier.ISBYREF flag if it's either ref or out.
17682 2002-07-29 Martin Baulig <martin@gnome.org>
17684 * expression.cs (ParameterReference.ParameterReference): Added
17685 `Location loc' argument to the constructor.
17687 * cs-parser.jay: Pass location to ParameterReference.
17689 2002-07-28 Miguel de Icaza <miguel@ximian.com>
17691 * statement.cs (Try): Initialize the location.
17693 * cs-parser.jay: pass location to Try.
17695 * expression.cs (Unary.Reduce): Change the prototype to return
17696 whether a constant fold could be performed or not. The result is
17697 returned in an out parameters. In the case of Indirection and
17698 AddressOf, we want to perform the full tests.
17700 2002-07-26 Miguel de Icaza <miguel@ximian.com>
17702 * statement.cs (Statement.Emit): Flag dead code.
17704 2002-07-27 Andrew Birkett <andy@nobugs.org>
17706 * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17708 2002-07-27 Martin Baulig <martin@gnome.org>
17710 * class.cs (MethodData.Define): Put back call to
17711 TypeManager.AddMethod(), accidentally commented this out.
17713 * report.cs (Debug): New public method to print debugging information,
17714 this is `[Conditional ("DEBUG")]'.
17716 2002-07-26 Martin Baulig <martin@gnome.org>
17718 * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17719 (switch_statement): Push the current_block to the switch_stack and
17720 pop it again when we're done with the switch.
17721 (switch_section): The new block is a child of the current_block.
17722 Fixes bug #24007, added test-152.cs.
17724 2002-07-27 Martin Baulig <martin@gnome.org>
17726 * expression.cs (Invocation.EmitArguments): When calling a varargs
17727 function with only its fixed arguments, we need to pass an empty
17730 2002-07-27 Martin Baulig <martin@gnome.org>
17732 Mono 0.13 has been released.
17734 2002-07-25 Miguel de Icaza <miguel@ximian.com>
17736 * driver.cs: Rename --resource to --linkres, because that is what
17737 we do currently, we dont support --resource yet.
17739 * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17741 2002-07-25 Martin Baulig <martin@gnome.org>
17743 * class.cs (MethodData): New public class. This is a `method builder'
17744 class for a method or one accessor of a Property/Indexer/Event.
17745 (MethodData.GetMethodFlags): Moved here from MemberBase.
17746 (MethodData.ApplyAttributes): Likewise.
17747 (MethodData.ApplyObsoleteAttribute): Likewise.
17748 (MethodData.ApplyConditionalAttribute): Likewise.
17749 (MethodData.ApplyDllImportAttribute): Likewise.
17750 (MethodData.CheckAbstractAndExternal): Likewise.
17751 (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17752 (MethodData.Emit): Formerly known as Method.Emit().
17753 (MemberBase): Moved everything which was specific to a single
17754 accessor/method to MethodData.
17755 (Method): Create a new MethodData and call Define() and Emit() on it.
17756 (Property, Indexer, Event): Create a new MethodData objects for each
17757 accessor and call Define() and Emit() on them.
17759 2002-07-25 Martin Baulig <martin@gnome.org>
17761 Made MethodCore derive from MemberBase to reuse the code from there.
17762 MemberBase now also checks for attributes.
17764 * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17765 (MemberBase.GetMethodFlags): Moved here from class Method and marked
17767 (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17768 `CallingConventions cc' and `Attributes opt_attrs' arguments.
17769 (MemberBase.ApplyAttributes): New virtual method; applies the
17770 attributes to a method or accessor.
17771 (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17772 (MemberBase.ApplyConditionalAttribute): Likewise.
17773 (MemberBase.ApplyDllImportAttribute): Likewise.
17774 (MemberBase.CheckAbstractAndExternal): Likewise.
17775 (MethodCore.ParameterTypes): This is now a property instead of a
17776 method, it's initialized from DoDefineParameters().
17777 (MethodCore.ParameterInfo): Removed the set accessor.
17778 (MethodCore.DoDefineParameters): New protected virtual method to
17779 initialize ParameterTypes and ParameterInfo.
17780 (Method.GetReturnType): We can now simply return the MemberType.
17781 (Method.GetMethodFlags): Override the MemberBase version and add
17782 the conditional flags.
17783 (Method.CheckBase): Moved some code from Define() here, call
17784 DoDefineParameters() here.
17785 (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17786 here to avoid some larger code duplication.
17787 (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17788 ensure that abstract and external accessors don't declare a body.
17790 * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17791 `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17792 lookup in the attribute's parent classes, so we need to abort as soon
17793 as we found the first match.
17794 (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17795 the attribute has no arguments.
17797 * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17800 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17802 * cs-parser.jay: reverted previous patch.
17804 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17806 * cs-parser.jay: fixed bug #22119.
17808 2002-07-24 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17810 * attribute.cs: fixed compilation. The error was:
17811 "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must
17812 be assigned to before control leaves the current method."
17813 [FIXME: Filed as bug #28186: MCS must report this error.]
17815 2002-07-25 Martin Baulig <martin@gnome.org>
17817 * attribute.cs (Attribute.Conditional_GetConditionName): New static
17818 method to pull the condition name ouf of a Conditional attribute.
17819 (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17820 the obsolete message and error flag out of an Obsolete attribute.
17822 * class.cs (Method.GetMethodFlags): New public method to get the
17823 TypeManager.MethodFlags for this method.
17824 (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17826 (Method.Define): Get and apply the Obsolete and Conditional attributes;
17827 if we're overriding a virtual function, set the new private variable
17828 `parent_method'; call the new TypeManager.AddMethod().
17830 * typemanager.cs (TypeManager.AddMethod): New static method. Stores
17831 the MethodBuilder and the Method in a PtrHashtable.
17832 (TypeManager.builder_to_method): Added for this purpose.
17833 (TypeManager.MethodFlags): Added IsObsoleteError.
17834 (TypeManager.GetMethodFlags): Added `Location loc' argument. Lookup
17835 Obsolete and Conditional arguments in MethodBuilders. If we discover
17836 an Obsolete attribute, emit an appropriate warning 618 / error 619 with
17837 the message from the attribute.
17839 2002-07-24 Martin Baulig <martin@gnome.org>
17841 * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
17842 preprocessor directives, ensure that the argument to #define/#undef is
17843 exactly one identifier and that it's actually an identifier.
17845 Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
17848 2002-07-24 Martin Baulig <martin@gnome.org>
17850 * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
17851 initialize it to TypeManager.object_type in the constructor.
17852 (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
17853 of the `hm.get_current' method if we're using the collection pattern.
17854 (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
17855 for the explicit conversion to make it work when we're using the collection
17856 pattern and the `Current' property has a different return type than `object'.
17859 2002-07-24 Martin Baulig <martin@gnome.org>
17861 * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17862 does not match, but don't report any errors. This method is called in
17863 order for all methods in a MethodGroupExpr until a matching method is
17864 found, so we don't want to bail out if the first method doesn't match.
17865 (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17866 matches, report the 123. Fixes #28070.
17868 2002-07-24 Martin Baulig <martin@gnome.org>
17870 * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17871 TypeManager.TypeToCoreType() to the top of the method so the
17872 following equality checks will work. Fixes #28107.
17874 2002-07-24 Martin Baulig <martin@gnome.org>
17876 * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17877 operand is of type uint, and the other operand is of type sbyte,
17878 short or int, the operands are converted to type long." -
17879 Actually do what this comment already told us. Fixes bug #28106,
17882 2002-07-24 Martin Baulig <martin@gnome.org>
17884 * class.cs (MethodBase): New abstract class. This is now a base
17885 class for Property, Indexer and Event to avoid some code duplication
17886 in their Define() and DefineMethods() methods.
17887 (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17888 generic methods for Define() and DefineMethods().
17889 (FieldBase): Derive from MemberBase, not MemberCore.
17890 (Property): Derive from MemberBase, not MemberCore.
17891 (Property.DefineMethod): Moved all the code from this method to the
17892 new MethodBase.DefineAccessor(), just call it with appropriate
17894 (Property.Define): Call the new Property.DoDefine(), this does some
17895 sanity checks and we don't need to duplicate the code everywhere.
17896 (Event): Derive from MemberBase, not MemberCore.
17897 (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17898 accessors, this will also make them work with interface events.
17899 (Indexer): Derive from MemberBase, not MemberCore.
17900 (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17901 (Indexer.Define): Use the new MethodBase functions.
17903 * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17904 argument to the constructor.
17905 (Interface.FindMembers): Added support for interface events.
17906 (Interface.PopluateEvent): Implemented.
17908 Added test-149.cs for this. This also fixes bugs #26067 and #24256.
17910 2002-07-22 Miguel de Icaza <miguel@ximian.com>
17912 * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17913 but this is required to check for a method name being the same as
17914 the containing class.
17918 2002-07-22 Gonzalo Paniagua Javier <gonzalo@ximian.com>
17920 * interface.cs: initialize variable.
17922 2002-07-23 Martin Baulig <martin@gnome.org>
17924 Implemented the IndexerName attribute in interfaces.
17926 * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17927 name if this is an explicit interface implementation.
17928 (Indexer.InterfaceIndexerName): New public variable. If we're
17929 implementing an interface indexer, this is the IndexerName in that
17930 interface. Otherwise, it's the IndexerName.
17931 (Indexer.DefineMethod): If we're implementing interface indexer,
17932 set InterfaceIndexerName. Use the new Pending.IsInterfaceIndexer
17933 and Pending.ImplementIndexer methods.
17934 (Indexer.Define): Also define the PropertyBuilder if we're
17935 implementing an interface indexer and this is neither an explicit
17936 interface implementation nor do the IndexerName match the one in
17939 * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17940 If a method is defined here, then we always need to create a proxy
17941 for it. This is used when implementing interface indexers.
17942 (Pending.IsInterfaceIndexer): New public method.
17943 (Pending.ImplementIndexer): New public method.
17944 (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17945 This is used when implementing interface indexers to define a proxy
17947 (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17948 define a proxy if necessary.
17950 * interface.cs (Interface.IndexerName): New public variable.
17951 (Interface.PopulateIndexer): Set the IndexerName.
17952 (Interface.DefineIndexers): New private method. Populate all the
17953 indexers and make sure their IndexerNames match.
17955 * typemanager.cs (IndexerPropertyName): Added support for interface
17958 2002-07-22 Martin Baulig <martin@gnome.org>
17960 * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17961 (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17962 ret if HasReturnLabel.
17963 (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17966 * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17967 and set the ec.LoopBeginTryCatchLevel.
17968 (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17969 (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17970 the current ec.TryCatchLevel, the branch goes out of an exception
17971 block. In this case, we need to use Leave and not Br.
17973 2002-07-22 Martin Baulig <martin@gnome.org>
17975 * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17976 block unless the block does not always return or it is contained in
17977 another try { ... } catch { ... } block. Fixes bug #26506.
17978 Added verify-1.cs to the test suite.
17980 2002-07-22 Martin Baulig <martin@gnome.org>
17982 * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17983 then we do not always return. Fixes bug #24985.
17985 2002-07-22 Martin Baulig <martin@gnome.org>
17987 * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17988 lookup on a per-class level; ie. walk up the class hierarchy until we
17989 found at least one applicable method, then choose the best among them.
17990 Fixes bug #24463 and test-29.cs.
17992 2002-07-22 Martin Baulig <martin@gnome.org>
17994 * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17995 return types of the methods. The return type is not part of the
17996 signature and we must not check it to make the `new' modifier work.
17997 Fixes bug #27999, also added test-147.cs.
17998 (TypeManager.TypeToCoreType): Added TypeManager.type_type.
18000 * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
18001 on the method's return type.
18003 2002-07-21 Martin Baulig <martin@gnome.org>
18005 * assign.cs: Make this work if the rightmost source is a constant and
18006 we need to do an implicit type conversion. Also adding a few more tests
18007 to test-38.cs which should have caught this.
18009 * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
18010 target in the makefile for this. The makefile.gnu is primarily intended
18011 for end-users who don't want to debug the compiler.
18013 2002-07-21 Martin Baulig <martin@gnome.org>
18015 * assign.cs: Improved the Assign class so it can now handle embedded
18016 assignments (X = Y = Z = something). As a side-effect this'll now also
18017 consume less local variables. test-38.cs now passes with MCS, added
18018 a few new test cases to that test.
18020 2002-07-20 Martin Baulig <martin@gnome.org>
18022 * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
18023 instructions. Fixes bug #27977, also added test-146.cs.
18025 2002-07-19 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18027 * cs-tokenizer.cs: fixed getHex ().
18029 2002-07-19 Martin Baulig <martin@gnome.org>
18031 * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
18032 not Type.GetType() to lookup the array type. This is needed when
18033 we're constructing an array of a user-defined type.
18034 (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
18035 single-dimensional arrays, but also for single-dimensial arrays of
18038 2002-07-19 Martin Baulig <martin@gnome.org>
18040 * expression.cs (New.DoEmit): Create a new LocalTemporary each time
18041 this function is called, it's not allowed to share LocalBuilders
18042 among ILGenerators.
18044 2002-07-19 Martin Baulig <martin@gnome.org>
18046 * expression.cs (Argument.Resolve): Report an error 118 when trying
18047 to pass a type as argument.
18049 2002-07-18 Martin Baulig <martin@gnome.org>
18051 * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
18052 Conv_R_Un for the signed `long' type.
18054 2002-07-15 Miguel de Icaza <miguel@ximian.com>
18056 * expression.cs (MemberAccess.DoResolve): Do not reuse the field
18057 `expr' for the temporary result, as that will fail if we do
18058 multiple resolves on the same expression.
18060 2002-07-05 Miguel de Icaza <miguel@ximian.com>
18062 * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
18063 ec.TypeContainer for looking up aliases.
18065 * class.cs (TypeContainer): Remove LookupAlias from here.
18067 * decl.cs (DeclSpace); Move here.
18069 2002-07-01 Miguel de Icaza <miguel@ximian.com>
18071 * class.cs (FindMembers): Only call filter if the constructor
18072 bulider is not null.
18074 Also handle delegates in `NestedTypes' now. Now we will perform
18075 type lookups using the standard resolution process. This also
18078 * decl.cs (DeclSpace.ResolveType): New type resolution routine.
18079 This uses Expressions (the limited kind that can be parsed by the
18080 tree) instead of strings.
18082 * expression.cs (ComposedCast.ToString): Implement, used to flag
18083 errors since now we have to render expressions.
18085 (ArrayCreation): Kill FormElementType. Use ComposedCasts in
18088 * ecore.cs (SimpleName.ToString): ditto.
18090 * cs-parser.jay: Instead of using strings to assemble types, use
18091 Expressions to assemble the type (using SimpleName, ComposedCast,
18092 MemberAccess). This should fix the type lookups in declarations,
18093 because we were using a different code path for this.
18095 * statement.cs (Block.Resolve): Continue processing statements
18096 even when there is an error.
18098 2002-07-17 Miguel de Icaza <miguel@ximian.com>
18100 * class.cs (Event.Define): Also remove the `remove' method from
18101 the list of pending items.
18103 * expression.cs (ParameterReference): Use ldarg.N (0..3) to
18104 generate more compact code.
18106 2002-07-17 Martin Baulig <martin@gnome.org>
18108 * const.cs (Const.LookupConstantValue): Add support for constant
18109 `unchecked' and `checked' expressions.
18110 Also adding test case test-140.cs for this.
18112 2002-07-17 Martin Baulig <martin@gnome.org>
18114 * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
18115 check whether mi.ReturnType implements the IEnumerator interface; the
18116 `==' and the IsAssignableFrom() will fail in this situation.
18118 2002-07-16 Ravi Pratap <ravi@ximian.com>
18120 * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix
18123 2002-07-16 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18125 * expression.cs: fixed bug #27811.
18127 2002-07-14 Miguel de Icaza <miguel@ximian.com>
18129 * expression.cs (ParameterReference.AddressOf): Patch from Paolo
18130 Molaro: when we are a ref, the value already contains a pointer
18131 value, do not take the address of it.
18133 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18134 * removed mb-parser.jay and mb-tokenizer.cs
18136 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18138 * expression.cs: check against the building corlib void type.
18140 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
18142 * ecore.cs: fix for valuetype static readonly fields: when
18143 initializing them, we need their address, not the address of a copy.
18145 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
18147 * typemanager.cs: register also enum_type in corlib.
18149 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18151 * class.cs: allow calling this (but not base) initializers in structs.
18153 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
18155 * ecore.cs: make sure we compare against the building base types
18158 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
18160 * typemanager.cs: fix TypeToCoreType() to handle void and object
18161 (corlib gets no more typerefs after this change).
18163 2002-07-12 Miguel de Icaza <miguel@ximian.com>
18165 * expression.cs (ArrayCreation.EmitArrayArguments): use
18166 Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
18168 (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
18169 Conv_Ovf_I_Un for the array arguments. Even if C# allows longs as
18170 array indexes, the runtime actually forbids them.
18172 * ecore.cs (ExpressionToArrayArgument): Move the conversion code
18173 for array arguments here.
18175 * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
18176 instead of the default for ValueTypes.
18178 (New.DoEmit): Use IsValueType instead of
18179 IsSubclassOf (value_type)
18180 (New.DoResolve): ditto.
18181 (Invocation.EmitCall): ditto.
18183 * assign.cs (Assign): ditto.
18185 * statement.cs (Unsafe): Ok, so I got the semantics wrong.
18186 Statements *are* currently doing part of their resolution during
18189 Expressions do always resolve during resolve, but statements are
18190 only required to propagate resolution to their children.
18192 2002-07-11 Miguel de Icaza <miguel@ximian.com>
18194 * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
18196 (LoadAssembly): Do not add the dll if it is already specified
18198 (MainDriver): Add the System directory to the link path at the end,
18199 after all the other -L arguments.
18201 * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
18202 wrong opcode for loading bytes and bools (ldelem.i1 instead of
18203 ldelem.u1) and using the opposite for sbytes.
18205 This fixes Digger, and we can finally run it.
18207 * driver.cs (UnixParseOption): Move the option parsing here.
18208 (CSCParseOption): Implement CSC-like parsing of options.
18210 We now support both modes of operation, the old Unix way, and the
18211 new CSC-like way. This should help those who wanted to make cross
18212 platform makefiles.
18214 The only thing broken is that /r:, /reference: and /lib: are not
18215 implemented, because I want to make those have the same semantics
18216 as the CSC compiler has, and kill once and for all the confussion
18217 around this. Will be doing this tomorrow.
18219 * statement.cs (Unsafe.Resolve): The state is checked during
18220 resolve, not emit, so we have to set the flags for IsUnsfe here.
18222 2002-07-10 Miguel de Icaza <miguel@ximian.com>
18224 * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
18225 not catch the Error_ObjectRefRequired in SimpleName (as it is
18226 possible to have a class/instance variable name that later gets
18227 deambiguated), we have to check this here.
18229 2002-07-10 Ravi Pratap <ravi@ximian.com>
18231 * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
18232 make static and put into Expression.
18234 (Event.Define): Register the private field of the event with the
18235 TypeManager so that GetFieldFromEvent can get at it.
18237 (TypeManager.RegisterPrivateFieldOfEvent): Implement to
18238 keep track of the private field associated with an event which
18241 (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
18244 * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
18246 2002-07-10 Miguel de Icaza <miguel@ximian.com>
18248 * expression.cs (Binary.EmitBranchable): this routine emits the
18249 Binary expression in a branchable context. This basically means:
18250 we need to branch somewhere, not just get the value on the stack.
18252 This works together with Statement.EmitBoolExpression.
18254 * statement.cs (Statement.EmitBoolExpression): Use
18257 2002-07-09 Miguel de Icaza <miguel@ximian.com>
18259 * statement.cs (For): Reduce the number of jumps in loops.
18261 (For): Implement loop inversion for the For statement.
18263 (Break): We can be breaking out of a Try/Catch controlled section
18264 (foreach might have an implicit try/catch clause), so we need to
18265 use Leave instead of Br.
18267 * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
18268 now). If the instace expression supports IMemoryLocation, we use
18269 the AddressOf method from the IMemoryLocation to extract the
18270 address instead of emitting the instance.
18272 This showed up with `This', as we were emitting the instance
18273 always (Emit) instead of the Address of This. Particularly
18274 interesting when This is a value type, as we dont want the Emit
18275 effect (which was to load the object).
18277 2002-07-08 Miguel de Icaza <miguel@ximian.com>
18279 * attribute.cs: Pass the entry point to the DefinePInvokeMethod
18281 * statement.cs (Checked): Set the CheckedState during the resolve
18282 process too, as the ConvCast operations track the checked state on
18283 the resolve process, and not emit.
18285 * cs-parser.jay (namespace_member_declaration): Flag that we have
18286 found a declaration when we do. This is used to flag error 1529
18288 * driver.cs: Report ok when we display the help only.
18290 2002-07-06 Andrew Birkett <adb@tardis.ed.ac.uk>
18292 * cs-tokenizer.cs (xtoken): Improve handling of string literals.
18294 2002-07-04 Miguel de Icaza <miguel@ximian.com>
18296 * cs-tokenizer.cs (define): We also have to track locally the
18297 defines. AllDefines is just used for the Conditional Attribute,
18298 but we also need the local defines for the current source code.
18300 2002-07-03 Miguel de Icaza <miguel@ximian.com>
18302 * statement.cs (While, For, Do): These loops can exit through a
18303 Break statement, use this information to tell whether the
18304 statement is the last piece of code.
18306 (Break): Flag that we break.
18308 * codegen.cs (EmitContexts): New `Breaks' state variable.
18310 2002-07-03 Martin Baulig <martin@gnome.org>
18312 * class.cs (TypeContainer.MethodModifiersValid): Allow override
18313 modifiers in method declarations in structs. Otherwise, you won't
18314 be able to override things like Object.Equals().
18316 2002-07-02 Miguel de Icaza <miguel@ximian.com>
18318 * class.cs (Method, Property, Indexer): Do not allow the public
18319 modifier to be used in explicit interface implementations.
18321 (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
18322 override modifiers in method declarations in structs
18324 2002-07-02 Andrew Birkett <adb@tardis.ed.ac.uk>
18326 * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
18327 integer or real overflow, report an error
18329 2002-07-02 Martin Baulig <martin@gnome.org>
18331 * typemanager.cs (TypeManager.InitCoreTypes): When compiling
18332 corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
18333 to tell the runtime about our newly created System.Object and
18334 System.ValueType types.
18336 2002-07-02 Miguel de Icaza <miguel@ximian.com>
18338 * expression.cs (This): Use Stobj/Ldobj when we are a member of a
18339 struct instead of Ldarg/Starg.
18341 2002-07-02 Martin Baulig <martin@gnome.org>
18343 * expression.cs (Indirection.Indirection): Call
18344 TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
18346 2002-07-02 Martin Baulig <martin@gnome.org>
18348 * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
18349 ValueType, call TypeManager.TypeToCoreType() on it.
18350 (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
18351 the OpCodes.Newarr argument.
18353 2002-07-02 Martin Baulig <martin@gnome.org>
18355 * expression.cs (Invocation.EmitCall): When compiling corlib,
18356 replace all calls to the system's System.Array type to calls to
18357 the newly created one.
18359 * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
18360 System.Array methods.
18361 (TypeManager.InitCoreTypes): When compiling corlib, get the methods
18362 from the system's System.Array type which must be replaced.
18364 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
18366 * typemanager.cs: load unverifiable_code_ctor so we can build
18367 corlib using the correct type. Avoid using GetTypeCode() with
18369 * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
18370 TypeManager.object_type to allow building corlib.
18372 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
18374 * ecore.cs: handle System.Enum separately in LoadFromPtr().
18376 2002-07-01 Martin Baulig <martin@gnome.org>
18378 * class.cs: Make the last change actually work, we need to check
18379 whether `ifaces != null' to avoid a crash.
18381 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18383 * class.cs: when we build structs without fields that implement
18384 interfaces, we need to add the interfaces separately, since there is
18385 no API to both set the size and add the interfaces at type creation
18388 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18390 * expression.cs: the dimension arguments to the array constructors
18391 need to be converted if they are a long.
18393 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
18395 * class.cs: don't emit ldarg.0 if there is no parent constructor
18396 (fixes showstopper for corlib).
18398 2002-06-29 Martin Baulig <martin@gnome.org>
18400 MCS now compiles corlib on GNU/Linux :-)
18402 * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
18403 ie. check for MethodImplOptions.InternalCall.
18405 * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
18406 and TypeManager.attribute_type are null, so we must explicitly check
18407 whether parent is not null to find out whether it's an attribute type.
18408 (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
18409 and SetBuilder, not only if the property is neither abstract nor external.
18410 This is necessary to set the MethodImplOptions on the accessor methods.
18411 (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
18412 SetBuilder, see Property.Emit().
18414 * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
18415 populate "System.Object", "System.ValueType" and "System.Attribute" since
18416 they've already been populated from BootCorlib_PopulateCoreTypes().
18418 2002-06-29 Martin Baulig <martin@gnome.org>
18420 * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
18421 is the NullLiteral, we also need to make sure that target_type is not
18424 2002-06-29 Martin Baulig <martin@gnome.org>
18426 * rootcontext.cs (RootContext.ResolveCore): We must initialize
18427 `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
18428 before calling BootstrapCorlib_ResolveDelegate ().
18430 2002-06-27 Gonzalo Paniagua Javier <gonzalo@ximian.com>
18432 * statement.cs: fixed build-breaker. All tests passed ok.
18434 2002-06-27 Martin Baulig <martin@gnome.org>
18436 * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
18437 for System.Decimal when compiling corlib.
18439 2002-06-27 Martin Baulig <martin@gnome.org>
18441 * statement.cs (Switch.TableSwitchEmit): Make this work with empty
18442 switch blocks which contain nothing but a default clause.
18444 2002-06-26 Andrew <adb@tardis.ed.ac.uk>
18446 * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
18448 2002-06-27 Martin Baulig <martin@gnome.org>
18450 * ecore.cs (PropertyExpr.PropertyExpr): Call
18451 TypeManager.TypeToCoreType() on the `pi.PropertyType'.
18453 * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
18454 is already a TypeBuilder.
18456 2002-06-27 Martin Baulig <martin@gnome.org>
18458 * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
18459 `target_type == TypeManager.array_type', not IsAssignableFrom() in
18460 the "from an array-type to System.Array" case. This makes it work
18461 when compiling corlib.
18463 2002-06-27 Martin Baulig <martin@gnome.org>
18465 * ecore.cs (Expression.SimpleNameResolve): If the expression is a
18466 non-static PropertyExpr, set its InstanceExpression. This makes
18467 the `ICollection.Count' property work in System/Array.cs.
18469 2002-06-25 Andrew Birkett <adb@tardis.ed.ac.uk>
18471 * driver.cs: Made error handling more consistent. Errors now
18472 tracked by Report class, so many methods which used to return int
18473 now return void. Main() now prints success/failure and
18474 errors/warnings message.
18476 Renamed '--probe' compiler argument to '--expect-error'. Removed
18477 the magic number return values (123 and 124). Now, if the
18478 expected error occurs, the compiler exits with success (exit value
18479 0). If the compilation completes without seeing that particular
18480 error, the compiler exits with failure (exit value 1). The
18481 makefile in mcs/errors has been changed to handle the new behaviour.
18483 * report.cs: Made 'expected error' number a property and renamed
18484 it from 'Probe' to 'ExpectedError'.
18486 * genericparser.cs: Removed error handling support, since it is
18487 now all done by Report class.
18489 * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
18490 class, so parse() no longer returns an int.
18492 * namespace.cs: Use Report.Error instead of GenericParser.error
18494 2002-06-22 Miguel de Icaza <miguel@ximian.com>
18496 * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
18497 TypeContainer.AddOperator): At the front of the list put the
18498 explicit implementations, so they get resolved/defined first.
18500 2002-06-21 Miguel de Icaza <miguel@ximian.com>
18502 * class.cs (TypeContainer.VerifyImplements): Verifies that a given
18503 interface type is implemented by this TypeContainer. Used during
18504 explicit interface implementation.
18506 (Property.Define, Indexer.Define, Method.Define): Validate that
18507 the given interface in the explicit implementation is one of the
18508 base classes for the containing type.
18510 Also if we are explicitly implementing an interface, but there is
18511 no match in the pending implementation table, report an error.
18513 (Property.Define): Only define the property if we are
18514 not explicitly implementing a property from an interface. Use the
18515 correct name also for those properties (the same CSC uses,
18516 although that is really not needed).
18518 (Property.Emit): Do not emit attributes for explicitly implemented
18519 properties, as there is no TypeBuilder.
18521 (Indexer.Emit): ditto.
18523 Hiding then means that we do not really *implement* a pending
18524 implementation, which makes code fail.
18526 2002-06-22 Martin Baulig <martin@gnome.org>
18528 * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
18529 the return value of Object.GetType(). [FIXME: we need to do this whenever
18530 we get a type back from the reflection library].
18532 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
18534 * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
18536 2002-06-20 Miguel de Icaza <miguel@ximian.com>
18538 * attribute.cs: Return null if we can not look up the type.
18540 * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
18541 the interface types found.
18543 * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
18544 interface types found.
18546 * typemanager.cs (GetInterfaces): Make this routine returns alll
18547 the interfaces and work around the lame differences between
18548 System.Type and System.Reflection.Emit.TypeBuilder in the results
18549 result for GetInterfaces.
18551 (ExpandInterfaces): Given an array of interface types, expand and
18552 eliminate repeated ocurrences of an interface. This expands in
18553 context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
18556 2002-06-21 Martin Baulig <martin@gnome.org>
18558 * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
18561 2002-06-21 Martin Baulig <martin@gnome.org>
18563 * typemanager.cs (TypeManager.TypeToCoreType): New function. When compiling corlib
18564 and called with one of the core types, return the corresponding typebuilder for
18567 * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18570 2002-06-21 Martin Baulig <martin@gnome.org>
18572 * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18573 `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18574 (Expression.ConvertReferenceExplicit): Likewise.
18576 * expression.cs (ElementAccess.DoResolve): Likewise.
18577 (ElementAccess.DoResolveLValue): Likewise.
18579 2002-06-10 Martin Baulig <martin@gnome.org>
18581 * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18582 add the "value" parameter to the parameter list.
18584 * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18587 2002-06-19 Miguel de Icaza <miguel@ximian.com>
18589 * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18590 the argument to an int, uint, long or ulong, per the spec. Also
18591 catch negative constants in array creation.
18593 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18595 * class.cs: do not allow the same interface to appear twice in
18596 the definition list.
18598 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18600 * ecore.cs: don't use ldlen with System.Array.
18602 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18604 * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18606 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18608 * modifiers.cs: produce correct field attributes for protected
18609 internal. Easy fix so miguel can work on ther harder stuff:-)
18611 2002-06-18 Miguel de Icaza <miguel@ximian.com>
18613 * pending.cs: New file. Move the code from class.cs here.
18614 Support clearning the pending flag for all methods (when not doing
18615 explicit interface implementation).
18617 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18619 * rootcontext.cs: added a couple more types needed to bootstrap.
18621 2002-06-17 Miguel de Icaza <miguel@ximian.com>
18623 * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18624 constructor in the type, instead of any constructor in the type
18625 hierarchy. Thanks to Paolo for finding this bug (it showed up as
18626 a bug in the Mono runtime when applying the params attribute).
18628 2002-06-16 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18629 * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18631 2002-06-14 Rachel Hestilow <hestilow@ximian.com>
18633 * expression.cs (Unary.ResolveOperator): Use TypeManager
18634 to resolve the type.
18636 2002-06-13 Ravi Pratap <ravi@ximian.com>
18638 * cs-parser.jay (enum_member_declaration): Pass in the attributes
18641 * enum.cs (AddEnumMember): Add support to store the attributes associated
18642 with each member too.
18644 * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18645 field builders too - this takes care of the enum member case.
18647 2002-06-10 Rachel Hestilow <hestilow@ximian.com>
18649 * typemanager.cs (TypeManager.VerifyUnManaged): Allow
18650 address-of operator on both value types and pointers.
18652 2002-06-10 Martin Baulig <martin@gnome.org>
18654 * interface.cs (Interface.PopulateIndexer): Add the indexer's
18655 PropertyBuilder to the `property_builders' list.
18657 * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
18658 (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
18659 `lookup_type' and all its interfaces. Unfortunately, Type.FindMembers() won't
18660 find any indexers which are inherited from an interface.
18662 2002-06-09 Martin Baulig <martin@gnome.org>
18664 * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
18665 the same type as the constant if necessary. There's also a test-130.cs
18668 * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
18670 * typemanager.cs (TypeManager.ChangeType): Previously known as
18671 Enum.ChangeEnumType().
18673 2002-06-09 Martin Baulig <martin@gnome.org>
18675 * expression.cs (Cast.TryReduce): Added support for consts.
18677 2002-06-08 Ravi Pratap <ravi@ximian.com>
18679 * class.cs (Accessor): Hold attributes information so we can pass
18682 * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18683 Modify to pass in attributes attached to the methods.
18685 (add_accessor_declaration, remove_accessor_declaration): Ditto.
18687 * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18688 to handle the Accessor kind :-)
18690 * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18692 2002-06-08 Martin Baulig <martin@gnome.org>
18694 * expression.cs (Unary.TryReduceNegative): Added support for
18697 2002-06-08 Martin Baulig <martin@gnome.org>
18699 * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18700 name can't be found in the `defined_names' - the caller will do a
18701 MemberLookup in this case and thus find methods in System.Enum
18702 such as Enum.IsDefined().
18704 2002-06-08 Martin Baulig <martin@gnome.org>
18706 * enum.cs (Enum.ChangeEnumType): This is a custom version of
18707 Convert.ChangeType() which works with TypeBuilder created types.
18708 (Enum.LookupEnumValue, Enum.Define): Use it here.
18710 * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18711 `TypeBuilder.BaseType != null' check.
18712 (TypeContainer.FindMembers): Only lookup parent members if we
18713 actually have a parent.
18714 (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18715 (ConstructorInitializer.Resolve): Likewise.
18717 * interface.cs (Interface.FindMembers): Added
18718 `TypeBuilder.BaseType != null' check.
18720 * rootcontext.cs (RootContext.ResolveCore): Added
18721 "System.Runtime.CompilerServices.IndexerNameAttribute" to
18722 classes_second_stage.
18724 * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18725 debug_type and trace_type when compiling with --nostdlib.
18727 2002-06-07 Martin Baulig <martin@gnome.org>
18729 * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18730 (AddField): Set it to true when adding a non-static field.
18731 (DefineType): Use `have_nonstatic_fields' to find out whether we
18732 have non-static fields, not `Fields != null'.
18734 2002-06-02 Miguel de Icaza <miguel@ximian.com>
18736 * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18737 dereferencing a null on the static-field code path)
18739 2002-05-30 Martin Baulig <martin@gnome.org>
18741 * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18742 to take command line arguments. Use reflection to call the new
18743 custom `Initialize' function on the symbol writer and pass it the
18744 command line arguments.
18746 * driver.cs (--debug-args): New command line argument to pass command
18747 line arguments to the symbol writer.
18749 2002-05-28 Miguel de Icaza <miguel@ximian.com>
18751 * assign.cs (DoResolve): Forgot to do the implicit conversion to
18752 the target type for indexers and properties. Thanks to Joe for
18755 2002-05-27 Miguel de Icaza <miguel@ximian.com>
18757 * typemanager.cs (MethodFlags): returns the method flags
18758 (Obsolete/ShouldIgnore) that control warning emission and whether
18759 the invocation should be made, or ignored.
18761 * expression.cs (Invocation.Emit): Remove previous hack, we should
18762 not do this on matching a base type, we should do this based on an attribute
18764 Only emit calls to System.Diagnostics.Debug and
18765 System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18766 on the command line.
18768 * rootcontext.cs: Global settings for tracing and debugging.
18770 * cs-tokenizer.cs (define): New utility function to track
18771 defines. Set the global settings for TRACE and DEBUG if found.
18773 2002-05-25 Ravi Pratap <ravi@ximian.com>
18775 * interface.cs (Populate*): Pass in the TypeContainer as well as
18776 the DeclSpace as parameters so that we can create EmitContexts and
18777 then use that to apply attributes etc.
18779 (PopulateMethod, PopulateEvent, PopulateProperty)
18780 (PopulateIndexer): Apply attributes everywhere.
18782 * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18785 (ApplyAttributes): Update accordingly.
18787 We now apply interface attributes for all members too.
18789 2002-05-26 Miguel de Icaza <miguel@ximian.com>
18791 * class.cs (Indexer.Define); Correctly check if we are explicit
18792 implementation (instead of checking the Name for a ".", we
18793 directly look up if the InterfaceType was specified).
18795 Delay the creation of the PropertyBuilder.
18797 Only create the PropertyBuilder if we are not an explicit
18798 interface implementation. This means that explicit interface
18799 implementation members do not participate in regular function
18800 lookups, and hence fixes another major ambiguity problem in
18801 overload resolution (that was the visible effect).
18803 (DefineMethod): Return whether we are doing an interface
18806 * typemanager.cs: Temporary hack until we get attributes in
18807 interfaces (Ravi is working on that) and we get IndexerName
18808 support in interfaces.
18810 * interface.cs: Register the indexers as properties.
18812 * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18813 warning, I have verified that this is a bug in the .NET runtime
18814 (JavaScript suffers of the same problem).
18816 * typemanager.cs (MemberLookup): When looking up members for
18817 interfaces, the parent of an interface is the implicit
18818 System.Object (so we succeed in searches of Object methods in an
18819 interface method invocation. Example: IEnumerable x; x.ToString
18822 2002-05-25 Miguel de Icaza <miguel@ximian.com>
18824 * class.cs (Event): Events should also register if they do
18825 implement the methods that an interface requires.
18827 * typemanager.cs (MemberLookup); use the new GetInterfaces
18830 (GetInterfaces): The code used to lookup interfaces for a type is
18831 used in more than one place, factor it here.
18833 * driver.cs: Track the errors at the bottom of the file, we kept
18836 * delegate.cs (NewDelegate.Emit): We have to emit a null as the
18837 instance if the method we are calling is static!
18839 2002-05-24 Miguel de Icaza <miguel@ximian.com>
18841 * attribute.cs (ApplyAttributes): Make this function filter out
18842 the IndexerName attribute (as that attribute in reality is never
18843 applied) and return the string constant for the IndexerName
18846 * class.cs (TypeContainer.Emit): Validate that all the indexers
18847 have the same IndexerName attribute, and if so, set the
18848 DefaultName attribute on the class.
18850 * typemanager.cs: The return value might contain other stuff (not
18851 only methods). For instance, consider a method with an "Item"
18852 property and an Item method.
18854 * class.cs: If there is a problem with the parameter types,
18857 2002-05-24 Ravi Pratap <ravi@ximian.com>
18859 * ecore.cs (ImplicitConversionExists): Wrapper function which also
18860 looks at user defined conversion after making a call to
18861 StandardConversionExists - we need this for overload resolution.
18863 * expression.cs : Update accordingly the various method calls.
18865 This fixes 2 bugs filed against implicit user defined conversions
18867 2002-05-22 Miguel de Icaza <miguel@ximian.com>
18869 * statement.cs: Track the result of the assignment.
18871 2002-05-21 Miguel de Icaza <miguel@ximian.com>
18873 * expression.cs (MemberAccess): Improved error reporting for
18874 inaccessible members.
18876 2002-05-22 Martin Baulig <martin@gnome.org>
18878 * makefile (mcs-mono2.exe): New target. This is mcs compiled with
18879 itself with debugging support.
18881 2002-05-22 Martin Baulig <martin@gnome.org>
18883 * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18884 Removed, this isn't needed anymore.
18886 2002-05-20 Martin Baulig <martin@gnome.org>
18888 * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18889 be underlying type for an enum.
18891 2002-05-20 Miguel de Icaza <miguel@ximian.com>
18893 * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18894 that splits out the loading of just the core types.
18896 * rootcontext.cs (ResolveCore): Split the struct resolution in
18897 two, so we can load the enumeration underlying types before any
18900 * expression.cs (Is): Bandaid until we fix properly Switch (see
18901 bug #24985 for details).
18903 * typemanager.cs (ImplementsInterface): The hashtable will contain
18904 a null if there are no interfaces implemented.
18906 2002-05-18 Miguel de Icaza <miguel@ximian.com>
18908 * cs-parser.jay (indexer_declarator): It is fine to have array
18911 2002-05-17 Miguel de Icaza <miguel@ximian.com>
18913 * typemanager.cs: (RegisterBuilder): New function used to register
18914 TypeBuilders that implement interfaces. Since
18915 TypeBuilder.GetInterfaces (as usual) does not work with lame
18917 (AddUserType): register interfaces.
18919 (ImplementsInterface): Use the builder_to_ifaces hash if we are
18920 dealing with TypeBuilder. Also, arrays are showing up as
18921 SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18922 methods can not be invoked on them!
18924 * ecore.cs (ExplicitReferenceConversionExists): Made public.
18925 (ImplicitReferenceConversionExists): Split out from
18926 StandardConversionExists.
18928 * expression.cs (As): We were only implementing one of the three
18929 cases for the as operator. We now implement them all.
18930 (Is): Implement the various other cases for Is as well.
18932 * typemanager.cs (CACHE): New define used to control if we want or
18933 not the FindMembers cache. Seems to have a negative impact on
18934 performance currently
18936 (MemberLookup): Nested types have full acess to
18937 enclosing type members
18939 Remove code that coped with instance/static returns for events, we
18940 now catch this in RealFindMembers.
18942 (RealFindMembers): only perform static lookup if the instance
18943 lookup did not return a type or an event.
18945 2002-05-17 Miguel de Icaza <miguel@ximian.com>
18947 * assign.cs (CompoundAssign): We pass more semantic information
18948 now to Compound Assignments than we did before: now we have all
18949 the information at hand, and now we resolve the target *before* we
18950 do the expression expansion, which allows the "CacheValue" method
18951 to have the effect we intended (before, a [x] += 1 would generate
18952 two differen ArrayAccess expressions from the ElementAccess,
18953 during the resolution process).
18955 (CompoundAssign.DoResolve): Resolve target and original_source here.
18957 2002-05-16 Miguel de Icaza <miguel@ximian.com>
18959 * expression.cs (ArrayAccess): dropped debugging information.
18961 * typemanager.cs: Small bug fix: I was always returning i_members,
18962 instead of one of i_members or s_members (depending on which had
18965 * assign.cs (IAssignMethod.CacheTemporaries): New method. This
18966 method is invoked before any code generation takes place, and it
18967 is a mechanism to inform that the expression will be invoked more
18968 than once, and that the method should use temporary values to
18969 avoid having side effects
18971 (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18973 * ecore.cs (Expression.CacheTemporaries): Provide empty default
18976 * expression.cs (Indirection, ArrayAccess): Add support for
18977 CacheTemporaries in these two bad boys.
18979 * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18980 ldobj or ldind_ref.
18981 (StoreFromPtr): Handle stobj as well.
18983 * expression.cs (UnaryMutator): Share more code.
18985 * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18986 down: I was not tracking the Filter function as well, which
18987 was affecting the results of the cache.
18989 2002-05-15 Miguel de Icaza <miguel@ximian.com>
18991 * attribute.cs: Remove the hack to handle the CharSet property on
18994 2002-05-14 Miguel de Icaza <miguel@ximian.com>
18996 * attribute.cs (DoResolve): More uglyness, we now only try to
18997 resolve the attribute partially, to extract the CharSet
18998 information (only if we are a StructLayout attribute). Otherwise
19000 (GetExtraTypeInfo): Add some code to conditionally kill in the
19001 future this. I am more and more convinced that the .NET
19002 framework has special code to handle the attribute setting on
19005 * expression.cs (IsParamsMethodApplicable): Revert my previous
19006 foreach change here, it was wrong.
19008 2002-05-13 Miguel de Icaza <miguel@ximian.com>
19010 * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
19011 (pp_expr): do not abort on unknown input, just return.
19012 (eval): abort if there are pending chars.
19014 * attribute.cs (Attribute.Resolve): Positional parameters are
19015 optional. Deal with that case.
19017 * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
19018 the Ansi/Unicode/Auto information for the type.
19020 (TypeContainer.DefineType): instantiate the EmitContext here, as
19021 we will be using it during the type definition (to resolve
19022 attributes) and during the emit phase.
19024 * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
19025 to pull type information out of the attributes
19027 (Attribute.Resolve): track the constructor builder, and allow for
19028 multiple invocations (structs and classes will use this).
19030 * ecore.cs (MemberLookupFinal): new version with all the
19031 parameters customizable.
19033 * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
19034 constructors. Return if the result value is null (as the error
19035 would have been flagged already by MemberLookupFinal)
19037 Do not allow instances of abstract classes or interfaces to be
19040 * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
19041 We have to compare the assembly property here when dealing with
19042 FamANDAssem and Assembly access modifiers, because we might be
19043 creating an assembly from *modules* (that means that we are not
19044 getting TypeBuilders for types defined in other modules that are
19045 part of this assembly).
19047 (Method.Emit): If the method is marked abstract and has a body,
19050 (TypeContainer.DefineMembers): If both the defined member and the
19051 parent name match are methods, then do not emit any warnings: let
19052 the Method.Define routine take care of flagging warnings. But if
19053 there is a mismatch (method overrides something else, or method is
19054 overriwritten by something, then emit warning).
19056 (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
19057 set to null, this means `do not check for the return type on the
19060 (Method.Define): set the return type for the method signature to
19061 null, so that we get methods with the same name and parameters and
19062 different return types. This is used to flag warning 114 (you are
19063 hiding a method, and you probably want to use the new/override
19066 * typemanager.cs (MemberLookup): Implemented proper access
19067 control, closing a long standing set of bug reports. The problem
19068 was that the Framework only has two bits: Public and NonPublic,
19069 and NonPublic includes private and protected methods, but we need
19070 to enforce the FamANDAssem, FamOrAssem and Family.
19072 2002-05-11 Miguel de Icaza <miguel@ximian.com>
19074 * statement.cs (GotoCase): Return true: Ammounts to giving up
19075 knowledge on whether we return or not, and letting the other case
19076 be responsible for it.
19078 2002-05-10 Miguel de Icaza <miguel@ximian.com>
19080 * driver.cs: Do not load directories for each file processed, only
19081 do it if there is a pattern.
19083 * ecore.cs: Report readonly assigns here as well, as we might have
19084 been resolved only by MemberAccess.
19086 (SimpleName.SimpleNameResolve): Also be useful for LValue
19087 resolution. We need this to propagate assign to local readonly variables
19089 * typemanager.cs: Use a ptrhashtable for the criteria, because we
19090 do not want to reuse potential criteria memory.
19092 * class.cs (MyEventBuilder): Set reflected_type;
19094 * ecore.cs (Constantify): Added support for constifying bools.
19096 (RootContext.LookupType): Added a cache for values looked up in
19097 the declaration space.
19099 * typemanager.cs (FindMembers): Now is a front-end to
19100 RealFindMembers, and provides a two-level hashtable-based cache to
19103 15% performance improvement: from 22.5 to 19.2 seconds.
19105 * expression.cs (IsParamsMethodApplicable): use foreach.
19106 (Invocation.DoResolve): ditto.
19107 (New.DoResolve): ditto.
19108 (ArrayCreation.DoResolve): ditto.
19110 * ecore.cs (FindMostEncompassingType): use foreach.
19112 * delegate.cs (NewDelegate.DoResolve): Use foreach
19114 * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
19115 (RemoveMethods): use foreach.
19117 * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
19118 nested foreach statements instead of for, and also break out of
19119 the inner loop once a match is found.
19121 (Invocation.OverloadResolve): Use foreach, simplify the code.
19123 2002-05-08 Miguel de Icaza <miguel@ximian.com>
19125 * cfold.cs (BinaryFold): During an enumeration evaluation context,
19126 we actually unwrap the expression to allow for extra information
19129 * expression.cs: Use Shr_Un on unsigned operations.
19131 2002-05-08 Ravi Pratap <ravi@ximian.com>
19133 * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of
19134 applicable operators was not being considered correctly. This closes
19135 the bug Miguel reported.
19137 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
19139 * attribute.cs: check that the type derives from System.Attribute
19140 and report the correct error in that case (moved the duplicate code to
19141 its own method, too).
19143 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
19145 * attribute.cs: lookup attribute type name as the spec says: first the
19146 bare attribute name and then name + "Attribute" (nant compiles with
19147 mcs after this fix).
19149 2002-05-07 Miguel de Icaza <miguel@ximian.com>
19151 * expression.cs (Unary.TryReduceNegative): Ah! Tricky! Tricky!
19152 Because of the way we parse things, we should try to see if a
19153 UIntConstant can fit in an integer.
19155 2002-05-07 Ravi Pratap <ravi@ximian.com>
19157 * ecore.cs (GetConversionOperators): Do not pick up op_True operators
19158 when we are in an explicit context.
19160 (ConvertReferenceExplicit): When converting from Iface type S to Class
19161 T make sure the rules are implemented as an OR.
19163 * parameter.cs (ParameterType): Make it a property for now although the
19164 purpose really isn't anything immediate.
19166 * expression.cs (Is*Applicable): Do better checking on the parameter type
19167 of a ref/out parameter. The ones from the system assemblies are already
19168 marked with the correct type so we don't need to do any correction.
19170 * ecore.cs (StandardConversionExists): Conversion from Interface types to
19171 the object type is standard too so include that.
19173 2002-05-06 Miguel de Icaza <miguel@ximian.com>
19175 * ecore.cs (StandardConversionExists): Augment with missing code:
19176 deal with IntConstant, LongConstants and Enumerations.
19178 * assign.cs: Report the error, instead of failing silently
19180 * rootcontext.cs (AddGlobalAttributes): Track attributes on the
19181 typecontainer that they are declared, because the
19182 typecontainer/namespace will have the list of using clauses that
19183 need to be applied.
19185 Assembly Attributes were escaping the normal registration
19188 (EmitCode): Apply attributes within an EmitContext that represents
19189 the container they were declared on.
19191 * cs-parser.jay: Track bases for structs. How did I get this wrong?
19193 2002-05-06 Ravi Pratap <ravi@ximian.com>
19195 * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
19196 Revamp completely - make much cleaner as we now operate only
19199 (FindMostSpecificSource, FindMostSpecificTarget): New methods
19200 to implement the logic detailed in the spec more correctly.
19202 (UserDefinedConversion): Update accordingly.
19204 2002-05-06 Miguel de Icaza <miguel@ximian.com>
19206 * statement.cs: Return flow analysis information up.
19208 * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
19211 (token): Do not consume an extra character before calling
19214 2002-05-06 Piers Haken <piersh@friskit.com>
19216 * cs-parser.jay: add 'override' attribute to System.Object.Finalize
19218 2002-05-06 Miguel de Icaza <miguel@ximian.com>
19220 * class.cs (Constructor.Emit): Set the IsStatic flag in the
19221 EmitContext during the instance constructor initializer
19222 resolution, to stop access to instance variables.
19224 This is mandated by the spec, last paragraph of the `constructor
19225 initializers' section.
19227 2002-05-05 Miguel de Icaza <miguel@ximian.com>
19229 * cs-parser.jay, class.cs (Accessor): new class used to represent
19230 an accessor (get or set). In the past we used `null' to represent
19231 a missing accessor. But this is ambiguous because there was no
19232 way to tell in abstract indexers/properties if one of them was
19235 Now there is a way of addressing that.
19237 * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
19238 instead of FindMembers.
19240 * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
19241 the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
19243 * attribute.cs: Treat indexers and properties as the same in terms
19244 of applying attributes
19246 * ecore.cs (FindMostEncompassedType): Use statically initialized
19247 EmptyExpressions()s like we do elsewhere to avoid creating useless
19248 objects (and we take this out of the tight loop).
19250 (GetConversionOperators): Move the code to extract the actual
19251 operators to a separate routine to clean things up.
19253 2002-05-04 Miguel de Icaza <miguel@ximian.com>
19255 * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
19256 events are always registered FieldBuilders.
19258 * class.cs (FieldBase): New class shared by Fields
19260 * delegate.cs: If we are a toplevel delegate, use our full name.
19261 If we are a nested delegate, then only use our tail name.
19263 2002-05-02 Ravi Pratap <ravi@ximian.com>
19265 * expression.cs (IsApplicable): Ensure that we add the "&" to
19266 ref/out types before comparing it with the type of the argument.
19268 (IsParamsMethodApplicable): Ditto.
19270 (Argument.Type): Use TypeManager.LookupType instead of Type.GetType -
19273 * delegate.cs : Handle the case when we have more than one applicable
19274 method. Flag an error only when we finish checking all.
19276 2002-05-02 Miguel de Icaza <miguel@ximian.com>
19278 * expression.cs: Add support for boolean static initializers.
19280 2002-05-01 Miguel de Icaza <miguel@ximian.com>
19282 * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
19284 * parameter.cs (ComputeParameterTypes,
19285 ComputeAndDefineParameterTypes): Better error handling: now we
19286 clear the `types' cache if we fail during any of the type lookups.
19287 We also return the status code correctly to our caller
19289 * delegate.cs: If we fail to define a delegate, abort the extra
19292 * expression.cs (Binary.ResolveOperator): for
19293 operator==(object,object) and operator !=(object, object) we also
19294 have to verify that there is an implicit conversion from one to
19297 (ArrayAccess.DoResolve): Array Access can operate on
19300 2002-04-30 Miguel de Icaza <miguel@ximian.com>
19302 * assign.cs (CompoundAssign): A new class used as a "flag" that
19303 the assignment actually is happening as part of a compound
19304 assignment operator.
19306 During compound assignment, a few new rules exist to enable things
19313 x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
19314 to the type of x) if y is implicitly convertible to the type of x,
19315 and the operator is a builtin operator and the return type of the
19316 operator is explicitly convertible to the type of x.
19318 * rootcontext.cs: Reset warning level to 2. 4 catches various
19319 "interesting" features in mcs, we must clean this up at some
19320 point, but currently am trying to kill other bugs ;-)
19322 * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
19323 in container classes as well.
19325 * expression.cs (Binary.ResolveOperator): Handle string case
19326 before anything else (as operator overloading does emit an error
19327 before doing anything else).
19329 This code could go away when we move to a table driven model, but
19330 i could not come up with a good plan last night.
19332 2002-04-30 Lawrence Pit <loz@cable.a2000.nl>
19334 * typemanager.cs (CSharpName): reimplementation using regex.
19335 * class.cs: added null check for fields in Emit
19336 * rootcontext.cs: set warninglevel to 4
19338 2002-04-29 Miguel de Icaza <miguel@ximian.com>
19340 * typemanager.cs (CSharpName): reimplemented with Lupus
19343 2002-04-28 Miguel de Icaza <miguel@ximian.com>
19345 * statement.cs (If): correclty implement Resolve, because we were
19346 not catching sem errors in there. The same process is needed
19348 (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
19351 (Statement.Warning_DeadCodeFound): Factorize code.
19352 (While): Report dead code here too.
19354 (Statement): Added Resolve virtual method to allow
19355 for resolution split from the emit code.
19357 2002-04-26 Miguel de Icaza <miguel@ximian.com>
19359 * statement.cs (EmitBoolExpression): No longer try to resolve the
19361 (MakeBoolean): New utility function that resolve, implicitly
19362 converts to boolean and tags the expression.
19365 (If, Do): Implement dead code elimination.
19366 (While): Implement loop inversion
19368 (Do, While, For, If): Resolve the expression prior to calling our
19371 2002-04-22 Lawrence Pit <loz@cable.a2000.nl>
19374 - added method Report28 (warning: program has more than one entry point)
19375 - added method IsEntryPoint, implements paragraph 10.1 of the spec
19376 - modified method Method.Define, the part at the end of the method
19378 * rootcontext.cs: added static public Location EntryPointLocation;
19380 * ../errors/cs0028.cs : Add test case for the above warning.
19383 - modified method CSharpName to allow arrays of primitive type to
19384 be printed nicely (e.g. instead of System.Int32[][] it now prints
19386 - added method CSharpSignature: returns the signature of a method
19387 in string format to be used in reporting errors, warnings, etc.
19389 * support.cs: InternalParameters.ParameterDesc variable tmp initialized
19392 2002-04-26 Ravi Pratap <ravi@ximian.com>
19394 * delegate.cs (Define): Fix extremely silly bug where I was
19395 setting the type of the 'object' parameter of the BeginInvoke
19396 method to System.IAsyncResult instead of System.Object ;-)
19398 2002-04-26 Miguel de Icaza <miguel@ximian.com>
19400 * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
19403 (Constructor.Emit): return if we fail to initialize the
19404 constructor. Another door closed!
19406 * expression.cs (New.DoResolve): Improve error message (from -6 to
19407 1501). Use DeclaredOnly lookup to find the exact constructor.
19409 * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
19410 loop. This is useful.
19412 * cs-parser.jay: Adjust the default parameters so that destructors
19413 have the proper signature.
19415 2002-04-26 Martin Baulig <martin@gnome.org>
19417 * driver.cs (LoadAssembly): If `assembly' contains any characters
19418 which are only valid in path names and not in assembly names
19419 (currently slash, backslash and point), use Assembly.LoadFrom ()
19420 instead of Assembly.Load () on the `assembly' (before iteration
19421 over the link_paths).
19423 2002-04-26 Martin Baulig <martin@gnome.org>
19425 * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
19427 2002-04-25 Miguel de Icaza <miguel@ximian.com>
19429 * class.cs (Property): use the new typemanager.MemberLookup
19431 (TypeContainer.MemberLookup): Implement using the
19432 TypeManager.MemberLookup now.
19434 * typemanager.cs: Make MemberLookup a function of the TypeManager,
19435 and return MemberInfos, so that these can be used without an
19436 EmitContext (what we had before).
19438 2002-04-24 Miguel de Icaza <miguel@ximian.com>
19440 * expression.cs: Fix the case where the argument to params if the
19441 type of the params. I omitted handling this before. Fixed
19443 2002-04-22 Miguel de Icaza <miguel@ximian.com>
19445 * driver.cs: Call BootCorlib_PopulateCoreType
19447 * class.cs (Property.CheckBase): Check for properties only, not
19450 * interface.cs: Temporary hack: try/catch around the
19451 CustomAttributeBuilder, because I am getting an exception that I
19454 * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
19455 types whose definitions are required to be there (attributes are
19456 defined before standard types).
19458 Compute definitions as we boot the various types, as they are used
19459 immediately (value_type class will need object_type, but if we do
19460 not initialize object_type, we will pass a null, which will let
19461 the runtime pick the System.Object from the existing corlib, which
19462 is not what we want).
19464 2002-04-22 Patrik Torstensson <totte@labs2.com>
19466 * cs-tokenizer.cs: fixed a number of trim() issues.
19468 2002-04-22 Ravi Pratap <ravi@ximian.com>
19470 * expression.cs (Argument.Type): Ensure that we return the correct
19471 type when we have out or ref parameters [in which case we
19474 2002-04-22 Miguel de Icaza <miguel@ximian.com>
19476 * class.cs (Property, Indexer): Allow extern modifier in there.
19478 * typemanager.cs (InitBaseTypes): Initializes object_type and
19479 value_type, since those will be used early on during the bootstrap
19480 process to compile corlib.
19482 (InitCoreTypes): Move code from here to InitBaseTypes.
19484 2002-04-21 Miguel de Icaza <miguel@ximian.com>
19486 * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
19487 single-dimension arrays as using the ldlen opcode.
19489 Daniel Lewis discovered this optimization.
19491 * typemanager.cs: Add signature for System.Array::get_Length
19493 2002-04-20 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19495 * statement.cs: report the error when the foreach does not apply to an
19496 array nor a collection.
19498 2002-04-19 Miguel de Icaza <miguel@ximian.com>
19500 * expression.cs: Add implicit conversions to the operator ~.
19502 * constant.cs (DecimalConstant.Emit): Emit decimal value.
19504 * typemanager.cs: Locate the decimal constructor.
19506 2002-04-17 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19508 * attribute.cs: use the new property of TypeOf.
19509 * expression.cs: added 'get' property around typearg.
19511 These changes fix a build breaker reported by NickD. Is this the
19512 correct way to fix? If not, please, revert my changes and make it
19515 2002-04-17 Miguel de Icaza <miguel@ximian.com>
19517 * attribute.cs: Add support for typeof in attribute invocations.
19518 I am not sure that this is right though.
19520 2002-04-14 Duncan Mak <duncan@ximian.com>
19522 * cfold.cs (BinaryFold): Catch DivideByZeroException in the
19523 Binary.Operator.Division case.
19525 2002-04-13 Ravi Pratap <ravi@ximian.com>
19527 * class.cs (DefineType): Ensure that we do a proper check on
19528 attribute types and also register it with the TypeManager.
19530 (TypeContainer.Targets): The default for attribute types is
19531 AttributeTargets.All.
19533 * attribute.cs (ApplyAttributes): Registering the attribute type
19534 is done elsewhere, not when we discover we have a Usage attribute.
19536 2002-04-12 Ravi Pratap <ravi@ximian.com>
19538 * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
19539 and get rid of is_delegate parameter.
19541 * everywhere : update.
19543 2002-04-12 Ravi Pratap <ravi@ximian.com>
19545 * cs-parser.jay (compilation_unit): Revamp completely to use
19546 some new ideas that I got from Rhys' grammar to solve the problems
19547 with assembly level attributes.
19549 (outer_declaration): New grammar production.
19551 (attribute_sections): Add.
19553 (opt_attributes): Base on attribute_sections
19555 (namespace_declaration): Allow opt_attributes to tackle the case
19556 when we have assembly level attributes - we are clever in this
19559 * attribute.cs (ApplyAttributes): Do not worry about assembly
19560 attributes in the non-global context.
19562 * rootcontext.cs (AddGlobalAttributes): Go back to using this
19563 instead of SetGlobalAttributes.
19565 * class.cs, rootcontext.cs : Ensure we define and generate
19566 attribute types before anything else.
19568 * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19569 and flag the new error -20 for the case when the attribute type
19570 does not have valid targets specified. csc does not catch this.
19572 * ../errors/errors.txt : update for error # -20
19574 2002-04-11 Ravi Pratap <ravi@ximian.com>
19576 * support.cs (InternalParameters.ParameterModifier): Do some null
19577 checking and return sane values.
19579 * class.cs (Method.Define): If we are a PInvoke method, ensure
19580 that we are static and extern. Report error # 601
19582 * ../errors/cs0601.cs : Add test case for the above error.
19584 2002-04-07 Ravi Pratap <ravi@ximian.com>
19586 * rootcontext.cs (attribute_types): We need to keep type of
19587 all attribute types separately and emit code for them first.
19589 (RegisterAttribute) : Implement.
19591 * class.cs (DefineType): Check if the current Type is a custom
19592 attribute type and register it accordingly.
19594 * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19595 adding the first attribute twice and rename to
19597 (SetGlobalAttributes): this.
19599 * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19602 * attribute.cs (ApplyAttributes): Take an additional argument telling us
19603 if we are processing global arguments. Hmm, I am unsure of this.
19605 2002-04-12 Gonzalo Paniagua Javier <gonzalo@ximian.com>
19607 * expression.cs: added static array of strings to avoid calling
19608 Enum.ToString () for Operator in Binary. Significant recover of
19611 2002-04-10 Miguel de Icaza <miguel@ximian.com>
19613 * class.cs (FindMembers): Allow the Builders of the various
19614 members to be null. If they are skip them. This only happens
19615 during the PInvoke declaration.
19617 2002-04-09 Miguel de Icaza <miguel@ximian.com>
19619 * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19620 failure, so we do not keep going afterwards.
19622 * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19623 wanted to pass `false' as the `is_delegate' argument. If this is
19624 the case, why not use delegate_type == null to mean `is_delegate =
19625 false' and anything else as is_delegate = true.
19627 Tue Apr 9 05:40:12 2002 Piers Haken <piersh@friskit.com>
19629 * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19630 code for the section, not the beginning of the tests.
19632 2002-04-08 Miguel de Icaza <miguel@ximian.com>
19634 * cfold.cs: Handle operator + (Enum x, Underlying x)
19636 * expression.cs (Binary): same. Warn about errors where we have
19637 Enum/Enum in operator + as well.
19639 Mon Apr 8 06:29:03 2002 Piers Haken <piersh@friskit.com>
19642 - added support for switch(bool)
19643 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19644 - add TableSwitchEmit() to handle table-based switch statements
19646 2002-04-05 Ravi Pratap <ravi@ximian.com>
19648 * expression.cs (Invocation.OverloadResolve): Factor out code which
19649 does parameter compatibility checking with arguments so that we can
19650 re-use the code even from Delegate.VerifyApplicability
19652 (VerifyArgumentsCompat): Move above code here.
19654 * delegate.cs (VerifyApplicability): Get rid of duplicate code
19655 and instead make a call to the above method.
19657 2002-03-31 Ravi Pratap <ravi@ximian.com>
19659 * typemanager.cs (attribute_type): Corresponds to System.Attribute.
19660 We use it to keep track of classes which are attribute types.
19662 2002-04-02 Miguel de Icaza <miguel@ximian.com>
19664 * delegate.cs (Delegate.Define): Correctly define the types in the
19665 presence of fixed and array parameters.
19667 * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
19670 * ecore.cs (Expression.MemberLookup): Reset binding flags to not
19671 include NonPublic after the first iteration.
19673 * class.cs (Indexer.CheckBase): Only check if both parents are
19676 * cs-parser.jay (accessor_body): If empty, set to null.
19678 * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19679 same code path here to resolve constants names that we did have in
19680 MemberAccess.DoResolve. There is too much code duplicated here.
19682 2002-04-01 Miguel de Icaza <miguel@ximian.com>
19684 * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19686 * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19689 * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19690 tokens, numbers and strings.
19692 * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19695 * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19696 asyncronous parameters and the regular parameters.
19698 * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19699 specify the target directory.
19701 * expression.cs: (This.DoResolve): Simplify
19702 (As.Emit): Optimize, do not generate IsInst if the expression is
19703 always of the given type.
19705 (Is.DoResolve): Bug fix, we were reporting both always/never for
19708 * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19709 creating too many unnecessary arrays.
19711 2002-03-31 Miguel de Icaza <miguel@ximian.com>
19713 * class.cs (EmitFieldInitializer): Use Assign expression to assign
19714 fields instead of rolling our own initializer. Takes care of all
19715 implicit conversions, and drops unnecessary static checks/argument.
19717 2002-03-31 Dick Porter <dick@ximian.com>
19719 * driver.cs: use the GetDirectories() return values properly, and
19720 use "/" as path separator.
19722 2002-03-30 Miguel de Icaza <miguel@ximian.com>
19724 * expression.cs (Unary): Optimize - - expr into expr.
19725 (Binary): Optimize a + (-b) into a -b.
19727 * codegen.cs (CodeGen): Made all methods static.
19729 2002-03-29 Miguel de Icaza <miguel@ximian.com>
19733 * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19734 TypeBuilder property.
19736 * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19739 * tree.cs: Removed the various RecordXXXX, and replaced with a
19740 single RecordDecl. Removed all the accessor methods, and just
19741 left a single access point Type
19743 * enum.cs: Rename DefineEnum to DefineType.
19745 * decl.cs: New abstract method `DefineType' used to unify the
19746 Defines for Enumerations, Interfaces, TypeContainers and
19749 (FindType): Moved LookupInterfaceOrClass here. Moved the
19750 LookupBaseClasses method that used to live in class.cs and
19751 interface.cs here, and renamed to FindType.
19753 * delegate.cs: Implement DefineType. Take advantage of the
19754 refactored pattern for locating the parent builder without taking
19755 the parent_builder argument (which we know does not work if we are
19756 nested, and triggering a toplevel definition).
19758 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19760 * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19761 accessibility of a member has changed during override and report
19764 * class.cs (Method.Define, Property.Define): Only complain on
19765 overrides if the method is private, any other accessibility is
19766 fine (and since we just checked the permission is the same, we are
19769 * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19770 and elif are processed always. The other pre-processing
19771 directives are only processed if we are "taking" the path
19773 2002-03-29 Martin Baulig <martin@gnome.org>
19775 * class.cs (Method.Emit): Only emit symbolic debugging info if the
19776 current location is not Null.
19778 * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19779 a separate method so we can profile it.
19781 * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19782 `span.Seconds' are just seconds, but no minutes or hours.
19783 (MainDriver): Profile the CodeGen.SaveSymbols calls.
19785 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19787 * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19788 Remove the gratuitous set of Final:
19790 // If an interface implementation, then we can set Final.
19791 if (((flags & MethodAttributes.Abstract) == 0) &&
19792 implementing.DeclaringType.IsInterface)
19793 flags |= MethodAttributes.Final;
19795 I do not know what I was smoking when I used that.
19798 * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19799 step into fixing the name resolution issues for delegates and
19800 unifying the toplevel name resolution.
19802 2002-03-28 Martin Baulig <martin@gnome.org>
19804 * class.cs (Method.Emit): If we have a symbol writer, call its
19805 OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19806 tell it about the current method.
19808 * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19809 writer that we're going to emit the first byte of IL code for a new
19810 statement (a new source line).
19811 (EmitContext.EmitTopBlock): If we have a symbol writer, call
19812 EmitContext.Mark() before emitting any code.
19814 * location.cs (SymbolDocument): Return null when we're Null.
19816 * statement.cs (Statement): Moved the `Location loc' variable here.
19817 (Statement.EmitBoolExpression): If we have a symbol writer, call
19818 ec.Mark() before emitting any code to tell it that we're at the
19819 beginning of a new statement.
19820 (StatementExpression): Added `Location' argument to the constructor.
19821 (Block): Added public readonly variable `StartLocation' and public
19822 variable `EndLocation'. The latter is to be set using SetEndLocation().
19823 (Block): Added constructor which takes a start and end location.
19824 (Block.SetEndLocation): New method. This sets the end location.
19825 (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19826 local variables we create.
19827 (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
19828 each statement and do also mark the begin and end of the block.
19830 * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
19831 tell it the current lexer.Location, use Location.Null for the end of the
19833 (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
19834 current block, set its end location using SetEndLocation().
19835 (statement_expression): StatementExpression constructor now takes the
19836 lexer.Location as additional argument.
19837 (for_statement, declare_local_variables): Likewise.
19838 (declare_local_variables): When creating a new implicit block, use the
19839 new Block constructor and pass it the lexer.Location.
19841 2002-03-28 Miguel de Icaza <miguel@ximian.com>
19843 * ecore.cs (Expression.MemberLookup): On interfaces, lookup
19844 members also on the parent interfaces recursively.
19846 2002-03-27 Miguel de Icaza <miguel@ximian.com>
19848 * report.cs: Use new formats, since Gonzalo finished the missing
19851 * expression.cs (Binary.ResolveOperator): added missing operator|
19852 operator& and operator^ for bool/bool.
19854 * cs-parser.jay: CheckDef now takes a Location argument that is
19855 used to report errors more precisly (instead of reporting the end
19856 of a definition, we try to track something which is a lot closer
19857 to the source of the problem).
19859 * cs-tokenizer.cs: Track global token use, so we can properly flag
19860 the use of #define/#undef after the first token has been seen.
19862 Also, rename the reportXXXX to Error_DescriptiveName
19864 * decl.cs (DeclSpace.IsTopLevel): Move property here from
19865 TypeContainer, so that Enum and Interface can use this too.
19867 * class.cs (TypeContainer.LookupInterfaceOrClass,
19868 GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19869 `builder' argument. Typically this was used to pass the parent
19870 builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19873 The problem is that a nested class could trigger the definition of
19874 a toplevel class, and the builder would be obviously wrong in that
19877 So we drop this argument, and we compute dynamically the
19878 TypeBuilder/ModuleBuilder (the correct information was available
19879 to us anyways from DeclSpace.Parent)
19881 * interface.cs (Interface.DefineInterface): Drop builder
19882 parameter cleanup like class.cs
19884 * enum.cs (Enum.DefineEnum): Drop builder parameter. Clean up
19887 * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19890 (Try.Emit): Propagate the returns value from the statement.
19892 (Return.Emit): Even if we are leavning
19894 * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19896 * modifiers.cs: Fix the computation of MethodAttributes flags.
19898 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19900 * driver.cs: allow compilation of files that start with '/'.
19901 Add a default case when checking the argument of --target.
19903 2002-03-25 Miguel de Icaza <miguel@ximian.com>
19905 * interface.cs: Implement the same search algorithm for types in
19906 the interface code.
19908 * delegate.cs: Do not allow multiple definition.
19910 * Recovered ChangeLog that got accidentally amputated
19912 * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19914 * rootcontext.cs: Load manually enum to allow core classes to
19915 contain enumerations.
19917 * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19918 Update to new static methods in TypeManager.
19920 * typemanager.cs (GetMethod, GetConstructor): Use our
19921 implementation of FindMembers to find the members, since during
19922 corlib compilation, the types are TypeBuilders and GetMethod and
19923 GetConstructor do not work.
19925 Make all methods in TypeManager static.
19927 (InitCodeHelpers): Split the functionality from
19928 the InitCodeTypes function.
19930 * driver.cs: Call InitCodeHelpers after we have populated the
19933 * cs-parser.jay (delegate_declaration): we did not used to compute
19934 the delegate name correctly for void delegates.
19936 2002-03-24 Miguel de Icaza <miguel@ximian.com>
19938 * rootcontext.cs (RootContext): Init the interface_resolve_order
19939 and type_container_resolve_order always.
19941 (ResolveCore, BootstrapCorlib_ResolveClass,
19942 BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19943 compiler when compiling with --nostdlib
19945 * class.cs (TypeContainer.DefineType): Check that our parent is
19946 not null. This test is most important when we are bootstraping
19949 * codegen.cs: Split out the symbol writing code.
19951 2002-03-25 Martin Baulig <martin@gnome.org>
19953 * driver.cs (-g): Made -g an alias for --debug.
19955 2002-03-24 Martin Baulig <martin@gnome.org>
19957 * codegen.cs (SymbolWriter): New public variable. Returns the
19958 current symbol writer.
19959 (CodeGen): Added `bool want_debugging_support' argument to the
19960 constructor. If true, tell the ModuleBuild that we want debugging
19961 support and ask it for the ISymbolWriter.
19962 (Save): If we have a symbol writer, call it's Close() method after
19963 saving the assembly.
19965 * driver.c (--debug): New command line argument to create a
19966 debugger information file.
19968 * location.cs (SymbolDocument): New public property. Returns an
19969 ISymbolDocumentWriter object for the current source file or null
19970 if we don't have a symbol writer.
19972 2002-03-21 Miguel de Icaza <miguel@ximian.com>
19974 * driver.cs (LoadAssembly): Correctly return when all the paths
19975 have been tried and not before.
19977 * statement.cs (Switch.Emit): return the actual coverage for this
19978 statement (returns/not-returns)
19980 (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19981 switch of the statement if we are the last switch section. That
19982 kills two problems: try/catch problems (we used to emit an empty
19983 nop at the end) and switch statements where all branches would
19986 2002-03-19 Miguel de Icaza <miguel@ximian.com>
19988 * driver.cs: Add default assemblies (the equivalent to the
19989 Microsoft CSC.RSP file)
19991 * cs-tokenizer.cs: When updating `cols and setting it to zero,
19992 also update tokens_seen and set it to false.
19994 * driver.cs: Implement --recurse for Mike.
19996 * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19997 correctly splitting out the paths.
19999 2002-03-18 Miguel de Icaza <miguel@ximian.com>
20001 * interface.cs (Interface.PopulateProperty): Instead of using
20002 `parent' as the declaration space for the set parameters, use
20005 * support.cs (InternalParameters): InternalParameters constructor
20006 takes a DeclSpace instead of a TypeContainer.
20008 * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
20009 types are being initialized, load the address of it before calling
20012 (New): Provide a mechanism to disable the generation of local
20013 value type temporaries when the caller will be providing us with
20014 an address to store it.
20016 (ArrayCreation.EmitDynamicInitializers): Use it.
20018 2002-03-17 Miguel de Icaza <miguel@ximian.com>
20020 * expression.cs (Invocation.EmitArguments): Only probe for array
20021 property if there is more than one argument. Sorry about that.
20023 * class.cs (Invocation.EmitArguments): Fix to emit arguments for
20024 empty param arrays.
20026 * class.cs (Method.LabelParameters): Fix incorrect code path that
20027 prevented the `ParamArrayAttribute' from being applied to the
20030 2002-03-16 Miguel de Icaza <miguel@ximian.com>
20032 * support.cs (ReflectionParameters): Correctly compute whether the
20033 last argument is a params array. Fixes the problem with
20036 * typemanager.cs: Make the assemblies array always be non-null
20037 (empty, but non-null)
20039 * tree.cs (RecordDecl): New function that abstracts the recording
20040 of names. This reports error 101, and provides a pointer to the
20041 previous declaration. Fixes a crash in the compiler.
20043 * cs-parser.jay (constructor_declaration): Update to new grammar,
20044 and provide a constructor_body that can be empty.
20046 2002-03-15 Miguel de Icaza <miguel@ximian.com>
20048 * driver.cs: Add support for --resources.
20050 * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
20051 Make all types for the various array helper methods be integer.
20053 * ecore.cs (Expression.ConvertNumericExplicit): Pass the
20054 CheckState to ConvCast.
20056 (ConvCast): Now it takes a `checked' state argument, to avoid
20057 depending on the emit context for the conversion, and just using
20058 the resolve time setting.
20060 * expression.cs (ArrayCreation.EmitArrayArguments): New function,
20061 instead of Invocation.EmitArguments. We do not emit the original
20062 arguments, instead we emit those which have been converted to
20063 unsigned int expressions.
20065 * statement.cs (Block.EmitMeta): Drop tracking of indexes.
20067 * codegen.cs: ditto.
20069 * expression.cs (LocalVariableReference): Drop the use of the
20070 Store function that depended on the variable index.
20072 * statement.cs (VariableInfo): Drop the `Idx' property from this
20073 class, as this is not taking into account the indexes for
20074 temporaries tat we generate during the execution, getting the
20077 * class.cs: First emit class initializers, then call the parent
20080 * expression.cs (Binary): Fix opcode emision.
20081 (UnaryMutator.EmitCode): Support checked code generation
20083 * ecore.cs (MemberLookup): TypeManager.FindMembers will return
20084 matches for events for both the Static and Instance scans,
20085 pointing to the same element. Fix that.
20087 2002-03-14 Miguel de Icaza <miguel@ximian.com>
20089 * rootcontext.cs (ResolveTree): Always set the
20090 interface_resolve_order, because nested interfaces will be calling
20093 * class.cs (GetInterfaceOrClass): Track the same resolution
20094 process used by TypeManager.LookupType. This fixes the nested
20095 type lookups in class declarations (separate path from
20098 (TypeContainer.DefineType): Also define nested interfaces.
20099 (TypeContainer.RegisterOrder): New public function used to
20100 register the order in which child interfaces need to be closed.
20102 Nested interfaces need to be closed after their parents have been
20105 * interface.cs (InterfaceAttr): Put all the logic for computing
20106 the interface attribute here.
20108 (DefineInterface): Register our interface order with the
20109 RootContext or with the TypeContainer depending on the case.
20111 2002-03-12 Miguel de Icaza <miguel@ximian.com>
20113 * cs-parser.jay: rework foreach statement to work with the new
20114 changes to the policy on SimpleNames.
20116 * report.cs: support Stacktrace on warnings as well.
20118 * makefile: drop --unsafe and /unsafe from the compile.
20120 2002-03-13 Ravi Pratap <ravi@ximian.com>
20122 * ecore.cs (StandardConversionExists): Modify to take an Expression
20123 as the first parameter. Ensure we do null -> reference type conversion
20126 * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
20127 temporary Expression objects.
20129 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
20131 * interface.cs: workaround bug in method overloading resolution
20132 (there is already a bugzilla bug for it).
20134 2002-03-12 Miguel de Icaza <miguel@ximian.com>
20136 We could also solve this problem by having a separate path for
20137 performing type lookups, instead of DoResolve, we could have a
20138 ResolveType entry point, and only participating pieces of the
20139 production (simplename, deref, array) would implement this.
20141 * codegen.cs (EmitContext): New field OnlyLookupTypes used to
20142 signal SimpleName to only resolve type names and not attempt to
20143 resolve anything else.
20145 * expression.cs (Cast): Set the flag.
20147 * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
20149 * class.cs: Only report 108 if there is no `new' modifier.
20151 * cs-parser.jay: rework foreach statement to work with the new
20152 changes to the policy on SimpleNames.
20154 * report.cs: support Stacktrace on warnings as well.
20156 * makefile: drop --unsafe and /unsafe from the compile.
20158 2002-03-11 Miguel de Icaza <miguel@ximian.com>
20160 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20161 lookups here, instead of doing that at parse time. This means
20162 that our grammar will not introduce `LocalVariableReferences' as
20163 expressions at this point. That solves the problem of code like
20167 static void Main ()
20171 This is only half the fix. The full fix requires parameters to
20172 also be handled in this way.
20174 * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
20175 makes the use more obvious of the DeclSpace. The
20176 ec.TypeContainer.TypeBuilder is now only used to pull the
20177 TypeBuilder for it.
20179 My theory is that I can get rid of the TypeBuilder completely from
20180 the EmitContext, and have typecasts where it is used (from
20181 DeclSpace to where it matters).
20183 The only pending problem is that the code that implements Aliases
20184 is on TypeContainer, and probably should go in DeclSpace.
20186 * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20187 lookups here, instead of doing that at parse time. This means
20188 that our grammar will not introduce `LocalVariableReferences' as
20189 expressions at this point. That solves the problem of code like
20193 static void Main ()
20197 This is only half the fix. The full fix requires parameters to
20198 also be handled in this way.
20200 * class.cs (Property.DefineMethod): When implementing an interface
20201 method, set newslot, when implementing an abstract method, do not
20202 set the flag (before we tried never setting it, or always setting
20203 it, which is the difference).
20204 (Indexer.DefineMethod): same.
20205 (Method.DefineMethod): same.
20207 * ecore.cs: Only set the status used flag if we get back a Field.
20209 * attribute.cs: Temporary hack, so Paolo can keep working.
20211 2002-03-08 Ravi Pratap <ravi@ximian.com>
20213 * attribute.cs (Attribute.UnmanagedType): This is to keep track of
20214 the unmanaged type in the case we have a MarshalAs attribute.
20216 (Resolve): Handle the case when we are parsing the special MarshalAs
20217 attribute [we need to store the unmanaged type to use later]
20219 * typemanager.cs (marshal_as_attr_type): Built in type for the
20220 MarshalAs Attribute.
20222 * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute
20223 on parameters and accordingly set the marshalling info.
20225 2002-03-09 Miguel de Icaza <miguel@ximian.com>
20227 * class.cs: Optimizing slightly by removing redundant code after
20228 we switched to the `NoTypes' return value.
20229 (Property.DefineMethod): use NoTypes here too.
20231 This fixes the bug I introduced in my last batch of changes.
20233 2002-03-05 Ravi Pratap <ravi@ximian.com>
20235 * tree.cs (RecordEnum): Add. We now keep track of enums too.
20237 * class.cs (LookupInterfaceOrClass): Check against the list of recorded
20238 Enums since those are types too.
20240 * cs-parser.jay (enum_declaration): Record enums as we parse them.
20242 * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined
20243 thanks to a call during the lookup process.
20245 2002-03-07 Miguel de Icaza <miguel@ximian.com>
20247 * statement.cs (Foreach): Lots of work to accomodate a particular
20248 kind of foreach statement that I had not kept in mind. It is
20249 possible to have foreachs on classes that provide a GetEnumerator
20250 method that return objects that implement the "pattern" for using
20251 a foreach, there is no need to support GetEnumerator
20254 This is needed to compile nant.
20256 * decl.cs: Only report 114 if the member is not `Finalize' and if
20257 the warning level is at least 2.
20259 * class.cs: Moved the compare function from Method to
20262 (MethodSignature.InheritableMemberSignatureCompare): Add new
20263 filter function that is used to extract inheritable methods from a
20266 (Method.Define): Use the new `inheritable_method_signature_filter'
20269 * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
20272 2002-03-06 Miguel de Icaza <miguel@ximian.com>
20274 * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
20276 * cs-parser.jay: Add opt_semicolon to the interface declaration.
20278 * expression.cs: Pass location information to
20279 ConvertImplicitStandard.
20281 * class.cs: Added debugging code to track return values from
20284 2002-03-05 Miguel de Icaza <miguel@ximian.com>
20286 * expression.cs (Is.DoResolve): If either side of the `is' is an
20287 interface, do not flag the warning.
20289 * ecore.cs (ImplicitReferenceConversion): We need a separate test
20292 * report.cs: Allow for --fatal to be used with --probe.
20294 * typemanager.cs (NoTypes): Move the definition for the empty Type
20297 * class.cs (TypeContainer.FindMembers): Also look for methods defined by
20299 (TypeContainer.DefineProxy): New function used to proxy to parent
20300 implementations when implementing interfaces.
20301 (TypeContainer.ParentImplements): used to lookup if our parent
20302 implements a public function that is required by an interface.
20303 (TypeContainer.VerifyPendingMethods): Hook this up.
20305 * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
20306 `modules' and `assemblies' arraylists into arrays. We only grow
20307 these are the very early start up of the program, so this improves
20308 the speedof LookupType (nicely measured).
20310 * expression.cs (MakeByteBlob): Replaced unsafe code with
20311 BitConverter, as suggested by Paolo.
20313 * cfold.cs (ConstantFold.Binary): Special case: perform constant
20314 folding of string concatenation, but if either side is a string,
20315 and the other is not, then return null, and let the runtime use
20316 the concatenation on the string plus the object (using
20317 `Object.ToString').
20319 2002-03-04 Miguel de Icaza <miguel@ximian.com>
20321 Constant Folding has been implemented now.
20323 * expression.cs (Unary.Reduce): Do not throw an exception, catch
20324 the error instead on types that are not supported in one's
20327 * constant.cs (Constant and all children): New set of functions to
20328 perform implict and explicit conversions.
20330 * ecore.cs (EnumConstant): Implement the new functions to perform
20331 conversion by proxying to the child expression.
20333 * codegen.cs: (ConstantCheckState): Constant evaluation has its
20334 own separate setting that can not be turned off from the command
20335 line using --unchecked or --checked and is only controlled using
20336 the checked/unchecked statements and expressions. This setting is
20337 used by the constant folder to flag errors.
20339 * expression.cs (CheckedExpr, UncheckedExpr): Set the
20340 ConstantCheckState as well.
20342 During Resolve, they also have to flag the state, because the
20343 constant folder runs completely in the Resolve phase.
20345 * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
20348 2002-03-01 Miguel de Icaza <miguel@ximian.com>
20350 * cfold.cs: New file, this file contains the constant folder.
20352 * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
20353 argument to track whether we are using the resulting address to
20354 load or store a value and provide better error messages.
20356 (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
20357 new AddressOf arguments.
20359 * statement.cs (Foreach.EmitCollectionForeach): Update
20361 * expression.cs (Argument.Emit): Call AddressOf with proper
20362 arguments to track usage.
20364 (New.DoEmit): Call AddressOf with new arguments.
20366 (Unary.Emit): Adjust AddressOf call.
20368 2002-03-01 Ravi Pratap <ravi@ximian.com>
20370 * cs-parser.jay (member_access): Change the case for pre-defined types
20371 to use a MemberAccess instead of a SimpleName. Thanks to Felix again for
20374 * class.cs (Operator::Emit): If we are abstract or extern, we don't have
20377 * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
20378 essentially like methods and apply attributes like MethodImplOptions to them too.
20380 * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
20383 * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
20384 DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
20387 * Update code everywhere accordingly.
20389 * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
20391 * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
20393 2002-02-28 Ravi Pratap <ravi@ximian.com>
20395 * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
20396 try performing lookups against those instead of jumping straight into using
20397 the 'using' clauses.
20399 (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
20401 (LookupType): Perform lookups in implicit parents too.
20403 * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
20404 sequence as RootContext.LookupType.
20406 * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries
20407 the various cases of namespace lookups into this method.
20409 2002-03-01 Miguel de Icaza <miguel@ximian.com>
20411 * cs-parser.jay: Add support for [Attribute ()] (empty arguments
20412 in positional arguments)
20414 * class.cs (Operator): Update the AllowedModifiers to contain
20417 * cs-parser.jay: Update operator declaration to allow for the
20418 operator body to be empty.
20420 * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
20423 2002-02-27 Miguel de Icaza <miguel@ximian.com>
20425 * class.cs (Method.Emit): Label parameters.
20427 * driver.cs: Return 1 or 0 as the program exit code.
20429 2002-02-26 Miguel de Icaza <miguel@ximian.com>
20431 * expression.cs: Special case the `null' object when trying to
20432 auto-compute the type, as anything can be explicitly converted to
20435 * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
20436 spotting this Paolo.
20438 (Expression.ImplicitNumericConversion): Perform comparissions of
20439 the type using the underlying type in the case of an enumeration
20440 rather than using the enumeration type for the compare.
20442 Cope with the underlying == type case, which is not possible to
20445 (Expression.ConvertNumericExplicit): Perform comparissions of
20446 the type using the underlying type in the case of an enumeration
20447 rather than using the enumeration type for the compare.
20449 * driver.cs: If the user does not supply an extension, assume .exe
20451 * cs-parser.jay (if_statement): Rewrote so that we can track the
20452 location for the if statement.
20454 * expression.cs (Binary.ConstantFold): Only concat strings when
20455 the operation is "+", not everything ;-)
20457 * statement.cs (Statement.EmitBoolExpression): Take a location
20459 (If, While, Do): Track location.
20461 * expression.cs (Binary.ResolveOperator): In the object + string
20462 case, I was missing a call to ConvertImplicit
20464 2002-02-25 Ravi Pratap <ravi@ximian.com>
20466 * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
20467 Location arguments. Ensure we use RootContext.LookupType to do our work
20468 and not try to do a direct Type.GetType and ModuleBuilder.GetType
20470 * interface.cs (PopulateMethod): Handle the type of the parameter being
20473 * expression.cs (Invocation.BetterFunction): Handle the case when we
20474 have a params method with no fixed arguments and a call is made with no
20477 2002-02-25 Miguel de Icaza <miguel@ximian.com>
20479 * cs-tokenizer.cs: Add support for the quote-escape-sequence in
20480 the verbatim-string-literal
20482 * support.cs (InternalParameters.ParameterModifier): handle null
20484 (InternalParameters.ParameterType): ditto.
20486 * parameter.cs (VerifyArgs): Also check if the fixed parameter is
20487 duplicating the name of the variable parameter.
20488 (GetParameterByName): Fix bug where we were not looking up array
20489 paramters if they were the only present (thanks Paolo!).
20490 (GetParameterInfo): We only have an empty set of types if both
20491 fixed and array are set to null.
20492 (GetParameterInfo-idx): Handle FixedParameter == null
20494 * cs-parser.jay: Handle the case where there is no catch
20495 statements (missing null test).
20497 2002-02-22 Miguel de Icaza <miguel@ximian.com>
20499 * driver.cs (MainDriver): Be conservative on our command line
20502 Catch DirectoryNotFoundException when calling GetFiles.
20504 (SplitPathAndPattern): Used to split the input specification into
20505 a path and a pattern that we can feed to Directory.GetFiles.
20507 2002-02-21 Miguel de Icaza <miguel@ximian.com>
20509 * statement.cs (Fixed): Implement the last case of the Fixed
20510 statement (string handling).
20512 * expression.cs (StringPtr): New class used to return a char * to
20513 a string; Used by the Fixed statement.
20515 * typemanager.cs: Add char_ptr_type. Add get_OffsetToStringData method.
20517 * expression.cs (Binary.ResolveOperator): Remove redundant
20518 MemberLookup pn parent type.
20519 Optimize union call, we do not need a union if the types are the same.
20520 (Unary.ResolveOperator): REmove redundant MemberLookup on parent
20523 Specialize the use of MemberLookup everywhere, instead of using
20524 the default settings.
20526 (StackAlloc): Implement stackalloc keyword.
20528 * cs-parser.jay: Add rule to parse stackalloc.
20530 * driver.cs: Handle /h, /help, /?
20532 * expression.cs (MakeByteBlob): Removed the hacks we had in place
20533 before we supported unsafe code.
20535 * makefile: add --unsafe to the self compilation of mcs.
20537 2002-02-20 Miguel de Icaza <miguel@ximian.com>
20539 * expression.cs (PointerArithmetic): New class that is used to
20540 perform pointer arithmetic.
20541 (Binary.Resolve): Handle pointer arithmetic
20542 Handle pointer comparission.
20543 (ArrayPtr): Utility expression class that is used to take the
20544 address of an array.
20546 (ElementAccess): Implement array access for pointers
20548 * statement.cs (Fixed): Implement fixed statement for arrays, we
20549 are missing one more case before we are done.
20551 * expression.cs (Indirection): Implement EmitAssign and set the
20552 ExprClass to Variable. This allows pointer dereferences to be
20553 treated as variables, and to have values assigned to them.
20555 * ecore.cs (Expression.StoreFromPtr): New utility function to
20556 store values dereferencing.
20558 2002-02-20 Ravi Pratap <ravi@ximian.com>
20560 * expression.cs (Binary.ResolveOperator): Ensure that we are
20561 not trying to operate on a void type - this fixes the reported
20564 * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
20565 the parent implementation is sealed.
20567 * ../errors/cs0239.cs : Add.
20569 * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20571 * typemanager.cs (unverifiable_code_type): Corresponds to
20572 System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20573 which have unsafe code in them.
20575 * rootcontext.cs (EmitCode): Emit the above attribute when we are in an
20578 2002-02-19 Miguel de Icaza <miguel@ximian.com>
20580 * cs-tokenizer.cs: Add support for @"litreal strings"
20582 Make tokenizer accept pre-processor directives
20583 on any column (remove the old C-like limitation).
20585 * rootcontext.cs (EmitCode): Emit any global attributes.
20586 (AddGlobalAttributes): Used to keep track of assembly attributes.
20588 * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20590 * cs-parser.jay: Add support for global attributes.
20592 2002-02-17 Miguel de Icaza <miguel@ximian.com>
20594 * expression.cs (Indirection): New helper class. Unary will
20595 create Indirection classes to be able to implement the
20596 IMemoryLocation interface on it.
20598 2002-02-16 Miguel de Icaza <miguel@ximian.com>
20600 * cs-parser.jay (fixed_statement): reference the right statement.
20602 * statement.cs (Fixed.Emit): Finish implementing the fixed
20603 statement for the &x case.
20605 2002-02-14 Miguel de Icaza <miguel@ximian.com>
20607 * class.cs (Property.Define, Method.Define): Remove newslot when
20610 * modifiers.cs: My use of NewSlot when `Abstract' was set was
20611 wrong. NewSlot should only be used if the `new' keyword is present.
20613 * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20614 locating our system dir. Sorry about this.
20616 2002-02-13 Miguel de Icaza <miguel@ximian.com>
20618 * driver.cs (GetSystemDir): Compute correctly the location of our
20619 system assemblies. I was using the compiler directory instead of
20620 the library directory.
20622 2002-02-13 Ravi Pratap <ravi@ximian.com>
20624 * expression.cs (BetterFunction): Put back in what Miguel commented out
20625 since it is the correct fix. The problem is elsewhere ;-)
20627 (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20628 parameters of the parms method are themselves compatible or not !
20630 (StandardConversionExists): Fix very dangerous bug where we were forgetting
20631 to check that a class implements an interface before saying that an implicit
20632 conversion was allowed. Use ImplementsInterface to do the checking.
20634 2002-02-13 Miguel de Icaza <miguel@ximian.com>
20636 * class.cs (Method.Define): Track whether we are an explicit
20637 implementation or not. And only call DefineMethodOverride if we
20638 are an explicit implementation.
20640 (Property.DefineMethod): Ditto.
20642 2002-02-11 Ravi Pratap <ravi@ximian.com>
20644 * expression.cs (BetterFunction): Catch hideous bug which was
20645 preventing us from detecting ambiguous calls due to implicit casts i.e
20648 2002-01-29 Miguel de Icaza <miguel@ximian.com>
20650 * support.cs (Pair): Remove un-needed method. I figured why I was
20651 getting the error in cs-parser.jay, the variable in a foreach loop
20652 is readonly, and the compiler does not really treat this as a variable.
20654 * cs-parser.jay (fixed_statement): Fix grammar. Use ASSIGN
20655 instead of EQUALS in grammar.
20657 * typemanager.cs (VerifyUnmanaged): Report correct error (208)
20659 * expression.cs (Unary.DoResolve): Check whether the argument is
20662 2002-01-28 Miguel de Icaza <miguel@ximian.com>
20664 * support.cs: Api for Pair to set a value. Despite the fact that
20665 the variables are public the MS C# compiler refuses to compile
20666 code that accesses the field if the variable is part of a foreach
20669 * statement.cs (Fixed): Begin implementation of the fixed
20672 (Block.AddVariable): Return the VariableInfo on success and null
20673 on failure instead of true/false.
20675 * cs-parser.jay (foreach): Catch errors on variables already
20676 defined (we were ignoring this value before) and properly unwind
20677 the block hierarchy
20679 (fixed_statement): grammar for the fixed statement.
20681 2002-01-25 Miguel de Icaza <miguel@ximian.com>
20683 * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20684 pointer types to be incretemented.
20686 (SizeOf): Implement.
20688 * cs-parser.jay (pointer_member_access): Implement
20689 expr->IDENTIFIER production.
20691 * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20692 MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20695 (Unary): Implement indirection.
20697 * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20698 use in non-unsafe context).
20700 (SimpleName.DoResolve): Check for pointers in field access on safe
20703 (Expression.LoadFromPtr): Factor the load-indirect code in this
20704 function. This was duplicated in UnboxCast and ParameterReference
20706 2002-01-24 Miguel de Icaza <miguel@ximian.com>
20708 * expression.cs (ComposedCast): report an error if a pointer cast
20709 is used in a safe region.
20711 * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20712 pointer type casts in unsafe context.
20714 * codegen.cs (EmitContext): Set up IsUnsafe.
20716 * cs-parser.jay (non_expression_type): Add productions for pointer
20719 * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20720 code. We should not use force into static mode if the method is
20721 not virtual. Fixes bug in MIS
20723 * statement.cs (Do.Emit, While.Emit, For.Emit,
20724 Statement.EmitBoolExpression): Add support to Do and While to
20725 propagate infinite loop as `I do return' semantics.
20727 Improve the For case to also test for boolean constants.
20729 * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20730 to the list of attributes we can add.
20732 Remove `EmitContext' argument.
20734 * class.cs (Method.Define): Apply parameter attributes.
20735 (Constructor.Define): Apply parameter attributes.
20736 (MethodCore.LabelParameters): Move here the core of labeling
20739 * support.cs (ReflectionParameters.ParameterModifier,
20740 InternalParameters.ParameterModifier): Use IsByRef on the type and
20741 only return the OUT bit for these parameters instead of in/out/ref
20744 This is because I miss-understood things. The ParameterInfo.IsIn
20745 and IsOut represent whether the parameter has the [In] and [Out]
20748 2002-01-22 Miguel de Icaza <miguel@ximian.com>
20750 * ecore.cs (FieldExpr.Emit): Release temporaries.
20752 * assign.cs (LocalTemporary.Release): new function.
20754 * codegen.cs (EmitContext.GetTemporaryStorage,
20755 EmitContext.FreeTemporaryStorage): Rework the way we deal with
20756 temporary storage. Now we can "put back" localbuilders when we
20759 2002-01-21 Miguel de Icaza <miguel@ximian.com>
20761 * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20762 need to make a copy of the variable to generate verifiable code.
20764 2002-01-19 Miguel de Icaza <miguel@ximian.com>
20766 * driver.cs: Compute dynamically the system directory.
20768 * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20769 Slower, but more generally useful. Used by the abstract
20770 registering implementation.
20772 * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20773 the rules for the special rule on Type/instances. First check if
20774 we have the same name, and if so, try that special static path
20775 rather than the instance path.
20777 2002-01-18 Miguel de Icaza <miguel@ximian.com>
20779 * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20782 * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20783 Enum, ValueType, Delegate or Array for non-corlib compiles.
20785 * cs-tokenizer.cs: Catch long identifiers (645)
20787 * typemanager.cs (IndexerPropetyName): Ravi never tested this
20790 * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20791 fix, we were returning too early, so we were not registering
20792 pending methods from abstract classes.
20794 Do not register pending methods if the class is abstract.
20796 * expression.cs (Conditional.DoResolve): Report circular implicit
20797 conversions when we neecd to compute it for conditional
20800 (Is.DoResolve): If the expression is always of the provided type,
20801 flag warning 183. If the expression can not ever be of the
20802 provided type flag warning 184.
20804 * class.cs: Catch 169 as well.
20806 * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20809 2002-01-18 Nick Drochak <ndrochak@gol.com>
20811 * makefile: remove path to beta2 csc.exe. path to csc.exe must be in PATH instead.
20813 2002-01-17 Miguel de Icaza <miguel@ximian.com>
20815 * interface.cs: (PopulateMethod): Check for pointers being defined
20816 only if the unsafe context is active.
20817 (PopulateProperty): ditto.
20818 (PopulateIndexer): ditto.
20820 * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20821 specified. If pointers are present, make sure that they are
20822 present in an unsafe context.
20823 (Constructor, Constructor.Define): ditto.
20824 (Field, Field.Define): ditto.
20825 (Property, Property.Define): ditto.
20826 (Event, Event.Define): ditto.
20828 * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
20829 hashtable if there are classes or structs defined.
20831 * expression.cs (LocalVariableReference.DoResolve): Simplify this
20832 code, as the constant resolution moved.
20834 * statement.cs (Block.EmitMeta): Resolve all constants as we emit
20835 the metadata, so we can flag error 133.
20837 * decl.cs (MemberCore.UnsafeOK): New function to test that a
20838 pointer is being declared in an unsafe context.
20840 2002-01-16 Miguel de Icaza <miguel@ximian.com>
20842 * modifiers.cs (Modifiers.Check): Require a Location argument.
20843 Report error 227 for Unsafe use.
20845 * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
20847 * statement.cs (For.Emit): If the test is null, then report that
20848 we do `return', as we wont reach anything afterwards.
20850 (Switch.SwitchGoverningType): Track the expression that matched
20853 * driver.cs: Allow negative numbers as an error code to flag.
20855 * cs-parser.jay: Handle 1551.
20857 * namespace.cs: Add 1537 checking (repeated using alias namespaces).
20859 2002-01-15 Miguel de Icaza <miguel@ximian.com>
20861 * cs-parser.jay: Report 1518 (type declaration can only contain
20862 class, struct, interface, enum or delegate)
20864 (switch_label): Report 1523 (keywords `case' or `default' must
20867 (opt_switch_sections): Report 1522 (empty switch)
20869 * driver.cs: Report 1515 (response file specified multiple times)
20870 Report 1516 (Source file specified multiple times).
20872 * expression.cs (Argument.Resolve): Signal 1510
20874 (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20875 access not allowed in static code)
20877 2002-01-11 Ravi Pratap <ravi@ximian.com>
20879 * typemanager.cs (IsPointerType): Utility method which we are going
20882 * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20883 the object type, so we take care of that.
20885 * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20887 * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20888 added to non-params parameters :-)
20890 * typemanager.cs (CSharpName): Include 'void' type too.
20892 (void_ptr_type): Include in the set of core types.
20894 * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of
20897 (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have
20900 * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had
20901 completely forgotten about it.
20903 2002-01-10 Ravi Pratap <ravi@ximian.com>
20905 * cs-parser.jay (pointer_type): Add. This begins our implementation
20906 of parsing rules for unsafe code.
20908 (unsafe_statement): Implement.
20910 (embedded_statement): Modify to include the above.
20912 * statement.cs (Unsafe): Implement new class for unsafe blocks.
20914 * codegen.cs (EmitContext.InUnsafe): Add. This determines
20915 if the current context is an unsafe one.
20917 * cs-parser.jay (local_variable_pointer_type): Since local variable types
20918 are handled differently, we need separate rules for them.
20920 (local_variable_declaration): Update to use local_variable_pointer_type
20921 to allow variable declarations of unmanaged pointer types.
20923 * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20924 in unsafe contexts.
20926 * ../errors/cs0214.cs : Add.
20928 2002-01-16 Nick Drochak <ndrochak@gol.com>
20930 * makefile: remove 'response' file when cleaning.
20932 2002-01-15 Miguel de Icaza <miguel@ximian.com>
20934 * cs-parser.jay: Report 1524.
20936 2002-01-14 Miguel de Icaza <miguel@ximian.com>
20938 * typemanager.cs (RegisterMethod): drop checking if we have
20939 registered this from here
20941 2002-01-12 Miguel de Icaza <miguel@ximian.com>
20943 * class.cs (Method.EmitDestructor): Implement calling our base
20946 * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20947 value of InFinally.
20949 * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20950 this routine and will wrap the call in a try/catch block. Deal
20953 2002-01-11 Miguel de Icaza <miguel@ximian.com>
20955 * ecore.cs (Expression.MemberLookup): instead of taking a
20956 parameter `same_type' that was used to tell whether we could
20957 access private members we compute our containing type from the
20960 (FieldExpr): Added partial support for volatile fields. This does
20961 not work for volatile fields exposed from assemblies, as I can not
20962 figure out how to extract the modreq from it.
20964 Updated all the source files to use this.
20966 * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20967 because it is referenced by MemberLookup very often.
20969 2002-01-09 Ravi Pratap <ravi@ximian.com>
20971 * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20972 TypeBuilder.GetCustomAttributes to retrieve what we need.
20974 Get rid of redundant default_member_attr_type as this is the same as
20975 default_member_type which already exists.
20977 * interface.cs, attribute.cs : Update accordingly.
20979 2002-01-08 Miguel de Icaza <miguel@ximian.com>
20981 * typemanager.cs: Enable IndexerPropertyName again. It does not
20982 work for TYpeBuilders though. Ravi, can you please fix this?
20984 * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20986 * expression.cs (Argument.Emit): Handle the case of ref objects
20987 being passed to ref functions;
20989 (ParameterReference.EmitLoad): Loads the content of the pointer
20990 without dereferencing.
20992 2002-01-07 Miguel de Icaza <miguel@ximian.com>
20994 * cs-tokenizer.cs: Implemented the pre-processing expressions.
20996 2002-01-08 Ravi Pratap <ravi@ximian.com>
20998 * class.cs (Indexer.DefineMethod): Incorporate the interface
20999 type in the name of the method if we are doing explicit interface
21002 * expression.cs (ConversionExists): Remove as it is completely obsolete.
21004 (BetterConversion): Fix extremely trivial bug where we were referring to
21005 ConversionExists instead of StandardConversionExists ! Hooray, things are fine
21008 * ../errors/bug16.cs : Add although we have fixed it.
21010 2002-01-07 Miguel de Icaza <miguel@ximian.com>
21012 * expression.cs (BaseIndexer): Begin implementation.
21014 * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
21016 * cs-parser.jay (indexer_declarator): Use qualified_identifier
21017 production directly to remove a shift/reduce, and implement
21018 explicit interface implementation.
21020 * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
21021 after a floating point suffix.
21023 * expression.cs (DoNumericPromotions): Improved the conversion for
21024 uint/uint. If we have a constant, we avoid doing a typecast to a
21027 * class.cs (Indexer): Implement explicit interface implementation
21030 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
21032 * class.cs: make the default instance constructor public and hidebysig.
21034 2001-01-03 Ravi Pratap <ravi@ximian.com>
21036 * interface.cs (EmitDefaultMemberAttr): Make this helper method static
21037 so we can call it from elsewhere.
21039 * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
21040 we emit it internally if the class has a defined indexer; otherwise the user
21041 emits it by decorating the class definition with the DefaultMemberAttribute.
21043 * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
21044 attribute is not used on a type which defines an indexer.
21046 * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
21047 character when we skip whitespace.
21049 * ../errors/cs0646.cs : Add.
21051 2002-01-03 Miguel de Icaza <miguel@ximian.com>
21053 * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
21056 * makefile: Add practical target `mcs3.exe' which builds the third
21057 generation compiler.
21059 * expression.cs (New): Fix structures constructor calling.
21061 * class.cs (Property, Method, Indexer): Emit Final flag on the
21062 method if we are an interface implementation and we are not
21065 * ecore.cs (PropertyExpr): New public field `IsBase', tells
21066 whether this property is referencing a `base' method.
21068 * expression.cs (Invocation.EmitCall): take an extra argument:
21069 is_base, this is used to determine whether the `call' or
21070 `callvirt' opcode should be used.
21073 * delegate.cs: update EmitCall.
21075 * class.cs (Method.Define): Set NewSlot for the cases where we are
21076 not implementing an interface method.
21078 (Property.Define): ditto.
21080 2002-01-02 Miguel de Icaza <miguel@ximian.com>
21082 * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
21083 'r'. Allows mcs to parse itself fully.
21085 2002-01-02 Ravi Pratap <ravi@ximian.com>
21087 * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
21088 of the number of initializers that require the InitializeArray method.
21090 (CheckIndices): Store the Expression in all cases - not the plain value. Also
21091 update the above field where necessary.
21093 (MakeByteBlob): Update accordingly.
21095 (DoEmit): Call EmitStaticInitializers only if the number of initializers is
21098 (EmitDynamicInitializers): Update in accordance with the new optimization.
21100 (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
21101 same OpCode applies.
21103 * cs-parser.jay : Fix some glaring errors I introduced.
21105 2002-01-01 Ravi Pratap <ravi@ximian.com>
21107 * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
21108 so that we can check for name clashes there too.
21110 * typemanager.cs (default_member_attr_type): The attribute that we need to emit
21111 for interface indexers.
21113 * interfaces.cs (Define): Emit the default member attribute.
21115 * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
21116 variable was being referred to while setting the value ;-)
21118 2002-01-01 Miguel de Icaza <miguel@ximian.com>
21120 * expression.cs (MakeByteBlob): Optimize: we do not need to fill
21121 byte-by-byte information when we know the data is zero.
21123 Make the block always a multiple of 4, because
21124 DefineInitializedData has a bug.
21126 * assign.cs: Fix, we should assign from the temporary, not from
21129 * expression.cs (MakeByteBlob): Fix my incorrect code.
21131 2001-12-31 Miguel de Icaza <miguel@ximian.com>
21133 * typemanager.cs (EnumToUnderlying): This function is used to get
21134 the underlying type from an enumeration, because it does not
21137 * constant.cs: Use the I4_S form for values between -128 and 127.
21139 * statement.cs (Block.LookupLabel): Looks up a label.
21140 (Block): Drop support for labeled blocks.
21142 (LabeledStatement): New kind of statement that represents a label
21145 (Goto): Finally implement this bad boy.
21147 * cs-parser.jay: Update to reflect new mechanism to implement
21150 2001-12-30 Miguel de Icaza <miguel@ximian.com>
21152 * codegen.cs (EmitContext.This): a codegen property that keeps the
21153 a single instance of this instead of creating many different this
21156 * delegate.cs (Delegate.DoResolve): Update to use the property;
21158 * ecore.cs (SimpleName.SimpleNameResolve): Ditto
21160 * expression.cs (BaseAccess.DoResolve): Ditto.
21162 2001-12-29 Ravi Pratap <ravi@ximian.com>
21164 * typemanager.cs (methodimpl_attr_type): Add to hold the type
21165 corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
21167 (InitCoreTypes): Update accordingly.
21169 * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
21170 so we can quickly store the state.
21172 (ApplyAttributes): Set the correct implementation flags
21173 for InternalCall methods.
21175 2001-12-29 Miguel de Icaza <miguel@ximian.com>
21177 * expression.cs (EmitCall): if a method is not virtual, then do
21178 not use callvirt on it.
21180 (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
21181 user defined stuff) requires the use of stobj, which takes an
21182 address on the stack instead of an array and an index. So emit
21183 the Ldelema operation for it.
21185 (EmitStoreOpcode): Use stobj for valuetypes.
21187 (UnaryMutator.EmitCode): Use the right 1 value depending on
21188 whether we are dealing with int64/uint64, float or doubles.
21190 * class.cs (TypeContainer.AddConstructor): Fix the logic to define
21191 constructors that I implemented last night.
21193 (Constructor.IsDefault): Fix to work properly for static
21196 * cs-parser.jay (CheckDef): report method signature errors.
21197 Update error number 103 to be 132.
21199 * decl.cs: New AdditionResult enumeration value: MethodExists.
21200 Although we do this check for methods later on in the semantic
21201 analysis, catching repeated default constructors is so easy that
21202 we catch these here.
21204 * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
21207 (ParameterReference.EmitAssign, Emit): handle
21210 (ArrayAccess.EmitLoadOpcode): Handle bool type here.
21211 (ArrayAccess.EmitStoreOpcode): ditto.
21213 * cs-tokenizer.cs (is_punct): Eliminated empty computation.
21215 * expression.cs (MakeByteBlob): Complete all the missing types
21216 (uint, short, ushort, byte, sbyte)
21218 * class.cs: Only init instance field initializers on instance
21221 Rename `constructors' to instance_constructors.
21223 (TypeContainer.AddConstructor): Only add constructors to the list
21224 if it is not static.
21226 Make sure that we handle default_static_constructor independently
21227 everywhere where we handle instance_constructors
21229 2001-12-28 Miguel de Icaza <miguel@ximian.com>
21231 * class.cs: Do not lookup or create a base initializer for a
21232 static constructor.
21234 (ConstructorInitializer.Resolve): use the proper type to lookup
21237 * cs-parser.jay: Report error 1585 (modifiers between type and name).
21239 * enum.cs, interface.cs: Remove CloseType, this is taken care by
21242 * decl.cs: CloseType is now an virtual method, the default
21243 implementation just closes this type.
21245 2001-12-28 Ravi Pratap <ravi@ximian.com>
21247 * attribute.cs (DefinePInvokeMethod): Set the implementation flags
21248 to PreserveSig by default. Also emit HideBySig on such methods.
21250 Basically, set the defaults to standard values.
21252 * expression.cs (Invocation.BetterFunction): We need to make sure that for each
21253 argument, if candidate is better, it can't be worse than the best !
21255 (Invocation): Re-write bits to differentiate between methods being
21256 applicable in their expanded form and their normal form - for params
21259 Get rid of use_standard everywhere as only standard conversions are allowed
21260 in overload resolution.
21262 More spec conformance.
21264 2001-12-27 Miguel de Icaza <miguel@ximian.com>
21266 * driver.cs: Add --timestamp, to see where the compiler spends
21269 * ecore.cs (SimpleName.DoResolve): Do not create an implicit
21270 `this' in static code.
21272 (SimpleName.DoResolve): Implement in terms of a helper function
21273 that allows static-references to be passed upstream to
21276 (Expression.ResolveWithSimpleName): Resolve specially simple
21277 names when called by MemberAccess to implement the special
21280 (Expression.ImplicitReferenceConversion): Handle conversions from
21281 Null to reference types before others, as Null's type is
21284 * expression.cs (Invocation.EmitCall): Handle the special case of
21285 calling methods declared on a reference type from a ValueType
21286 (Base classes System.Object and System.Enum)
21288 (MemberAccess.Resolve): Only perform lookups on Enumerations if
21289 the left hand side is a TypeExpr, not on every enumeration.
21291 (Binary.Resolve): If types are reference types, then do a cast to
21292 object on operators != and == of both arguments.
21294 * typemanager.cs (FindMembers): Extract instance and static
21295 members if requested.
21297 * interface.cs (PopulateProperty): Use void_type instead of null
21298 as the return type for the setter method.
21300 (PopulateIndexer): ditto.
21302 2001-12-27 Ravi Pratap <ravi@ximian.com>
21304 * support.cs (ReflectionParameters): Fix minor bug where we
21305 were examining the wrong parameter for the ParamArray attribute.
21307 Cope with requests for the type of the parameter at position
21308 greater than the params parameter's. We now return the element
21309 type of the params array as that makes more sense.
21311 * expression.cs (Invocation.IsParamsMethodApplicable): Update
21312 accordingly as we no longer have to extract the element type
21315 (Invocation.OverloadResolve): Update.
21317 2001-12-27 Miguel de Icaza <miguel@ximian.com>
21319 * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
21320 against IEnumerator, test whether the return value is a descendant
21321 of the IEnumerator interface.
21323 * class.cs (Indexer.Define): Use an auxiliary method to implement
21324 the other bits of the method definition. Begin support for
21325 explicit interface implementation.
21327 (Property.DefineMethod): Use TypeManager.void_type instead of null
21328 for an empty return value.
21330 2001-12-26 Miguel de Icaza <miguel@ximian.com>
21332 * expression.cs (MemberAccess.ResolveMemberAccess): if we are
21333 dealing with a FieldExpr which is composed of a FieldBuilder, in
21334 the code path we did extract the constant, but we should have
21335 obtained the underlying value to be able to cast it (otherwise we
21336 end up in an infinite loop, this is what Ravi was running into).
21338 (ArrayCreation.UpdateIndices): Arrays might be empty.
21340 (MemberAccess.ResolveMemberAccess): Add support for section
21341 14.5.4.1 that deals with the special case of E.I when E is a type
21342 and something else, that I can be a reference to a static member.
21344 (ArrayCreation.MakeByteBlob): It is not an error to not be able to
21345 handle a particular array type to create byte blobs, it is just
21346 something we dont generate byteblobs for.
21348 * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
21351 * location.cs (Push): remove the key from the hashtable that we
21352 are about to add. This happens for empty files.
21354 * driver.cs: Dispose files after we have parsed them.
21356 (tokenize): new function that only runs the tokenizer on its
21357 input, for speed testing.
21359 2001-12-26 Ravi Pratap <ravi@ximian.com>
21361 * class.cs (Event.Define): Define the private field only if there
21362 are no accessors defined.
21364 * expression.cs (ResolveMemberAccess): If there is no associated
21365 field with the event, that means we have an event defined with its
21366 own accessors and we should flag error cs0070 since transforming
21367 ourselves into a field is not valid in that case.
21369 * ecore.cs (SimpleName.DoResolve): Same as above.
21371 * attribute.cs (DefinePInvokeMethod): Set the default calling convention
21372 and charset to sane values.
21374 2001-12-25 Ravi Pratap <ravi@ximian.com>
21376 * assign.cs (DoResolve): Perform check on events only if they
21377 are being accessed outside the declaring type.
21379 * cs-parser.jay (event_declarations): Update rules to correctly
21380 set the type of the implicit parameter etc.
21382 (add_accessor, remove_accessor): Set current local parameters.
21384 * expression.cs (Binary): For delegate addition and subtraction,
21385 cast the return value from the method into the appropriate delegate
21388 2001-12-24 Ravi Pratap <ravi@ximian.com>
21390 * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
21391 of these as the workaround is unnecessary.
21393 * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
21394 delegate data - none of that is needed at all.
21396 Re-write bits to extract the instance expression and the delegate method
21399 * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator
21402 * attribute.cs (ApplyAttributes): New method to take care of common tasks
21403 of attaching attributes instead of duplicating code everywhere.
21405 * everywhere : Update code to do attribute emission using the above method.
21407 2001-12-23 Miguel de Icaza <miguel@ximian.com>
21409 * expression.cs (IsParamsMethodApplicable): if there are not
21410 parameters, return immediately.
21412 * ecore.cs: The 0 literal can be implicity converted to an enum
21415 (SimpleName.DoResolve): First lookup the type, then lookup the
21418 (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
21419 want to get its address. If the InstanceExpression is not
21420 addressable, store the result in a temporary variable, then get
21423 * codegen.cs: Only display 219 errors on warning level or above.
21425 * expression.cs (ArrayAccess): Make it implement the
21426 IMemoryLocation interface.
21428 (Binary.DoResolve): handle the operator == (object a, object b)
21429 and operator != (object a, object b) without incurring into a
21430 BoxedCast (because 5 != o should never be performed).
21432 Handle binary enumerator operators.
21434 (EmitLoadOpcode): Use Ldelema if the object we are loading is a
21435 value type, otherwise use Ldelem_ref.
21437 Use precomputed names;
21439 (AddressOf): Implement address of
21441 * cs-parser.jay (labeled_statement): Fix recursive block
21442 addition by reworking the production.
21444 * expression.cs (New.DoEmit): New has a special case:
21446 If we are dealing with a ValueType, we have a few
21447 situations to deal with:
21449 * The target of New is a ValueType variable, that is
21450 easy, we just pass this as the variable reference
21452 * The target of New is being passed as an argument,
21453 to a boxing operation or a function that takes a
21456 In this case, we need to create a temporary variable
21457 that is the argument of New.
21460 2001-12-23 Ravi Pratap <ravi@ximian.com>
21462 * rootcontext.cs (LookupType): Check that current_type is not null before
21463 going about looking at nested types.
21465 * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
21466 not implement the IAssignMethod interface any more.
21468 * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
21469 where we tranform them into FieldExprs if they are being resolved from within
21470 the declaring type.
21472 * ecore.cs (SimpleName.DoResolve): Do the same here.
21474 * assign.cs (DoResolve, Emit): Clean up code considerably.
21476 * ../errors/bug10.cs : Add.
21478 * ../errors/cs0070.cs : Add.
21480 * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
21482 * assign.cs : Get rid of EventIsLocal everywhere.
21484 2001-12-23 Miguel de Icaza <miguel@ximian.com>
21486 * ecore.cs (ConvertIntLiteral): finished the implementation.
21488 * statement.cs (SwitchLabel): Convert the value we are using as a
21489 key before looking up the table.
21491 2001-12-22 Miguel de Icaza <miguel@ximian.com>
21493 * codegen.cs (EmitTopBlock): Require a Location argument now.
21495 * cs-parser.jay (constructor_declarator): We need to setup
21496 current_local_parameters before we parse the
21497 opt_constructor_initializer, to allow the variables to be bound
21498 to the constructor arguments.
21500 * rootcontext.cs (LookupType): First lookup nested classes in our
21501 class and our parents before we go looking outside our class.
21503 * expression.cs (ConstantFold): Extract/debox the values at the
21506 * rootcontext.cs (EmitCode): Resolve the constants first before we
21507 resolve the types. This is not really needed, but it helps debugging.
21509 * statement.cs: report location.
21511 * cs-parser.jay: pass location to throw statement.
21513 * driver.cs: Small bug fix.
21515 * report.cs: Updated format to be 4-zero filled digits.
21517 2001-12-22 Ravi Pratap <ravi@ximian.com>
21519 * expression.cs (CheckIndices): Fix minor bug where the wrong
21520 variable was being referred to ;-)
21522 (DoEmit): Do not call EmitStaticInitializers when the
21523 underlying type is System.Object.
21525 2001-12-21 Ravi Pratap <ravi@ximian.com>
21527 * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
21528 and do the usual workaround for SRE.
21530 * class.cs (MyEventBuilder.EventType): New member to get at the type
21531 of the event, quickly.
21533 * expression.cs (Binary.ResolveOperator): Handle delegate addition.
21535 * assign.cs (Assign.DoResolve): Handle the case when the target
21536 is an EventExpr and perform the necessary checks.
21538 * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
21541 (SimpleName.MemberStaticCheck): Include check for EventExpr.
21543 (EventExpr): Set the type in the constructor itself since we
21544 are meant to be born fully resolved.
21546 (EventExpr.Define): Revert code I wrote earlier.
21548 * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
21549 instance expression is null. The instance expression is a This in that case
21550 or a null, depending on whether it is a static method or not.
21552 Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
21553 refers to more than one method.
21555 * assign.cs (DoResolve): Check whether the event belongs to the same Type container
21556 and accordingly flag errors.
21558 2001-12-21 Miguel de Icaza <miguel@ximian.com>
21560 * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
21562 2001-12-22 Miguel de Icaza <miguel@ximian.com>
21564 * location.cs (ToString): Provide useful rutine.
21566 2001-12-21 Miguel de Icaza <miguel@ximian.com>
21568 * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21569 objects, return the actual integral boxed.
21571 * statement.cs (SwitchLabel): define an ILLabel for each
21574 (Switch.CheckSwitch): If the value is a Literal, extract
21575 the underlying literal.
21577 Also in the unused hashtable we had, add the SwitchLabel so we can
21578 quickly look this value up.
21580 * constant.cs: Implement a bunch of new constants. Rewrite
21581 Literal based on this. Made changes everywhere to adapt to this.
21583 * expression.cs (Expression.MakeByteBlob): Optimize routine by
21584 dereferencing array only once, and also copes with enumrations.
21586 bytes are two bytes wide, not one.
21588 (Cast): Perform constant conversions.
21590 * ecore.cs (TryImplicitIntConversion): Return literals instead of
21591 wrappers to the literals here.
21593 * expression.cs (DoNumericPromotions): long literals can converted
21594 to ulong implicity (this is taken care of elsewhere, but I was
21595 missing this spot).
21597 * ecore.cs (Expression.Literalize): Make the return type Literal,
21598 to improve type checking.
21600 * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21602 2001-12-20 Miguel de Icaza <miguel@ximian.com>
21604 * literal.cs: Revert code from ravi that checked the bounds. The
21605 bounds are sane by the definition of the type itself.
21607 * typemanager.cs: Fix implementation of ImplementsInterface. We
21608 need to actually look up in our parent hierarchy for interfaces
21611 * const.cs: Use the underlying type for enumerations
21613 * delegate.cs: Compute the basename for the delegate creation,
21614 that should fix the delegate test case, and restore the correct
21615 Type Lookup semantics in rootcontext
21617 * rootcontext.cs: Revert Ravi's last patch. The correct way of
21618 referencing a nested type with the Reflection API is using the "+"
21621 * cs-parser.jay: Do not require EOF token at the end.
21623 2001-12-20 Ravi Pratap <ravi@ximian.com>
21625 * rootcontext.cs (LookupType): Concatenate type names with
21626 a '.' instead of a '+' The test suite passes again.
21628 * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21629 field of the enumeration.
21631 * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21632 the case when the member is an EventExpr.
21634 * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21635 static has an associated instance expression.
21637 * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21639 (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21641 * class.cs (Event.Define): Register event and perform appropriate checks
21644 We define the Add and Remove methods even if the use provides none because
21645 in that case, we provide default implementations ourselves.
21647 Define a private field of the type of the event. This is done by the CSC compiler
21648 and we should be doing it too ;-)
21650 * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
21651 More methods we use in code we generate.
21653 (multicast_delegate_type, delegate_type): Two separate types since the distinction
21656 (InitCoreTypes): Update accordingly for the above.
21658 * class.cs (Event.Emit): Generate code for default accessors that we provide
21660 (EmitDefaultMethod): Do the job in the above.
21662 * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the
21665 2001-12-20 Miguel de Icaza <miguel@ximian.com>
21667 * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
21668 builders even if we were missing one.
21670 * interface.cs, class.cs, enum.cs: When calling DefineNestedType
21671 pass the Basename as our class name instead of the Name. The
21672 basename will be correctly composed for us.
21674 * parameter.cs (Paramters): Now takes a Location argument.
21676 * decl.cs (DeclSpace.LookupType): Removed convenience function and
21677 make all the code call directly LookupType in RootContext and take
21678 this chance to pass the Location information everywhere.
21680 * Everywhere: pass Location information.
21682 2001-12-19 Miguel de Icaza <miguel@ximian.com>
21684 * class.cs (Constructor.Define): Updated way of detecting the
21685 length of the parameters.
21687 (TypeContainer.DefineType): Use basename as the type name for
21690 (TypeContainer.Define): Do not recursively define types here, as
21691 definition is taken care in order by the RootContext.
21693 * tree.cs: Keep track of namespaces in a per-file basis.
21695 * parameter.cs (Parameter.ComputeSignature): Update to use
21698 (Parameters.GetSignature): ditto.
21700 * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21701 instead of a TypeContainer.
21703 (Interface.SemanticAnalysis): Use `this' instead of our parent to
21704 resolve names. Because we need to be resolve in our context, not
21707 * driver.cs: Implement response files.
21709 * class.cs (TypeContainer.DefineType): If we are defined, do not
21710 redefine ourselves.
21712 (Event.Emit): Emit the code for add/remove handlers.
21713 (Event.Define): Save the MethodBuilders for add/remove.
21715 * typemanager.cs: Use pair here too.
21717 * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21718 DictionaryEntry requires the first argument to be non-null.
21720 (enum_declaration): Compute full name for registering the
21723 (delegate_declaration): Instead of using
21724 formal_parameter_list, use opt_formal_parameter_list as the list
21727 * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21728 (EventParsing): New property that controls whether `add' and
21729 `remove' are returned as tokens or identifiers (for events);
21731 2001-12-19 Ravi Pratap <ravi@ximian.com>
21733 * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21734 use MyEventBuilder only and let it wrap the real builder for us.
21736 (MyEventBuilder): Revamp constructor etc.
21738 Implement all operations that we perform on EventBuilder in precisely the same
21741 (FindMembers): Update to use the EventBuilder member.
21743 (Event.Emit): Update accordingly.
21745 2001-12-18 Ravi Pratap <ravi@ximian.com>
21747 * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21748 by calling the appropriate methods.
21750 (GetCustomAttributes): Make stubs as they cannot possibly do anything
21753 (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21755 2001-12-17 Ravi Pratap <ravi@ximian.com>
21757 * delegate.cs (Delegate.Populate): Check that the return type
21758 and various parameters types are indeed accessible.
21760 * class.cs (Constructor.Define): Same here.
21762 (Field.Define): Ditto.
21764 (Event.Define): Ditto.
21766 (Operator.Define): Check that the underlying Method defined itself
21767 correctly - so it's MethodBuilder should not be null.
21769 * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21770 expression happens to be null.
21772 * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21773 members but as of now we don't seem to be able to do anything really useful with it.
21775 (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21776 not the EventBuilder.
21778 2001-12-18 Miguel de Icaza <miguel@ximian.com>
21780 * cs-tokenizer.cs: Add support for defines.
21781 Add support for #if, #elif, #else, #endif
21783 (eval_var): evaluates a variable.
21784 (eval): stubbed for evaluating functions.
21786 * cs-parser.jay: Pass the defines information
21788 * driver.cs: Add --define command line option.
21790 * decl.cs: Move MemberCore here.
21792 Make it the base class for DeclSpace. This allows us to catch and
21793 report 108 and 109 for everything now.
21795 * class.cs (TypeContainer.Define): Extract all the members
21796 before populating and emit the warning 108 (new keyword required
21797 to override) instead of having each member implement this.
21799 (MemberCore.Define): New abstract method, we will be using this in
21800 the warning reporting engine in Populate.
21802 (Operator.Define): Adjust to new MemberCore protocol.
21804 * const.cs (Const): This does not derive from Expression, it is a
21805 temporary object we use to create fields, it is a MemberCore.
21807 * class.cs (Method.Define): Allow the entry point to be in a
21810 * driver.cs: Rewrite the argument handler to clean it up a bit.
21812 * rootcontext.cs: Made it just an auxiliary namespace feature by
21813 making everything static.
21815 * driver.cs: Adapt code to use RootContext type name instead of
21818 * delegate.cs: Remove RootContext argument.
21820 * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21823 * class.cs (Event.Define): The lookup can fail.
21825 * cs-tokenizer.cs: Begin implementation of pre-procesor.
21827 * expression.cs: Resolve the this instance before invoking the code.
21829 2001-12-17 Miguel de Icaza <miguel@ximian.com>
21831 * cs-parser.jay: Add a production in element_access that allows
21832 the thing to become a "type" reference. This way we can parse
21833 things like "(string [])" as a type.
21835 Note that this still does not handle the more complex rules of
21839 * delegate.cs (Delegate.Populate): Register the delegage constructor builder here.
21841 * ecore.cs: (CopyNewMethods): new utility function used to
21842 assemble the list of methods from running FindMembers.
21844 (MemberLookup): Rework FindMembers so that
21846 2001-12-16 Miguel de Icaza <miguel@ximian.com>
21848 * class.cs (TypeContainer): Remove Delegates who fail to be
21851 * delegate.cs (Populate): Verify that we dont get null return
21852 values. TODO: Check for AsAccessible.
21854 * cs-parser.jay: Use basename to emit error 574 (destructor should
21855 have the same name as container class), not the full name.
21857 * cs-tokenizer.cs (adjust_int): Fit the integer in the best
21858 possible representation.
21860 Also implements integer type suffixes U and L.
21862 2001-12-15 Miguel de Icaza <miguel@ximian.com>
21864 * expression.cs (ArrayCreation.DoResolve): We need to do the
21865 argument resolution *always*.
21867 * decl.cs: Make this hold the namespace. Hold the root context as
21869 (LookupType): Move here.
21871 * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21873 * location.cs (Row, Name): Fixed the code, it was always returning
21874 references to the first file.
21876 * interface.cs: Register properties defined through interfaces.
21878 * driver.cs: Add support for globbing on the command line
21880 * class.cs (Field): Make it derive from MemberCore as well.
21883 2001-12-15 Ravi Pratap <ravi@ximian.com>
21885 * class.cs (Event::Define): Check that the type of the event is a delegate
21886 type else flag error #66.
21888 Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21891 * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21892 values of EntryPoint, CharSet etc etc.
21894 Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21896 * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21897 be null and we should ignore this. I am not sure if this is really clean. Apparently,
21898 there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21899 which needs this to do its work.
21901 * ../errors/cs0066.cs : Add.
21903 2001-12-14 Miguel de Icaza <miguel@ximian.com>
21905 * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21908 * class.cs: (MethodSignature.MethodSignature): Removed hack that
21909 clears out the parameters field.
21910 (MemberSignatureCompare): Cleanup
21912 (MemberCore): New base class used to share code between MethodCore
21915 (RegisterRequiredImplementations) BindingFlags.Public requires
21916 either BindingFlags.Instace or Static. Use instance here.
21918 (Property): Refactored code to cope better with the full spec.
21920 * parameter.cs (GetParameterInfo): Return an empty array instead
21923 * class.cs (Property): Abstract or extern properties have no bodies.
21925 * parameter.cs (GetParameterInfo): return a zero-sized array.
21927 * class.cs (TypeContainer.MethodModifiersValid): Move all the
21928 method modifier validation to the typecontainer so we can reuse
21929 this on properties.
21931 (MethodCore.ParameterTypes): return an empty sized array of types.
21933 (Property.Define): Test property modifier validity.
21935 Add tests for sealed/override too.
21937 (Method.Emit): abstract or extern methods have no bodies.
21939 2001-12-14 Ravi Pratap <ravi@ximian.com>
21941 * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21944 (Method::Define, ::Emit): Modify accordingly.
21946 * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21948 (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21950 * makefile: Pass in /unsafe.
21952 2001-12-13 Miguel de Icaza <miguel@ximian.com>
21954 * class.cs (MakeKey): Kill routine.
21956 * class.cs (TypeContainer.Define): Correctly define explicit
21957 method implementations (they require the full interface name plus
21960 * typemanager.cs: Deply the PtrHashtable here and stop using the
21961 lame keys. Things work so much better.
21963 This of course broke everyone who depended on `RegisterMethod' to
21964 do the `test for existance' test. This has to be done elsewhere.
21966 * support.cs (PtrHashtable): A hashtable that avoid comparing with
21967 the object stupid Equals method (because, that like fails all over
21968 the place). We still do not use it.
21970 * class.cs (TypeContainer.SetRequiredInterface,
21971 TypeContainer.RequireMethods): Killed these two routines and moved
21972 all the functionality to RegisterRequiredImplementations.
21974 (TypeContainer.RegisterRequiredImplementations): This routine now
21975 registers all the implementations required in an array for the
21976 interfaces and abstract methods. We use an array of structures
21977 which can be computed ahead of time to reduce memory usage and we
21978 also assume that lookups are cheap as most classes will not
21979 implement too many interfaces.
21981 We also avoid creating too many MethodSignatures.
21983 (TypeContainer.IsInterfaceMethod): Update and optionally does not
21984 clear the "pending" bit if we find that there are problems with
21987 (TypeContainer.VerifyPendingMethods): Update to report errors of
21988 methods that look like implementations but are not.
21990 (TypeContainer.Define): Add support for explicit interface method
21993 2001-12-12 Miguel de Icaza <miguel@ximian.com>
21995 * typemanager.cs: Keep track of the parameters here instead of
21996 being a feature of the TypeContainer.
21998 * class.cs: Drop the registration of parameters here, as
21999 InterfaceMethods are also interface declarations.
22001 * delegate.cs: Register methods with the TypeManager not only with
22002 the TypeContainer. This code was buggy.
22004 * interface.cs: Full registation here.
22006 2001-12-11 Miguel de Icaza <miguel@ximian.com>
22008 * expression.cs: Remove reducer for binary expressions, it can not
22011 * const.cs: Put here the code that used to go into constant.cs
22013 * constant.cs: Put here the code for constants, this is a new base
22014 class for Literals.
22016 * literal.cs: Make Literal derive from Constant.
22018 2001-12-09 Miguel de Icaza <miguel@ximian.com>
22020 * statement.cs (Return.Emit): Report error 157 if the user
22021 attempts to return from a finally block.
22023 (Return.Emit): Instead of emitting a return, jump to the end of
22026 * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
22027 LocalBuilder to store the result of the function. ReturnLabel is
22028 the target where we jump.
22031 2001-12-09 Radek Doulik <rodo@ximian.com>
22033 * cs-parser.jay: remember alias in current namespace
22035 * ecore.cs (SimpleName::DoResolve): use aliases for types or
22038 * class.cs (LookupAlias): lookup alias in my_namespace
22040 * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
22042 (LookupAlias): lookup alias in this and if needed in parent
22045 2001-12-08 Miguel de Icaza <miguel@ximian.com>
22049 * rootcontext.cs: (ModuleBuilder) Made static, first step into
22050 making things static. I need this to avoid passing the
22051 TypeContainer when calling ParameterType.
22053 * support.cs (InternalParameters.ParameterType): Remove ugly hack
22054 that did string manipulation to compute the type and then call
22055 GetType. Use Parameter.ParameterType instead.
22057 * cs-tokenizer.cs: Consume the suffix for floating values.
22059 * expression.cs (ParameterReference): figure out whether this is a
22060 reference parameter or not. Kill an extra variable by computing
22061 the arg_idx during emission.
22063 * parameter.cs (Parameters.GetParameterInfo): New overloaded
22064 function that returns whether a parameter is an out/ref value or not.
22066 (Parameter.ParameterType): The type of the parameter (base,
22067 without ref/out applied).
22069 (Parameter.Resolve): Perform resolution here.
22070 (Parameter.ExternalType): The full type (with ref/out applied).
22072 * statement.cs (Using.Emit, Using.EmitExpression): Implement
22073 support for expressions on the using statement.
22075 2001-12-07 Miguel de Icaza <miguel@ximian.com>
22077 * statement.cs (Using.EmitLocalVariableDecls): Split the
22078 localvariable handling of the using statement.
22080 (Block.EmitMeta): Keep track of variable count across blocks. We
22081 were reusing slots on separate branches of blocks.
22083 (Try.Emit): Emit the general code block, we were not emitting it.
22085 Check the type of the declaration to be an IDisposable or
22086 something that can be implicity converted to it.
22088 Emit conversions if required.
22090 * ecore.cs (EmptyExpression): New utility class.
22091 (Expression.ImplicitConversionExists): New utility function.
22093 2001-12-06 Miguel de Icaza <miguel@ximian.com>
22095 * statement.cs (Using): Implement.
22097 * expression.cs (LocalVariableReference): Support read only variables.
22099 * statement.cs: Remove the explicit emit for the Leave opcode.
22100 (VariableInfo): Add a readonly field.
22102 2001-12-05 Miguel de Icaza <miguel@ximian.com>
22104 * ecore.cs (ConvCast): new class used to encapsulate the various
22105 explicit integer conversions that works in both checked and
22106 unchecked contexts.
22108 (Expression.ConvertNumericExplicit): Use new ConvCast class to
22109 properly generate the overflow opcodes.
22111 2001-12-04 Miguel de Icaza <miguel@ximian.com>
22113 * statement.cs: The correct type for the EmptyExpression is the
22114 element_type, not the variable type. Ravi pointed this out.
22116 2001-12-04 Ravi Pratap <ravi@ximian.com>
22118 * class.cs (Method::Define): Handle PInvoke methods specially
22119 by using DefinePInvokeMethod instead of the usual one.
22121 * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
22122 above to do the task of extracting information and defining the method.
22124 2001-12-04 Ravi Pratap <ravi@ximian.com>
22126 * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
22127 of the condition for string type.
22129 (Emit): Move that here.
22131 (ArrayCreation::CheckIndices): Keep string literals in their expression
22134 (EmitDynamicInitializers): Handle strings appropriately.
22136 2001-12-04 Miguel de Icaza <miguel@ximian.com>
22138 * codegen.cs (EmitContext): Replace multiple variables with a
22139 single pointer to the current Switch statement.
22141 * statement.cs (GotoDefault, Switch): Adjust to cleaned up
22144 2001-12-03 Miguel de Icaza <miguel@ximian.com>
22148 * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
22151 (Foreach.Emit): Foreach on arrays was not setting
22152 up the loop variables (for break/continue).
22154 (GotoCase): Semi-implented.
22156 2001-12-03 Ravi Pratap <ravi@ximian.com>
22158 * attribute.cs (CheckAttribute): Handle system attributes by using
22159 Attribute.GetAttributes to examine information we need.
22161 (GetValidPlaces): Same here.
22163 * class.cs (Method::Define): Catch invalid use of extern and abstract together.
22165 * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
22167 * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
22169 (Method::Define): Set appropriate flags if we have a DllImport attribute.
22171 (Method::Emit): Handle the case when we are a PInvoke method.
22173 2001-12-03 Miguel de Icaza <miguel@ximian.com>
22175 * expression.cs: Use ResolveWithSimpleName on compound names.
22177 2001-12-02 Ravi Pratap <ravi@ximian.com>
22179 * constant.cs (EmitConstant): Make sure we resolve the associated expression
22180 before trying to reduce it.
22182 * typemanager.cs (RegisterConstant, LookupConstant): Implement.
22184 * constant.cs (LookupConstantValue): Implement.
22186 (EmitConstant): Use the above in emitting the constant.
22188 * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
22189 that are user-defined by doing a LookupConstantValue on them.
22191 (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
22194 2001-11-29 Miguel de Icaza <miguel@ximian.com>
22196 * expression.cs (BaseAccess, BaseIndexer): Also split this out.
22198 (BaseAccess.DoResolve): Implement.
22200 (MemberAccess.DoResolve): Split this routine into a
22201 ResolveMemberAccess routine that can be used independently
22203 2001-11-28 Miguel de Icaza <miguel@ximian.com>
22205 * expression.cs (Probe, Is, As): Split Probe in two classes Is and
22206 As that share bits of the implementation. Is returns a boolean,
22207 while As returns the Type that is being probed.
22209 2001-12-01 Ravi Pratap <ravi@ximian.com>
22211 * enum.cs (LookupEnumValue): Re-write various bits, return an object value
22212 instead of a Literal - much easier.
22214 (EnumInTransit): Remove - utterly useless :-)
22216 (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
22218 * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
22220 * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
22221 chain when we have no associated expression.
22223 2001-11-30 Ravi Pratap <ravi@ximian.com>
22225 * constant.cs (Define): Use Location while reporting the errror.
22227 Also emit a warning when 'new' is used and there is no inherited
22230 * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being
22233 (LookupEnumValue): Implement to lookup an enum member's value and define it
22236 (Populate): Re-write accordingly to use the above routine.
22238 2001-11-27 Miguel de Icaza <miguel@ximian.com>
22240 * expression.cs (This): Fix prototype for DoResolveLValue to
22241 override the base class DoResolveLValue.
22243 * cs-parser.cs: Report errors cs574 and cs575 (destructor
22246 * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
22247 (we need to load the address of the field here). This fixes
22250 (FieldExpr.DoResolveLValue): Call the DoResolve
22251 function to initialize the Instance expression.
22253 * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
22254 correctly the GetEnumerator operation on a value type.
22256 * cs-parser.jay: Add more simple parsing error catches.
22258 * statement.cs (Switch): Add support for string switches.
22259 Handle null specially.
22261 * literal.cs (NullLiteral): Make NullLiteral objects singletons.
22263 2001-11-28 Ravi Pratap <ravi@ximian.com>
22265 * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
22267 (declare_local_constant): New helper function.
22269 * statement.cs (AddConstant): Keep a separate record of constants
22271 (IsConstant): Implement to determine if a variable is a constant.
22273 (GetConstantExpression): Implement.
22275 * expression.cs (LocalVariableReference): Handle the case when it is a constant.
22277 * statement.cs (IsVariableDefined): Re-write.
22279 2001-11-27 Ravi Pratap <ravi@ximian.com>
22281 * class.cs (TypeContainer::FindMembers): Look for constants
22282 in the case when we are looking for MemberTypes.Field
22284 * expression.cs (MemberAccess::DoResolve): Check that in the
22285 case we are a FieldExpr and a Literal, we are not being accessed
22286 by an instance reference.
22288 * cs-parser.jay (local_constant_declaration): Implement.
22290 (declaration_statement): Implement for constant declarations.
22292 2001-11-26 Miguel de Icaza <miguel@ximian.com>
22294 * statement.cs (Switch): Catch double defaults.
22296 (Switch): More work on the switch() statement
22297 implementation. It works for integral values now, need to finish
22301 2001-11-24 Miguel de Icaza <miguel@ximian.com>
22303 * ecore.cs (Expression.ConvertIntLiteral): New function to convert
22304 integer literals into other integer literals. To be used by
22307 2001-11-24 Ravi Pratap <ravi@ximian.com>
22309 * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
22312 (EmitDynamicInitializers): Cope with the above since we extract data
22313 directly from ArrayData now.
22315 (ExpectInitializers): Keep track of whether initializers are mandatory
22318 (Bounds): Make it a hashtable to prevent the same dimension being
22319 recorded for every element in that dimension.
22321 (EmitDynamicInitializers): Fix bug which prevented the Set array method
22324 Also fix bug which was causing the indices to be emitted in the reverse
22327 2001-11-24 Miguel de Icaza <miguel@ximian.com>
22329 * expression.cs (ArrayCreation): Implement the bits that Ravi left
22330 unfinished. They do not work, because the underlying code is
22333 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22335 * cs-parser.jay: Remove bogus fixme.
22337 * statement.cs (Switch, SwitchSection, SwithLabel): Started work
22338 on Switch statement.
22340 2001-11-23 Ravi Pratap <ravi@ximian.com>
22342 * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
22345 * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
22346 parameter. Apparently, any expression is allowed.
22348 (ValidateInitializers): Update accordingly.
22350 (CheckIndices): Fix some tricky bugs thanks to recursion.
22352 * delegate.cs (NewDelegate::DoResolve): Re-write large portions as
22353 I was being completely brain-dead.
22355 (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
22356 and re-write acordingly.
22358 (DelegateInvocation): Re-write accordingly.
22360 * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
22362 (MakeByteBlob): Handle types more correctly.
22364 * expression.cs (ArrayCreation:Emit): Write preliminary code to do
22365 initialization from expressions but it is incomplete because I am a complete
22368 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22370 * statement.cs (If.Emit): Fix a bug that generated incorrect code
22371 on If. Basically, we have to return `true' (ie, we do return to
22372 our caller) only if both branches of the if return.
22374 * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
22375 short-circuit operators, handle them as short circuit operators.
22377 (Cast.DoResolve): Resolve type.
22378 (Cast.Cast): Take an expression as the target type.
22380 * cs-parser.jay (cast_expression): Remove old hack that only
22381 allowed a limited set of types to be handled. Now we take a
22382 unary_expression and we resolve to a type during semantic
22385 Use the grammar productions from Rhys to handle casts (this is
22386 not complete like Rhys syntax yet, we fail to handle that corner
22387 case that C# has regarding (-x), but we will get there.
22389 2001-11-22 Ravi Pratap <ravi@ximian.com>
22391 * class.cs (EmitFieldInitializer): Take care of the case when we have a
22392 field which is an array type.
22394 * cs-parser.jay (declare_local_variables): Support array initialization too.
22396 * typemanager.cs (MakeKey): Implement.
22398 (everywhere): Use the above appropriately.
22400 * cs-parser.jay (for_statement): Update for array initialization while
22401 declaring variables.
22403 * ecore.cs : The error message was correct, it's the variable's names that
22404 were misleading ;-) Make the code more readable.
22406 (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
22407 the correct type etc.
22409 (ConvertExplicit): Handle Enum types by examining the underlying type.
22411 2001-11-21 Ravi Pratap <ravi@ximian.com>
22413 * parameter.cs (GetCallingConvention): Always return
22414 CallingConventions.Standard for now.
22416 2001-11-22 Miguel de Icaza <miguel@ximian.com>
22418 * expression.cs (Binary.ResolveOperator): Update the values of `l'
22419 and `r' after calling DoNumericPromotions.
22421 * ecore.cs: Fix error message (the types were in the wrong order).
22423 * statement.cs (Foreach.ProbeCollectionType): Need to pass
22424 BindingFlags.Instance as well
22426 * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
22427 implicit int literal conversion in an empty cast so that we
22428 propagate the right type upstream.
22430 (UnboxCast): new class used to unbox value types.
22431 (Expression.ConvertExplicit): Add explicit type conversions done
22434 (Expression.ImplicitNumericConversion): Oops, forgot to test for
22435 the target type before applying the implicit LongLiterals to ULong
22438 2001-11-21 Miguel de Icaza <miguel@ximian.com>
22440 * cs-parser.jay (for_statement): Reworked the way For works: now
22441 we declare manually any variables that are introduced in
22442 for_initializer to solve the problem of having out-of-band code
22443 emition (that is what got for broken).
22445 (declaration_statement): Perform the actual variable declaration
22446 that used to be done in local_variable_declaration here.
22448 (local_variable_declaration): Do not declare anything, just pass
22449 the information on a DictionaryEntry
22451 2001-11-20 Ravi Pratap <ravi@ximian.com>
22453 * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
22454 re-write of the logic to now make it recursive.
22456 (UpdateIndices): Re-write accordingly.
22458 Store element data in a separate ArrayData list in the above methods.
22460 (MakeByteBlob): Implement to dump the array data into a byte array.
22462 2001-11-19 Ravi Pratap <ravi@ximian.com>
22464 * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
22467 * constant.cs (Define): Implement.
22469 (EmitConstant): Re-write fully.
22471 Pass in location info.
22473 * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
22476 * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
22477 DictionaryEntry since we need location info too.
22479 (constant_declaration): Update accordingly.
22481 * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
22482 code into another method : UpdateIndices.
22484 2001-11-18 Ravi Pratap <ravi@ximian.com>
22486 * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
22487 some type checking etc.
22489 2001-11-17 Ravi Pratap <ravi@ximian.com>
22491 * expression.cs (ArrayCreation::ValidateInitializers): Implement
22492 bits to provide dimension info if the user skips doing that.
22494 Update second constructor to store the rank correctly.
22496 2001-11-16 Ravi Pratap <ravi@ximian.com>
22498 * expression.cs (ArrayCreation::ValidateInitializers): Poke around
22499 and try to implement.
22501 * ../errors/cs0150.cs : Add.
22503 * ../errors/cs0178.cs : Add.
22505 2001-11-16 Miguel de Icaza <miguel@ximian.com>
22507 * statement.cs: Implement foreach on multi-dimensional arrays.
22509 * parameter.cs (Parameters.GetParameterByName): Also lookup the
22510 name of the params argument.
22512 * expression.cs: Use EmitStoreOpcode to get the right opcode while
22513 initializing the array.
22515 (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
22516 we can use this elsewhere.
22518 * statement.cs: Finish implementation of foreach for single
22521 * cs-parser.jay: Use an out-of-band stack to pass information
22522 around, I wonder why I need this.
22524 foreach_block: Make the new foreach_block the current_block.
22526 * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
22527 function used to return a static Parameters structure. Used for
22528 empty parameters, as those are created very frequently.
22530 * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
22532 2001-11-15 Ravi Pratap <ravi@ximian.com>
22534 * interface.cs : Default modifier is private, not public. The
22535 make verify test passes again.
22537 2001-11-15 Ravi Pratap <ravi@ximian.com>
22539 * support.cs (ReflectionParameters): Fix logic to determine
22540 whether the last parameter is a params one. Test 9 passes again.
22542 * delegate.cs (Populate): Register the builders we define with
22543 RegisterParameterForBuilder. Test 19 passes again.
22545 * cs-parser.jay (property_declaration): Reference $6 instead
22546 of $$ to get at the location.
22548 (indexer_declaration): Similar stuff.
22550 (attribute): Ditto.
22552 * class.cs (Property): Register parameters for the Get and Set methods
22553 if they exist. Test 23 passes again.
22555 * expression.cs (ArrayCreation::Emit): Pass null for the method in the
22556 call to EmitArguments as we are sure there aren't any params arguments.
22557 Test 32 passes again.
22559 * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
22560 IndexOutOfRangeException.
22562 * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
22563 Test 33 now passes again.
22565 2001-11-15 Miguel de Icaza <miguel@ximian.com>
22567 * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22568 broke a bunch of things. Will have to come up with a better way
22569 of tracking locations.
22571 * statement.cs: Implemented foreach for single dimension arrays.
22573 2001-11-09 Miguel de Icaza <miguel@ximian.com>
22575 * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22576 an error. This removes the lookup from the critical path.
22578 * cs-parser.jay: Removed use of temporary_loc, which is completely
22581 2001-11-14 Miguel de Icaza <miguel@ximian.com>
22583 * support.cs (ReflectionParameters.ParameterModifier): Report
22584 whether the argument is a PARAMS argument or not.
22586 * class.cs: Set the attribute `ParamArrayAttribute' on the
22587 parameter argument.
22589 * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22590 and cons_param_array_attribute (ConstructorInfo for
22591 ParamArrayAttribute).,
22593 * codegen.cs: Emit the return using the `Return' statement, that
22594 way we can report the error correctly for missing return values.
22596 * class.cs (Method.Emit): Clean up.
22598 * expression.cs (Argument.Resolve): Take another argument: the
22599 location where this argument is used. Notice that this is not
22600 part of the "Argument" class as to reduce the size of the
22601 structure (we know the approximate location anyways).
22603 Test if the argument is a variable-reference, if not, then
22604 complain with a 206.
22606 (Argument.Emit): Emit addresses of variables.
22608 (Argument.FullDesc): Simplify.
22610 (Invocation.DoResolve): Update for Argument.Resolve.
22612 (ElementAccess.DoResolve): ditto.
22614 * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22615 method should be virtual, as this method is always virtual.
22617 (NewDelegate.DoResolve): Update for Argument.Resolve.
22619 * class.cs (ConstructorInitializer.DoResolve): ditto.
22621 * attribute.cs (Attribute.Resolve): ditto.
22623 2001-11-13 Miguel de Icaza <miguel@ximian.com>
22625 * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22627 * expression.cs (ParameterReference): Drop IStackStorage and implement
22628 IAssignMethod instead.
22630 (LocalVariableReference): ditto.
22632 * ecore.cs (FieldExpr): Drop IStackStorage and implement
22633 IAssignMethod instead.
22635 2001-11-13 Miguel de Icaza <miguel@ximian.com>
22637 * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22638 enumerations that are used in heavily used structures derive from
22639 byte in a laughable and pathetic attempt to reduce memory usage.
22640 This is the kind of pre-optimzations that you should not do at
22641 home without adult supervision.
22643 * expression.cs (UnaryMutator): New class, used to handle ++ and
22644 -- separatedly from the other unary operators. Cleans up the
22645 code, and kills the ExpressionStatement dependency in Unary.
22647 (Unary): Removed `method' and `Arguments' from this class, making
22648 it smaller, and moving it all to SimpleCall, so I can reuse this
22649 code in other locations and avoid creating a lot of transient data
22650 strucutres when not required.
22652 * cs-parser.jay: Adjust for new changes.
22654 2001-11-11 Miguel de Icaza <miguel@ximian.com>
22656 * enum.cs (Enum.Populate): If there is a failure during
22659 * cs-parser.jay (opt_enum_base): we used to catch type errors
22660 here, but this is really incorrect. The type error should be
22661 catched during semantic analysis.
22663 2001-12-11 Ravi Pratap <ravi@ximian.com>
22665 * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
22666 current_local_parameters as expected since I, in my stupidity, had forgotten
22669 * attribute.cs (GetValidPlaces): Fix stupid bug.
22671 * class.cs (Method::Emit): Perform check on applicability of attributes.
22673 (Constructor::Emit): Ditto.
22675 (Field::Emit): Ditto.
22677 (Field.Location): Store location information.
22679 (Property, Event, Indexer, Operator): Ditto.
22681 * cs-parser.jay (field_declaration): Pass in location for each field.
22683 * ../errors/cs0592.cs : Add.
22685 2001-11-12 Ravi Pratap <ravi@ximian.com>
22687 * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22689 (InitCoreTypes): Update accordingly.
22691 (RegisterAttrType, LookupAttr): Implement.
22693 * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22694 info about the same.
22696 (Resolve): Update to populate the above as necessary.
22698 (Error592): Helper.
22700 (GetValidPlaces): Helper to the above.
22702 (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22704 * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22706 2001-11-12 Ravi Pratap <ravi@ximian.com>
22708 * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22710 * ../errors/cs0617.cs : Add.
22712 2001-11-11 Ravi Pratap <ravi@ximian.com>
22714 * enum.cs (Emit): Rename to Populate to be more consistent with what
22715 we expect it to do and when exactly it is called.
22717 * class.cs, rootcontext.cs : Update accordingly.
22719 * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22720 FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22722 * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22724 * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22725 of a fieldinfo using the above, when dealing with a FieldBuilder.
22727 2001-11-10 Ravi Pratap <ravi@ximian.com>
22729 * ../errors/cs0031.cs : Add.
22731 * ../errors/cs1008.cs : Add.
22733 * ../errrors/cs0543.cs : Add.
22735 * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22738 (FindMembers): Implement.
22740 * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22741 enums and delegates too.
22743 (enum_types): Rename to builder_to_enum.
22745 (delegate_types): Rename to builder_to_delegate.
22747 * delegate.cs (FindMembers): Implement.
22749 2001-11-09 Ravi Pratap <ravi@ximian.com>
22751 * typemanager.cs (IsEnumType): Implement.
22753 * enum.cs (Emit): Re-write parts to account for the underlying type
22754 better and perform checking etc.
22756 (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22757 of the underlying type.
22759 * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22762 * enum.cs (error31): Helper to report error #31.
22764 * cs-parser.jay (enum_declaration): Store location of each member too.
22766 * enum.cs (member_to_location): New hashtable.
22768 (AddEnumMember): Update location hashtable.
22770 (Emit): Use the location of each member while reporting errors.
22772 2001-11-09 Miguel de Icaza <miguel@ximian.com>
22774 * cs-parser.jay: A for_initializer if is a
22775 local_variable_declaration really ammount to have an implicit
22776 block with the variable declaration and no initializer for for.
22778 * statement.cs (For.Emit): Cope with null initializers.
22780 This fixes the infinite loop on for initializers.
22782 2001-11-08 Miguel de Icaza <miguel@ximian.com>
22784 * enum.cs: More cleanup.
22786 * ecore.cs: Remove dead code.
22788 * class.cs (Property.Emit): More simplification.
22789 (Event.Emit): ditto.
22791 Reworked to have less levels of indentation.
22793 2001-11-08 Ravi Pratap <ravi@ximian.com>
22795 * class.cs (Property): Emit attributes.
22805 * enum.cs (Emit): Ditto.
22807 * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22810 * class.cs (Field, Event, etc.): Move attribute generation into the
22811 Emit method everywhere.
22813 * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22814 we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22815 as we had no way of defining nested enums !
22817 * rootcontext.cs : Adjust code accordingly.
22819 * typemanager.cs (AddEnumType): To keep track of enum types separately.
22821 2001-11-07 Ravi Pratap <ravi@ximian.com>
22823 * expression.cs (EvalConstantExpression): Move into ecore.cs
22825 * enum.cs (Enum): Rename some members and make them public and readonly
22826 according to our convention.
22828 * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
22831 * enum.cs (Enum::Define): Use the above instead of TypeAttr.
22833 (Enum::Emit): Write a simple version for now which doesn't try to compute
22834 expressions. I shall modify this to be more robust in just a while.
22836 * class.cs (TypeContainer::Emit): Make sure we include Enums too.
22838 (TypeContainer::CloseType): Create the Enum types too.
22840 * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
22842 * expression.cs (EvalConstantExpression): Get rid of completely.
22844 * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
22845 user-defined values and other cases.
22847 (IsValidEnumLiteral): Helper function.
22849 * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing
22850 out there in the case we had a literal FieldExpr.
22852 (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
22854 (Literalize): Revamp a bit to take two arguments.
22856 (EnumLiteral): New class which derives from Literal to wrap enum literals.
22858 2001-11-06 Ravi Pratap <ravi@ximian.com>
22860 * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22862 * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22864 (Resolve): Use the above to ensure we have proper initializers.
22866 2001-11-05 Ravi Pratap <ravi@ximian.com>
22868 * expression.cs (Expression::EvalConstantExpression): New method to
22869 evaluate constant expressions.
22871 * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22873 2001-11-07 Miguel de Icaza <miguel@ximian.com>
22875 * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22878 (Binary.ResolveOperator): Handle operator != (object a, object b)
22879 and operator == (object a, object b);
22881 (Binary.DoNumericPromotions): Indicate whether the numeric
22882 promotion was possible.
22884 (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22887 Made the ArrayAccess implement interface IAssignMethod instead of
22888 IStackStore as the order in which arguments are passed reflects
22891 * assign.cs: Instead of using expr.ExprClass to select the way of
22892 assinging, probe for the IStackStore/IAssignMethod interfaces.
22894 * typemanager.cs: Load InitializeArray definition.
22896 * rootcontext.cs (RootContext.MakeStaticData): Used to define
22897 static data that can be used to initialize arrays.
22899 2001-11-05 Miguel de Icaza <miguel@ximian.com>
22901 * expression.cs: Handle operator== and operator!= for booleans.
22903 (Conditioal.Reduce): Implement reducer for the ?: operator.
22905 (Conditional.Resolve): Implement dead code elimination.
22907 (Binary.Resolve): Catch string literals and return a new
22908 concatenated string.
22910 (Unary.Reduce): Implement reduction of unary expressions.
22912 * ecore.cs: Split out the expression core handling here.
22914 (Expression.Reduce): New method used to perform constant folding
22915 and CSE. This is needed to support constant-expressions.
22917 * statement.cs (Statement.EmitBoolExpression): Pass true and false
22918 targets, and optimize for !x.
22920 2001-11-04 Ravi Pratap <ravi@ximian.com>
22922 * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22923 of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22924 set custom atttributes.
22926 * literal.cs (Literal::GetValue): New abstract method to return the actual
22927 value of the literal, cast as an object.
22929 (*Literal): Implement GetValue method.
22931 * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22932 expressions to the arraylist but objects of type Argument.
22934 * class.cs (TypeContainer::Emit): Emit our attributes too.
22936 (Method::Emit, Constructor::Emit): Ditto.
22938 * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22939 to be ignoring earlier.
22941 2001-11-03 Ravi Pratap <ravi@ximian.com>
22943 * attribute.cs (AttributeSection::Define): Implement to do the business
22944 of constructing a CustomAttributeBuilder.
22946 (Attribute): New trivial class. Increases readability of code.
22948 * cs-parser.jay : Update accordingly.
22950 (positional_argument_list, named_argument_list, named_argument): New rules
22952 (attribute_arguments): Use the above so that we are more correct.
22954 2001-11-02 Ravi Pratap <ravi@ximian.com>
22956 * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22957 to perform all checks for a method with a params parameter.
22959 (Invocation::OverloadResolve): Update to use the above method and therefore
22960 cope correctly with params method invocations.
22962 * support.cs (InternalParameters::ParameterDesc): Provide a desc for
22965 * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22966 constructors in our parent too because we can't afford to miss out on
22969 * attribute.cs (AttributeSection): New name for the class Attribute
22971 Other trivial changes to improve readability.
22973 * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22974 use the new class names.
22976 2001-11-01 Ravi Pratap <ravi@ximian.com>
22978 * class.cs (Method::Define): Complete definition for params types too
22980 (Indexer::Define): Ditto.
22982 * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22983 Cope everywhere with a request for info about the array parameter.
22985 2001-11-01 Ravi Pratap <ravi@ximian.com>
22987 * tree.cs (RecordNamespace): Fix up to check for the correct key.
22989 * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in
22990 local_variable_type to extract the string corresponding to the type.
22992 (local_variable_type): Fixup the action to use the new helper method.
22994 * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to
22997 * expression.cs : Clean out code which uses the above.
22999 2001-10-31 Ravi Pratap <ravi@ximian.com>
23001 * typemanager.cs (RegisterMethod): Check if we already have an existing key
23002 and bale out if necessary by returning a false.
23004 (RegisterProperty): Ditto.
23006 * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
23007 and print out appropriate error messages.
23009 * interface.cs (everywhere): Ditto.
23011 * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
23012 location to constructor.
23014 * class.cs (Property, Event, Indexer): Update accordingly.
23016 * ../errors/cs111.cs : Added.
23018 * expression.cs (Invocation::IsApplicable): New static method to determine applicability
23019 of a method, as laid down by the spec.
23021 (Invocation::OverloadResolve): Use the above method.
23023 2001-10-31 Ravi Pratap <ravi@ximian.com>
23025 * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
23026 now take a TypeContainer and a Parameters object.
23028 (ParameterData): Modify return type of ParameterModifier method to be
23029 Parameter.Modifier and not a string.
23031 (ReflectionParameters, InternalParameters): Update accordingly.
23033 * expression.cs (Argument::GetParameterModifier): Same here.
23035 * support.cs (InternalParameters::ParameterType): Find a better way of determining
23036 if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
23037 symbol in it at all so maybe this is only for now.
23039 2001-10-30 Ravi Pratap <ravi@ximian.com>
23041 * support.cs (InternalParameters): Constructor now takes an extra argument
23042 which is the actual Parameters class.
23044 (ParameterDesc): Update to provide info on ref/out modifiers.
23046 * class.cs (everywhere): Update call to InternalParameters to pass in
23047 the second argument too.
23049 * support.cs (ParameterData): Add ParameterModifier, which is a method
23050 to return the modifier info [ref/out etc]
23052 (InternalParameters, ReflectionParameters): Implement the above.
23054 * expression.cs (Argument::ParameterModifier): Similar function to return
23055 info about the argument's modifiers.
23057 (Invocation::OverloadResolve): Update to take into account matching modifiers
23060 * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
23061 a new SetFormalParameters object which we pass to InternalParameters.
23063 2001-10-30 Ravi Pratap <ravi@ximian.com>
23065 * expression.cs (NewArray): Merge into the ArrayCreation class.
23067 2001-10-29 Ravi Pratap <ravi@ximian.com>
23069 * expression.cs (NewArray): Merge classes NewBuiltinArray and
23070 NewUserdefinedArray into one as there wasn't much of a use in having
23073 * expression.cs (Argument): Change field's name to ArgType from Type.
23075 (Type): New readonly property which returns the proper type, taking into
23076 account ref/out modifiers.
23078 (everywhere): Adjust code accordingly for the above.
23080 * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
23081 whether we are emitting for a ref or out parameter.
23083 * expression.cs (Argument::Emit): Use the above field to set the state.
23085 (LocalVariableReference::Emit): Update to honour the flag and emit the
23088 * parameter.cs (Attributes): Set the correct flags for ref parameters.
23090 * expression.cs (Argument::FullDesc): New function to provide a full desc.
23092 * support.cs (ParameterData): Add method ParameterDesc to the interface.
23094 (ReflectionParameters, InternalParameters): Implement the above method.
23096 * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
23099 (Invocation::FullMethodDesc): Ditto.
23101 2001-10-29 Miguel de Icaza <miguel@ximian.com>
23103 * cs-parser.jay: Add extra production for the second form of array
23106 * expression.cs (ArrayCreation): Update to reflect the above
23109 * Small changes to prepare for Array initialization.
23111 2001-10-28 Miguel de Icaza <miguel@ximian.com>
23113 * typemanager.cs (ImplementsInterface): interface might be null;
23114 Deal with this problem;
23116 Also, we do store negative hits on the cache (null values), so use
23117 this instead of calling t.GetInterfaces on the type everytime.
23119 2001-10-28 Ravi Pratap <ravi@ximian.com>
23121 * typemanager.cs (IsBuiltinType): New method to help determine the same.
23123 * expression.cs (New::DoResolve): Get rid of array creation code and instead
23124 split functionality out into different classes.
23126 (New::FormArrayType): Move into NewBuiltinArray.
23128 (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
23131 (NewBuiltinArray): New class to handle creation of built-in arrays.
23133 (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
23134 account creation of one-dimensional arrays.
23136 (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
23138 (NewUserdefinedArray::DoResolve): Implement.
23140 * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
23142 * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
23143 we maintain inside the TypeManager. This is necessary to perform lookups on the
23146 (LookupType): Update to perform GetType on the module builders too.
23148 * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
23150 * exprssion.cs (NewUserdefinedArray::Emit): Implement.
23152 2001-10-23 Ravi Pratap <ravi@ximian.com>
23154 * expression.cs (New::DoResolve): Implement guts of array creation.
23156 (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
23158 2001-10-27 Miguel de Icaza <miguel@ximian.com>
23160 * expression.cs: Fix bug I introduced lsat night that broke
23163 (Expression.Resolve): Report a 246 error (can not resolve name)
23164 if we find a SimpleName in the stream.
23166 (Expression.ResolveLValue): Ditto.
23168 (Expression.ResolveWithSimpleName): This function is a variant of
23169 ResolveName, this one allows SimpleNames to be returned without a
23170 warning. The only consumer of SimpleNames is MemberAccess
23172 2001-10-26 Miguel de Icaza <miguel@ximian.com>
23174 * expression.cs (Invocation::DoResolve): Catch SimpleNames that
23175 might arrive here. I have my doubts that this is correct.
23177 * statement.cs (Lock): Implement lock statement.
23179 * cs-parser.jay: Small fixes to support `lock' and `using'
23181 * cs-tokenizer.cs: Remove extra space
23183 * driver.cs: New flag --checked, allows to turn on integer math
23186 * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
23187 Threading.Monitor.Exit
23189 2001-10-23 Miguel de Icaza <miguel@ximian.com>
23191 * expression.cs (IndexerAccess::DoResolveLValue): Set the
23192 Expression Class to be IndexerAccess.
23194 Notice that Indexer::DoResolve sets the eclass to Value.
23196 2001-10-22 Miguel de Icaza <miguel@ximian.com>
23198 * class.cs (TypeContainer::Emit): Emit code for indexers.
23200 * assign.cs (IAssignMethod): New interface implemented by Indexers
23201 and Properties for handling assignment.
23203 (Assign::Emit): Simplify and reuse code.
23205 * expression.cs (IndexerAccess, PropertyExpr): Implement
23206 IAssignMethod, clean up old code.
23208 2001-10-22 Ravi Pratap <ravi@ximian.com>
23210 * typemanager.cs (ImplementsInterface): New method to determine if a type
23211 implements a given interface. Provides a nice cache too.
23213 * expression.cs (ImplicitReferenceConversion): Update checks to use the above
23216 (ConvertReferenceExplicit): Ditto.
23218 * delegate.cs (Delegate::Populate): Update to define the parameters on the
23219 various methods, with correct names etc.
23221 * class.cs (Operator::OpType): New members Operator.UnaryPlus and
23222 Operator.UnaryNegation.
23224 * cs-parser.jay (operator_declarator): Be a little clever in the case where
23225 we have a unary plus or minus operator.
23227 * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and
23230 * everywhere : update accordingly.
23232 * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
23235 * class.cs (Method::Define): For the case where we are implementing a method
23236 inherited from an interface, we need to set the MethodAttributes.Final flag too.
23237 Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
23239 2001-10-21 Ravi Pratap <ravi@ximian.com>
23241 * interface.cs (FindMembers): Implement to work around S.R.E
23244 * typemanager.cs (IsInterfaceType): Implement.
23246 (FindMembers): Update to handle interface types too.
23248 * expression.cs (ImplicitReferenceConversion): Re-write bits which
23249 use IsAssignableFrom as that is not correct - it doesn't work.
23251 * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
23252 and accordingly override EmitStatement.
23254 * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
23255 using the correct logic :-)
23257 2001-10-19 Ravi Pratap <ravi@ximian.com>
23259 * ../errors/cs-11.cs : Add to demonstrate error -11
23261 2001-10-17 Miguel de Icaza <miguel@ximian.com>
23263 * assign.cs (Assign::Resolve): Resolve right hand side first, and
23264 then pass this as a hint to ResolveLValue.
23266 * expression.cs (FieldExpr): Add Location information
23268 (FieldExpr::LValueResolve): Report assignment to readonly
23271 (Expression::ExprClassFromMemberInfo): Pass location information.
23273 (Expression::ResolveLValue): Add new method that resolves an
23276 (Expression::DoResolveLValue): Default invocation calls
23279 (Indexers): New class used to keep track of indexers in a given
23282 (IStackStore): Renamed from LValue, as it did not really describe
23283 what this did. Also ResolveLValue is gone from this interface and
23284 now is part of Expression.
23286 (ElementAccess): Depending on the element access type
23288 * typemanager.cs: Add `indexer_name_type' as a Core type
23289 (System.Runtime.CompilerServices.IndexerNameAttribute)
23291 * statement.cs (Goto): Take a location.
23293 2001-10-18 Ravi Pratap <ravi@ximian.com>
23295 * delegate.cs (Delegate::VerifyDelegate): New method to verify
23296 if two delegates are compatible.
23298 (NewDelegate::DoResolve): Update to take care of the case when
23299 we instantiate a delegate from another delegate.
23301 * typemanager.cs (FindMembers): Don't even try to look up members
23302 of Delegate types for now.
23304 2001-10-18 Ravi Pratap <ravi@ximian.com>
23306 * delegate.cs (NewDelegate): New class to take care of delegate
23309 * expression.cs (New): Split the delegate related code out into
23310 the NewDelegate class.
23312 * delegate.cs (DelegateInvocation): New class to handle delegate
23315 * expression.cs (Invocation): Split out delegate related code into
23316 the DelegateInvocation class.
23318 2001-10-17 Ravi Pratap <ravi@ximian.com>
23320 * expression.cs (New::DoResolve): Implement delegate creation fully
23321 and according to the spec.
23323 (New::DoEmit): Update to handle delegates differently.
23325 (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
23326 because of which we were printing out arguments in reverse order !
23328 * delegate.cs (VerifyMethod): Implement to check if the given method
23329 matches the delegate.
23331 (FullDelegateDesc): Implement.
23333 (VerifyApplicability): Implement.
23335 * expression.cs (Invocation::DoResolve): Update to accordingly handle
23336 delegate invocations too.
23338 (Invocation::Emit): Ditto.
23340 * ../errors/cs1593.cs : Added.
23342 * ../errors/cs1594.cs : Added.
23344 * delegate.cs (InstanceExpression, TargetMethod): New properties.
23346 2001-10-16 Ravi Pratap <ravi@ximian.com>
23348 * typemanager.cs (intptr_type): Core type for System.IntPtr
23350 (InitCoreTypes): Update for the same.
23352 (iasyncresult_type, asynccallback_type): Ditto.
23354 * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
23357 * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
23360 * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
23361 the builders for the 4 members of a delegate type :-)
23363 (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
23366 * expression.cs (New::DoResolve): Implement guts for delegate creation.
23368 * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
23370 2001-10-15 Miguel de Icaza <miguel@ximian.com>
23372 * statement.cs (Break::Emit): Implement.
23373 (Continue::Emit): Implement.
23375 (For::Emit): Track old being/end loops; Set Begin loop, ack end loop
23376 (While::Emit): Track old being/end loops; Set Begin loop, ack end loop
23377 (Do::Emit): Track old being/end loops; Set Begin loop, ack end loop
23378 (Foreach::Emit): Track old being/end loops; Set Begin loop, ack
23381 * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
23382 properties that track the label for the current loop (begin of the
23383 loop and end of the loop).
23385 2001-10-15 Ravi Pratap <ravi@ximian.com>
23387 * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
23388 use of emitting anything at all.
23390 * class.cs, rootcontext.cs : Get rid of calls to the same.
23392 * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
23394 (Populate): Define the constructor correctly and set the implementation
23397 * typemanager.cs (delegate_types): New hashtable to hold delegates that
23400 (AddDelegateType): Implement.
23402 (IsDelegateType): Implement helper method.
23404 * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
23406 * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
23407 and accordingly handle it.
23409 * delegate.cs (Populate): Take TypeContainer argument.
23410 Implement bits to define the Invoke method. However, I still haven't figured out
23411 how to take care of the native int bit :-(
23413 * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-)
23414 Qualify the name of the delegate, not its return type !
23416 * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
23419 (StandardConversionExists): Checking for array types turns out to be recursive.
23421 (ConvertReferenceExplicit): Implement array conversion.
23423 (ExplicitReferenceConversionExists): New method to determine precisely that :-)
23425 2001-10-12 Ravi Pratap <ravi@ximian.com>
23427 * cs-parser.jay (delegate_declaration): Store the fully qualified
23428 name as it is a type declaration.
23430 * delegate.cs (ReturnType, Name): Rename members to these. Make them
23433 (DefineDelegate): Renamed from Define. Does the same thing essentially,
23434 as TypeContainer::DefineType.
23436 (Populate): Method in which all the definition of the various methods (Invoke)
23439 (Emit): Emit any code, if necessary. I am not sure about this really, but let's
23442 (CloseDelegate): Finally creates the delegate.
23444 * class.cs (TypeContainer::DefineType): Update to define delegates.
23445 (Populate, Emit and CloseType): Do the same thing here too.
23447 * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
23448 delegates in all these operations.
23450 2001-10-14 Miguel de Icaza <miguel@ximian.com>
23452 * expression.cs: LocalTemporary: a new expression used to
23453 reference a temporary that has been created.
23455 * assign.cs: Handle PropertyAccess back here, so that we can
23456 provide the proper semantic access to properties.
23458 * expression.cs (Expression::ConvertReferenceExplicit): Implement
23459 a few more explicit conversions.
23461 * modifiers.cs: `NEW' modifier maps to HideBySig.
23463 * expression.cs (PropertyExpr): Make this into an
23464 ExpressionStatement, and support the EmitStatement code path.
23466 Perform get/set error checking, clean up the interface.
23468 * assign.cs: recognize PropertyExprs as targets, and if so, turn
23469 them into toplevel access objects.
23471 2001-10-12 Miguel de Icaza <miguel@ximian.com>
23473 * expression.cs: PropertyExpr::PropertyExpr: use work around the
23476 * typemanager.cs: Keep track here of our PropertyBuilders again to
23477 work around lameness in SRE.
23479 2001-10-11 Miguel de Icaza <miguel@ximian.com>
23481 * expression.cs (LValue::LValueResolve): New method in the
23482 interface, used to perform a second resolution pass for LValues.
23484 (This::DoResolve): Catch the use of this in static methods.
23486 (This::LValueResolve): Implement.
23488 (This::Store): Remove warning, assigning to `this' in structures
23491 (Invocation::Emit): Deal with invocation of
23492 methods on value types. We need to pass the address to structure
23493 methods rather than the object itself. (The equivalent code to
23494 emit "this" for structures leaves the entire structure on the
23495 stack instead of a pointer to it).
23497 (ParameterReference::DoResolve): Compute the real index for the
23498 argument based on whether the method takes or not a `this' pointer
23499 (ie, the method is static).
23501 * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
23502 value types returned from functions when we need to invoke a
23503 method on the sturcture.
23506 2001-10-11 Ravi Pratap <ravi@ximian.com>
23508 * class.cs (TypeContainer::DefineType): Method to actually do the business of
23509 defining the type in the Modulebuilder or Typebuilder. This is to take
23510 care of nested types which need to be defined on the TypeBuilder using
23511 DefineNestedMethod.
23513 (TypeContainer::GetClassBases): Implement. Essentially the code from the
23514 methods in RootContext, only ported to be part of TypeContainer.
23516 (TypeContainer::GetInterfaceOrClass): Ditto.
23518 (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
23520 * interface.cs (Interface::DefineInterface): New method. Does exactly
23521 what RootContext.CreateInterface did earlier, only it takes care of nested types
23524 (Interface::GetInterfaces): Move from RootContext here and port.
23526 (Interface::GetInterfaceByName): Same here.
23528 * rootcontext.cs (ResolveTree): Re-write.
23530 (PopulateTypes): Re-write.
23532 * class.cs (TypeContainer::Populate): Populate nested types too.
23533 (TypeContainer::Emit): Emit nested members too.
23535 * typemanager.cs (AddUserType): Do not make use of the FullName property,
23536 instead just use the name argument passed in as it is already fully
23539 (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
23540 to TypeContainer mapping to see if a type is user-defined.
23542 * class.cs (TypeContainer::CloseType): Implement.
23544 (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
23545 the default constructor.
23547 (TypeContainer::Populate): Fix minor bug which led to creating default constructors
23550 (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
23552 * interface.cs (CloseType): Create the type here.
23554 * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
23557 Remove all the methods which are now in TypeContainer.
23559 2001-10-10 Ravi Pratap <ravi@ximian.com>
23561 * delegate.cs (Define): Re-write bits to define the delegate
23564 2001-10-10 Miguel de Icaza <miguel@ximian.com>
23566 * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23568 * expression.cs (ImplicitReferenceConversion): handle null as well
23569 as a source to convert to any reference type.
23571 * statement.cs (Return): Perform any implicit conversions to
23572 expected return type.
23574 Validate use of return statement.
23576 * codegen.cs (EmitContext): Pass the expected return type here.
23578 * class.cs (Method, Constructor, Property): Pass expected return
23579 type to EmitContext.
23581 2001-10-09 Miguel de Icaza <miguel@ximian.com>
23583 * expression.cs: Make DoResolve take an EmitContext instead of a
23586 Replaced `l' and `location' for `loc', for consistency.
23588 (Error, Warning): Remove unneeded Tc argument.
23590 * assign.cs, literal.cs, constant.cs: Update to new calling
23593 * codegen.cs: EmitContext now contains a flag indicating whether
23594 code is being generated in a static method or not.
23596 * cs-parser.jay: DecomposeQI, new function that replaces the old
23597 QualifiedIdentifier. Now we always decompose the assembled
23598 strings from qualified_identifier productions into a group of
23601 2001-10-08 Miguel de Icaza <miguel@ximian.com>
23603 * rootcontext.cs: Deal with field-less struct types correctly now
23604 by passing the size option to Define Type.
23606 * class.cs: Removed hack that created one static field.
23608 2001-10-07 Miguel de Icaza <miguel@ximian.com>
23610 * statement.cs: Moved most of the code generation here.
23612 2001-10-09 Ravi Pratap <ravi@ximian.com>
23614 * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23617 (ElementAccess): Remove useless bits for now - keep checks as the spec
23620 2001-10-08 Ravi Pratap <ravi@ximian.com>
23622 * expression.cs (ElementAccess::DoResolve): Remove my crap code
23623 and start performing checks according to the spec.
23625 2001-10-07 Ravi Pratap <ravi@ximian.com>
23627 * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23628 rank_specifiers instead.
23630 (rank_specifiers): Change the order in which the rank specifiers are stored
23632 (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23634 * expression.cs (ElementAccess): Implement the LValue interface too.
23636 2001-10-06 Ravi Pratap <ravi@ximian.com>
23638 * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23639 except that user defined conversions are not included.
23641 (UserDefinedConversion): Update to use the ConvertExplicitStandard to
23642 perform the conversion of the return type, if necessary.
23644 (New::DoResolve): Check whether we are creating an array or an object
23645 and accordingly do the needful.
23647 (New::Emit): Same here.
23649 (New::DoResolve): Implement guts of array creation.
23651 (New::FormLookupType): Helper function.
23653 2001-10-07 Miguel de Icaza <miguel@ximian.com>
23655 * codegen.cs: Removed most of the code generation here, and move the
23656 corresponding code generation bits to the statement classes.
23658 Added support for try/catch/finalize and throw.
23660 * cs-parser.jay: Added support for try/catch/finalize.
23662 * class.cs: Catch static methods having the flags override,
23663 virtual or abstract.
23665 * expression.cs (UserCast): This user cast was not really doing
23666 what it was supposed to do. Which is to be born in fully resolved
23667 state. Parts of the resolution were being performed at Emit time!
23671 2001-10-05 Miguel de Icaza <miguel@ximian.com>
23673 * expression.cs: Implicity convert the result from UserCast.
23675 2001-10-05 Ravi Pratap <ravi@ximian.com>
23677 * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23678 prevented it from working correctly.
23680 (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23681 merely ConvertImplicit.
23683 2001-10-05 Miguel de Icaza <miguel@ximian.com>
23685 * typemanager.cs: Make the LookupTypeContainer function static,
23686 and not per-instance.
23688 * class.cs: Make static FindMembers (the one that takes a Type
23691 * codegen.cs: Add EmitForeach here.
23693 * cs-parser.jay: Make foreach a toplevel object instead of the
23694 inline expansion, as we need to perform semantic analysis on it.
23696 2001-10-05 Ravi Pratap <ravi@ximian.com>
23698 * expression.cs (Expression::ImplicitUserConversion): Rename to
23699 UserDefinedConversion.
23701 (Expression::UserDefinedConversion): Take an extra argument specifying
23702 whether we look for explicit user conversions too.
23704 (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23706 (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23708 (ExplicitUserConversion): Make it a call to UserDefinedConversion
23709 with the appropriate arguments.
23711 * cs-parser.jay (cast_expression): Record location too.
23713 * expression.cs (Cast): Record location info.
23715 (Expression::ConvertExplicit): Take location argument.
23717 (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23718 to determine if we are doing explicit conversions.
23720 (UserCast::Emit): Update accordingly.
23722 (Expression::ConvertExplicit): Report an error if everything fails.
23724 * ../errors/cs0030.cs : Add.
23726 2001-10-04 Miguel de Icaza <miguel@ximian.com>
23728 * modifiers.cs: If the ABSTRACT keyword is present, also set the
23729 virtual and newslot bits.
23731 * class.cs (TypeContainer::RegisterRequiredImplementations):
23732 Record methods we need.
23734 (TypeContainer::MakeKey): Helper function to make keys for
23735 MethodBases, since the Methodbase key is useless.
23737 (TypeContainer::Populate): Call RegisterRequiredImplementations
23738 before defining the methods.
23740 Create a mapping for method_builders_to_methods ahead of time
23741 instead of inside a tight loop.
23743 (::RequireMethods): Accept an object as the data to set into the
23744 hashtable so we can report interface vs abstract method mismatch.
23746 2001-10-03 Miguel de Icaza <miguel@ximian.com>
23748 * report.cs: Make all of it static.
23750 * rootcontext.cs: Drop object_type and value_type computations, as
23751 we have those in the TypeManager anyways.
23753 Drop report instance variable too, now it is a global.
23755 * driver.cs: Use try/catch on command line handling.
23757 Add --probe option to debug the error reporting system with a test
23760 * report.cs: Add support for exiting program when a probe
23761 condition is reached.
23763 2001-10-03 Ravi Pratap <ravi@ximian.com>
23765 * expression.cs (Binary::DoNumericPromotions): Fix the case when
23766 we do a forcible conversion regardless of type, to check if
23767 ForceConversion returns a null.
23769 (Binary::error19): Use location to report error.
23771 (Unary::error23): Use location here too.
23773 * ../errors/cs0019.cs : Check in.
23775 * ../errors/cs0023.cs : Check in.
23777 * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23778 case of a non-null MethodInfo object with a length of 0 !
23780 (Binary::ResolveOperator): Flag error if overload resolution fails to find
23781 an applicable member - according to the spec :-)
23782 Also fix logic to find members in base types.
23784 (Unary::ResolveOperator): Same here.
23786 (Unary::report23): Change name to error23 and make first argument a TypeContainer
23787 as I was getting thoroughly confused between this and error19 :-)
23789 * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23790 (::FindMostEncompassedType): Implement.
23791 (::FindMostEncompassingType): Implement.
23792 (::StandardConversionExists): Implement.
23794 (UserImplicitCast): Re-vamp. We now need info about most specific
23795 source and target types so that we can do the necessary conversions.
23797 (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23798 mathematical union with no duplicates.
23800 2001-10-03 Miguel de Icaza <miguel@ximian.com>
23802 * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23803 in order from base classes to child classes, so that we can in
23804 child classes look up in our parent for method names and
23805 attributes (required for handling abstract, virtual, new, override
23806 constructs: we need to instrospect our base class, and if we dont
23807 populate the classes in order, the introspection might be
23808 incorrect. For example, a method could query its parent before
23809 the parent has any methods and would determine that the parent has
23810 no abstract methods (while it could have had them)).
23812 (RootContext::CreateType): Record the order in which we define the
23815 2001-10-02 Miguel de Icaza <miguel@ximian.com>
23817 * class.cs (TypeContainer::Populate): Also method definitions can
23818 fail now, keep track of this.
23820 (TypeContainer::FindMembers): Implement support for
23821 DeclaredOnly/noDeclaredOnly flag.
23823 (Constructor::Emit) Return the ConstructorBuilder.
23825 (Method::Emit) Return the MethodBuilder.
23826 Check for abstract or virtual methods to be public.
23828 * rootcontext.cs (RootContext::CreateType): Register all the
23829 abstract methods required for the class to be complete and the
23830 interface methods that must be implemented.
23832 * cs-parser.jay: Report error 501 (method requires body if it is
23833 not marked abstract or extern).
23835 * expression.cs (TypeOf::Emit): Implement.
23837 * typemanager.cs: runtime_handle_type, new global type.
23839 * class.cs (Property::Emit): Generate code for properties.
23841 2001-10-02 Ravi Pratap <ravi@ximian.com>
23843 * expression.cs (Unary::ResolveOperator): Find operators on base type
23844 too - we now conform exactly to the spec.
23846 (Binary::ResolveOperator): Same here.
23848 * class.cs (Operator::Define): Fix minor quirk in the tests.
23850 * ../errors/cs0215.cs : Added.
23852 * ../errors/cs0556.cs : Added.
23854 * ../errors/cs0555.cs : Added.
23856 2001-10-01 Miguel de Icaza <miguel@ximian.com>
23858 * cs-tokenizer.cs: Reimplemented Location to be a struct with a
23859 single integer which is really efficient
23861 2001-10-01 Ravi Pratap <ravi@ximian.com>
23863 * expression.cs (Expression::ImplicitUserConversion): Use location
23864 even in the case when we are examining True operators.
23866 * class.cs (Operator::Define): Perform extensive checks to conform
23867 with the rules for operator overloading in the spec.
23869 * expression.cs (Expression::ImplicitReferenceConversion): Implement
23870 some of the other conversions mentioned in the spec.
23872 * typemanager.cs (array_type): New static member for the System.Array built-in
23875 (cloneable_interface): For System.ICloneable interface.
23877 * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23878 we start resolving the tree and populating types.
23880 * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23882 2001-10-01 Miguel de Icaza <miguel@ximian.com>
23884 * expression.cs (Expression::ExprClassFromMemberInfo,
23885 Expression::Literalize): Create literal expressions from
23886 FieldInfos which are literals.
23888 (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23889 type casts, because they were wrong. The test suite in tests
23892 (ImplicitNumericConversion): ushort to ulong requires a widening
23895 Int32 constant to long requires widening cast as well.
23897 * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23898 for integers because the type on the stack is not i4.
23900 2001-09-30 Miguel de Icaza <miguel@ximian.com>
23902 * expression.cs (report118): require location argument.
23904 * parameter.cs: Do not dereference potential null value.
23906 * class.cs: Catch methods that lack the `new' keyword when
23907 overriding a name. Report warnings when `new' is used without
23908 anything being there to override.
23910 * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23912 * class.cs: Only add constructor to hashtable if it is non-null
23913 (as now constructors can fail on define).
23915 (TypeManager, Class, Struct): Take location arguments.
23917 Catch field instance initialization in structs as errors.
23919 accepting_filter: a new filter for FindMembers that is static so
23920 that we dont create an instance per invocation.
23922 (Constructor::Define): Catch errors where a struct constructor is
23925 * cs-parser.jay: Pass location information for various new
23928 * delegate.cs (Delegate): take a location argument.
23930 * driver.cs: Do not call EmitCode if there were problesm in the
23931 Definition of the types, as many Builders wont be there.
23933 * decl.cs (Decl::Decl): Require a location argument.
23935 * cs-tokenizer.cs: Handle properly hex constants that can not fit
23936 into integers, and find the most appropiate integer for it.
23938 * literal.cs: Implement ULongLiteral.
23940 * rootcontext.cs: Provide better information about the location of
23941 failure when CreateType fails.
23943 2001-09-29 Miguel de Icaza <miguel@ximian.com>
23945 * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23948 * expression.cs (Binary::CheckShiftArguments): Add missing type
23950 (Binary::ResolveOperator): Add type to the logical and and logical
23951 or, Bitwise And/Or and Exclusive Or code paths, it was missing
23954 (Binary::DoNumericPromotions): In the case where either argument
23955 is ulong (and most signed types combined with ulong cause an
23956 error) perform implicit integer constant conversions as well.
23958 2001-09-28 Miguel de Icaza <miguel@ximian.com>
23960 * expression.cs (UserImplicitCast): Method should always be
23962 (Invocation::BetterConversion): Simplified test for IntLiteral.
23964 (Expression::ImplicitNumericConversion): Split this routine out.
23965 Put the code that performs implicit constant integer conversions
23968 (Expression::Resolve): Become a wrapper around DoResolve so we can
23969 check eclass and type being set after resolve.
23971 (Invocation::Badness): Remove this dead function
23973 (Binary::ResolveOperator): Do not compute the expensive argumnets
23974 unless we have a union for it.
23976 (Probe::Emit): Is needs to do an isinst and then
23977 compare against null.
23979 (::CanConvert): Added Location argument. If the Location argument
23980 is null (Location.Null), then we do not report errors. This is
23981 used by the `probe' mechanism of the Explicit conversion. We do
23982 not want to generate an error for something that the user
23983 explicitly requested to be casted. But the pipeline for an
23984 explicit cast first tests for potential implicit casts.
23986 So for now, if the Location is null, it means `Probe only' to
23987 avoid adding another argument. Might have to revise this
23990 (ClassCast): New class used to type cast objects into arbitrary
23991 classes (used in Explicit Reference Conversions).
23993 Implement `as' as well.
23995 Reverted all the patches from Ravi below: they were broken:
23997 * The use of `level' as a mechanism to stop recursive
23998 invocations is wrong. That was there just to catch the
23999 bug with a strack trace but not as a way of addressing
24002 To fix the problem we have to *understand* what is going
24003 on and the interactions and come up with a plan, not
24004 just get things going.
24006 * The use of the type conversion cache that I proposed
24007 last night had an open topic: How does this work across
24008 protection domains. A user defined conversion might not
24009 be public in the location where we are applying the
24010 conversion, a different conversion might be selected
24011 (ie, private A->B (better) but public B->A (worse),
24012 inside A, A->B applies, but outside it, B->A will
24015 * On top of that (ie, even if the above is solved),
24016 conversions in a cache need to be abstract. Ie, `To
24017 convert from an Int to a Short use an OpcodeCast', not
24018 `To convert from an Int to a Short use the OpcodeCast on
24019 the variable 5' (which is what this patch was doing).
24021 2001-09-28 Ravi Pratap <ravi@ximian.com>
24023 * expression.cs (Invocation::ConversionExists): Re-write to use
24024 the conversion cache
24026 (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
24027 cache all conversions done, not just user-defined ones.
24029 (Invocation::BetterConversion): The real culprit. Use ConversionExists
24030 to determine if a conversion exists instead of acutually trying to
24031 perform the conversion. It's faster too.
24033 (Expression::ConvertExplicit): Modify to use ConversionExists to check
24034 and only then attempt the implicit conversion.
24036 2001-09-28 Ravi Pratap <ravi@ximian.com>
24038 * expression.cs (ConvertImplicit): Use a cache for conversions
24039 already found. Check level of recursion and bail out if necessary.
24041 2001-09-28 Miguel de Icaza <miguel@ximian.com>
24043 * typemanager.cs (string_concat_string_string, string_concat_object_object):
24044 Export standard methods that we expect for string operations.
24046 * statement.cs (Block::UsageWarning): Track usage of variables and
24047 report the errors for not used variables.
24049 * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
24052 2001-09-27 Miguel de Icaza <miguel@ximian.com>
24054 * codegen.cs: remove unnneded code
24056 * expression.cs: Removed BuiltinTypeAccess class
24058 Fix the order in which implicit conversions are
24061 The previous fixed dropped support for boxed conversions (adding a
24062 test to the test suite now)
24064 (UserImplicitCast::CanConvert): Remove test for source being null,
24065 that code is broken. We should not feed a null to begin with, if
24066 we do, then we should track the bug where the problem originates
24067 and not try to cover it up here.
24069 Return a resolved expression of type UserImplicitCast on success
24070 rather than true/false. Ravi: this is what I was talking about,
24071 the pattern is to use a static method as a "constructor" for
24074 Also, do not create arguments until the very last minute,
24075 otherwise we always create the arguments even for lookups that
24076 will never be performed.
24078 (UserImplicitCast::Resolve): Eliminate, objects of type
24079 UserImplicitCast are born in a fully resolved state.
24081 * typemanager.cs (InitCoreTypes): Init also value_type
24082 (System.ValueType).
24084 * expression.cs (Cast::Resolve): First resolve the child expression.
24086 (LValue): Add new method AddressOf to be used by
24089 Change the argument of Store to take an EmitContext instead of an
24090 ILGenerator, because things like FieldExpr need to be able to call
24091 their children expression to generate the instance code.
24093 (Expression::Error, Expression::Warning): Sugar functions for
24096 (Expression::MemberLookup): Accept a TypeContainer instead of a
24097 Report as the first argument.
24099 (Expression::ResolvePrimary): Killed. I still want to improve
24100 this as currently the code is just not right.
24102 (Expression::ResolveMemberAccess): Simplify, but it is still
24105 (Unary::Resolve): Catch errors in AddressOf operators.
24107 (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
24108 index to a byte for the short-version, or the compiler will choose
24109 the wrong Emit call, which generates the wrong data.
24111 (ParameterReference::Emit, ::Store): same.
24113 (FieldExpr::AddressOf): Implement.
24115 * typemanager.cs: TypeManager: made public variable instead of
24118 * driver.cs: document --fatal.
24120 * report.cs (ErrorMessage, WarningMessage): new names for the old
24121 Error and Warning classes.
24123 * cs-parser.jay (member_access): Turn built-in access to types
24124 into a normal simplename
24126 2001-09-27 Ravi Pratap <ravi@ximian.com>
24128 * expression.cs (Invocation::BetterConversion): Fix to cope
24129 with q being null, since this was introducing a bug.
24131 * expression.cs (ConvertImplicit): Do built-in conversions first.
24133 2001-09-27 Ravi Pratap <ravi@ximian.com>
24135 * expression.cs (UserImplicitCast::Resolve): Fix bug.
24137 2001-09-27 Ravi Pratap <ravi@ximian.com>
24139 * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
24140 I had introduced long ago (what's new ?).
24142 * expression.cs (UserImplicitCast::CanConvert): Static method to do
24143 the work of all the checking.
24144 (ConvertImplicit): Call CanConvert and only then create object if necessary.
24145 (UserImplicitCast::CanConvert, ::Resolve): Re-write.
24147 (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
24148 that is the right way.
24150 (Invocation::MakeUnionSet): Convenience function to make unions of sets for
24151 overloading resolution. Use everywhere instead of cutting and pasting code.
24153 (Binary::ResolveOperator): Use MakeUnionSet.
24155 (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when
24156 we have to convert to bool types. Not complete yet.
24158 2001-09-27 Miguel de Icaza <miguel@ximian.com>
24160 * typemanager.cs (TypeManager::CSharpName): support ushort.
24162 * expression.cs (Expression::TryImplicitIntConversion): Attempts
24163 to provide an expression that performsn an implicit constant int
24164 conversion (section 6.1.6).
24165 (Expression::ConvertImplicitRequired): Reworked to include
24166 implicit constant expression conversions.
24168 (Expression::ConvertNumericExplicit): Finished.
24170 (Invocation::Emit): If InstanceExpression is null, then it means
24171 that we perform a call on this.
24173 2001-09-26 Miguel de Icaza <miguel@ximian.com>
24175 * expression.cs (Unary::Emit): Remove some dead code.
24176 (Probe): Implement Resolve and Emit for `is'.
24177 (Expression::ConvertImplicitRequired): Attempt to do constant
24178 expression conversions here. Maybe should be moved to
24179 ConvertImplicit, but I am not sure.
24180 (Expression::ImplicitLongConstantConversionPossible,
24181 Expression::ImplicitIntConstantConversionPossible): New functions
24182 that tell whether is it possible to apply an implicit constant
24183 expression conversion.
24185 (ConvertNumericExplicit): Started work on explicit numeric
24188 * cs-parser.jay: Update operator constants.
24190 * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
24191 (Parameters::GetSignature): Hook up VerifyArgs here.
24192 (Parameters::VerifyArgs): Verifies that no two arguments have the
24195 * class.cs (Operator): Update the operator names to reflect the
24196 ones that the spec expects (as we are just stringizing the
24199 * expression.cs (Unary::ResolveOperator): Fix bug: Use
24200 MethodInfo's ReturnType instead of LookupMethodByBuilder as the
24201 previous usage did only work for our methods.
24202 (Expression::ConvertImplicit): Handle decimal implicit numeric
24203 conversions as well.
24204 (Expression::InternalTypeConstructor): Used to invoke constructors
24205 on internal types for default promotions.
24207 (Unary::Emit): Implement special handling for the pre/post
24208 increment/decrement for overloaded operators, as they need to have
24209 the same semantics as the other operators.
24211 (Binary::ResolveOperator): ditto.
24212 (Invocation::ConversionExists): ditto.
24213 (UserImplicitCast::Resolve): ditto.
24215 2001-09-26 Ravi Pratap <ravi@ximian.com>
24217 * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
24218 operator, return after emitting body. Regression tests pass again !
24220 * expression.cs (ConvertImplicit): Take TypeContainer as first argument
24221 (Unary::ForceConversion, Binary::ForceConversion): Ditto.
24222 (Invocation::OverloadResolve): Ditto.
24223 (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
24225 * everywhere : update calls to the above methods accordingly.
24227 2001-09-26 Miguel de Icaza <miguel@ximian.com>
24229 * assign.cs (Assign): Make it inherit from ExpressionStatement.
24231 * expression.cs (ExpressionStatement): New base class used for
24232 expressions that can appear in statements, so that we can provide
24233 an alternate path to generate expression that do not leave a value
24236 (Expression::Emit, and all the derivatives): We no longer return
24237 whether a value is left on the stack or not. Every expression
24238 after being emitted leaves a single value on the stack.
24240 * codegen.cs (EmitContext::EmitStatementExpression): Use the
24241 facilties of ExpressionStatement if possible.
24243 * cs-parser.jay: Update statement_expression.
24245 2001-09-25 Miguel de Icaza <miguel@ximian.com>
24247 * driver.cs: Change the wording of message
24249 2001-09-25 Ravi Pratap <ravi@ximian.com>
24251 * expression.cs (Binary::ResolveOperator): Had forgottten to set
24252 the type of the expression to the return type of the method if
24253 we have an overloaded operator match ! The regression tests pass again !
24254 (Unary::ResolveOperator): Ditto.
24256 * expression.cs (Invocation::ConversionExists): Correct the member lookup
24257 to find "op_Implicit", not "implicit" ;-)
24258 (UserImplicitCast): New class to take care of user-defined implicit conversions.
24259 (ConvertImplicit, ForceConversion): Take TypeContainer argument
24261 * everywhere : Correct calls to the above accordingly.
24263 * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
24264 (ConvertImplicit): Do user-defined conversion if it exists.
24266 2001-09-24 Miguel de Icaza <miguel@ximian.com>
24268 * assign.cs: track location.
24269 (Resolve): Use implicit conversions on assignment.
24271 * literal.cs: Oops. Not good, Emit of short access values should
24272 pass (Bytes) or the wrong argument will be selected.
24274 * expression.cs (Unary::Emit): Emit code for -expr.
24276 (Unary::ResolveOperator): Handle `Substract' for non-constants
24277 (substract from zero from the non-constants).
24278 Deal with Doubles as well.
24280 (Expression::ConvertImplicitRequired): New routine that reports an
24281 error if no implicit conversion exists.
24283 (Invocation::OverloadResolve): Store the converted implicit
24284 expressions if we make them
24286 2001-09-24 Ravi Pratap <ravi@ximian.com>
24288 * class.cs (ConstructorInitializer): Take a Location argument.
24289 (ConstructorBaseInitializer): Same here.
24290 (ConstructorThisInitializer): Same here.
24292 * cs-parser.jay : Update all calls accordingly.
24294 * expression.cs (Unary, Binary, New): Take location argument.
24295 Update accordingly everywhere.
24297 * cs-parser.jay : Update all calls to the above to take a location
24300 * class.cs : Ditto.
24302 2001-09-24 Ravi Pratap <ravi@ximian.com>
24304 * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
24305 (Invocation::BetterConversion): Same here
24306 (Invocation::ConversionExists): Ditto.
24308 (Invocation::ConversionExists): Implement.
24310 2001-09-22 Ravi Pratap <ravi@ximian.com>
24312 * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
24313 Also take an additional TypeContainer argument.
24315 * All over : Pass in TypeContainer as argument to OverloadResolve.
24317 * typemanager.cs (CSharpName): Update to check for the string type and return
24320 * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
24323 2001-09-21 Ravi Pratap <ravi@ximian.com>
24325 * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
24326 (Invocation::BetterFunction): Implement.
24327 (Invocation::BetterConversion): Implement.
24328 (Invocation::ConversionExists): Skeleton, no implementation yet.
24330 Okay, things work fine !
24332 2001-09-21 Miguel de Icaza <miguel@ximian.com>
24334 * typemanager.cs: declare and load enum_type, delegate_type and
24337 * expression.cs (Expression::Emit): Now emit returns a value that
24338 tells whether a value is left on the stack or not. This strategy
24339 might be reveted tomorrow with a mechanism that would address
24340 multiple assignments.
24341 (Expression::report118): Utility routine to report mismatches on
24344 (Unary::Report23): Report impossible type/operator combination
24347 (Unary::IsIncrementableNumber): Whether the type can be
24348 incremented or decremented with add.
24349 (Unary::ResolveOperator): Also allow enumerations to be bitwise
24351 (Unary::ResolveOperator): Implement ++, !, ~,
24353 (Invocation::Emit): Deal with new Emit convetion.
24355 * All Expression derivatives: Updated their Emit method to return
24356 whether they leave values on the stack or not.
24358 * codegen.cs (CodeGen::EmitStatement): Pop values left on the
24359 stack for expressions that are statements.
24361 2001-09-20 Miguel de Icaza <miguel@ximian.com>
24363 * expression.cs (LValue): New interface. Must be implemented by
24365 (LocalVariableReference, ParameterReference, FieldExpr): Implement
24368 * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
24369 interface for generating code, simplifies the code.
24371 2001-09-20 Ravi Pratap <ravi@ximian.com>
24373 * expression.cs (everywhere): Comment out return statements in ::Resolve
24374 methods to avoid the warnings.
24376 2001-09-20 Miguel de Icaza <miguel@ximian.com>
24378 * driver.cs (parse): Report error 2001 if we can not open the
24381 * expression.cs (SimpleName::ResolveSimpleName): Error if we can
24384 * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
24387 * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
24388 otherwise nested blocks end up with the same index.
24390 * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
24392 * expression.cs: Instead of having FIXMEs in the Resolve
24393 functions, throw exceptions so it is obvious that we are facing a
24396 * cs-parser.jay (invocation_expression): Pass Location information.
24398 * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
24399 Use a basename for those routines because .NET does not like paths
24402 * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
24405 2001-09-19 Miguel de Icaza <miguel@ximian.com>
24407 * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
24408 are loading the correct data types (throws an exception if not).
24409 (TypeManager::InitCoreTypes): Use CoreLookupType
24411 * expression.cs (Unary::ResolveOperator): return the child
24412 expression for expressions which are just +expr.
24413 (Unary::ResolveOperator): Return negative literals for -LITERAL
24414 expressions (otherwise they are Unary {Literal}).
24415 (Invocation::Badness): Take into account `Implicit constant
24416 expression conversions'.
24418 * literal.cs (LongLiteral): Implement long literal class.
24419 (IntLiteral): export the `Value' of the intliteral.
24421 2001-09-19 Ravi Pratap <ravi@ximian.com>
24423 * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
24425 * class.cs (Operator::Define): Change the methodname prefix to 'op_'
24426 instead of 'Operator'
24428 * expression.cs (Binary::ResolveOperator): Update accordingly.
24429 (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
24432 * cs-parser.jay (unary_expression): Update to use the new names.
24434 * gen-treedump.cs (GetUnary): Same here.
24436 * expression.cs (Unary::Resolve): Implement.
24437 (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded
24438 operators are found instead of making noise ;-)
24439 (Unary::ResolveOperator): New method to do precisely the same thing which
24440 Binary::ResolveOperator does for Binary expressions.
24441 (Unary.method, .Arguments): Add.
24442 (Unary::OperName): Implement.
24443 (Unary::ForceConversion): Copy and Paste !
24445 * class.cs (Operator::Define): Fix a small bug for the case when we have
24448 * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
24449 for the inbuilt operators. Only overloading works for now ;-)
24451 2001-09-18 Miguel de Icaza <miguel@ximian.com>
24453 * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
24454 UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
24456 * expression.cs (This::Emit): Implement.
24457 (This::Resolve): Implement.
24458 (TypeOf:Resolve): Implement.
24459 (Expression::ResolveSimpleName): Add an implicit this to instance
24461 (MemberAccess::Resolve): Deal with Parameters and Fields.
24462 Bind instance variable to Field expressions.
24463 (FieldExpr::Instance): New field used to track the expression that
24464 represents the object instance.
24465 (FieldExpr::Resolve): Track potential errors from MemberLookup not
24467 (FieldExpr::Emit): Implement.
24469 * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
24470 the last instruction contains a return opcode to avoid generating
24471 the last `ret' instruction (this generates correct code, and it is
24472 nice to pass the peverify output).
24474 * class.cs (TypeContainer::EmitFieldInitializers): Implement field
24475 initializer for static and instance variables.
24476 (Constructor::Emit): Allow initializer to be null in the case of
24477 static constructors. Only emit initializer for instance
24480 (TypeContainer::FindMembers): Return a null array if there are no
24483 Also fix the code for the MemberTypes.Method branch, as it was not
24484 scanning that for operators (or tried to access null variables before).
24486 * assign.cs (Assign::Emit): Handle instance and static fields.
24490 * driver.cs: Stop compilation if there are parse errors.
24492 * cs-parser.jay (constructor_declaration): Provide default base
24493 initializer for non-static constructors.
24494 (constructor_declarator): Do not provide a default base
24495 initializers if none was specified.
24496 Catch the fact that constructors should not have parameters.
24498 * class.cs: Do not emit parent class initializers for static
24499 constructors, that should be flagged as an error.
24501 2001-09-18 Ravi Pratap <ravi@ximian.com>
24503 * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
24504 Move back code into TypeContainer::Populate.
24506 2001-09-18 Ravi Pratap <ravi@ximian.com>
24508 * class.cs (TypeContainer::AddConstructor): Fix the check to
24509 compare against Name, not Basename.
24510 (Operator::OpType): Change Plus and Minus to Add and Subtract.
24512 * cs-parser.jay : Update accordingly.
24514 * class.cs (TypeContainer::FindMembers): For the case where we are searching
24515 for methods, don't forget to look into the operators too.
24516 (RegisterMethodBuilder): Helper method to take care of this for
24517 methods, constructors and operators.
24518 (Operator::Define): Completely revamp.
24519 (Operator.OperatorMethod, MethodName): New fields.
24520 (TypeContainer::Populate): Move the registering of builders into
24521 RegisterMethodBuilder.
24522 (Operator::Emit): Re-write.
24524 * expression.cs (Binary::Emit): Comment out code path to emit method
24525 invocation stuff for the case when we have a user defined operator. I am
24526 just not able to get it right !
24528 2001-09-17 Miguel de Icaza <miguel@ximian.com>
24530 * expression.cs (Expression::OverloadResolve): Drop TypeContainer
24533 (Expression::MemberLookup): Provide a version that allows to
24534 specify the MemberTypes and BindingFlags.
24536 * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
24537 so it was not fetching variable information from outer blocks.
24539 * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
24540 Beforefieldinit as it was buggy.
24542 * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
24543 that Ravi put here.
24545 * class.cs (Constructor::Emit): Only emit if block is not null.
24546 (TypeContainer::EmitDefaultConstructor): Removed routine, now we
24547 deal with this by semantically definining it as if the user had
24550 (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
24551 constructors as we now "emit" them at a higher level.
24553 (TypeContainer::DefineDefaultConstructor): Used to define the
24554 default constructors if none was provided.
24556 (ConstructorInitializer): Add methods Resolve and Emit.
24558 * expression.cs: Cast to ConstructorInfo instead of MethodInfo
24560 2001-09-17 Ravi Pratap <ravi@ximian.com>
24562 * class.cs (TypeContainer::EmitDefaultConstructor): Register
24563 the default constructor builder with our hashtable for methodbuilders
24566 * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24567 and argument_count is 0 in which case we have a match.
24568 (Binary::ResolveOperator): More null checking and miscellaneous coding
24571 2001-09-17 Ravi Pratap <ravi@ximian.com>
24573 * rootcontext.cs (IsNameSpace): Compare against null.
24575 * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24577 * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24578 and Unary::Operator.
24580 * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24583 * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24584 we have overloaded operators.
24585 (Binary::ResolveOperator): Implement the part which does the operator overload
24588 * class.cs (Operator::Emit): Implement.
24589 (TypeContainer::Emit): Emit the operators we have too.
24591 * expression.cs (Binary::Emit): Update to emit the appropriate code for
24592 the case when we have a user-defined operator.
24594 2001-09-17 Miguel de Icaza <miguel@ximian.com>
24596 * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24598 2001-09-16 Ravi Pratap <ravi@ximian.com>
24600 * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24601 (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24602 (Constructor::Emit): Implement.
24603 (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24604 if we have no work to do.
24605 (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's
24608 * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24609 (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24611 * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24614 2001-09-15 Ravi Pratap <ravi@ximian.com>
24616 * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24618 (Tree::RecordNamespace): Method to do what the name says ;-)
24619 (Tree::Namespaces): Property to get at the namespaces hashtable.
24621 * cs-parser.jay (namespace_declaration): Call RecordNamespace to
24624 * rootcontext.cs (IsNamespace): Fixed it :-)
24626 2001-09-14 Miguel de Icaza <miguel@ximian.com>
24628 * class.cs (TypeContainer::FindMembers): Add support for
24630 (MethodCore): New class that encapsulates both the shared aspects
24631 of a Constructor and a Method.
24632 (Method, Constructor): Factored pieces into MethodCore.
24634 * driver.cs: Added --fatal which makes errors throw exceptions.
24635 Load System assembly as well as part of the standard library.
24637 * report.cs: Allow throwing exceptions on errors for debugging.
24639 * modifiers.cs: Do not use `parent', instead use the real type
24640 container to evaluate permission settings.
24642 * class.cs: Put Ravi's patch back in. He is right, and we will
24643 have to cope with the
24645 2001-09-14 Ravi Pratap <ravi@ximian.com>
24647 * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
24648 FamORAssem, not FamANDAssem.
24650 2001-09-14 Miguel de Icaza <miguel@ximian.com>
24652 * driver.cs: Added --parse option that only parses its input files
24655 * class.cs: Reverted last change from Ravi to IsTopLevel. That is
24656 incorrect. IsTopLevel is not used to tell whether an object is
24657 root_types or not (that can be achieved by testing this ==
24658 root_types). But to see if this is a top-level *class* (not
24659 necessarly our "toplevel" container).
24661 2001-09-14 Ravi Pratap <ravi@ximian.com>
24663 * enum.cs (Enum::Define): Modify to call the Lookup method on the
24664 parent instead of a direct call to GetType.
24666 2001-09-14 Ravi Pratap <ravi@ximian.com>
24668 * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
24669 Modifiers.TypeAttr. This should just be a call to that method.
24671 * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
24672 object so that we can determine if we are top-level or not.
24674 * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the
24677 * enum.cs (Enum::Define): Ditto.
24679 * modifiers.cs (FieldAttr): Re-write.
24681 * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24682 (TypeContainer::HaveStaticConstructor): New property to provide access
24683 to precisely that info.
24685 * modifiers.cs (MethodAttr): Re-write.
24686 (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24688 * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24689 of top-level types as claimed.
24691 2001-09-13 Miguel de Icaza <miguel@ximian.com>
24693 * expression.cs (MemberLookup): Fruitless attempt to lookup
24694 constructors. Maybe I need to emit default constructors? That
24695 might be it (currently .NET emits this for me automatically).
24696 (Invocation::OverloadResolve): Cope with Arguments == null.
24697 (Invocation::EmitArguments): new function, shared by the new
24698 constructor and us.
24699 (Invocation::Emit): Handle static and instance methods. Emit
24700 proper call instruction for virtual or non-virtual invocations.
24701 (New::Emit): Implement.
24702 (New::Resolve): Implement.
24703 (MemberAccess:Resolve): Implement.
24704 (MethodGroupExpr::InstanceExpression): used conforming to the spec
24705 to track instances.
24706 (FieldExpr::Resolve): Set type.
24708 * support.cs: Handle empty arguments.
24710 * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24711 SimpleLookup): Auxiliary routines to help parse a qualifier
24714 Update qualifier_identifier rule.
24716 * codegen.cs: Removed debugging messages.
24718 * class.cs: Make this a global thing, this acts just as a "key" to
24719 objects that we might have around.
24721 (Populate): Only initialize method_builders_to_methods once.
24723 * expression.cs (PropertyExpr): Initialize type from the
24726 * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24727 Resolve pattern. Attempt to implicitly convert value to boolean.
24730 * expression.cs: Set the type for the int32/int32 argument case.
24731 (Binary::ResolveOperator): Set the return type to boolean for
24732 comparission operators
24734 * typemanager.cs: Remove debugging print code.
24736 (Invocation::Resolve): resolve type.
24738 * class.cs: Allocate a MemberInfo of the correct size, as the code
24739 elsewhere depends on the test to reflect the correct contents.
24741 (Method::) Keep track of parameters, due to System.Reflection holes
24743 (TypeContainer::Populate): Keep track of MethodBuilders to Method
24746 (TypeContainer::FindMembers): Use ArrayList and then copy an array
24747 of the exact size and return that.
24749 (Class::LookupMethodByBuilder): New function that maps
24750 MethodBuilders to its methods. Required to locate the information
24751 on methods because System.Reflection bit us again.
24753 * support.cs: New file, contains an interface ParameterData and
24754 two implementations: ReflectionParameters and InternalParameters
24755 used to access Parameter information. We will need to grow this
24758 * expression.cs (Invocation::GetParameterData): implement a cache
24759 and a wrapper around the ParameterData creation for methods.
24760 (Invocation::OverloadResolve): Use new code.
24762 2001-09-13 Ravi Pratap <ravi@ximian.com>
24764 * class.cs (TypeContainer::EmitField): Remove and move into
24765 (Field::Define): here and modify accordingly.
24766 (Field.FieldBuilder): New member.
24767 (TypeContainer::Populate): Update accordingly.
24768 (TypeContainer::FindMembers): Implement.
24770 2001-09-13 Miguel de Icaza <miguel@ximian.com>
24772 * statement.cs: (VariableInfo::VariableType): New field to be
24773 initialized with the full type once it is resolved.
24775 2001-09-12 Miguel de Icaza <miguel@ximian.com>
24777 * parameter.cs (GetParameterInfo): Use a type cache to compute
24778 things only once, and to reuse this information
24780 * expression.cs (LocalVariableReference::Emit): Implement.
24781 (OpcodeCast::Emit): fix.
24783 (ParameterReference::Resolve): Implement.
24784 (ParameterReference::Emit): Implement.
24786 * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24787 that are expressions need to stay as Expressions.
24789 * typemanager.cs (CSharpName): Returns the C# name of a type if
24792 * expression.cs (Expression::ConvertImplicit): New function that
24793 implements implicit type conversions.
24795 (Expression::ImplicitReferenceConversion): Implements implicit
24796 reference conversions.
24798 (EmptyCast): New type for transparent casts.
24800 (OpcodeCast): New type for casts of types that are performed with
24801 a sequence of bytecodes.
24803 (BoxedCast): New type used for casting value types into reference
24804 types. Emits a box opcode.
24806 (Binary::DoNumericPromotions): Implements numeric promotions of
24807 and computation of the Binary::Type.
24809 (Binary::EmitBranchable): Optimization.
24811 (Binary::Emit): Implement code emission for expressions.
24813 * typemanager.cs (TypeManager): Added two new core types: sbyte
24816 2001-09-12 Ravi Pratap <ravi@ximian.com>
24818 * class.cs (TypeContainer::FindMembers): Method which does exactly
24819 what Type.FindMembers does, only we don't have to use reflection. No
24820 implementation yet.
24822 * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24823 typecontainer objects as we need to get at them.
24824 (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24826 * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24827 typecontainer object.
24829 * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
24830 of just a Report object.
24832 2001-09-11 Ravi Pratap <ravi@ximian.com>
24834 * class.cs (Event::Define): Go back to using the prefixes "add_" and
24836 (TypeContainer::Populate): Now define the delegates of the type too.
24837 (TypeContainer.Delegates): Property to access the list of delegates defined
24840 * delegates.cs (Delegate::Define): Implement partially.
24842 * modifiers.cs (TypeAttr): Handle more flags.
24844 2001-09-11 Ravi Pratap <ravi@ximian.com>
24846 * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
24848 (Operator::Define): Re-write logic to get types by using the LookupType method
24849 instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
24850 (Indexer::Define): Ditto.
24851 (Event::Define): Ditto.
24852 (Property::Define): Ditto.
24854 2001-09-10 Ravi Pratap <ravi@ximian.com>
24856 * class.cs (TypeContainer::Populate): Now define operators too.
24857 (TypeContainer.Operators): New property to access the list of operators
24859 (Operator.OperatorMethodBuilder): New member to hold the method builder
24860 for the operator we are defining.
24861 (Operator::Define): Implement.
24863 2001-09-10 Ravi Pratap <ravi@ximian.com>
24865 * class.cs (Event::Define): Make the prefixes of the accessor methods
24866 addOn_ and removeOn_
24868 * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24869 of the location being passed in too. Ideally, this should go later since all
24870 error reporting should be done through the Report object.
24872 * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24873 (Populate): Iterate thru the indexers we have and define them too.
24874 (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24875 for the get and set accessors.
24876 (Indexer::Define): Implement.
24878 2001-09-09 Miguel de Icaza <miguel@ximian.com>
24880 * expression.cs (Binary::Resolve): Beginning of it. I scratched
24881 my previous implementation, did not work.
24883 * typemanager.cs: Add a couple of missing types (the longs).
24885 * literal.cs: Use TypeManager.bool_type instead of getting it.
24887 * expression.cs (EventExpr): New kind of expressions.
24888 (Expressio::ExprClassFromMemberInfo): finish
24890 2001-09-08 Miguel de Icaza <miguel@ximian.com>
24892 * assign.cs: Emit stores to static fields differently.
24894 2001-09-08 Ravi Pratap <ravi@ximian.com>
24896 * Merge in changes and adjust code to tackle conflicts. Backed out my
24897 code in Assign::Resolve ;-)
24899 2001-09-08 Ravi Pratap <ravi@ximian.com>
24901 * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24902 instead Report.Error and also pass in the location.
24903 (CSharpParser::Lexer): New readonly property to return the reference
24904 to the Tokenizer object.
24905 (declare_local_variables): Use Report.Error with location instead of plain
24909 * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24910 (Operator.CheckBinaryOperator): Ditto.
24912 * cs-parser.jay (operator_declarator): Update accordingly.
24914 * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24915 (CheckBinaryOperator): Same here.
24917 * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24918 on the name without any prefixes of namespace names etc. This is because we
24919 already might have something already fully qualified like
24920 'System.Console.WriteLine'
24922 * assign.cs (Resolve): Begin implementation. Stuck ;-)
24924 2001-09-07 Ravi Pratap <ravi@ximian.com>
24926 * cs-tokenizer.cs (location): Return a string which also contains
24929 * expression.cs (ElementAccess): New class for expressions of the
24930 type 'element access.'
24931 (BaseAccess): New class for expressions of the type 'base access.'
24932 (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24935 * cs-parser.jay (element_access): Implement action.
24936 (base_access): Implement actions.
24937 (checked_expression, unchecked_expression): Implement.
24939 * cs-parser.jay (local_variable_type): Correct and implement.
24940 (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24942 * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24944 * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24945 name and the specifiers.
24947 * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24949 * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of
24950 making them all public ;-)
24952 * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24955 2001-09-07 Miguel de Icaza <miguel@ximian.com>
24957 * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24959 (FieldExpr, PropertyExprs): New resolved expressions.
24960 (SimpleName::MemberStaticCheck): Perform static checks for access
24961 to non-static fields on static methods. Maybe this should be
24962 generalized for MemberAccesses.
24963 (SimpleName::ResolveSimpleName): More work on simple name
24966 * cs-parser.jay (primary_expression/qualified_identifier): track
24967 the parameter index.
24969 * codegen.cs (CodeGen::Save): Catch save exception, report error.
24970 (EmitContext::EmitBoolExpression): Chain to expression generation
24971 instead of temporary hack.
24972 (::EmitStatementExpression): Put generic expression code generation.
24974 * assign.cs (Assign::Emit): Implement variable assignments to
24975 local variables, parameters and fields.
24977 2001-09-06 Miguel de Icaza <miguel@ximian.com>
24979 * statement.cs (Block::GetVariableInfo): New method, returns the
24980 VariableInfo for a variable name in a block.
24981 (Block::GetVariableType): Implement in terms of GetVariableInfo
24983 * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24984 DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24986 2001-09-06 Ravi Pratap <ravi@ximian.com>
24988 * cs-parser.jay (operator_declaration): Continue on my quest : update
24989 to take attributes argument.
24990 (event_declaration): Ditto.
24991 (enum_declaration): Ditto.
24992 (indexer_declaration): Ditto.
24994 * class.cs (Operator::Operator): Update constructor accordingly.
24995 (Event::Event): Ditto.
24997 * delegate.cs (Delegate::Delegate): Same here.
24999 * enum.cs (Enum::Enum): Same here.
25001 2001-09-05 Ravi Pratap <ravi@ximian.com>
25003 * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
25005 * ../tests/cs0658.cs : New file to demonstrate error 0658.
25007 * attribute.cs (Attributes): New class to encapsulate all attributes which were
25008 being passed around as an arraylist.
25009 (Attributes::AddAttribute): Method to add attribute sections.
25011 * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
25012 (struct_declaration): Update accordingly.
25013 (constant_declaration): Update.
25014 (field_declaration): Update.
25015 (method_header): Update.
25016 (fixed_parameter): Update.
25017 (parameter_array): Ditto.
25018 (property_declaration): Ditto.
25019 (destructor_declaration): Ditto.
25021 * class.cs (Struct::Struct): Update constructors accordingly.
25022 (Class::Class): Ditto.
25023 (Field::Field): Ditto.
25024 (Method::Method): Ditto.
25025 (Property::Property): Ditto.
25026 (TypeContainer::OptAttribute): update property's return type.
25028 * interface.cs (Interface.opt_attributes): New member.
25029 (Interface::Interface): Update to take the extra Attributes argument.
25031 * parameter.cs (Parameter::Parameter): Ditto.
25033 * constant.cs (Constant::Constant): Ditto.
25035 * interface.cs (InterfaceMemberBase): New OptAttributes field.
25036 (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take
25037 the attributes as a parameter.
25038 (InterfaceProperty): Update constructor call.
25039 (InterfaceEvent): Ditto.
25040 (InterfaceMethod): Ditto.
25041 (InterfaceIndexer): Ditto.
25043 * cs-parser.jay (interface_indexer_declaration): Update call to constructor to
25044 pass the attributes too.
25045 (interface_event_declaration): Ditto.
25046 (interface_property_declaration): Ditto.
25047 (interface_method_declaration): Ditto.
25048 (interface_declaration): Ditto.
25050 2001-09-05 Miguel de Icaza <miguel@ximian.com>
25052 * class.cs (Method::Define): Track the "static Main" definition to
25053 create an entry point.
25055 * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
25056 EntryPoint if we find it.
25058 * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
25059 (EmitContext::ig): Make this variable public.
25061 * driver.cs: Make the default output file be the first file name
25062 with the .exe extension.
25064 Detect empty compilations
25066 Handle various kinds of output targets. Handle --target and
25067 rename -t to --dumper.
25069 * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
25070 methods inherited from Expression return now an Expression. This
25071 will is used during the tree rewriting as we resolve them during
25074 (Expression::MemberLookup): Implements the MemberLookup (7.3) from
25075 the spec. Missing entirely is the information about
25076 accessability of elements of it.
25078 (Expression::ExprClassFromMemberInfo): New constructor for
25079 Expressions that creates a fully initialized Expression based on
25080 a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
25083 (Invocation::Resolve): Begin implementing resolution of invocations.
25085 * literal.cs (StringLiteral): Implement Emit.
25087 2001-09-05 Ravi Pratap <ravi@ximian.com>
25089 * cs-parser.jay (error): Add new modifier because we are hiding an inherited
25092 2001-09-04 Ravi Pratap <ravi@ximian.com>
25094 * cs-parser.jay (attribute_arguments): Implement actions.
25095 (attribute): Fix bug in production. Implement action.
25096 (attribute_list): Implement.
25097 (attribute_target): Implement.
25098 (attribute_target_specifier, opt_target_specifier): Implement
25099 (CheckAttributeTarget): New method to check if the attribute target
25101 (attribute_section): Implement.
25102 (opt_attributes): Implement.
25104 * attribute.cs : New file to handle attributes.
25105 (Attribute): Class to hold attribute info.
25107 * cs-parser.jay (opt_attribute_target_specifier): Remove production
25108 (attribute_section): Modify production to use 2 different rules to
25109 achieve the same thing. 1 s/r conflict down !
25110 Clean out commented, useless, non-reducing dimension_separator rules.
25112 * class.cs (TypeContainer.attributes): New member to hold list
25113 of attributes for a type.
25114 (Struct::Struct): Modify to take one more argument, the attribute list.
25115 (Class::Class): Ditto.
25116 (Field::Field): Ditto.
25117 (Method::Method): Ditto.
25118 (Property::Property): Ditto.
25120 * cs-parser.jay (struct_declaration): Update constructor call to
25121 pass in the attributes too.
25122 (class_declaration): Ditto.
25123 (constant_declaration): Ditto.
25124 (field_declaration): Ditto.
25125 (method_header): Ditto.
25126 (fixed_parameter): Ditto.
25127 (parameter_array): Ditto.
25128 (property_declaration): Ditto.
25130 * constant.cs (Constant::Constant): Update constructor similarly.
25131 Use System.Collections.
25133 * parameter.cs (Parameter::Parameter): Update as above.
25135 2001-09-02 Ravi Pratap <ravi@ximian.com>
25137 * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
25138 (TypeContainer.delegates): New member to hold list of delegates.
25140 * cs-parser.jay (delegate_declaration): Implement the action correctly
25141 this time as I seem to be on crack ;-)
25143 2001-09-02 Miguel de Icaza <miguel@ximian.com>
25145 * rootcontext.cs (RootContext::IsNamespace): new function, used to
25146 tell whether an identifier represents a namespace.
25148 * expression.cs (NamespaceExpr): A namespace expression, used only
25149 temporarly during expression resolution.
25150 (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
25151 utility functions to resolve names on expressions.
25153 2001-09-01 Miguel de Icaza <miguel@ximian.com>
25155 * codegen.cs: Add hook for StatementExpressions.
25157 * class.cs: Fix inverted test for static flag in methods.
25159 2001-09-02 Ravi Pratap <ravi@ximian.com>
25161 * class.cs (Operator::CheckUnaryOperator): Correct error number used
25162 to make it coincide with MS' number.
25163 (Operator::CheckBinaryOperator): Ditto.
25165 * ../errors/errors.txt : Remove error numbers added earlier.
25167 * ../errors/cs1019.cs : Test case for error # 1019
25169 * ../errros/cs1020.cs : Test case for error # 1020
25171 * cs-parser.jay : Clean out commented cruft.
25172 (dimension_separators, dimension_separator): Comment out. Ostensibly not
25173 used anywhere - non-reducing rule.
25174 (namespace_declarations): Non-reducing rule - comment out.
25176 * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
25177 with TypeContainer::AddEnum.
25179 * delegate.cs : New file for delegate handling classes.
25180 (Delegate): Class for declaring delegates.
25182 * makefile : Update.
25184 * cs-parser.jay (delegate_declaration): Implement.
25186 2001-09-01 Ravi Pratap <ravi@che.iitm.ac.in>
25188 * class.cs (Event::Define): Implement.
25189 (Event.EventBuilder): New member.
25191 * class.cs (TypeContainer::Populate): Update to define all enums and events
25193 (Events): New property for the events arraylist we hold. Shouldn't we move to using
25194 readonly fields for all these cases ?
25196 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
25198 * class.cs (Property): Revamp to use the convention of making fields readonly.
25199 Accordingly modify code elsewhere.
25201 * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
25202 the Define method of the Property class.
25204 * class.cs : Clean up applied patch and update references to variables etc. Fix
25206 (TypeContainer::Populate): Update to define all the properties we have. Also
25207 define all enumerations.
25209 * enum.cs (Define): Implement.
25211 2001-08-31 Ravi Pratap <ravi@che.iitm.ac.in>
25213 * cs-parser.jay (overloadable_operator): The semantic value is an
25214 enum of the Operator class.
25215 (operator_declarator): Implement actions.
25216 (operator_declaration): Implement.
25218 * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
25219 validity of definitions.
25220 (Operator::CheckBinaryOperator): Static method to check for binary operators
25221 (TypeContainer::AddOperator): New method to add an operator to a type.
25223 * cs-parser.jay (indexer_declaration): Added line to actually call the
25224 AddIndexer method so it gets added ;-)
25226 * ../errors/errors.txt : Update to include new error numbers. Are these numbers
25227 already taken care of by the MS compiler ?
25229 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
25231 * class.cs (Operator): New class for operator declarations.
25232 (Operator::OpType): Enum for the various operators.
25234 2001-08-29 Ravi Pratap <ravi@che.iitm.ac.in>
25236 * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
25237 ostensibly handle this in semantic analysis.
25239 * cs-parser.jay (general_catch_clause): Comment out
25240 (specific_catch_clauses, specific_catch_clause): Ditto.
25241 (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
25242 (catch_args, opt_catch_args): New productions.
25243 (catch_clause): Rewrite to use the new productions above
25244 (catch_clauses): Modify accordingly.
25245 (opt_catch_clauses): New production to use in try_statement
25246 (try_statement): Revamp. Basically, we get rid of one unnecessary rule
25247 and re-write the code in the actions to extract the specific and
25248 general catch clauses by being a little smart ;-)
25250 * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
25251 Hooray, try and catch statements parse fine !
25253 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
25255 * statement.cs (Block::GetVariableType): Fix logic to extract the type
25256 string from the hashtable of variables.
25258 * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
25259 I end up making that mistake ;-)
25260 (catch_clauses): Fixed gross error which made Key and Value of the
25261 DictionaryEntry the same : $1 !!
25263 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
25265 * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
25267 * cs-parser.jay (event_declaration): Correct to remove the semicolon
25268 when the add and remove accessors are specified.
25270 2001-08-28 Ravi Pratap <ravi@che.iitm.ac.in>
25272 * cs-parser.jay (IndexerDeclaration): New helper class to hold
25273 information about indexer_declarator.
25274 (indexer_declarator): Implement actions.
25275 (parsing_indexer): New local boolean used to keep track of whether
25276 we are parsing indexers or properties. This is necessary because
25277 implicit_parameters come into picture even for the get accessor in the
25278 case of an indexer.
25279 (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
25281 * class.cs (Indexer): New class for indexer declarations.
25282 (TypeContainer::AddIndexer): New method to add an indexer to a type.
25283 (TypeContainer::indexers): New member to hold list of indexers for the
25286 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
25288 * cs-parser.jay (add_accessor_declaration): Implement action.
25289 (remove_accessor_declaration): Implement action.
25290 (event_accessors_declaration): Implement
25291 (variable_declarators): swap statements for first rule - trivial.
25293 * class.cs (Event): New class to hold information about event
25295 (TypeContainer::AddEvent): New method to add an event to a type
25296 (TypeContainer::events): New member to hold list of events.
25298 * cs-parser.jay (event_declaration): Implement actions.
25300 2001-08-27 Ravi Pratap <ravi@che.iitm.ac.in>
25302 * cs-parser.jay (dim_separators): Implement. Make it a string
25303 concatenating all the commas together, just as they appear.
25304 (opt_dim_separators): Modify accordingly
25305 (rank_specifiers): Update accordingly. Basically do the same
25306 thing - instead, collect the brackets here.
25307 (opt_rank_sepcifiers): Modify accordingly.
25308 (array_type): Modify to actually return the complete type string
25309 instead of ignoring the rank_specifiers.
25310 (expression_list): Implement to collect the expressions
25311 (variable_initializer): Implement. We make it a list of expressions
25312 essentially so that we can handle the array_initializer case neatly too.
25313 (variable_initializer_list): Implement.
25314 (array_initializer): Make it a list of variable_initializers
25315 (opt_array_initializer): Modify accordingly.
25317 * expression.cs (New::NType): Add enumeration to help us
25318 keep track of whether we have an object/delegate creation
25319 or an array creation.
25320 (New:NewType, New::Rank, New::Indices, New::Initializers): New
25321 members to hold data about array creation.
25322 (New:New): Modify to update NewType
25323 (New:New): New Overloaded contructor for the array creation
25326 * cs-parser.jay (array_creation_expression): Implement to call
25327 the overloaded New constructor.
25329 2001-08-26 Ravi Pratap <ravi@che.iitm.ac.in>
25331 * class.cs (TypeContainer::Constructors): Return member
25332 constructors instead of returning null.
25334 2001-08-26 Miguel de Icaza <miguel@ximian.com>
25336 * typemanager.cs (InitCoreTypes): Initialize the various core
25337 types after we have populated the type manager with the user
25338 defined types (this distinction will be important later while
25339 compiling corlib.dll)
25341 * expression.cs, literal.cs, assign.cs, constant.cs: Started work
25342 on Expression Classification. Now all expressions have a method
25343 `Resolve' and a method `Emit'.
25345 * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
25346 generation from working. Also add some temporary debugging
25349 2001-08-24 Miguel de Icaza <miguel@ximian.com>
25351 * codegen.cs: Lots of code generation pieces. This is only the
25352 beginning, will continue tomorrow with more touches of polish. We
25353 handle the fundamentals of if, while, do, for, return. Others are
25354 trickier and I need to start working on invocations soon.
25356 * gen-treedump.cs: Bug fix, use s.Increment here instead of
25359 * codegen.cs (EmitContext): New struct, used during code
25360 emission to keep a context. Most of the code generation will be
25363 * cs-parser.jay: Add embedded blocks to the list of statements of
25364 this block. So code generation proceeds in a top down fashion.
25366 2001-08-23 Miguel de Icaza <miguel@ximian.com>
25368 * statement.cs: Add support for multiple child blocks.
25370 2001-08-22 Miguel de Icaza <miguel@ximian.com>
25372 * codegen.cs (EmitCode): New function, will emit the code for a
25373 Block of code given a TypeContainer and its ILGenerator.
25375 * statement.cs (Block): Standard public readonly optimization.
25376 (Block::Block constructors): Link children.
25377 (Block::Child): Child Linker.
25378 (Block::EmitVariables): Emits IL variable declarations.
25380 * class.cs: Drop support for MethodGroups here, delay until
25382 (Method::): Applied the same simplification that I did before, and
25383 move from Properties to public readonly fields.
25384 (Method::ParameterTypes): Returns the parameter types for the
25385 function, and implements a cache that will be useful later when I
25386 do error checking and the semantic analysis on the methods is
25388 (Constructor::GetCallingConvention): Renamed from CallingConvetion
25389 and made a method, optional argument tells whether this is a class
25390 or a structure to apply the `has-this' bit.
25391 (Method::GetCallingConvention): Implement, returns the calling
25393 (Method::Define): Defines the type, a second pass is performed
25394 later to populate the methods.
25396 (Constructor::ParameterTypes): implement a cache similar to the
25397 one on Method::ParameterTypes, useful later when we do semantic
25400 (TypeContainer::EmitMethod): New method. Emits methods.
25402 * expression.cs: Removed MethodGroup class from here.
25404 * parameter.cs (Parameters::GetCallingConvention): new method.
25406 2001-08-21 Miguel de Icaza <miguel@ximian.com>
25408 * class.cs (TypeContainer::Populate): Drop RootContext from the
25411 (Constructor::CallingConvention): Returns the calling convention.
25412 (Constructor::ParameterTypes): Returns the constructor parameter
25415 (TypeContainer::AddConstructor): Keep track of default constructor
25416 and the default static constructor.
25418 (Constructor::) Another class that starts using `public readonly'
25419 instead of properties.
25421 (Constructor::IsDefault): Whether this is a default constructor.
25423 (Field::) use readonly public fields instead of properties also.
25425 (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
25426 track of static constructors; If none is used, turn on
25427 BeforeFieldInit in the TypeAttributes.
25429 * cs-parser.jay (opt_argument_list): now the return can be null
25430 for the cases where there are no arguments.
25432 (constructor_declarator): If there is no implicit `base' or
25433 `this', then invoke the default parent constructor.
25435 * modifiers.cs (MethodAttr): New static function maps a set of
25436 modifiers flags into a MethodAttributes enum
25437 (FieldAttr): renamed from `Map'. So now we have FieldAttr,
25438 MethodAttr, TypeAttr to represent the various mappings where the
25439 modifiers are used.
25440 (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'
25442 2001-08-19 Miguel de Icaza <miguel@ximian.com>
25444 * parameter.cs (GetParameterInfo): Fix bug where there would be no
25447 * interface.cs (PopulateIndexer): Implemented the code generator
25448 for interface indexers.
25450 2001-08-17 Miguel de Icaza <miguel@ximian.com>
25452 * interface.cs (InterfaceMemberBase): Now we track the new status
25455 (PopulateProperty): Implement property population. Woohoo! Got
25456 Methods and Properties going today.
25458 Removed all the properties for interfaces, and replaced them with
25459 `public readonly' fields.
25461 2001-08-16 Miguel de Icaza <miguel@ximian.com>
25463 * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
25464 initialize their hashtables/arraylists only when they are needed
25465 instead of doing this always.
25467 * parameter.cs: Handle refs and out parameters.
25469 * cs-parser.jay: Use an ArrayList to construct the arguments
25470 instead of the ParameterCollection, and then cast that to a
25473 * parameter.cs: Drop the use of ParameterCollection and use
25474 instead arrays of Parameters.
25476 (GetParameterInfo): Use the Type, not the Name when resolving
25479 2001-08-13 Miguel de Icaza <miguel@ximian.com>
25481 * parameter.cs: Eliminate the properties Name, Type and ModFlags,
25482 and instead use public readonly fields.
25484 * class.cs: Put back walking code for type containers.
25486 2001-08-11 Miguel de Icaza <miguel@ximian.com>
25488 * class.cs (MakeConstant): Code to define constants.
25490 * rootcontext.cs (LookupType): New function. Used to locate types
25493 2001-08-08 Miguel de Icaza <miguel@ximian.com>
25495 * rootcontext.cs: OH MY! My trick works! It is amazing how nice
25496 this System.Reflection code is. Kudos to Microsoft
25498 * typemanager.cs: Implement a type cache and avoid loading all
25499 types at boot time. Wrap in LookupType the internals. This made
25500 the compiler so much faster. Wow. I rule!
25502 * driver.cs: Make sure we always load mscorlib first (for
25503 debugging purposes, nothing really important).
25505 * Renamespaced things that were on `CSC' to `CIR'. Maybe I should
25506 have moved to `CSC' rather than `CIR'. Oh man! The confussion!
25508 * rootcontext.cs: Lookup types on their namespace; Lookup types
25509 on namespaces that have been imported using the `using' keyword.
25511 * class.cs (TypeContainer::TypeAttr): Virtualize.
25512 (Class::TypeAttr): Return attributes suitable for this bad boy.
25513 (Struct::TypeAttr): ditto.
25514 Handle nested classes.
25515 (TypeContainer::) Remove all the type visiting code, it is now
25516 replaced with the rootcontext.cs code
25518 * rootcontext.cs (GetClassBases): Added support for structs.
25520 2001-08-06 Miguel de Icaza <miguel@ximian.com>
25522 * interface.cs, statement.cs, class.cs, parameter.cs,
25523 rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
25524 Drop use of TypeRefs, and use strings instead.
25526 2001-08-04 Miguel de Icaza <miguel@ximian.com>
25530 * class.cs (Struct::Struct): set the SEALED flags after
25531 checking the modifiers.
25532 (TypeContainer::TypeAttr): new property, returns the
25533 TypeAttributes for a class.
25535 * cs-parser.jay (type_list): Oops, list production was creating a
25536 new list of base types.
25538 * rootcontext.cs (StdLib): New property.
25539 (GetInterfaceTypeByName): returns an interface by type name, and
25540 encapsulates error handling here.
25541 (GetInterfaces): simplified.
25542 (ResolveTree): Encapsulated all the tree resolution here.
25543 (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
25546 * driver.cs: Add support for --nostdlib, to avoid loading the
25547 default assemblies.
25548 (Main): Do not put tree resolution here.
25550 * rootcontext.cs: Beginning of the class resolution.
25552 2001-08-03 Miguel de Icaza <miguel@ximian.com>
25554 * rootcontext.cs: Provide better error reporting.
25556 * cs-parser.jay (interface_base): set our $$ to be interfaces.
25558 * rootcontext.cs (CreateInterface): Handle the case where there
25559 are no parent interfaces.
25561 (CloseTypes): Routine to flush types at the end.
25562 (CreateInterface): Track types.
25563 (GetInterfaces): Returns an array of Types from the list of
25564 defined interfaces.
25566 * typemanager.c (AddUserType): Mechanism to track user types (puts
25567 the type on the global type hash, and allows us to close it at the
25570 2001-08-02 Miguel de Icaza <miguel@ximian.com>
25572 * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25573 RecordInterface instead.
25575 * cs-parser.jay: Updated to reflect changes above.
25577 * decl.cs (Definition): Keep track of the TypeBuilder type that
25578 represents this type here. Not sure we will use it in the long
25579 run, but wont hurt for now.
25581 * driver.cs: Smaller changes to accomodate the new code.
25583 Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25586 * rootcontext.cs (CreateInterface): New method, used to create
25587 the System.TypeBuilder type for interfaces.
25588 (ResolveInterfaces): new entry point to resolve the interface
25590 (CodeGen): Property, used to keep track of the code generator.
25592 2001-07-26 Miguel de Icaza <miguel@ximian.com>
25594 * cs-parser.jay: Add a second production for delegate_declaration
25597 (enum_body): Put an opt_comma here instead of putting it on
25598 enum_body or enum_member_declarations so we can handle trailing
25599 commas on enumeration members. Gets rid of a shift/reduce.
25601 (type_list): Need a COMMA in the middle.
25603 (indexer_declaration): Tell tokenizer to recognize get/set
25605 * Remove old targets.
25607 * Re-add the parser target.
25609 2001-07-13 Simon Cozens <simon@simon-cozens.org>
25611 * cs-parser.jay: Add precendence rules for a number of operators
25612 ot reduce the number of shift/reduce conflicts in the grammar.
25614 2001-07-17 Miguel de Icaza <miguel@ximian.com>
25616 * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25619 Get rid of old crufty code.
25621 * rootcontext.cs: Use this to keep track of the parsed
25622 representation and the defined types available to the program.
25624 * gen-treedump.cs: adjust for new convention.
25626 * type.cs: Split out the type manager, and the assembly builder
25629 * typemanager.cs: the type manager will live here now.
25631 * cil-codegen.cs: And the code generator here.
25633 2001-07-14 Sean MacIsaac <macisaac@ximian.com>
25635 * makefile: Fixed up for easy making.
25637 2001-07-13 Simon Cozens <simon@simon-cozens.org>
25639 * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25642 (unary_expression): Expand pre_increment_expression and
25643 post_decrement_expression to reduce a shift/reduce.
25645 2001-07-11 Simon Cozens
25647 * cs-tokenizer.cs: Hex numbers should begin with a 0.
25649 Improve allow_keyword_as_indent name.
25651 2001-06-19 Miguel de Icaza <miguel@ximian.com>
25653 * Adjustments for Beta2.
25655 2001-06-13 Miguel de Icaza <miguel@ximian.com>
25657 * decl.cs: Added `Define' abstract method.
25658 (InTransit): new property, used to catch recursive definitions.
25660 * interface.cs: Implement `Define'.
25662 * modifiers.cs: Map Modifiers.constants to
25663 System.Reflection.TypeAttribute flags.
25665 * class.cs: Keep track of types and user-defined types.
25666 (BuilderInit): New method for creating an assembly
25667 (ResolveType): New function to launch the resolution process, only
25668 used by interfaces for now.
25670 * cs-parser.jay: Keep track of Classes, Structs and Interfaces
25671 that are inserted into the name space.
25673 2001-06-08 Miguel de Icaza <miguel@ximian.com>
25675 * ARGH. I have screwed up my tree so many times due to the use of
25676 rsync rather than using CVS. Going to fix this at once.
25678 * driver.cs: Objetify driver. Load assemblies, use assemblies to
25681 2001-06-07 Miguel de Icaza <miguel@ximian.com>
25683 * Experiment successful: Use System.Type rather that our own
25686 2001-05-25 Miguel de Icaza <miguel@ximian.com>
25688 * cs-parser.jay: Removed nsAliases from here.
25690 Use new namespaces, handle `using XXX;'
25692 * namespace.cs: Reimplemented namespace handling, use a recursive
25693 definition of the class. Now we can keep track of using clauses
25694 and catch invalid using clauses.
25696 2001-05-24 Miguel de Icaza <miguel@ximian.com>
25698 * gen-treedump.cs: Adapted for all the renaming.
25700 * expression.cs (Expression): this class now has a Type property
25701 which returns an expression Type.
25703 (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25704 `Type', as this has a different meaning now in the base
25706 2001-05-22 Miguel de Icaza <miguel@ximian.com>
25708 * interface.cs, class.cs: Removed from all the sources the
25709 references to signature computation, as we can not do method
25710 signature computation during the parsing time, as we are not
25711 trying to solve at that point distinguishing:
25715 void a (NS.Blah x) {}
25718 Which depending on the context might be valid or not, as we do not
25719 know if Blah is the same thing as NS.Blah at that point.
25721 * Redid everything so the code uses TypeRefs now instead of
25722 Types. TypeRefs are just temporary type placeholders, that need
25723 to be resolved. They initially have a pointer to a string and the
25724 current scope in which they are used. This is used later by the
25725 compiler to resolve the reference to an actual Type.
25727 * DeclSpace is no longer a CIR.Type, and neither are
25728 TypeContainers (Class and Struct) nor Interfaces nor Enums. They
25729 are all DeclSpaces, but no Types.
25731 * type.cs (TypeRefManager): This implements the TypeRef manager,
25732 which keeps track of all the types that need to be resolved after
25733 the parsing has finished.
25735 2001-05-13 Miguel de Icaza <miguel@ximian.com>
25737 * ARGH. We are going to have to store `foreach' as a class rather
25738 than resolving it, as we need to verify error 1579 after name
25739 resolution. *OR* we could keep a flag that says `This request to
25740 IEnumerator comes from a foreach statement' which we can then use
25741 to generate the error.
25743 2001-05-10 Miguel de Icaza <miguel@ximian.com>
25745 * class.cs (TypeContainer.AddMethod): we now add methods to the
25746 MethodGroup instead of the method hashtable.
25748 * expression.cs: Add MethodGroup abstraction, which gets us one
25749 step closer to the specification in the way we handle method
25752 * cs-parser.jay (primary_expression): qualified_identifier now
25753 tried to match up an identifier to a local variable reference or
25754 to a parameter reference.
25756 current_local_parameters is now a parser global variable that
25757 points to the current parameters for the block, used during name
25760 (property_declaration): Now creates an implicit `value' argument to
25763 2001-05-09 Miguel de Icaza <miguel@ximian.com>
25765 * parameter.cs: Do not use `param' arguments as part of the
25766 signature, per the spec.
25768 2001-05-08 Miguel de Icaza <miguel@ximian.com>
25770 * decl.cs: Base class for classes, structs and interfaces. This
25771 is the "Declaration Space"
25773 * cs-parser.jay: Use CheckDef for checking declaration errors
25774 instead of having one on each function.
25776 * class.cs: Factor out some code for handling error handling in
25777 accordance to the "Declarations" section in the "Basic Concepts"
25778 chapter in the ECMA C# spec.
25780 * interface.cs: Make all interface member classes derive from
25781 InterfaceMemberBase.
25783 2001-05-07 Miguel de Icaza <miguel@ximian.com>
25785 * Many things: all interfaces are parsed and generated in
25786 gen-treedump. Support for member variables, constructors,
25787 destructors, properties, constants is there.
25789 Beginning of the IL backend, but very little done, just there for
25792 2001-04-29 Miguel de Icaza <miguel@ximian.com>
25794 * cs-parser.jay: Fix labeled statement.
25796 * cs-tokenizer.cs (escape): Escape " and ' always.
25797 ref_line, ref_name: keep track of the line/filename as instructed
25798 by #line by the compiler.
25801 2001-04-27 Miguel de Icaza <miguel@ximian.com>
25803 * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25804 to match the values in System.CodeDOM.
25806 Divid renamed to Divide.
25808 * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25810 (Statements.set): remove.
25812 * System.CodeDOM/CodeCatchClause.cs: always have a valid
25815 * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25816 falseStatements always have valid values.
25818 * cs-parser.jay: Use System.CodeDOM now.